/*! * DevExtreme (dx.all.debug.js) * Version: 24.1.6 * Build date: Sat Sep 14 2024 * * Copyright (c) 2012 - 2024 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ "use strict"; ! function() { var __webpack_modules__ = { 81589: /*!****************************************************************************!*\ !*** ../../node_modules/@devextreme/runtime/cjs/inferno/base_component.js ***! \****************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { var __extends = this && this.__extends || (extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) { d.__proto__ = b } || function(d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p] } } }; return extendStatics(d, b) }, function(d, b) { if ("function" !== typeof b && null !== b) { throw new TypeError("Class extends value " + String(b) + " is not a constructor or null") } extendStatics(d, b); function __() { this.constructor = d } d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __) }); var extendStatics; Object.defineProperty(exports, "__esModule", { value: true }); exports.InfernoWrapperComponent = exports.InfernoComponent = exports.BaseInfernoComponent = void 0; var inferno_1 = __webpack_require__( /*! inferno */ 65414); var effect_host_1 = __webpack_require__( /*! ./effect_host */ 53213); var areObjectsEqual = function(firstObject, secondObject) { var bothAreObjects = firstObject instanceof Object && secondObject instanceof Object; if (!bothAreObjects) { return firstObject === secondObject } var firstObjectKeys = Object.keys(firstObject); var secondObjectKeys = Object.keys(secondObject); if (firstObjectKeys.length !== secondObjectKeys.length) { return false } var hasDifferentElement = firstObjectKeys.some((function(key) { return firstObject[key] !== secondObject[key] })); return !hasDifferentElement }; var BaseInfernoComponent = function(_super) { __extends(BaseInfernoComponent, _super); function BaseInfernoComponent() { var _this = null !== _super && _super.apply(this, arguments) || this; _this._pendingContext = _this.context; return _this } BaseInfernoComponent.prototype.componentWillReceiveProps = function(_, context) { this._pendingContext = null !== context && void 0 !== context ? context : {} }; BaseInfernoComponent.prototype.shouldComponentUpdate = function(nextProps, nextState) { return !areObjectsEqual(this.props, nextProps) || !areObjectsEqual(this.state, nextState) || !areObjectsEqual(this.context, this._pendingContext) }; return BaseInfernoComponent }(inferno_1.Component); exports.BaseInfernoComponent = BaseInfernoComponent; var InfernoComponent = function(_super) { __extends(InfernoComponent, _super); function InfernoComponent() { var _this = null !== _super && _super.apply(this, arguments) || this; _this._effects = []; return _this } InfernoComponent.prototype.createEffects = function() { return [] }; InfernoComponent.prototype.updateEffects = function() {}; InfernoComponent.prototype.componentWillMount = function() { effect_host_1.InfernoEffectHost.lock() }; InfernoComponent.prototype.componentWillUpdate = function(_nextProps, _nextState, _context) { effect_host_1.InfernoEffectHost.lock() }; InfernoComponent.prototype.componentDidMount = function() { var _this = this; effect_host_1.InfernoEffectHost.callbacks.push((function() { _this._effects = _this.createEffects() })); effect_host_1.InfernoEffectHost.callEffects() }; InfernoComponent.prototype.componentDidUpdate = function() { var _this = this; effect_host_1.InfernoEffectHost.callbacks.push((function() { return _this.updateEffects() })); effect_host_1.InfernoEffectHost.callEffects() }; InfernoComponent.prototype.destroyEffects = function() { this._effects.forEach((function(e) { return e.dispose() })) }; InfernoComponent.prototype.componentWillUnmount = function() { this.destroyEffects() }; return InfernoComponent }(BaseInfernoComponent); exports.InfernoComponent = InfernoComponent; var InfernoWrapperComponent = function(_super) { __extends(InfernoWrapperComponent, _super); function InfernoWrapperComponent() { var _this = null !== _super && _super.apply(this, arguments) || this; _this.vDomElement = null; return _this } InfernoWrapperComponent.prototype.vDomUpdateClasses = function() { var el = this.vDomElement; var currentClasses = el.className.length ? el.className.split(" ") : []; var addedClasses = currentClasses.filter((function(className) { return el.dxClasses.previous.indexOf(className) < 0 })); var removedClasses = el.dxClasses.previous.filter((function(className) { return currentClasses.indexOf(className) < 0 })); addedClasses.forEach((function(value) { var indexInRemoved = el.dxClasses.removed.indexOf(value); if (indexInRemoved > -1) { el.dxClasses.removed.splice(indexInRemoved, 1) } else if (!el.dxClasses.added.includes(value)) { el.dxClasses.added.push(value) } })); removedClasses.forEach((function(value) { var indexInAdded = el.dxClasses.added.indexOf(value); if (indexInAdded > -1) { el.dxClasses.added.splice(indexInAdded, 1) } else if (!el.dxClasses.removed.includes(value)) { el.dxClasses.removed.push(value) } })) }; InfernoWrapperComponent.prototype.componentDidMount = function() { var el = inferno_1.findDOMfromVNode(this.$LI, true); this.vDomElement = el; _super.prototype.componentDidMount.call(this); el.dxClasses = el.dxClasses || { removed: [], added: [], previous: [] }; el.dxClasses.previous = (null === el || void 0 === el ? void 0 : el.className.length) ? el.className.split(" ") : [] }; InfernoWrapperComponent.prototype.componentDidUpdate = function() { _super.prototype.componentDidUpdate.call(this); var el = this.vDomElement; if (null !== el) { el.dxClasses.added.forEach((function(className) { return el.classList.add(className) })); el.dxClasses.removed.forEach((function(className) { return el.classList.remove(className) })); el.dxClasses.previous = el.className.length ? el.className.split(" ") : [] } }; InfernoWrapperComponent.prototype.shouldComponentUpdate = function(nextProps, nextState) { var shouldUpdate = _super.prototype.shouldComponentUpdate.call(this, nextProps, nextState); if (shouldUpdate) { this.vDomUpdateClasses() } return shouldUpdate }; return InfernoWrapperComponent }(InfernoComponent); exports.InfernoWrapperComponent = InfernoWrapperComponent }, 61080: /*!****************************************************************************!*\ !*** ../../node_modules/@devextreme/runtime/cjs/inferno/create_context.js ***! \****************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { var __extends = this && this.__extends || (extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) { d.__proto__ = b } || function(d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p] } } }; return extendStatics(d, b) }, function(d, b) { if ("function" !== typeof b && null !== b) { throw new TypeError("Class extends value " + String(b) + " is not a constructor or null") } extendStatics(d, b); function __() { this.constructor = d } d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __) }); var extendStatics; var __assign = this && this.__assign || function() { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p)) { t[p] = s[p] } } } return t }; return __assign.apply(this, arguments) }; Object.defineProperty(exports, "__esModule", { value: true }); exports.createContext = void 0; var inferno_1 = __webpack_require__( /*! inferno */ 65414); var contextId = 0; exports.createContext = function(defaultValue) { var id = contextId++; return { id: id, defaultValue: defaultValue, Provider: function(_super) { __extends(class_1, _super); function class_1() { return null !== _super && _super.apply(this, arguments) || this } class_1.prototype.getChildContext = function() { var _a; return __assign(__assign({}, this.context), (_a = {}, _a[id] = this.props.value || defaultValue, _a)) }; class_1.prototype.render = function() { return this.props.children }; return class_1 }(inferno_1.Component) } } }, 43956: /*!********************************************************************!*\ !*** ../../node_modules/@devextreme/runtime/cjs/inferno/effect.js ***! \********************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.InfernoEffect = void 0; var InfernoEffect = function() { function InfernoEffect(effect, dependency) { this.dependency = dependency; this.effect = effect; this.destroy = effect() } InfernoEffect.prototype.update = function(dependency) { var currentDependency = this.dependency; if (dependency) { this.dependency = dependency } if (!dependency || dependency.some((function(d, i) { return currentDependency[i] !== d }))) { this.dispose(); this.destroy = this.effect() } }; InfernoEffect.prototype.dispose = function() { if (this.destroy) { this.destroy() } }; return InfernoEffect }(); exports.InfernoEffect = InfernoEffect }, 53213: /*!*************************************************************************!*\ !*** ../../node_modules/@devextreme/runtime/cjs/inferno/effect_host.js ***! \*************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.InfernoEffectHost = void 0; exports.InfernoEffectHost = { lockCount: 0, lock: function() { this.lockCount++ }, callbacks: [], callEffects: function() { this.lockCount--; if (this.lockCount < 0) { throw new Error("Unexpected Effect Call") } if (0 === this.lockCount) { var effects = this.callbacks; this.callbacks = []; effects.forEach((function(callback) { return callback() })) } } } }, 74219: /*!*******************************************************************!*\ !*** ../../node_modules/@devextreme/runtime/cjs/inferno/index.js ***! \*******************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) { if (void 0 === k2) { k2 = k } Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k] } }) } : function(o, m, k, k2) { if (void 0 === k2) { k2 = k } o[k2] = m[k] }); var __exportStar = this && this.__exportStar || function(m, exports) { for (var p in m) { if ("default" !== p && !Object.prototype.hasOwnProperty.call(exports, p)) { __createBinding(exports, m, p) } } }; Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(__webpack_require__( /*! ./base_component */ 81589), exports); __exportStar(__webpack_require__( /*! ./create_context */ 61080), exports); __exportStar(__webpack_require__( /*! ./effect */ 43956), exports); __exportStar(__webpack_require__( /*! ./effect_host */ 53213), exports); __exportStar(__webpack_require__( /*! ./portal */ 53159), exports); __exportStar(__webpack_require__( /*! ./ref_object */ 86687), exports); __exportStar(__webpack_require__( /*! ./re_render_effect */ 31620), exports); __exportStar(__webpack_require__( /*! ./mocked/hydrate */ 67604), exports); __exportStar(__webpack_require__( /*! ./render_template */ 32423), exports); __exportStar(__webpack_require__( /*! ./normalize_styles */ 73084), exports) }, 67604: /*!****************************************************************************!*\ !*** ../../node_modules/@devextreme/runtime/cjs/inferno/mocked/hydrate.js ***! \****************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.hydrate = void 0; var inferno_1 = __webpack_require__( /*! inferno */ 65414); var shared_1 = __webpack_require__( /*! ./shared */ 45786); function isSamePropsInnerHTML(dom, props) { return Boolean(props && props.dangerouslySetInnerHTML && props.dangerouslySetInnerHTML.__html && function(dom, innerHTML) { var tempdom = document.createElement("i"); tempdom.innerHTML = innerHTML; return tempdom.innerHTML === dom.innerHTML }(dom, props.dangerouslySetInnerHTML.__html)) } function hydrateChildren(parentVNode, parentNode, currentNode, context, isSVG, lifecycle) { var childFlags = parentVNode.childFlags; var children = parentVNode.children; var props = parentVNode.props; var flags = parentVNode.flags; if (1 !== childFlags) { if (2 === childFlags) { if (shared_1.isNull(currentNode)) { inferno_1._M(children, parentNode, context, isSVG, null, lifecycle) } else { currentNode = hydrateVNode(children, parentNode, currentNode, context, isSVG, lifecycle); currentNode = currentNode ? currentNode.nextSibling : null } } else if (16 === childFlags) { if (shared_1.isNull(currentNode)) { parentNode.appendChild(document.createTextNode(children)) } else if (1 !== parentNode.childNodes.length || 3 !== currentNode.nodeType) { parentNode.textContent = children } else if (currentNode.nodeValue !== children) { currentNode.nodeValue = children } currentNode = null } else if (12 & childFlags) { var prevVNodeIsTextNode = false; for (var i = 0, len = children.length; i < len; ++i) { var child = children[i]; if (shared_1.isNull(currentNode) || prevVNodeIsTextNode && (16 & child.flags) > 0) { inferno_1._M(child, parentNode, context, isSVG, currentNode, lifecycle) } else { currentNode = hydrateVNode(child, parentNode, currentNode, context, isSVG, lifecycle); currentNode = currentNode ? currentNode.nextSibling : null } prevVNodeIsTextNode = (16 & child.flags) > 0 } } if (0 === (8192 & flags)) { var nextSibling = null; while (currentNode) { nextSibling = currentNode.nextSibling; parentNode.removeChild(currentNode); currentNode = nextSibling } } } else if (!shared_1.isNull(parentNode.firstChild) && !isSamePropsInnerHTML(parentNode, props)) { parentNode.textContent = ""; if (448 & flags) { parentNode.defaultValue = "" } } } function hydrateText(vNode, parentDOM, dom) { if (3 !== dom.nodeType) { parentDOM.replaceChild(vNode.dom = document.createTextNode(vNode.children), dom) } else { var text = vNode.children; if (dom.nodeValue !== text) { dom.nodeValue = text } vNode.dom = dom } return vNode.dom } function hydrateVNode(vNode, parentDOM, currentDom, context, isSVG, lifecycle) { var flags = vNode.flags |= 16384; if (14 & flags) { return function(vNode, parentDOM, dom, context, isSVG, isClass, lifecycle) { var type = vNode.type; var ref = vNode.ref; var props = vNode.props || inferno_1.EMPTY_OBJ; var currentNode; if (isClass) { var instance = inferno_1._CI(vNode, type, props, context, isSVG, lifecycle); var input = instance.$LI; currentNode = hydrateVNode(input, parentDOM, dom, instance.$CX, isSVG, lifecycle); inferno_1._MCCC(ref, instance, lifecycle) } else { input = inferno_1._HI(inferno_1._RFC(vNode, context)); currentNode = hydrateVNode(input, parentDOM, dom, context, isSVG, lifecycle); vNode.children = input; inferno_1._MFCC(vNode, lifecycle) } return currentNode }(vNode, parentDOM, currentDom, context, isSVG, (4 & flags) > 0, lifecycle) } if (481 & flags) { return function(vNode, parentDOM, dom, context, isSVG, lifecycle) { var props = vNode.props; var className = vNode.className; var flags = vNode.flags; var ref = vNode.ref; isSVG = isSVG || (32 & flags) > 0; if (1 !== dom.nodeType) { inferno_1._ME(vNode, null, context, isSVG, null, lifecycle); parentDOM.replaceChild(vNode.dom, dom) } else { vNode.dom = dom; hydrateChildren(vNode, dom, dom.firstChild, context, isSVG, lifecycle); if (!shared_1.isNull(props)) { inferno_1._MP(vNode, flags, props, dom, isSVG) } if (shared_1.isNullOrUndef(className)) { if ("" !== dom.className) { dom.removeAttribute("class") } } else if (isSVG) { dom.setAttribute("class", className) } else { dom.className = className } inferno_1._MR(ref, dom, lifecycle) } return vNode.dom }(vNode, parentDOM, currentDom, context, isSVG, lifecycle) } if (16 & flags) { return hydrateText(vNode, parentDOM, currentDom) } if (512 & flags) { return vNode.dom = currentDom } if (8192 & flags) { return function(vNode, parentDOM, dom, context, isSVG, lifecycle) { var children = vNode.children; if (2 === vNode.childFlags) { hydrateText(children, parentDOM, dom); return children.dom } hydrateChildren(vNode, parentDOM, dom, context, isSVG, lifecycle); return function(vNode) { var flags; var children; while (vNode) { flags = vNode.flags; if (2033 & flags) { return vNode.dom } children = vNode.children; if (8192 & flags) { vNode = 2 === vNode.childFlags ? children : children[children.length - 1] } else if (4 & flags) { vNode = children.$LI } else { vNode = children } } return null }(children[children.length - 1]) }(vNode, parentDOM, currentDom, context, isSVG, lifecycle) } shared_1.throwError(); return null } exports.hydrate = function(input, parentDOM, callback) { var dom = parentDOM.firstChild; if (shared_1.isNull(dom)) { inferno_1.render(input, parentDOM, callback) } else { var lifecycle = []; if (!shared_1.isInvalid(input)) { dom = hydrateVNode(input, parentDOM, dom, {}, false, lifecycle) } while (dom && (dom = dom.nextSibling)) { parentDOM.removeChild(dom) } if (lifecycle.length > 0) { var listener = void 0; while (void 0 !== (listener = lifecycle.shift())) { listener() } } } parentDOM.$V = input; if (shared_1.isFunction(callback)) { callback() } } }, 45786: /*!***************************************************************************!*\ !*** ../../node_modules/@devextreme/runtime/cjs/inferno/mocked/shared.js ***! \***************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.throwError = exports.isNull = exports.isFunction = exports.isInvalid = exports.isNullOrUndef = exports.ERROR_MSG = void 0; exports.ERROR_MSG = "a runtime error occured! Use Inferno in development environment to find the error."; exports.isNullOrUndef = function(o) { return void 0 === o || null === o }; exports.isInvalid = function(o) { return null === o || false === o || true === o || void 0 === o }; exports.isFunction = function(o) { return "function" === typeof o }; exports.isNull = function(o) { return null === o }; exports.throwError = function(message) { if (!message) { message = exports.ERROR_MSG } throw new Error("Inferno Error: " + message) } }, 73084: /*!******************************************************************************!*\ !*** ../../node_modules/@devextreme/runtime/cjs/inferno/normalize_styles.js ***! \******************************************************************************/ function(__unused_webpack_module, exports) { var __read = this && this.__read || function(o, n) { var m = "function" === typeof Symbol && o[Symbol.iterator]; if (!m) { return o } var r, e, i = m.call(o), ar = []; try { while ((void 0 === n || n-- > 0) && !(r = i.next()).done) { ar.push(r.value) } } catch (error) { e = { error: error } } finally { try { if (r && !r.done && (m = i.return)) { m.call(i) } } finally { if (e) { throw e.error } } } return ar }; Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeStyles = void 0; var NUMBER_STYLES = new Set(["animationIterationCount", "borderImageOutset", "borderImageSlice", "border-imageWidth", "boxFlex", "boxFlexGroup", "boxOrdinalGroup", "columnCount", "fillOpacity", "flex", "flexGrow", "flexNegative", "flexOrder", "flexPositive", "flexShrink", "floodOpacity", "fontWeight", "gridColumn", "gridRow", "lineClamp", "lineHeight", "opacity", "order", "orphans", "stopOpacity", "strokeDasharray", "strokeDashoffset", "strokeMiterlimit", "strokeOpacity", "strokeWidth", "tabSize", "widows", "zIndex", "zoom"]); var uppercasePattern = /[A-Z]/g; exports.normalizeStyles = function(styles) { if (!(styles instanceof Object)) { return } return Object.entries(styles).reduce((function(acc, _a) { var _b = __read(_a, 2), key = _b[0], value = _b[1]; acc[(str = key, str.replace(uppercasePattern, "-$&").toLowerCase())] = function(value) { if ("number" === typeof value) { return true } return !Number.isNaN(Number(value)) }(value) ? function(style, value) { return NUMBER_STYLES.has(style) ? value : value + "px" }(key, value) : value; var str; return acc }), {}) } }, 53159: /*!********************************************************************!*\ !*** ../../node_modules/@devextreme/runtime/cjs/inferno/portal.js ***! \********************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.Portal = void 0; var inferno_1 = __webpack_require__( /*! inferno */ 65414); exports.Portal = function(_a) { var container = _a.container, children = _a.children; if (container) { return inferno_1.createPortal(children, container) } return null } }, 31620: /*!******************************************************************************!*\ !*** ../../node_modules/@devextreme/runtime/cjs/inferno/re_render_effect.js ***! \******************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.createReRenderEffect = void 0; var inferno_1 = __webpack_require__( /*! inferno */ 65414); var effect_1 = __webpack_require__( /*! ./effect */ 43956); exports.createReRenderEffect = function() { return new effect_1.InfernoEffect((function() { inferno_1.rerender() }), []) } }, 86687: /*!************************************************************************!*\ !*** ../../node_modules/@devextreme/runtime/cjs/inferno/ref_object.js ***! \************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }) }, 32423: /*!*****************************************************************************!*\ !*** ../../node_modules/@devextreme/runtime/cjs/inferno/render_template.js ***! \*****************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.hasTemplate = exports.renderTemplate = void 0; var inferno_1 = __webpack_require__( /*! inferno */ 65414); var inferno_create_element_1 = __webpack_require__( /*! inferno-create-element */ 99038); exports.renderTemplate = function(template, props, _component) { setTimeout((function() { inferno_1.render(inferno_create_element_1.createElement(template, props), function(props) { var _a, _b; return (null === (_a = props.container) || void 0 === _a ? void 0 : _a.get(0)) || (null === (_b = props.item) || void 0 === _b ? void 0 : _b.get(0)) }(props)) }), 0) }; exports.hasTemplate = function(name, properties, _component) { var value = properties[name]; return !!value && "string" !== typeof value } }, 99038: /*!*******************************************************************!*\ !*** ../../node_modules/inferno-create-element/dist/index.esm.js ***! \*******************************************************************/ function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, { createElement: function() { return createElement } }); var inferno__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( /*! inferno */ 65414); function isNullOrUndef(o) { return void 0 === o || null === o } function isUndefined(o) { return void 0 === o } var componentHooks = { onComponentDidMount: 1, onComponentDidUpdate: 1, onComponentShouldUpdate: 1, onComponentWillMount: 1, onComponentWillUnmount: 1, onComponentWillUpdate: 1 }; function createElement(type, props, _children) { var arguments$1 = arguments; var children; var ref = null; var key = null; var className = null; var flags = 0; var newProps; var childLen = arguments.length - 2; if (1 === childLen) { children = _children } else if (childLen > 1) { children = []; while (childLen-- > 0) { children[childLen] = arguments$1[childLen + 2] } } if (o = type, "string" === typeof o) { flags = (0, inferno__WEBPACK_IMPORTED_MODULE_0__.getFlagsForElementVnode)(type); if (!isNullOrUndef(props)) { newProps = {}; for (var prop in props) { if ("className" === prop || "class" === prop) { className = props[prop] } else if ("key" === prop) { key = props.key } else if ("children" === prop && isUndefined(children)) { children = props.children } else if ("ref" === prop) { ref = props.ref } else { if ("contenteditable" === prop) { flags |= 4096 } newProps[prop] = props[prop] } } } } else { flags = 2; if (!isUndefined(children)) { if (!props) { props = {} } props.children = children } if (!isNullOrUndef(props)) { newProps = {}; for (var prop$1 in props) { if ("key" === prop$1) { key = props.key } else if ("ref" === prop$1) { ref = props.ref } else if (1 === componentHooks[prop$1]) { if (!ref) { ref = {} } ref[prop$1] = props[prop$1] } else { newProps[prop$1] = props[prop$1] } } } return (0, inferno__WEBPACK_IMPORTED_MODULE_0__.createComponentVNode)(flags, type, newProps, key, ref) } var o; if (8192 & flags) { return (0, inferno__WEBPACK_IMPORTED_MODULE_0__.createFragment)(1 === childLen ? [children] : children, 0, key) } return (0, inferno__WEBPACK_IMPORTED_MODULE_0__.createVNode)(flags, type, className, children, 0, newProps, key, ref) } }, 65414: /*!***********************************************************!*\ !*** ../../node_modules/inferno/index.esm.js + 1 modules ***! \***********************************************************/ function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, { Component: function() { return Component }, EMPTY_OBJ: function() { return EMPTY_OBJ }, Fragment: function() { return Fragment }, _CI: function() { return createClassComponentInstance }, _HI: function() { return normalizeRoot }, _M: function() { return mount }, _MCCC: function() { return mountClassComponentCallbacks }, _ME: function() { return mountElement }, _MFCC: function() { return mountFunctionalComponentCallbacks }, _MP: function() { return mountProps }, _MR: function() { return mountRef }, _RFC: function() { return renderFunctionalComponent }, __render: function() { return __render }, createComponentVNode: function() { return createComponentVNode }, createFragment: function() { return createFragment }, createPortal: function() { return createPortal }, createRef: function() { return createRef }, createRenderer: function() { return createRenderer }, createTextVNode: function() { return createTextVNode }, createVNode: function() { return createVNode }, directClone: function() { return directClone }, findDOMfromVNode: function() { return findDOMfromVNode }, forwardRef: function() { return forwardRef }, getFlagsForElementVnode: function() { return getFlagsForElementVnode }, linkEvent: function() { return linkEvent }, normalizeProps: function() { return normalizeProps }, options: function() { return options }, render: function() { return render }, rerender: function() { return rerender }, version: function() { return version } }); var isArray = Array.isArray; function isStringOrNumber(o) { var type = typeof o; return "string" === type || "number" === type } function isNullOrUndef(o) { return void 0 === o || null === o } function isInvalid(o) { return null === o || false === o || true === o || void 0 === o } function isFunction(o) { return "function" === typeof o } function isString(o) { return "string" === typeof o } function isNull(o) { return null === o } function combineFrom(first, second) { var out = {}; if (first) { for (var key in first) { out[key] = first[key] } } if (second) { for (var key$1 in second) { out[key$1] = second[key$1] } } return out } function linkEvent(data, event) { if (isFunction(event)) { return { data: data, event: event } } return null } function isLinkEventObject(o) { return !isNull(o) && "object" === typeof o } var EMPTY_OBJ = {}; var Fragment = "$F"; function normalizeEventName(name) { return name.substr(2).toLowerCase() } function appendChild(parentDOM, dom) { parentDOM.appendChild(dom) } function insertOrAppend(parentDOM, newNode, nextNode) { if (isNull(nextNode)) { appendChild(parentDOM, newNode) } else { parentDOM.insertBefore(newNode, nextNode) } } function removeChild(parentDOM, childNode) { parentDOM.removeChild(childNode) } function callAll(arrayFn) { for (var i = 0; i < arrayFn.length; i++) { arrayFn[i]() } } function findChildVNode(vNode, startEdge, flags) { var children = vNode.children; if (4 & flags) { return children.$LI } if (8192 & flags) { return 2 === vNode.childFlags ? children : children[startEdge ? 0 : children.length - 1] } return children } function findDOMfromVNode(vNode, startEdge) { var flags; while (vNode) { flags = vNode.flags; if (2033 & flags) { return vNode.dom } vNode = findChildVNode(vNode, startEdge, flags) } return null } function removeVNodeDOM(vNode, parentDOM) { do { var flags = vNode.flags; if (2033 & flags) { removeChild(parentDOM, vNode.dom); return } var children = vNode.children; if (4 & flags) { vNode = children.$LI } if (8 & flags) { vNode = children } if (8192 & flags) { if (2 === vNode.childFlags) { vNode = children } else { for (var i = 0, len = children.length; i < len; ++i) { removeVNodeDOM(children[i], parentDOM) } return } } } while (vNode) } function moveVNodeDOM(vNode, parentDOM, nextNode) { do { var flags = vNode.flags; if (2033 & flags) { insertOrAppend(parentDOM, vNode.dom, nextNode); return } var children = vNode.children; if (4 & flags) { vNode = children.$LI } if (8 & flags) { vNode = children } if (8192 & flags) { if (2 === vNode.childFlags) { vNode = children } else { for (var i = 0, len = children.length; i < len; ++i) { moveVNodeDOM(children[i], parentDOM, nextNode) } return } } } while (vNode) } function createDerivedState(instance, nextProps, state) { if (instance.constructor.getDerivedStateFromProps) { return combineFrom(state, instance.constructor.getDerivedStateFromProps(nextProps, state)) } return state } var renderCheck = { v: false }; var options = { componentComparator: null, createVNode: null, renderComplete: null }; function setTextContent(dom, children) { dom.textContent = children } function isLastValueSameLinkEvent(lastValue, nextValue) { return isLinkEventObject(lastValue) && lastValue.event === nextValue.event && lastValue.data === nextValue.data } function mergeUnsetProperties(to, from) { for (var propName in from) { if (o = to[propName], void 0 === o) { to[propName] = from[propName] } } var o; return to } function safeCall1(method, arg1) { return !!isFunction(method) && (method(arg1), true) } var keyPrefix = "$"; function V(childFlags, children, className, flags, key, props, ref, type) { this.childFlags = childFlags; this.children = children; this.className = className; this.dom = null; this.flags = flags; this.key = void 0 === key ? null : key; this.props = void 0 === props ? null : props; this.ref = void 0 === ref ? null : ref; this.type = type } function createVNode(flags, type, className, children, childFlags, props, key, ref) { var childFlag = void 0 === childFlags ? 1 : childFlags; var vNode = new V(childFlag, children, className, flags, key, props, ref, type); if (options.createVNode) { options.createVNode(vNode) } if (0 === childFlag) { normalizeChildren(vNode, vNode.children) } return vNode } function createComponentVNode(flags, type, props, key, ref) { flags = function(flags, type) { if (12 & flags) { return flags } if (type.prototype && type.prototype.render) { return 4 } if (type.render) { return 32776 } return 8 }(flags, type); var vNode = new V(1, null, null, flags, key, function(flags, type, props) { var defaultProps = (32768 & flags ? type.render : type).defaultProps; if (isNullOrUndef(defaultProps)) { return props } if (isNullOrUndef(props)) { return combineFrom(defaultProps, null) } return mergeUnsetProperties(props, defaultProps) }(flags, type, props), function(flags, type, ref) { if (4 & flags) { return ref } var defaultHooks = (32768 & flags ? type.render : type).defaultHooks; if (isNullOrUndef(defaultHooks)) { return ref } if (isNullOrUndef(ref)) { return defaultHooks } return mergeUnsetProperties(ref, defaultHooks) }(flags, type, ref), type); if (options.createVNode) { options.createVNode(vNode) } return vNode } function createTextVNode(text, key) { return new V(1, isNullOrUndef(text) || true === text || false === text ? "" : text, null, 16, key, null, null, null) } function createFragment(children, childFlags, key) { var fragment = createVNode(8192, 8192, null, children, childFlags, null, key, null); switch (fragment.childFlags) { case 1: fragment.children = createVoidVNode(); fragment.childFlags = 2; break; case 16: fragment.children = [createTextVNode(children)]; fragment.childFlags = 4 } return fragment } function normalizeProps(vNode) { var props = vNode.props; if (props) { var flags = vNode.flags; if (481 & flags) { if (void 0 !== props.children && isNullOrUndef(vNode.children)) { normalizeChildren(vNode, props.children) } if (void 0 !== props.className) { if (isNullOrUndef(vNode.className)) { vNode.className = props.className || null } props.className = void 0 } } if (void 0 !== props.key) { vNode.key = props.key; props.key = void 0 } if (void 0 !== props.ref) { if (8 & flags) { vNode.ref = combineFrom(vNode.ref, props.ref) } else { vNode.ref = props.ref } props.ref = void 0 } } return vNode } function directClone(vNodeToClone) { var flags = -16385 & vNodeToClone.flags; var props = vNodeToClone.props; if (14 & flags) { if (!isNull(props)) { var propsToClone = props; props = {}; for (var key in propsToClone) { props[key] = propsToClone[key] } } } if (0 === (8192 & flags)) { return new V(vNodeToClone.childFlags, vNodeToClone.children, vNodeToClone.className, flags, vNodeToClone.key, props, vNodeToClone.ref, vNodeToClone.type) } return function(vNodeToClone) { var oldChildren = vNodeToClone.children; var childFlags = vNodeToClone.childFlags; return createFragment(2 === childFlags ? directClone(oldChildren) : oldChildren.map(directClone), childFlags, vNodeToClone.key) }(vNodeToClone) } function createVoidVNode() { return createTextVNode("", null) } function createPortal(children, container) { var normalizedRoot = normalizeRoot(children); return createVNode(1024, 1024, null, normalizedRoot, 0, null, normalizedRoot.key, container) } function _normalizeVNodes(nodes, result, index, currentKey) { for (var len = nodes.length; index < len; index++) { var n = nodes[index]; if (!isInvalid(n)) { var newKey = currentKey + keyPrefix + index; if (isArray(n)) { _normalizeVNodes(n, result, 0, newKey) } else { if (isStringOrNumber(n)) { n = createTextVNode(n, newKey) } else { var oldKey = n.key; var isPrefixedKey = isString(oldKey) && oldKey[0] === keyPrefix; if (81920 & n.flags || isPrefixedKey) { n = directClone(n) } n.flags |= 65536; if (!isPrefixedKey) { if (isNull(oldKey)) { n.key = newKey } else { n.key = currentKey + oldKey } } else if (oldKey.substring(0, currentKey.length) !== currentKey) { n.key = currentKey + oldKey } } result.push(n) } } } } function getFlagsForElementVnode(type) { switch (type) { case "svg": return 32; case "input": return 64; case "select": return 256; case "textarea": return 128; case Fragment: return 8192; default: return 1 } } function normalizeChildren(vNode, children) { var newChildren; var newChildFlags = 1; if (isInvalid(children)) { newChildren = children } else if (isStringOrNumber(children)) { newChildFlags = 16; newChildren = children } else if (isArray(children)) { var len = children.length; for (var i = 0; i < len; ++i) { var n = children[i]; if (isInvalid(n) || isArray(n)) { newChildren = newChildren || children.slice(0, i); _normalizeVNodes(children, newChildren, i, ""); break } else if (isStringOrNumber(n)) { newChildren = newChildren || children.slice(0, i); newChildren.push(createTextVNode(n, keyPrefix + i)) } else { var key = n.key; var needsCloning = (81920 & n.flags) > 0; var isNullKey = isNull(key); var isPrefixed = isString(key) && key[0] === keyPrefix; if (needsCloning || isNullKey || isPrefixed) { newChildren = newChildren || children.slice(0, i); if (needsCloning || isPrefixed) { n = directClone(n) } if (isNullKey || isPrefixed) { n.key = keyPrefix + i } newChildren.push(n) } else if (newChildren) { newChildren.push(n) } n.flags |= 65536 } } newChildren = newChildren || children; if (0 === newChildren.length) { newChildFlags = 1 } else { newChildFlags = 8 } } else { newChildren = children; newChildren.flags |= 65536; if (81920 & children.flags) { newChildren = directClone(children) } newChildFlags = 2 } vNode.children = newChildren; vNode.childFlags = newChildFlags; return vNode } function normalizeRoot(input) { if (isInvalid(input) || isStringOrNumber(input)) { return createTextVNode(input, null) } if (isArray(input)) { return createFragment(input, 0, null) } return 16384 & input.flags ? directClone(input) : input } var xlinkNS = "http://www.w3.org/1999/xlink"; var xmlNS = "http://www.w3.org/XML/1998/namespace"; var namespaces = { "xlink:actuate": xlinkNS, "xlink:arcrole": xlinkNS, "xlink:href": xlinkNS, "xlink:role": xlinkNS, "xlink:show": xlinkNS, "xlink:title": xlinkNS, "xlink:type": xlinkNS, "xml:base": xmlNS, "xml:lang": xmlNS, "xml:space": xmlNS }; function getDelegatedEventObject(v) { return { onClick: v, onDblClick: v, onFocusIn: v, onFocusOut: v, onKeyDown: v, onKeyPress: v, onKeyUp: v, onMouseDown: v, onMouseMove: v, onMouseUp: v, onTouchEnd: v, onTouchMove: v, onTouchStart: v } } var attachedEventCounts = getDelegatedEventObject(0); var attachedEvents = getDelegatedEventObject(null); var syntheticEvents = getDelegatedEventObject(true); function updateOrAddSyntheticEvent(name, dom) { var eventsObject = dom.$EV; if (!eventsObject) { eventsObject = dom.$EV = getDelegatedEventObject(null) } if (!eventsObject[name]) { if (1 === ++attachedEventCounts[name]) { attachedEvents[name] = function(name) { var attachedEvent = "onClick" === name || "onDblClick" === name ? function(name) { return function(event) { if (0 !== event.button) { event.stopPropagation(); return } dispatchEvents(event, true, name, extendEventProperties(event)) } }(name) : function(name) { return function(event) { dispatchEvents(event, false, name, extendEventProperties(event)) } }(name); document.addEventListener(normalizeEventName(name), attachedEvent); return attachedEvent }(name) } } return eventsObject } function unmountSyntheticEvent(name, dom) { var eventsObject = dom.$EV; if (eventsObject && eventsObject[name]) { if (0 === --attachedEventCounts[name]) { document.removeEventListener(normalizeEventName(name), attachedEvents[name]); attachedEvents[name] = null } eventsObject[name] = null } } function dispatchEvents(event, isClick, name, eventData) { var dom = function(event) { return isFunction(event.composedPath) ? event.composedPath()[0] : event.target }(event); do { if (isClick && dom.disabled) { return } var eventsObject = dom.$EV; if (eventsObject) { var currentEvent = eventsObject[name]; if (currentEvent) { eventData.dom = dom; currentEvent.event ? currentEvent.event(currentEvent.data, event) : currentEvent(event); if (event.cancelBubble) { return } } } dom = dom.parentNode } while (!isNull(dom)) } function stopPropagation() { this.cancelBubble = true; if (!this.immediatePropagationStopped) { this.stopImmediatePropagation() } } function isDefaultPrevented() { return this.defaultPrevented } function isPropagationStopped() { return this.cancelBubble } function extendEventProperties(event) { var eventData = { dom: document }; event.isDefaultPrevented = isDefaultPrevented; event.isPropagationStopped = isPropagationStopped; event.stopPropagation = stopPropagation; Object.defineProperty(event, "currentTarget", { configurable: true, get: function() { return eventData.dom } }); return eventData } function triggerEventListener(props, methodName, e) { if (props[methodName]) { var listener = props[methodName]; if (listener.event) { listener.event(listener.data, e) } else { listener(e) } } else { var nativeListenerName = methodName.toLowerCase(); if (props[nativeListenerName]) { props[nativeListenerName](e) } } } function createWrappedFunction(methodName, applyValue) { var fnMethod = function(e) { var vNode = this.$V; if (!vNode) { return } var props = vNode.props || EMPTY_OBJ; var dom = vNode.dom; if (isString(methodName)) { triggerEventListener(props, methodName, e) } else { for (var i = 0; i < methodName.length; ++i) { triggerEventListener(props, methodName[i], e) } } if (isFunction(applyValue)) { var newVNode = this.$V; var newProps = newVNode.props || EMPTY_OBJ; applyValue(newProps, dom, false, newVNode) } }; Object.defineProperty(fnMethod, "wrapped", { configurable: false, enumerable: false, value: true, writable: false }); return fnMethod } function attachEvent(dom, eventName, handler) { var previousKey = "$" + eventName; var previousArgs = dom[previousKey]; if (previousArgs) { if (previousArgs[1].wrapped) { return } dom.removeEventListener(previousArgs[0], previousArgs[1]); dom[previousKey] = null } if (isFunction(handler)) { dom.addEventListener(eventName, handler); dom[previousKey] = [eventName, handler] } } function isCheckedType(type) { return "checkbox" === type || "radio" === type } var onTextInputChange = createWrappedFunction("onInput", applyValueInput); var wrappedOnChange = createWrappedFunction(["onClick", "onChange"], applyValueInput); function emptywrapper(event) { event.stopPropagation() } emptywrapper.wrapped = true; function applyValueInput(nextPropsOrEmpty, dom) { var type = nextPropsOrEmpty.type; var value = nextPropsOrEmpty.value; var checked = nextPropsOrEmpty.checked; var multiple = nextPropsOrEmpty.multiple; var defaultValue = nextPropsOrEmpty.defaultValue; var hasValue = !isNullOrUndef(value); if (type && type !== dom.type) { dom.setAttribute("type", type) } if (!isNullOrUndef(multiple) && multiple !== dom.multiple) { dom.multiple = multiple } if (!isNullOrUndef(defaultValue) && !hasValue) { dom.defaultValue = defaultValue + "" } if (isCheckedType(type)) { if (hasValue) { dom.value = value } if (!isNullOrUndef(checked)) { dom.checked = checked } } else if (hasValue && dom.value !== value) { dom.defaultValue = value; dom.value = value } else if (!isNullOrUndef(checked)) { dom.checked = checked } } function updateChildOptions(vNode, value) { if ("option" === vNode.type) { ! function(vNode, value) { var props = vNode.props || EMPTY_OBJ; var dom = vNode.dom; dom.value = props.value; if (props.value === value || isArray(value) && -1 !== value.indexOf(props.value)) { dom.selected = true } else if (!isNullOrUndef(value) || !isNullOrUndef(props.selected)) { dom.selected = props.selected || false } }(vNode, value) } else { var children = vNode.children; var flags = vNode.flags; if (4 & flags) { updateChildOptions(children.$LI, value) } else if (8 & flags) { updateChildOptions(children, value) } else if (2 === vNode.childFlags) { updateChildOptions(children, value) } else if (12 & vNode.childFlags) { for (var i = 0, len = children.length; i < len; ++i) { updateChildOptions(children[i], value) } } } } var onSelectChange = createWrappedFunction("onChange", applyValueSelect); function applyValueSelect(nextPropsOrEmpty, dom, mounting, vNode) { var multiplePropInBoolean = Boolean(nextPropsOrEmpty.multiple); if (!isNullOrUndef(nextPropsOrEmpty.multiple) && multiplePropInBoolean !== dom.multiple) { dom.multiple = multiplePropInBoolean } var index = nextPropsOrEmpty.selectedIndex; if (-1 === index) { dom.selectedIndex = -1 } var childFlags = vNode.childFlags; if (1 !== childFlags) { var value = nextPropsOrEmpty.value; if ((o = index, "number" === typeof o) && index > -1 && dom.options[index]) { value = dom.options[index].value } if (mounting && isNullOrUndef(value)) { value = nextPropsOrEmpty.defaultValue } updateChildOptions(vNode, value) } var o } var onTextareaInputChange = createWrappedFunction("onInput", applyValueTextArea); var wrappedOnChange$1 = createWrappedFunction("onChange"); function applyValueTextArea(nextPropsOrEmpty, dom, mounting) { var value = nextPropsOrEmpty.value; var domValue = dom.value; if (isNullOrUndef(value)) { if (mounting) { var defaultValue = nextPropsOrEmpty.defaultValue; if (!isNullOrUndef(defaultValue) && defaultValue !== domValue) { dom.defaultValue = defaultValue; dom.value = defaultValue } } } else if (domValue !== value) { dom.defaultValue = value; dom.value = value } } function processElement(flags, vNode, dom, nextPropsOrEmpty, mounting, isControlled) { if (64 & flags) { applyValueInput(nextPropsOrEmpty, dom) } else if (256 & flags) { applyValueSelect(nextPropsOrEmpty, dom, mounting, vNode) } else if (128 & flags) { applyValueTextArea(nextPropsOrEmpty, dom, mounting) } if (isControlled) { dom.$V = vNode } } function addFormElementEventHandlers(flags, dom, nextPropsOrEmpty) { if (64 & flags) { ! function(dom, nextPropsOrEmpty) { if (isCheckedType(nextPropsOrEmpty.type)) { attachEvent(dom, "change", wrappedOnChange); attachEvent(dom, "click", emptywrapper) } else { attachEvent(dom, "input", onTextInputChange) } }(dom, nextPropsOrEmpty) } else if (256 & flags) { ! function(dom) { attachEvent(dom, "change", onSelectChange) }(dom) } else if (128 & flags) { ! function(dom, nextPropsOrEmpty) { attachEvent(dom, "input", onTextareaInputChange); if (nextPropsOrEmpty.onChange) { attachEvent(dom, "change", wrappedOnChange$1) } }(dom, nextPropsOrEmpty) } } function isControlledFormElement(nextPropsOrEmpty) { return nextPropsOrEmpty.type && isCheckedType(nextPropsOrEmpty.type) ? !isNullOrUndef(nextPropsOrEmpty.checked) : !isNullOrUndef(nextPropsOrEmpty.value) } function createRef() { return { current: null } } function forwardRef(render) { return { render: render } } function unmountRef(ref) { if (ref) { if (!safeCall1(ref, null) && ref.current) { ref.current = null } } } function mountRef(ref, value, lifecycle) { if (ref && (isFunction(ref) || void 0 !== ref.current)) { lifecycle.push((function() { if (!safeCall1(ref, value) && void 0 !== ref.current) { ref.current = value } })) } } function remove(vNode, parentDOM) { unmount(vNode); removeVNodeDOM(vNode, parentDOM) } function unmount(vNode) { var flags = vNode.flags; var children = vNode.children; var ref; if (481 & flags) { ref = vNode.ref; var props = vNode.props; unmountRef(ref); var childFlags = vNode.childFlags; if (!isNull(props)) { var keys = Object.keys(props); for (var i = 0, len = keys.length; i < len; i++) { var key = keys[i]; if (syntheticEvents[key]) { unmountSyntheticEvent(key, vNode.dom) } } } if (12 & childFlags) { unmountAllChildren(children) } else if (2 === childFlags) { unmount(children) } } else if (children) { if (4 & flags) { if (isFunction(children.componentWillUnmount)) { children.componentWillUnmount() } unmountRef(vNode.ref); children.$UN = true; unmount(children.$LI) } else if (8 & flags) { ref = vNode.ref; if (!isNullOrUndef(ref) && isFunction(ref.onComponentWillUnmount)) { ref.onComponentWillUnmount(findDOMfromVNode(vNode, true), vNode.props || EMPTY_OBJ) } unmount(children) } else if (1024 & flags) { remove(children, vNode.ref) } else if (8192 & flags) { if (12 & vNode.childFlags) { unmountAllChildren(children) } } } } function unmountAllChildren(children) { for (var i = 0, len = children.length; i < len; ++i) { unmount(children[i]) } } function clearDOM(dom) { dom.textContent = "" } function removeAllChildren(dom, vNode, children) { unmountAllChildren(children); if (8192 & vNode.flags) { removeVNodeDOM(vNode, dom) } else { clearDOM(dom) } } function patchDangerInnerHTML(lastValue, nextValue, lastVNode, dom) { var lastHtml = lastValue && lastValue.__html || ""; var nextHtml = nextValue && nextValue.__html || ""; if (lastHtml !== nextHtml) { if (!isNullOrUndef(nextHtml) && ! function(dom, innerHTML) { var tempdom = document.createElement("i"); tempdom.innerHTML = innerHTML; return tempdom.innerHTML === dom.innerHTML }(dom, nextHtml)) { if (!isNull(lastVNode)) { if (12 & lastVNode.childFlags) { unmountAllChildren(lastVNode.children) } else if (2 === lastVNode.childFlags) { unmount(lastVNode.children) } lastVNode.children = null; lastVNode.childFlags = 1 } dom.innerHTML = nextHtml } } } function patchProp(prop, lastValue, nextValue, dom, isSVG, hasControlledValue, lastVNode) { switch (prop) { case "children": case "childrenType": case "className": case "defaultValue": case "key": case "multiple": case "ref": case "selectedIndex": break; case "autoFocus": dom.autofocus = !!nextValue; break; case "allowfullscreen": case "autoplay": case "capture": case "checked": case "controls": case "default": case "disabled": case "hidden": case "indeterminate": case "loop": case "muted": case "novalidate": case "open": case "readOnly": case "required": case "reversed": case "scoped": case "seamless": case "selected": dom[prop] = !!nextValue; break; case "defaultChecked": case "value": case "volume": if (hasControlledValue && "value" === prop) { break } var value = isNullOrUndef(nextValue) ? "" : nextValue; if (dom[prop] !== value) { dom[prop] = value } break; case "style": ! function(lastAttrValue, nextAttrValue, dom) { if (isNullOrUndef(nextAttrValue)) { dom.removeAttribute("style"); return } var domStyle = dom.style; var style; var value; if (isString(nextAttrValue)) { domStyle.cssText = nextAttrValue; return } if (!isNullOrUndef(lastAttrValue) && !isString(lastAttrValue)) { for (style in nextAttrValue) { value = nextAttrValue[style]; if (value !== lastAttrValue[style]) { domStyle.setProperty(style, value) } } for (style in lastAttrValue) { if (isNullOrUndef(nextAttrValue[style])) { domStyle.removeProperty(style) } } } else { for (style in nextAttrValue) { value = nextAttrValue[style]; domStyle.setProperty(style, value) } } }(lastValue, nextValue, dom); break; case "dangerouslySetInnerHTML": patchDangerInnerHTML(lastValue, nextValue, lastVNode, dom); break; default: if (syntheticEvents[prop]) { ! function(name, lastEvent, nextEvent, dom) { if (isFunction(nextEvent)) { updateOrAddSyntheticEvent(name, dom)[name] = nextEvent } else if (isLinkEventObject(nextEvent)) { if (isLastValueSameLinkEvent(lastEvent, nextEvent)) { return } updateOrAddSyntheticEvent(name, dom)[name] = nextEvent } else { unmountSyntheticEvent(name, dom) } }(prop, lastValue, nextValue, dom) } else if (111 === prop.charCodeAt(0) && 110 === prop.charCodeAt(1)) { ! function(name, lastValue, nextValue, dom) { if (isLinkEventObject(nextValue)) { if (isLastValueSameLinkEvent(lastValue, nextValue)) { return } nextValue = function(nextValue) { var ev = nextValue.event; return function(e) { ev(nextValue.data, e) } }(nextValue) } attachEvent(dom, normalizeEventName(name), nextValue) }(prop, lastValue, nextValue, dom) } else if (isNullOrUndef(nextValue)) { dom.removeAttribute(prop) } else if (isSVG && namespaces[prop]) { dom.setAttributeNS(namespaces[prop], prop, nextValue) } else { dom.setAttribute(prop, nextValue) } } } function mountProps(vNode, flags, props, dom, isSVG) { var hasControlledValue = false; var isFormElement = (448 & flags) > 0; if (isFormElement) { hasControlledValue = isControlledFormElement(props); if (hasControlledValue) { addFormElementEventHandlers(flags, dom, props) } } for (var prop in props) { patchProp(prop, null, props[prop], dom, isSVG, hasControlledValue, null) } if (isFormElement) { processElement(flags, vNode, dom, props, true, hasControlledValue) } } function renderNewInput(instance, props, context) { var nextInput = normalizeRoot(instance.render(props, instance.state, context)); var childContext = context; if (isFunction(instance.getChildContext)) { childContext = combineFrom(context, instance.getChildContext()) } instance.$CX = childContext; return nextInput } function createClassComponentInstance(vNode, Component, props, context, isSVG, lifecycle) { var instance = new Component(props, context); var usesNewAPI = instance.$N = Boolean(Component.getDerivedStateFromProps || instance.getSnapshotBeforeUpdate); instance.$SVG = isSVG; instance.$L = lifecycle; vNode.children = instance; instance.$BS = false; instance.context = context; if (instance.props === EMPTY_OBJ) { instance.props = props } if (!usesNewAPI) { if (isFunction(instance.componentWillMount)) { instance.$BR = true; instance.componentWillMount(); var pending = instance.$PS; if (!isNull(pending)) { var state = instance.state; if (isNull(state)) { instance.state = pending } else { for (var key in pending) { state[key] = pending[key] } } instance.$PS = null } instance.$BR = false } } else { instance.state = createDerivedState(instance, props, instance.state) } instance.$LI = renderNewInput(instance, props, context); return instance } function renderFunctionalComponent(vNode, context) { var props = vNode.props || EMPTY_OBJ; return 32768 & vNode.flags ? vNode.type.render(props, vNode.ref, context) : vNode.type(props, context) } function mount(vNode, parentDOM, context, isSVG, nextNode, lifecycle) { var flags = vNode.flags |= 16384; if (481 & flags) { mountElement(vNode, parentDOM, context, isSVG, nextNode, lifecycle) } else if (4 & flags) { ! function(vNode, parentDOM, context, isSVG, nextNode, lifecycle) { var instance = createClassComponentInstance(vNode, vNode.type, vNode.props || EMPTY_OBJ, context, isSVG, lifecycle); mount(instance.$LI, parentDOM, instance.$CX, isSVG, nextNode, lifecycle); mountClassComponentCallbacks(vNode.ref, instance, lifecycle) }(vNode, parentDOM, context, isSVG, nextNode, lifecycle) } else if (8 & flags) { ! function(vNode, parentDOM, context, isSVG, nextNode, lifecycle) { mount(vNode.children = normalizeRoot(renderFunctionalComponent(vNode, context)), parentDOM, context, isSVG, nextNode, lifecycle) }(vNode, parentDOM, context, isSVG, nextNode, lifecycle); mountFunctionalComponentCallbacks(vNode, lifecycle) } else if (512 & flags || 16 & flags) { mountText(vNode, parentDOM, nextNode) } else if (8192 & flags) { ! function(vNode, context, parentDOM, isSVG, nextNode, lifecycle) { var children = vNode.children; var childFlags = vNode.childFlags; if (12 & childFlags && 0 === children.length) { childFlags = vNode.childFlags = 2; children = vNode.children = createVoidVNode() } if (2 === childFlags) { mount(children, parentDOM, context, isSVG, nextNode, lifecycle) } else { mountArrayChildren(children, parentDOM, context, isSVG, nextNode, lifecycle) } }(vNode, context, parentDOM, isSVG, nextNode, lifecycle) } else if (1024 & flags) { ! function(vNode, context, parentDOM, nextNode, lifecycle) { mount(vNode.children, vNode.ref, context, false, null, lifecycle); var placeHolderVNode = createVoidVNode(); mountText(placeHolderVNode, parentDOM, nextNode); vNode.dom = placeHolderVNode.dom }(vNode, context, parentDOM, nextNode, lifecycle) } } function mountText(vNode, parentDOM, nextNode) { var dom = vNode.dom = document.createTextNode(vNode.children); if (!isNull(parentDOM)) { insertOrAppend(parentDOM, dom, nextNode) } } function mountElement(vNode, parentDOM, context, isSVG, nextNode, lifecycle) { var flags = vNode.flags; var props = vNode.props; var className = vNode.className; var childFlags = vNode.childFlags; var dom = vNode.dom = function(tag, isSVG) { if (isSVG) { return document.createElementNS("http://www.w3.org/2000/svg", tag) } return document.createElement(tag) }(vNode.type, isSVG = isSVG || (32 & flags) > 0); var children = vNode.children; if (!isNullOrUndef(className) && "" !== className) { if (isSVG) { dom.setAttribute("class", className) } else { dom.className = className } } if (16 === childFlags) { setTextContent(dom, children) } else if (1 !== childFlags) { var childrenIsSVG = isSVG && "foreignObject" !== vNode.type; if (2 === childFlags) { if (16384 & children.flags) { vNode.children = children = directClone(children) } mount(children, dom, context, childrenIsSVG, null, lifecycle) } else if (8 === childFlags || 4 === childFlags) { mountArrayChildren(children, dom, context, childrenIsSVG, null, lifecycle) } } if (!isNull(parentDOM)) { insertOrAppend(parentDOM, dom, nextNode) } if (!isNull(props)) { mountProps(vNode, flags, props, dom, isSVG) } mountRef(vNode.ref, dom, lifecycle) } function mountArrayChildren(children, dom, context, isSVG, nextNode, lifecycle) { for (var i = 0; i < children.length; ++i) { var child = children[i]; if (16384 & child.flags) { children[i] = child = directClone(child) } mount(child, dom, context, isSVG, nextNode, lifecycle) } } function mountClassComponentCallbacks(ref, instance, lifecycle) { mountRef(ref, instance, lifecycle); if (isFunction(instance.componentDidMount)) { lifecycle.push(function(instance) { return function() { instance.componentDidMount() } }(instance)) } } function mountFunctionalComponentCallbacks(vNode, lifecycle) { var ref = vNode.ref; if (!isNullOrUndef(ref)) { safeCall1(ref.onComponentWillMount, vNode.props || EMPTY_OBJ); if (isFunction(ref.onComponentDidMount)) { lifecycle.push(function(ref, vNode) { return function() { ref.onComponentDidMount(findDOMfromVNode(vNode, true), vNode.props || EMPTY_OBJ) } }(ref, vNode)) } } } function patch(lastVNode, nextVNode, parentDOM, context, isSVG, nextNode, lifecycle) { var nextFlags = nextVNode.flags |= 16384; if (lastVNode.flags !== nextFlags || lastVNode.type !== nextVNode.type || lastVNode.key !== nextVNode.key || 2048 & nextFlags) { if (16384 & lastVNode.flags) { ! function(lastVNode, nextVNode, parentDOM, context, isSVG, lifecycle) { unmount(lastVNode); if (0 !== (nextVNode.flags & lastVNode.flags & 2033)) { mount(nextVNode, null, context, isSVG, null, lifecycle); ! function(parentDOM, newDom, lastDom) { parentDOM.replaceChild(newDom, lastDom) }(parentDOM, nextVNode.dom, lastVNode.dom) } else { mount(nextVNode, parentDOM, context, isSVG, findDOMfromVNode(lastVNode, true), lifecycle); removeVNodeDOM(lastVNode, parentDOM) } }(lastVNode, nextVNode, parentDOM, context, isSVG, lifecycle) } else { mount(nextVNode, parentDOM, context, isSVG, nextNode, lifecycle) } } else if (481 & nextFlags) { ! function(lastVNode, nextVNode, context, isSVG, nextFlags, lifecycle) { var dom = nextVNode.dom = lastVNode.dom; var lastProps = lastVNode.props; var nextProps = nextVNode.props; var isFormElement = false; var hasControlledValue = false; var nextPropsOrEmpty; isSVG = isSVG || (32 & nextFlags) > 0; if (lastProps !== nextProps) { var lastPropsOrEmpty = lastProps || EMPTY_OBJ; nextPropsOrEmpty = nextProps || EMPTY_OBJ; if (nextPropsOrEmpty !== EMPTY_OBJ) { isFormElement = (448 & nextFlags) > 0; if (isFormElement) { hasControlledValue = isControlledFormElement(nextPropsOrEmpty) } for (var prop in nextPropsOrEmpty) { var lastValue = lastPropsOrEmpty[prop]; var nextValue = nextPropsOrEmpty[prop]; if (lastValue !== nextValue) { patchProp(prop, lastValue, nextValue, dom, isSVG, hasControlledValue, lastVNode) } } } if (lastPropsOrEmpty !== EMPTY_OBJ) { for (var prop$1 in lastPropsOrEmpty) { if (isNullOrUndef(nextPropsOrEmpty[prop$1]) && !isNullOrUndef(lastPropsOrEmpty[prop$1])) { patchProp(prop$1, lastPropsOrEmpty[prop$1], null, dom, isSVG, hasControlledValue, lastVNode) } } } } var nextChildren = nextVNode.children; var nextClassName = nextVNode.className; if (lastVNode.className !== nextClassName) { if (isNullOrUndef(nextClassName)) { dom.removeAttribute("class") } else if (isSVG) { dom.setAttribute("class", nextClassName) } else { dom.className = nextClassName } } if (4096 & nextFlags) { ! function(dom, nextChildren) { if (dom.textContent !== nextChildren) { dom.textContent = nextChildren } }(dom, nextChildren) } else { patchChildren(lastVNode.childFlags, nextVNode.childFlags, lastVNode.children, nextChildren, dom, context, isSVG && "foreignObject" !== nextVNode.type, null, lastVNode, lifecycle) } if (isFormElement) { processElement(nextFlags, nextVNode, dom, nextPropsOrEmpty, false, hasControlledValue) } var nextRef = nextVNode.ref; var lastRef = lastVNode.ref; if (lastRef !== nextRef) { unmountRef(lastRef); mountRef(nextRef, dom, lifecycle) } }(lastVNode, nextVNode, context, isSVG, nextFlags, lifecycle) } else if (4 & nextFlags) { ! function(lastVNode, nextVNode, parentDOM, context, isSVG, nextNode, lifecycle) { var instance = nextVNode.children = lastVNode.children; if (isNull(instance)) { return } instance.$L = lifecycle; var nextProps = nextVNode.props || EMPTY_OBJ; var nextRef = nextVNode.ref; var lastRef = lastVNode.ref; var nextState = instance.state; if (!instance.$N) { if (isFunction(instance.componentWillReceiveProps)) { instance.$BR = true; instance.componentWillReceiveProps(nextProps, context); if (instance.$UN) { return } instance.$BR = false } if (!isNull(instance.$PS)) { nextState = combineFrom(nextState, instance.$PS); instance.$PS = null } } updateClassComponent(instance, nextState, nextProps, parentDOM, context, isSVG, false, nextNode, lifecycle); if (lastRef !== nextRef) { unmountRef(lastRef); mountRef(nextRef, instance, lifecycle) } }(lastVNode, nextVNode, parentDOM, context, isSVG, nextNode, lifecycle) } else if (8 & nextFlags) { ! function(lastVNode, nextVNode, parentDOM, context, isSVG, nextNode, lifecycle) { var shouldUpdate = true; var nextProps = nextVNode.props || EMPTY_OBJ; var nextRef = nextVNode.ref; var lastProps = lastVNode.props; var nextHooksDefined = !isNullOrUndef(nextRef); var lastInput = lastVNode.children; if (nextHooksDefined && isFunction(nextRef.onComponentShouldUpdate)) { shouldUpdate = nextRef.onComponentShouldUpdate(lastProps, nextProps) } if (false !== shouldUpdate) { if (nextHooksDefined && isFunction(nextRef.onComponentWillUpdate)) { nextRef.onComponentWillUpdate(lastProps, nextProps) } var nextInput = normalizeRoot(renderFunctionalComponent(nextVNode, context)); patch(lastInput, nextInput, parentDOM, context, isSVG, nextNode, lifecycle); nextVNode.children = nextInput; if (nextHooksDefined && isFunction(nextRef.onComponentDidUpdate)) { nextRef.onComponentDidUpdate(lastProps, nextProps) } } else { nextVNode.children = lastInput } }(lastVNode, nextVNode, parentDOM, context, isSVG, nextNode, lifecycle) } else if (16 & nextFlags) { ! function(lastVNode, nextVNode) { var nextText = nextVNode.children; var dom = nextVNode.dom = lastVNode.dom; if (nextText !== lastVNode.children) { dom.nodeValue = nextText } }(lastVNode, nextVNode) } else if (512 & nextFlags) { nextVNode.dom = lastVNode.dom } else if (8192 & nextFlags) { ! function(lastVNode, nextVNode, parentDOM, context, isSVG, lifecycle) { var lastChildren = lastVNode.children; var nextChildren = nextVNode.children; var lastChildFlags = lastVNode.childFlags; var nextChildFlags = nextVNode.childFlags; var nextNode = null; if (12 & nextChildFlags && 0 === nextChildren.length) { nextChildFlags = nextVNode.childFlags = 2; nextChildren = nextVNode.children = createVoidVNode() } var nextIsSingle = 0 !== (2 & nextChildFlags); if (12 & lastChildFlags) { var lastLen = lastChildren.length; if (8 & lastChildFlags && 8 & nextChildFlags || nextIsSingle || !nextIsSingle && nextChildren.length > lastLen) { nextNode = findDOMfromVNode(lastChildren[lastLen - 1], false).nextSibling } } patchChildren(lastChildFlags, nextChildFlags, lastChildren, nextChildren, parentDOM, context, isSVG, nextNode, lastVNode, lifecycle) }(lastVNode, nextVNode, parentDOM, context, isSVG, lifecycle) } else { ! function(lastVNode, nextVNode, context, lifecycle) { var lastContainer = lastVNode.ref; var nextContainer = nextVNode.ref; var nextChildren = nextVNode.children; patchChildren(lastVNode.childFlags, nextVNode.childFlags, lastVNode.children, nextChildren, lastContainer, context, false, null, lastVNode, lifecycle); nextVNode.dom = lastVNode.dom; if (lastContainer !== nextContainer && !isInvalid(nextChildren)) { var node = nextChildren.dom; removeChild(lastContainer, node); appendChild(nextContainer, node) } }(lastVNode, nextVNode, context, lifecycle) } } function patchChildren(lastChildFlags, nextChildFlags, lastChildren, nextChildren, parentDOM, context, isSVG, nextNode, parentVNode, lifecycle) { switch (lastChildFlags) { case 2: switch (nextChildFlags) { case 2: patch(lastChildren, nextChildren, parentDOM, context, isSVG, nextNode, lifecycle); break; case 1: remove(lastChildren, parentDOM); break; case 16: unmount(lastChildren); setTextContent(parentDOM, nextChildren); break; default: ! function(lastChildren, nextChildren, parentDOM, context, isSVG, lifecycle) { unmount(lastChildren); mountArrayChildren(nextChildren, parentDOM, context, isSVG, findDOMfromVNode(lastChildren, true), lifecycle); removeVNodeDOM(lastChildren, parentDOM) }(lastChildren, nextChildren, parentDOM, context, isSVG, lifecycle) } break; case 1: switch (nextChildFlags) { case 2: mount(nextChildren, parentDOM, context, isSVG, nextNode, lifecycle); break; case 1: break; case 16: setTextContent(parentDOM, nextChildren); break; default: mountArrayChildren(nextChildren, parentDOM, context, isSVG, nextNode, lifecycle) } break; case 16: switch (nextChildFlags) { case 16: ! function(lastChildren, nextChildren, parentDOM) { if (lastChildren !== nextChildren) { if ("" !== lastChildren) { parentDOM.firstChild.nodeValue = nextChildren } else { setTextContent(parentDOM, nextChildren) } } }(lastChildren, nextChildren, parentDOM); break; case 2: clearDOM(parentDOM); mount(nextChildren, parentDOM, context, isSVG, nextNode, lifecycle); break; case 1: clearDOM(parentDOM); break; default: clearDOM(parentDOM); mountArrayChildren(nextChildren, parentDOM, context, isSVG, nextNode, lifecycle) } break; default: switch (nextChildFlags) { case 16: unmountAllChildren(lastChildren); setTextContent(parentDOM, nextChildren); break; case 2: removeAllChildren(parentDOM, parentVNode, lastChildren); mount(nextChildren, parentDOM, context, isSVG, nextNode, lifecycle); break; case 1: removeAllChildren(parentDOM, parentVNode, lastChildren); break; default: var lastLength = 0 | lastChildren.length; var nextLength = 0 | nextChildren.length; if (0 === lastLength) { if (nextLength > 0) { mountArrayChildren(nextChildren, parentDOM, context, isSVG, nextNode, lifecycle) } } else if (0 === nextLength) { removeAllChildren(parentDOM, parentVNode, lastChildren) } else if (8 === nextChildFlags && 8 === lastChildFlags) { ! function(a, b, dom, context, isSVG, aLength, bLength, outerEdge, parentVNode, lifecycle) { var aEnd = aLength - 1; var bEnd = bLength - 1; var j = 0; var aNode = a[j]; var bNode = b[j]; var nextPos; var nextNode; outer: { while (aNode.key === bNode.key) { if (16384 & bNode.flags) { b[j] = bNode = directClone(bNode) } patch(aNode, bNode, dom, context, isSVG, outerEdge, lifecycle); a[j] = bNode; ++j; if (j > aEnd || j > bEnd) { break outer } aNode = a[j]; bNode = b[j] } aNode = a[aEnd];bNode = b[bEnd]; while (aNode.key === bNode.key) { if (16384 & bNode.flags) { b[bEnd] = bNode = directClone(bNode) } patch(aNode, bNode, dom, context, isSVG, outerEdge, lifecycle); a[aEnd] = bNode; aEnd--; bEnd--; if (j > aEnd || j > bEnd) { break outer } aNode = a[aEnd]; bNode = b[bEnd] } } if (j > aEnd) { if (j <= bEnd) { nextPos = bEnd + 1; nextNode = nextPos < bLength ? findDOMfromVNode(b[nextPos], true) : outerEdge; while (j <= bEnd) { bNode = b[j]; if (16384 & bNode.flags) { b[j] = bNode = directClone(bNode) }++j; mount(bNode, dom, context, isSVG, nextNode, lifecycle) } } } else if (j > bEnd) { while (j <= aEnd) { remove(a[j++], dom) } } else { ! function(a, b, context, aLength, bLength, aEnd, bEnd, j, dom, isSVG, outerEdge, parentVNode, lifecycle) { var aNode; var bNode; var nextPos; var i = 0; var aStart = j; var bStart = j; var aLeft = aEnd - j + 1; var bLeft = bEnd - j + 1; var sources = new Int32Array(bLeft + 1); var canRemoveWholeContent = aLeft === aLength; var moved = false; var pos = 0; var patched = 0; if (bLength < 4 || (aLeft | bLeft) < 32) { for (i = aStart; i <= aEnd; ++i) { aNode = a[i]; if (patched < bLeft) { for (j = bStart; j <= bEnd; j++) { bNode = b[j]; if (aNode.key === bNode.key) { sources[j - bStart] = i + 1; if (canRemoveWholeContent) { canRemoveWholeContent = false; while (aStart < i) { remove(a[aStart++], dom) } } if (pos > j) { moved = true } else { pos = j } if (16384 & bNode.flags) { b[j] = bNode = directClone(bNode) } patch(aNode, bNode, dom, context, isSVG, outerEdge, lifecycle); ++patched; break } } if (!canRemoveWholeContent && j > bEnd) { remove(aNode, dom) } } else if (!canRemoveWholeContent) { remove(aNode, dom) } } } else { var keyIndex = {}; for (i = bStart; i <= bEnd; ++i) { keyIndex[b[i].key] = i } for (i = aStart; i <= aEnd; ++i) { aNode = a[i]; if (patched < bLeft) { j = keyIndex[aNode.key]; if (void 0 !== j) { if (canRemoveWholeContent) { canRemoveWholeContent = false; while (i > aStart) { remove(a[aStart++], dom) } } sources[j - bStart] = i + 1; if (pos > j) { moved = true } else { pos = j } bNode = b[j]; if (16384 & bNode.flags) { b[j] = bNode = directClone(bNode) } patch(aNode, bNode, dom, context, isSVG, outerEdge, lifecycle); ++patched } else if (!canRemoveWholeContent) { remove(aNode, dom) } } else if (!canRemoveWholeContent) { remove(aNode, dom) } } } if (canRemoveWholeContent) { removeAllChildren(dom, parentVNode, a); mountArrayChildren(b, dom, context, isSVG, outerEdge, lifecycle) } else if (moved) { var seq = function(arr) { var arrI = 0; var i = 0; var j = 0; var k = 0; var u = 0; var v = 0; var c = 0; var len = arr.length; if (len > maxLen) { maxLen = len; result = new Int32Array(len); p = new Int32Array(len) } for (; i < len; ++i) { arrI = arr[i]; if (0 !== arrI) { j = result[k]; if (arr[j] < arrI) { p[i] = j; result[++k] = i; continue } u = 0; v = k; while (u < v) { c = u + v >> 1; if (arr[result[c]] < arrI) { u = c + 1 } else { v = c } } if (arrI < arr[result[u]]) { if (u > 0) { p[i] = result[u - 1] } result[u] = i } } } u = k + 1; var seq = new Int32Array(u); v = result[u - 1]; while (u-- > 0) { seq[u] = v; v = p[v]; result[u] = 0 } return seq }(sources); j = seq.length - 1; for (i = bLeft - 1; i >= 0; i--) { if (0 === sources[i]) { pos = i + bStart; bNode = b[pos]; if (16384 & bNode.flags) { b[pos] = bNode = directClone(bNode) } nextPos = pos + 1; mount(bNode, dom, context, isSVG, nextPos < bLength ? findDOMfromVNode(b[nextPos], true) : outerEdge, lifecycle) } else if (j < 0 || i !== seq[j]) { pos = i + bStart; bNode = b[pos]; nextPos = pos + 1; moveVNodeDOM(bNode, dom, nextPos < bLength ? findDOMfromVNode(b[nextPos], true) : outerEdge) } else { j-- } } } else if (patched !== bLeft) { for (i = bLeft - 1; i >= 0; i--) { if (0 === sources[i]) { pos = i + bStart; bNode = b[pos]; if (16384 & bNode.flags) { b[pos] = bNode = directClone(bNode) } nextPos = pos + 1; mount(bNode, dom, context, isSVG, nextPos < bLength ? findDOMfromVNode(b[nextPos], true) : outerEdge, lifecycle) } } } }(a, b, context, aLength, bLength, aEnd, bEnd, j, dom, isSVG, outerEdge, parentVNode, lifecycle) } }(lastChildren, nextChildren, parentDOM, context, isSVG, lastLength, nextLength, nextNode, parentVNode, lifecycle) } else { ! function(lastChildren, nextChildren, dom, context, isSVG, lastChildrenLength, nextChildrenLength, nextNode, lifecycle) { var commonLength = lastChildrenLength > nextChildrenLength ? nextChildrenLength : lastChildrenLength; var i = 0; var nextChild; var lastChild; for (; i < commonLength; ++i) { nextChild = nextChildren[i]; lastChild = lastChildren[i]; if (16384 & nextChild.flags) { nextChild = nextChildren[i] = directClone(nextChild) } patch(lastChild, nextChild, dom, context, isSVG, nextNode, lifecycle); lastChildren[i] = nextChild } if (lastChildrenLength < nextChildrenLength) { for (i = commonLength; i < nextChildrenLength; ++i) { nextChild = nextChildren[i]; if (16384 & nextChild.flags) { nextChild = nextChildren[i] = directClone(nextChild) } mount(nextChild, dom, context, isSVG, nextNode, lifecycle) } } else if (lastChildrenLength > nextChildrenLength) { for (i = commonLength; i < lastChildrenLength; ++i) { remove(lastChildren[i], dom) } } }(lastChildren, nextChildren, parentDOM, context, isSVG, lastLength, nextLength, nextNode, lifecycle) } } } } function updateClassComponent(instance, nextState, nextProps, parentDOM, context, isSVG, force, nextNode, lifecycle) { var lastState = instance.state; var lastProps = instance.props; var usesNewAPI = Boolean(instance.$N); var hasSCU = isFunction(instance.shouldComponentUpdate); if (usesNewAPI) { nextState = createDerivedState(instance, nextProps, nextState !== lastState ? combineFrom(lastState, nextState) : nextState) } if (force || !hasSCU || hasSCU && instance.shouldComponentUpdate(nextProps, nextState, context)) { if (!usesNewAPI && isFunction(instance.componentWillUpdate)) { instance.componentWillUpdate(nextProps, nextState, context) } instance.props = nextProps; instance.state = nextState; instance.context = context; var snapshot = null; var nextInput = renderNewInput(instance, nextProps, context); if (usesNewAPI && isFunction(instance.getSnapshotBeforeUpdate)) { snapshot = instance.getSnapshotBeforeUpdate(lastProps, lastState) } patch(instance.$LI, nextInput, parentDOM, instance.$CX, isSVG, nextNode, lifecycle); instance.$LI = nextInput; if (isFunction(instance.componentDidUpdate)) { ! function(instance, lastProps, lastState, snapshot, lifecycle) { lifecycle.push((function() { instance.componentDidUpdate(lastProps, lastState, snapshot) })) }(instance, lastProps, lastState, snapshot, lifecycle) } } else { instance.props = nextProps; instance.state = nextState; instance.context = context } } var result; var p; var maxLen = 0; var hasDocumentAvailable = "undefined" !== typeof document; if (hasDocumentAvailable) { if (window.Node) { Node.prototype.$EV = null; Node.prototype.$V = null } } function __render(input, parentDOM, callback, context) { var lifecycle = []; var rootInput = parentDOM.$V; renderCheck.v = true; if (isNullOrUndef(rootInput)) { if (!isNullOrUndef(input)) { if (16384 & input.flags) { input = directClone(input) } mount(input, parentDOM, context, false, null, lifecycle); parentDOM.$V = input; rootInput = input } } else if (isNullOrUndef(input)) { remove(rootInput, parentDOM); parentDOM.$V = null } else { if (16384 & input.flags) { input = directClone(input) } patch(rootInput, input, parentDOM, context, false, null, lifecycle); rootInput = parentDOM.$V = input } callAll(lifecycle); renderCheck.v = false; if (isFunction(callback)) { callback() } if (isFunction(options.renderComplete)) { options.renderComplete(rootInput, parentDOM) } } function render(input, parentDOM, callback, context) { if (void 0 === callback) { callback = null } if (void 0 === context) { context = EMPTY_OBJ } __render(input, parentDOM, callback, context) } function createRenderer(parentDOM) { return function(lastInput, nextInput, callback, context) { if (!parentDOM) { parentDOM = lastInput } render(nextInput, parentDOM, callback, context) } } var QUEUE = []; var nextTick = "undefined" !== typeof Promise ? Promise.resolve().then.bind(Promise.resolve()) : function(a) { window.setTimeout(a, 0) }; var microTaskPending = false; function queueStateChanges(component, newState, callback, force) { var pending = component.$PS; if (isFunction(newState)) { newState = newState(pending ? combineFrom(component.state, pending) : component.state, component.props, component.context) } if (isNullOrUndef(pending)) { component.$PS = newState } else { for (var stateKey in newState) { pending[stateKey] = newState[stateKey] } } if (!component.$BR) { if (!renderCheck.v) { if (0 === QUEUE.length) { applyState(component, force); if (isFunction(callback)) { callback.call(component) } return } } if (-1 === QUEUE.indexOf(component)) { QUEUE.push(component) } if (force) { component.$F = true } if (!microTaskPending) { microTaskPending = true; nextTick(rerender) } if (isFunction(callback)) { var QU = component.$QU; if (!QU) { QU = component.$QU = [] } QU.push(callback) } } else if (isFunction(callback)) { component.$L.push(callback.bind(component)) } } function callSetStateCallbacks(component) { var queue = component.$QU; for (var i = 0; i < queue.length; ++i) { queue[i].call(component) } component.$QU = null } function rerender() { var component; microTaskPending = false; while (component = QUEUE.shift()) { if (!component.$UN) { var force = component.$F; component.$F = false; applyState(component, force); if (component.$QU) { callSetStateCallbacks(component) } } } } function applyState(component, force) { if (force || !component.$BR) { var pendingState = component.$PS; component.$PS = null; var lifecycle = []; renderCheck.v = true; updateClassComponent(component, combineFrom(component.state, pendingState), component.props, findDOMfromVNode(component.$LI, true).parentNode, component.context, component.$SVG, force, null, lifecycle); callAll(lifecycle); renderCheck.v = false } else { component.state = component.$PS; component.$PS = null } } var Component = function(props, context) { this.state = null; this.$BR = false; this.$BS = true; this.$PS = null; this.$LI = null; this.$UN = false; this.$CX = null; this.$QU = null; this.$N = false; this.$L = null; this.$SVG = false; this.$F = false; this.props = props || EMPTY_OBJ; this.context = context || EMPTY_OBJ }; Component.prototype.forceUpdate = function(callback) { if (this.$UN) { return } queueStateChanges(this, {}, callback, true) }; Component.prototype.setState = function(newState, callback) { if (this.$UN) { return } if (!this.$BS) { queueStateChanges(this, newState, callback, false) } }; Component.prototype.render = function(_nextProps, _nextState, _nextContext) { return null }; var version = "7.4.11"; if (false) {} }, 98919: /*!***************************************************************!*\ !*** ../../node_modules/rrule/dist/esm/index.js + 28 modules ***! \***************************************************************/ function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, { Frequency: function() { return Frequency }, RRule: function() { return RRule }, RRuleSet: function() { return RRuleSet }, Weekday: function() { return Weekday }, datetime: function() { return datetime }, rrulestr: function() { return rrulestr } }); var ALL_WEEKDAYS = ["MO", "TU", "WE", "TH", "FR", "SA", "SU"]; var Weekday = function() { function Weekday(weekday, n) { if (0 === n) { throw new Error("Can't create weekday with n == 0") } this.weekday = weekday; this.n = n } Weekday.fromStr = function(str) { return new Weekday(ALL_WEEKDAYS.indexOf(str)) }; Weekday.prototype.nth = function(n) { return this.n === n ? this : new Weekday(this.weekday, n) }; Weekday.prototype.equals = function(other) { return this.weekday === other.weekday && this.n === other.n }; Weekday.prototype.toString = function() { var s = ALL_WEEKDAYS[this.weekday]; if (this.n) { s = (this.n > 0 ? "+" : "") + String(this.n) + s } return s }; Weekday.prototype.getJsWeekday = function() { return 6 === this.weekday ? 0 : this.weekday + 1 }; return Weekday }(); var isPresent = function(value) { return null !== value && void 0 !== value }; var isNumber = function(value) { return "number" === typeof value }; var isWeekdayStr = function(value) { return "string" === typeof value && ALL_WEEKDAYS.includes(value) }; var isArray = Array.isArray; var range = function(start, end) { if (void 0 === end) { end = start } if (1 === arguments.length) { end = start; start = 0 } var rang = []; for (var i = start; i < end; i++) { rang.push(i) } return rang }; var repeat = function(value, times) { var i = 0; var array = []; if (isArray(value)) { for (; i < times; i++) { array[i] = [].concat(value) } } else { for (; i < times; i++) { array[i] = value } } return array }; var toArray = function(item) { if (isArray(item)) { return item } return [item] }; function padStart(item, targetLength, padString) { if (void 0 === padString) { padString = " " } var str = String(item); targetLength |= 0; if (str.length > targetLength) { return String(str) } targetLength -= str.length; if (targetLength > padString.length) { padString += repeat(padString, targetLength / padString.length) } return padString.slice(0, targetLength) + String(str) } var split = function(str, sep, num) { var splits = str.split(sep); return num ? splits.slice(0, num).concat([splits.slice(num).join(sep)]) : splits }; var pymod = function(a, b) { var r = a % b; return r * b < 0 ? r + b : r }; var divmod = function(a, b) { return { div: Math.floor(a / b), mod: pymod(a, b) } }; var empty = function(obj) { return !isPresent(obj) || 0 === obj.length }; var notEmpty = function(obj) { return !empty(obj) }; var includes = function(arr, val) { return notEmpty(arr) && -1 !== arr.indexOf(val) }; var datetime = function(y, m, d, h, i, s) { if (void 0 === h) { h = 0 } if (void 0 === i) { i = 0 } if (void 0 === s) { s = 0 } return new Date(Date.UTC(y, m - 1, d, h, i, s)) }; var MONTH_DAYS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; var MAXYEAR = 9999; var ORDINAL_BASE = datetime(1970, 1, 1); var PY_WEEKDAYS = [6, 0, 1, 2, 3, 4, 5]; var isLeapYear = function(year) { return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0 }; var isDate = function(value) { return value instanceof Date }; var isValidDate = function(value) { return isDate(value) && !isNaN(value.getTime()) }; var tzOffset = function(date) { return 60 * date.getTimezoneOffset() * 1e3 }; var toOrdinal = function(date) { return date1 = date, date2 = ORDINAL_BASE, date1ms = date1.getTime() - tzOffset(date1), date2ms = date2.getTime() - tzOffset(date2), differencems = date1ms - date2ms, Math.round(differencems / 864e5); var date1, date2, date1ms, date2ms, differencems }; var fromOrdinal = function(ordinal) { return new Date(ORDINAL_BASE.getTime() + 864e5 * ordinal) }; var getMonthDays = function(date) { var month = date.getUTCMonth(); return 1 === month && isLeapYear(date.getUTCFullYear()) ? 29 : MONTH_DAYS[month] }; var getWeekday = function(date) { return PY_WEEKDAYS[date.getUTCDay()] }; var monthRange = function(year, month) { var date = datetime(year, month + 1, 1); return [getWeekday(date), getMonthDays(date)] }; var combine = function(date, time) { time = time || date; return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), time.getHours(), time.getMinutes(), time.getSeconds(), time.getMilliseconds())) }; var dateutil_clone = function(date) { var dolly = new Date(date.getTime()); return dolly }; var cloneDates = function(dates) { var clones = []; for (var i = 0; i < dates.length; i++) { clones.push(dateutil_clone(dates[i])) } return clones }; var sort = function(dates) { dates.sort((function(a, b) { return a.getTime() - b.getTime() })) }; var timeToUntilString = function(time, utc) { if (void 0 === utc) { utc = true } var date = new Date(time); return [padStart(date.getUTCFullYear().toString(), 4, "0"), padStart(date.getUTCMonth() + 1, 2, "0"), padStart(date.getUTCDate(), 2, "0"), "T", padStart(date.getUTCHours(), 2, "0"), padStart(date.getUTCMinutes(), 2, "0"), padStart(date.getUTCSeconds(), 2, "0"), utc ? "Z" : ""].join("") }; var untilStringToDate = function(until) { var bits = /^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/.exec(until); if (!bits) { throw new Error("Invalid UNTIL value: ".concat(until)) } return new Date(Date.UTC(parseInt(bits[1], 10), parseInt(bits[2], 10) - 1, parseInt(bits[3], 10), parseInt(bits[5], 10) || 0, parseInt(bits[6], 10) || 0, parseInt(bits[7], 10) || 0)) }; var dateTZtoISO8601 = function(date, timeZone) { var dateStr = date.toLocaleString("sv-SE", { timeZone: timeZone }); return dateStr.replace(" ", "T") + "Z" }; var IterResult = function() { function IterResult(method, args) { this.minDate = null; this.maxDate = null; this._result = []; this.total = 0; this.method = method; this.args = args; if ("between" === method) { this.maxDate = args.inc ? args.before : new Date(args.before.getTime() - 1); this.minDate = args.inc ? args.after : new Date(args.after.getTime() + 1) } else if ("before" === method) { this.maxDate = args.inc ? args.dt : new Date(args.dt.getTime() - 1) } else if ("after" === method) { this.minDate = args.inc ? args.dt : new Date(args.dt.getTime() + 1) } } IterResult.prototype.accept = function(date) { ++this.total; var tooEarly = this.minDate && date < this.minDate; var tooLate = this.maxDate && date > this.maxDate; if ("between" === this.method) { if (tooEarly) { return true } if (tooLate) { return false } } else if ("before" === this.method) { if (tooLate) { return false } } else if ("after" === this.method) { if (tooEarly) { return true } this.add(date); return false } return this.add(date) }; IterResult.prototype.add = function(date) { this._result.push(date); return true }; IterResult.prototype.getValue = function() { var res = this._result; switch (this.method) { case "all": case "between": return res; default: return res.length ? res[res.length - 1] : null } }; IterResult.prototype.clone = function() { return new IterResult(this.method, this.args) }; return IterResult }(); var iterresult = IterResult; var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) { d.__proto__ = b } || function(d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p] } } }; return extendStatics(d, b) }; function __extends(d, b) { if ("function" !== typeof b && null !== b) { throw new TypeError("Class extends value " + String(b) + " is not a constructor or null") } extendStatics(d, b); function __() { this.constructor = d } d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __) } var __assign = function() { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p)) { t[p] = s[p] } } } return t }; return __assign.apply(this, arguments) }; Object.create; function __spreadArray(to, from, pack) { if (pack || 2 === arguments.length) { for (var ar, i = 0, l = from.length; i < l; i++) { if (ar || !(i in from)) { if (!ar) { ar = Array.prototype.slice.call(from, 0, i) } ar[i] = from[i] } } } return to.concat(ar || Array.prototype.slice.call(from)) } Object.create; "function" === typeof SuppressedError && SuppressedError; var CallbackIterResult = function(_super) { __extends(CallbackIterResult, _super); function CallbackIterResult(method, args, iterator) { var _this = _super.call(this, method, args) || this; _this.iterator = iterator; return _this } CallbackIterResult.prototype.add = function(date) { if (this.iterator(date, this._result.length)) { this._result.push(date); return true } return false }; return CallbackIterResult }(iterresult); var callbackiterresult = CallbackIterResult; var i18n = { dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], tokens: { SKIP: /^[ \r\n\t]+|^\.$/, number: /^[1-9][0-9]*/, numberAsText: /^(one|two|three)/i, every: /^every/i, "day(s)": /^days?/i, "weekday(s)": /^weekdays?/i, "week(s)": /^weeks?/i, "hour(s)": /^hours?/i, "minute(s)": /^minutes?/i, "month(s)": /^months?/i, "year(s)": /^years?/i, on: /^(on|in)/i, at: /^(at)/i, the: /^the/i, first: /^first/i, second: /^second/i, third: /^third/i, nth: /^([1-9][0-9]*)(\.|th|nd|rd|st)/i, last: /^last/i, for: /^for/i, "time(s)": /^times?/i, until: /^(un)?til/i, monday: /^mo(n(day)?)?/i, tuesday: /^tu(e(s(day)?)?)?/i, wednesday: /^we(d(n(esday)?)?)?/i, thursday: /^th(u(r(sday)?)?)?/i, friday: /^fr(i(day)?)?/i, saturday: /^sa(t(urday)?)?/i, sunday: /^su(n(day)?)?/i, january: /^jan(uary)?/i, february: /^feb(ruary)?/i, march: /^mar(ch)?/i, april: /^apr(il)?/i, may: /^may/i, june: /^june?/i, july: /^july?/i, august: /^aug(ust)?/i, september: /^sep(t(ember)?)?/i, october: /^oct(ober)?/i, november: /^nov(ember)?/i, december: /^dec(ember)?/i, comma: /^(,\s*|(and|or)\s*)+/i } }; var contains = function(arr, val) { return -1 !== arr.indexOf(val) }; var defaultGetText = function(id) { return id.toString() }; var defaultDateFormatter = function(year, month, day) { return "".concat(month, " ").concat(day, ", ").concat(year) }; var ToText = function() { function ToText(rrule, gettext, language, dateFormatter) { if (void 0 === gettext) { gettext = defaultGetText } if (void 0 === language) { language = i18n } if (void 0 === dateFormatter) { dateFormatter = defaultDateFormatter } this.text = []; this.language = language || i18n; this.gettext = gettext; this.dateFormatter = dateFormatter; this.rrule = rrule; this.options = rrule.options; this.origOptions = rrule.origOptions; if (this.origOptions.bymonthday) { var bymonthday = [].concat(this.options.bymonthday); var bynmonthday = [].concat(this.options.bynmonthday); bymonthday.sort((function(a, b) { return a - b })); bynmonthday.sort((function(a, b) { return b - a })); this.bymonthday = bymonthday.concat(bynmonthday); if (!this.bymonthday.length) { this.bymonthday = null } } if (isPresent(this.origOptions.byweekday)) { var byweekday = !isArray(this.origOptions.byweekday) ? [this.origOptions.byweekday] : this.origOptions.byweekday; var days = String(byweekday); this.byweekday = { allWeeks: byweekday.filter((function(weekday) { return !weekday.n })), someWeeks: byweekday.filter((function(weekday) { return Boolean(weekday.n) })), isWeekdays: -1 !== days.indexOf("MO") && -1 !== days.indexOf("TU") && -1 !== days.indexOf("WE") && -1 !== days.indexOf("TH") && -1 !== days.indexOf("FR") && -1 === days.indexOf("SA") && -1 === days.indexOf("SU"), isEveryDay: -1 !== days.indexOf("MO") && -1 !== days.indexOf("TU") && -1 !== days.indexOf("WE") && -1 !== days.indexOf("TH") && -1 !== days.indexOf("FR") && -1 !== days.indexOf("SA") && -1 !== days.indexOf("SU") }; var sortWeekDays = function(a, b) { return a.weekday - b.weekday }; this.byweekday.allWeeks.sort(sortWeekDays); this.byweekday.someWeeks.sort(sortWeekDays); if (!this.byweekday.allWeeks.length) { this.byweekday.allWeeks = null } if (!this.byweekday.someWeeks.length) { this.byweekday.someWeeks = null } } else { this.byweekday = null } } ToText.isFullyConvertible = function(rrule) { if (!(rrule.options.freq in ToText.IMPLEMENTED)) { return false } if (rrule.origOptions.until && rrule.origOptions.count) { return false } for (var key in rrule.origOptions) { if (contains(["dtstart", "wkst", "freq"], key)) { return true } if (!contains(ToText.IMPLEMENTED[rrule.options.freq], key)) { return false } } return true }; ToText.prototype.isFullyConvertible = function() { return ToText.isFullyConvertible(this.rrule) }; ToText.prototype.toString = function() { var gettext = this.gettext; if (!(this.options.freq in ToText.IMPLEMENTED)) { return gettext("RRule error: Unable to fully convert this rrule to text") } this.text = [gettext("every")]; this[RRule.FREQUENCIES[this.options.freq]](); if (this.options.until) { this.add(gettext("until")); var until = this.options.until; this.add(this.dateFormatter(until.getUTCFullYear(), this.language.monthNames[until.getUTCMonth()], until.getUTCDate())) } else if (this.options.count) { this.add(gettext("for")).add(this.options.count.toString()).add(this.plural(this.options.count) ? gettext("times") : gettext("time")) } if (!this.isFullyConvertible()) { this.add(gettext("(~ approximate)")) } return this.text.join("") }; ToText.prototype.HOURLY = function() { var gettext = this.gettext; if (1 !== this.options.interval) { this.add(this.options.interval.toString()) } this.add(this.plural(this.options.interval) ? gettext("hours") : gettext("hour")) }; ToText.prototype.MINUTELY = function() { var gettext = this.gettext; if (1 !== this.options.interval) { this.add(this.options.interval.toString()) } this.add(this.plural(this.options.interval) ? gettext("minutes") : gettext("minute")) }; ToText.prototype.DAILY = function() { var gettext = this.gettext; if (1 !== this.options.interval) { this.add(this.options.interval.toString()) } if (this.byweekday && this.byweekday.isWeekdays) { this.add(this.plural(this.options.interval) ? gettext("weekdays") : gettext("weekday")) } else { this.add(this.plural(this.options.interval) ? gettext("days") : gettext("day")) } if (this.origOptions.bymonth) { this.add(gettext("in")); this._bymonth() } if (this.bymonthday) { this._bymonthday() } else if (this.byweekday) { this._byweekday() } else if (this.origOptions.byhour) { this._byhour() } }; ToText.prototype.WEEKLY = function() { var gettext = this.gettext; if (1 !== this.options.interval) { this.add(this.options.interval.toString()).add(this.plural(this.options.interval) ? gettext("weeks") : gettext("week")) } if (this.byweekday && this.byweekday.isWeekdays) { if (1 === this.options.interval) { this.add(this.plural(this.options.interval) ? gettext("weekdays") : gettext("weekday")) } else { this.add(gettext("on")).add(gettext("weekdays")) } } else if (this.byweekday && this.byweekday.isEveryDay) { this.add(this.plural(this.options.interval) ? gettext("days") : gettext("day")) } else { if (1 === this.options.interval) { this.add(gettext("week")) } if (this.origOptions.bymonth) { this.add(gettext("in")); this._bymonth() } if (this.bymonthday) { this._bymonthday() } else if (this.byweekday) { this._byweekday() } } }; ToText.prototype.MONTHLY = function() { var gettext = this.gettext; if (this.origOptions.bymonth) { if (1 !== this.options.interval) { this.add(this.options.interval.toString()).add(gettext("months")); if (this.plural(this.options.interval)) { this.add(gettext("in")) } } this._bymonth() } else { if (1 !== this.options.interval) { this.add(this.options.interval.toString()) } this.add(this.plural(this.options.interval) ? gettext("months") : gettext("month")) } if (this.bymonthday) { this._bymonthday() } else if (this.byweekday && this.byweekday.isWeekdays) { this.add(gettext("on")).add(gettext("weekdays")) } else if (this.byweekday) { this._byweekday() } }; ToText.prototype.YEARLY = function() { var gettext = this.gettext; if (this.origOptions.bymonth) { if (1 !== this.options.interval) { this.add(this.options.interval.toString()); this.add(gettext("years")) } this._bymonth() } else { if (1 !== this.options.interval) { this.add(this.options.interval.toString()) } this.add(this.plural(this.options.interval) ? gettext("years") : gettext("year")) } if (this.bymonthday) { this._bymonthday() } else if (this.byweekday) { this._byweekday() } if (this.options.byyearday) { this.add(gettext("on the")).add(this.list(this.options.byyearday, this.nth, gettext("and"))).add(gettext("day")) } if (this.options.byweekno) { this.add(gettext("in")).add(this.plural(this.options.byweekno.length) ? gettext("weeks") : gettext("week")).add(this.list(this.options.byweekno, void 0, gettext("and"))) } }; ToText.prototype._bymonthday = function() { var gettext = this.gettext; if (this.byweekday && this.byweekday.allWeeks) { this.add(gettext("on")).add(this.list(this.byweekday.allWeeks, this.weekdaytext, gettext("or"))).add(gettext("the")).add(this.list(this.bymonthday, this.nth, gettext("or"))) } else { this.add(gettext("on the")).add(this.list(this.bymonthday, this.nth, gettext("and"))) } }; ToText.prototype._byweekday = function() { var gettext = this.gettext; if (this.byweekday.allWeeks && !this.byweekday.isWeekdays) { this.add(gettext("on")).add(this.list(this.byweekday.allWeeks, this.weekdaytext)) } if (this.byweekday.someWeeks) { if (this.byweekday.allWeeks) { this.add(gettext("and")) } this.add(gettext("on the")).add(this.list(this.byweekday.someWeeks, this.weekdaytext, gettext("and"))) } }; ToText.prototype._byhour = function() { var gettext = this.gettext; this.add(gettext("at")).add(this.list(this.origOptions.byhour, void 0, gettext("and"))) }; ToText.prototype._bymonth = function() { this.add(this.list(this.options.bymonth, this.monthtext, this.gettext("and"))) }; ToText.prototype.nth = function(n) { n = parseInt(n.toString(), 10); var nth; var gettext = this.gettext; if (-1 === n) { return gettext("last") } var npos = Math.abs(n); switch (npos) { case 1: case 21: case 31: nth = npos + gettext("st"); break; case 2: case 22: nth = npos + gettext("nd"); break; case 3: case 23: nth = npos + gettext("rd"); break; default: nth = npos + gettext("th") } return n < 0 ? nth + " " + gettext("last") : nth }; ToText.prototype.monthtext = function(m) { return this.language.monthNames[m - 1] }; ToText.prototype.weekdaytext = function(wday) { var weekday = isNumber(wday) ? (wday + 1) % 7 : wday.getJsWeekday(); return (wday.n ? this.nth(wday.n) + " " : "") + this.language.dayNames[weekday] }; ToText.prototype.plural = function(n) { return n % 100 !== 1 }; ToText.prototype.add = function(s) { this.text.push(" "); this.text.push(s); return this }; ToText.prototype.list = function(arr, callback, finalDelim, delim) { var _this = this; if (void 0 === delim) { delim = "," } if (!isArray(arr)) { arr = [arr] } callback = callback || function(o) { return o.toString() }; var realCallback = function(arg) { return callback && callback.call(_this, arg) }; if (finalDelim) { return function(array, delimiter, finalDelimiter) { var list = ""; for (var i = 0; i < array.length; i++) { if (0 !== i) { if (i === array.length - 1) { list += " " + finalDelimiter + " " } else { list += delimiter + " " } } list += array[i] } return list }(arr.map(realCallback), delim, finalDelim) } else { return arr.map(realCallback).join(delim + " ") } }; return ToText }(); var totext = ToText; var Parser = function() { function Parser(rules) { this.done = true; this.rules = rules } Parser.prototype.start = function(text) { this.text = text; this.done = false; return this.nextSymbol() }; Parser.prototype.isDone = function() { return this.done && null === this.symbol }; Parser.prototype.nextSymbol = function() { var best; var bestSymbol; this.symbol = null; this.value = null; do { if (this.done) { return false } var rule = void 0; best = null; for (var name_1 in this.rules) { rule = this.rules[name_1]; var match = rule.exec(this.text); if (match) { if (null === best || match[0].length > best[0].length) { best = match; bestSymbol = name_1 } } } if (null != best) { this.text = this.text.substr(best[0].length); if ("" === this.text) { this.done = true } } if (null == best) { this.done = true; this.symbol = null; this.value = null; return } } while ("SKIP" === bestSymbol); this.symbol = bestSymbol; this.value = best; return true }; Parser.prototype.accept = function(name) { if (this.symbol === name) { if (this.value) { var v = this.value; this.nextSymbol(); return v } this.nextSymbol(); return true } return false }; Parser.prototype.acceptNumber = function() { return this.accept("number") }; Parser.prototype.expect = function(name) { if (this.accept(name)) { return true } throw new Error("expected " + name + " but found " + this.symbol) }; return Parser }(); function parseText(text, language) { if (void 0 === language) { language = i18n } var options = {}; var ttr = new Parser(language.tokens); if (!ttr.start(text)) { return null }! function() { ttr.expect("every"); var n = ttr.acceptNumber(); if (n) { options.interval = parseInt(n[0], 10) } if (ttr.isDone()) { throw new Error("Unexpected end") } switch (ttr.symbol) { case "day(s)": options.freq = RRule.DAILY; if (ttr.nextSymbol()) { ! function() { var at = ttr.accept("at"); if (!at) { return } do { var n = ttr.acceptNumber(); if (!n) { throw new Error("Unexpected symbol " + ttr.symbol + ", expected hour") } options.byhour = [parseInt(n[0], 10)]; while (ttr.accept("comma")) { n = ttr.acceptNumber(); if (!n) { throw new Error("Unexpected symbol " + ttr.symbol + "; expected hour") } options.byhour.push(parseInt(n[0], 10)) } } while (ttr.accept("comma") || ttr.accept("at")) }(); F() } break; case "weekday(s)": options.freq = RRule.WEEKLY; options.byweekday = [RRule.MO, RRule.TU, RRule.WE, RRule.TH, RRule.FR]; ttr.nextSymbol(); F(); break; case "week(s)": options.freq = RRule.WEEKLY; if (ttr.nextSymbol()) { ON(); F() } break; case "hour(s)": options.freq = RRule.HOURLY; if (ttr.nextSymbol()) { ON(); F() } break; case "minute(s)": options.freq = RRule.MINUTELY; if (ttr.nextSymbol()) { ON(); F() } break; case "month(s)": options.freq = RRule.MONTHLY; if (ttr.nextSymbol()) { ON(); F() } break; case "year(s)": options.freq = RRule.YEARLY; if (ttr.nextSymbol()) { ON(); F() } break; case "monday": case "tuesday": case "wednesday": case "thursday": case "friday": case "saturday": case "sunday": options.freq = RRule.WEEKLY; var key = ttr.symbol.substr(0, 2).toUpperCase(); options.byweekday = [RRule[key]]; if (!ttr.nextSymbol()) { return } while (ttr.accept("comma")) { if (ttr.isDone()) { throw new Error("Unexpected end") } var wkd = decodeWKD(); if (!wkd) { throw new Error("Unexpected symbol " + ttr.symbol + ", expected weekday") } options.byweekday.push(RRule[wkd]); ttr.nextSymbol() }! function() { ttr.accept("on"); ttr.accept("the"); var nth = decodeNTH(); if (!nth) { return } options.bymonthday = [nth]; ttr.nextSymbol(); while (ttr.accept("comma")) { nth = decodeNTH(); if (!nth) { throw new Error("Unexpected symbol " + ttr.symbol + "; expected monthday") } options.bymonthday.push(nth); ttr.nextSymbol() } }(); F(); break; case "january": case "february": case "march": case "april": case "may": case "june": case "july": case "august": case "september": case "october": case "november": case "december": options.freq = RRule.YEARLY; options.bymonth = [decodeM()]; if (!ttr.nextSymbol()) { return } while (ttr.accept("comma")) { if (ttr.isDone()) { throw new Error("Unexpected end") } var m = decodeM(); if (!m) { throw new Error("Unexpected symbol " + ttr.symbol + ", expected month") } options.bymonth.push(m); ttr.nextSymbol() } ON(); F(); break; default: throw new Error("Unknown symbol") } }(); return options; function ON() { var on = ttr.accept("on"); var the = ttr.accept("the"); if (!(on || the)) { return } do { var nth = decodeNTH(); var wkd = decodeWKD(); var m = decodeM(); if (nth) { if (wkd) { ttr.nextSymbol(); if (!options.byweekday) { options.byweekday = [] } options.byweekday.push(RRule[wkd].nth(nth)) } else { if (!options.bymonthday) { options.bymonthday = [] } options.bymonthday.push(nth); ttr.accept("day(s)") } } else if (wkd) { ttr.nextSymbol(); if (!options.byweekday) { options.byweekday = [] } options.byweekday.push(RRule[wkd]) } else if ("weekday(s)" === ttr.symbol) { ttr.nextSymbol(); if (!options.byweekday) { options.byweekday = [RRule.MO, RRule.TU, RRule.WE, RRule.TH, RRule.FR] } } else if ("week(s)" === ttr.symbol) { ttr.nextSymbol(); var n = ttr.acceptNumber(); if (!n) { throw new Error("Unexpected symbol " + ttr.symbol + ", expected week number") } options.byweekno = [parseInt(n[0], 10)]; while (ttr.accept("comma")) { n = ttr.acceptNumber(); if (!n) { throw new Error("Unexpected symbol " + ttr.symbol + "; expected monthday") } options.byweekno.push(parseInt(n[0], 10)) } } else if (m) { ttr.nextSymbol(); if (!options.bymonth) { options.bymonth = [] } options.bymonth.push(m) } else { return } } while (ttr.accept("comma") || ttr.accept("the") || ttr.accept("on")) } function decodeM() { switch (ttr.symbol) { case "january": return 1; case "february": return 2; case "march": return 3; case "april": return 4; case "may": return 5; case "june": return 6; case "july": return 7; case "august": return 8; case "september": return 9; case "october": return 10; case "november": return 11; case "december": return 12; default: return false } } function decodeWKD() { switch (ttr.symbol) { case "monday": case "tuesday": case "wednesday": case "thursday": case "friday": case "saturday": case "sunday": return ttr.symbol.substr(0, 2).toUpperCase(); default: return false } } function decodeNTH() { switch (ttr.symbol) { case "last": ttr.nextSymbol(); return -1; case "first": ttr.nextSymbol(); return 1; case "second": ttr.nextSymbol(); return ttr.accept("last") ? -2 : 2; case "third": ttr.nextSymbol(); return ttr.accept("last") ? -3 : 3; case "nth": var v = parseInt(ttr.value[1], 10); if (v < -366 || v > 366) { throw new Error("Nth out of range: " + v) } ttr.nextSymbol(); return ttr.accept("last") ? -v : v; default: return false } } function F() { if ("until" === ttr.symbol) { var date = Date.parse(ttr.text); if (!date) { throw new Error("Cannot parse until date:" + ttr.text) } options.until = new Date(date) } else if (ttr.accept("for")) { options.count = parseInt(ttr.value[0], 10); ttr.expect("number") } } } var Frequency; ! function(Frequency) { Frequency[Frequency.YEARLY = 0] = "YEARLY"; Frequency[Frequency.MONTHLY = 1] = "MONTHLY"; Frequency[Frequency.WEEKLY = 2] = "WEEKLY"; Frequency[Frequency.DAILY = 3] = "DAILY"; Frequency[Frequency.HOURLY = 4] = "HOURLY"; Frequency[Frequency.MINUTELY = 5] = "MINUTELY"; Frequency[Frequency.SECONDLY = 6] = "SECONDLY" }(Frequency || (Frequency = {})); function freqIsDailyOrGreater(freq) { return freq < Frequency.HOURLY } /* ! * rrule.js - Library for working with recurrence rules for calendar dates. * https://github.com/jakubroztocil/rrule * * Copyright 2010, Jakub Roztocil and Lars Schoning * Licenced under the BSD licence. * https://github.com/jakubroztocil/rrule/blob/master/LICENCE * */ var fromText = function(text, language) { if (void 0 === language) { language = i18n } return new RRule(parseText(text, language) || void 0) }; var common = ["count", "until", "interval", "byweekday", "bymonthday", "bymonth"]; totext.IMPLEMENTED = []; totext.IMPLEMENTED[Frequency.HOURLY] = common; totext.IMPLEMENTED[Frequency.MINUTELY] = common; totext.IMPLEMENTED[Frequency.DAILY] = ["byhour"].concat(common); totext.IMPLEMENTED[Frequency.WEEKLY] = common; totext.IMPLEMENTED[Frequency.MONTHLY] = common; totext.IMPLEMENTED[Frequency.YEARLY] = ["byweekno", "byyearday"].concat(common); var isFullyConvertible = totext.isFullyConvertible; var Time = function() { function Time(hour, minute, second, millisecond) { this.hour = hour; this.minute = minute; this.second = second; this.millisecond = millisecond || 0 } Time.prototype.getHours = function() { return this.hour }; Time.prototype.getMinutes = function() { return this.minute }; Time.prototype.getSeconds = function() { return this.second }; Time.prototype.getMilliseconds = function() { return this.millisecond }; Time.prototype.getTime = function() { return 1e3 * (60 * this.hour * 60 + 60 * this.minute + this.second) + this.millisecond }; return Time }(); var DateTime = function(_super) { __extends(DateTime, _super); function DateTime(year, month, day, hour, minute, second, millisecond) { var _this = _super.call(this, hour, minute, second, millisecond) || this; _this.year = year; _this.month = month; _this.day = day; return _this } DateTime.fromDate = function(date) { return new this(date.getUTCFullYear(), date.getUTCMonth() + 1, date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.valueOf() % 1e3) }; DateTime.prototype.getWeekday = function() { return getWeekday(new Date(this.getTime())) }; DateTime.prototype.getTime = function() { return new Date(Date.UTC(this.year, this.month - 1, this.day, this.hour, this.minute, this.second, this.millisecond)).getTime() }; DateTime.prototype.getDay = function() { return this.day }; DateTime.prototype.getMonth = function() { return this.month }; DateTime.prototype.getYear = function() { return this.year }; DateTime.prototype.addYears = function(years) { this.year += years }; DateTime.prototype.addMonths = function(months) { this.month += months; if (this.month > 12) { var yearDiv = Math.floor(this.month / 12); var monthMod = pymod(this.month, 12); this.month = monthMod; this.year += yearDiv; if (0 === this.month) { this.month = 12; --this.year } } }; DateTime.prototype.addWeekly = function(days, wkst) { if (wkst > this.getWeekday()) { this.day += -(this.getWeekday() + 1 + (6 - wkst)) + 7 * days } else { this.day += -(this.getWeekday() - wkst) + 7 * days } this.fixDay() }; DateTime.prototype.addDaily = function(days) { this.day += days; this.fixDay() }; DateTime.prototype.addHours = function(hours, filtered, byhour) { if (filtered) { this.hour += Math.floor((23 - this.hour) / hours) * hours } for (;;) { this.hour += hours; var _a = divmod(this.hour, 24), dayDiv = _a.div, hourMod = _a.mod; if (dayDiv) { this.hour = hourMod; this.addDaily(dayDiv) } if (empty(byhour) || includes(byhour, this.hour)) { break } } }; DateTime.prototype.addMinutes = function(minutes, filtered, byhour, byminute) { if (filtered) { this.minute += Math.floor((1439 - (60 * this.hour + this.minute)) / minutes) * minutes } for (;;) { this.minute += minutes; var _a = divmod(this.minute, 60), hourDiv = _a.div, minuteMod = _a.mod; if (hourDiv) { this.minute = minuteMod; this.addHours(hourDiv, false, byhour) } if ((empty(byhour) || includes(byhour, this.hour)) && (empty(byminute) || includes(byminute, this.minute))) { break } } }; DateTime.prototype.addSeconds = function(seconds, filtered, byhour, byminute, bysecond) { if (filtered) { this.second += Math.floor((86399 - (3600 * this.hour + 60 * this.minute + this.second)) / seconds) * seconds } for (;;) { this.second += seconds; var _a = divmod(this.second, 60), minuteDiv = _a.div, secondMod = _a.mod; if (minuteDiv) { this.second = secondMod; this.addMinutes(minuteDiv, false, byhour, byminute) } if ((empty(byhour) || includes(byhour, this.hour)) && (empty(byminute) || includes(byminute, this.minute)) && (empty(bysecond) || includes(bysecond, this.second))) { break } } }; DateTime.prototype.fixDay = function() { if (this.day <= 28) { return } var daysinmonth = monthRange(this.year, this.month - 1)[1]; if (this.day <= daysinmonth) { return } while (this.day > daysinmonth) { this.day -= daysinmonth; ++this.month; if (13 === this.month) { this.month = 1; ++this.year; if (this.year > MAXYEAR) { return } } daysinmonth = monthRange(this.year, this.month - 1)[1] } }; DateTime.prototype.add = function(options, filtered) { var freq = options.freq, interval = options.interval, wkst = options.wkst, byhour = options.byhour, byminute = options.byminute, bysecond = options.bysecond; switch (freq) { case Frequency.YEARLY: return this.addYears(interval); case Frequency.MONTHLY: return this.addMonths(interval); case Frequency.WEEKLY: return this.addWeekly(interval, wkst); case Frequency.DAILY: return this.addDaily(interval); case Frequency.HOURLY: return this.addHours(interval, filtered, byhour); case Frequency.MINUTELY: return this.addMinutes(interval, filtered, byhour, byminute); case Frequency.SECONDLY: return this.addSeconds(interval, filtered, byhour, byminute, bysecond) } }; return DateTime }(Time); function initializeOptions(options) { var invalid = []; var keys = Object.keys(options); for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { var key = keys_1[_i]; if (!includes(defaultKeys, key)) { invalid.push(key) } if (isDate(options[key]) && !isValidDate(options[key])) { invalid.push(key) } } if (invalid.length) { throw new Error("Invalid options: " + invalid.join(", ")) } return __assign({}, options) } function parseOptions(options) { var opts = __assign(__assign({}, DEFAULT_OPTIONS), initializeOptions(options)); if (isPresent(opts.byeaster)) { opts.freq = RRule.YEARLY } if (!(isPresent(opts.freq) && RRule.FREQUENCIES[opts.freq])) { throw new Error("Invalid frequency: ".concat(opts.freq, " ").concat(options.freq)) } if (!opts.dtstart) { opts.dtstart = new Date((new Date).setMilliseconds(0)) } if (!isPresent(opts.wkst)) { opts.wkst = RRule.MO.weekday } else if (isNumber(opts.wkst)) {} else { opts.wkst = opts.wkst.weekday } if (isPresent(opts.bysetpos)) { if (isNumber(opts.bysetpos)) { opts.bysetpos = [opts.bysetpos] } for (var i = 0; i < opts.bysetpos.length; i++) { var v = opts.bysetpos[i]; if (0 === v || !(v >= -366 && v <= 366)) { throw new Error("bysetpos must be between 1 and 366, or between -366 and -1") } } } if (!(Boolean(opts.byweekno) || notEmpty(opts.byweekno) || notEmpty(opts.byyearday) || Boolean(opts.bymonthday) || notEmpty(opts.bymonthday) || isPresent(opts.byweekday) || isPresent(opts.byeaster))) { switch (opts.freq) { case RRule.YEARLY: if (!opts.bymonth) { opts.bymonth = opts.dtstart.getUTCMonth() + 1 } opts.bymonthday = opts.dtstart.getUTCDate(); break; case RRule.MONTHLY: opts.bymonthday = opts.dtstart.getUTCDate(); break; case RRule.WEEKLY: opts.byweekday = [getWeekday(opts.dtstart)] } } if (isPresent(opts.bymonth) && !isArray(opts.bymonth)) { opts.bymonth = [opts.bymonth] } if (isPresent(opts.byyearday) && !isArray(opts.byyearday) && isNumber(opts.byyearday)) { opts.byyearday = [opts.byyearday] } if (!isPresent(opts.bymonthday)) { opts.bymonthday = []; opts.bynmonthday = [] } else if (isArray(opts.bymonthday)) { var bymonthday = []; var bynmonthday = []; for (i = 0; i < opts.bymonthday.length; i++) { v = opts.bymonthday[i]; if (v > 0) { bymonthday.push(v) } else if (v < 0) { bynmonthday.push(v) } } opts.bymonthday = bymonthday; opts.bynmonthday = bynmonthday } else if (opts.bymonthday < 0) { opts.bynmonthday = [opts.bymonthday]; opts.bymonthday = [] } else { opts.bynmonthday = []; opts.bymonthday = [opts.bymonthday] } if (isPresent(opts.byweekno) && !isArray(opts.byweekno)) { opts.byweekno = [opts.byweekno] } if (!isPresent(opts.byweekday)) { opts.bynweekday = null } else if (isNumber(opts.byweekday)) { opts.byweekday = [opts.byweekday]; opts.bynweekday = null } else if (isWeekdayStr(opts.byweekday)) { opts.byweekday = [Weekday.fromStr(opts.byweekday).weekday]; opts.bynweekday = null } else if (opts.byweekday instanceof Weekday) { if (!opts.byweekday.n || opts.freq > RRule.MONTHLY) { opts.byweekday = [opts.byweekday.weekday]; opts.bynweekday = null } else { opts.bynweekday = [ [opts.byweekday.weekday, opts.byweekday.n] ]; opts.byweekday = null } } else { var byweekday = []; var bynweekday = []; for (i = 0; i < opts.byweekday.length; i++) { var wday = opts.byweekday[i]; if (isNumber(wday)) { byweekday.push(wday); continue } else if (isWeekdayStr(wday)) { byweekday.push(Weekday.fromStr(wday).weekday); continue } if (!wday.n || opts.freq > RRule.MONTHLY) { byweekday.push(wday.weekday) } else { bynweekday.push([wday.weekday, wday.n]) } } opts.byweekday = notEmpty(byweekday) ? byweekday : null; opts.bynweekday = notEmpty(bynweekday) ? bynweekday : null } if (!isPresent(opts.byhour)) { opts.byhour = opts.freq < RRule.HOURLY ? [opts.dtstart.getUTCHours()] : null } else if (isNumber(opts.byhour)) { opts.byhour = [opts.byhour] } if (!isPresent(opts.byminute)) { opts.byminute = opts.freq < RRule.MINUTELY ? [opts.dtstart.getUTCMinutes()] : null } else if (isNumber(opts.byminute)) { opts.byminute = [opts.byminute] } if (!isPresent(opts.bysecond)) { opts.bysecond = opts.freq < RRule.SECONDLY ? [opts.dtstart.getUTCSeconds()] : null } else if (isNumber(opts.bysecond)) { opts.bysecond = [opts.bysecond] } return { parsedOptions: opts } } function parseString(rfcString) { var options = rfcString.split("\n").map(parseLine).filter((function(x) { return null !== x })); return __assign(__assign({}, options[0]), options[1]) } function parseDtstart(line) { var options = {}; var dtstartWithZone = /DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(line); if (!dtstartWithZone) { return options } var tzid = dtstartWithZone[1], dtstart = dtstartWithZone[2]; if (tzid) { options.tzid = tzid } options.dtstart = untilStringToDate(dtstart); return options } function parseLine(rfcString) { rfcString = rfcString.replace(/^\s+|\s+$/, ""); if (!rfcString.length) { return null } var header = /^([A-Z]+?)[:;]/.exec(rfcString.toUpperCase()); if (!header) { return parseRrule(rfcString) } var key = header[1]; switch (key.toUpperCase()) { case "RRULE": case "EXRULE": return parseRrule(rfcString); case "DTSTART": return parseDtstart(rfcString); default: throw new Error("Unsupported RFC prop ".concat(key, " in ").concat(rfcString)) } } function parseRrule(line) { var strippedLine = line.replace(/^RRULE:/i, ""); var options = parseDtstart(strippedLine); var attrs = line.replace(/^(?:RRULE|EXRULE):/i, "").split(";"); attrs.forEach((function(attr) { var _a = attr.split("="), key = _a[0], value = _a[1]; switch (key.toUpperCase()) { case "FREQ": options.freq = Frequency[value.toUpperCase()]; break; case "WKST": options.wkst = Days[value.toUpperCase()]; break; case "COUNT": case "INTERVAL": case "BYSETPOS": case "BYMONTH": case "BYMONTHDAY": case "BYYEARDAY": case "BYWEEKNO": case "BYHOUR": case "BYMINUTE": case "BYSECOND": var num = function(value) { if (-1 !== value.indexOf(",")) { var values = value.split(","); return values.map(parseIndividualNumber) } return parseIndividualNumber(value) }(value); var optionKey = key.toLowerCase(); options[optionKey] = num; break; case "BYWEEKDAY": case "BYDAY": options.byweekday = function(value) { var days = value.split(","); return days.map((function(day) { if (2 === day.length) { return Days[day] } var parts = day.match(/^([+-]?\d{1,2})([A-Z]{2})$/); if (!parts || parts.length < 3) { throw new SyntaxError("Invalid weekday string: ".concat(day)) } var n = Number(parts[1]); var wdaypart = parts[2]; var wday = Days[wdaypart].weekday; return new Weekday(wday, n) })) }(value); break; case "DTSTART": case "TZID": var dtstart = parseDtstart(line); options.tzid = dtstart.tzid; options.dtstart = dtstart.dtstart; break; case "UNTIL": options.until = untilStringToDate(value); break; case "BYEASTER": options.byeaster = Number(value); break; default: throw new Error("Unknown RRULE property '" + key + "'") } })); return options } function parseIndividualNumber(value) { if (/^[+-]?\d+$/.test(value)) { return Number(value) } return value } var DateWithZone = function() { function DateWithZone(date, tzid) { if (isNaN(date.getTime())) { throw new RangeError("Invalid date passed to DateWithZone") } this.date = date; this.tzid = tzid } Object.defineProperty(DateWithZone.prototype, "isUTC", { get: function() { return !this.tzid || "UTC" === this.tzid.toUpperCase() }, enumerable: false, configurable: true }); DateWithZone.prototype.toString = function() { var datestr = timeToUntilString(this.date.getTime(), this.isUTC); if (!this.isUTC) { return ";TZID=".concat(this.tzid, ":").concat(datestr) } return ":".concat(datestr) }; DateWithZone.prototype.getTime = function() { return this.date.getTime() }; DateWithZone.prototype.rezonedDate = function() { if (this.isUTC) { return this.date } return function(date, timeZone) { var localTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone; var dateInLocalTZ = new Date(dateTZtoISO8601(date, localTimeZone)); var dateInTargetTZ = new Date(dateTZtoISO8601(date, null !== timeZone && void 0 !== timeZone ? timeZone : "UTC")); var tzOffset = dateInTargetTZ.getTime() - dateInLocalTZ.getTime(); return new Date(date.getTime() - tzOffset) }(this.date, this.tzid) }; return DateWithZone }(); function optionsToString(options) { var rrule = []; var dtstart = ""; var keys = Object.keys(options); var defaultKeys = Object.keys(DEFAULT_OPTIONS); for (var i = 0; i < keys.length; i++) { if ("tzid" === keys[i]) { continue } if (!includes(defaultKeys, keys[i])) { continue } var key = keys[i].toUpperCase(); var value = options[keys[i]]; var outValue = ""; if (!isPresent(value) || isArray(value) && !value.length) { continue } switch (key) { case "FREQ": outValue = RRule.FREQUENCIES[options.freq]; break; case "WKST": if (isNumber(value)) { outValue = new Weekday(value).toString() } else { outValue = value.toString() } break; case "BYWEEKDAY": key = "BYDAY"; outValue = toArray(value).map((function(wday) { if (wday instanceof Weekday) { return wday } if (isArray(wday)) { return new Weekday(wday[0], wday[1]) } return new Weekday(wday) })).toString(); break; case "DTSTART": dtstart = buildDtstart(value, options.tzid); break; case "UNTIL": outValue = timeToUntilString(value, !options.tzid); break; default: if (isArray(value)) { var strValues = []; for (var j = 0; j < value.length; j++) { strValues[j] = String(value[j]) } outValue = strValues.toString() } else { outValue = String(value) } } if (outValue) { rrule.push([key, outValue]) } } var rules = rrule.map((function(_a) { var key = _a[0], value = _a[1]; return "".concat(key, "=").concat(value.toString()) })).join(";"); var ruleString = ""; if ("" !== rules) { ruleString = "RRULE:".concat(rules) } return [dtstart, ruleString].filter((function(x) { return !!x })).join("\n") } function buildDtstart(dtstart, tzid) { if (!dtstart) { return "" } return "DTSTART" + new DateWithZone(new Date(dtstart), tzid).toString() } function argsMatch(left, right) { if (Array.isArray(left)) { if (!Array.isArray(right)) { return false } if (left.length !== right.length) { return false } return left.every((function(date, i) { return date.getTime() === right[i].getTime() })) } if (left instanceof Date) { return right instanceof Date && left.getTime() === right.getTime() } return left === right } var Cache = function() { function Cache() { this.all = false; this.before = []; this.after = []; this.between = [] } Cache.prototype._cacheAdd = function(what, value, args) { if (value) { value = value instanceof Date ? dateutil_clone(value) : cloneDates(value) } if ("all" === what) { this.all = value } else { args._value = value; this[what].push(args) } }; Cache.prototype._cacheGet = function(what, args) { var cached = false; var argsKeys = args ? Object.keys(args) : []; var findCacheDiff = function(item) { for (var i = 0; i < argsKeys.length; i++) { var key = argsKeys[i]; if (!argsMatch(args[key], item[key])) { return true } } return false }; var cachedObject = this[what]; if ("all" === what) { cached = this.all } else if (isArray(cachedObject)) { for (var i = 0; i < cachedObject.length; i++) { var item = cachedObject[i]; if (argsKeys.length && findCacheDiff(item)) { continue } cached = item._value; break } } if (!cached && this.all) { var iterResult = new iterresult(what, args); for (i = 0; i < this.all.length; i++) { if (!iterResult.accept(this.all[i])) { break } } cached = iterResult.getValue(); this._cacheAdd(what, cached, args) } return isArray(cached) ? cloneDates(cached) : cached instanceof Date ? dateutil_clone(cached) : cached }; return Cache }(); var M365MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], repeat(1, 31), true), repeat(2, 28), true), repeat(3, 31), true), repeat(4, 30), true), repeat(5, 31), true), repeat(6, 30), true), repeat(7, 31), true), repeat(8, 31), true), repeat(9, 30), true), repeat(10, 31), true), repeat(11, 30), true), repeat(12, 31), true), repeat(1, 7), true); var M366MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], repeat(1, 31), true), repeat(2, 29), true), repeat(3, 31), true), repeat(4, 30), true), repeat(5, 31), true), repeat(6, 30), true), repeat(7, 31), true), repeat(8, 31), true), repeat(9, 30), true), repeat(10, 31), true), repeat(11, 30), true), repeat(12, 31), true), repeat(1, 7), true); var M28 = range(1, 29); var M29 = range(1, 30); var M30 = range(1, 31); var M31 = range(1, 32); var MDAY366MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], M31, true), M29, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31.slice(0, 7), true); var MDAY365MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], M31, true), M28, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31.slice(0, 7), true); var NM28 = range(-28, 0); var NM29 = range(-29, 0); var NM30 = range(-30, 0); var NM31 = range(-31, 0); var NMDAY366MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], NM31, true), NM29, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31.slice(0, 7), true); var NMDAY365MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], NM31, true), NM28, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31.slice(0, 7), true); var M366RANGE = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366]; var M365RANGE = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]; var WDAYMASK = function() { var wdaymask = []; for (var i = 0; i < 55; i++) { wdaymask = wdaymask.concat(range(7)) } return wdaymask }(); function rebuildYear(year, options) { var firstyday = datetime(year, 1, 1); var yearlen = isLeapYear(year) ? 366 : 365; var nextyearlen = isLeapYear(year + 1) ? 366 : 365; var yearordinal = toOrdinal(firstyday); var yearweekday = getWeekday(firstyday); var result = __assign(__assign({ yearlen: yearlen, nextyearlen: nextyearlen, yearordinal: yearordinal, yearweekday: yearweekday }, function(year) { var yearlen = isLeapYear(year) ? 366 : 365; var firstyday = datetime(year, 1, 1); var wday = getWeekday(firstyday); if (365 === yearlen) { return { mmask: M365MASK, mdaymask: MDAY365MASK, nmdaymask: NMDAY365MASK, wdaymask: WDAYMASK.slice(wday), mrange: M365RANGE } } return { mmask: M366MASK, mdaymask: MDAY366MASK, nmdaymask: NMDAY366MASK, wdaymask: WDAYMASK.slice(wday), mrange: M366RANGE } }(year)), { wnomask: null }); if (empty(options.byweekno)) { return result } result.wnomask = repeat(0, yearlen + 7); var firstwkst; var wyearlen; var no1wkst = firstwkst = pymod(7 - yearweekday + options.wkst, 7); if (no1wkst >= 4) { no1wkst = 0; wyearlen = result.yearlen + pymod(yearweekday - options.wkst, 7) } else { wyearlen = yearlen - no1wkst } var div = Math.floor(wyearlen / 7); var mod = pymod(wyearlen, 7); var numweeks = Math.floor(div + mod / 4); for (var j = 0; j < options.byweekno.length; j++) { var n = options.byweekno[j]; if (n < 0) { n += numweeks + 1 } if (!(n > 0 && n <= numweeks)) { continue } var i = void 0; if (n > 1) { i = no1wkst + 7 * (n - 1); if (no1wkst !== firstwkst) { i -= 7 - firstwkst } } else { i = no1wkst } for (var k = 0; k < 7; k++) { result.wnomask[i] = 1; i++; if (result.wdaymask[i] === options.wkst) { break } } } if (includes(options.byweekno, 1)) { i = no1wkst + 7 * numweeks; if (no1wkst !== firstwkst) { i -= 7 - firstwkst } if (i < yearlen) { for (j = 0; j < 7; j++) { result.wnomask[i] = 1; i += 1; if (result.wdaymask[i] === options.wkst) { break } } } } if (no1wkst) { var lnumweeks = void 0; if (!includes(options.byweekno, -1)) { var lyearweekday = getWeekday(datetime(year - 1, 1, 1)); var lno1wkst = pymod(7 - lyearweekday.valueOf() + options.wkst, 7); var lyearlen = isLeapYear(year - 1) ? 366 : 365; var weekst = void 0; if (lno1wkst >= 4) { lno1wkst = 0; weekst = lyearlen + pymod(lyearweekday - options.wkst, 7) } else { weekst = yearlen - no1wkst } lnumweeks = Math.floor(52 + pymod(weekst, 7) / 4) } else { lnumweeks = -1 } if (includes(options.byweekno, lnumweeks)) { for (i = 0; i < no1wkst; i++) { result.wnomask[i] = 1 } } } return result } var Iterinfo = function() { function Iterinfo(options) { this.options = options } Iterinfo.prototype.rebuild = function(year, month) { var options = this.options; if (year !== this.lastyear) { this.yearinfo = rebuildYear(year, options) } if (notEmpty(options.bynweekday) && (month !== this.lastmonth || year !== this.lastyear)) { var _a = this.yearinfo, yearlen = _a.yearlen, mrange = _a.mrange, wdaymask = _a.wdaymask; this.monthinfo = function(year, month, yearlen, mrange, wdaymask, options) { var result = { lastyear: year, lastmonth: month, nwdaymask: [] }; var ranges = []; if (options.freq === RRule.YEARLY) { if (empty(options.bymonth)) { ranges = [ [0, yearlen] ] } else { for (var j = 0; j < options.bymonth.length; j++) { month = options.bymonth[j]; ranges.push(mrange.slice(month - 1, month + 1)) } } } else if (options.freq === RRule.MONTHLY) { ranges = [mrange.slice(month - 1, month + 1)] } if (empty(ranges)) { return result } result.nwdaymask = repeat(0, yearlen); for (j = 0; j < ranges.length; j++) { var rang = ranges[j]; var first = rang[0]; var last = rang[1] - 1; for (var k = 0; k < options.bynweekday.length; k++) { var i = void 0; var _a = options.bynweekday[k], wday = _a[0], n = _a[1]; if (n < 0) { i = last + 7 * (n + 1); i -= pymod(wdaymask[i] - wday, 7) } else { i = first + 7 * (n - 1); i += pymod(7 - wdaymask[i] + wday, 7) } if (first <= i && i <= last) { result.nwdaymask[i] = 1 } } } return result }(year, month, yearlen, mrange, wdaymask, options) } if (isPresent(options.byeaster)) { this.eastermask = function(y, offset) { if (void 0 === offset) { offset = 0 } var a = y % 19; var b = Math.floor(y / 100); var c = y % 100; var d = Math.floor(b / 4); var e = b % 4; var f = Math.floor((b + 8) / 25); var g = Math.floor((b - f + 1) / 3); var h = Math.floor(19 * a + b - d - g + 15) % 30; var i = Math.floor(c / 4); var k = c % 4; var l = Math.floor(32 + 2 * e + 2 * i - h - k) % 7; var m = Math.floor((a + 11 * h + 22 * l) / 451); var month = Math.floor((h + l - 7 * m + 114) / 31); var day = (h + l - 7 * m + 114) % 31 + 1; var date = Date.UTC(y, month - 1, day + offset); var yearStart = Date.UTC(y, 0, 1); return [Math.ceil((date - yearStart) / 864e5)] }(year, options.byeaster) } }; Object.defineProperty(Iterinfo.prototype, "lastyear", { get: function() { return this.monthinfo ? this.monthinfo.lastyear : null }, enumerable: false, configurable: true }); Object.defineProperty(Iterinfo.prototype, "lastmonth", { get: function() { return this.monthinfo ? this.monthinfo.lastmonth : null }, enumerable: false, configurable: true }); Object.defineProperty(Iterinfo.prototype, "yearlen", { get: function() { return this.yearinfo.yearlen }, enumerable: false, configurable: true }); Object.defineProperty(Iterinfo.prototype, "yearordinal", { get: function() { return this.yearinfo.yearordinal }, enumerable: false, configurable: true }); Object.defineProperty(Iterinfo.prototype, "mrange", { get: function() { return this.yearinfo.mrange }, enumerable: false, configurable: true }); Object.defineProperty(Iterinfo.prototype, "wdaymask", { get: function() { return this.yearinfo.wdaymask }, enumerable: false, configurable: true }); Object.defineProperty(Iterinfo.prototype, "mmask", { get: function() { return this.yearinfo.mmask }, enumerable: false, configurable: true }); Object.defineProperty(Iterinfo.prototype, "wnomask", { get: function() { return this.yearinfo.wnomask }, enumerable: false, configurable: true }); Object.defineProperty(Iterinfo.prototype, "nwdaymask", { get: function() { return this.monthinfo ? this.monthinfo.nwdaymask : [] }, enumerable: false, configurable: true }); Object.defineProperty(Iterinfo.prototype, "nextyearlen", { get: function() { return this.yearinfo.nextyearlen }, enumerable: false, configurable: true }); Object.defineProperty(Iterinfo.prototype, "mdaymask", { get: function() { return this.yearinfo.mdaymask }, enumerable: false, configurable: true }); Object.defineProperty(Iterinfo.prototype, "nmdaymask", { get: function() { return this.yearinfo.nmdaymask }, enumerable: false, configurable: true }); Iterinfo.prototype.ydayset = function() { return [range(this.yearlen), 0, this.yearlen] }; Iterinfo.prototype.mdayset = function(_, month) { var start = this.mrange[month - 1]; var end = this.mrange[month]; var set = repeat(null, this.yearlen); for (var i = start; i < end; i++) { set[i] = i } return [set, start, end] }; Iterinfo.prototype.wdayset = function(year, month, day) { var set = repeat(null, this.yearlen + 7); var i = toOrdinal(datetime(year, month, day)) - this.yearordinal; var start = i; for (var j = 0; j < 7; j++) { set[i] = i; ++i; if (this.wdaymask[i] === this.options.wkst) { break } } return [set, start, i] }; Iterinfo.prototype.ddayset = function(year, month, day) { var set = repeat(null, this.yearlen); var i = toOrdinal(datetime(year, month, day)) - this.yearordinal; set[i] = i; return [set, i, i + 1] }; Iterinfo.prototype.htimeset = function(hour, _, second, millisecond) { var _this = this; var set = []; this.options.byminute.forEach((function(minute) { set = set.concat(_this.mtimeset(hour, minute, second, millisecond)) })); sort(set); return set }; Iterinfo.prototype.mtimeset = function(hour, minute, _, millisecond) { var set = this.options.bysecond.map((function(second) { return new Time(hour, minute, second, millisecond) })); sort(set); return set }; Iterinfo.prototype.stimeset = function(hour, minute, second, millisecond) { return [new Time(hour, minute, second, millisecond)] }; Iterinfo.prototype.getdayset = function(freq) { switch (freq) { case Frequency.YEARLY: return this.ydayset.bind(this); case Frequency.MONTHLY: return this.mdayset.bind(this); case Frequency.WEEKLY: return this.wdayset.bind(this); case Frequency.DAILY: default: return this.ddayset.bind(this) } }; Iterinfo.prototype.gettimeset = function(freq) { switch (freq) { case Frequency.HOURLY: return this.htimeset.bind(this); case Frequency.MINUTELY: return this.mtimeset.bind(this); case Frequency.SECONDLY: return this.stimeset.bind(this) } }; return Iterinfo }(); var iterinfo = Iterinfo; function buildPoslist(bysetpos, timeset, start, end, ii, dayset) { var poslist = []; for (var j = 0; j < bysetpos.length; j++) { var daypos = void 0; var timepos = void 0; var pos = bysetpos[j]; if (pos < 0) { daypos = Math.floor(pos / timeset.length); timepos = pymod(pos, timeset.length) } else { daypos = Math.floor((pos - 1) / timeset.length); timepos = pymod(pos - 1, timeset.length) } var tmp = []; for (var k = start; k < end; k++) { var val = dayset[k]; if (!isPresent(val)) { continue } tmp.push(val) } var i = void 0; if (daypos < 0) { i = tmp.slice(daypos)[0] } else { i = tmp[daypos] } var time = timeset[timepos]; var date = fromOrdinal(ii.yearordinal + i); var res = combine(date, time); if (!includes(poslist, res)) { poslist.push(res) } } sort(poslist); return poslist } function iter(iterResult, options) { var dtstart = options.dtstart, freq = options.freq, interval = options.interval, until = options.until, bysetpos = options.bysetpos; var count = options.count; if (0 === count || 0 === interval) { return emitResult(iterResult) } var counterDate = DateTime.fromDate(dtstart); var ii = new iterinfo(options); ii.rebuild(counterDate.year, counterDate.month); var timeset = function(ii, counterDate, options) { var freq = options.freq, byhour = options.byhour, byminute = options.byminute, bysecond = options.bysecond; if (freqIsDailyOrGreater(freq)) { return function(opts) { var millisecondModulo = opts.dtstart.getTime() % 1e3; if (!freqIsDailyOrGreater(opts.freq)) { return [] } var timeset = []; opts.byhour.forEach((function(hour) { opts.byminute.forEach((function(minute) { opts.bysecond.forEach((function(second) { timeset.push(new Time(hour, minute, second, millisecondModulo)) })) })) })); return timeset }(options) } if (freq >= RRule.HOURLY && notEmpty(byhour) && !includes(byhour, counterDate.hour) || freq >= RRule.MINUTELY && notEmpty(byminute) && !includes(byminute, counterDate.minute) || freq >= RRule.SECONDLY && notEmpty(bysecond) && !includes(bysecond, counterDate.second)) { return [] } return ii.gettimeset(freq)(counterDate.hour, counterDate.minute, counterDate.second, counterDate.millisecond) }(ii, counterDate, options); for (;;) { var _a = ii.getdayset(freq)(counterDate.year, counterDate.month, counterDate.day), dayset = _a[0], start = _a[1], end = _a[2]; var filtered = removeFilteredDays(dayset, start, end, ii, options); if (notEmpty(bysetpos)) { var poslist = buildPoslist(bysetpos, timeset, start, end, ii, dayset); for (var j = 0; j < poslist.length; j++) { var res = poslist[j]; if (until && res > until) { return emitResult(iterResult) } if (res >= dtstart) { var rezonedDate = rezoneIfNeeded(res, options); if (!iterResult.accept(rezonedDate)) { return emitResult(iterResult) } if (count) { --count; if (!count) { return emitResult(iterResult) } } } } } else { for (j = start; j < end; j++) { var currentDay = dayset[j]; if (!isPresent(currentDay)) { continue } var date = fromOrdinal(ii.yearordinal + currentDay); for (var k = 0; k < timeset.length; k++) { var time = timeset[k]; res = combine(date, time); if (until && res > until) { return emitResult(iterResult) } if (res >= dtstart) { rezonedDate = rezoneIfNeeded(res, options); if (!iterResult.accept(rezonedDate)) { return emitResult(iterResult) } if (count) { --count; if (!count) { return emitResult(iterResult) } } } } } } if (0 === options.interval) { return emitResult(iterResult) } counterDate.add(options, filtered); if (counterDate.year > MAXYEAR) { return emitResult(iterResult) } if (!freqIsDailyOrGreater(freq)) { timeset = ii.gettimeset(freq)(counterDate.hour, counterDate.minute, counterDate.second, 0) } ii.rebuild(counterDate.year, counterDate.month) } } function isFiltered(ii, currentDay, options) { var bymonth = options.bymonth, byweekno = options.byweekno, byweekday = options.byweekday, byeaster = options.byeaster, bymonthday = options.bymonthday, bynmonthday = options.bynmonthday, byyearday = options.byyearday; return notEmpty(bymonth) && !includes(bymonth, ii.mmask[currentDay]) || notEmpty(byweekno) && !ii.wnomask[currentDay] || notEmpty(byweekday) && !includes(byweekday, ii.wdaymask[currentDay]) || notEmpty(ii.nwdaymask) && !ii.nwdaymask[currentDay] || null !== byeaster && !includes(ii.eastermask, currentDay) || (notEmpty(bymonthday) || notEmpty(bynmonthday)) && !includes(bymonthday, ii.mdaymask[currentDay]) && !includes(bynmonthday, ii.nmdaymask[currentDay]) || notEmpty(byyearday) && (currentDay < ii.yearlen && !includes(byyearday, currentDay + 1) && !includes(byyearday, -ii.yearlen + currentDay) || currentDay >= ii.yearlen && !includes(byyearday, currentDay + 1 - ii.yearlen) && !includes(byyearday, -ii.nextyearlen + currentDay - ii.yearlen)) } function rezoneIfNeeded(date, options) { return new DateWithZone(date, options.tzid).rezonedDate() } function emitResult(iterResult) { return iterResult.getValue() } function removeFilteredDays(dayset, start, end, ii, options) { var filtered = false; for (var dayCounter = start; dayCounter < end; dayCounter++) { var currentDay = dayset[dayCounter]; filtered = isFiltered(ii, currentDay, options); if (filtered) { dayset[currentDay] = null } } return filtered } var Days = { MO: new Weekday(0), TU: new Weekday(1), WE: new Weekday(2), TH: new Weekday(3), FR: new Weekday(4), SA: new Weekday(5), SU: new Weekday(6) }; var DEFAULT_OPTIONS = { freq: Frequency.YEARLY, dtstart: null, interval: 1, wkst: Days.MO, count: null, until: null, tzid: null, bysetpos: null, bymonth: null, bymonthday: null, bynmonthday: null, byyearday: null, byweekno: null, byweekday: null, bynweekday: null, byhour: null, byminute: null, bysecond: null, byeaster: null }; var defaultKeys = Object.keys(DEFAULT_OPTIONS); var RRule = function() { function RRule(options, noCache) { if (void 0 === options) { options = {} } if (void 0 === noCache) { noCache = false } this._cache = noCache ? null : new Cache; this.origOptions = initializeOptions(options); var parsedOptions = parseOptions(options).parsedOptions; this.options = parsedOptions } RRule.parseText = function(text, language) { return parseText(text, language) }; RRule.fromText = function(text, language) { return fromText(text, language) }; RRule.fromString = function(str) { return new RRule(RRule.parseString(str) || void 0) }; RRule.prototype._iter = function(iterResult) { return iter(iterResult, this.options) }; RRule.prototype._cacheGet = function(what, args) { if (!this._cache) { return false } return this._cache._cacheGet(what, args) }; RRule.prototype._cacheAdd = function(what, value, args) { if (!this._cache) { return } return this._cache._cacheAdd(what, value, args) }; RRule.prototype.all = function(iterator) { if (iterator) { return this._iter(new callbackiterresult("all", {}, iterator)) } var result = this._cacheGet("all"); if (false === result) { result = this._iter(new iterresult("all", {})); this._cacheAdd("all", result) } return result }; RRule.prototype.between = function(after, before, inc, iterator) { if (void 0 === inc) { inc = false } if (!isValidDate(after) || !isValidDate(before)) { throw new Error("Invalid date passed in to RRule.between") } var args = { before: before, after: after, inc: inc }; if (iterator) { return this._iter(new callbackiterresult("between", args, iterator)) } var result = this._cacheGet("between", args); if (false === result) { result = this._iter(new iterresult("between", args)); this._cacheAdd("between", result, args) } return result }; RRule.prototype.before = function(dt, inc) { if (void 0 === inc) { inc = false } if (!isValidDate(dt)) { throw new Error("Invalid date passed in to RRule.before") } var args = { dt: dt, inc: inc }; var result = this._cacheGet("before", args); if (false === result) { result = this._iter(new iterresult("before", args)); this._cacheAdd("before", result, args) } return result }; RRule.prototype.after = function(dt, inc) { if (void 0 === inc) { inc = false } if (!isValidDate(dt)) { throw new Error("Invalid date passed in to RRule.after") } var args = { dt: dt, inc: inc }; var result = this._cacheGet("after", args); if (false === result) { result = this._iter(new iterresult("after", args)); this._cacheAdd("after", result, args) } return result }; RRule.prototype.count = function() { return this.all().length }; RRule.prototype.toString = function() { return optionsToString(this.origOptions) }; RRule.prototype.toText = function(gettext, language, dateFormatter) { return function(rrule, gettext, language, dateFormatter) { return new totext(rrule, gettext, language, dateFormatter).toString() }(this, gettext, language, dateFormatter) }; RRule.prototype.isFullyConvertibleToText = function() { return isFullyConvertible(this) }; RRule.prototype.clone = function() { return new RRule(this.origOptions) }; RRule.FREQUENCIES = ["YEARLY", "MONTHLY", "WEEKLY", "DAILY", "HOURLY", "MINUTELY", "SECONDLY"]; RRule.YEARLY = Frequency.YEARLY; RRule.MONTHLY = Frequency.MONTHLY; RRule.WEEKLY = Frequency.WEEKLY; RRule.DAILY = Frequency.DAILY; RRule.HOURLY = Frequency.HOURLY; RRule.MINUTELY = Frequency.MINUTELY; RRule.SECONDLY = Frequency.SECONDLY; RRule.MO = Days.MO; RRule.TU = Days.TU; RRule.WE = Days.WE; RRule.TH = Days.TH; RRule.FR = Days.FR; RRule.SA = Days.SA; RRule.SU = Days.SU; RRule.parseString = parseString; RRule.optionsToString = optionsToString; return RRule }(); var rrulestr_DEFAULT_OPTIONS = { dtstart: null, cache: false, unfold: false, forceset: false, compatible: false, tzid: null }; function parseInput(s, options) { var rrulevals = []; var rdatevals = []; var exrulevals = []; var exdatevals = []; var parsedDtstart = parseDtstart(s); var dtstart = parsedDtstart.dtstart; var tzid = parsedDtstart.tzid; var lines = function(s, unfold) { if (void 0 === unfold) { unfold = false } s = s && s.trim(); if (!s) { throw new Error("Invalid empty string") } if (!unfold) { return s.split(/\s/) } var lines = s.split("\n"); var i = 0; while (i < lines.length) { var line = lines[i] = lines[i].replace(/\s+$/g, ""); if (!line) { lines.splice(i, 1) } else if (i > 0 && " " === line[0]) { lines[i - 1] += line.slice(1); lines.splice(i, 1) } else { i += 1 } } return lines }(s, options.unfold); lines.forEach((function(line) { var _a; if (!line) { return } var _b = function(line) { var _a = function(line) { if (-1 === line.indexOf(":")) { return { name: "RRULE", value: line } } var _a = split(line, ":", 1), name = _a[0], value = _a[1]; return { name: name, value: value } }(line), name = _a.name, value = _a.value; var parms = name.split(";"); if (!parms) { throw new Error("empty property name") } return { name: parms[0].toUpperCase(), parms: parms.slice(1), value: value } }(line), name = _b.name, parms = _b.parms, value = _b.value; switch (name.toUpperCase()) { case "RRULE": if (parms.length) { throw new Error("unsupported RRULE parm: ".concat(parms.join(","))) } rrulevals.push(parseString(line)); break; case "RDATE": var _c = null !== (_a = /RDATE(?:;TZID=([^:=]+))?/i.exec(line)) && void 0 !== _a ? _a : [], rdateTzid = _c[1]; if (rdateTzid && !tzid) { tzid = rdateTzid } rdatevals = rdatevals.concat(parseRDate(value, parms)); break; case "EXRULE": if (parms.length) { throw new Error("unsupported EXRULE parm: ".concat(parms.join(","))) } exrulevals.push(parseString(value)); break; case "EXDATE": exdatevals = exdatevals.concat(parseRDate(value, parms)); break; case "DTSTART": break; default: throw new Error("unsupported property: " + name) } })); return { dtstart: dtstart, tzid: tzid, rrulevals: rrulevals, rdatevals: rdatevals, exrulevals: exrulevals, exdatevals: exdatevals } } function rrulestr(s, options) { if (void 0 === options) { options = {} } return function(s, options) { var _a = parseInput(s, options), rrulevals = _a.rrulevals, rdatevals = _a.rdatevals, exrulevals = _a.exrulevals, exdatevals = _a.exdatevals, dtstart = _a.dtstart, tzid = _a.tzid; var noCache = false === options.cache; if (options.compatible) { options.forceset = true; options.unfold = true } if (options.forceset || rrulevals.length > 1 || rdatevals.length || exrulevals.length || exdatevals.length) { var rset_1 = new RRuleSet(noCache); rset_1.dtstart(dtstart); rset_1.tzid(tzid || void 0); rrulevals.forEach((function(val) { rset_1.rrule(new RRule(groomRruleOptions(val, dtstart, tzid), noCache)) })); rdatevals.forEach((function(date) { rset_1.rdate(date) })); exrulevals.forEach((function(val) { rset_1.exrule(new RRule(groomRruleOptions(val, dtstart, tzid), noCache)) })); exdatevals.forEach((function(date) { rset_1.exdate(date) })); if (options.compatible && options.dtstart) { rset_1.rdate(dtstart) } return rset_1 } var val = rrulevals[0] || {}; return new RRule(groomRruleOptions(val, val.dtstart || options.dtstart || dtstart, val.tzid || options.tzid || tzid), noCache) }(s, function(options) { var invalid = []; var keys = Object.keys(options); var defaultKeys = Object.keys(rrulestr_DEFAULT_OPTIONS); keys.forEach((function(key) { if (!includes(defaultKeys, key)) { invalid.push(key) } })); if (invalid.length) { throw new Error("Invalid options: " + invalid.join(", ")) } return __assign(__assign({}, rrulestr_DEFAULT_OPTIONS), options) }(options)) } function groomRruleOptions(val, dtstart, tzid) { return __assign(__assign({}, val), { dtstart: dtstart, tzid: tzid }) } function parseRDate(rdateval, parms) { ! function(parms) { parms.forEach((function(parm) { if (!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(parm)) { throw new Error("unsupported RDATE/EXDATE parm: " + parm) } })) }(parms); return rdateval.split(",").map((function(datestr) { return untilStringToDate(datestr) })) } function createGetterSetter(fieldName) { var _this = this; return function(field) { if (void 0 !== field) { _this["_".concat(fieldName)] = field } if (void 0 !== _this["_".concat(fieldName)]) { return _this["_".concat(fieldName)] } for (var i = 0; i < _this._rrule.length; i++) { var field_1 = _this._rrule[i].origOptions[fieldName]; if (field_1) { return field_1 } } } } var RRuleSet = function(_super) { __extends(RRuleSet, _super); function RRuleSet(noCache) { if (void 0 === noCache) { noCache = false } var _this = _super.call(this, {}, noCache) || this; _this.dtstart = createGetterSetter.apply(_this, ["dtstart"]); _this.tzid = createGetterSetter.apply(_this, ["tzid"]); _this._rrule = []; _this._rdate = []; _this._exrule = []; _this._exdate = []; return _this } RRuleSet.prototype._iter = function(iterResult) { return function(iterResult, _rrule, _exrule, _rdate, _exdate, tzid) { var _exdateHash = {}; var _accept = iterResult.accept; function evalExdate(after, before) { _exrule.forEach((function(rrule) { rrule.between(after, before, true).forEach((function(date) { _exdateHash[Number(date)] = true })) })) } _exdate.forEach((function(date) { var zonedDate = new DateWithZone(date, tzid).rezonedDate(); _exdateHash[Number(zonedDate)] = true })); iterResult.accept = function(date) { var dt = Number(date); if (isNaN(dt)) { return _accept.call(this, date) } if (!_exdateHash[dt]) { evalExdate(new Date(dt - 1), new Date(dt + 1)); if (!_exdateHash[dt]) { _exdateHash[dt] = true; return _accept.call(this, date) } } return true }; if ("between" === iterResult.method) { evalExdate(iterResult.args.after, iterResult.args.before); iterResult.accept = function(date) { var dt = Number(date); if (!_exdateHash[dt]) { _exdateHash[dt] = true; return _accept.call(this, date) } return true } } for (var i = 0; i < _rdate.length; i++) { var zonedDate = new DateWithZone(_rdate[i], tzid).rezonedDate(); if (!iterResult.accept(new Date(zonedDate.getTime()))) { break } } _rrule.forEach((function(rrule) { iter(iterResult, rrule.options) })); var res = iterResult._result; sort(res); switch (iterResult.method) { case "all": case "between": return res; case "before": return res.length && res[res.length - 1] || null; default: return res.length && res[0] || null } }(iterResult, this._rrule, this._exrule, this._rdate, this._exdate, this.tzid()) }; RRuleSet.prototype.rrule = function(rrule) { _addRule(rrule, this._rrule) }; RRuleSet.prototype.exrule = function(rrule) { _addRule(rrule, this._exrule) }; RRuleSet.prototype.rdate = function(date) { _addDate(date, this._rdate) }; RRuleSet.prototype.exdate = function(date) { _addDate(date, this._exdate) }; RRuleSet.prototype.rrules = function() { return this._rrule.map((function(e) { return rrulestr(e.toString()) })) }; RRuleSet.prototype.exrules = function() { return this._exrule.map((function(e) { return rrulestr(e.toString()) })) }; RRuleSet.prototype.rdates = function() { return this._rdate.map((function(e) { return new Date(e.getTime()) })) }; RRuleSet.prototype.exdates = function() { return this._exdate.map((function(e) { return new Date(e.getTime()) })) }; RRuleSet.prototype.valueOf = function() { var result = []; if (!this._rrule.length && this._dtstart) { result = result.concat(optionsToString({ dtstart: this._dtstart })) } this._rrule.forEach((function(rrule) { result = result.concat(rrule.toString().split("\n")) })); this._exrule.forEach((function(exrule) { result = result.concat(exrule.toString().split("\n").map((function(line) { return line.replace(/^RRULE:/, "EXRULE:") })).filter((function(line) { return !/^DTSTART/.test(line) }))) })); if (this._rdate.length) { result.push(rdatesToString("RDATE", this._rdate, this.tzid())) } if (this._exdate.length) { result.push(rdatesToString("EXDATE", this._exdate, this.tzid())) } return result }; RRuleSet.prototype.toString = function() { return this.valueOf().join("\n") }; RRuleSet.prototype.clone = function() { var rrs = new RRuleSet(!!this._cache); this._rrule.forEach((function(rule) { return rrs.rrule(rule.clone()) })); this._exrule.forEach((function(rule) { return rrs.exrule(rule.clone()) })); this._rdate.forEach((function(date) { return rrs.rdate(new Date(date.getTime())) })); this._exdate.forEach((function(date) { return rrs.exdate(new Date(date.getTime())) })); return rrs }; return RRuleSet }(RRule); function _addRule(rrule, collection) { if (!(rrule instanceof RRule)) { throw new TypeError(String(rrule) + " is not RRule instance") } if (!includes(collection.map(String), String(rrule))) { collection.push(rrule) } } function _addDate(date, collection) { if (!(date instanceof Date)) { throw new TypeError(String(date) + " is not Date instance") } if (!includes(collection.map(Number), Number(date))) { collection.push(date); sort(collection) } } function rdatesToString(param, rdates, tzid) { var isUTC = !tzid || "UTC" === tzid.toUpperCase(); var header = isUTC ? "".concat(param, ":") : "".concat(param, ";TZID=").concat(tzid, ":"); var dateString = rdates.map((function(rdate) { return timeToUntilString(rdate.valueOf(), isUTC) })).join(","); return "".concat(header).concat(dateString) } }, 66798: /*!***************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/common/m_charts.js ***! \***************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.registerPattern = exports.registerGradient = exports.default = void 0; var _utils = __webpack_require__( /*! ../../viz/core/utils */ 19157); function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const graphicObjects = {}; exports.registerPattern = options => { const id = (0, _utils.getNextDefsSvgId)(); graphicObjects[id] = _extends({ type: "pattern" }, options); return id }; exports.registerGradient = (type, options) => { const id = (0, _utils.getNextDefsSvgId)(); graphicObjects[id] = _extends({ type: type }, options); return id }; exports.default = { getGraphicObjects: () => graphicObjects } }, 97522: /*!***********************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/core/license/byte_utils.js ***! \***********************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.base64ToBytes = function(base64) { return new Uint8Array(atob(base64).split("").map((s => s.charCodeAt(0)))) }; exports.bytesToHex = function(bytes) { return [...bytes].map((b => b.toString(16).padStart(2, "0"))).join("") }; exports.bytesToWords = function(bytes) { const words = new Uint32Array(1 + (bytes.length - 1 >> 2)); for (let k = 0; k < bytes.length; k += 1) { words[k >> 2] |= bytes[k] << 8 * (3 - k % 4) } return words }; exports.concatBytes = function(a, b) { const result = new Uint8Array(a.length + b.length); result.set(a, 0); result.set(b, a.length); return result }; exports.hexToBytes = function(string) { var _string$match; return new Uint8Array((null === (_string$match = string.match(/.{1,2}/g)) || void 0 === _string$match ? void 0 : _string$match.map((byte => parseInt(byte, 16)))) ?? []) }; exports.leftRotate = function(x, n) { return (x << n | x >>> 32 - n) >>> 0 }; exports.stringToBytes = function(string) { const bytes = new Uint8Array(string.length); for (let k = 0; k < string.length; k += 1) { bytes[k] = 255 & string.charCodeAt(k) } return bytes }; exports.wordsToBytes = function(words) { const bytes = new Uint8Array(4 * words.length); for (let k = 0; k < bytes.length; k += 1) { bytes[k] = words[k >> 2] >>> 8 * (3 - k % 4) } return bytes }; exports.wordsToHex = function(words) { return [...words].map((w => w.toString(16).padStart(8, "0"))).join("") } }, 41402: /*!****************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/core/license/key.js ***! \****************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.PUBLIC_KEY = exports.INTERNAL_USAGE_ID = void 0; exports.PUBLIC_KEY = { e: 65537, n: new Uint8Array([200, 219, 153, 203, 140, 7, 228, 253, 193, 243, 62, 137, 139, 60, 68, 242, 48, 142, 113, 88, 185, 235, 253, 105, 80, 74, 32, 170, 96, 74, 111, 250, 7, 205, 154, 3, 146, 115, 153, 53, 45, 132, 123, 56, 61, 208, 184, 201, 63, 24, 109, 223, 0, 179, 169, 102, 139, 224, 73, 233, 45, 173, 138, 66, 98, 88, 69, 76, 177, 111, 113, 218, 192, 33, 101, 152, 25, 134, 34, 173, 32, 82, 230, 44, 247, 200, 253, 170, 192, 246, 30, 12, 96, 205, 100, 249, 181, 93, 0, 231]) }; exports.INTERNAL_USAGE_ID = "ppJtlS56r0az1kqUjWJs-g" }, 77685: /*!*******************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/core/license/license_validation.js ***! \*******************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; exports.parseLicenseKey = parseLicenseKey; exports.peekValidationPerformed = function() { return validationPerformed }; exports.setLicenseCheckSkipCondition = function() {}; exports.validateLicense = validateLicense; var _config = _interopRequireDefault(__webpack_require__( /*! ../../../core/config */ 80209)); var _errors = _interopRequireDefault(__webpack_require__( /*! ../../../core/errors */ 17381)); var _version = __webpack_require__( /*! ../../../core/version */ 36739); var _version2 = __webpack_require__( /*! ../../utils/version */ 39550); var _byte_utils = __webpack_require__( /*! ./byte_utils */ 97522); var _key = __webpack_require__( /*! ./key */ 41402); var _pkcs = __webpack_require__( /*! ./pkcs1 */ 95373); var _rsa_bigint = __webpack_require__( /*! ./rsa_bigint */ 25746); var _sha = __webpack_require__( /*! ./sha1 */ 13082); var _trial_panel = __webpack_require__( /*! ./trial_panel */ 84814); var _types = __webpack_require__( /*! ./types */ 13004); const _excluded = ["customerId", "maxVersionAllowed", "format", "internalUsageId"]; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const FORMAT = 1; const RTM_MIN_PATCH_VERSION = 3; const KEY_SPLITTER = "."; const BUY_NOW_LINK = "https://go.devexpress.com/Licensing_Installer_Watermark_DevExtremeJQuery.aspx"; const GENERAL_ERROR = { kind: _types.TokenKind.corrupted, error: "general" }; const VERIFICATION_ERROR = { kind: _types.TokenKind.corrupted, error: "verification" }; const DECODING_ERROR = { kind: _types.TokenKind.corrupted, error: "decoding" }; const DESERIALIZATION_ERROR = { kind: _types.TokenKind.corrupted, error: "deserialization" }; const PAYLOAD_ERROR = { kind: _types.TokenKind.corrupted, error: "payload" }; const VERSION_ERROR = { kind: _types.TokenKind.corrupted, error: "version" }; let validationPerformed = false; function parseLicenseKey(encodedKey) { if (void 0 === encodedKey) { return GENERAL_ERROR } const parts = encodedKey.split(KEY_SPLITTER); if (2 !== parts.length || 0 === parts[0].length || 0 === parts[1].length) { return GENERAL_ERROR } if (! function(_ref) { let { text: text, signature: encodedSignature } = _ref; return (0, _rsa_bigint.compareSignatures)({ key: _key.PUBLIC_KEY, signature: (0, _byte_utils.base64ToBytes)(encodedSignature), actual: (0, _pkcs.pad)((0, _sha.sha1)(text)) }) }({ text: parts[0], signature: parts[1] })) { return VERIFICATION_ERROR } let decodedPayload = ""; try { decodedPayload = atob(parts[0]) } catch { return DECODING_ERROR } let payload = {}; try { payload = JSON.parse(decodedPayload) } catch { return DESERIALIZATION_ERROR } const { customerId: customerId, maxVersionAllowed: maxVersionAllowed, format: format, internalUsageId: internalUsageId } = payload, rest = function(source, excluded) { if (null == source) { return {} } var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) { continue } target[key] = source[key] } } return target }(payload, _excluded); if (void 0 !== internalUsageId) { return { kind: _types.TokenKind.internal, internalUsageId: internalUsageId } } if (void 0 === customerId || void 0 === maxVersionAllowed || void 0 === format) { return PAYLOAD_ERROR } if (format !== FORMAT) { return VERSION_ERROR } return { kind: _types.TokenKind.verified, payload: _extends({ customerId: customerId, maxVersionAllowed: maxVersionAllowed }, rest) } } function isPreview(patch) { return isNaN(patch) || patch < RTM_MIN_PATCH_VERSION } function validateLicense(licenseKey) { let versionStr = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : _version.fullVersion; if (validationPerformed) { return } validationPerformed = true; const version = (0, _version2.parseVersion)(versionStr); const versionsCompatible = (0, _version2.assertedVersionsCompatible)(version); const { internal: internal, error: error } = function(_ref2) { let { licenseKey: licenseKey, version: version } = _ref2; let preview = false; try { preview = isPreview(version.patch); const { major: major, minor: minor } = preview ? (0, _version2.getPreviousMajorVersion)(version) : version; if (!licenseKey) { return { preview: preview, error: "W0019" } } const license = parseLicenseKey(licenseKey); if (license.kind === _types.TokenKind.corrupted) { return { preview: preview, error: "W0021" } } if (license.kind === _types.TokenKind.internal) { return { preview: preview, internal: true, error: license.internalUsageId === _key.INTERNAL_USAGE_ID ? void 0 : "W0020" } } if (!(major && minor)) { return { preview: preview, error: "W0021" } } if (10 * major + minor > license.payload.maxVersionAllowed) { return { preview: preview, error: "W0020" } } return { preview: preview, error: void 0 } } catch { return { preview: preview, error: "W0021" } } }({ licenseKey: licenseKey, version: version }); if (!versionsCompatible && internal) { return } if (error && !internal) { (0, _trial_panel.showTrialPanel)((0, _config.default)().buyNowLink ?? BUY_NOW_LINK, _version.fullVersion) } const preview = isPreview(version.patch); if (error) { _errors.default.log(preview ? "W0022" : error); return } if (preview && !internal) { _errors.default.log("W0022") } } exports.default = { validateLicense: validateLicense } }, 95373: /*!******************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/core/license/pkcs1.js ***! \******************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.pad = function(hash) { const dataLength = (8 * _key.PUBLIC_KEY.n.length + 6) / 8; const data = (0, _byte_utils.concatBytes)((0, _byte_utils.hexToBytes)(ASN1_SHA1), hash); if (data.length + 10 > dataLength) { throw Error("Key is too short for SHA1 signing algorithm") } const padding = new Uint8Array(dataLength - data.length); padding.fill(255, 0, padding.length - 1); padding[0] = 0; padding[1] = 1; padding[padding.length - 1] = 0; return (0, _byte_utils.concatBytes)(padding, data) }; var _byte_utils = __webpack_require__( /*! ./byte_utils */ 97522); var _key = __webpack_require__( /*! ./key */ 41402); const ASN1_SHA1 = "3021300906052b0e03021a05000414" }, 25746: /*!***********************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/core/license/rsa_bigint.js ***! \***********************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.compareSignatures = function(args) { try { const zero = BigInt(0); const one = BigInt(1); const eight = BigInt(8); const modExp = (base, exponent, modulus) => { let result = one; let b = base; let e = exponent; while (e) { if (e & one) { result = result * b % modulus } b = b * b % modulus; e >>= one } return result }; const bigIntFromBytes = bytes => bytes.reduce(((acc, cur) => (acc << eight) + BigInt(cur)), zero); const actual = bigIntFromBytes(args.actual); const signature = bigIntFromBytes(args.signature); const exponent = BigInt(args.key.e); const modulus = bigIntFromBytes(args.key.n); const expected = modExp(signature, exponent, modulus); return expected === actual } catch { return true } } }, 13082: /*!*****************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/core/license/sha1.js ***! \*****************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.preprocess = preprocess; exports.sha1 = function(text) { const message = preprocess(text); const h = new Uint32Array([1732584193, 4023233417, 2562383102, 271733878, 3285377520]); for (let i = 0; i < message.length; i += 16) { const w = new Uint32Array(80); for (let j = 0; j < 16; j += 1) { w[j] = message[i + j] } for (let j = 16; j < 80; j += 1) { const n = w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16]; w[j] = n << 1 | n >>> 31 } let a = h[0]; let b = h[1]; let c = h[2]; let d = h[3]; let e = h[4]; for (let j = 0; j < 80; j += 1) { const [f, k] = j < 20 ? [b & c | ~b & d, 1518500249] : j < 40 ? [b ^ c ^ d, 1859775393] : j < 60 ? [b & c | b & d | c & d, 2400959708] : [b ^ c ^ d, 3395469782]; const temp = (0, _byte_utils.leftRotate)(a, 5) + f + e + k + w[j]; e = d; d = c; c = (0, _byte_utils.leftRotate)(b, 30); b = a; a = temp } h[0] += a; h[1] += b; h[2] += c; h[3] += d; h[4] += e } return (0, _byte_utils.wordsToBytes)(h) }; var _byte_utils = __webpack_require__( /*! ./byte_utils */ 97522); function preprocess(text) { const bytes = new Uint8Array(text.length + 1); bytes.set((0, _byte_utils.stringToBytes)(text)); bytes[bytes.length - 1] = 128; const words = (0, _byte_utils.bytesToWords)(new Uint8Array(bytes)); const result = new Uint32Array(16 * Math.ceil((words.length + 2) / 16)); result.set(words, 0); result[result.length - 1] = 8 * (bytes.length - 1); return result } }, 45053: /*!*******************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/core/license/trial_panel.client.js ***! \*******************************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.isClient = exports.BASE_Z_INDEX = void 0; exports.registerCustomComponents = registerCustomComponents; exports.renderTrialPanel = function(buyNowUrl, version, customStyles) { registerCustomComponents(customStyles); const trialPanelTrigger = document.createElement(componentNames.trigger); trialPanelTrigger.setAttribute(attributeNames.buyNow, buyNowUrl); trialPanelTrigger.setAttribute(attributeNames.version, version); document.body.appendChild(trialPanelTrigger) }; function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const BASE_Z_INDEX = exports.BASE_Z_INDEX = 1500; const isClient = () => "undefined" !== typeof HTMLElement; exports.isClient = isClient; const SafeHTMLElement = isClient() ? HTMLElement : class {}; const componentNames = { trigger: "dx-license-trigger", panel: "dx-license" }; const attributeNames = { buyNow: "buy-now", version: "version" }; const commonStyles = { opacity: "1", visibility: "visible", "clip-path": "none", filter: "none" }; const contentStyles = _extends({}, commonStyles, { width: "100%", height: "auto", "line-height": "normal", display: "block", "z-index": `${BASE_Z_INDEX}`, position: "static", transform: "translate(0px, 0px)", "background-color": "#FF7200", border: "none", margin: "auto", "box-sizing": "border-box", "text-align": "center" }); const containerStyles = _extends({}, contentStyles, { display: "flex", "align-items": "center", "flex-direction": "row", position: "relative", top: "0px", left: "0px", padding: "0.5rem" }); const buttonStyles = { width: "1rem", cursor: "pointer", height: "1rem" }; const textStyles = _extends({}, commonStyles, { display: "inline", position: "static", padding: "0px", margin: "0px", color: "white", "font-family": "'Segoe UI','Open Sans Condensed',-apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica neue,helvetica,Cantarell,Ubuntu,roboto,noto,arial,sans-serif", "font-size": "0.875rem", "font-wight": "600" }); function createImportantStyles(defaultStyles, customStyles) { const styles = customStyles ? _extends({}, defaultStyles, customStyles) : defaultStyles; return Object.keys(styles).reduce(((cssString, currentKey) => `${cssString}${[currentKey,`${styles[currentKey]} !important;`].join(": ")}`), "") } class DxLicense extends SafeHTMLElement { constructor() { var _DxLicense$customStyl, _DxLicense$customStyl2, _DxLicense$customStyl3, _DxLicense$customStyl4, _DxLicense$customStyl5; super(); this._observer = null; this._inReassign = false; this._hidden = false; this._spanStyles = createImportantStyles(textStyles, null === (_DxLicense$customStyl = DxLicense.customStyles) || void 0 === _DxLicense$customStyl ? void 0 : _DxLicense$customStyl.textStyles); this._linkStyles = createImportantStyles(textStyles, null === (_DxLicense$customStyl2 = DxLicense.customStyles) || void 0 === _DxLicense$customStyl2 ? void 0 : _DxLicense$customStyl2.linkStyles); this._containerStyles = createImportantStyles(containerStyles, null === (_DxLicense$customStyl3 = DxLicense.customStyles) || void 0 === _DxLicense$customStyl3 ? void 0 : _DxLicense$customStyl3.containerStyles); this._contentStyles = createImportantStyles(contentStyles, null === (_DxLicense$customStyl4 = DxLicense.customStyles) || void 0 === _DxLicense$customStyl4 ? void 0 : _DxLicense$customStyl4.contentStyles); this._buttonStyles = createImportantStyles(buttonStyles, null === (_DxLicense$customStyl5 = DxLicense.customStyles) || void 0 === _DxLicense$customStyl5 ? void 0 : _DxLicense$customStyl5.contentStyles) } _createSpan(text) { const span = document.createElement("span"); span.innerText = text; span.style.cssText = this._spanStyles; return span } _createLink(text, href) { const link = document.createElement("a"); link.innerText = text; link.style.cssText = this._linkStyles; link.href = href; link.target = "_blank"; return link } _createButton() { const button = document.createElement("div"); button.style.cssText = this._buttonStyles; const polygon = document.createElementNS("http://www.w3.org/2000/svg", "polygon"); const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg"); polygon.setAttribute("points", "13.4 12.7 8.7 8 13.4 3.4 12.6 2.6 8 7.3 3.4 2.6 2.6 3.4 7.3 8 2.6 12.6 3.4 13.4 8 8.7 12.7 13.4 13.4 12.7"); polygon.style.cssText = createImportantStyles({ fill: "#fff", opacity: ".5", "stroke-width": "0px" }); svg.setAttribute("id", "Layer_1"); svg.setAttribute("data-name", "Layer 1"); svg.setAttribute("version", "1.1"); svg.setAttribute("viewBox", "0 0 16 16"); svg.style.cssText = createImportantStyles({ "vertical-align": "baseline" }); svg.appendChild(polygon); button.appendChild(svg); button.onclick = () => { this._hidden = true; this.style.cssText = createImportantStyles({ display: "none" }) }; return button } _createContentContainer() { const contentContainer = document.createElement("div"); contentContainer.style.cssText = this._contentStyles; contentContainer.append(this._createSpan("For evaluation purposes only. Redistribution not authorized. Please "), this._createLink("purchase a license", this.getAttribute(attributeNames.buyNow)), this._createSpan(` to continue use of DevExpress product libraries (v${this.getAttribute(attributeNames.version)}).`)); return contentContainer } _reassignComponent() { this.innerHTML = ""; this.style.cssText = this._containerStyles; this.append(this._createContentContainer(), this._createButton()) } connectedCallback() { this._reassignComponent(); if (!this._observer) { this._observer = new MutationObserver((() => { if (this._hidden) { var _this$_observer; null === (_this$_observer = this._observer) || void 0 === _this$_observer || _this$_observer.disconnect(); return } if (this._inReassign) { this._inReassign = false } else { this._inReassign = true; this._reassignComponent() } })); this._observer.observe(this, { childList: true, attributes: true, subtree: true }) } } disconnectedCallback() { setTimeout((() => { const licensePanel = document.getElementsByTagName(componentNames.panel); if (!licensePanel.length) { document.body.prepend(this) } }), 100) } } DxLicense.customStyles = void 0; class DxLicenseTrigger extends SafeHTMLElement { connectedCallback() { this.style.cssText = createImportantStyles({ display: "none" }); const licensePanel = document.getElementsByTagName(componentNames.panel); if (!licensePanel.length) { const license = document.createElement(componentNames.panel); license.setAttribute(attributeNames.version, this.getAttribute(attributeNames.version)); license.setAttribute(attributeNames.buyNow, this.getAttribute(attributeNames.buyNow)); license.setAttribute("data-permanent", "true"); document.body.prepend(license) } } } function registerCustomComponents(customStyles) { if (!customElements.get(componentNames.trigger)) { DxLicense.customStyles = customStyles; customElements.define(componentNames.trigger, DxLicenseTrigger); customElements.define(componentNames.panel, DxLicense) } } }, 84814: /*!************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/core/license/trial_panel.js ***! \************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.registerTrialPanelComponents = function(customStyles) { if ((0, _trial_panel.isClient)()) { (0, _trial_panel.registerCustomComponents)(customStyles) } }; exports.showTrialPanel = function(buyNowUrl, version, customStyles) { if ((0, _trial_panel.isClient)()) { (0, _trial_panel.renderTrialPanel)(buyNowUrl, version, customStyles) } }; var _trial_panel = __webpack_require__( /*! ./trial_panel.client */ 45053) }, 13004: /*!******************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/core/license/types.js ***! \******************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.TokenKind = void 0; var TokenKind; ! function(TokenKind) { TokenKind.corrupted = "corrupted"; TokenKind.verified = "verified"; TokenKind.internal = "internal" }(TokenKind || (exports.TokenKind = TokenKind = {})) }, 59897: /*!*************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/core/r1/component_wrapper.js ***! \*************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.ComponentWrapper = void 0; __webpack_require__( /*! ../../../events/click */ 95429); __webpack_require__( /*! ../../../events/core/emitter.feedback */ 91633); __webpack_require__( /*! ../../../events/hover */ 24028); var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../core/dom_adapter */ 73349)); var _dom_component = _interopRequireDefault(__webpack_require__( /*! ../../../core/dom_component */ 13046)); var _element = __webpack_require__( /*! ../../../core/element */ 6415); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374)); var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306); var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922); var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno_renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/inferno_renderer */ 15334)); var _keyboard_processor = _interopRequireDefault(__webpack_require__( /*! ../../../events/core/keyboard_processor */ 51661)); var _template_wrapper = __webpack_require__( /*! ./template_wrapper */ 59977); var _index = __webpack_require__( /*! ./utils/index */ 71587); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const setDefaultOptionValue = (options, defaultValueGetter) => name => { if (Object.prototype.hasOwnProperty.call(options, name) && void 0 === options[name]) { options[name] = defaultValueGetter(name) } }; class ComponentWrapper extends _dom_component.default { get _propsInfo() { return { allowNull: [], twoWay: [], elements: [], templates: [], props: [] } } constructor(element, options) { super(element, options); this._shouldRaiseContentReady = false; this.validateKeyDownHandler() } validateKeyDownHandler() { const supportedKeyNames = this.getSupportedKeyNames(); const hasComponentDefaultKeyHandlers = supportedKeyNames.length > 0; const hasComponentKeyDownMethod = "function" === typeof this._viewComponent.prototype.keyDown; if (hasComponentDefaultKeyHandlers && !hasComponentKeyDownMethod) { throw Error("Component's declaration must have 'keyDown' method.") } } get viewRef() { var _this$_viewRef; return null === (_this$_viewRef = this._viewRef) || void 0 === _this$_viewRef ? void 0 : _this$_viewRef.current } _checkContentReadyOption(fullName) { const contentReadyOptions = this._getContentReadyOptions().reduce(((options, name) => { options[name] = true; return options }), {}); this._checkContentReadyOption = optionName => !!contentReadyOptions[optionName]; return this._checkContentReadyOption(fullName) } _getContentReadyOptions() { return ["rtlEnabled"] } _fireContentReady() { this._actionsMap.onContentReady({}) } _getDefaultOptions() { const viewDefaultProps = this._getViewComponentDefaultProps(); return (0, _extend.extend)(true, super._getDefaultOptions(), viewDefaultProps, this._propsInfo.twoWay.reduce(((options, _ref) => { let [name, defaultName, eventName] = _ref; return _extends({}, options, { [name]: viewDefaultProps[defaultName], [eventName]: value => this.option(name, value) }) }), {}), this._propsInfo.templates.reduce(((options, name) => _extends({}, options, { [name]: null })), {})) } _getUnwrappedOption() { const unwrappedProps = {}; Object.keys(this.option()).forEach((key => { unwrappedProps[key] = this.option(key) })); return unwrappedProps } _initializeComponent() { var _this$_templateManage; super._initializeComponent(); null === (_this$_templateManage = this._templateManager) || void 0 === _this$_templateManage || _this$_templateManage.addDefaultTemplates(this.getDefaultTemplates()); const optionProxy = this._getUnwrappedOption(); this._props = this._optionsWithDefaultTemplates(optionProxy); this._propsInfo.templates.forEach((template => { this._componentTemplates[template] = this._createTemplateComponent(this._props[template]) })); Object.keys(this._getActionConfigsFull()).forEach((name => this._addAction(name))); this._viewRef = (0, _inferno.createRef)(); this.defaultKeyHandlers = this._createDefaultKeyHandlers() } _initMarkup() { const props = this.getProps(); this._renderWrapper(props) } _renderWrapper(props) { const containerNode = this.$element()[0]; if (!this._isNodeReplaced) { _inferno_renderer.default.onPreRender() } _inferno_renderer.default.render(this._viewComponent, props, containerNode, this._isNodeReplaced); if (!this._isNodeReplaced) { this._isNodeReplaced = true; _inferno_renderer.default.onAfterRender(); this._shouldRaiseContentReady = true } if (this._shouldRaiseContentReady) { this._fireContentReady(); this._shouldRaiseContentReady = false } } _silent(name, value) { this._options.silent(name, value) } _render() {} _removeWidget() { _inferno_renderer.default.remove(this.$element()[0]) } _dispose() { this._removeWidget(); super._dispose() } get elementAttr() { const element = this.$element()[0]; if (!this._elementAttr) { const { attributes: attributes } = element; const attrs = Array.from(attributes).filter((attr => { var _attributes$attr$name; return !this._propsInfo.templates.includes(attr.name) && (null === (_attributes$attr$name = attributes[attr.name]) || void 0 === _attributes$attr$name ? void 0 : _attributes$attr$name.specified) })).reduce(((result, _ref2) => { let { name: name, value: value } = _ref2; const updatedAttributes = result; const isDomAttr = name in element; updatedAttributes[name] = "" === value && isDomAttr ? element[name] : value; return updatedAttributes }), {}); this._elementAttr = attrs; this._storedClasses = element.getAttribute("class") || "" } const elemStyle = element.style; const style = {}; for (let i = 0; i < elemStyle.length; i += 1) { style[elemStyle[i]] = elemStyle.getPropertyValue(elemStyle[i]) } this._elementAttr.style = style; this._elementAttr.class = this._storedClasses; return this._elementAttr } _getAdditionalActionConfigs() { return { onContentReady: { excludeValidators: ["disabled", "readOnly"] } } } _getAdditionalProps() { return [] } _patchOptionValues(options) { const { allowNull: allowNull, twoWay: twoWay, elements: elements, props: props } = this._propsInfo; const viewDefaultProps = this._getViewComponentDefaultProps(); const defaultWidgetPropsKeys = Object.keys(viewDefaultProps); const defaultOptions = this._getDefaultOptions(); const { ref: ref, children: children, onKeyboardHandled: onKeyboardHandled } = options; const onKeyDown = onKeyboardHandled ? (_, event_options) => { onKeyboardHandled(event_options) } : void 0; const widgetProps = { ref: ref, children: children, onKeyDown: onKeyDown }; [...props, ...this._getAdditionalProps()].forEach((propName => { if (Object.prototype.hasOwnProperty.call(options, propName)) { widgetProps[propName] = options[propName] } })); allowNull.forEach(setDefaultOptionValue(widgetProps, (() => null))); defaultWidgetPropsKeys.forEach(setDefaultOptionValue(widgetProps, (name => defaultOptions[name]))); twoWay.forEach((_ref3 => { let [name, defaultName] = _ref3; setDefaultOptionValue(widgetProps, (() => defaultOptions[defaultName]))(name) })); elements.forEach((name => { if (name in widgetProps) { const value = widgetProps[name]; if ((0, _type.isRenderer)(value)) { widgetProps[name] = this._patchElementParam(value) } } })); return widgetProps } getSupportedKeyNames() { return [] } prepareStyleProp(props) { if ("string" === typeof props.style) { return _extends({}, props, { style: {}, cssText: props.style }) } return props } getProps() { const { elementAttr: elementAttr } = this.option(); const options = this._patchOptionValues(_extends({}, this._props, { ref: this._viewRef, children: this._extractDefaultSlot(), aria: this._aria })); this._propsInfo.templates.forEach((template => { options[template] = this._componentTemplates[template] })); return this.prepareStyleProp(_extends({}, options, this.elementAttr, elementAttr, { className: [...(this.elementAttr.class ?? "").split(" "), ...((null === elementAttr || void 0 === elementAttr ? void 0 : elementAttr.class) ?? "").split(" ")].filter(((c, i, a) => c && a.indexOf(c) === i)).join(" ").trim(), class: "" }, this._actionsMap)) } _getActionConfigs() { return {} } _getActionConfigsFull() { return _extends({}, this._getActionConfigs(), this._getAdditionalActionConfigs()) } getDefaultTemplates() { const defaultTemplates = Object.values(this._templatesInfo); const result = {}; defaultTemplates.forEach((template => { result[template] = "dx-renovation-template-mock" })); return result } get _templatesInfo() { return {} } _optionsWithDefaultTemplates(options) { const templateOptions = Object.entries(this._templatesInfo).reduce(((result, _ref4) => { let [templateName, templateValue] = _ref4; return _extends({}, result, { [templateName]: options[templateName] ?? templateValue }) }), {}); return _extends({}, options, templateOptions) } _init() { super._init(); this.customKeyHandlers = {}; this._actionsMap = {}; this._aria = {}; this._componentTemplates = {} } _createDefaultKeyHandlers() { const result = {}; const keys = this.getSupportedKeyNames(); keys.forEach((key => { result[key] = e => this.viewRef.keyDown(_keyboard_processor.default.createKeyDownOptions(e)) })); return result } _addAction(event, actionToAdd) { let action = actionToAdd; if (!action) { const actionByOption = this._createActionByOption(event, this._getActionConfigsFull()[event]); action = actArgs => { Object.keys(actArgs).forEach((name => { if ((0, _type.isDefined)(actArgs[name]) && _dom_adapter.default.isNode(actArgs[name])) { actArgs[name] = (0, _element.getPublicElement)((0, _renderer.default)(actArgs[name])) } })); return actionByOption(actArgs) } } this._actionsMap[event] = action } _optionChanged(option) { const { name: name, fullName: fullName, value: value, previousValue: previousValue } = option; (0, _index.updatePropsImmutable)(this._props, this.option(), name, fullName); if (this._propsInfo.templates.includes(name) && value !== previousValue) { this._componentTemplates[name] = this._createTemplateComponent(value) } if (name && this._getActionConfigsFull()[name]) { this._addAction(name) } this._shouldRaiseContentReady = this._shouldRaiseContentReady || this._checkContentReadyOption(fullName); super._optionChanged(option); this._invalidate() } _extractDefaultSlot() { if (this.option("_hasAnonymousTemplateContent")) { return _inferno_renderer.default.createElement(_template_wrapper.TemplateWrapper, { template: this._getTemplate(this._templateManager.anonymousTemplateName), transclude: true, renovated: true }) } return null } _createTemplateComponent(templateOption) { if (!templateOption) { return } const template = this._getTemplate(templateOption); if ((0, _type.isString)(template) && "dx-renovation-template-mock" === template) { return } return model => _inferno_renderer.default.createElement(_template_wrapper.TemplateWrapper, (0, _template_wrapper.buildTemplateArgs)(model, template)) } _wrapKeyDownHandler(initialHandler) { return options => { const { originalEvent: originalEvent, keyName: keyName, which: which } = options; const keys = this.customKeyHandlers; const func = keys[keyName] || keys[which]; if (void 0 !== func) { const handler = func.bind(this); const result = handler(originalEvent, options); if (!result) { originalEvent.cancel = true; return originalEvent } } return null === initialHandler || void 0 === initialHandler ? void 0 : initialHandler(originalEvent, options) } } _toPublicElement(element) { return (0, _element.getPublicElement)((0, _renderer.default)(element)) } _patchElementParam(value) { try { const result = (0, _renderer.default)(value); const element = null === result || void 0 === result ? void 0 : result.get(0); return null !== element && void 0 !== element && element.nodeType ? element : value } catch (error) { return value } } repaint() { this._isNodeReplaced = false; this._shouldRaiseContentReady = true; this._removeWidget(); this._refresh() } _supportedKeys() { return _extends({}, this.defaultKeyHandlers, this.customKeyHandlers) } registerKeyHandler(key, handler) { this.customKeyHandlers[key] = handler } setAria(name, value) { this._aria[name] = value; this._initMarkup() } _getViewComponentDefaultProps() { return this._viewComponent.defaultProps || {} } } exports.ComponentWrapper = ComponentWrapper; ComponentWrapper.IS_RENOVATED_WIDGET = false; ComponentWrapper.IS_RENOVATED_WIDGET = true }, 68789: /*!*************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/core/r1/index.js ***! \*************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "ComponentWrapper", { enumerable: true, get: function() { return _component_wrapper.ComponentWrapper } }); var _component_wrapper = __webpack_require__( /*! ./component_wrapper */ 59897) }, 59977: /*!************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/core/r1/template_wrapper.js ***! \************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.buildTemplateArgs = exports.TemplateWrapper = void 0; var _inferno = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../core/dom_adapter */ 73349)); var _element = __webpack_require__( /*! ../../../core/element */ 6415); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374)); var _dom = __webpack_require__( /*! ../../../core/utils/dom */ 3532); var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922); var _inferno2 = __webpack_require__( /*! inferno */ 65414); var _shallow_equals = __webpack_require__( /*! ./utils/shallow_equals */ 66755); const _excluded = ["isEqual"]; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } exports.buildTemplateArgs = (model, template) => { const args = { template: template, model: _extends({}, model) }; const _ref = model.data ?? {}, { isEqual: isEqual } = _ref, data = function(source, excluded) { if (null == source) { return {} } var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) { continue } target[key] = source[key] } } return target }(_ref, _excluded); if (isEqual) { args.model.data = data; args.isEqual = isEqual } return args }; class TemplateWrapper extends _inferno.InfernoComponent { constructor(props) { super(props); this.renderTemplate = this.renderTemplate.bind(this) } renderTemplate() { const node = (0, _inferno2.findDOMfromVNode)(this.$LI, true); if (!(null !== node && void 0 !== node && node.parentNode)) { return () => {} } const container = node.parentNode; const $container = (0, _renderer.default)(container); const $oldContainerContent = $container.contents().toArray(); const content = ((props, container) => { const { data: data, index: index } = props.model ?? { data: {} }; if (data) { Object.keys(data).forEach((name => { if (data[name] && _dom_adapter.default.isNode(data[name])) { data[name] = (0, _element.getPublicElement)((0, _renderer.default)(data[name])) } })) } const rendered = props.template.render(_extends({ container: container, transclude: props.transclude }, { renovated: props.renovated }, !props.transclude ? { model: data } : {}, !props.transclude && Number.isFinite(index) ? { index: index } : {})); if (void 0 === rendered) { return [] } return (element = rendered, !!element.toArray) ? rendered.toArray() : [(0, _renderer.default)(rendered).get(0)]; var element })(this.props, (0, _element.getPublicElement)($container)); (0, _dom.replaceWith)((0, _renderer.default)(node), (0, _renderer.default)(content)); return () => { const $actualContainerContent = (0, _renderer.default)(container).contents().toArray(); oldChildren = $oldContainerContent, newChildren = $actualContainerContent, void newChildren.forEach((newElement => { const hasOldChild = !!oldChildren.find((oldElement => newElement === oldElement)); if (!hasOldChild && newElement.parentNode) { (0, _renderer.default)(newElement).remove() } })); var oldChildren, newChildren; container.appendChild(node) } } shouldComponentUpdate(nextProps) { const { template: template, model: model } = this.props; const { template: nextTemplate, model: nextModel, isEqual: isEqual } = nextProps; const equalityComparer = isEqual ?? _shallow_equals.shallowEquals; if (template !== nextTemplate) { return true } if (!(0, _type.isDefined)(model) || !(0, _type.isDefined)(nextModel)) { return model !== nextModel } const { data: data, index: index } = model; const { data: nextData, index: nextIndex } = nextModel; if (index !== nextIndex) { return true } return !equalityComparer(data, nextData) } createEffects() { return [new _inferno.InfernoEffect(this.renderTemplate, [this.props.template, this.props.model])] } updateEffects() { this._effects[0].update([this.props.template, this.props.model]) } componentWillUnmount() {} render() { return null } } exports.TemplateWrapper = TemplateWrapper }, 10976: /*!**************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/core/r1/utils/get_template.js ***! \**************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.getTemplate = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } exports.getTemplate = TemplateProp => TemplateProp && (TemplateProp.defaultProps ? props => (0, _inferno.normalizeProps)((0, _inferno.createComponentVNode)(2, TemplateProp, _extends({}, props))) : TemplateProp) }, 71587: /*!*******************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/core/r1/utils/index.js ***! \*******************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "getTemplate", { enumerable: true, get: function() { return _get_template.getTemplate } }); Object.defineProperty(exports, "shallowEquals", { enumerable: true, get: function() { return _shallow_equals.shallowEquals } }); Object.defineProperty(exports, "updatePropsImmutable", { enumerable: true, get: function() { return _update_props_immutable.updatePropsImmutable } }); var _get_template = __webpack_require__( /*! ./get_template */ 10976); var _shallow_equals = __webpack_require__( /*! ./shallow_equals */ 66755); var _update_props_immutable = __webpack_require__( /*! ./update_props_immutable */ 26765) }, 66755: /*!****************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/core/r1/utils/shallow_equals.js ***! \****************************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.shallowEquals = void 0; exports.shallowEquals = (firstObject, secondObject) => { if (Object.keys(firstObject).length !== Object.keys(secondObject).length) { return false } return Object.keys(firstObject).every((key => firstObject[key] === secondObject[key])) } }, 26765: /*!************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/core/r1/utils/update_props_immutable.js ***! \************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.updatePropsImmutable = void 0; var _data = __webpack_require__( /*! ../../../../core/utils/data */ 47617); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const cloneObjectValue = value => Array.isArray(value) ? [...value] : _extends({}, value); const cloneObjectProp = (value, prevValue, fullNameParts) => { const result = fullNameParts.length > 0 && prevValue && value !== prevValue ? cloneObjectValue(prevValue) : cloneObjectValue(value); const name = fullNameParts[0]; if (fullNameParts.length > 1) { result[name] = cloneObjectProp(value[name], null === prevValue || void 0 === prevValue ? void 0 : prevValue[name], fullNameParts.slice(1)) } else if (name) { if ((0, _type.isPlainObject)(value[name])) { result[name] = cloneObjectValue(value[name]) } else { result[name] = value[name] } } return result }; exports.updatePropsImmutable = (props, option, name, fullName) => { const currentPropsValue = option[name]; const prevPropsValue = props[name]; const result = props; if ((0, _type.isPlainObject)(currentPropsValue) || name !== fullName && Array.isArray(currentPropsValue)) { result[name] = cloneObjectProp(currentPropsValue, prevPropsValue, (0, _data.getPathParts)(fullName).slice(1)) } else { result[name] = currentPropsValue } } }, 24321: /*!***************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/core/utils/date.js ***! \***************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.dateUtilsTs = void 0; exports.dateUtilsTs = { addOffsets: (date, offsets) => { const newDateMs = offsets.reduce(((result, offset) => result + offset), date.getTime()); return new Date(newDateMs) } } }, 11390: /*!***************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/core/utils/math.js ***! \***************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.shiftIntegerByModule = void 0; exports.shiftIntegerByModule = (integerValue, moduleValue) => { if (!Number.isInteger(integerValue)) { throw Error(`Passed integer value ${integerValue} is not an integer.`) } if (!Number.isInteger(moduleValue)) { throw Error(`Passed module value ${moduleValue} is not an integer.`) } if (moduleValue <= 0) { throw Error(`Passed module value ${moduleValue} must be > 0.`) } const normalizedInteger = integerValue % moduleValue; switch (true) { case 0 === normalizedInteger: return 0; case normalizedInteger > 0: return normalizedInteger; case normalizedInteger < 0: return moduleValue + normalizedInteger; default: throw Error(`Unexpected division (${integerValue} % ${moduleValue}) occurred.`) } } }, 17301: /*!******************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/core/utils/promise.js ***! \******************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.createPromise = function() { let resolve; let reject; const promise = new Promise(((res, rej) => { resolve = res; reject = rej })); return { promise: promise, resolve: resolve, reject: reject } } }, 97944: /*!*****************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/core/utils/scroll.js ***! \*****************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.getMemoizeScrollTo = function(getScrollableInstance) { const instance = getScrollableInstance(); let lastParams = {}; return function(params) { let force = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : false; const normalizedParams = { top: void 0 !== params.top ? Math.ceil(params.top) : void 0, left: void 0 !== params.left ? Math.ceil(params.left) : void 0 }; const isSameParams = normalizedParams.top === lastParams.top && normalizedParams.left === lastParams.left; if (!force && isSameParams) { return } lastParams = normalizedParams; instance.scrollTo(params) } } }, 27150: /*!***************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/data_controller.js ***! \***************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _deferred = __webpack_require__( /*! ../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../core/utils/extend */ 13306); var _type = __webpack_require__( /*! ../core/utils/type */ 35922); var _array_store = (obj = __webpack_require__( /*! ../data/array_store */ 26562), obj && obj.__esModule ? obj : { default: obj }); var obj; var _data_source = __webpack_require__( /*! ../data/data_source/data_source */ 85273); var _utils = __webpack_require__( /*! ../data/data_source/utils */ 9234); exports.default = class { constructor(dataSourceOptions, _ref) { let { key: key } = _ref; this._isSharedDataSource = false; this._keyExpr = key; this.updateDataSource(dataSourceOptions) } _updateDataSource(dataSourceOptions) { if (!dataSourceOptions) { return } if (dataSourceOptions instanceof _data_source.DataSource) { this._isSharedDataSource = true; this._dataSource = dataSourceOptions } else { const normalizedDataSourceOptions = (0, _utils.normalizeDataSourceOptions)(dataSourceOptions); this._dataSource = new _data_source.DataSource((0, _extend.extend)(true, {}, {}, normalizedDataSourceOptions)) } } _updateDataSourceByItems(items) { this._dataSource = new _data_source.DataSource({ store: new _array_store.default({ key: this.key(), data: items }), pageSize: 0 }) } _disposeDataSource() { if (this._dataSource) { if (this._isSharedDataSource) { this._isSharedDataSource = false } else { this._dataSource.dispose() } delete this._dataSource } } load() { return this._dataSource.load() } loadSingle(propName, propValue) { if (!this._dataSource) { return (new _deferred.Deferred).reject() } let pName = propName; let pValue = propValue; if (arguments.length < 2) { pValue = propName; pName = this.key() } return this._dataSource.loadSingle(pName, pValue) } loadFromStore(loadOptions) { return this.store().load(loadOptions) } loadNextPage() { this.pageIndex(1 + this.pageIndex()); return this.load() } loadOptions() { return this._dataSource.loadOptions() } userData() { return this._dataSource._userData } cancel(operationId) { this._dataSource.cancel(operationId) } cancelAll() { this._dataSource.cancelAll() } filter(filter) { return this._dataSource.filter(filter) } addSearchFilter(storeLoadOptions) { this._dataSource._addSearchFilter(storeLoadOptions) } group(group) { return this._dataSource.group(group) } paginate() { return this._dataSource.paginate() } pageSize() { return this._dataSource._pageSize } pageIndex(pageIndex) { if (void 0 === pageIndex) { return this._dataSource.pageIndex(void 0) } return this._dataSource.pageIndex(pageIndex) } resetDataSource() { this._disposeDataSource() } resetDataSourcePageIndex() { if (this.pageIndex()) { this.pageIndex(0); this.load() } } updateDataSource(items, key) { const dataSourceOptions = items ?? this.items(); if (key) { this._keyExpr = key } this._disposeDataSource(); if (Array.isArray(dataSourceOptions)) { this._updateDataSourceByItems(dataSourceOptions) } else { this._updateDataSource(dataSourceOptions) } } totalCount() { return this._dataSource.totalCount() } isLastPage() { return this._dataSource.isLastPage() || !this._dataSource._pageSize } isLoading() { return this._dataSource.isLoading() } isLoaded() { return this._dataSource.isLoaded() } searchValue(value) { return this._dataSource.searchValue(value) } searchOperation(operation) { return this._dataSource.searchOperation(operation) } searchExpr(expr) { return this._dataSource.searchExpr(expr) } select() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key] } return this._dataSource.select(args) } key() { var _this$_dataSource; const storeKey = null === (_this$_dataSource = this._dataSource) || void 0 === _this$_dataSource ? void 0 : _this$_dataSource.key(); return (0, _type.isDefined)(storeKey) && "this" === this._keyExpr ? storeKey : this._keyExpr } keyOf(item) { return this.store().keyOf(item) } store() { return this._dataSource.store() } items() { var _this$_dataSource2; return null === (_this$_dataSource2 = this._dataSource) || void 0 === _this$_dataSource2 ? void 0 : _this$_dataSource2.items() } applyMapFunction(data) { return this._dataSource._applyMapFunction(data) } getDataSource() { return this._dataSource ?? null } reload() { return this._dataSource.reload() } on(event, handler) { this._dataSource.on(event, handler) } off(event, handler) { this._dataSource.off(event, handler) } } }, 18605: /*!***************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/events/dblclick.js ***! \***************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.name = exports.dblClick = void 0; var _class = _interopRequireDefault(__webpack_require__( /*! ../../core/class */ 38377)); var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../core/dom_adapter */ 73349)); var _dom = __webpack_require__( /*! ../../core/utils/dom */ 3532); var _click = __webpack_require__( /*! ../../events/click */ 95429); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../events/core/events_engine */ 55994)); var _index = __webpack_require__( /*! ../../events/utils/index */ 39611); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const DBLCLICK_EVENT_NAME = exports.name = "dxdblclick"; const NAMESPACED_CLICK_EVENT = (0, _index.addNamespace)(_click.name, "dxDblClick"); const DblClick = _class.default.inherit({ ctor() { this._handlerCount = 0; this._forgetLastClick() }, _forgetLastClick() { this._firstClickTarget = null; this._lastClickTimeStamp = -300 }, add() { if (this._handlerCount <= 0) { _events_engine.default.on(_dom_adapter.default.getDocument(), NAMESPACED_CLICK_EVENT, this._clickHandler.bind(this)) } this._handlerCount += 1 }, _clickHandler(e) { const timeStamp = e.timeStamp || Date.now(); const timeBetweenClicks = timeStamp - this._lastClickTimeStamp; const isSimulated = timeBetweenClicks < 0; const isDouble = !isSimulated && timeBetweenClicks < 300; if (isDouble) { (0, _index.fireEvent)({ type: DBLCLICK_EVENT_NAME, target: (0, _dom.closestCommonParent)(this._firstClickTarget, e.target), originalEvent: e }); this._forgetLastClick() } else { this._firstClickTarget = e.target; this._lastClickTimeStamp = timeStamp; clearTimeout(this._lastClickClearTimeout); this._lastClickClearTimeout = setTimeout((() => { this._forgetLastClick() }), 600) } }, remove() { this._handlerCount -= 1; if (this._handlerCount <= 0) { this._forgetLastClick(); _events_engine.default.off(_dom_adapter.default.getDocument(), NAMESPACED_CLICK_EVENT, void 0); clearTimeout(this._lastClickClearTimeout); this._handlerCount = 0 } } }); exports.dblClick = new DblClick }, 90102: /*!************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/filter_builder/m_between.js ***! \************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.getConfig = function(caption, context) { return { name: "between", caption: caption, icon: "range", valueSeparator: SEPARATOR, dataTypes: ["number", "date", "datetime"], editorTemplate: editorTemplate.bind(context), notForLookup: true } }; var _renderer = (obj = __webpack_require__( /*! ../../core/renderer */ 68374), obj && obj.__esModule ? obj : { default: obj }); var obj; var _extend = __webpack_require__( /*! ../../core/utils/extend */ 13306); const FILTER_BUILDER_RANGE_CLASS = "dx-filterbuilder-range"; const FILTER_BUILDER_RANGE_START_CLASS = `${FILTER_BUILDER_RANGE_CLASS}-start`; const FILTER_BUILDER_RANGE_END_CLASS = `${FILTER_BUILDER_RANGE_CLASS}-end`; const FILTER_BUILDER_RANGE_SEPARATOR_CLASS = `${FILTER_BUILDER_RANGE_CLASS}-separator`; const SEPARATOR = "\u2013"; function editorTemplate(conditionInfo, container) { const $editorStart = (0, _renderer.default)("
").addClass(FILTER_BUILDER_RANGE_START_CLASS); const $editorEnd = (0, _renderer.default)("
").addClass(FILTER_BUILDER_RANGE_END_CLASS); let values = conditionInfo.value || []; const getStartValue = function(values) { return values && values.length > 0 ? values[0] : null }; const getEndValue = function(values) { return values && 2 === values.length ? values[1] : null }; container.append($editorStart); container.append((0, _renderer.default)("").addClass(FILTER_BUILDER_RANGE_SEPARATOR_CLASS).text(SEPARATOR)); container.append($editorEnd); container.addClass(FILTER_BUILDER_RANGE_CLASS); this._editorFactory.createEditor.call(this, $editorStart, (0, _extend.extend)({}, conditionInfo.field, conditionInfo, { value: getStartValue(values), parentType: "filterBuilder", setValue(value) { values = [value, getEndValue(values)]; conditionInfo.setValue(values) } })); this._editorFactory.createEditor.call(this, $editorEnd, (0, _extend.extend)({}, conditionInfo.field, conditionInfo, { value: getEndValue(values), parentType: "filterBuilder", setValue(value) { values = [getStartValue(values), value]; conditionInfo.setValue(values) } })) } }, 88283: /*!*******************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/filter_builder/m_filter_builder.js ***! \*******************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../core/component_registrator */ 99393)); var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../core/dom_adapter */ 73349)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../core/renderer */ 68374)); var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 13306); var _type = __webpack_require__( /*! ../../core/utils/type */ 35922); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../events/core/events_engine */ 55994)); var _index = __webpack_require__( /*! ../../events/utils/index */ 39611); var _message = _interopRequireDefault(__webpack_require__( /*! ../../localization/message */ 28109)); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../ui/popup/ui.popup */ 51495)); var _ui2 = _interopRequireDefault(__webpack_require__( /*! ../../ui/shared/ui.editor_factory_mixin */ 15653)); var _tree_view = _interopRequireDefault(__webpack_require__( /*! ../../ui/tree_view */ 30254)); var _ui3 = _interopRequireDefault(__webpack_require__( /*! ../../ui/widget/ui.widget */ 14390)); var _m_utils = __webpack_require__( /*! ../ui/overlay/m_utils */ 38154); var _m_utils2 = __webpack_require__( /*! ./m_utils */ 70474); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const ACTIONS = [{ name: "onEditorPreparing", config: { excludeValidators: ["disabled", "readOnly"], category: "rendering" } }, { name: "onEditorPrepared", config: { excludeValidators: ["disabled", "readOnly"], category: "rendering" } }, { name: "onValueChanged", config: { excludeValidators: ["disabled", "readOnly"] } }]; const OPERATORS = { and: "and", or: "or", notAnd: "!and", notOr: "!or" }; const EditorFactory = (0, _ui2.default)(class {}); class FilterBuilder extends _ui3.default { _getDefaultOptions() { return (0, _extend.extend)(super._getDefaultOptions(), { onEditorPreparing: null, onEditorPrepared: null, onValueChanged: null, fields: [], groupOperations: ["and", "or", "notAnd", "notOr"], maxGroupLevel: void 0, value: null, allowHierarchicalFields: false, groupOperationDescriptions: { and: _message.default.format("dxFilterBuilder-and"), or: _message.default.format("dxFilterBuilder-or"), notAnd: _message.default.format("dxFilterBuilder-notAnd"), notOr: _message.default.format("dxFilterBuilder-notOr") }, customOperations: [], closePopupOnTargetScroll: true, filterOperationDescriptions: { between: _message.default.format("dxFilterBuilder-filterOperationBetween"), equal: _message.default.format("dxFilterBuilder-filterOperationEquals"), notEqual: _message.default.format("dxFilterBuilder-filterOperationNotEquals"), lessThan: _message.default.format("dxFilterBuilder-filterOperationLess"), lessThanOrEqual: _message.default.format("dxFilterBuilder-filterOperationLessOrEquals"), greaterThan: _message.default.format("dxFilterBuilder-filterOperationGreater"), greaterThanOrEqual: _message.default.format("dxFilterBuilder-filterOperationGreaterOrEquals"), startsWith: _message.default.format("dxFilterBuilder-filterOperationStartsWith"), contains: _message.default.format("dxFilterBuilder-filterOperationContains"), notContains: _message.default.format("dxFilterBuilder-filterOperationNotContains"), endsWith: _message.default.format("dxFilterBuilder-filterOperationEndsWith"), isBlank: _message.default.format("dxFilterBuilder-filterOperationIsBlank"), isNotBlank: _message.default.format("dxFilterBuilder-filterOperationIsNotBlank") } }) } _optionChanged(args) { switch (args.name) { case "closePopupOnTargetScroll": break; case "onEditorPreparing": case "onEditorPrepared": case "onValueChanged": this._initActions(); break; case "customOperations": this._initCustomOperations(); this._invalidate(); break; case "fields": case "maxGroupLevel": case "groupOperations": case "allowHierarchicalFields": case "groupOperationDescriptions": case "filterOperationDescriptions": this._invalidate(); break; case "value": if (args.value !== args.previousValue) { const disableInvalidateForValue = this._disableInvalidateForValue; if (!disableInvalidateForValue) { this._initModel(); this._invalidate() } this._disableInvalidateForValue = false; this.executeAction("onValueChanged", { value: args.value, previousValue: args.previousValue }); this._disableInvalidateForValue = disableInvalidateForValue } break; default: super._optionChanged(args) } } getFilterExpression() { const fields = this._getNormalizedFields(); const value = (0, _extend.extend)(true, [], this._model); return (0, _m_utils2.getFilterExpression)((0, _m_utils2.getNormalizedFilter)(value), fields, this._customOperations, "filterBuilder") } _getNormalizedFields() { return (0, _m_utils2.getNormalizedFields)(this.option("fields")) } _updateFilter() { this._disableInvalidateForValue = true; const value = (0, _extend.extend)(true, [], this._model); const normalizedValue = (0, _m_utils2.getNormalizedFilter)(value); const oldValue = (0, _m_utils2.getNormalizedFilter)(this._getModel(this.option("value"))); if (JSON.stringify(oldValue) !== JSON.stringify(normalizedValue)) { this.option("value", normalizedValue) } this._disableInvalidateForValue = false; this._fireContentReadyAction() } _init() { this._initCustomOperations(); this._initModel(); this._initEditorFactory(); this._initActions(); super._init() } _initEditorFactory() { this._editorFactory = new EditorFactory } _initCustomOperations() { this._customOperations = (0, _m_utils2.getMergedOperations)(this.option("customOperations"), this.option("filterOperationDescriptions.between"), this) } _getDefaultGroupOperation() { var _this$option; return (null === (_this$option = this.option("groupOperations")) || void 0 === _this$option ? void 0 : _this$option[0]) ?? OPERATORS.and } _getModel(value) { return (0, _m_utils2.convertToInnerStructure)(value, this._customOperations, this._getDefaultGroupOperation()) } _initModel() { this._model = this._getModel(this.option("value")) } _initActions() { const that = this; that._actions = {}; ACTIONS.forEach((action => { const actionConfig = (0, _extend.extend)({}, action.config); that._actions[action.name] = that._createActionByOption(action.name, actionConfig) })) } executeAction(actionName, options) { const action = this._actions[actionName]; return action && action(options) } _initMarkup() { this.$element().addClass("dx-filterbuilder"); super._initMarkup(); this._createGroupElementByCriteria(this._model).appendTo(this.$element()) } _createConditionElement(condition, parent) { return (0, _renderer.default)("
").addClass("dx-filterbuilder-group").append(this._createConditionItem(condition, parent)) } _createGroupElementByCriteria(criteria, parent) { let groupLevel = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0; const $group = this._createGroupElement(criteria, parent, groupLevel); const $groupContent = $group.find(".dx-filterbuilder-group-content"); const groupCriteria = (0, _m_utils2.getGroupCriteria)(criteria); for (let i = 0; i < groupCriteria.length; i++) { const innerCriteria = groupCriteria[i]; if ((0, _m_utils2.isGroup)(innerCriteria)) { this._createGroupElementByCriteria(innerCriteria, criteria, groupLevel + 1).appendTo($groupContent) } else if ((0, _m_utils2.isCondition)(innerCriteria)) { this._createConditionElement(innerCriteria, criteria).appendTo($groupContent) } } return $group } _createGroupElement(criteria, parent, groupLevel) { const $groupItem = (0, _renderer.default)("
").addClass("dx-filterbuilder-group-item"); const $groupContent = (0, _renderer.default)("
").addClass("dx-filterbuilder-group-content"); const $group = (0, _renderer.default)("
").addClass("dx-filterbuilder-group").append($groupItem).append($groupContent); if (null != parent) { this._createRemoveButton((() => { (0, _m_utils2.removeItem)(parent, criteria); $group.remove(); this._updateFilter() })).appendTo($groupItem) } this._createGroupOperationButton(criteria).appendTo($groupItem); this._createAddButton((() => { const newGroup = (0, _m_utils2.createEmptyGroup)(this._getDefaultGroupOperation()); (0, _m_utils2.addItem)(newGroup, criteria); this._createGroupElement(newGroup, criteria, groupLevel + 1).appendTo($groupContent); this._updateFilter() }), (() => { const field = this.option("fields")[0]; const newCondition = (0, _m_utils2.createCondition)(field, this._customOperations); (0, _m_utils2.addItem)(newCondition, criteria); this._createConditionElement(newCondition, criteria).appendTo($groupContent); this._updateFilter() }), groupLevel).appendTo($groupItem); return $group } _createButton(caption) { return (0, _renderer.default)("
").text(caption) } _createGroupOperationButton(criteria) { const groupOperations = this._getGroupOperations(criteria); let groupMenuItem = (0, _m_utils2.getGroupMenuItem)(criteria, groupOperations); const caption = groupMenuItem.text; const $operationButton = groupOperations && groupOperations.length < 2 ? this._createButton(caption).addClass("dx-state-disabled") : this._createButtonWithMenu({ caption: caption, menu: { items: groupOperations, displayExpr: "text", keyExpr: "value", onItemClick: e => { if (groupMenuItem !== e.itemData) { (0, _m_utils2.setGroupValue)(criteria, e.itemData.value); $operationButton.text(e.itemData.text); groupMenuItem = e.itemData; this._updateFilter() } }, onContentReady(e) { e.component.selectItem(groupMenuItem) }, cssClass: "dx-filterbuilder-group-operations" } }); return $operationButton.addClass("dx-filterbuilder-text").addClass("dx-filterbuilder-group-operation").attr("tabindex", 0) } _createButtonWithMenu(options) { const that = this; const removeMenu = function() { that.$element().find(".dx-state-active").removeClass("dx-state-active"); that.$element().find(".dx-overlay .dx-treeview").remove(); that.$element().find(".dx-overlay").remove() }; const rtlEnabled = this.option("rtlEnabled"); const position = rtlEnabled ? "right" : "left"; const $button = this._createButton(options.caption); (0, _extend.extend)(options.menu, { focusStateEnabled: true, selectionMode: "single", onItemClick: (handler = options.menu.onItemClick, function(e) { handler(e); if ("dxclick" === e.event.type) { removeMenu() } }), onHiding() { $button.removeClass("dx-state-active") }, position: { my: `${position} top`, at: `${position} bottom`, offset: "0 1", of: $button, collision: "flip" }, animation: null, onHidden() { removeMenu() }, cssClass: `dx-filterbuilder-overlay ${options.menu.cssClass}`, rtlEnabled: rtlEnabled }); var handler; options.popup = { onShown(info) { const treeViewElement = (0, _renderer.default)(info.component.content()).find(".dx-treeview"); const treeView = treeViewElement.dxTreeView("instance"); _events_engine.default.on(treeViewElement, "keyup keydown", (e => { const keyName = (0, _index.normalizeKeyName)(e); if ("keydown" === e.type && "tab" === keyName || "keyup" === e.type && ("escape" === keyName || "enter" === keyName)) { info.component.hide(); _events_engine.default.trigger(options.menu.position.of, "focus") } })); treeView.focus(); treeView.option("focusedElement", null) } }; this._subscribeOnClickAndEnterKey($button, (() => { removeMenu(); that._createPopupWithTreeView(options, that.$element()); $button.addClass("dx-state-active") })); return $button } _hasValueButton(condition) { const customOperation = (0, _m_utils2.getCustomOperation)(this._customOperations, condition[1]); return customOperation ? false !== customOperation.hasValue : null !== condition[2] } _createOperationButtonWithMenu(condition, field) { const that = this; const availableOperations = (0, _m_utils2.getAvailableOperations)(field, this.option("filterOperationDescriptions"), this._customOperations); let currentOperation = (0, _m_utils2.getOperationFromAvailable)((0, _m_utils2.getOperationValue)(condition), availableOperations); const $operationButton = this._createButtonWithMenu({ caption: currentOperation.text, menu: { items: availableOperations, displayExpr: "text", onItemRendered(e) { e.itemData.isCustom && (0, _renderer.default)(e.itemElement).addClass("dx-filterbuilder-menu-custom-operation") }, onContentReady(e) { e.component.selectItem(currentOperation) }, onItemClick: e => { if (currentOperation !== e.itemData) { currentOperation = e.itemData; (0, _m_utils2.updateConditionByOperation)(condition, currentOperation.value, that._customOperations); const $valueButton = $operationButton.siblings().filter(".dx-filterbuilder-item-value"); if (that._hasValueButton(condition)) { if (0 !== $valueButton.length) { $valueButton.remove() } that._createValueButton(condition, field).appendTo($operationButton.parent()) } else { $valueButton.remove() } $operationButton.text(currentOperation.text); this._updateFilter() } }, cssClass: "dx-filterbuilder-operations" } }).addClass("dx-filterbuilder-text").addClass("dx-filterbuilder-item-operation").attr("tabindex", 0); return $operationButton } _createOperationAndValueButtons(condition, field, $item) { this._createOperationButtonWithMenu(condition, field).appendTo($item); if (this._hasValueButton(condition)) { this._createValueButton(condition, field).appendTo($item) } } _createFieldButtonWithMenu(fields, condition, field) { const that = this; const allowHierarchicalFields = this.option("allowHierarchicalFields"); const items = (0, _m_utils2.getItems)(fields, allowHierarchicalFields); let item = (0, _m_utils2.getField)(field.name || field.dataField, items); const getFullCaption = function(item, items) { return allowHierarchicalFields ? (0, _m_utils2.getCaptionWithParents)(item, items) : item.caption }; const $fieldButton = this._createButtonWithMenu({ caption: getFullCaption(item, items), menu: { items: items, dataStructure: "plain", keyExpr: "id", parentId: "parentId", displayExpr: "caption", onItemClick: e => { if (item !== e.itemData) { item = e.itemData; condition[0] = item.name || item.dataField; condition[2] = "object" === item.dataType ? null : ""; (0, _m_utils2.updateConditionByOperation)(condition, (0, _m_utils2.getDefaultOperation)(item), that._customOperations); $fieldButton.siblings().filter(".dx-filterbuilder-text").remove(); that._createOperationAndValueButtons(condition, item, $fieldButton.parent()); const caption = getFullCaption(item, e.component.option("items")); $fieldButton.text(caption); this._updateFilter() } }, onContentReady(e) { e.component.selectItem(item) }, cssClass: "dx-filterbuilder-fields" } }).addClass("dx-filterbuilder-text").addClass("dx-filterbuilder-item-field").attr("tabindex", 0); return $fieldButton } _createConditionItem(condition, parent) { const $item = (0, _renderer.default)("
").addClass("dx-filterbuilder-group-item"); const fields = this._getNormalizedFields(); const field = (0, _m_utils2.getField)(condition[0], fields); this._createRemoveButton((() => { (0, _m_utils2.removeItem)(parent, condition); const isSingleChild = 1 === $item.parent().children().length; if (isSingleChild) { $item.parent().remove() } else { $item.remove() } this._updateFilter() })).appendTo($item); this._createFieldButtonWithMenu(fields, condition, field).appendTo($item); this._createOperationAndValueButtons(condition, field, $item); return $item } _getGroupOperations(criteria) { let groupOperations = this.option("groupOperations"); const groupOperationDescriptions = this.option("groupOperationDescriptions"); if (!groupOperations || !groupOperations.length) { groupOperations = [(0, _m_utils2.getGroupValue)(criteria).replace("!", "not")] } return groupOperations.map((operation => ({ text: groupOperationDescriptions[operation], value: OPERATORS[operation] }))) } _createRemoveButton(handler) { const $removeButton = (0, _renderer.default)("
").addClass("dx-filterbuilder-action-icon").addClass("dx-icon-remove").addClass("dx-filterbuilder-action").attr("tabindex", 0); this._subscribeOnClickAndEnterKey($removeButton, handler); return $removeButton } _createAddButton(addGroupHandler, addConditionHandler, groupLevel) { let $button; const maxGroupLevel = this.option("maxGroupLevel"); if ((0, _type.isDefined)(maxGroupLevel) && groupLevel >= maxGroupLevel) { $button = this._createButton(); this._subscribeOnClickAndEnterKey($button, addConditionHandler) } else { $button = this._createButtonWithMenu({ menu: { items: [{ caption: _message.default.format("dxFilterBuilder-addCondition"), click: addConditionHandler }, { caption: _message.default.format("dxFilterBuilder-addGroup"), click: addGroupHandler }], displayExpr: "caption", onItemClick(e) { e.itemData.click() }, cssClass: "dx-filterbuilder-add-condition" } }) } return $button.addClass("dx-filterbuilder-action-icon").addClass("dx-icon-plus").addClass("dx-filterbuilder-action").attr("tabindex", 0) } _createValueText(item, field, $container) { const that = this; const $text = (0, _renderer.default)("
").html(" ").addClass("dx-filterbuilder-item-value-text").attr("tabindex", 0).appendTo($container); const value = item[2]; const customOperation = (0, _m_utils2.getCustomOperation)(that._customOperations, item[1]); if (!customOperation && field.lookup) { (0, _m_utils2.getCurrentLookupValueText)(field, value, (result => { (0, _m_utils2.renderValueText)($text, result) })) } else { (0, _deferred.when)((0, _m_utils2.getCurrentValueText)(field, value, customOperation)).done((result => { (0, _m_utils2.renderValueText)($text, result, customOperation) })) } that._subscribeOnClickAndEnterKey($text, (e => { if ("keyup" === e.type) { e.stopPropagation() } that._createValueEditorWithEvents(item, field, $container) })); return $text } _updateConditionValue(item, value, callback) { const areValuesDifferent = item[2] !== value; if (areValuesDifferent) { item[2] = value } callback(); this._updateFilter() } _addDocumentKeyUp($editor, handler) { let isComposing = false; let hasCompositionJustEnded = false; const document = _dom_adapter.default.getDocument(); const documentKeyUpHandler = e => { if (isComposing || hasCompositionJustEnded) { hasCompositionJustEnded = false; return } handler(e) }; _events_engine.default.on(document, "keyup", documentKeyUpHandler); const input = $editor.find("input"); _events_engine.default.on(input, "compositionstart", (() => { isComposing = true })); _events_engine.default.on(input, "compositionend", (() => { isComposing = false; hasCompositionJustEnded = true })); _events_engine.default.on(input, "keydown", (event => { if (229 !== event.which) { hasCompositionJustEnded = false } })); this._documentKeyUpHandler = documentKeyUpHandler } _addDocumentClick($editor, closeEditorFunc) { const document = _dom_adapter.default.getDocument(); const documentClickHandler = e => { if (!this._isFocusOnEditorParts($editor, e.target)) { _events_engine.default.trigger($editor.find("input"), "change"); closeEditorFunc() } }; _events_engine.default.on(document, "dxpointerdown", documentClickHandler); this._documentClickHandler = documentClickHandler } _isFocusOnEditorParts($editor, target) { const activeElement = target || _dom_adapter.default.getActiveElement(); return (0, _renderer.default)(activeElement).closest($editor.children()).length || (0, _renderer.default)(activeElement).closest(".dx-dropdowneditor-overlay").length } _removeEvents() { const document = _dom_adapter.default.getDocument(); (0, _type.isDefined)(this._documentKeyUpHandler) && _events_engine.default.off(document, "keyup", this._documentKeyUpHandler); (0, _type.isDefined)(this._documentClickHandler) && _events_engine.default.off(document, "dxpointerdown", this._documentClickHandler) } _dispose() { this._removeEvents(); super._dispose() } _createValueEditorWithEvents(item, field, $container) { let value = item[2]; const createValueText = () => { $container.empty(); this._removeEvents(); return this._createValueText(item, field, $container) }; const closeEditor = () => { this._updateConditionValue(item, value, (() => { createValueText() })) }; const options = { value: "" === value ? null : value, filterOperation: (0, _m_utils2.getOperationValue)(item), setValue(data) { value = null === data ? "" : data }, closeEditor: closeEditor, text: $container.text() }; $container.empty(); const $editor = this._createValueEditor($container, field, options); _events_engine.default.trigger($editor.find("input").not(":hidden").eq(0), "focus"); this._removeEvents(); this._addDocumentClick($editor, closeEditor); this._addDocumentKeyUp($editor, (e => { const keyName = (0, _index.normalizeKeyName)(e); if ("tab" === keyName) { if (this._isFocusOnEditorParts($editor)) { return } this._updateConditionValue(item, value, (() => { createValueText(); if (e.shiftKey) { _events_engine.default.trigger($container.prev(), "focus") } })) } if ("escape" === keyName) { _events_engine.default.trigger(createValueText(), "focus") } if ("enter" === keyName) { this._updateConditionValue(item, value, (() => { _events_engine.default.trigger(createValueText(), "focus") })) } })); this._fireContentReadyAction() } _createValueButton(item, field) { const $valueButton = (0, _renderer.default)("
").addClass("dx-filterbuilder-text").addClass("dx-filterbuilder-item-value"); this._createValueText(item, field, $valueButton); return $valueButton } _createValueEditor($container, field, options) { const $editor = (0, _renderer.default)("
").attr("tabindex", 0).appendTo($container); const customOperation = (0, _m_utils2.getCustomOperation)(this._customOperations, options.filterOperation); const editorTemplate = customOperation && customOperation.editorTemplate ? customOperation.editorTemplate : field.editorTemplate; if (editorTemplate) { const template = this._getTemplate(editorTemplate); template.render({ model: (0, _extend.extend)({ field: field }, options), container: $editor }) } else { this._editorFactory.createEditor.call(this, $editor, (0, _extend.extend)({}, field, options, { parentType: "filterBuilder" })) } return $editor } _createPopupWithTreeView(options, $container) { const that = this; const $popup = (0, _renderer.default)("
").addClass(options.menu.cssClass).appendTo($container); this._createComponent($popup, _ui.default, { onHiding: options.menu.onHiding, onHidden: options.menu.onHidden, rtlEnabled: options.menu.rtlEnabled, position: options.menu.position, animation: options.menu.animation, contentTemplate(contentElement) { const $menuContainer = (0, _renderer.default)("
").appendTo(contentElement); that._createComponent($menuContainer, _tree_view.default, options.menu); this.repaint() }, _ignoreFunctionValueDeprecation: true, maxHeight: () => (0, _m_utils.getElementMaxHeightByWindow)(options.menu.position.of), visible: true, focusStateEnabled: false, preventScrollEvents: false, hideOnParentScroll: this.option("closePopupOnTargetScroll"), hideOnOutsideClick: true, onShown: options.popup.onShown, shading: false, width: "auto", height: "auto", showTitle: false, _wrapperClassExternal: options.menu.cssClass }) } _subscribeOnClickAndEnterKey($button, handler) { _events_engine.default.on($button, "dxclick", handler); _events_engine.default.on($button, "keyup", (e => { if ("enter" === (0, _index.normalizeKeyName)(e)) { handler(e) } })) } }(0, _component_registrator.default)("dxFilterBuilder", FilterBuilder); exports.default = FilterBuilder }, 90067: /*!*********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/filter_builder/m_filter_operations_dictionary.js ***! \*********************************************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; const OPERATION_ICONS = { "=": "equal", "<>": "notequal", "<": "less", "<=": "lessorequal", ">": "greater", ">=": "greaterorequal", notcontains: "doesnotcontain", contains: "contains", startswith: "startswith", endswith: "endswith", isblank: "isblank", isnotblank: "isnotblank" }; const OPERATION_NAME = { "=": "equal", "<>": "notEqual", "<": "lessThan", "<=": "lessThanOrEqual", ">": "greaterThan", ">=": "greaterThanOrEqual", startswith: "startsWith", contains: "contains", notcontains: "notContains", endswith: "endsWith", isblank: "isBlank", isnotblank: "isNotBlank", between: "between" }; exports.default = { getIconByFilterOperation: filterOperation => OPERATION_ICONS[filterOperation], getNameByFilterOperation: filterOperation => OPERATION_NAME[filterOperation] } }, 70474: /*!**********************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/filter_builder/m_utils.js ***! \**********************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.addItem = function(item, group) { const criteria = getGroupCriteria(group); const groupValue = getGroupValue(criteria); 1 === criteria.length ? criteria.unshift(item) : criteria.push(item, groupValue); return group }; exports.convertToInnerStructure = convertToInnerStructure; exports.createCondition = function(field, customOperations) { const condition = [field.dataField, "", ""]; const filterOperation = getDefaultOperation(field); updateConditionByOperation(condition, filterOperation, customOperations); return condition }; exports.createEmptyGroup = createEmptyGroup; exports.filterHasField = function filterHasField(filter, dataField) { if (null === filter || 0 === filter.length) { return false } if (isCondition(filter)) { return filter[0] === dataField } return filter.some((item => (isCondition(item) || isGroup(item)) && filterHasField(item, dataField))) }; exports.getAvailableOperations = function(field, filterOperationDescriptions, customOperations) { const filterOperations = getFilterOperations(field); const isLookupField = !!field.lookup; customOperations.forEach((customOperation => { if (!field.filterOperations && -1 === filterOperations.indexOf(customOperation.name)) { const dataTypes = customOperation && customOperation.dataTypes; const isOperationForbidden = isLookupField ? !!customOperation.notForLookup : false; if (!isOperationForbidden && dataTypes && dataTypes.indexOf(field.dataType || DEFAULT_DATA_TYPE) >= 0) { filterOperations.push(customOperation.name) } } })); return filterOperations.map((operation => { const customOperation = getCustomOperation(customOperations, operation); if (customOperation) { return { icon: customOperation.icon || EMPTY_MENU_ICON, text: customOperation.caption || (0, _inflector.captionize)(customOperation.name), value: customOperation.name, isCustom: true } } return { icon: _m_filter_operations_dictionary.default.getIconByFilterOperation(operation) || EMPTY_MENU_ICON, text: getCaptionByOperation(operation, filterOperationDescriptions), value: operation } })) }; exports.getCaptionByOperation = getCaptionByOperation; exports.getCaptionWithParents = function getCaptionWithParents(item, plainItems) { if (hasParent(item.dataField)) { const parentId = getParentIdFromItemDataField(item.dataField); for (let i = 0; i < plainItems.length; i++) { if (plainItems[i].dataField === parentId) { return `${getCaptionWithParents(plainItems[i],plainItems)}.${item.caption}` } } } return item.caption }; exports.getCurrentLookupValueText = function(field, value, handler) { if ("" === value) { handler(""); return } const { lookup: lookup } = field; if (lookup.items) { handler(lookup.calculateCellValue(value) || "") } else { const lookupDataSource = (0, _type.isFunction)(lookup.dataSource) ? lookup.dataSource({}) : lookup.dataSource; const dataSource = new _data_source.DataSource(lookupDataSource); dataSource.loadSingle(lookup.valueExpr, value).done((result => { let valueText = ""; if (result) { valueText = lookup.displayExpr ? (0, _data.compileGetter)(lookup.displayExpr)(result) : result } if (field.customizeText) { valueText = field.customizeText({ value: value, valueText: valueText }) } handler(valueText) })).fail((() => { handler("") })) } }; exports.getCurrentValueText = function(field, value, customOperation) { let target = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : "filterBuilder"; if (checkDefaultValue(value)) { return "" } if (Array.isArray(value)) { const result = new _deferred.Deferred; _deferred.when.apply(this, function(field, value, customOperation, target) { const options = { values: value }; return value.map((v => getPrimitiveValueText(field, v, customOperation, target, options))) }(field, value, customOperation, target)).done((function() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key] } const text = args.some((item => !checkDefaultValue(item))) ? args.map((item => !checkDefaultValue(item) ? item : "?")) : ""; result.resolve(text) })); return result } return getPrimitiveValueText(field, value, customOperation, target) }; exports.getCustomOperation = getCustomOperation; exports.getDefaultOperation = getDefaultOperation; exports.getField = getField; exports.getFilterExpression = function getFilterExpression(value, fields, customOperations, target) { if (!(0, _type.isDefined)(value)) { return null } if (isNegationGroup(value)) { const filterExpression = getFilterExpression(value[1], fields, customOperations, target); return ["!", filterExpression] } const criteria = getGroupCriteria(value); if (isCondition(criteria)) { return getConditionFilterExpression(criteria, fields, customOperations, target) || null } let result = []; let filterExpression; const groupValue = getGroupValue(criteria); for (let 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) { result.length && result.push(groupValue); result.push(filterExpression) } } } if (1 === result.length) { result = result[0] } return result.length ? result : null }; exports.getFilterOperations = getFilterOperations; exports.getGroupCriteria = getGroupCriteria; exports.getGroupMenuItem = function(group, availableGroups) { const groupValue = getGroupValue(group); return availableGroups.filter((item => item.value === groupValue))[0] }; exports.getGroupValue = getGroupValue; exports.getItems = getItems; exports.getMatchedConditions = function(filter, dataField) { if (null === filter || 0 === filter.length) { return [] } if (isCondition(filter)) { if (isMatchedCondition(filter, dataField)) { return [filter] } return [] } const groupValue = getGroupValue(filter); if (groupValue !== AND_GROUP_OPERATION) { return [] } const result = filter.filter((item => isCondition(item) && isMatchedCondition(item, dataField))); return result }; exports.getMergedOperations = function(customOperations, betweenCaption, context) { const result = (0, _extend.extend)(true, [], customOperations); let betweenIndex = -1; result.some(((customOperation, index) => { if ("between" === customOperation.name) { betweenIndex = index; return true } return })); if (-1 !== betweenIndex) { result[betweenIndex] = (0, _extend.extend)((0, _m_between.getConfig)(betweenCaption, context), result[betweenIndex]) } else { result.unshift((0, _m_between.getConfig)(betweenCaption, context)) } return result }; exports.getNormalizedFields = function(fields) { return fields.reduce(((result, field) => { if ((0, _type.isDefined)(field.dataField)) { const normalizedField = {}; for (const key in field) { if (field[key] && AVAILABLE_FIELD_PROPERTIES.includes(key)) { normalizedField[key] = field[key] } } normalizedField.defaultCalculateFilterExpression = _filtering.default.defaultCalculateFilterExpression; if (!(0, _type.isDefined)(normalizedField.dataType)) { normalizedField.dataType = DEFAULT_DATA_TYPE } if (!(0, _type.isDefined)(normalizedField.trueText)) { normalizedField.trueText = _message.default.format("dxDataGrid-trueText") } if (!(0, _type.isDefined)(normalizedField.falseText)) { normalizedField.falseText = _message.default.format("dxDataGrid-falseText") } result.push(normalizedField) } return result }), []) }; exports.getNormalizedFilter = function getNormalizedFilter(group) { const criteria = getGroupCriteria(group); let i; if (0 === criteria.length) { return null } const itemsForRemove = []; for (i = 0; i < criteria.length; i++) { if (isGroup(criteria[i])) { const 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 = function(group, criteria) { if (isNegationGroup(group)) { group[1] = criteria } else { group = criteria } return group }(group, criteria[0]) } if (0 === group.length) { return null } return group }; exports.getOperationFromAvailable = function(operation, availableOperations) { for (let i = 0; i < availableOperations.length; i++) { if (availableOperations[i].value === operation) { return availableOperations[i] } } throw new _ui.default.Error("E1048", operation) }; exports.getOperationValue = function(condition) { let caption; if (null === condition[2]) { if (condition[1] === EQUAL_OPERATION) { caption = "isblank" } else { caption = "isnotblank" } } else { caption = condition[1] } return caption }; exports.isCondition = isCondition; exports.isEmptyGroup = function(group) { const criteria = getGroupCriteria(group); if (isCondition(criteria)) { return false } const hasConditions = criteria.some((item => isCondition(item))); return !hasConditions }; exports.isGroup = isGroup; exports.isValidCondition = isValidCondition; exports.removeFieldConditionsFromFilter = function(filter, dataField) { if (!filter || 0 === filter.length) { return null } if (isCondition(filter)) { const hasMatchedCondition = isMatchedCondition(filter, dataField); return !hasMatchedCondition ? filter : null } return syncConditionIntoGroup(filter, [dataField], false) }; exports.removeItem = removeItem; exports.renderValueText = void 0; exports.setGroupValue = function(group, value) { ! function(group, value) { const isNegationValue = function(value) { return -1 !== value.indexOf("!") }; const convertGroupToNegationGroup = function(group) { const criteria = group.slice(0); group.length = 0; group.push("!", criteria) }; const convertNegationGroupToGroup = function(group) { const criteria = getGroupCriteria(group); group.length = 0; [].push.apply(group, criteria) }; if (isNegationValue(value)) { if (!isNegationGroup(group)) { convertGroupToNegationGroup(group) } } else if (isNegationGroup(group)) { convertNegationGroupToGroup(group) } }(group, value); const criteria = getGroupCriteria(group); let i; value = function(value) { return -1 === value.indexOf("!") ? value : value.substring(1) }(value); ! function(criteria, value) { for (i = 0; i < criteria.length; i++) { if (!Array.isArray(criteria[i])) { criteria[i] = value } } }(criteria, value); return group }; exports.syncFilters = function(filter, addedFilter) { if (null === filter || 0 === filter.length) { return addedFilter } if (isCondition(filter)) { if (isMatchedCondition(filter, addedFilter[0])) { return addedFilter } return [filter, AND_GROUP_OPERATION, addedFilter] } const groupValue = getGroupValue(filter); if (groupValue !== AND_GROUP_OPERATION) { return [addedFilter, "and", filter] } return syncConditionIntoGroup(filter, addedFilter, true) }; exports.updateConditionByOperation = updateConditionByOperation; var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../core/renderer */ 68374)); var _data = __webpack_require__( /*! ../../core/utils/data */ 47617); var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 13306); var _inflector = __webpack_require__( /*! ../../core/utils/inflector */ 78008); var _type = __webpack_require__( /*! ../../core/utils/type */ 35922); var _data_source = __webpack_require__( /*! ../../data/data_source/data_source */ 85273); var _errors = __webpack_require__( /*! ../../data/errors */ 18438); var _format_helper = _interopRequireDefault(__webpack_require__( /*! ../../format_helper */ 30343)); var _message = _interopRequireDefault(__webpack_require__( /*! ../../localization/message */ 28109)); var _filtering = _interopRequireDefault(__webpack_require__( /*! ../../ui/shared/filtering */ 18740)); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../ui/widget/ui.errors */ 96688)); var _m_between = __webpack_require__( /*! ./m_between */ 90102); var _m_filter_operations_dictionary = _interopRequireDefault(__webpack_require__( /*! ./m_filter_operations_dictionary */ 90067)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const DEFAULT_DATA_TYPE = "string"; const EMPTY_MENU_ICON = "icon-none"; const AND_GROUP_OPERATION = "and"; const EQUAL_OPERATION = "="; const NOT_EQUAL_OPERATION = "<>"; const DATATYPE_OPERATIONS = { number: ["=", "<>", "<", ">", "<=", ">=", "isblank", "isnotblank"], string: ["contains", "notcontains", "startswith", "endswith", "=", "<>", "isblank", "isnotblank"], date: ["=", "<>", "<", ">", "<=", ">=", "isblank", "isnotblank"], datetime: ["=", "<>", "<", ">", "<=", ">=", "isblank", "isnotblank"], boolean: ["=", "<>", "isblank", "isnotblank"], object: ["isblank", "isnotblank"] }; const DEFAULT_FORMAT = { date: "shortDate", datetime: "shortDateShortTime" }; const LOOKUP_OPERATIONS = ["=", "<>", "isblank", "isnotblank"]; const AVAILABLE_FIELD_PROPERTIES = ["caption", "customizeText", "dataField", "dataType", "editorTemplate", "falseText", "editorOptions", "filterOperations", "format", "lookup", "trueText", "calculateFilterExpression", "name"]; function isNegationGroup(group) { return group && group.length > 1 && "!" === group[0] && !isCondition(group) } function getGroupCriteria(group) { return isNegationGroup(group) ? group[1] : group } function getCriteriaOperation(criteria) { if (isCondition(criteria)) { return AND_GROUP_OPERATION } let value = ""; for (let i = 0; i < criteria.length; i++) { const 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) { const criteria = getGroupCriteria(group); let value = getCriteriaOperation(criteria); if (!value) { value = AND_GROUP_OPERATION } if (criteria !== group) { value = `!${value}` } return value } function getFilterOperations(field) { const result = (entity = field.filterOperations, Array.isArray(entity) && entity.length) ? field.filterOperations : function(field) { return field.lookup && LOOKUP_OPERATIONS || DATATYPE_OPERATIONS[field.dataType || DEFAULT_DATA_TYPE] }(field); var entity; return (0, _extend.extend)([], result) } function getCaptionByOperation(operation, filterOperationDescriptions) { const operationName = _m_filter_operations_dictionary.default.getNameByFilterOperation(operation); return filterOperationDescriptions && filterOperationDescriptions[operationName] ? filterOperationDescriptions[operationName] : operationName } function getCustomOperation(customOperations, name) { const filteredOperations = customOperations.filter((item => item.name === name)); return filteredOperations.length ? filteredOperations[0] : null } function getDefaultOperation(field) { return field.defaultFilterOperation || getFilterOperations(field)[0] } function removeItem(group, item) { const criteria = getGroupCriteria(group); const index = criteria.indexOf(item); criteria.splice(index, 1); if (1 !== criteria.length) { criteria.splice(index, 1) } return group } function createEmptyGroup(value) { const isNegation = isNegationGroupOperation(value); const groupOperation = isNegation ? getGroupOperationFromNegationOperation(value) : value; return isNegation ? ["!", [groupOperation]] : [groupOperation] } function getField(dataField, fields) { for (let i = 0; i < fields.length; i++) { if (fields[i].name === dataField) { return fields[i] } if (fields[i].dataField.toLowerCase() === dataField.toLowerCase()) { return fields[i] } } const extendedFields = getItems(fields, true).filter((item => item.dataField.toLowerCase() === dataField.toLowerCase())); if (extendedFields.length > 0) { return extendedFields[0] } throw new _ui.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, defaultGroupOperation) { defaultGroupOperation = defaultGroupOperation || AND_GROUP_OPERATION; const groupOperation = getCriteriaOperation(group).toLowerCase() || defaultGroupOperation; let innerGroup = []; for (let i = 0; i < group.length; i++) { if (isGroup(group[i])) { innerGroup.push(convertToInnerStructure(group[i], customOperations, defaultGroupOperation)); innerGroup = appendGroupOperationToGroup(innerGroup, groupOperation) } else if (isCondition(group[i])) { innerGroup.push(convertToInnerCondition(group[i], customOperations)); innerGroup = appendGroupOperationToGroup(innerGroup, groupOperation) } } if (0 === innerGroup.length) { innerGroup = appendGroupOperationToGroup(innerGroup, groupOperation) } return innerGroup } function convertToInnerCondition(condition, customOperations) { if (function(condition, customOperations) { const customOperation = getCustomOperation(customOperations, condition[1]); return customOperation && customOperation.name === condition[1] }(condition, customOperations)) { return condition } if (condition.length < 3) { condition[2] = condition[1]; condition[1] = EQUAL_OPERATION } return condition } function isNegationGroupOperation(operation) { return -1 !== operation.indexOf("not") } function getGroupOperationFromNegationOperation(operation) { return operation.substring(3).toLowerCase() } function appendGroupOperationToCriteria(criteria, groupOperation) { const isNegation = isNegationGroupOperation(groupOperation); groupOperation = isNegation ? getGroupOperationFromNegationOperation(groupOperation) : groupOperation; return isNegation ? ["!", criteria, groupOperation] : [criteria, groupOperation] } function appendGroupOperationToGroup(group, groupOperation) { const isNegation = isNegationGroupOperation(groupOperation); groupOperation = isNegation ? getGroupOperationFromNegationOperation(groupOperation) : groupOperation; group.push(groupOperation); let result = group; if (isNegation) { result = ["!", result] } return result } function convertToInnerStructure(value, customOperations, defaultGroupOperation) { defaultGroupOperation = defaultGroupOperation || AND_GROUP_OPERATION; if (!value) { return createEmptyGroup(defaultGroupOperation) } value = (0, _extend.extend)(true, [], value); if (isCondition(value)) { return appendGroupOperationToCriteria(convertToInnerCondition(value, customOperations), defaultGroupOperation) } if (isNegationGroup(value)) { return ["!", isCondition(value[1]) ? appendGroupOperationToCriteria(convertToInnerCondition(value[1], customOperations), defaultGroupOperation) : isNegationGroup(value[1]) ? appendGroupOperationToCriteria(convertToInnerStructure(value[1], customOperations), defaultGroupOperation) : convertToInnerGroup(value[1], customOperations, defaultGroupOperation)] } return convertToInnerGroup(value, customOperations, defaultGroupOperation) } function getConditionFilterExpression(condition, fields, customOperations, target) { const field = getField(condition[0], fields); const filterExpression = convertToInnerCondition(condition, customOperations); const customOperation = customOperations.length && getCustomOperation(customOperations, filterExpression[1]); if (customOperation && customOperation.calculateFilterExpression) { return customOperation.calculateFilterExpression.apply(customOperation, [filterExpression[2], field, fields]) } if (field.createFilterExpression) { return field.createFilterExpression.apply(field, [filterExpression[2], filterExpression[1], target]) } if (field.calculateFilterExpression) { return field.calculateFilterExpression.apply(field, [filterExpression[2], filterExpression[1], target]) } return field.defaultCalculateFilterExpression.apply(field, [filterExpression[2], filterExpression[1], target]) } function getPrimitiveValueText(field, value, customOperation, target, options) { let valueText; if (true === value) { valueText = field.trueText || _message.default.format("dxDataGrid-trueText") } else if (false === value) { valueText = field.falseText || _message.default.format("dxDataGrid-falseText") } else { valueText = function(field, value) { const fieldFormat = field.format || DEFAULT_FORMAT[field.dataType]; return _format_helper.default.format(value, fieldFormat) }(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 }, options) } return valueText } function checkDefaultValue(value) { return "" === value || null === value } function itemExists(plainItems, parentId) { return plainItems.some((item => item.dataField === parentId)) } function pushItemAndCheckParent(originalItems, plainItems, item) { const { dataField: dataField } = item; 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"], defaultCalculateFilterExpression: _filtering.default.defaultCalculateFilterExpression }) } } plainItems.push(item) } function generateCaptionByDataField(dataField, allowHierarchicalFields) { let caption = ""; if (allowHierarchicalFields) { dataField = dataField.substring(dataField.lastIndexOf(".") + 1) } else if (hasParent(dataField)) { dataField.split(".").forEach(((field, index, arr) => { caption += (0, _inflector.captionize)(field); if (index !== arr.length - 1) { caption += "." } })); return caption } return (0, _inflector.captionize)(dataField) } function getItems(fields, allowHierarchicalFields) { const items = []; for (let i = 0; i < fields.length; i++) { const 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 -1 !== dataField.lastIndexOf(".") } function getParentIdFromItemDataField(dataField) { return dataField.substring(0, dataField.lastIndexOf(".")) } function updateConditionByOperation(condition, operation, customOperations) { let 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 isValidCondition(condition) { return "" !== condition[2] } function isMatchedCondition(filter, addedFilterDataField) { return filter[0] === addedFilterDataField } function syncConditionIntoGroup(filter, addedFilter, canPush) { const result = []; filter.forEach((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 } exports.renderValueText = function($container, value, customOperation) { if (Array.isArray(value)) { const lastItemIndex = value.length - 1; $container.empty(); value.forEach(((t, i) => { (0, _renderer.default)("").addClass("dx-filterbuilder-text-part").text(t).appendTo($container); if (i !== lastItemIndex) { (0, _renderer.default)("").addClass("dx-filterbuilder-text-separator").text(customOperation && customOperation.valueSeparator ? customOperation.valueSeparator : "|").addClass("dx-filterbuilder-text-separator-empty").appendTo($container) } })) } else if (value) { $container.text(value) } else { $container.text(_message.default.format("dxFilterBuilder-enterValueText")) } } }, 48252: /*!*******************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/export/m_export.js ***! \*******************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.ExportController = exports.DataProvider = void 0; __webpack_require__( /*! ../../../../ui/button */ 63008); __webpack_require__( /*! ../../../../ui/drop_down_button */ 45231); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _position = __webpack_require__( /*! ../../../../core/utils/position */ 37518); var _string = __webpack_require__( /*! ../../../../core/utils/string */ 68752); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109)); var _list_light = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/list_light */ 56757)); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/widget/ui.errors */ 96688)); var _m_export = __webpack_require__( /*! ../../../grids/grid_core/m_export */ 1229); var _m_core = _interopRequireDefault(__webpack_require__( /*! ../m_core */ 74938)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } class DataProvider { constructor(exportController, initialColumnWidthsByColumnIndex, selectedRowsOnly) { this._exportController = exportController; this._initialColumnWidthsByColumnIndex = initialColumnWidthsByColumnIndex; this._selectedRowsOnly = selectedRowsOnly } _getGroupValue(item) { const { key: key, data: data, rowType: rowType, groupIndex: groupIndex, summaryCells: summaryCells } = item; const groupColumn = this._options.groupColumns[groupIndex]; const value = _m_core.default.getDisplayValue(groupColumn, groupColumn.deserializeValue ? groupColumn.deserializeValue(key[groupIndex]) : key[groupIndex], data, rowType); let result = `${groupColumn.caption}: ${_m_core.default.formatValue(value,groupColumn)}`; if (summaryCells && summaryCells[0] && summaryCells[0].length) { result += ` ${_m_core.default.getGroupRowSummaryText(summaryCells[0],this._options.summaryTexts)}` } return result } _correctCellIndex(cellIndex) { return cellIndex } _initOptions() { const exportController = this._exportController; const groupColumns = exportController._columnsController.getGroupColumns(); this._options = { columns: exportController._getColumns(this._initialColumnWidthsByColumnIndex), groupColumns: groupColumns, items: this._selectedRowsOnly || exportController._selectionOnly ? exportController._getSelectedItems() : exportController._getAllItems(), isHeadersVisible: exportController.option("showColumnHeaders"), summaryTexts: exportController.option("summary.texts"), rtlEnabled: exportController.option("rtlEnabled") } } getHeaderStyles() { return [{ bold: true, alignment: "center" }, { bold: true, alignment: "left" }, { bold: true, alignment: "right" }] } getGroupRowStyle() { return { bold: true, alignment: (0, _position.getDefaultAlignment)(this._options.rtlEnabled) } } getColumnStyles() { const columnStyles = []; this.getColumns().forEach((column => { columnStyles.push({ alignment: column.alignment || "left", format: column.format, dataType: column.dataType }) })); return columnStyles } getStyles() { return [...this.getHeaderStyles(), ...this.getColumnStyles(), this.getGroupRowStyle()] } _getTotalCellStyleId(cellIndex) { var _this$getColumns$cell; const alignment = (null === (_this$getColumns$cell = this.getColumns()[cellIndex]) || void 0 === _this$getColumns$cell ? void 0 : _this$getColumns$cell.alignment) || "right"; return this.getHeaderStyles().map((style => style.alignment)).indexOf(alignment) } getStyleId(rowIndex, cellIndex) { if (rowIndex < this.getHeaderRowCount()) { return 0 } if (this.isTotalCell(rowIndex - this.getHeaderRowCount(), cellIndex)) { return this._getTotalCellStyleId(cellIndex) } if (this.isGroupRow(rowIndex - this.getHeaderRowCount())) { return this.getHeaderStyles().length + this.getColumns().length } return cellIndex + this.getHeaderStyles().length } getColumns(getColumnsByAllRows) { const { columns: columns } = this._options; return getColumnsByAllRows ? columns : columns[columns.length - 1] } getColumnsWidths() { const columns = this.getColumns(); return (0, _type.isDefined)(columns) ? columns.map((c => c.width)) : void 0 } getRowsCount() { return this._options.items.length + this.getHeaderRowCount() } getHeaderRowCount() { if (this.isHeadersVisible()) { return this._options.columns.length - 1 } return 0 } isGroupRow(rowIndex) { return rowIndex < this._options.items.length && "group" === this._options.items[rowIndex].rowType } getGroupLevel(rowIndex) { const item = this._options.items[rowIndex - this.getHeaderRowCount()]; const groupIndex = item && item.groupIndex; if (item && "totalFooter" === item.rowType) { return 0 } return (0, _type.isDefined)(groupIndex) ? groupIndex : this._options.groupColumns.length } getCellType(rowIndex, cellIndex) { const columns = this.getColumns(); if (rowIndex < this.getHeaderRowCount()) { return "string" } rowIndex -= this.getHeaderRowCount(); if (cellIndex < columns.length) { const item = this._options.items.length && this._options.items[rowIndex]; const column = columns[cellIndex]; if (item && "data" === item.rowType) { if (isFinite(item.values[this._correctCellIndex(cellIndex)]) && !(0, _type.isDefined)(column.customizeText)) { return (0, _type.isDefined)(column.lookup) ? column.lookup.dataType : column.dataType } } return "string" } } ready() { this._initOptions(); const options = this._options; return (0, _deferred.when)(options.items).done((items => { options.items = items })).fail((() => { options.items = [] })) } _convertFromGridGroupSummaryItems(gridGroupSummaryItems) { if ((0, _type.isDefined)(gridGroupSummaryItems) && gridGroupSummaryItems.length > 0) { return gridGroupSummaryItems.map((item => ({ value: item.value, name: item.name }))) } } getCellData(rowIndex, cellIndex, isExcelJS) { let value; let column; const result = { cellSourceData: {}, value: value }; const columns = this.getColumns(); const correctedCellIndex = this._correctCellIndex(cellIndex); if (rowIndex < this.getHeaderRowCount()) { const columnsRow = this.getColumns(true)[rowIndex]; column = columnsRow[cellIndex]; result.cellSourceData.rowType = "header"; result.cellSourceData.column = column && column.gridColumn; result.value = column && column.caption } else { rowIndex -= this.getHeaderRowCount(); const item = this._options.items.length && this._options.items[rowIndex]; if (item) { const itemValues = item.values; result.cellSourceData.rowType = item.rowType; result.cellSourceData.column = columns[cellIndex] && columns[cellIndex].gridColumn; switch (item.rowType) { case "groupFooter": case "totalFooter": if (correctedCellIndex < itemValues.length) { value = itemValues[correctedCellIndex]; if ((0, _type.isDefined)(value)) { result.cellSourceData.value = value.value; result.cellSourceData.totalSummaryItemName = value.name; result.value = _m_core.default.getSummaryText(value, this._options.summaryTexts) } else { result.cellSourceData.value = void 0 } } break; case "group": result.cellSourceData.groupIndex = item.groupIndex; if (cellIndex < 1) { result.cellSourceData.column = this._options.groupColumns[item.groupIndex]; result.cellSourceData.value = item.key[item.groupIndex]; result.cellSourceData.groupSummaryItems = this._convertFromGridGroupSummaryItems(item.summaryCells[0]); result.value = this._getGroupValue(item) } else { const summaryItems = item.values[correctedCellIndex]; if (Array.isArray(summaryItems)) { result.cellSourceData.groupSummaryItems = this._convertFromGridGroupSummaryItems(summaryItems); value = ""; for (let i = 0; i < summaryItems.length; i++) { value += (i > 0 ? isExcelJS ? "\n" : " \n " : "") + _m_core.default.getSummaryText(summaryItems[i], this._options.summaryTexts) } result.value = value } else { result.cellSourceData.value = void 0 } } break; default: column = columns[cellIndex]; if (column) { const value = itemValues[correctedCellIndex]; const displayValue = _m_core.default.getDisplayValue(column, value, item.data, item.rowType); if (!isFinite(displayValue) || (0, _type.isDefined)(column.customizeText)) { if (isExcelJS && (0, _type.isDefined)(column.customizeText) && column.customizeText === this._exportController._columnsController.getCustomizeTextByDataType("boolean")) { result.value = displayValue } else { result.value = _m_core.default.formatValue(displayValue, column) } } else { result.value = displayValue } result.cellSourceData.value = value } result.cellSourceData.data = item.data } } } return result } isHeadersVisible() { return this._options.isHeadersVisible } isTotalCell(rowIndex, cellIndex) { const { items: items } = this._options; const item = items[rowIndex]; const correctCellIndex = this._correctCellIndex(cellIndex); const isSummaryAlignByColumn = item.summaryCells && item.summaryCells[correctCellIndex] && item.summaryCells[correctCellIndex].length > 0 && item.summaryCells[correctCellIndex][0].alignByColumn; return item && "groupFooter" === item.rowType || "totalFooter" === item.rowType || isSummaryAlignByColumn } getCellMerging(rowIndex, cellIndex) { const { columns: columns } = this._options; const column = columns[rowIndex] && columns[rowIndex][cellIndex]; return column ? { colspan: (column.exportColspan || 1) - 1, rowspan: (column.rowspan || 1) - 1 } : { colspan: 0, rowspan: 0 } } getFrozenArea() { return { x: 0, y: this.getHeaderRowCount() } } } exports.DataProvider = DataProvider; class ExportController extends _m_core.default.ViewController { init() { this.throwWarningIfNoOnExportingEvent(); this._columnsController = this.getController("columns"); this._dataController = this.getController("data"); this._selectionController = this.getController("selection"); this._rowsView = this.getView("rowsView"); this._headersView = this.getView("columnHeadersView"); this.createAction("onExporting", { excludeValidators: ["disabled", "readOnly"] }) } _getEmptyCell() { return { caption: "", colspan: 1, rowspan: 1 } } _updateColumnWidth(column, width) { column.width = width } _getColumns(initialColumnWidthsByColumnIndex) { let result = []; let i; let columns; const columnsController = this._columnsController; const rowCount = columnsController.getRowCount(); for (i = 0; i <= rowCount; i++) { const currentHeaderRow = []; columns = columnsController.getVisibleColumns(i, true); let columnWidthsByColumnIndex; if (i === rowCount) { if (this._updateLockCount) { columnWidthsByColumnIndex = initialColumnWidthsByColumnIndex } else { const columnWidths = this._getColumnWidths(this._headersView, this._rowsView); if (columnWidths && columnWidths.length) { columnWidthsByColumnIndex = {}; for (let i = 0; i < columns.length; i++) { columnWidthsByColumnIndex[columns[i].index] = columnWidths[i] } } } } for (let j = 0; j < columns.length; j++) { const column = (0, _extend.extend)({}, columns[j], { dataType: "datetime" === columns[j].dataType ? "date" : columns[j].dataType, gridColumn: columns[j] }); if (this._needColumnExporting(column)) { const currentColspan = this._calculateExportColspan(column); if ((0, _type.isDefined)(currentColspan)) { column.exportColspan = currentColspan } if (columnWidthsByColumnIndex) { this._updateColumnWidth(column, columnWidthsByColumnIndex[column.index]) } currentHeaderRow.push(column) } } result.push(currentHeaderRow) } columns = result[rowCount]; result = (0, _m_export.prepareItems)(result.slice(0, -1), this._getEmptyCell()); result.push(columns); return result } _calculateExportColspan(column) { if (!column.isBand) { return } const childColumns = this._columnsController.getChildrenByBandColumn(column.index, true); if (!(0, _type.isDefined)(childColumns)) { return } return childColumns.reduce(((result, childColumn) => { if (this._needColumnExporting(childColumn)) { return result + (this._calculateExportColspan(childColumn) || 1) } return result }), 0) } _needColumnExporting(column) { return !column.command && (column.allowExporting || void 0 === column.allowExporting) } _getFooterSummaryItems(summaryCells, isTotal) { const result = []; let estimatedItemsCount = 1; let i = 0; do { const values = []; for (let j = 0; j < summaryCells.length; j++) { const summaryCell = summaryCells[j]; const itemsLength = summaryCell.length; if (estimatedItemsCount < itemsLength) { estimatedItemsCount = itemsLength } values.push(summaryCell[i]) } result.push({ values: values, rowType: isTotal ? "totalFooter" : "groupFooter" }) } while (i++ < estimatedItemsCount - 1); return result } _hasSummaryGroupFooters() { const groupItems = this.option("summary.groupItems"); if ((0, _type.isDefined)(groupItems)) { for (let i = 0; i < groupItems.length; i++) { if (groupItems[i].showInGroupFooter) { return true } } } return false } _getItemsWithSummaryGroupFooters(sourceItems) { let result = []; let beforeGroupFooterItems = []; let groupFooterItems = []; for (let i = 0; i < sourceItems.length; i++) { const item = sourceItems[i]; if ("groupFooter" === item.rowType) { groupFooterItems = this._getFooterSummaryItems(item.summaryCells); result = result.concat(beforeGroupFooterItems, groupFooterItems); beforeGroupFooterItems = [] } else { beforeGroupFooterItems.push(item) } } return result.length ? result : beforeGroupFooterItems } _updateGroupValuesWithSummaryByColumn(sourceItems) { let summaryValues = []; for (let i = 0; i < sourceItems.length; i++) { const item = sourceItems[i]; const { summaryCells: summaryCells } = item; if ("group" === item.rowType && summaryCells && summaryCells.length > 1) { const groupColumnCount = item.values.length; for (let j = 1; j < summaryCells.length; j++) { for (let k = 0; k < summaryCells[j].length; k++) { const summaryItem = summaryCells[j][k]; if (summaryItem && summaryItem.alignByColumn) { if (!Array.isArray(summaryValues[j - groupColumnCount])) { summaryValues[j - groupColumnCount] = [] } summaryValues[j - groupColumnCount].push(summaryItem) } } } if (summaryValues.length > 0) { item.values.push(...summaryValues); summaryValues = [] } } } } _processUnExportedItems(items) { const columns = this._columnsController.getVisibleColumns(null, true); const groupColumns = this._columnsController.getGroupColumns(); let values; let summaryCells; for (let i = 0; i < items.length; i++) { const item = items[i]; let isCommand = false; values = []; summaryCells = []; for (let j = 0; j < columns.length; j++) { const column = columns[j]; isCommand || (isCommand = ["detailExpand", "buttons"].includes(column.type)); if (this._needColumnExporting(column)) { if (item.values) { if ("group" === item.rowType && !values.length) { values.push(item.key[item.groupIndex]) } else { values.push(item.values[j]) } } if (item.summaryCells) { if ("group" === item.rowType && !summaryCells.length) { const index = j - groupColumns.length + item.groupIndex; summaryCells.push(item.summaryCells[isCommand ? index : index + 1]) } else { summaryCells.push(item.summaryCells[j]) } } } } if (values.length) { item.values = values } if (summaryCells.length) { item.summaryCells = summaryCells } } } _getAllItems(data) { let skipFilter = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : false; const that = this; const d = new _deferred.Deferred; const footerItems = this._dataController.footerItems(); const totalItem = footerItems.length && footerItems[0]; const summaryTotalItems = that.option("summary.totalItems"); let summaryCells; (0, _deferred.when)(data).done((data => { this._dataController.loadAll(data, skipFilter).done(((sourceItems, totalAggregates) => { that._updateGroupValuesWithSummaryByColumn(sourceItems); if (that._hasSummaryGroupFooters()) { sourceItems = that._getItemsWithSummaryGroupFooters(sourceItems) } summaryCells = totalItem && totalItem.summaryCells; if ((0, _type.isDefined)(totalAggregates) && summaryTotalItems) { summaryCells = that._getSummaryCells(summaryTotalItems, totalAggregates) } const summaryItems = totalItem && that._getFooterSummaryItems(summaryCells, true); if (summaryItems) { sourceItems = sourceItems.concat(summaryItems) } that._processUnExportedItems(sourceItems); d.resolve(sourceItems) })).fail(d.reject) })).fail(d.reject); return d } _getSummaryCells(summaryTotalItems, totalAggregates) { return this._dataController._calculateSummaryCells(summaryTotalItems, totalAggregates, this._columnsController.getVisibleColumns(null, true), ((summaryItem, column) => this._dataController._isDataColumn(column) ? column.index : -1)) } _getSelectedItems() { if (this.needLoadItemsOnExportingSelectedItems()) { return this._getAllItems(this._selectionController.loadSelectedItemsWithFilter(), true) } return this._getAllItems(this._selectionController.getSelectedRowsData()) } _getColumnWidths(headersView, rowsView) { return headersView && headersView.isVisible() ? headersView.getColumnWidths() : rowsView.getColumnWidths() } throwWarningIfNoOnExportingEvent() { var _this$component$hasAc, _this$component; const hasOnExporting = null === (_this$component$hasAc = (_this$component = this.component).hasActionSubscription) || void 0 === _this$component$hasAc ? void 0 : _this$component$hasAc.call(_this$component, "onExporting"); if (this.option("export.enabled") && !hasOnExporting) { _ui.default.log("W1024") } } callbackNames() { return ["selectionOnlyChanged"] } getDataProvider(selectedRowsOnly) { const columnWidths = this._getColumnWidths(this._headersView, this._rowsView); let initialColumnWidthsByColumnIndex; if (columnWidths && columnWidths.length) { initialColumnWidthsByColumnIndex = {}; const columnsLastRowVisibleColumns = this._columnsController.getVisibleColumns(this._columnsController.getRowCount(), true); for (let i = 0; i < columnsLastRowVisibleColumns.length; i++) { initialColumnWidthsByColumnIndex[columnsLastRowVisibleColumns[i].index] = columnWidths[i] } } return new DataProvider(this, initialColumnWidthsByColumnIndex, selectedRowsOnly) } exportTo(selectedRowsOnly, format) { this._selectionOnly = selectedRowsOnly; const onExporting = this.getAction("onExporting"); const eventArgs = { rtlEnabled: this.option("rtlEnabled"), selectedRowsOnly: !!selectedRowsOnly, format: format, fileName: "DataGrid", cancel: false }; (0, _type.isFunction)(onExporting) && onExporting(eventArgs) } publicMethods() { return ["getDataProvider"] } selectionOnly(value) { if ((0, _type.isDefined)(value)) { this._isSelectedRows = value; this.selectionOnlyChanged.fire() } else { return this._isSelectedRows } } optionChanged(args) { super.optionChanged(args); if ("export" === args.name) { this.throwWarningIfNoOnExportingEvent() } } needLoadItemsOnExportingSelectedItems() { return this.option("loadItemsOnExportingSelectedItems") ?? this._dataController._dataSource.remoteOperations().filtering } } exports.ExportController = ExportController; _m_core.default.registerModule("export", { defaultOptions: () => ({ export: { enabled: false, fileName: "DataGrid", formats: ["xlsx"], allowExportSelectedData: false, texts: { exportTo: _message.default.format("dxDataGrid-exportTo"), exportAll: _message.default.format("dxDataGrid-exportAll"), exportSelectedRows: _message.default.format("dxDataGrid-exportSelectedRows") } } }), controllers: { export: ExportController }, extenders: { controllers: { editing: Base => class extends Base { callbackNames() { const callbackList = super.callbackNames(); return (0, _type.isDefined)(callbackList) ? callbackList.push("editingButtonsUpdated") : ["editingButtonsUpdated"] } _updateEditButtons() { super._updateEditButtons(); this.editingButtonsUpdated.fire() } } }, views: { headerPanel: Base => class extends Base { _getToolbarItems() { const items = super._getToolbarItems(); const exportButton = this._getExportToolbarButton(); if (exportButton) { items.push(exportButton); this._correctItemsPosition(items) } return items } _getExportToolbarButton() { const items = this._getExportToolbarItems(); if (0 === items.length) { return null } const disabled = this._needDisableExportButton(); const toolbarButtonOptions = { name: "exportButton", location: "after", locateInMenu: "auto", sortIndex: 30, options: { items: items }, disabled: disabled }; if (1 === items.length) { const widgetOptions = _extends({}, items[0], { hint: items[0].text, elementAttr: { class: "dx-datagrid-export-button" } }); toolbarButtonOptions.widget = "dxButton"; toolbarButtonOptions.showText = "inMenu"; toolbarButtonOptions.options = widgetOptions } else { const widgetOptions = { icon: "export", displayExpr: "text", items: items, hint: this.option("export.texts.exportTo"), elementAttr: { class: "dx-datagrid-export-button" }, dropDownOptions: { width: "auto", _wrapperClassExternal: "dx-datagrid-export-menu" } }; toolbarButtonOptions.options = widgetOptions; toolbarButtonOptions.widget = "dxDropDownButton"; toolbarButtonOptions.menuItemTemplate = (_data, _index, container) => { this._createComponent((0, _renderer.default)(container), _list_light.default, { items: items }) } } return toolbarButtonOptions } _getExportToolbarItems() { const exportOptions = this.option("export"); const texts = this.option("export.texts"); const formats = this.option("export.formats") ?? []; if (!exportOptions.enabled) { return [] } const items = []; formats.forEach((formatType => { let formatName = formatType.toUpperCase(); let exportAllIcon = "export"; if ("xlsx" === formatType) { formatName = "Excel"; exportAllIcon = "xlsxfile" } if ("pdf" === formatType) { exportAllIcon = "pdffile" } items.push({ text: (0, _string.format)(texts.exportAll, formatName), icon: exportAllIcon, onClick: () => { this._exportController.exportTo(false, formatType) } }); if (exportOptions.allowExportSelectedData) { items.push({ text: (0, _string.format)(texts.exportSelectedRows, formatName), icon: "exportselected", onClick: () => { this._exportController.exportTo(true, formatType) } }) } })); return items } _correctItemsPosition(items) { items.sort(((itemA, itemB) => itemA.sortIndex - itemB.sortIndex)) } _isExportButtonVisible() { return this.option("export.enabled") } optionChanged(args) { super.optionChanged(args); if ("export" === args.name) { args.handled = true; this._invalidate() } } _needDisableExportButton() { const isDataColumnsInvisible = !this._columnsController.hasVisibleDataColumns(); const hasUnsavedChanges = this._editingController.hasChanges(); return isDataColumnsInvisible || hasUnsavedChanges } _columnOptionChanged(e) { super._columnOptionChanged(e); const isColumnLocationChanged = _m_core.default.checkChanges(e.optionNames, ["groupIndex", "visible", "all"]); if (isColumnLocationChanged) { const disabled = this._needDisableExportButton(); this.setToolbarItemDisabled("exportButton", disabled) } } init() { super.init(); this._exportController = this.getController("export"); this._editingController.editingButtonsUpdated.add((() => { const disabled = this._needDisableExportButton(); this.setToolbarItemDisabled("exportButton", disabled) })) } isVisible() { return super.isVisible() || this._isExportButtonVisible() } } } } }) }, 56445: /*!*****************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/focus/m_focus.js ***! \*****************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _data = __webpack_require__( /*! ../../../../core/utils/data */ 47617); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _m_focus = __webpack_require__( /*! ../../../grids/grid_core/focus/m_focus */ 5325); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; var _m_utils = __webpack_require__( /*! ../m_utils */ 10087); function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991; _m_core.default.registerModule("focus", _extends({}, _m_focus.focusModule, { extenders: _extends({}, _m_focus.focusModule.extenders, { controllers: _extends({}, _m_focus.focusModule.extenders.controllers, { data: Base => class extends(_m_focus.focusModule.extenders.controllers.data(Base)) { changeRowExpand(path, isRowClick) { if (this.option("focusedRowEnabled") && Array.isArray(path) && this.isRowExpanded(path)) { if ((!isRowClick || !this._keyboardNavigationController.isKeyboardEnabled()) && this._isFocusedRowInsideGroup(path)) { this.option("focusedRowKey", path) } } return super.changeRowExpand(path, isRowClick) } _isFocusedRowInsideGroup(path) { const focusedRowKey = this.option("focusedRowKey"); const rowIndex = this.getRowIndexByKey(focusedRowKey); const focusedRow = rowIndex >= 0 && this.getVisibleRows()[rowIndex]; const groups = this._columnsController.getGroupDataSourceParameters(true); if (focusedRow) { for (let i = 0; i < path.length; ++i) { const getter = (0, _data.compileGetter)(groups[i] && groups[i].selector); if (getter(focusedRow.data) !== path[i]) { return false } } } return true } _getGroupPath(groupItem, groupCount) { const groupPath = []; let items = [groupItem]; while (items && items[0] && groupCount) { const item = items[0]; if (void 0 !== item.key) { groupPath.push(item.key) } items = item.items; groupCount-- } return groupPath } _expandGroupByPath(that, groupPath, level) { const d = new _deferred.Deferred; level++; that.expandRow(groupPath.slice(0, level)).done((() => { if (level === groupPath.length) { d.resolve() } else { that._expandGroupByPath(that, groupPath, level).done(d.resolve).fail(d.reject) } })).fail(d.reject); return d.promise() } _calculateGlobalRowIndexByGroupedData(key) { const that = this; const dataSource = that._dataSource; const filter = that._generateFilterByKey(key); const deferred = new _deferred.Deferred; const isGroupKey = Array.isArray(key); const group = dataSource.group(); if (isGroupKey) { return deferred.resolve(-1).promise() } if (!dataSource._grouping._updatePagingOptions) { that._calculateGlobalRowIndexByFlatData(key, null, true).done(deferred.resolve).fail(deferred.reject); return deferred } dataSource.load({ filter: that._concatWithCombinedFilter(filter), group: group }).done((data => { if (!data || 0 === data.length || !(0, _type.isDefined)(data[0].key) || -1 === data[0].key) { return deferred.resolve(-1).promise() } const groupPath = that._getGroupPath(data[0], group.length); that._expandGroupByPath(that, groupPath, 0).done((() => { that._calculateExpandedRowGlobalIndex(deferred, key, groupPath, group) })).fail(deferred.reject) })).fail(deferred.reject); return deferred.promise() } _calculateExpandedRowGlobalIndex(deferred, key, groupPath, group) { const groupFilter = (0, _m_utils.createGroupFilter)(groupPath, { group: group }); const dataSource = this._dataSource; const scrollingMode = this.option("scrolling.mode"); const isVirtualScrolling = "virtual" === scrollingMode || "infinite" === scrollingMode; const pageSize = dataSource.pageSize(); let groupOffset; dataSource._grouping._updatePagingOptions({ skip: 0, take: MAX_SAFE_INTEGER }, ((groupInfo, totalOffset) => { if ((0, _common.equalByValue)(groupInfo.path, groupPath)) { groupOffset = totalOffset } })); this._calculateGlobalRowIndexByFlatData(key, groupFilter).done((dataOffset => { let count; let groupContinuationCount; if (dataOffset < 0) { deferred.resolve(-1); return } const currentPageOffset = groupOffset % pageSize || pageSize; count = currentPageOffset + dataOffset - groupPath.length; if (isVirtualScrolling) { groupContinuationCount = 0 } else { groupContinuationCount = Math.floor(count / (pageSize - groupPath.length)) * groupPath.length } count = groupOffset + dataOffset + groupContinuationCount; deferred.resolve(count) })).fail(deferred.reject) } } }) }) })) }, 72487: /*!***********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/grouping/m_grouping.js ***! \***********************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.GroupingHeaderPanelExtender = void 0; var _devices = _interopRequireDefault(__webpack_require__( /*! ../../../../core/devices */ 20530)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _size = __webpack_require__( /*! ../../../../core/utils/size */ 58664); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109)); var _accessibility = __webpack_require__( /*! ../../../../ui/shared/accessibility */ 56756); var _m_accessibility = __webpack_require__( /*! ../../../grids/grid_core/m_accessibility */ 9130); var _m_core = _interopRequireDefault(__webpack_require__( /*! ../m_core */ 74938)); var _m_data_source_adapter = _interopRequireDefault(__webpack_require__( /*! ../m_data_source_adapter */ 49975)); var _m_grouping_collapsed = __webpack_require__( /*! ./m_grouping_collapsed */ 2772); var _m_grouping_expanded = __webpack_require__( /*! ./m_grouping_expanded */ 4789); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } _m_data_source_adapter.default.extend((Base => class extends Base { init() { super.init.apply(this, arguments); this._initGroupingHelper() } _initGroupingHelper(options) { const grouping = this._grouping; const isAutoExpandAll = this.option("grouping.autoExpandAll"); const isFocusedRowEnabled = this.option("focusedRowEnabled"); const remoteOperations = options ? options.remoteOperations : this.remoteOperations(); const isODataRemoteOperations = remoteOperations.filtering && remoteOperations.sorting && remoteOperations.paging; if (isODataRemoteOperations && !remoteOperations.grouping && (isAutoExpandAll || !isFocusedRowEnabled)) { if (!grouping || grouping instanceof _m_grouping_collapsed.GroupingHelper) { this._grouping = new _m_grouping_expanded.GroupingHelper(this) } } else if (!grouping || grouping instanceof _m_grouping_expanded.GroupingHelper) { this._grouping = new _m_grouping_collapsed.GroupingHelper(this) } } totalItemsCount() { const totalCount = super.totalItemsCount(); return totalCount > 0 && this._dataSource.group() && this._dataSource.requireTotalCount() ? totalCount + this._grouping.totalCountCorrection() : totalCount } itemsCount() { return this._dataSource.group() ? this._grouping.itemsCount() || 0 : super.itemsCount.apply(this, arguments) } allowCollapseAll() { return this._grouping.allowCollapseAll() } isGroupItemCountable(item) { return this._grouping.isGroupItemCountable(item) } isRowExpanded(key) { const groupInfo = this._grouping.findGroupInfo(key); return groupInfo ? groupInfo.isExpanded : !this._grouping.allowCollapseAll() } collapseAll(groupIndex) { return this._collapseExpandAll(groupIndex, false) } expandAll(groupIndex) { return this._collapseExpandAll(groupIndex, true) } _collapseExpandAll(groupIndex, isExpand) { const that = this; const dataSource = that._dataSource; const group = dataSource.group(); const groups = _m_core.default.normalizeSortingInfo(group || []); if (groups.length) { for (let i = 0; i < groups.length; i++) { if (void 0 === groupIndex || groupIndex === i) { groups[i].isExpanded = isExpand } else if (group && group[i]) { groups[i].isExpanded = group[i].isExpanded } } dataSource.group(groups); that._grouping.foreachGroups(((groupInfo, parents) => { if (void 0 === groupIndex || groupIndex === parents.length - 1) { groupInfo.isExpanded = isExpand } }), false, true); that.resetPagesCache() } return true } refresh() { super.refresh.apply(this, arguments); return this._grouping.refresh.apply(this._grouping, arguments) } changeRowExpand(path) { const that = this; const dataSource = that._dataSource; if (dataSource.group()) { dataSource.beginLoading(); if (that._lastLoadOptions) { that._lastLoadOptions.groupExpand = true } return that._changeRowExpandCore(path).always((() => { dataSource.endLoading() })) } } _changeRowExpandCore(path) { return this._grouping.changeRowExpand(path) } _hasGroupLevelsExpandState(group, isExpanded) { if (group && Array.isArray(group)) { for (let i = 0; i < group.length; i++) { if (group[i].isExpanded === isExpanded) { return true } } } } _customizeRemoteOperations(options, operationTypes) { const { remoteOperations: remoteOperations } = options; if (options.storeLoadOptions.group) { if (remoteOperations.grouping && !options.isCustomLoading) { if (!remoteOperations.groupPaging || this._hasGroupLevelsExpandState(options.storeLoadOptions.group, true)) { remoteOperations.paging = false } } if (!remoteOperations.grouping && (!remoteOperations.sorting || !remoteOperations.filtering || options.isCustomLoading || this._hasGroupLevelsExpandState(options.storeLoadOptions.group, false))) { remoteOperations.paging = false } } else if (!options.isCustomLoading && remoteOperations.paging && operationTypes.grouping) { this.resetCache() } super._customizeRemoteOperations.apply(this, arguments) } _handleDataLoading(options) { super._handleDataLoading(options); this._initGroupingHelper(options); return this._grouping.handleDataLoading(options) } _handleDataLoaded(options) { return this._grouping.handleDataLoaded(options, super._handleDataLoaded.bind(this)) } _handleDataLoadedCore(options) { return this._grouping.handleDataLoadedCore(options, super._handleDataLoadedCore.bind(this)) } })); const onGroupingMenuItemClick = function(column, params) { const columnsController = this._columnsController; switch (params.itemData.value) { case "group": { const groups = columnsController._dataSource.group() || []; columnsController.columnOption(column.dataField, "groupIndex", groups.length); break } case "ungroup": columnsController.columnOption(column.dataField, "groupIndex", -1); break; case "ungroupAll": this.component.clearGrouping() } }; const isGroupPanelVisible = groupPanelOptions => { const visible = null === groupPanelOptions || void 0 === groupPanelOptions ? void 0 : groupPanelOptions.visible; return "auto" === visible ? "desktop" === _devices.default.current().deviceType : !!visible }; const allowDragging = (groupPanelOptions, column) => { const isVisible = isGroupPanelVisible(groupPanelOptions); const canDrag = (null === groupPanelOptions || void 0 === groupPanelOptions ? void 0 : groupPanelOptions.allowColumnDragging) && column.allowGrouping; return isVisible && !!canDrag }; const GroupingHeaderPanelExtender = Base => class extends Base { _getToolbarItems() { const items = super._getToolbarItems(); return this._appendGroupingItem(items) } _appendGroupingItem(items) { if (this._isGroupPanelVisible()) { let isRendered = false; const toolbarItem = { template: () => { const $groupPanel = (0, _renderer.default)("
").addClass("dx-datagrid-group-panel"); this._updateGroupPanelContent($groupPanel); (0, _m_accessibility.registerKeyboardAction)("groupPanel", this, $groupPanel, void 0, this._handleActionKeyDown.bind(this)); return $groupPanel }, name: "groupPanel", onItemRendered: () => { isRendered && this.renderCompleted.fire(); isRendered = true }, location: "before", locateInMenu: "never", sortIndex: 1 }; items.push(toolbarItem); this.updateToolbarDimensions() } return items } _handleActionKeyDown(args) { const { event: event } = args; const $target = (0, _renderer.default)(event.target); const groupColumnIndex = $target.closest(".dx-group-panel-item").index(); const column = this._columnsController.getGroupColumns()[groupColumnIndex]; const columnIndex = column && column.index; if ($target.is(".dx-header-filter")) { this._headerFilterController.showHeaderFilterMenu(columnIndex, true) } else { this._processGroupItemAction(columnIndex) } event.preventDefault() } _isGroupPanelVisible() { return isGroupPanelVisible(this.option("groupPanel")) } _renderGroupPanelItems($groupPanel, groupColumns) { const that = this; $groupPanel.empty(); (0, _iterator.each)(groupColumns, ((index, groupColumn) => { that._createGroupPanelItem($groupPanel, groupColumn) })); (0, _accessibility.restoreFocus)(this) } _createGroupPanelItem($rootElement, groupColumn) { const $groupPanelItem = (0, _renderer.default)("
").addClass(groupColumn.cssClass).addClass("dx-group-panel-item").data("columnData", groupColumn).appendTo($rootElement).text(groupColumn.caption); (0, _accessibility.setTabIndex)(this, $groupPanelItem); return $groupPanelItem } _columnOptionChanged(e) { if (!this._requireReady && !_m_core.default.checkChanges(e.optionNames, ["width", "visibleWidth"])) { const $toolbarElement = this.element(); const $groupPanel = $toolbarElement && $toolbarElement.find(".dx-datagrid-group-panel"); if ($groupPanel && $groupPanel.length) { this._updateGroupPanelContent($groupPanel); this.updateToolbarDimensions(); this.renderCompleted.fire() } } super._columnOptionChanged() } _updateGroupPanelContent($groupPanel) { const groupColumns = this.getColumns(); const groupPanelOptions = this.option("groupPanel"); this._renderGroupPanelItems($groupPanel, groupColumns); if (groupPanelOptions.allowColumnDragging && !groupColumns.length) { (0, _renderer.default)("
").addClass("dx-group-panel-message").text(groupPanelOptions.emptyPanelText).appendTo($groupPanel); $groupPanel.closest(".dx-toolbar-item").addClass("dx-toolbar-label"); $groupPanel.closest(".dx-toolbar-label").css("maxWidth", "none") } } allowDragging(column) { const groupPanelOptions = this.option("groupPanel"); return allowDragging(groupPanelOptions, column) } getColumnElements() { const $element = this.element(); return $element && $element.find(".dx-group-panel-item") } getColumns() { return this._columnsController.getGroupColumns() } getBoundingRect() { const $element = this.element(); if ($element && $element.find(".dx-datagrid-group-panel").length) { const offset = $element.offset(); return { top: offset.top, bottom: offset.top + (0, _size.getHeight)($element) } } return null } getName() { return "group" } getContextMenuItems(options) { const that = this; const contextMenuEnabled = that.option("grouping.contextMenuEnabled"); const $groupedColumnElement = (0, _renderer.default)(options.targetElement).closest(".dx-group-panel-item"); let items; if ($groupedColumnElement.length) { options.column = $groupedColumnElement.data("columnData") } if (contextMenuEnabled && options.column) { const { column: column } = options; const isGroupingAllowed = (0, _type.isDefined)(column.allowGrouping) ? column.allowGrouping : true; if (isGroupingAllowed) { const isColumnGrouped = (0, _type.isDefined)(column.groupIndex) && column.groupIndex > -1; const groupingTexts = that.option("grouping.texts"); const onItemClick = onGroupingMenuItemClick.bind(that, column); items = [{ text: groupingTexts.ungroup, value: "ungroup", disabled: !isColumnGrouped, onItemClick: onItemClick }, { text: groupingTexts.ungroupAll, value: "ungroupAll", onItemClick: onItemClick }] } } return items } isVisible() { return super.isVisible() || this._isGroupPanelVisible() } hasGroupedColumns() { return this._isGroupPanelVisible() && !!this.getColumns().length } optionChanged(args) { if ("groupPanel" === args.name) { this._invalidate(); args.handled = true } else { super.optionChanged(args) } } }; exports.GroupingHeaderPanelExtender = GroupingHeaderPanelExtender; _m_core.default.registerModule("grouping", { defaultOptions: () => ({ grouping: { autoExpandAll: true, allowCollapsing: true, contextMenuEnabled: false, expandMode: "buttonClick", texts: { groupContinuesMessage: _message.default.format("dxDataGrid-groupContinuesMessage"), groupContinuedMessage: _message.default.format("dxDataGrid-groupContinuedMessage"), groupByThisColumn: _message.default.format("dxDataGrid-groupHeaderText"), ungroup: _message.default.format("dxDataGrid-ungroupHeaderText"), ungroupAll: _message.default.format("dxDataGrid-ungroupAllText") } }, groupPanel: { visible: false, emptyPanelText: _message.default.format("dxDataGrid-groupPanelEmptyText"), allowColumnDragging: true } }), extenders: { controllers: { data: Base => class extends Base { init() { super.init(); this.createAction("onRowExpanding"); this.createAction("onRowExpanded"); this.createAction("onRowCollapsing"); this.createAction("onRowCollapsed") } _beforeProcessItems(items) { const groupColumns = this._columnsController.getGroupColumns(); items = super._beforeProcessItems(items); if (items.length && groupColumns.length) { items = this._processGroupItems(items, groupColumns.length) } return items } _processItem(item, options) { if ((0, _type.isDefined)(item.groupIndex) && (0, _type.isString)(item.rowType) && 0 === item.rowType.indexOf("group")) { item = this._processGroupItem(item, options); options.dataIndex = 0 } else { item = super._processItem.apply(this, arguments) } return item } _processGroupItem(item, options) { return item } _processGroupItems(items, groupsCount, options) { const that = this; const groupedColumns = that._columnsController.getGroupColumns(); const column = groupedColumns[groupedColumns.length - groupsCount]; if (!options) { const scrollingMode = that.option("scrolling.mode"); options = { collectContinuationItems: "virtual" !== scrollingMode && "infinite" !== scrollingMode, resultItems: [], path: [], values: [] } } const { resultItems: resultItems } = options; if (options.data) { if (options.collectContinuationItems || !options.data.isContinuation) { resultItems.push({ rowType: "group", data: options.data, groupIndex: options.path.length - 1, isExpanded: !!options.data.items, key: options.path.slice(0), values: options.values.slice(0) }) } } if (items) { if (0 === groupsCount) { resultItems.push.apply(resultItems, items) } else { for (let i = 0; i < items.length; i++) { const item = items[i]; if (item && "items" in item) { options.data = item; options.path.push(item.key); options.values.push(column && column.deserializeValue && !column.calculateDisplayValue ? column.deserializeValue(item.key) : item.key); that._processGroupItems(item.items, groupsCount - 1, options); options.data = void 0; options.path.pop(); options.values.pop() } else { resultItems.push(item) } } } } return resultItems } publicMethods() { return super.publicMethods().concat(["collapseAll", "expandAll", "isRowExpanded", "expandRow", "collapseRow"]) } collapseAll(groupIndex) { const dataSource = this._dataSource; if (dataSource && dataSource.collapseAll(groupIndex)) { dataSource.pageIndex(0); dataSource.reload() } } expandAll(groupIndex) { const dataSource = this._dataSource; if (dataSource && dataSource.expandAll(groupIndex)) { dataSource.pageIndex(0); dataSource.reload() } } changeRowExpand(key) { const that = this; const expanded = that.isRowExpanded(key); const args = { key: key, expanded: expanded }; that.executeAction(expanded ? "onRowCollapsing" : "onRowExpanding", args); if (!args.cancel) { return (0, _deferred.when)(that._changeRowExpandCore(key)).done((() => { args.expanded = !expanded; that.executeAction(expanded ? "onRowCollapsed" : "onRowExpanded", args) })) } return (new _deferred.Deferred).resolve() } _changeRowExpandCore(key) { const that = this; const dataSource = this._dataSource; const d = new _deferred.Deferred; if (!dataSource) { d.resolve() } else { (0, _deferred.when)(dataSource.changeRowExpand(key)).done((() => { that.load().done(d.resolve).fail(d.reject) })).fail(d.reject) } return d } isRowExpanded(key) { const dataSource = this._dataSource; return dataSource && dataSource.isRowExpanded(key) } expandRow(key) { if (!this.isRowExpanded(key)) { return this.changeRowExpand(key) } return (new _deferred.Deferred).resolve() } collapseRow(key) { if (this.isRowExpanded(key)) { return this.changeRowExpand(key) } return (new _deferred.Deferred).resolve() } optionChanged(args) { if ("grouping" === args.name) { args.name = "dataSource" } super.optionChanged(args) } }, columns: Base => class extends Base { _getExpandColumnOptions() { const options = super._getExpandColumnOptions.apply(this, arguments); options.cellTemplate = _m_core.default.getExpandCellTemplate(); return options } }, editing: Base => class extends Base { _isProcessedItem(item) { return (0, _type.isDefined)(item.groupIndex) && (0, _type.isString)(item.rowType) && 0 === item.rowType.indexOf("group") } } }, views: { headerPanel: GroupingHeaderPanelExtender, rowsView: Base => class extends Base { getContextMenuItems(options) { const that = this; const contextMenuEnabled = that.option("grouping.contextMenuEnabled"); let items; if (contextMenuEnabled && options.row && "group" === options.row.rowType) { const columnsController = that._columnsController; const column = columnsController.columnOption(`groupIndex:${options.row.groupIndex}`); if (column && column.allowGrouping) { const groupingTexts = that.option("grouping.texts"); const onItemClick = onGroupingMenuItemClick.bind(that, column); items = []; items.push({ text: groupingTexts.ungroup, value: "ungroup", onItemClick: onItemClick }, { text: groupingTexts.ungroupAll, value: "ungroupAll", onItemClick: onItemClick }) } } return items } _rowClick(e) { const that = this; const expandMode = that.option("grouping.expandMode"); const scrollingMode = that.option("scrolling.mode"); const isGroupRowStateChanged = "infinite" !== scrollingMode && "rowClick" === expandMode && (0, _renderer.default)(e.event.target).closest(".dx-group-row").length; const isExpandButtonClicked = (0, _renderer.default)(e.event.target).closest(".dx-datagrid-expand").length; if (isGroupRowStateChanged || isExpandButtonClicked) { that._changeGroupRowState(e) } super._rowClick(e) } _changeGroupRowState(e) { const row = this._dataController.items()[e.rowIndex]; const allowCollapsing = this._columnsController.columnOption(`groupIndex:${row.groupIndex}`, "allowCollapsing"); if ("data" === row.rowType || "group" === row.rowType && false !== allowCollapsing) { this._dataController.changeRowExpand(row.key, true); e.event.preventDefault(); e.handled = true } } }, columnHeadersView: Base => class extends Base { getContextMenuItems(options) { const that = this; const contextMenuEnabled = that.option("grouping.contextMenuEnabled"); let items = super.getContextMenuItems(options); if (contextMenuEnabled && options.row && ("header" === options.row.rowType || "detailAdaptive" === options.row.rowType)) { const { column: column } = options; if (!column.command && (!(0, _type.isDefined)(column.allowGrouping) || column.allowGrouping)) { const groupingTexts = that.option("grouping.texts"); const isColumnGrouped = (0, _type.isDefined)(column.groupIndex) && column.groupIndex > -1; const onItemClick = onGroupingMenuItemClick.bind(that, column); items = items || []; items.push({ text: groupingTexts.groupByThisColumn, value: "group", beginGroup: true, disabled: isColumnGrouped, onItemClick: onItemClick }); if (column.showWhenGrouped) { items.push({ text: groupingTexts.ungroup, value: "ungroup", disabled: !isColumnGrouped, onItemClick: onItemClick }) } items.push({ text: groupingTexts.ungroupAll, value: "ungroupAll", onItemClick: onItemClick }) } } return items } allowDragging(column) { const groupPanelOptions = this.option("groupPanel"); return allowDragging(groupPanelOptions, column) || super.allowDragging(column) } } } } }) }, 2772: /*!*********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/grouping/m_grouping_collapsed.js ***! \*********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.GroupingHelper = void 0; var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _errors = __webpack_require__( /*! ../../../../data/errors */ 18438); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/widget/ui.errors */ 96688)); var _m_core = _interopRequireDefault(__webpack_require__( /*! ../m_core */ 74938)); var _m_utils = __webpack_require__( /*! ../m_utils */ 10087); var _m_grouping_core = __webpack_require__( /*! ./m_grouping_core */ 8748); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function getContinuationGroupCount(groupOffset, pageSize, groupSize, groupIndex) { groupIndex = groupIndex || 0; if (pageSize > 1 && groupSize > 0) { let pageOffset = groupOffset - Math.floor(groupOffset / pageSize) * pageSize || pageSize; pageOffset += groupSize - groupIndex - 2; if (pageOffset < 0) { pageOffset += pageSize } return Math.floor(pageOffset / (pageSize - groupIndex - 1)) } return 0 } const foreachExpandedGroups = function(that, callback, updateGroups) { return that.foreachGroups(((groupInfo, parents) => { if (groupInfo.isExpanded) { return callback(groupInfo, parents) } }), true, false, updateGroups, updateGroups) }; const processGroupItems = function(that, items, groupsCount, expandedInfo, path, isCustomLoading, isLastGroupExpanded) { let isExpanded; expandedInfo.items = expandedInfo.items || []; expandedInfo.paths = expandedInfo.paths || []; expandedInfo.count = expandedInfo.count || 0; expandedInfo.lastCount = expandedInfo.lastCount || 0; if (!groupsCount) { return } for (let i = 0; i < items.length; i++) { const item = items[i]; if (void 0 !== item.items) { path.push(item.key); if (isCustomLoading) { isExpanded = true } else { const groupInfo = that.findGroupInfo(path); isExpanded = groupInfo && groupInfo.isExpanded } if (!isExpanded) { item.collapsedItems = item.items; item.items = null } else if (item.items) { processGroupItems(that, item.items, groupsCount - 1, expandedInfo, path, isCustomLoading, isLastGroupExpanded) } else if (1 === groupsCount && item.count && (!isCustomLoading || isLastGroupExpanded)) { expandedInfo.items.push(item); expandedInfo.paths.push(path.slice(0)); expandedInfo.count += expandedInfo.lastCount; expandedInfo.lastCount = item.count } path.pop() } } }; const updateGroupInfoItem = function(that, item, isLastGroupLevel, path, offset) { const groupInfo = that.findGroupInfo(path); let count; if (!groupInfo) { if (isLastGroupLevel) { count = item.count > 0 ? item.count : item.items.length } that.addGroupInfo({ isExpanded: that._isGroupExpanded(path.length - 1), path: path.slice(0), offset: offset, count: count || 0 }) } else { if (isLastGroupLevel) { groupInfo.count = item.count > 0 ? item.count : item.items && item.items.length || 0 } else { item.count = groupInfo.count || item.count } groupInfo.offset = offset } }; const updateGroupInfos = function(that, options, items, loadedGroupCount, groupIndex, path, parentIndex) { const groupCount = options.group ? options.group.length : 0; const isLastGroupLevel = groupCount === loadedGroupCount; const remotePaging = options.remoteOperations.paging; let offset = 0; let totalCount = 0; let count; groupIndex = groupIndex || 0; path = path || []; if (remotePaging && !parentIndex) { offset = 0 === groupIndex ? options.skip || 0 : options.skips[groupIndex - 1] || 0 } if (groupIndex >= loadedGroupCount) { return items.length } for (let i = 0; i < items.length; i++) { const item = items[i]; if (item) { path.push(item.key); if (!item.count && !item.items || void 0 === item.items) { return -1 } updateGroupInfoItem(that, item, isLastGroupLevel, path, offset + i); count = item.items ? updateGroupInfos(that, options, item.items, loadedGroupCount, groupIndex + 1, path, i) : item.count || -1; if (count < 0) { return -1 } totalCount += count; path.pop() } } return totalCount }; const isGroupExpanded = function(groups, groupIndex) { return groups && groups.length && groups[groupIndex] && !!groups[groupIndex].isExpanded }; const getTotalOffset = function(groupInfos, pageSize, offset) { let groupSize; let totalOffset = offset; for (let groupIndex = 0; groupIndex < groupInfos.length; groupIndex++) { groupSize = groupInfos[groupIndex].offset + 1; if (groupIndex > 0) { groupSize += groupInfos[groupIndex - 1].childrenTotalCount; if (pageSize) { groupSize += getContinuationGroupCount(totalOffset, pageSize, groupSize, groupIndex - 1) * groupIndex } } totalOffset += groupSize } return totalOffset }; function applyContinuationToGroupItem(options, expandedInfo, groupLevel, expandedItemIndex) { const item = expandedInfo.items[expandedItemIndex]; const skip = options.skips && options.skips[groupLevel]; const take = options.takes && options.takes[groupLevel]; const isLastExpandedItem = expandedItemIndex === expandedInfo.items.length - 1; const isFirstExpandedItem = 0 === expandedItemIndex; const lastExpandedItemSkip = isFirstExpandedItem && skip || 0; const isItemsTruncatedByTake = item.count > take + lastExpandedItemSkip; if (isFirstExpandedItem && void 0 !== skip) { item.isContinuation = true } if (isLastExpandedItem && void 0 !== take && isItemsTruncatedByTake) { item.isContinuationOnNextPage = true } } function isDataDeferred(data) { return !Array.isArray(data) } function makeDataDeferred(options) { if (!isDataDeferred(options.data)) { options.data = new _deferred.Deferred } } function loadGroupItems(that, options, loadedGroupCount, expandedInfo, groupLevel, data) { if (!options.isCustomLoading) { expandedInfo = {}; processGroupItems(that, data, loadedGroupCount, expandedInfo, []); ! function(options, expandedInfo, currentGroupCount) { const currentGroupIndex = currentGroupCount - 1; const groupCount = options.group ? options.group.length : 0; expandedInfo.skip = options.skips && options.skips[currentGroupIndex]; if (options.takes && void 0 !== options.takes[currentGroupIndex]) { if (groupCount === currentGroupCount) { expandedInfo.take = expandedInfo.count ? expandedInfo.count - (expandedInfo.skip || 0) : 0 } else { expandedInfo.take = 0 } expandedInfo.take += options.takes[currentGroupIndex] } }(options, expandedInfo, loadedGroupCount) } const groupCount = options.group ? options.group.length : 0; if (expandedInfo.paths.length && groupCount - loadedGroupCount > 0) { makeDataDeferred(options); ! function(that, options, expandedInfo, loadedGroupCount, groupLevel, data) { const groups = options.group || []; const currentGroup = groups[groupLevel + 1]; const deferreds = []; (0, _iterator.each)(expandedInfo.paths, (expandedItemIndex => { var _options$storeLoadOpt; const loadOptions = { requireTotalCount: false, requireGroupCount: true, group: [currentGroup], groupSummary: options.storeLoadOptions.groupSummary, filter: (0, _m_utils.createGroupFilter)(expandedInfo.paths[expandedItemIndex], { filter: options.storeLoadOptions.filter, group: groups }), select: options.storeLoadOptions.select, langParams: null === (_options$storeLoadOpt = options.storeLoadOptions) || void 0 === _options$storeLoadOpt ? void 0 : _options$storeLoadOpt.langParams }; if (0 === expandedItemIndex) { loadOptions.skip = expandedInfo.skip || 0 } if (expandedItemIndex === expandedInfo.paths.length - 1) { loadOptions.take = expandedInfo.take } const loadResult = 0 === loadOptions.take ? [] : that._dataSource.loadFromStore(loadOptions); (0, _deferred.when)(loadResult).done((data => { const item = expandedInfo.items[expandedItemIndex]; applyContinuationToGroupItem(options, expandedInfo, groupLevel, expandedItemIndex); item.items = data })); deferreds.push(loadResult) })); _deferred.when.apply(null, deferreds).done((() => { updateGroupInfos(that, options, data, loadedGroupCount + 1); loadGroupItems(that, options, loadedGroupCount + 1, expandedInfo, groupLevel + 1, data) })) }(that, options, expandedInfo, loadedGroupCount, groupLevel, data) } else if (expandedInfo.paths.length && options.storeLoadOptions.group) { makeDataDeferred(options); ! function(that, options, expandedInfo, data) { const expandedFilters = []; const groups = options.group || []; (0, _iterator.each)(expandedInfo.paths, ((_, expandedPath) => { expandedFilters.push((0, _m_utils.createGroupFilter)(expandedPath, { group: options.isCustomLoading ? options.storeLoadOptions.group : groups })) })); let { filter: filter } = options.storeLoadOptions; if (!options.storeLoadOptions.isLoadingAll) { filter = _m_core.default.combineFilters([filter, _m_core.default.combineFilters(expandedFilters, "or")]) } const loadOptions = (0, _extend.extend)({}, options.storeLoadOptions, { requireTotalCount: false, requireGroupCount: false, group: null, sort: groups.concat(_m_core.default.normalizeSortingInfo(options.storeLoadOptions.sort || [])), filter: filter }); const isPagingLocal = that._dataSource.isLastLevelGroupItemsPagingLocal(); if (!isPagingLocal) { loadOptions.skip = expandedInfo.skip; loadOptions.take = expandedInfo.take }(0, _deferred.when)(0 === expandedInfo.take ? [] : that._dataSource.loadFromStore(loadOptions)).done((items => { if (isPagingLocal) { items = that._dataSource.sortLastLevelGroupItems(items, groups, expandedInfo.paths); items = expandedInfo.skip ? items.slice(expandedInfo.skip) : items; items = expandedInfo.take ? items.slice(0, expandedInfo.take) : items }(0, _iterator.each)(expandedInfo.items, ((index, item) => { const itemCount = item.count - (0 === index && expandedInfo.skip || 0); const expandedItems = items.splice(0, itemCount); applyContinuationToGroupItem(options, expandedInfo, groups.length - 1, index); item.items = expandedItems })); options.data.resolve(data) })).fail(options.data.reject) }(that, options, expandedInfo, data) } else if (isDataDeferred(options.data)) { options.data.resolve(data) } } const loadGroupTotalCount = function(dataSource, options) { const d = new _deferred.Deferred; const isGrouping = !!(options.group && options.group.length); const loadOptions = (0, _extend.extend)({ skip: 0, take: 1, requireGroupCount: isGrouping, requireTotalCount: !isGrouping }, options, { group: isGrouping ? options.group : null }); dataSource.load(loadOptions).done(((data, extra) => { const count = extra && (isGrouping ? extra.groupCount : extra.totalCount); if (!isFinite(count)) { d.reject(_errors.errors.Error(isGrouping ? "E4022" : "E4021")); return } d.resolve(count) })).fail(d.reject.bind(d)); return d }; class GroupingHelper extends _m_grouping_core.GroupingHelper { updateTotalItemsCount(options) { let totalItemsCount = 0; const totalCount = options.extra && options.extra.totalCount || 0; const groupCount = options.extra && options.extra.groupCount || 0; const pageSize = this._dataSource.pageSize(); const isVirtualPaging = this._isVirtualPaging(); foreachExpandedGroups(this, (groupInfo => { groupInfo.childrenTotalCount = 0 })); foreachExpandedGroups(this, ((groupInfo, parents) => { const totalOffset = getTotalOffset(parents, isVirtualPaging ? 0 : pageSize, totalItemsCount); let count = groupInfo.count + groupInfo.childrenTotalCount; if (!isVirtualPaging) { count += getContinuationGroupCount(totalOffset, pageSize, count, parents.length - 1) } if (parents[parents.length - 2]) { parents[parents.length - 2].childrenTotalCount += count } else { totalItemsCount += count } })); super.updateTotalItemsCount(totalItemsCount - totalCount + groupCount) } _isGroupExpanded(groupIndex) { const groups = this._dataSource.group(); return isGroupExpanded(groups, groupIndex) } _updatePagingOptions(options, callback) { const that = this; const isVirtualPaging = that._isVirtualPaging(); const pageSize = that._dataSource.pageSize(); const skips = []; const takes = []; let skipChildrenTotalCount = 0; let childrenTotalCount = 0; if (options.take) { foreachExpandedGroups(this, (groupInfo => { groupInfo.childrenTotalCount = 0; groupInfo.skipChildrenTotalCount = 0 })); foreachExpandedGroups(that, ((groupInfo, parents) => { let take; let takeCorrection = 0; let parentTakeCorrection = 0; const totalOffset = getTotalOffset(parents, isVirtualPaging ? 0 : pageSize, childrenTotalCount); let continuationGroupCount = 0; let skipContinuationGroupCount = 0; let groupInfoCount = groupInfo.count + groupInfo.childrenTotalCount; let childrenGroupInfoCount = groupInfoCount; callback && callback(groupInfo, totalOffset); const skip = options.skip - totalOffset; if (totalOffset <= options.skip + options.take && groupInfoCount) { take = options.take; if (!isVirtualPaging) { continuationGroupCount = getContinuationGroupCount(totalOffset, pageSize, groupInfoCount, parents.length - 1); groupInfoCount += continuationGroupCount * parents.length; childrenGroupInfoCount += continuationGroupCount; if (pageSize && skip >= 0) { takeCorrection = parents.length; parentTakeCorrection = parents.length - 1; skipContinuationGroupCount = Math.floor(skip / pageSize) } } if (skip >= 0) { if (totalOffset + groupInfoCount > options.skip) { skips.unshift(skip - skipContinuationGroupCount * takeCorrection - groupInfo.skipChildrenTotalCount) } if (totalOffset + groupInfoCount >= options.skip + take) { takes.unshift(take - takeCorrection - groupInfo.childrenTotalCount + groupInfo.skipChildrenTotalCount) } } else if (totalOffset + groupInfoCount >= options.skip + take) { takes.unshift(take + skip - groupInfo.childrenTotalCount) } } if (totalOffset <= options.skip) { if (parents[parents.length - 2]) { parents[parents.length - 2].skipChildrenTotalCount += Math.min(childrenGroupInfoCount, skip + 1 - skipContinuationGroupCount * parentTakeCorrection) } else { skipChildrenTotalCount += Math.min(childrenGroupInfoCount, skip + 1) } } if (totalOffset <= options.skip + take) { groupInfoCount = Math.min(childrenGroupInfoCount, skip + take - (skipContinuationGroupCount + 1) * parentTakeCorrection); if (parents[parents.length - 2]) { parents[parents.length - 2].childrenTotalCount += groupInfoCount } else { childrenTotalCount += groupInfoCount } } })); options.skip -= skipChildrenTotalCount; options.take -= childrenTotalCount - skipChildrenTotalCount } options.skips = skips; options.takes = takes } changeRowExpand(path) { const groupInfo = this.findGroupInfo(path); const dataSource = this._dataSource; const remoteGroupPaging = dataSource.remoteOperations().groupPaging; const groups = _m_core.default.normalizeSortingInfo(dataSource.group()); if (groupInfo) { groupInfo.isExpanded = !groupInfo.isExpanded; if (remoteGroupPaging && groupInfo.isExpanded && path.length < groups.length) { return loadGroupTotalCount(dataSource, { filter: (0, _m_utils.createGroupFilter)(path, { filter: dataSource.lastLoadOptions().filter, group: dataSource.group() }), group: [groups[path.length]], select: dataSource.select() }).done((groupCount => { groupInfo.count = groupCount })) } return (new _deferred.Deferred).resolve() } return (new _deferred.Deferred).reject() } handleDataLoading(options) { const that = this; const { storeLoadOptions: storeLoadOptions } = options; const groups = _m_core.default.normalizeSortingInfo(storeLoadOptions.group || options.loadOptions.group); if (options.isCustomLoading || !groups.length) { return } if (options.remoteOperations.grouping) { const remotePaging = that._dataSource.remoteOperations().paging; storeLoadOptions.group = _m_core.default.normalizeSortingInfo(storeLoadOptions.group); storeLoadOptions.group.forEach(((group, index) => { const isLastGroup = index === storeLoadOptions.group.length - 1; group.isExpanded = !remotePaging || !isLastGroup })) } options.group = options.group || groups; if (options.remoteOperations.paging) { options.skip = storeLoadOptions.skip; options.take = storeLoadOptions.take; storeLoadOptions.requireGroupCount = true; storeLoadOptions.group = groups.slice(0, 1); that._updatePagingOptions(options); storeLoadOptions.skip = options.skip; storeLoadOptions.take = options.take } else { options.skip = options.loadOptions.skip; options.take = options.loadOptions.take; that._updatePagingOptions(options) } } handleDataLoadedCore(options, callBase) { const that = this; const loadedGroupCount = _m_core.default.normalizeSortingInfo(options.storeLoadOptions.group || options.loadOptions.group).length; const groupCount = options.group ? options.group.length : 0; let totalCount; const expandedInfo = {}; if (options.isCustomLoading) { callBase(options); processGroupItems(that, options.data, loadedGroupCount, expandedInfo, [], options.isCustomLoading, options.storeLoadOptions.isLoadingAll) } else { if (!options.remoteOperations.paging) { that.foreachGroups((groupInfo => { groupInfo.count = 0 })) } totalCount = updateGroupInfos(that, options, options.data, loadedGroupCount); if (totalCount < 0) { options.data = (new _deferred.Deferred).reject(_ui.default.Error("E1037")); return } if (!options.remoteOperations.paging) { if (loadedGroupCount && options.extra && options.loadOptions.requireTotalCount) { options.extra.totalCount = totalCount; options.extra.groupCount = options.data.length } } if (groupCount && options.storeLoadOptions.requireGroupCount && !isFinite(options.extra.groupCount)) { options.data = (new _deferred.Deferred).reject(_errors.errors.Error("E4022")); return } that.updateTotalItemsCount(options); if (!options.remoteOperations.paging) { that._updatePagingOptions(options); options.lastLoadOptions.skips = options.skips; options.lastLoadOptions.takes = options.takes } callBase(options); if (!options.remoteOperations.paging) { that._processPaging(options, loadedGroupCount) } } loadGroupItems(that, options, loadedGroupCount, expandedInfo, 0, options.data) } _processSkips(items, skips, groupCount) { if (!groupCount) { return } const firstItem = items[0]; const skip = skips[0]; const children = firstItem && firstItem.items; if (void 0 !== skip) { firstItem.isContinuation = true; if (children) { firstItem.items = children.slice(skip); this._processSkips(firstItem.items, skips.slice(1), groupCount - 1) } } } _processTakes(items, skips, takes, groupCount, parents) { if (!groupCount || !items) { return } parents = parents || []; const lastItem = items[items.length - 1]; let children = lastItem && lastItem.items; const take = takes[0]; const skip = skips[0]; if (lastItem) { const maxTakeCount = lastItem.count - (lastItem.isContinuation && skip || 0) || children.length; if (void 0 !== take && maxTakeCount > take) { lastItem.isContinuationOnNextPage = true; parents.forEach((parent => { parent.isContinuationOnNextPage = true })); if (children) { children = children.slice(0, take); lastItem.items = children } } parents.push(lastItem); this._processTakes(children, skips.slice(1), takes.slice(1), groupCount - 1, parents) } } _processPaging(options, groupCount) { this._processSkips(options.data, options.skips, groupCount); this._processTakes(options.data, options.skips, options.takes, groupCount) } isLastLevelGroupItemsPagingLocal() { return false } sortLastLevelGroupItems(items) { return items } refresh(options, operationTypes) { const that = this; const dataSource = that._dataSource; const { storeLoadOptions: storeLoadOptions } = options; const group = options.group || options.storeLoadOptions.group; const oldGroups = _m_core.default.normalizeSortingInfo(that._group); let isExpanded; let groupIndex; function handleGroup(groupInfo, parents) { if (parents.length === groupIndex + 1) { groupInfo.isExpanded = isExpanded } } for (groupIndex = 0; groupIndex < oldGroups.length; groupIndex++) { isExpanded = isGroupExpanded(group, groupIndex); if (isGroupExpanded(that._group, groupIndex) !== isExpanded) { that.foreachGroups(handleGroup) } } super.refresh.apply(this, arguments); if (group && options.remoteOperations.paging && operationTypes.reload) { return foreachExpandedGroups(that, (groupInfo => { const groupCountQuery = loadGroupTotalCount(dataSource, { filter: (0, _m_utils.createGroupFilter)(groupInfo.path, { filter: storeLoadOptions.filter, group: group }), group: group.slice(groupInfo.path.length), select: storeLoadOptions.select }); const groupOffsetQuery = loadGroupTotalCount(dataSource, { filter: (0, _m_grouping_core.createOffsetFilter)(groupInfo.path, { filter: storeLoadOptions.filter, group: group }, true), group: group.slice(groupInfo.path.length - 1, groupInfo.path.length), select: storeLoadOptions.select }); return (0, _deferred.when)(groupOffsetQuery, groupCountQuery).done(((offset, count) => { offset = parseInt(offset.length ? offset[0] : offset); count = parseInt(count.length ? count[0] : count); groupInfo.offset = offset; if (groupInfo.count !== count) { groupInfo.count = count; that.updateTotalItemsCount(options) } })) }), true) } } } exports.GroupingHelper = GroupingHelper }, 8748: /*!****************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/grouping/m_grouping_core.js ***! \****************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.GroupingHelper = void 0; exports.createOffsetFilter = function(path, storeLoadOptions, lastLevelOnly) { const groups = (0, _utils.normalizeSortingInfo)(storeLoadOptions.group); let filter = []; for (let i = lastLevelOnly ? path.length - 1 : 0; i < path.length; i++) { const filterElement = []; for (let j = 0; j <= i; j++) { const { selector: selector } = groups[j]; if (i === j && (null === path[j] || false === path[j] || true === path[j])) { if (false === path[j]) { filterElement.push([selector, "=", groups[j].desc ? true : null]) } else if (path[j] ? !groups[j].desc : groups[j].desc) { filterElement.push([selector, "<>", path[j]]) } else { filterElement.push([selector, "<>", null]); filterElement.push([selector, "=", null]) } } else { const currentFilter = [selector, i === j ? groups[j].desc ? ">" : "<" : "=", path[j]]; if ("<" === currentFilter[1]) { filterElement.push([currentFilter, "or", [selector, "=", null]]) } else { filterElement.push(currentFilter) } } } filter.push(_m_core.default.combineFilters(filterElement)) } filter = _m_core.default.combineFilters(filter, "or"); return _m_core.default.combineFilters([filter, storeLoadOptions.filter]) }; var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _utils = __webpack_require__( /*! ../../../../data/utils */ 16454); var _m_core = _interopRequireDefault(__webpack_require__( /*! ../m_core */ 74938)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const findGroupInfoByKey = function(groupsInfo, key) { const { hash: hash } = groupsInfo; return hash && hash[JSON.stringify(key)] }; const getGroupInfoIndexByOffset = function(groupsInfo, offset) { let leftIndex = 0; let rightIndex = groupsInfo.length - 1; if (!groupsInfo.length) { return 0 } do { const middleIndex = rightIndex + leftIndex >> 1; if (groupsInfo[middleIndex].offset > offset) { rightIndex = middleIndex } else { leftIndex = middleIndex } } while (rightIndex - leftIndex > 1); let index; for (index = leftIndex; index <= rightIndex; index++) { if (groupsInfo[index].offset > offset) { break } } return index }; const cleanGroupsInfo = function(groupsInfo, groupIndex, groupsCount) { for (let i = 0; i < groupsInfo.length; i++) { if (groupIndex + 1 >= groupsCount) { groupsInfo[i].children = [] } else { cleanGroupsInfo(groupsInfo[i].children, groupIndex + 1, groupsCount) } } }; const calculateItemsCount = function(that, items, groupsCount) { let result = 0; if (items) { if (!groupsCount) { result = items.length } else { for (let i = 0; i < items.length; i++) { if (that.isGroupItemCountable(items[i])) { result++ } result += calculateItemsCount(that, items[i].items, groupsCount - 1) } } } return result }; exports.GroupingHelper = class { constructor(dataSourceAdapter) { this._dataSource = dataSourceAdapter; this.reset() } reset() { this._groupsInfo = []; this._totalCountCorrection = 0 } totalCountCorrection() { return this._totalCountCorrection } updateTotalItemsCount(totalCountCorrection) { this._totalCountCorrection = totalCountCorrection || 0 } isGroupItemCountable(item) { return !this._isVirtualPaging() || !item.isContinuation } _isVirtualPaging() { const scrollingMode = this._dataSource.option("scrolling.mode"); return "virtual" === scrollingMode || "infinite" === scrollingMode } itemsCount() { const dataSourceAdapter = this._dataSource; const dataSource = dataSourceAdapter._dataSource; const groupCount = _m_core.default.normalizeSortingInfo(dataSource.group() || []).length; const itemsCount = calculateItemsCount(this, dataSource.items(), groupCount); return itemsCount } foreachGroups(callback, childrenAtFirst, foreachCollapsedGroups, updateOffsets, updateParentOffsets) { const that = this; return function foreachGroupsCore(groupsInfo, callback, childrenAtFirst, parents) { const callbackResults = []; function executeCallback(callback, data, parents, callbackResults) { const callbackResult = data && callback(data, parents); callbackResult && callbackResults.push(callbackResult); return callbackResult } for (let i = 0; i < groupsInfo.length; i++) { parents.push(groupsInfo[i].data); if (!childrenAtFirst && false === executeCallback(callback, groupsInfo[i].data, parents, callbackResults)) { return false } if (!groupsInfo[i].data || groupsInfo[i].data.isExpanded || foreachCollapsedGroups) { const { children: children } = groupsInfo[i]; const callbackResult = children.length && foreachGroupsCore(children, callback, childrenAtFirst, parents); callbackResult && callbackResults.push(callbackResult); if (false === callbackResult) { return false } } if (childrenAtFirst && false === executeCallback(callback, groupsInfo[i].data, parents, callbackResults)) { return false } if (!groupsInfo[i].data || groupsInfo[i].data.offset !== groupsInfo[i].offset) { updateOffsets = true } parents.pop() } const currentParents = updateParentOffsets && parents.slice(0); return updateOffsets && _deferred.when.apply(_renderer.default, callbackResults).always((() => { that._updateGroupInfoOffsets(groupsInfo, currentParents) })) }(that._groupsInfo, callback, childrenAtFirst, []) } _updateGroupInfoOffsets(groupsInfo, parents) { parents = parents || []; for (let index = 0; index < groupsInfo.length; index++) { const groupInfo = groupsInfo[index]; if (groupInfo.data && groupInfo.data.offset !== groupInfo.offset) { groupInfo.offset = groupInfo.data.offset; for (let parentIndex = 0; parentIndex < parents.length; parentIndex++) { parents[parentIndex].offset = groupInfo.offset } } } groupsInfo.sort(((a, b) => a.offset - b.offset)) } findGroupInfo(path) { let groupInfo; let groupsInfo = this._groupsInfo; for (let pathIndex = 0; groupsInfo && pathIndex < path.length; pathIndex++) { groupInfo = findGroupInfoByKey(groupsInfo, path[pathIndex]); groupsInfo = groupInfo && groupInfo.children } return groupInfo && groupInfo.data } addGroupInfo(groupInfoData) { const that = this; let groupInfo; const { path: path } = groupInfoData; let groupsInfo = that._groupsInfo; for (let pathIndex = 0; pathIndex < path.length; pathIndex++) { groupInfo = findGroupInfoByKey(groupsInfo, path[pathIndex]); if (!groupInfo) { groupInfo = { key: path[pathIndex], offset: groupInfoData.offset, data: { offset: groupInfoData.offset, isExpanded: true, path: path.slice(0, pathIndex + 1) }, children: [] }; const index = getGroupInfoIndexByOffset(groupsInfo, groupInfoData.offset); groupsInfo.splice(index, 0, groupInfo); groupsInfo.hash = groupsInfo.hash || {}; groupsInfo.hash[JSON.stringify(groupInfo.key)] = groupInfo } if (pathIndex === path.length - 1) { groupInfo.data = groupInfoData; if (groupInfo.offset !== groupInfoData.offset) { that._updateGroupInfoOffsets(groupsInfo) } } groupsInfo = groupInfo.children } } allowCollapseAll() { return true } refresh(options) { const that = this; const { storeLoadOptions: storeLoadOptions } = options; const groups = (0, _utils.normalizeSortingInfo)(storeLoadOptions.group || []); const oldGroups = "_group" in that ? (0, _utils.normalizeSortingInfo)(that._group || []) : groups; let groupsCount = Math.min(oldGroups.length, groups.length); that._group = storeLoadOptions.group; for (let groupIndex = 0; groupIndex < groupsCount; groupIndex++) { if (oldGroups[groupIndex].selector !== groups[groupIndex].selector) { groupsCount = groupIndex; break } } if (!groupsCount) { that.reset() } else { cleanGroupsInfo(that._groupsInfo, 0, groupsCount) } } handleDataLoading() {} handleDataLoaded(options, callBase) { callBase(options) } handleDataLoadedCore(options, callBase) { callBase(options) } } }, 4789: /*!********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/grouping/m_grouping_expanded.js ***! \********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.GroupingHelper = void 0; var _data = __webpack_require__( /*! ../../../../core/utils/data */ 47617); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _query = _interopRequireDefault(__webpack_require__( /*! ../../../../data/query */ 96687)); var _store_helper = _interopRequireDefault(__webpack_require__( /*! ../../../../data/store_helper */ 99236)); var _utils = __webpack_require__( /*! ../../../../data/utils */ 16454); var _m_core = _interopRequireDefault(__webpack_require__( /*! ../m_core */ 74938)); var _m_utils = __webpack_require__( /*! ../m_utils */ 10087); var _m_grouping_core = __webpack_require__( /*! ./m_grouping_core */ 8748); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const loadTotalCount = function(dataSource, options) { const d = new _deferred.Deferred; const loadOptions = (0, _extend.extend)({ skip: 0, take: 1, requireTotalCount: true }, options); dataSource.load(loadOptions).done(((data, extra) => { d.resolve(extra && extra.totalCount) })).fail(d.reject.bind(d)); return d }; const foreachCollapsedGroups = function(that, callback, updateOffsets) { return that.foreachGroups((groupInfo => { if (!groupInfo.isExpanded) { return callback(groupInfo) } }), false, false, updateOffsets, true) }; const correctSkipLoadOption = function(that, skip) { let skipCorrection = 0; let resultSkip = skip || 0; if (skip) { foreachCollapsedGroups(that, (groupInfo => { if (groupInfo.offset - skipCorrection >= skip) { return false } skipCorrection += groupInfo.count - 1 })); resultSkip += skipCorrection } return resultSkip }; const processGroupItems = function(that, items, path, offset, skipFirstItem, take) { let removeLastItemsCount = 0; let needRemoveFirstItem = false; for (let i = 0; i < items.length; i++) { const item = items[i]; if (void 0 !== item.items) { path.push(item.key); const groupInfo = that.findGroupInfo(path); if (groupInfo && !groupInfo.isExpanded) { item.collapsedItems = item.items; item.items = null; offset += groupInfo.count; take--; if (take < 0) { removeLastItemsCount++ } if (skipFirstItem) { needRemoveFirstItem = true } } else if (item.items) { const offsetInfo = processGroupItems(that, item.items, path, offset, skipFirstItem, take); if (skipFirstItem) { if (offsetInfo.offset - offset > 1) { item.isContinuation = true } else { needRemoveFirstItem = true } } offset = offsetInfo.offset; take = offsetInfo.take; if (take < 0) { if (item.items.length) { item.isContinuationOnNextPage = true } else { removeLastItemsCount++ } } } path.pop() } else { if (skipFirstItem) { needRemoveFirstItem = true } offset++; take--; if (take < 0) { removeLastItemsCount++ } } skipFirstItem = false } if (needRemoveFirstItem) { items.splice(0, 1) } if (removeLastItemsCount) { items.splice(-removeLastItemsCount, removeLastItemsCount) } return { offset: offset, take: take } }; const pathEquals = function(path1, path2) { if (path1.length !== path2.length) { return false } for (let i = 0; i < path1.length; i++) { if (!(0, _utils.keysEqual)(null, path1[i], path2[i])) { return false } } return true }; const updateGroupOffsets = function(that, items, path, offset, additionalGroupInfo) { if (!items) { return } for (let i = 0; i < items.length; i++) { const item = items[i]; if ("key" in item && void 0 !== item.items) { path.push(item.key); if (additionalGroupInfo && pathEquals(additionalGroupInfo.path, path) && !item.isContinuation) { additionalGroupInfo.offset = offset } const groupInfo = that.findGroupInfo(path); if (groupInfo && !item.isContinuation) { groupInfo.offset = offset } if (groupInfo && !groupInfo.isExpanded) { offset += groupInfo.count } else { offset = updateGroupOffsets(that, item.items, path, offset, additionalGroupInfo) } path.pop() } else { offset++ } } return offset }; const getGroupCount = function(item, groupCount) { let count = item.count || item.items.length; if (!item.count && groupCount > 1) { count = 0; for (let i = 0; i < item.items.length; i++) { count += getGroupCount(item.items[i], groupCount - 1) } } return count }; class GroupingHelper extends _m_grouping_core.GroupingHelper { handleDataLoading(options) { const { storeLoadOptions: storeLoadOptions } = options; const collapsedGroups = []; let collapsedItemsCount = 0; let skipFirstItem = false; let take; const { group: group } = options.loadOptions; let skipCorrection = 0; ! function(storeLoadOptions, loadOptions) { if (loadOptions.group) { const groups = _m_core.default.normalizeSortingInfo(loadOptions.group); const sorts = _m_core.default.normalizeSortingInfo(storeLoadOptions.sort); storeLoadOptions.sort = _store_helper.default.arrangeSortingInfo(groups, sorts); delete loadOptions.group } }(storeLoadOptions, options.loadOptions); options.group = options.group || group; if (options.isCustomLoading) { return } const loadOptions = (0, _extend.extend)({}, storeLoadOptions); loadOptions.skip = correctSkipLoadOption(this, storeLoadOptions.skip); if (loadOptions.skip && loadOptions.take && group) { loadOptions.skip--; loadOptions.take++; skipFirstItem = true } if (loadOptions.take && group) { take = loadOptions.take; loadOptions.take++ } foreachCollapsedGroups(this, (groupInfo => { if (groupInfo.offset >= loadOptions.skip + loadOptions.take + skipCorrection) { return false } if (groupInfo.offset >= loadOptions.skip + skipCorrection && groupInfo.count) { skipCorrection += groupInfo.count - 1; collapsedGroups.push(groupInfo); collapsedItemsCount += groupInfo.count } })); (0, _iterator.each)(collapsedGroups, (function() { loadOptions.filter = function(path, storeLoadOptions, group) { const groups = _m_core.default.normalizeSortingInfo(group || storeLoadOptions.group); let filter = []; for (let i = 0; i < path.length; i++) { const filterElement = []; for (let j = 0; j <= i; j++) { filterElement.push([groups[j].selector, i === j ? "<>" : "=", path[j]]) } filter.push(_m_core.default.combineFilters(filterElement)) } filter = _m_core.default.combineFilters(filter, "or"); return _m_core.default.combineFilters([filter, storeLoadOptions.filter]) }(this.path, loadOptions, group) })); options.storeLoadOptions = loadOptions; options.collapsedGroups = collapsedGroups; options.collapsedItemsCount = collapsedItemsCount; options.skip = loadOptions.skip || 0; options.skipFirstItem = skipFirstItem; options.take = take } handleDataLoaded(options, callBase) { const that = this; const { collapsedGroups: collapsedGroups } = options; const groups = _m_core.default.normalizeSortingInfo(options.group); const groupCount = groups.length; function appendCollapsedPath(data, path, groups, collapsedGroup, offset) { if (!data || !path.length || !groups.length) { return } let keyValue; let i; const pathValue = (0, _data.toComparable)(path[0], true); for (i = 0; i < data.length; i++) { keyValue = (0, _data.toComparable)(data[i].key, true); if (offset >= collapsedGroup.offset || pathValue === keyValue) { break } else { offset += getGroupCount(data[i], groups.length) } } if (!data.length || pathValue !== keyValue) { data.splice(i, 0, { key: path[0], items: [], count: 1 === path.length ? collapsedGroup.count : void 0 }) } appendCollapsedPath(data[i].items, path.slice(1), groups.slice(1), collapsedGroup, offset) } if (options.collapsedItemsCount && options.extra && options.extra.totalCount >= 0) { if (!options.extra._totalCountWasIncreasedByCollapsedItems) { options.extra.totalCount += options.collapsedItemsCount; options.extra._totalCountWasIncreasedByCollapsedItems = true } } callBase(options); if (groupCount) { let { data: data } = options; const query = (0, _query.default)(data); _store_helper.default.multiLevelGroup(query, groups).enumerate().done((groupedData => { data = groupedData })); if (collapsedGroups) { for (let pathIndex = 0; pathIndex < collapsedGroups.length; pathIndex++) { appendCollapsedPath(data, collapsedGroups[pathIndex].path, groups, collapsedGroups[pathIndex], options.skip) } } if (!options.isCustomLoading) { processGroupItems(that, data, [], options.skip, options.skipFirstItem, options.take) } options.data = data } } isGroupItemCountable(item) { return null === item.items } updateTotalItemsCount() { let itemsCountCorrection = 0; foreachCollapsedGroups(this, (groupInfo => { if (groupInfo.count) { itemsCountCorrection -= groupInfo.count - 1 } })); super.updateTotalItemsCount(itemsCountCorrection) } changeRowExpand(path) { const that = this; const dataSource = that._dataSource; const beginPageIndex = dataSource.beginPageIndex ? dataSource.beginPageIndex() : dataSource.pageIndex(); const dataSourceItems = dataSource.items(); const offset = correctSkipLoadOption(that, beginPageIndex * dataSource.pageSize()); let groupInfo = that.findGroupInfo(path); let groupCountQuery; if (groupInfo && !groupInfo.isExpanded) { groupCountQuery = (new _deferred.Deferred).resolve(groupInfo.count) } else { groupCountQuery = loadTotalCount(dataSource, { filter: (0, _m_utils.createGroupFilter)(path, { filter: dataSource.filter(), group: dataSource.group() }) }) } return (0, _deferred.when)(groupCountQuery).done((count => { count = parseInt(count.length ? count[0] : count); if (groupInfo) { updateGroupOffsets(that, dataSourceItems, [], offset); groupInfo.isExpanded = !groupInfo.isExpanded; groupInfo.count = count } else { groupInfo = { offset: -1, count: count, path: path, isExpanded: false }; updateGroupOffsets(that, dataSourceItems, [], offset, groupInfo); if (groupInfo.offset >= 0) { that.addGroupInfo(groupInfo) } } that.updateTotalItemsCount() })).fail((function() { dataSource._eventsStrategy.fireEvent("loadError", arguments) })) } allowCollapseAll() { return false } refresh(options, operationTypes) { const that = this; const { storeLoadOptions: storeLoadOptions } = options; const dataSource = that._dataSource; super.refresh.apply(this, arguments); if (operationTypes.reload) { return foreachCollapsedGroups(that, (groupInfo => { const groupCountQuery = loadTotalCount(dataSource, { filter: (0, _m_utils.createGroupFilter)(groupInfo.path, storeLoadOptions) }); const groupOffsetQuery = loadTotalCount(dataSource, { filter: (0, _m_grouping_core.createOffsetFilter)(groupInfo.path, storeLoadOptions) }); return (0, _deferred.when)(groupOffsetQuery, groupCountQuery).done(((offset, count) => { offset = parseInt(offset.length ? offset[0] : offset); count = parseInt(count.length ? count[0] : count); groupInfo.offset = offset; if (groupInfo.count !== count) { groupInfo.count = count; that.updateTotalItemsCount() } })) }), true) } } } exports.GroupingHelper = GroupingHelper }, 29593: /*!**************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/m_aggregate_calculator.js ***! \**************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _data = __webpack_require__( /*! ../../../core/utils/data */ 47617); var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922); var _errors = __webpack_require__( /*! ../../../data/errors */ 18438); var _utils = __webpack_require__( /*! ../../../data/utils */ 16454); function depthFirstSearch(i, depth, root, callback) { let j = 0; if (i < depth) { for (; j < root.items.length; j++) { depthFirstSearch(i + 1, depth, root.items[j], callback) } } if (i === depth) { callback(root) } } function map(array, callback) { let i; if ("map" in array) { return array.map(callback) } const result = new Array(array.length); for (i in array) { result[i] = callback(array[i], i) } return result } function normalizeAggregate(aggregate) { const selector = (0, _data.compileGetter)(aggregate.selector); const skipEmptyValues = "skipEmptyValues" in aggregate ? aggregate.skipEmptyValues : true; let { aggregator: aggregator } = aggregate; if ("string" === typeof aggregator) { aggregator = _utils.aggregators[aggregator]; if (!aggregator) { throw _errors.errors.Error("E4001", aggregate.aggregator) } } return { selector: selector, aggregator: aggregator, skipEmptyValues: skipEmptyValues } } exports.default = class { constructor(options) { this._data = options.data; this._groupLevel = options.groupLevel || 0; this._totalAggregates = map(options.totalAggregates || [], normalizeAggregate); this._groupAggregates = map(options.groupAggregates || [], normalizeAggregate); this._totals = [] } calculate() { if (this._totalAggregates.length) { this._calculateTotals(0, { items: this._data }) } if (this._groupAggregates.length && this._groupLevel > 0) { this._calculateGroups({ items: this._data }) } } totalAggregates() { return this._totals } _aggregate(aggregates, data, container) { const length = data.items ? data.items.length : 0; for (let i = 0; i < aggregates.length; i++) { if (aggregator = aggregates[i].aggregator, aggregator === _utils.aggregators.count) { container[i] = (container[i] || 0) + length; continue } for (let j = 0; j < length; j++) { this._accumulate(i, aggregates[i], container, data.items[j]) } } var aggregator } _calculateTotals(level, data) { if (0 === level) { this._totals = this._seed(this._totalAggregates) } if (level === this._groupLevel) { this._aggregate(this._totalAggregates, data, this._totals) } else { for (let i = 0; i < data.items.length; i++) { this._calculateTotals(level + 1, data.items[i]) } } if (0 === level) { this._totals = this._finalize(this._totalAggregates, this._totals) } } _calculateGroups(root) { const maxLevel = this._groupLevel; let currentLevel = maxLevel + 1; const seedFn = this._seed.bind(this, this._groupAggregates); const stepFn = this._aggregate.bind(this, this._groupAggregates); const finalizeFn = this._finalize.bind(this, this._groupAggregates); function aggregator(node) { node.aggregates = seedFn(currentLevel - 1); if (currentLevel === maxLevel) { stepFn(node, node.aggregates) } else { depthFirstSearch(currentLevel, maxLevel, node, (innerNode => { stepFn(innerNode, node.aggregates) })) } node.aggregates = finalizeFn(node.aggregates) } while (--currentLevel > 0) { depthFirstSearch(0, currentLevel, root, aggregator) } } _seed(aggregates, groupIndex) { return map(aggregates, (aggregate => { const { aggregator: aggregator } = aggregate; const seed = "seed" in aggregator ? (0, _type.isFunction)(aggregator.seed) ? aggregator.seed(groupIndex) : aggregator.seed : NaN; return seed })) } _accumulate(aggregateIndex, aggregate, results, item) { const value = aggregate.selector(item); const { aggregator: aggregator } = aggregate; const { skipEmptyValues: skipEmptyValues } = aggregate; if (skipEmptyValues && (x = value, x !== x || "" === x || null === x || void 0 === x)) { return } var x; if (results[aggregateIndex] !== results[aggregateIndex]) { results[aggregateIndex] = value } else { results[aggregateIndex] = aggregator.step(results[aggregateIndex], value) } } _finalize(aggregates, results) { return map(aggregates, ((aggregate, index) => { const fin = aggregate.aggregator.finalize; return fin ? fin(results[index]) : results[index] })) } } }, 96291: /*!************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/m_columns_controller.js ***! \************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306); var _m_columns_controller = __webpack_require__( /*! ../../grids/grid_core/columns_controller/m_columns_controller */ 10279); var _m_core = (obj = __webpack_require__( /*! ./m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("columns", { defaultOptions: () => (0, _extend.extend)(true, {}, _m_columns_controller.columnsControllerModule.defaultOptions(), { commonColumnSettings: { allowExporting: true } }), controllers: _m_columns_controller.columnsControllerModule.controllers }) }, 74938: /*!**********************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/m_core.js ***! \**********************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _m_modules = _interopRequireDefault(__webpack_require__( /*! ../../grids/grid_core/m_modules */ 15943)); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../../grids/grid_core/m_utils */ 60082)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } exports.default = _extends({}, _m_modules.default, _m_utils.default, { modules: [] }) }, 3263: /*!*********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/m_data_controller.js ***! \*********************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.DataController = void 0; var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../ui/widget/ui.errors */ 96688)); var _m_data_controller = __webpack_require__( /*! ../../grids/grid_core/data_controller/m_data_controller */ 72119); var _m_core = _interopRequireDefault(__webpack_require__( /*! ./m_core */ 74938)); var _m_data_source_adapter = _interopRequireDefault(__webpack_require__( /*! ./m_data_source_adapter */ 49975)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } class DataGridDataController extends _m_data_controller.DataController { _getDataSourceAdapter() { return _m_data_source_adapter.default } _getSpecificDataSourceOption() { const dataSource = this.option("dataSource"); if (dataSource && !Array.isArray(dataSource) && this.option("keyExpr")) { _ui.default.log("W1011") } return super._getSpecificDataSourceOption() } } exports.DataController = DataGridDataController; _m_core.default.registerModule("data", { defaultOptions: _m_data_controller.dataControllerModule.defaultOptions, controllers: { data: DataGridDataController } }) }, 49975: /*!*************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/m_data_source_adapter.js ***! \*************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _m_data_source_adapter = (obj = __webpack_require__( /*! ../../grids/grid_core/data_source_adapter/m_data_source_adapter */ 30945), obj && obj.__esModule ? obj : { default: obj }); var obj; let DataSourceAdapterType = _m_data_source_adapter.default; exports.default = { extend(extender) { DataSourceAdapterType = extender(DataSourceAdapterType) }, create: component => new DataSourceAdapterType(component) } }, 26949: /*!*************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/m_editing.js ***! \*************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { __webpack_require__( /*! ./module_not_extended/editor_factory */ 98125); var _m_editing = __webpack_require__( /*! ../../grids/grid_core/editing/m_editing */ 22324); var _m_core = (obj = __webpack_require__( /*! ./m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } _m_core.default.registerModule("editing", _extends({}, _m_editing.editingModule, { extenders: _extends({}, _m_editing.editingModule.extenders, { controllers: _extends({}, _m_editing.editingModule.extenders.controllers, { data: Base => class extends((0, _m_editing.dataControllerEditingExtenderMixin)(Base)) { _changeRowExpandCore(key) { const editingController = this._editingController; if (Array.isArray(key)) { editingController && editingController.refresh() } return super._changeRowExpandCore.apply(this, arguments) } } }) }) })) }, 10087: /*!***********************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/m_utils.js ***! \***********************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.createGroupFilter = function(path, storeLoadOptions) { const groups = (0, _utils.normalizeSortingInfo)(storeLoadOptions.group); const filter = []; for (let i = 0; i < path.length; i++) { filter.push([groups[i].selector, "=", path[i]]) } if (storeLoadOptions.filter) { filter.push(storeLoadOptions.filter) } return _m_utils.default.combineFilters(filter) }; var _utils = __webpack_require__( /*! ../../../data/utils */ 16454); var _m_utils = (obj = __webpack_require__( /*! ../../grids/grid_core/m_utils */ 60082), obj && obj.__esModule ? obj : { default: obj }); var obj }, 10590: /*!************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/m_widget.js ***! \************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _m_widget_base = (obj = __webpack_require__( /*! ./m_widget_base */ 26196), obj && obj.__esModule ? obj : { default: obj }); var obj; __webpack_require__( /*! ./module_not_extended/state_storing */ 97847); __webpack_require__( /*! ./module_not_extended/selection */ 86006); __webpack_require__( /*! ./module_not_extended/column_chooser */ 17663); __webpack_require__( /*! ./grouping/m_grouping */ 72487); __webpack_require__( /*! ./module_not_extended/master_detail */ 48190); __webpack_require__( /*! ./m_editing */ 26949); __webpack_require__( /*! ./module_not_extended/editing_row_based */ 42267); __webpack_require__( /*! ./module_not_extended/editing_form_based */ 94585); __webpack_require__( /*! ./module_not_extended/editing_cell_based */ 82831); __webpack_require__( /*! ./module_not_extended/validating */ 41430); __webpack_require__( /*! ./module_not_extended/virtual_scrolling */ 98726); __webpack_require__( /*! ./module_not_extended/filter_row */ 34622); __webpack_require__( /*! ./module_not_extended/header_filter */ 42595); __webpack_require__( /*! ./module_not_extended/filter_sync */ 66551); __webpack_require__( /*! ./module_not_extended/filter_builder */ 69566); __webpack_require__( /*! ./module_not_extended/filter_panel */ 76568); __webpack_require__( /*! ./module_not_extended/search */ 20015); __webpack_require__( /*! ./module_not_extended/pager */ 70608); __webpack_require__( /*! ./module_not_extended/columns_resizing_reordering */ 53489); __webpack_require__( /*! ./module_not_extended/keyboard_navigation */ 28294); __webpack_require__( /*! ./summary/m_summary */ 15180); __webpack_require__( /*! ./module_not_extended/column_fixing */ 68339); __webpack_require__( /*! ./module_not_extended/adaptivity */ 26098); __webpack_require__( /*! ./module_not_extended/virtual_columns */ 12470); __webpack_require__( /*! ./export/m_export */ 48252); __webpack_require__( /*! ./focus/m_focus */ 56445); __webpack_require__( /*! ./module_not_extended/row_dragging */ 445); exports.default = _m_widget_base.default }, 26196: /*!*****************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/m_widget_base.js ***! \*****************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; __webpack_require__( /*! ./module_not_extended/column_headers */ 90130); __webpack_require__( /*! ./m_columns_controller */ 96291); __webpack_require__( /*! ./m_data_controller */ 3263); __webpack_require__( /*! ./module_not_extended/sorting */ 10792); __webpack_require__( /*! ./module_not_extended/rows */ 86226); __webpack_require__( /*! ./module_not_extended/context_menu */ 74043); __webpack_require__( /*! ./module_not_extended/error_handling */ 46950); __webpack_require__( /*! ./module_not_extended/grid_view */ 24734); __webpack_require__( /*! ./module_not_extended/header_panel */ 63350); var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 99393)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374)); var _browser = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/browser */ 47810)); var _console = __webpack_require__( /*! ../../../core/utils/console */ 30869); var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306); var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922); var _themes = __webpack_require__( /*! ../../../ui/themes */ 75811); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../../grids/grid_core/m_utils */ 60082)); var _m_widget_base = _interopRequireDefault(__webpack_require__( /*! ../../grids/grid_core/m_widget_base */ 67880)); var _m_core = _interopRequireDefault(__webpack_require__( /*! ./m_core */ 74938)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } _m_core.default.registerModulesOrder(["stateStoring", "columns", "selection", "editorFactory", "columnChooser", "grouping", "editing", "editingRowBased", "editingFormBased", "editingCellBased", "masterDetail", "validating", "adaptivity", "data", "virtualScrolling", "columnHeaders", "filterRow", "headerPanel", "headerFilter", "sorting", "search", "rows", "pager", "columnsResizingReordering", "contextMenu", "keyboardNavigation", "errorHandling", "summary", "columnFixing", "export", "gridView"]); class DataGrid extends _m_widget_base.default { _defaultOptionsRules() { return super._defaultOptionsRules().concat([{ device: { platform: "ios" }, options: { showRowLines: true } }, { device: () => (0, _themes.isMaterialBased)(), options: { showRowLines: true, showColumnLines: false, headerFilter: { height: 315 }, editing: { useIcons: true }, selection: { showCheckBoxesMode: "always" } } }, { device: () => _browser.default.webkit, options: { loadingTimeout: 30, loadPanel: { animation: { show: { easing: "cubic-bezier(1, 0, 1, 0)", duration: 500, from: { opacity: 0 }, to: { opacity: 1 } } } } } }, { device: device => "desktop" !== device.deviceType, options: { grouping: { expandMode: "rowClick" } } }]) } _init() { super._init(); _m_utils.default.logHeaderFilterDeprecatedWarningIfNeed(this); _m_core.default.processModules(this, _m_core.default); _m_core.default.callModuleItemsMethod(this, "init") } _initMarkup() { super._initMarkup.apply(this, arguments); this.getView("gridView").render(this.$element()) } _setDeprecatedOptions() { super._setDeprecatedOptions(); (0, _extend.extend)(this._deprecatedOptions, { useKeyboard: { since: "19.2", alias: "keyboardNavigation.enabled" }, rowTemplate: { since: "21.2", message: 'Use the "dataRowTemplate" option instead' } }) } static registerModule(name, module) { _m_core.default.registerModule(name, module) } getGridCoreHelper() { return _m_core.default } _getTemplate(templateName) { let template = templateName; if ((0, _type.isString)(template) && template.startsWith("#")) { template = (0, _renderer.default)(templateName); _console.logger.warn("Specifying grid templates with the jQuery selector name is now deprecated. Use the DOM Node or the jQuery object that references this selector instead.") } return super._getTemplate(template) } focus(element) { this.getController("keyboardNavigation").focus(element) } }(0, _component_registrator.default)("dxDataGrid", DataGrid); exports.default = DataGrid }, 26098: /*!**********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/module_not_extended/adaptivity.js ***! \**********************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_adaptivity = __webpack_require__( /*! ../../../grids/grid_core/adaptivity/m_adaptivity */ 18107); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("adaptivity", _m_adaptivity.adaptivityModule) }, 17663: /*!**************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/module_not_extended/column_chooser.js ***! \**************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.ColumnChooserView = exports.ColumnChooserController = void 0; var _m_column_chooser = __webpack_require__( /*! ../../../grids/grid_core/column_chooser/m_column_chooser */ 71184); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; exports.ColumnChooserController = _m_column_chooser.columnChooserModule.controllers.columnChooser; exports.ColumnChooserView = _m_column_chooser.columnChooserModule.views.columnChooserView; _m_core.default.registerModule("columnChooser", _m_column_chooser.columnChooserModule) }, 68339: /*!*************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/module_not_extended/column_fixing.js ***! \*************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_column_fixing = __webpack_require__( /*! ../../../grids/grid_core/column_fixing/m_column_fixing */ 53424); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("columnFixing", _m_column_fixing.columnFixingModule) }, 90130: /*!**************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/module_not_extended/column_headers.js ***! \**************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.ColumnHeadersView = void 0; var _m_column_headers = __webpack_require__( /*! ../../../grids/grid_core/column_headers/m_column_headers */ 14509); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; exports.ColumnHeadersView = _m_column_headers.columnHeadersModule.views.columnHeadersView; _m_core.default.registerModule("columnHeaders", _m_column_headers.columnHeadersModule) }, 53489: /*!***************************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/module_not_extended/columns_resizing_reordering.js ***! \***************************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.TrackerView = exports.TablePositionViewController = exports.DraggingHeaderViewController = exports.DraggingHeaderView = exports.ColumnsSeparatorView = exports.ColumnsResizerViewController = void 0; var _m_columns_resizing_reordering = __webpack_require__( /*! ../../../grids/grid_core/columns_resizing_reordering/m_columns_resizing_reordering */ 49505); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; const DraggingHeaderView = exports.DraggingHeaderView = _m_columns_resizing_reordering.columnsResizingReorderingModule.views.draggingHeaderView; const DraggingHeaderViewController = exports.DraggingHeaderViewController = _m_columns_resizing_reordering.columnsResizingReorderingModule.controllers.draggingHeader; const ColumnsSeparatorView = exports.ColumnsSeparatorView = _m_columns_resizing_reordering.columnsResizingReorderingModule.views.columnsSeparatorView; const TablePositionViewController = exports.TablePositionViewController = _m_columns_resizing_reordering.columnsResizingReorderingModule.controllers.tablePosition; const ColumnsResizerViewController = exports.ColumnsResizerViewController = _m_columns_resizing_reordering.columnsResizingReorderingModule.controllers.columnsResizer; const TrackerView = exports.TrackerView = _m_columns_resizing_reordering.columnsResizingReorderingModule.views.trackerView; _m_core.default.registerModule("columnsResizingReordering", _m_columns_resizing_reordering.columnsResizingReorderingModule); exports.default = { DraggingHeaderView: DraggingHeaderView, DraggingHeaderViewController: DraggingHeaderViewController, ColumnsSeparatorView: ColumnsSeparatorView, TablePositionViewController: TablePositionViewController, ColumnsResizerViewController: ColumnsResizerViewController, TrackerView: TrackerView } }, 74043: /*!************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/module_not_extended/context_menu.js ***! \************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_context_menu = __webpack_require__( /*! ../../../grids/grid_core/context_menu/m_context_menu */ 69823); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("contextMenu", _m_context_menu.contextMenuModule) }, 82831: /*!******************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/module_not_extended/editing_cell_based.js ***! \******************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_editing_cell_based = __webpack_require__( /*! ../../../grids/grid_core/editing/m_editing_cell_based */ 68802); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("editingCellBased", _m_editing_cell_based.editingCellBasedModule) }, 94585: /*!******************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/module_not_extended/editing_form_based.js ***! \******************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_editing_form_based = __webpack_require__( /*! ../../../grids/grid_core/editing/m_editing_form_based */ 99211); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("editingFormBased", _m_editing_form_based.editingFormBasedModule) }, 42267: /*!*****************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/module_not_extended/editing_row_based.js ***! \*****************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_editing_row_based = __webpack_require__( /*! ../../../grids/grid_core/editing/m_editing_row_based */ 55597); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("editingRowBased", _m_editing_row_based.editingRowBasedModule) }, 98125: /*!**************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/module_not_extended/editor_factory.js ***! \**************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_editor_factory = __webpack_require__( /*! ../../../grids/grid_core/editor_factory/m_editor_factory */ 80070); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("editorFactory", _m_editor_factory.editorFactoryModule) }, 46950: /*!**************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/module_not_extended/error_handling.js ***! \**************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_error_handling = __webpack_require__( /*! ../../../grids/grid_core/error_handling/m_error_handling */ 31152); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("errorHandling", _m_error_handling.errorHandlingModule) }, 69566: /*!**************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/module_not_extended/filter_builder.js ***! \**************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_filter_builder = __webpack_require__( /*! ../../../grids/grid_core/filter/m_filter_builder */ 62690); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("filterBuilder", _m_filter_builder.filterBuilderModule) }, 76568: /*!************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/module_not_extended/filter_panel.js ***! \************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_filter_panel = __webpack_require__( /*! ../../../grids/grid_core/filter/m_filter_panel */ 4062); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("filterPanel", _m_filter_panel.filterPanelModule) }, 34622: /*!**********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/module_not_extended/filter_row.js ***! \**********************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_filter_row = __webpack_require__( /*! ../../../grids/grid_core/filter/m_filter_row */ 12302); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("filterRow", _m_filter_row.filterRowModule) }, 66551: /*!***********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/module_not_extended/filter_sync.js ***! \***********************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_filter_sync = __webpack_require__( /*! ../../../grids/grid_core/filter/m_filter_sync */ 14407); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("filterSync", _m_filter_sync.filterSyncModule) }, 24734: /*!*********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/module_not_extended/grid_view.js ***! \*********************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_grid_view = __webpack_require__( /*! ../../../grids/grid_core/views/m_grid_view */ 28016); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("gridView", _m_grid_view.gridViewModule) }, 42595: /*!*************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/module_not_extended/header_filter.js ***! \*************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_header_filter = __webpack_require__( /*! ../../../grids/grid_core/header_filter/m_header_filter */ 68796); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("headerFilter", _m_header_filter.headerFilterModule) }, 63350: /*!************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/module_not_extended/header_panel.js ***! \************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.HeaderPanel = void 0; var _m_header_panel = __webpack_require__( /*! ../../../grids/grid_core/header_panel/m_header_panel */ 92468); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; exports.HeaderPanel = _m_header_panel.headerPanelModule.views.headerPanel; _m_core.default.registerModule("headerPanel", _m_header_panel.headerPanelModule) }, 28294: /*!*******************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/module_not_extended/keyboard_navigation.js ***! \*******************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_keyboard_navigation = __webpack_require__( /*! ../../../grids/grid_core/keyboard_navigation/m_keyboard_navigation */ 31822); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("keyboardNavigation", _m_keyboard_navigation.keyboardNavigationModule) }, 48190: /*!*************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/module_not_extended/master_detail.js ***! \*************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_master_detail = __webpack_require__( /*! ../../../grids/grid_core/master_detail/m_master_detail */ 82802); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("masterDetail", _m_master_detail.masterDetailModule) }, 70608: /*!*****************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/module_not_extended/pager.js ***! \*****************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_pager = __webpack_require__( /*! ../../../grids/grid_core/pager/m_pager */ 3990); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("pager", _m_pager.pagerModule) }, 445: /*!************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/module_not_extended/row_dragging.js ***! \************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_row_dragging = __webpack_require__( /*! ../../../grids/grid_core/row_dragging/m_row_dragging */ 88351); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("rowDragging", _m_row_dragging.rowDraggingModule) }, 86226: /*!****************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/module_not_extended/rows.js ***! \****************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.RowsView = void 0; var _m_rows_view = __webpack_require__( /*! ../../../grids/grid_core/views/m_rows_view */ 35095); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; exports.RowsView = _m_rows_view.rowsModule.views.rowsView; _m_core.default.registerModule("rows", _m_rows_view.rowsModule) }, 20015: /*!******************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/module_not_extended/search.js ***! \******************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_search = __webpack_require__( /*! ../../../grids/grid_core/search/m_search */ 92021); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("search", _m_search.searchModule) }, 86006: /*!*********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/module_not_extended/selection.js ***! \*********************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_selection = __webpack_require__( /*! ../../../grids/grid_core/selection/m_selection */ 17969); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("selection", _m_selection.selectionModule) }, 10792: /*!*******************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/module_not_extended/sorting.js ***! \*******************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_sorting = __webpack_require__( /*! ../../../grids/grid_core/sorting/m_sorting */ 11590); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("sorting", _m_sorting.sortingModule) }, 97847: /*!*************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/module_not_extended/state_storing.js ***! \*************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_state_storing = __webpack_require__( /*! ../../../grids/grid_core/state_storing/m_state_storing */ 12440); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("stateStoring", _m_state_storing.stateStoringModule) }, 41430: /*!**********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/module_not_extended/validating.js ***! \**********************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_validating = __webpack_require__( /*! ../../../grids/grid_core/validating/m_validating */ 39830); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("validating", _m_validating.validatingModule) }, 12470: /*!***************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/module_not_extended/virtual_columns.js ***! \***************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_virtual_columns = __webpack_require__( /*! ../../../grids/grid_core/virtual_columns/m_virtual_columns */ 87482); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 74938), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("virtualColumns", _m_virtual_columns.virtualColumnsModule) }, 98726: /*!*****************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/module_not_extended/virtual_scrolling.js ***! \*****************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_virtual_scrolling = __webpack_require__( /*! ../../../grids/grid_core/virtual_scrolling/m_virtual_scrolling */ 92018); var _m_core = _interopRequireDefault(__webpack_require__( /*! ../m_core */ 74938)); var _m_data_source_adapter = _interopRequireDefault(__webpack_require__( /*! ../m_data_source_adapter */ 49975)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } _m_core.default.registerModule("virtualScrolling", _m_virtual_scrolling.virtualScrollingModule); _m_data_source_adapter.default.extend(_m_virtual_scrolling.dataSourceAdapterExtender) }, 15180: /*!*********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/data_grid/summary/m_summary.js ***! \*********************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.renderSummaryCell = exports.FooterView = void 0; var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _data = __webpack_require__( /*! ../../../../core/utils/data */ 47617); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _query = _interopRequireDefault(__webpack_require__( /*! ../../../../data/query */ 96687)); var _store_helper = _interopRequireDefault(__webpack_require__( /*! ../../../../data/store_helper */ 99236)); var _utils = __webpack_require__( /*! ../../../../data/utils */ 16454); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109)); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/widget/ui.errors */ 96688)); var _m_columns_view = __webpack_require__( /*! ../../../grids/grid_core/views/m_columns_view */ 57318); var _m_aggregate_calculator = _interopRequireDefault(__webpack_require__( /*! ../m_aggregate_calculator */ 29593)); var _m_core = _interopRequireDefault(__webpack_require__( /*! ../m_core */ 74938)); var _m_data_source_adapter = _interopRequireDefault(__webpack_require__( /*! ../m_data_source_adapter */ 49975)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const renderSummaryCell = function(cell, options) { const $cell = (0, _renderer.default)(cell); const { column: column } = options; const { summaryItems: summaryItems } = options; const $summaryItems = []; if (!column.command && summaryItems) { for (let i = 0; i < summaryItems.length; i++) { const summaryItem = summaryItems[i]; const text = _m_core.default.getSummaryText(summaryItem, options.summaryTexts); $summaryItems.push((0, _renderer.default)("
").css("textAlign", summaryItem.alignment || column.alignment).addClass("dx-datagrid-summary-item").addClass("dx-datagrid-text-content").addClass(summaryItem.cssClass).toggleClass("dx-datagrid-group-text-content", "group" === options.rowType).text(text).attr("aria-label", `${column.caption} ${text}`)) } $cell.append($summaryItems) } }; exports.renderSummaryCell = renderSummaryCell; const getSummaryCellOptions = function(that, options) { const summaryTexts = that.option("summary.texts") || {}; return { totalItem: options.row, summaryItems: options.row.summaryCells[options.columnIndex], summaryTexts: summaryTexts } }; const getGroupAggregates = function(data) { return data.summary || data.aggregates || [] }; const recalculateWhileEditing = function(that) { return that.option("summary.recalculateWhileEditing") }; const forEachGroup = function(groups, groupCount, callback, path) { path = path || []; for (let i = 0; i < groups.length; i++) { path.push(groups[i].key); if (1 === groupCount) { callback(path, groups[i].items) } else { forEachGroup(groups[i].items, groupCount - 1, callback, path) } path.pop() } }; const applyAddedData = function(data, insertedData, groupLevel) { if (groupLevel) { return applyAddedData(data, insertedData.map((item => ({ items: [item] })), groupLevel - 1)) } return data.concat(insertedData) }; const applyRemovedData = function(data, removedData, groupLevel) { if (groupLevel) { return data.map((data => { const updatedData = {}; const updatedItems = applyRemovedData(data.items || [], removedData, groupLevel - 1); Object.defineProperty(updatedData, "aggregates", { get: () => data.aggregates, set: value => { data.aggregates = value } }); return (0, _extend.extend)(updatedData, data, { items: updatedItems }) })) } return data.filter((data => removedData.indexOf(data) < 0)) }; const sortGroupsBySummaryCore = function(items, groups, sortByGroups) { if (!items || !groups.length) { return items } const group = groups[0]; const sorts = sortByGroups[0]; let query; if (group && sorts && sorts.length) { query = (0, _query.default)(items); (0, _iterator.each)(sorts, (function(index) { if (0 === index) { query = query.sortBy(this.selector, this.desc) } else { query = query.thenBy(this.selector, this.desc) } })); query.enumerate().done((sortedItems => { items = sortedItems })) } groups = groups.slice(1); sortByGroups = sortByGroups.slice(1); if (groups.length && sortByGroups.length) { (0, _iterator.each)(items, (function() { this.items = sortGroupsBySummaryCore(this.items, groups, sortByGroups) })) } return items }; const sortGroupsBySummary = function(data, group, summary) { const sortByGroups = summary && summary.sortByGroups && summary.sortByGroups(); if (sortByGroups && sortByGroups.length) { return sortGroupsBySummaryCore(data, group, sortByGroups) } return data }; const calculateAggregates = function(that, summary, data, groupLevel) { let calculator; if (recalculateWhileEditing(that)) { const editingController = that._editingController; if (editingController) { const insertedData = editingController.getInsertedData(); if (insertedData.length) { data = applyAddedData(data, insertedData, groupLevel) } const removedData = editingController.getRemovedData(); if (removedData.length) { data = applyRemovedData(data, removedData, groupLevel) } } } if (summary) { calculator = new _m_aggregate_calculator.default({ totalAggregates: summary.totalAggregates, groupAggregates: summary.groupAggregates, data: data, groupLevel: groupLevel }); calculator.calculate() } return calculator ? calculator.totalAggregates() : [] }; class FooterView extends _m_columns_view.ColumnsView { _getRows() { return this._dataController.footerItems() } _getCellOptions(options) { return (0, _extend.extend)(super._getCellOptions(options), getSummaryCellOptions(this, options)) } _renderCellContent($cell, options) { renderSummaryCell($cell, options); super._renderCellContent.apply(this, arguments) } _renderCore(change) { let needUpdateScrollLeft = false; const totalItem = this._dataController.footerItems()[0]; if (!change || !change.columnIndices) { this.element().empty().addClass("dx-datagrid-total-footer").toggleClass("dx-datagrid-nowrap", !this.option("wordWrapEnabled")); needUpdateScrollLeft = true } if (totalItem && totalItem.summaryCells && totalItem.summaryCells.length) { this._updateContent(this._renderTable({ change: change }), change); needUpdateScrollLeft && this._updateScrollLeftPosition() } } _updateContent($newTable, change) { if (change && "update" === change.changeType && change.columnIndices) { return this.waitAsyncTemplates().done((() => { const $row = this.getTableElement().find(".dx-row"); const $newRow = $newTable.find(".dx-row"); this._updateCells($row, $newRow, change.columnIndices[0]) })) } return super._updateContent.apply(this, arguments) } _rowClick(e) { const item = this._dataController.footerItems()[e.rowIndex] || {}; this.executeAction("onRowClick", (0, _extend.extend)({}, e, item)) } _columnOptionChanged(e) { const { optionNames: optionNames } = e; if (e.changeTypes.grouping) { return } if (optionNames.width || optionNames.visibleWidth) { super._columnOptionChanged(e) } } _handleDataChanged(e) { const { changeType: changeType } = e; if ("update" === e.changeType && e.repaintChangesOnly) { if (!e.totalColumnIndices) { this.render() } else if (e.totalColumnIndices.length) { this.render(null, { changeType: "update", columnIndices: [e.totalColumnIndices] }) } } else if ("refresh" === changeType || "append" === changeType || "prepend" === changeType) { this.render() } } _createRow(row) { const $row = super._createRow.apply(this, arguments); if ("totalFooter" === row.rowType) { $row.addClass("dx-footer-row"); $row.addClass("dx-cell-focus-disabled"); $row.attr("tabindex", 0) } return $row } getHeight() { return this.getElementHeight() } isVisible() { return !!this._dataController.footerItems().length } } exports.FooterView = FooterView; _m_data_source_adapter.default.extend((Base => class extends Base { init() { super.init.apply(this, arguments); this._editingController = this.getController("editing"); this._totalAggregates = []; this._summaryGetter = _common.noop } summaryGetter(summaryGetter) { if (!arguments.length) { return this._summaryGetter } if ((0, _type.isFunction)(summaryGetter)) { this._summaryGetter = summaryGetter } } summary(summary) { if (!arguments.length) { return this._summaryGetter() } this._summaryGetter = function() { return summary } } totalAggregates() { return this._totalAggregates } isLastLevelGroupItemsPagingLocal() { const summary = this.summary(); const sortByGroupsInfo = null === summary || void 0 === summary ? void 0 : summary.sortByGroups(); return null === sortByGroupsInfo || void 0 === sortByGroupsInfo ? void 0 : sortByGroupsInfo.length } sortLastLevelGroupItems(items, groups, paths) { const groupedItems = _store_helper.default.multiLevelGroup((0, _query.default)(items), groups).toArray(); let result = []; paths.forEach((path => { forEachGroup(groupedItems, groups.length, ((itemsPath, items) => { if (path.toString() === itemsPath.toString()) { result = result.concat(items) } })) })); return result } _customizeRemoteOperations(options) { const summary = this.summary(); if (summary) { if (options.remoteOperations.summary) { if (!options.isCustomLoading || options.storeLoadOptions.isLoadingAll) { if (options.storeLoadOptions.group) { if (options.remoteOperations.grouping) { options.storeLoadOptions.groupSummary = summary.groupAggregates } else if (summary.groupAggregates.length) { options.remoteOperations.paging = false } } options.storeLoadOptions.totalSummary = summary.totalAggregates } } else if (summary.totalAggregates.length || summary.groupAggregates.length && options.storeLoadOptions.group) { options.remoteOperations.paging = false } } super._customizeRemoteOperations.apply(this, arguments); const cachedExtra = options.cachedData.extra; if (null !== cachedExtra && void 0 !== cachedExtra && cachedExtra.summary && !options.isCustomLoading) { options.storeLoadOptions.totalSummary = void 0 } } _handleDataLoadedCore(options) { const groups = (0, _utils.normalizeSortingInfo)(options.storeLoadOptions.group || options.loadOptions.group || []); const remoteOperations = options.remoteOperations || {}; const summary = this.summaryGetter()(remoteOperations); if (!options.isCustomLoading || options.storeLoadOptions.isLoadingAll) { if (remoteOperations.summary) { if (!remoteOperations.paging && groups.length && summary) { if (!remoteOperations.grouping) { calculateAggregates(this, { groupAggregates: summary.groupAggregates }, options.data, groups.length) } options.data = sortGroupsBySummary(options.data, groups, summary) } } else if (!remoteOperations.paging && summary) { var _options$cachedData; const operationTypes = options.operationTypes || {}; const hasOperations = Object.keys(operationTypes).some((type => operationTypes[type])); if (!hasOperations || !(null !== (_options$cachedData = options.cachedData) && void 0 !== _options$cachedData && null !== (_options$cachedData = _options$cachedData.extra) && void 0 !== _options$cachedData && _options$cachedData.summary) || groups.length && summary.groupAggregates.length) { const totalAggregates = calculateAggregates(this, summary, options.data, groups.length); options.extra = (0, _type.isPlainObject)(options.extra) ? options.extra : {}; options.extra.summary = totalAggregates; if (options.cachedData) { options.cachedData.extra = options.extra } } options.data = sortGroupsBySummary(options.data, groups, summary) } } if (!options.isCustomLoading) { this._totalAggregates = options.extra && options.extra.summary || this._totalAggregates } super._handleDataLoadedCore(options) } })); _m_core.default.registerModule("summary", { defaultOptions: () => ({ summary: { groupItems: void 0, totalItems: void 0, calculateCustomSummary: void 0, skipEmptyValues: true, recalculateWhileEditing: false, texts: { sum: _message.default.format("dxDataGrid-summarySum"), sumOtherColumn: _message.default.format("dxDataGrid-summarySumOtherColumn"), min: _message.default.format("dxDataGrid-summaryMin"), minOtherColumn: _message.default.format("dxDataGrid-summaryMinOtherColumn"), max: _message.default.format("dxDataGrid-summaryMax"), maxOtherColumn: _message.default.format("dxDataGrid-summaryMaxOtherColumn"), avg: _message.default.format("dxDataGrid-summaryAvg"), avgOtherColumn: _message.default.format("dxDataGrid-summaryAvgOtherColumn"), count: _message.default.format("dxDataGrid-summaryCount") } }, sortByGroupSummaryInfo: void 0 }), views: { footerView: FooterView }, extenders: { controllers: { data: Base => class extends Base { _isDataColumn(column) { return column && (!(0, _type.isDefined)(column.groupIndex) || column.showWhenGrouped) } _isGroupFooterVisible() { const groupItems = this.option("summary.groupItems") || []; for (let i = 0; i < groupItems.length; i++) { const groupItem = groupItems[i]; const column = this._columnsController.columnOption(groupItem.showInColumn || groupItem.column); if (groupItem.showInGroupFooter && this._isDataColumn(column)) { return true } } return false } _processGroupItems(items, groupCount, options) { const data = options && options.data; const result = super._processGroupItems.apply(this, arguments); if (options) { if (void 0 === options.isGroupFooterVisible) { options.isGroupFooterVisible = this._isGroupFooterVisible() } if (data && data.items && options.isGroupFooterVisible && (options.collectContinuationItems || !data.isContinuationOnNextPage)) { result.push({ rowType: "groupFooter", key: options.path.slice(), data: data, groupIndex: options.path.length - 1, values: [] }) } } return result } _processGroupItem(groupItem, options) { const that = this; if (!options.summaryGroupItems) { options.summaryGroupItems = that.option("summary.groupItems") || [] } if ("group" === groupItem.rowType) { let groupColumnIndex = -1; let afterGroupColumnIndex = -1; (0, _iterator.each)(options.visibleColumns, (function(visibleIndex) { const prevColumn = options.visibleColumns[visibleIndex - 1]; if (groupItem.groupIndex === this.groupIndex) { groupColumnIndex = this.index } if (visibleIndex > 0 && "expand" === prevColumn.command && "expand" !== this.command) { afterGroupColumnIndex = this.index } })); groupItem.summaryCells = this._calculateSummaryCells(options.summaryGroupItems, getGroupAggregates(groupItem.data), options.visibleColumns, ((summaryItem, column) => { if (summaryItem.showInGroupFooter) { return -1 } if (summaryItem.alignByColumn && column && !(0, _type.isDefined)(column.groupIndex) && column.index !== afterGroupColumnIndex) { return column.index } return groupColumnIndex }), true) } if ("groupFooter" === groupItem.rowType) { groupItem.summaryCells = this._calculateSummaryCells(options.summaryGroupItems, getGroupAggregates(groupItem.data), options.visibleColumns, ((summaryItem, column) => summaryItem.showInGroupFooter && that._isDataColumn(column) ? column.index : -1)) } return groupItem } _calculateSummaryCells(summaryItems, aggregates, visibleColumns, calculateTargetColumnIndex, isGroupRow) { const that = this; const summaryCells = []; const summaryCellsByColumns = {}; (0, _iterator.each)(summaryItems, ((summaryIndex, summaryItem) => { const column = that._columnsController.columnOption(summaryItem.column); const showInColumn = summaryItem.showInColumn && that._columnsController.columnOption(summaryItem.showInColumn) || column; const columnIndex = calculateTargetColumnIndex(summaryItem, showInColumn); if (columnIndex >= 0) { if (!summaryCellsByColumns[columnIndex]) { summaryCellsByColumns[columnIndex] = [] } const aggregate = aggregates[summaryIndex]; if (aggregate === aggregate) { let valueFormat; if ((0, _type.isDefined)(summaryItem.valueFormat)) { valueFormat = summaryItem.valueFormat } else if ("count" !== summaryItem.summaryType) { valueFormat = _m_core.default.getFormatByDataType(column && column.dataType) } summaryCellsByColumns[columnIndex].push((0, _extend.extend)({}, summaryItem, { value: (0, _type.isString)(aggregate) && column && column.deserializeValue ? column.deserializeValue(aggregate) : aggregate, valueFormat: valueFormat, columnCaption: column && column.index !== columnIndex ? column.caption : void 0 })) } } })); if (!(0, _type.isEmptyObject)(summaryCellsByColumns)) { visibleColumns.forEach(((column, visibleIndex) => { const prevColumn = visibleColumns[visibleIndex - 1]; const columnIndex = isGroupRow && ("expand" === (null === prevColumn || void 0 === prevColumn ? void 0 : prevColumn.command) || "expand" === column.command) ? null === prevColumn || void 0 === prevColumn ? void 0 : prevColumn.index : column.index; summaryCells.push(summaryCellsByColumns[columnIndex] || []) })) } return summaryCells } _getSummaryCells(summaryTotalItems, totalAggregates) { const that = this; const columnsController = that._columnsController; return that._calculateSummaryCells(summaryTotalItems, totalAggregates, columnsController.getVisibleColumns(), ((summaryItem, column) => that._isDataColumn(column) ? column.index : -1)) } _updateItemsCore(change) { const that = this; let summaryCells; const dataSource = that._dataSource; const footerItems = that._footerItems; const oldSummaryCells = footerItems && footerItems[0] && footerItems[0].summaryCells; const summaryTotalItems = that.option("summary.totalItems"); that._footerItems = []; if (dataSource && summaryTotalItems && summaryTotalItems.length) { const totalAggregates = dataSource.totalAggregates(); summaryCells = that._getSummaryCells(summaryTotalItems, totalAggregates); if (change && change.repaintChangesOnly && oldSummaryCells) { change.totalColumnIndices = summaryCells.map(((summaryCell, index) => { if (JSON.stringify(summaryCell) !== JSON.stringify(oldSummaryCells[index])) { return index } return -1 })).filter((index => index >= 0)) } if (summaryCells.length) { that._footerItems.push({ rowType: "totalFooter", summaryCells: summaryCells }) } } super._updateItemsCore(change) } _prepareUnsavedDataSelector(selector) { if (recalculateWhileEditing(this)) { const editingController = this._editingController; if (editingController) { return function(data) { data = editingController.getUpdatedData(data); return selector(data) } } } return selector } _prepareAggregateSelector(selector, aggregator) { selector = this._prepareUnsavedDataSelector(selector); if ("avg" === aggregator || "sum" === aggregator) { return function(data) { const value = selector(data); return (0, _type.isDefined)(value) ? Number(value) : value } } return selector } _getAggregates(summaryItems, remoteOperations) { const that = this; let calculateCustomSummary = that.option("summary.calculateCustomSummary"); const commonSkipEmptyValues = that.option("summary.skipEmptyValues"); return (0, _iterator.map)(summaryItems || [], (summaryItem => { const column = this._columnsController.columnOption(summaryItem.column); const calculateCellValue = column && column.calculateCellValue ? column.calculateCellValue.bind(column) : (0, _data.compileGetter)(column ? column.dataField : summaryItem.column); let aggregator = summaryItem.summaryType || "count"; const skipEmptyValues = (0, _type.isDefined)(summaryItem.skipEmptyValues) ? summaryItem.skipEmptyValues : commonSkipEmptyValues; if (remoteOperations) { return { selector: summaryItem.column, summaryType: aggregator } } const selector = that._prepareAggregateSelector(calculateCellValue, aggregator); if ("custom" === aggregator) { if (!calculateCustomSummary) { _ui.default.log("E1026"); calculateCustomSummary = function() {} } const options = { component: that.component, name: summaryItem.name }; calculateCustomSummary(options); options.summaryProcess = "calculate"; aggregator = { seed(groupIndex) { options.summaryProcess = "start"; options.totalValue = void 0; options.groupIndex = groupIndex; delete options.value; calculateCustomSummary(options); return options.totalValue }, step(totalValue, value) { options.summaryProcess = "calculate"; options.totalValue = totalValue; options.value = value; calculateCustomSummary(options); return options.totalValue }, finalize(totalValue) { options.summaryProcess = "finalize"; options.totalValue = totalValue; delete options.value; calculateCustomSummary(options); return options.totalValue } } } return { selector: selector, aggregator: aggregator, skipEmptyValues: skipEmptyValues } })) } _addSortInfo(sortByGroups, groupColumn, selector, sortOrder) { if (groupColumn) { const { groupIndex: groupIndex } = groupColumn; sortOrder = sortOrder || groupColumn.sortOrder; if ((0, _type.isDefined)(groupIndex)) { sortByGroups[groupIndex] = sortByGroups[groupIndex] || []; sortByGroups[groupIndex].push({ selector: selector, desc: "desc" === sortOrder }) } } } _findSummaryItem(summaryItems, name) { let summaryItemIndex = -1; if ((0, _type.isDefined)(name)) { (0, _iterator.each)(summaryItems || [], (function(index) { if (this.name === name || index === name || this.summaryType === name || this.column === name || function(summaryItem) { const { summaryType: summaryType } = summaryItem; const { column: column } = summaryItem; return summaryType && column && `${summaryType}_${column}` }(this) === name) { summaryItemIndex = index; return false } })) } return summaryItemIndex } _getSummarySortByGroups(sortByGroupSummaryInfo, groupSummaryItems) { const that = this; const columnsController = that._columnsController; const groupColumns = columnsController.getGroupColumns(); const sortByGroups = []; if (!groupSummaryItems || !groupSummaryItems.length) { return }(0, _iterator.each)(sortByGroupSummaryInfo || [], (function() { const { sortOrder: sortOrder } = this; let { groupColumn: groupColumn } = this; const summaryItemIndex = that._findSummaryItem(groupSummaryItems, this.summaryItem); if (summaryItemIndex < 0) { return } const selector = function(data) { return getGroupAggregates(data)[summaryItemIndex] }; if ((0, _type.isDefined)(groupColumn)) { groupColumn = columnsController.columnOption(groupColumn); that._addSortInfo(sortByGroups, groupColumn, selector, sortOrder) } else { (0, _iterator.each)(groupColumns, ((groupIndex, groupColumn) => { that._addSortInfo(sortByGroups, groupColumn, selector, sortOrder) })) } })); return sortByGroups } _createDataSourceAdapterCore(dataSource, remoteOperations) { const that = this; const dataSourceAdapter = super._createDataSourceAdapterCore(dataSource, remoteOperations); dataSourceAdapter.summaryGetter((currentRemoteOperations => that._getSummaryOptions(currentRemoteOperations || remoteOperations))); return dataSourceAdapter } _getSummaryOptions(remoteOperations) { const that = this; const groupSummaryItems = that.option("summary.groupItems"); const totalSummaryItems = that.option("summary.totalItems"); const sortByGroupSummaryInfo = that.option("sortByGroupSummaryInfo"); const groupAggregates = that._getAggregates(groupSummaryItems, remoteOperations && remoteOperations.grouping && remoteOperations.summary); const totalAggregates = that._getAggregates(totalSummaryItems, remoteOperations && remoteOperations.summary); const sortByGroups = function() { return that._getSummarySortByGroups(sortByGroupSummaryInfo, groupSummaryItems) }; if (groupAggregates.length || totalAggregates.length) { return { groupAggregates: groupAggregates, totalAggregates: totalAggregates, sortByGroups: sortByGroups } } return } publicMethods() { const methods = super.publicMethods(); methods.push("getTotalSummaryValue"); return methods } getTotalSummaryValue(summaryItemName) { const summaryItemIndex = this._findSummaryItem(this.option("summary.totalItems"), summaryItemName); const aggregates = this._dataSource.totalAggregates(); if (aggregates.length && summaryItemIndex > -1) { return aggregates[summaryItemIndex] } } optionChanged(args) { if ("summary" === args.name || "sortByGroupSummaryInfo" === args.name) { args.name = "dataSource" } super.optionChanged(args) } init() { this._footerItems = []; super.init() } footerItems() { return this._footerItems } }, editing: Base => class extends Base { _refreshSummary() { if (recalculateWhileEditing(this) && !this.isSaving()) { this._dataController.refresh({ load: true, changesOnly: true }) } } _addChange(params) { const result = super._addChange.apply(this, arguments); if (params.type) { this._refreshSummary() } return result } _removeChange() { const result = super._removeChange.apply(this, arguments); this._refreshSummary(); return result } cancelEditData() { const result = super.cancelEditData.apply(this, arguments); this._refreshSummary(); return result } } }, views: { rowsView: Base => class extends Base { _createRow(row) { const $row = super._createRow.apply(this, arguments); row && $row.addClass("groupFooter" === row.rowType ? "dx-datagrid-group-footer" : ""); return $row } _renderCells($row, options) { super._renderCells.apply(this, arguments); if ("group" === options.row.rowType && options.row.summaryCells && options.row.summaryCells.length) { this._renderGroupSummaryCells($row, options) } } _hasAlignByColumnSummaryItems(columnIndex, options) { return !(0, _type.isDefined)(options.columns[columnIndex].groupIndex) && options.row.summaryCells[columnIndex].length } _getAlignByColumnCellCount(groupCellColSpan, options) { let alignByColumnCellCount = 0; for (let i = 1; i < groupCellColSpan; i++) { const columnIndex = options.row.summaryCells.length - i; alignByColumnCellCount = this._hasAlignByColumnSummaryItems(columnIndex, options) ? i : alignByColumnCellCount } return alignByColumnCellCount } _renderGroupSummaryCells($row, options) { const $groupCell = $row.children().last(); const groupCellColSpan = Number($groupCell.attr("colSpan")) || 1; const alignByColumnCellCount = this._getAlignByColumnCellCount(groupCellColSpan, options); this._renderGroupSummaryCellsCore($groupCell, options, groupCellColSpan, alignByColumnCellCount) } _renderGroupSummaryCellsCore($groupCell, options, groupCellColSpan, alignByColumnCellCount) { if (alignByColumnCellCount > 0) { $groupCell.attr("colSpan", groupCellColSpan - alignByColumnCellCount); for (let i = 0; i < alignByColumnCellCount; i++) { const columnIndex = options.columns.length - alignByColumnCellCount + i; this._renderCell($groupCell.parent(), (0, _extend.extend)({ column: options.columns[columnIndex], columnIndex: this._getSummaryCellIndex(columnIndex, options.columns) }, options)) } } } _getSummaryCellIndex(columnIndex, columns) { return columnIndex } _getCellTemplate(options) { if (!options.column.command && !(0, _type.isDefined)(options.column.groupIndex) && options.summaryItems && options.summaryItems.length) { return renderSummaryCell } return super._getCellTemplate(options) } _getCellOptions(options) { const that = this; const parameters = super._getCellOptions(options); if (options.row.summaryCells) { return (0, _extend.extend)(parameters, getSummaryCellOptions(that, options)) } return parameters } } } } }) }, 18107: /*!***************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/adaptivity/m_adaptivity.js ***! \***************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.adaptivityModule = exports.AdaptiveColumnsController = void 0; var _guid = _interopRequireDefault(__webpack_require__( /*! ../../../../core/guid */ 73176)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _dom = __webpack_require__( /*! ../../../../core/utils/dom */ 3532); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _size = __webpack_require__( /*! ../../../../core/utils/size */ 58664); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _click = __webpack_require__( /*! ../../../../events/click */ 95429); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../../events/core/events_engine */ 55994)); var _remove = __webpack_require__( /*! ../../../../events/remove */ 29007); var _index = __webpack_require__( /*! ../../../../events/utils/index */ 39611); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109)); var _form = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/form */ 17737)); var _themes = __webpack_require__( /*! ../../../../ui/themes */ 75811); var _m_modules = _interopRequireDefault(__webpack_require__( /*! ../m_modules */ 15943)); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../m_utils */ 60082)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const COLUMN_VIEWS = ["columnHeadersView", "rowsView", "footerView"]; function getColumnId(that, column) { return that._columnsController.getColumnId(column) } function adaptiveCellTemplate(container, options) { let $adaptiveColumnButton; const $container = (0, _renderer.default)(container); const adaptiveColumnsController = options.component.getController("adaptiveColumns"); if ("data" === options.rowType) { $adaptiveColumnButton = (0, _renderer.default)("").addClass(adaptiveColumnsController.addWidgetPrefix("adaptive-more")); _events_engine.default.on($adaptiveColumnButton, (0, _index.addNamespace)(_click.name, "dxDataGridAdaptivity"), adaptiveColumnsController.createAction((() => { adaptiveColumnsController.toggleExpandAdaptiveDetailRow(options.key) }))); $adaptiveColumnButton.appendTo($container) } else { _m_utils.default.setEmptyText($container) } } function focusCellHandler(e) { var _e$data; const $nextCell = null === (_e$data = e.data) || void 0 === _e$data ? void 0 : _e$data.$nextCell; _events_engine.default.off($nextCell, "focus", focusCellHandler); _events_engine.default.trigger($nextCell, "dxclick") } class AdaptiveColumnsController extends _m_modules.default.ViewController { init() { this._columnsController = this.getController("columns"); this._dataController = this.getController("data"); this._editingController = this.getController("editing"); this._keyboardNavigationController = this.getController("keyboardNavigation"); this._rowsView = this.getView("rowsView"); this._columnsController.addCommandColumn({ type: "adaptive", command: "adaptive", visible: true, adaptiveHidden: true, cssClass: "dx-command-adaptive", alignment: "center", width: "auto", cellTemplate: adaptiveCellTemplate, fixedPosition: "right" }); this._columnsController.columnsChanged.add((() => { const isAdaptiveVisible = !!this.updateHidingQueue(this._columnsController.getColumns()).length; this._columnsController.columnOption("command:adaptive", "adaptiveHidden", !isAdaptiveVisible, true) })); this._hidingColumnsQueue = []; this._hiddenColumns = []; this.createAction("onAdaptiveDetailRowPreparing"); super.init() } optionChanged(args) { if ("columnHidingEnabled" === args.name) { this._columnsController.columnOption("command:adaptive", "adaptiveHidden", !args.value) } super.optionChanged(args) } publicMethods() { return ["isAdaptiveDetailRowExpanded", "expandAdaptiveDetailRow", "collapseAdaptiveDetailRow"] } _isRowEditMode() { const editMode = this._getEditMode(); return "row" === editMode } _isItemModified(item, cellOptions) { const columnIndex = this._columnsController.getVisibleIndex(item.column.index); const rowIndex = this._dataController.getRowIndexByKey(cellOptions.key); const row = this._dataController.items()[rowIndex + 1]; return row && row.modifiedValues && (0, _type.isDefined)(row.modifiedValues[columnIndex]) } _renderFormViewTemplate(item, cellOptions, $container) { const that = this; const { column: column } = item; const focusAction = that.createAction((() => { if (that._editingController.isEditing()) { _events_engine.default.trigger($container, _click.name) } })); const rowData = cellOptions.row.data; const value = column.calculateCellValue(rowData); const displayValue = _m_utils.default.getDisplayValue(column, value, rowData, cellOptions.rowType); const text = _m_utils.default.formatValue(displayValue, column); const isCellOrBatchEditMode = this._editingController.isCellOrBatchEditMode(); const rowsView = that._rowsView; if (column.allowEditing && this._keyboardNavigationController.isKeyboardEnabled()) { $container.attr("tabIndex", that.option("tabIndex")); if (isCellOrBatchEditMode) { _events_engine.default.off($container, "focus", focusAction); _events_engine.default.on($container, "focus", focusAction) } } if (column.cellTemplate) { const templateOptions = (0, _extend.extend)({}, cellOptions, { value: value, displayValue: displayValue, text: text, column: column }); rowsView.renderTemplate($container, column.cellTemplate, templateOptions, (0, _dom.isElementInDom)($container)).done((() => { rowsView._cellPrepared($container, cellOptions) })) } else { const container = $container.get(0); if (column.encodeHtml) { container.textContent = text } else { container.innerHTML = text } $container.addClass("dx-adaptive-item-text"); if (!(0, _type.isDefined)(text) || "" === text) { $container.html(" ") } if (!that._isRowEditMode()) { if (that._isItemModified(item, cellOptions)) { $container.addClass("dx-item-modified") } } rowsView._cellPrepared($container, cellOptions) } } _getTemplate(item, cellOptions, updateForm) { const that = this; const { column: column } = item; const editingController = this._editingController; return function(options, container) { const $container = (0, _renderer.default)(container); const columnIndex = that._columnsController.getVisibleIndex(column.index); const templateOptions = (0, _extend.extend)({}, cellOptions); const renderFormTemplate = function() { const isItemEdited = that._isItemEdited(item); templateOptions.value = cellOptions.row.values[columnIndex]; if (isItemEdited || column.showEditorAlways) { editingController.renderFormEditorTemplate(templateOptions, item, options, $container, !isItemEdited) } else { templateOptions.column = column; templateOptions.columnIndex = columnIndex; that._renderFormViewTemplate(item, templateOptions, $container) } }; renderFormTemplate(); if (templateOptions.watch) { const dispose = templateOptions.watch((() => ({ isItemEdited: that._isItemEdited(item), value: cellOptions.row.values[columnIndex] })), (() => { $container.contents().remove(); $container.removeClass("dx-adaptive-item-text"); renderFormTemplate() })); _events_engine.default.on($container, _remove.removeEvent, dispose) } } } _isVisibleColumnsValid(visibleColumns) { if (visibleColumns < 2) { return false } if (visibleColumns.length - function() { let result = 0; for (let j = 0; j < visibleColumns.length; j++) { const visibleColumn = visibleColumns[j]; if (visibleColumn.command) { result++ } } return result }() <= 1) { return false } return true } _calculatePercentWidths(widths, visibleColumns) { const that = this; let percentWidths = 0; visibleColumns.forEach(((item, index) => { if ("adaptiveHidden" !== widths[index]) { percentWidths += that._getItemPercentWidth(item) } })); return percentWidths } _isPercentWidth(width) { return (0, _type.isString)(width) && width.endsWith("%") } _isColumnHidden(column) { return this._hiddenColumns.filter((hiddenColumn => hiddenColumn.index === column.index)).length > 0 } _getAverageColumnsWidth(containerWidth, columns, columnsCanFit) { const that = this; let fixedColumnsWidth = 0; let columnsWithoutFixedWidthCount = 0; columns.forEach((column => { if (!that._isColumnHidden(column)) { const { width: width } = column; if ((0, _type.isDefined)(width) && !isNaN(parseFloat(width))) { fixedColumnsWidth += that._isPercentWidth(width) ? that._calculatePercentWidth({ visibleIndex: column.visibleIndex, columnsCount: columns.length, columnsCanFit: columnsCanFit, bestFitWidth: column.bestFitWidth, columnWidth: width, containerWidth: containerWidth }) : parseFloat(width) } else { columnsWithoutFixedWidthCount++ } } })); return (containerWidth - fixedColumnsWidth) / columnsWithoutFixedWidthCount } _calculateColumnWidth(column, containerWidth, contentColumns, columnsCanFit) { const columnId = getColumnId(this, column); const widthOption = this._columnsController.columnOption(columnId, "width"); const bestFitWidth = this._columnsController.columnOption(columnId, "bestFitWidth"); const columnsCount = contentColumns.length; let colWidth; if (widthOption && "auto" !== widthOption) { if (this._isPercentWidth(widthOption)) { colWidth = this._calculatePercentWidth({ visibleIndex: column.visibleIndex, columnsCount: columnsCount, columnsCanFit: columnsCanFit, bestFitWidth: bestFitWidth, columnWidth: widthOption, containerWidth: containerWidth }) } else { return parseFloat(widthOption) } } else { const columnAutoWidth = this.option("columnAutoWidth"); colWidth = columnAutoWidth || !!column.command ? bestFitWidth : this._getAverageColumnsWidth(containerWidth, contentColumns, columnsCanFit) } return colWidth } _calculatePercentWidth(options) { const columnFitted = options.visibleIndex < options.columnsCount - 1 && options.columnsCanFit; const partialWidth = options.containerWidth * parseFloat(options.columnWidth) / 100; const resultWidth = options.columnsCanFit && partialWidth < options.bestFitWidth ? options.bestFitWidth : partialWidth; return columnFitted ? options.containerWidth * parseFloat(options.columnWidth) / 100 : resultWidth } _getNotTruncatedColumnWidth(column, containerWidth, contentColumns, columnsCanFit) { const columnId = getColumnId(this, column); const widthOption = this._columnsController.columnOption(columnId, "width"); const bestFitWidth = this._columnsController.columnOption(columnId, "bestFitWidth"); if (widthOption && "auto" !== widthOption && !this._isPercentWidth(widthOption)) { return parseFloat(widthOption) } const colWidth = this._calculateColumnWidth(column, containerWidth, contentColumns, columnsCanFit); return colWidth < bestFitWidth ? null : colWidth } _getItemPercentWidth(item) { let result = 0; if (item.width && this._isPercentWidth(item.width)) { result = parseFloat(item.width) } return result } _getCommandColumnsWidth() { const that = this; const columns = that._columnsController.getVisibleColumns(); let colWidth = 0; (0, _iterator.each)(columns, ((index, column) => { if (column.index < 0 || column.command) { colWidth += that._columnsController.columnOption(getColumnId(that, column), "bestFitWidth") || 0 } })); return colWidth } _isItemEdited(item) { if (this.isFormOrPopupEditMode()) { return false } if (this._isRowEditMode()) { const editRowKey = this.option("editing.editRowKey"); if ((0, _common.equalByValue)(editRowKey, this._dataController.adaptiveExpandedKey())) { return true } } else { const rowIndex = this._dataController.getRowIndexByKey(this._dataController.adaptiveExpandedKey()) + 1; const columnIndex = this._columnsController.getVisibleIndex(item.column.index); return this._editingController.isEditCell(rowIndex, columnIndex) } return } _getFormItemsByHiddenColumns(hiddenColumns) { const items = []; (0, _iterator.each)(hiddenColumns, ((_, column) => { items.push({ column: column, name: column.name, dataField: column.dataField, visibleIndex: column.visibleIndex }) })); return items } _getAdaptiveColumnVisibleIndex(visibleColumns) { for (let i = 0; i < visibleColumns.length; i++) { const column = visibleColumns[i]; if ("adaptive" === column.command) { return i } } return } _hideAdaptiveColumn(resultWidths, visibleColumns) { const visibleIndex = this._getAdaptiveColumnVisibleIndex(visibleColumns); if ((0, _type.isDefined)(visibleIndex)) { resultWidths[visibleIndex] = "adaptiveHidden"; this._hideVisibleColumn({ isCommandColumn: true, visibleIndex: visibleIndex }) } } _showHiddenCellsInView(_ref) { let { $cells: $cells, isCommandColumn: isCommandColumn } = _ref; let cssClassNameToRemove = this.addWidgetPrefix("hidden-column"); if (isCommandColumn) { cssClassNameToRemove = "dx-command-adaptive-hidden"; $cells.attr({ tabIndex: 0, "aria-hidden": null }).removeClass(cssClassNameToRemove) } else { $cells.removeClass(cssClassNameToRemove) } } _showHiddenColumns() { for (let i = 0; i < COLUMN_VIEWS.length; i++) { const view = this.getView(COLUMN_VIEWS[i]); if (view && view.isVisible() && view.element()) { const viewName = view.name; const $hiddenCommandCells = view.element().find(".dx-command-adaptive-hidden"); this._showHiddenCellsInView({ viewName: viewName, $cells: $hiddenCommandCells, isCommandColumn: true }); const $hiddenCells = view.element().find(`.${this.addWidgetPrefix("hidden-column")}`); this._showHiddenCellsInView({ viewName: viewName, $cells: $hiddenCells }) } } } _isCellValid($cell) { return $cell && $cell.length && !$cell.hasClass("dx-master-detail-cell") && !$cell.hasClass("dx-group-cell") } _hideVisibleColumn(_ref2) { let { isCommandColumn: isCommandColumn, visibleIndex: visibleIndex } = _ref2; const that = this; COLUMN_VIEWS.forEach((viewName => { const view = that.getView(viewName); view && that._hideVisibleColumnInView({ view: view, isCommandColumn: isCommandColumn, visibleIndex: visibleIndex }) })) } _hideVisibleColumnInView(_ref3) { let { view: view, isCommandColumn: isCommandColumn, visibleIndex: visibleIndex } = _ref3; const viewName = view.name; let $cellElement; const column = this._columnsController.getVisibleColumns()[visibleIndex]; const editFormRowIndex = this._editingController && this._editingController.getEditFormRowIndex(); if (view && view.isVisible() && column) { const rowsCount = view.getRowsCount(); const $rowElements = view._getRowElements(); for (let rowIndex = 0; rowIndex < rowsCount; rowIndex++) { const cancelClassAdding = rowIndex === editFormRowIndex && "rowsView" === viewName && "popup" !== this.option("editing.mode"); if (!cancelClassAdding) { const currentVisibleIndex = "columnHeadersView" === viewName ? this._columnsController.getVisibleIndex(column.index, rowIndex) : visibleIndex; if (currentVisibleIndex >= 0) { const $rowElement = $rowElements.eq(rowIndex); $cellElement = this._findCellElementInRow($rowElement, currentVisibleIndex); this._isCellValid($cellElement) && this._hideVisibleCellInView({ viewName: viewName, isCommandColumn: isCommandColumn, $cell: $cellElement }) } } } } } _findCellElementInRow($rowElement, visibleColumnIndex) { const $rowCells = $rowElement.children(); let visibleIndex = visibleColumnIndex; let cellIsInsideGroup = false; if ($rowElement.hasClass("dx-group-row")) { const $groupCell = $rowElement.find(".dx-group-cell"); const colSpan = $groupCell.attr("colspan"); if ($groupCell.length && (0, _type.isDefined)(colSpan)) { const groupCellLength = parseInt(colSpan); const endGroupIndex = $groupCell.index() + groupCellLength - 1; if (visibleColumnIndex > endGroupIndex) { visibleIndex = visibleColumnIndex - groupCellLength + 1 } else { cellIsInsideGroup = true } } } const $cellElement = !cellIsInsideGroup ? $rowCells.eq(visibleIndex) : void 0; return $cellElement } _hideVisibleCellInView(_ref4) { let { $cell: $cell, isCommandColumn: isCommandColumn } = _ref4; const cssClassNameToAdd = isCommandColumn ? "dx-command-adaptive-hidden" : this.addWidgetPrefix("hidden-column"); $cell.attr({ tabIndex: -1, "aria-hidden": true }).addClass(cssClassNameToAdd) } _getEditMode() { return this._editingController.getEditMode() } isFormOrPopupEditMode() { const editMode = this._getEditMode(); return "form" === editMode || "popup" === editMode } hideRedundantColumns(resultWidths, visibleColumns, hiddenQueue) { const that = this; this._hiddenColumns = []; if (that._isVisibleColumnsValid(visibleColumns) && hiddenQueue.length) { let totalWidth = 0; const $rootElement = that.component.$element(); let rootElementWidth = (0, _size.getWidth)($rootElement) - that._getCommandColumnsWidth(); const getVisibleContentColumns = function() { return visibleColumns.filter((item => !item.command && 0 === this._hiddenColumns.filter((i => i.index === item.index)).length)) }.bind(this); let visibleContentColumns = getVisibleContentColumns(); const contentColumnsCount = visibleContentColumns.length; let i; let hasHiddenColumns; let needHideColumn; do { needHideColumn = false; totalWidth = 0; const percentWidths = that._calculatePercentWidths(resultWidths, visibleColumns); const columnsCanFit = percentWidths < 100 && 0 !== percentWidths; for (i = 0; i < visibleColumns.length; i++) { const visibleColumn = visibleColumns[i]; let columnWidth = that._getNotTruncatedColumnWidth(visibleColumn, rootElementWidth, visibleContentColumns, columnsCanFit); const columnId = getColumnId(that, visibleColumn); const widthOption = that._columnsController.columnOption(columnId, "width"); const minWidth = that._columnsController.columnOption(columnId, "minWidth"); const columnBestFitWidth = that._columnsController.columnOption(columnId, "bestFitWidth"); if ("adaptiveHidden" === resultWidths[i]) { hasHiddenColumns = true; continue } if (!columnWidth && !visibleColumn.command && !visibleColumn.fixed) { needHideColumn = true; break } if (!widthOption || "auto" === widthOption) { columnWidth = Math.max(columnBestFitWidth || 0, minWidth || 0) } if ("adaptive" !== visibleColumn.command || hasHiddenColumns) { totalWidth += columnWidth } } needHideColumn = needHideColumn || totalWidth > (0, _size.getWidth)($rootElement); if (needHideColumn) { const column = hiddenQueue.pop(); const visibleIndex = that._columnsController.getVisibleIndex(column.index); rootElementWidth += that._calculateColumnWidth(column, rootElementWidth, visibleContentColumns, columnsCanFit); that._hideVisibleColumn({ visibleIndex: visibleIndex }); resultWidths[visibleIndex] = "adaptiveHidden"; this._hiddenColumns.push(column); visibleContentColumns = getVisibleContentColumns() } } while (needHideColumn && visibleContentColumns.length > 1 && hiddenQueue.length); if (contentColumnsCount === visibleContentColumns.length) { that._hideAdaptiveColumn(resultWidths, visibleColumns) } } else { that._hideAdaptiveColumn(resultWidths, visibleColumns) } } getAdaptiveDetailItems() { return this._$itemContents } getItemContentByColumnIndex(visibleColumnIndex) { let $itemContent; for (let i = 0; i < this._$itemContents.length; i++) { $itemContent = this._$itemContents.eq(i); const item = $itemContent.data("dx-form-item"); if (item && item.column && this._columnsController.getVisibleIndex(item.column.index) === visibleColumnIndex) { return $itemContent } } } toggleExpandAdaptiveDetailRow(key, alwaysExpanded) { if (!(this.isFormOrPopupEditMode() && this._editingController.isEditing())) { this._dataController.toggleExpandAdaptiveDetailRow(key, alwaysExpanded) } } createFormByHiddenColumns(container, options) { const that = this; const $container = (0, _renderer.default)(container); const userFormOptions = { items: that._getFormItemsByHiddenColumns(that._hiddenColumns), formID: `dx-${new _guid.default}` }; const defaultFormOptions = (0, _themes.isMaterial)() ? { colCount: 2 } : {}; this.executeAction("onAdaptiveDetailRowPreparing", { formOptions: userFormOptions }); that._$itemContents = null; that._form = that._createComponent((0, _renderer.default)("
").appendTo($container), _form.default, (0, _extend.extend)(defaultFormOptions, userFormOptions, { customizeItem(item) { const column = item.column || that._columnsController.columnOption(item.name || item.dataField); if (column) { item.label = item.label || {}; item.label.text = item.label.text || column.caption; item.column = column; item.template = that._getTemplate(item, options, that.updateForm.bind(that)) } userFormOptions.customizeItem && userFormOptions.customizeItem.call(this, item) }, onContentReady(e) { userFormOptions.onContentReady && userFormOptions.onContentReady.call(this, e); that._$itemContents = $container.find(".dx-field-item-content") } })) } hasAdaptiveDetailRowExpanded() { return (0, _type.isDefined)(this._dataController.adaptiveExpandedKey()) } updateForm(hiddenColumns) { if (this.hasAdaptiveDetailRowExpanded()) { if (this._form && (0, _type.isDefined)(this._form._contentReadyAction)) { if (hiddenColumns && hiddenColumns.length) { this._form.option("items", this._getFormItemsByHiddenColumns(hiddenColumns)) } else { this._form.repaint() } } } } updateHidingQueue(columns) { const that = this; const hideableColumns = columns.filter((column => column.visible && !column.type && !column.fixed && !((0, _type.isDefined)(column.groupIndex) && column.groupIndex >= 0))); let columnsHasHidingPriority; let i; that._hidingColumnsQueue = []; if (that.option("allowColumnResizing") && "widget" === that.option("columnResizingMode")) { return that._hidingColumnsQueue } for (i = 0; i < hideableColumns.length; i++) { if ((0, _type.isDefined)(hideableColumns[i].hidingPriority) && hideableColumns[i].hidingPriority >= 0) { columnsHasHidingPriority = true; that._hidingColumnsQueue[hideableColumns[i].hidingPriority] = hideableColumns[i] } } if (columnsHasHidingPriority) { that._hidingColumnsQueue.reverse() } else if (that.option("columnHidingEnabled")) { for (i = 0; i < hideableColumns.length; i++) { const visibleIndex = that._columnsController.getVisibleIndex(hideableColumns[i].index); that._hidingColumnsQueue[visibleIndex] = hideableColumns[i] } } that._hidingColumnsQueue = that._hidingColumnsQueue.filter(Object); return that._hidingColumnsQueue } getHiddenColumns() { return this._hiddenColumns } hasHiddenColumns() { return this._hiddenColumns.length > 0 } getHidingColumnsQueue() { return this._hidingColumnsQueue } isAdaptiveDetailRowExpanded(key) { const dataController = this._dataController; return dataController.adaptiveExpandedKey() && (0, _common.equalByValue)(dataController.adaptiveExpandedKey(), key) } expandAdaptiveDetailRow(key) { if (!this.hasAdaptiveDetailRowExpanded()) { this.toggleExpandAdaptiveDetailRow(key) } } collapseAdaptiveDetailRow() { if (this.hasAdaptiveDetailRowExpanded()) { this.toggleExpandAdaptiveDetailRow() } } updateCommandAdaptiveAriaLabel(key, label) { const rowIndex = this._dataController.getRowIndexByKey(key); if (-1 === rowIndex) { return } const $row = (0, _renderer.default)(this.component.getRowElement(rowIndex)); this.setCommandAdaptiveAriaLabel($row, label) } setCommandAdaptiveAriaLabel($row, labelName) { const $adaptiveCommand = $row.find(".dx-command-adaptive"); $adaptiveCommand.attr("aria-label", _message.default.format(labelName)) } } exports.AdaptiveColumnsController = AdaptiveColumnsController; exports.adaptivityModule = { defaultOptions: () => ({ columnHidingEnabled: false, onAdaptiveDetailRowPreparing: null }), controllers: { adaptiveColumns: AdaptiveColumnsController }, extenders: { views: { rowsView: Base => class extends Base { _getCellTemplate(options) { const that = this; const { column: column } = options; if ("detailAdaptive" === options.rowType && "detail" === column.command) { return function(container, options) { that._adaptiveColumnsController.createFormByHiddenColumns((0, _renderer.default)(container), options) } } return super._getCellTemplate(options) } _createRow(row) { const $row = super._createRow.apply(this, arguments); if (row && "detailAdaptive" === row.rowType && row.key === this._dataController.adaptiveExpandedKey()) { $row.addClass("dx-adaptive-detail-row") } return $row } _renderCells($row, options) { super._renderCells($row, options); const adaptiveColumnsController = this._adaptiveColumnsController; const hidingColumnsQueueLength = adaptiveColumnsController.getHidingColumnsQueue().length; const hiddenColumnsLength = adaptiveColumnsController.getHiddenColumns().length; if (hidingColumnsQueueLength && !hiddenColumnsLength) { (function($row) { return $row.find("td:not(.dx-datagrid-hidden-column):not([class*='dx-command-'])") })($row).last().addClass("dx-last-data-cell") } if ("data" === options.row.rowType) { adaptiveColumnsController.setCommandAdaptiveAriaLabel($row, "dxDataGrid-ariaAdaptiveExpand") } } _getColumnIndexByElementCore($element) { const $itemContent = $element.closest(".dx-field-item-content"); if ($itemContent.length && $itemContent.closest(this.component.$element()).length) { const formItem = $itemContent.length ? $itemContent.first().data("dx-form-item") : null; return formItem && formItem.column && this._columnsController.getVisibleIndex(formItem.column.index) } return super._getColumnIndexByElementCore($element) } _cellPrepared($cell, options) { super._cellPrepared.apply(this, arguments); if ("detailAdaptive" !== options.row.rowType && "adaptiveHidden" === options.column.visibleWidth) { $cell.addClass(this.addWidgetPrefix("hidden-column")) } } getCell(cellPosition, rows) { const item = this._dataController.items()[null === cellPosition || void 0 === cellPosition ? void 0 : cellPosition.rowIndex]; if ("detailAdaptive" === (null === item || void 0 === item ? void 0 : item.rowType)) { const $adaptiveDetailItems = this._adaptiveColumnsController.getAdaptiveDetailItems(); return super.getCell(cellPosition, rows, $adaptiveDetailItems) } return super.getCell.apply(this, arguments) } _getCellElement(rowIndex, columnIdentifier) { const item = this._dataController.items()[rowIndex]; if (item && "detailAdaptive" === item.rowType) { return this._adaptiveColumnsController.getItemContentByColumnIndex(columnIdentifier) } return super._getCellElement.apply(this, arguments) } getContextMenuItems(options) { var _super$getContextMenu; if (options.row && "detailAdaptive" === options.row.rowType) { const view = this._columnHeadersView; const formItem = (0, _renderer.default)(options.targetElement).closest(".dx-field-item-label").next().data("dx-form-item"); options.column = formItem ? formItem.column : options.column; return view.getContextMenuItems && view.getContextMenuItems(options) } return null === (_super$getContextMenu = super.getContextMenuItems) || void 0 === _super$getContextMenu ? void 0 : _super$getContextMenu.call(this, options) } isClickableElement($target) { var _super$isClickableEle; const isClickable = (null === (_super$isClickableEle = super.isClickableElement) || void 0 === _super$isClickableEle ? void 0 : _super$isClickableEle.call(this, $target)) ?? false; return isClickable || !!$target.closest(".dx-command-adaptive").length } } }, controllers: { export: Base => class extends Base { _updateColumnWidth(column, width) { super._updateColumnWidth(column, "adaptiveHidden" === column.visibleWidth ? column.bestFitWidth : width) } }, columnsResizer: Base => class extends Base { _pointCreated(point, cellsLength, columns) { const result = super._pointCreated(point, cellsLength, columns); const currentColumn = columns[point.columnIndex] || {}; const nextColumnIndex = this._getNextColumnIndex(point.columnIndex); const nextColumn = columns[nextColumnIndex] || {}; const hasHiddenColumnsOnly = nextColumnIndex !== point.columnIndex + 1 && nextColumn.command; const hasAdaptiveHiddenWidth = "adaptiveHidden" === currentColumn.visibleWidth || hasHiddenColumnsOnly; return result || hasAdaptiveHiddenWidth } _getNextColumnIndex(currentColumnIndex) { const visibleColumns = this._columnsController.getVisibleColumns(); let index = super._getNextColumnIndex(currentColumnIndex); while (visibleColumns[index] && "adaptiveHidden" === visibleColumns[index].visibleWidth) { index++ } return index } }, draggingHeader: Base => class extends Base { _pointCreated(point, columns, location, sourceColumn) { const result = super._pointCreated(point, columns, location, sourceColumn); const column = columns[point.columnIndex - 1] || {}; const hasAdaptiveHiddenWidth = "adaptiveHidden" === column.visibleWidth; return result || hasAdaptiveHiddenWidth } }, editing: Base => class extends Base { _isRowEditMode() { return "row" === this.getEditMode() } _getFormEditItemTemplate(cellOptions, column) { if ("row" !== this.getEditMode() && "detailAdaptive" === cellOptions.rowType) { cellOptions.columnIndex = this._columnsController.getVisibleIndex(column.index); return this.getColumnTemplate(cellOptions) } return super._getFormEditItemTemplate(cellOptions, column) } _closeEditItem($targetElement) { const $itemContents = $targetElement.closest(".dx-field-item-content"); const rowIndex = this._dataController.getRowIndexByKey(this._dataController.adaptiveExpandedKey()) + 1; const formItem = $itemContents.length ? $itemContents.first().data("dx-form-item") : null; const columnIndex = formItem && formItem.column && this._columnsController.getVisibleIndex(formItem.column.index); if (!this.isEditCell(rowIndex, columnIndex)) { super._closeEditItem($targetElement) } } _beforeUpdateItems(rowIndices, rowIndex) { if (!this._adaptiveColumnsController.isFormOrPopupEditMode() && this._adaptiveColumnsController.hasHiddenColumns()) { const items = this._dataController.items(); const item = items[rowIndex]; const oldExpandRowIndex = _m_utils.default.getIndexByKey(this._dataController.adaptiveExpandedKey(), items); this._isForceRowAdaptiveExpand = !this._adaptiveColumnsController.hasAdaptiveDetailRowExpanded(); if (oldExpandRowIndex >= 0) { rowIndices.push(oldExpandRowIndex + 1) } rowIndices.push(rowIndex + 1); this._dataController.adaptiveExpandedKey(item.key) } } _afterInsertRow(key) { super._afterInsertRow.apply(this, arguments); if (this._adaptiveColumnsController.hasHiddenColumns()) { this._adaptiveColumnsController.toggleExpandAdaptiveDetailRow(key, this.isRowEditMode()); this._isForceRowAdaptiveExpand = true } } _collapseAdaptiveDetailRow() { if (this._isRowEditMode() && this._isForceRowAdaptiveExpand) { this._adaptiveColumnsController.collapseAdaptiveDetailRow(); this._isForceRowAdaptiveExpand = false } } _cancelEditAdaptiveDetailRow() { if (this._adaptiveColumnsController.hasHiddenColumns()) { this._collapseAdaptiveDetailRow() } } _afterSaveEditData() { super._afterSaveEditData.apply(this, arguments); const deferred = new _deferred.Deferred; if (this._isRowEditMode() && this._adaptiveColumnsController.hasHiddenColumns()) { (0, _deferred.when)(this._validatingController.validate(true)).done((isValid => { if (isValid) { this._cancelEditAdaptiveDetailRow() } deferred.resolve() })) } else { deferred.resolve() } return deferred.promise() } _beforeCancelEditData() { super._beforeCancelEditData(); this._cancelEditAdaptiveDetailRow() } _getRowIndicesForCascadeUpdating(row) { const rowIndices = super._getRowIndicesForCascadeUpdating.apply(this, arguments); if (this._adaptiveColumnsController.isAdaptiveDetailRowExpanded(row.key)) { rowIndices.push("detailAdaptive" === row.rowType ? row.rowIndex - 1 : row.rowIndex + 1) } return rowIndices } _beforeCloseEditCellInBatchMode(rowIndices) { const expandedKey = this._dataController._adaptiveExpandedKey; if (expandedKey) { const rowIndex = _m_utils.default.getIndexByKey(expandedKey, this._dataController.items()); if (rowIndex > -1) { rowIndices.unshift(rowIndex) } } } editRow(rowIndex) { if (this._adaptiveColumnsController.isFormOrPopupEditMode()) { this._adaptiveColumnsController.collapseAdaptiveDetailRow() } return super.editRow(rowIndex) } deleteRow(rowIndex) { const rowKey = this._dataController.getKeyByRowIndex(rowIndex); if ("batch" === this.getEditMode() && this._adaptiveColumnsController.isAdaptiveDetailRowExpanded(rowKey)) { this._adaptiveColumnsController.collapseAdaptiveDetailRow() } super.deleteRow(rowIndex) } }, resizing: Base => class extends Base { dispose() { super.dispose.apply(this, arguments); clearTimeout(this._updateScrollableTimeoutID) } _needBestFit() { return super._needBestFit() || !!this._adaptiveColumnsController.getHidingColumnsQueue().length } _correctColumnWidths(resultWidths, visibleColumns) { const adaptiveController = this._adaptiveColumnsController; const oldHiddenColumns = adaptiveController.getHiddenColumns(); const hidingColumnsQueue = adaptiveController.updateHidingQueue(this._columnsController.getColumns()); adaptiveController.hideRedundantColumns(resultWidths, visibleColumns, hidingColumnsQueue); const hiddenColumns = adaptiveController.getHiddenColumns(); if (adaptiveController.hasAdaptiveDetailRowExpanded()) { if (oldHiddenColumns.length !== hiddenColumns.length) { adaptiveController.updateForm(hiddenColumns) } }!hiddenColumns.length && adaptiveController.collapseAdaptiveDetailRow(); return super._correctColumnWidths.apply(this, arguments) } _toggleBestFitMode(isBestFit) { isBestFit && this._adaptiveColumnsController._showHiddenColumns(); super._toggleBestFitMode(isBestFit) } _needStretch() { const adaptiveColumnsController = this._adaptiveColumnsController; return super._needStretch.apply(this, arguments) || adaptiveColumnsController.getHidingColumnsQueue().length || adaptiveColumnsController.hasHiddenColumns() } }, data: Base => class extends Base { init() { super.init(); this._adaptiveExpandedKey = void 0 } _processItems(items, change) { const { changeType: changeType } = change; items = super._processItems.apply(this, arguments); if ("loadingAll" === changeType || !(0, _type.isDefined)(this._adaptiveExpandedKey)) { return items } const expandRowIndex = _m_utils.default.getIndexByKey(this._adaptiveExpandedKey, items); const newMode = false === this.option("scrolling.legacyMode"); if (expandRowIndex >= 0) { const item = items[expandRowIndex]; items.splice(expandRowIndex + 1, 0, { visible: true, rowType: "detailAdaptive", key: item.key, data: item.data, node: item.node, modifiedValues: item.modifiedValues, isNewRow: item.isNewRow, values: item.values }) } else if ("refresh" === changeType && !(newMode && change.repaintChangesOnly)) { this._adaptiveExpandedKey = void 0 } return items } _getRowIndicesForExpand(key) { const rowIndices = super._getRowIndicesForExpand.apply(this, arguments); if (this._adaptiveColumnsController.isAdaptiveDetailRowExpanded(key)) { const lastRowIndex = rowIndices[rowIndices.length - 1]; rowIndices.push(lastRowIndex + 1) } return rowIndices } adaptiveExpandedKey(value) { if ((0, _type.isDefined)(value)) { this._adaptiveExpandedKey = value } else { return this._adaptiveExpandedKey } } toggleExpandAdaptiveDetailRow(key, alwaysExpanded) { let oldExpandLoadedRowIndex = _m_utils.default.getIndexByKey(this._adaptiveExpandedKey, this._items); let newExpandLoadedRowIndex = _m_utils.default.getIndexByKey(key, this._items); if (oldExpandLoadedRowIndex >= 0 && oldExpandLoadedRowIndex === newExpandLoadedRowIndex && !alwaysExpanded) { key = void 0; newExpandLoadedRowIndex = -1 } const oldKey = this._adaptiveExpandedKey; this._adaptiveExpandedKey = key; if (oldExpandLoadedRowIndex >= 0) { oldExpandLoadedRowIndex++ } if (newExpandLoadedRowIndex >= 0) { newExpandLoadedRowIndex++ } const rowIndexDelta = this.getRowIndexDelta(); this.updateItems({ allowInvisibleRowIndices: true, changeType: "update", rowIndices: [oldExpandLoadedRowIndex - rowIndexDelta, newExpandLoadedRowIndex - rowIndexDelta] }); this._adaptiveColumnsController.updateCommandAdaptiveAriaLabel(key, "dxDataGrid-ariaAdaptiveCollapse"); this._adaptiveColumnsController.updateCommandAdaptiveAriaLabel(oldKey, "dxDataGrid-ariaAdaptiveExpand") } }, editorFactory: Base => class extends Base { _needHideBorder($element) { return super._needHideBorder($element) || (null === $element || void 0 === $element ? void 0 : $element.hasClass("dx-field-item-content")) && (null === $element || void 0 === $element ? void 0 : $element.find(".dx-checkbox").length) } _getFocusCellSelector() { return `${super._getFocusCellSelector()}, .dx-adaptive-detail-row .dx-field-item > .dx-field-item-content` } _getRevertTooltipsSelector() { return `${super._getRevertTooltipsSelector()}, .dx-field-item-content .${this.addWidgetPrefix("revert-tooltip")}` } }, columns: Base => class extends Base { _isColumnVisible(column) { return super._isColumnVisible(column) && !column.adaptiveHidden } }, keyboardNavigation: Base => class extends Base { _isCellValid($cell, isClick) { return super._isCellValid($cell, isClick) && !$cell.hasClass(this.addWidgetPrefix("hidden-column")) && !$cell.hasClass("dx-command-adaptive-hidden") } _processNextCellInMasterDetail($nextCell, $cell) { super._processNextCellInMasterDetail($nextCell, $cell); const isCellOrBatchMode = this._editingController.isCellOrBatchEditMode(); const isEditing = this._editingController.isEditing(); if (isEditing && $nextCell && isCellOrBatchMode && !this._isInsideEditForm($nextCell)) { _events_engine.default.off($nextCell, "focus", focusCellHandler); _events_engine.default.on($nextCell, "focus", { $nextCell: $nextCell }, focusCellHandler); _events_engine.default.trigger($cell, "focus") } } _isCellElement($cell) { return super._isCellElement($cell) || $cell.hasClass("dx-adaptive-item-text") } } } } } }, 71184: /*!***********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/column_chooser/m_column_chooser.js ***! \***********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.columnChooserModule = exports.ColumnChooserView = exports.ColumnChooserController = void 0; var _devices = _interopRequireDefault(__webpack_require__( /*! ../../../../core/devices */ 20530)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _size = __webpack_require__( /*! ../../../../core/utils/size */ 58664); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109)); var _button = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/button */ 63008)); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/popup/ui.popup */ 51495)); var _themes = __webpack_require__( /*! ../../../../ui/themes */ 75811); var _tree_view = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/tree_view */ 30254)); var _m_modules = _interopRequireDefault(__webpack_require__( /*! ../m_modules */ 15943)); var _m_columns_view = __webpack_require__( /*! ../views/m_columns_view */ 57318); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const COLUMN_OPTIONS_USED_IN_ITEMS = ["showInColumnChooser", "caption", "allowHiding", "visible", "cssClass", "ownerBand"]; class ColumnChooserController extends _m_modules.default.ViewController { init() { super.init(); this._rowsView = this.getView("rowsView") } renderShowColumnChooserButton($element) { const that = this; const columnChooserButtonClass = that.addWidgetPrefix("column-chooser-button"); const columnChooserEnabled = that.option("columnChooser.enabled"); const $showColumnChooserButton = $element.find(`.${columnChooserButtonClass}`); let $columnChooserButton; if (columnChooserEnabled) { if (!$showColumnChooserButton.length) { $columnChooserButton = (0, _renderer.default)("
").addClass(columnChooserButtonClass).appendTo($element); that._createComponent($columnChooserButton, _button.default, { icon: "column-chooser", onClick() { that.getView("columnChooserView").showColumnChooser() }, hint: that.option("columnChooser.title"), integrationOptions: {} }) } else { $showColumnChooserButton.show() } } else { $showColumnChooserButton.hide() } } getPosition() { const position = this.option("columnChooser.position"); return (0, _type.isDefined)(position) ? position : { my: "right bottom", at: "right bottom", of: this._rowsView && this._rowsView.element(), collision: "fit", offset: "-2 -2", boundaryOffset: "2 2" } } } exports.ColumnChooserController = ColumnChooserController; class ColumnChooserView extends _m_columns_view.ColumnsView { optionChanged(args) { if ("columnChooser" === args.name) { this._initializePopupContainer(); this.render(null, "full") } else { super.optionChanged(args) } } publicMethods() { return ["showColumnChooser", "hideColumnChooser"] } _resizeCore() {} _isWinDevice() { return !!_devices.default.real().win } _initializePopupContainer() { const that = this; const columnChooserClass = that.addWidgetPrefix("column-chooser"); const $element = that.element().addClass(columnChooserClass); const columnChooserOptions = that.option("columnChooser"); const popupPosition = this._columnChooserController.getPosition(); const themeName = (0, _themes.current)(); const isGenericTheme = (0, _themes.isGeneric)(themeName); const isMaterial = (0, _themes.isMaterial)(themeName); const dxPopupOptions = { visible: false, shading: false, showCloseButton: false, dragEnabled: true, resizeEnabled: true, wrapperAttr: { class: columnChooserClass }, toolbarItems: [{ text: columnChooserOptions.title, toolbar: "top", location: isGenericTheme || isMaterial ? "before" : "center" }], position: popupPosition, width: columnChooserOptions.width, height: columnChooserOptions.height, rtlEnabled: that.option("rtlEnabled"), onHidden() { if (that._isWinDevice()) { (0, _renderer.default)("body").removeClass(that.addWidgetPrefix("notouch-action")) } }, container: columnChooserOptions.container }; if (isGenericTheme || isMaterial) { (0, _extend.extend)(dxPopupOptions, { showCloseButton: true }) } else { dxPopupOptions.toolbarItems[dxPopupOptions.toolbarItems.length] = { shortcut: "cancel" } } if (!(0, _type.isDefined)(this._popupContainer)) { that._popupContainer = that._createComponent($element, _ui.default, dxPopupOptions); that._popupContainer.on("optionChanged", (args => { if ("visible" === args.name) { that.renderCompleted.fire() } })) } else { this._popupContainer.option(dxPopupOptions) } this.setPopupAttributes() } setPopupAttributes() { const isSelectMode = this.isSelectMode(); const isBandColumnsUsed = this._columnsController.isBandColumnsUsed(); this._popupContainer.setAria({ role: "dialog", label: _message.default.format("dxDataGrid-columnChooserTitle") }); this._popupContainer.$wrapper().toggleClass(this.addWidgetPrefix("column-chooser-mode-drag"), !isSelectMode).toggleClass(this.addWidgetPrefix("column-chooser-mode-select"), isSelectMode); this._popupContainer.$content().addClass(this.addWidgetPrefix("column-chooser-list")); if (isSelectMode && !isBandColumnsUsed) { this._popupContainer.$content().addClass(this.addWidgetPrefix("column-chooser-plain")) } } _renderCore(change) { if (this._popupContainer) { const isDragMode = !this.isSelectMode(); if (!this._columnChooserList || "full" === change) { this._renderTreeView() } else if (isDragMode) { this._updateItems() } } } _renderTreeView() { var _columnChooser$search, _columnChooser$search2, _columnChooser$search3; const that = this; const $container = this._popupContainer.$content(); const columnChooser = this.option("columnChooser"); const isSelectMode = this.isSelectMode(); const searchEnabled = (0, _type.isDefined)(columnChooser.allowSearch) ? columnChooser.allowSearch : null === (_columnChooser$search = columnChooser.search) || void 0 === _columnChooser$search ? void 0 : _columnChooser$search.enabled; const searchTimeout = (0, _type.isDefined)(columnChooser.searchTimeout) ? columnChooser.searchTimeout : null === (_columnChooser$search2 = columnChooser.search) || void 0 === _columnChooser$search2 ? void 0 : _columnChooser$search2.timeout; const treeViewConfig = { dataStructure: "plain", activeStateEnabled: true, focusStateEnabled: true, hoverStateEnabled: true, itemTemplate: "item", showCheckBoxesMode: "none", rootValue: null, searchEnabled: searchEnabled, searchTimeout: searchTimeout, searchEditorOptions: null === (_columnChooser$search3 = columnChooser.search) || void 0 === _columnChooser$search3 ? void 0 : _columnChooser$search3.editorOptions }; if (this._isWinDevice()) { treeViewConfig.useNativeScrolling = false }(0, _extend.extend)(treeViewConfig, isSelectMode ? this._prepareSelectModeConfig() : this._prepareDragModeConfig()); if (this._columnChooserList) { if (!treeViewConfig.searchEnabled) { treeViewConfig.searchValue = "" } this._columnChooserList.option(treeViewConfig); this._updateItems() } else { this._columnChooserList = this._createComponent($container, _tree_view.default, treeViewConfig); this._updateItems(); let scrollTop = 0; this._columnChooserList.on("optionChanged", (e => { const scrollable = e.component.getScrollable(); scrollTop = scrollable.scrollTop() })); this._columnChooserList.on("contentReady", (e => { (0, _common.deferUpdate)((() => { const scrollable = e.component.getScrollable(); scrollable.scrollTo({ y: scrollTop }); that.renderCompleted.fire() })) })) } } _prepareDragModeConfig() { const columnChooserOptions = this.option("columnChooser"); return { noDataText: columnChooserOptions.emptyPanelText, activeStateEnabled: false, hoverStateEnabled: false, itemTemplate(data, index, item) { (0, _renderer.default)(item).text(data.text).parent().addClass(data.cssClass).addClass("dx-column-chooser-item") } } } _prepareSelectModeConfig() { const that = this; const selectionOptions = this.option("columnChooser.selection") ?? {}; let isUpdatingSelection = false; return { selectByClick: selectionOptions.selectByClick, selectNodesRecursive: selectionOptions.recursive, showCheckBoxesMode: selectionOptions.allowSelectAll ? "selectAll" : "normal", onSelectionChanged: e => { if (isUpdatingSelection) { return } const nodes = (nodes => { const addNodesToArray = (nodes, flatNodesArray) => nodes.reduce(((result, node) => { result.push(node); if (node.children.length) { addNodesToArray(node.children, result) } return result }), flatNodesArray); return addNodesToArray(nodes, []) })(e.component.getNodes()); e.component.beginUpdate(); isUpdatingSelection = true; ((e, nodes) => { nodes.filter((node => false === node.itemData.allowHiding)).forEach((node => e.component.selectItem(node.key))) })(e, nodes); e.component.endUpdate(); isUpdatingSelection = false; that.component.beginUpdate(); this._isUpdatingColumnVisibility = true; (nodes => { nodes.forEach((node => { const columnIndex = node.itemData.id; const isVisible = false !== node.selected; that._columnsController.columnOption(columnIndex, "visible", isVisible) })) })(nodes); that.component.endUpdate(); this._isUpdatingColumnVisibility = false } } } _updateItems() { const isSelectMode = this.isSelectMode(); const chooserColumns = this._columnsController.getChooserColumns(isSelectMode); const items = function(that, chooserColumns) { const items = []; const isSelectMode = that.isSelectMode(); const isRecursive = that.option("columnChooser.selection.recursive"); if (chooserColumns.length) { (0, _iterator.each)(chooserColumns, ((index, column) => { const item = { text: column.caption, cssClass: column.cssClass, allowHiding: column.allowHiding, expanded: true, id: column.index, disabled: false === column.allowHiding, parentId: (0, _type.isDefined)(column.ownerBand) ? column.ownerBand : null }; const isRecursiveWithColumns = isRecursive && column.hasColumns; if (isSelectMode && !isRecursiveWithColumns) { item.selected = column.visible } items.push(item) })) } return items }(this, chooserColumns); this._columnChooserList.option("items", items) } _updateItemsSelection(columnIndices) { const changedColumns = null === columnIndices || void 0 === columnIndices ? void 0 : columnIndices.map((columnIndex => this._columnsController.columnOption(columnIndex))); this._columnChooserList.beginUpdate(); null === changedColumns || void 0 === changedColumns || changedColumns.forEach((_ref => { let { visible: visible, index: index } = _ref; if (visible) { this._columnChooserList.selectItem(index) } else { this._columnChooserList.unselectItem(index) } })); this._columnChooserList.endUpdate() } _columnOptionChanged(e) { super._columnOptionChanged(e); const isSelectMode = this.isSelectMode(); if (isSelectMode && this._columnChooserList && !this._isUpdatingColumnVisibility) { const { optionNames: optionNames } = e; const onlyVisibleChanged = optionNames.visible && 1 === optionNames.length; const columnIndices = (0, _type.isDefined)(e.columnIndex) ? [e.columnIndex] : e.columnIndices; const needUpdate = COLUMN_OPTIONS_USED_IN_ITEMS.some((optionName => optionNames[optionName])) || e.changeTypes.columns && optionNames.all; if (needUpdate) { this._updateItemsSelection(columnIndices); if (!onlyVisibleChanged) { this._updateItems() } } } } getColumnElements() { const result = []; const isSelectMode = this.isSelectMode(); const chooserColumns = this._columnsController.getChooserColumns(isSelectMode); const $content = this._popupContainer && this._popupContainer.$content(); const $nodes = $content && $content.find(".dx-treeview-node"); if ($nodes) { chooserColumns.forEach((column => { const $node = $nodes.filter(`[data-item-id = '${column.index}']`); const item = $node.length ? $node.children(".dx-column-chooser-item").get(0) : null; result.push(item) })) } return (0, _renderer.default)(result) } getName() { return "columnChooser" } getColumns() { return this._columnsController.getChooserColumns() } allowDragging(column) { const isParentColumnVisible = this._columnsController.isParentColumnVisible(column.index); const isColumnHidden = !column.visible && column.allowHiding; return this.isColumnChooserVisible() && isParentColumnVisible && isColumnHidden } allowColumnHeaderDragging(column) { const isDragMode = !this.isSelectMode(); return isDragMode && this.isColumnChooserVisible() && column.allowHiding } getBoundingRect() { const container = this._popupContainer && this._popupContainer.$overlayContent(); if (container && container.is(":visible")) { const offset = container.offset(); return { left: offset.left, top: offset.top, right: offset.left + (0, _size.getOuterWidth)(container), bottom: offset.top + (0, _size.getOuterHeight)(container) } } return null } showColumnChooser() { if (!this._popupContainer) { this._initializePopupContainer(); this.render() } this._popupContainer.show(); if (this._isWinDevice()) { (0, _renderer.default)("body").addClass(this.addWidgetPrefix("notouch-action")) } } hideColumnChooser() { if (this._popupContainer) { this._popupContainer.hide() } } isColumnChooserVisible() { const popupContainer = this._popupContainer; return popupContainer && popupContainer.option("visible") } isSelectMode() { return "select" === this.option("columnChooser.mode") } hasHiddenColumns() { const isEnabled = this.option("columnChooser.enabled"); const hiddenColumns = this.getColumns().filter((column => !column.visible)); return isEnabled && hiddenColumns.length } } exports.ColumnChooserView = ColumnChooserView; exports.columnChooserModule = { defaultOptions: () => ({ columnChooser: { enabled: false, search: { enabled: false, timeout: 500, editorOptions: {} }, selection: { allowSelectAll: false, selectByClick: false, recursive: false }, position: void 0, mode: "dragAndDrop", width: 250, height: 260, title: _message.default.format("dxDataGrid-columnChooserTitle"), emptyPanelText: _message.default.format("dxDataGrid-columnChooserEmptyText"), container: void 0 } }), controllers: { columnChooser: ColumnChooserController }, views: { columnChooserView: ColumnChooserView }, extenders: { views: { headerPanel: Base => class extends Base { _getToolbarItems() { const items = super._getToolbarItems(); return this._appendColumnChooserItem(items) } _appendColumnChooserItem(items) { const that = this; const columnChooserEnabled = that.option("columnChooser.enabled"); if (columnChooserEnabled) { const onClickHandler = function() { that.component.getView("columnChooserView").showColumnChooser() }; const onInitialized = function(e) { (0, _renderer.default)(e.element).addClass(that._getToolbarButtonClass(that.addWidgetPrefix("column-chooser-button"))) }; const hintText = that.option("columnChooser.title"); const toolbarItem = { widget: "dxButton", options: { icon: "column-chooser", onClick: onClickHandler, hint: hintText, text: hintText, onInitialized: onInitialized, elementAttr: { "aria-haspopup": "dialog" } }, showText: "inMenu", location: "after", name: "columnChooserButton", locateInMenu: "auto", sortIndex: 40 }; items.push(toolbarItem) } return items } optionChanged(args) { if ("columnChooser" === args.name) { this._invalidate(); args.handled = true } else { super.optionChanged(args) } } isVisible() { const columnChooserEnabled = this.option("columnChooser.enabled"); return super.isVisible() || columnChooserEnabled } }, columnHeadersView: Base => class extends Base { allowDragging(column) { const isDragMode = !this._columnChooserView.isSelectMode(); const isColumnChooserVisible = this._columnChooserView.isColumnChooserVisible(); return isDragMode && isColumnChooserVisible && column.allowHiding || super.allowDragging(column) } } }, controllers: { columns: Base => class extends Base { allowMoveColumn(fromVisibleIndex, toVisibleIndex, sourceLocation, targetLocation) { const isSelectMode = "select" === this.option("columnChooser.mode"); const isMoveColumnDisallowed = isSelectMode && "columnChooser" === targetLocation; return isMoveColumnDisallowed ? false : super.allowMoveColumn(fromVisibleIndex, toVisibleIndex, sourceLocation, targetLocation) } } } } } }, 53424: /*!*********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/column_fixing/m_column_fixing.js ***! \*********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.columnFixingModule = void 0; var _translator = __webpack_require__( /*! ../../../../animation/translator */ 31648); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _browser = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/browser */ 47810)); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _position = __webpack_require__( /*! ../../../../core/utils/position */ 37518); var _size = __webpack_require__( /*! ../../../../core/utils/size */ 58664); var _style = __webpack_require__( /*! ../../../../core/utils/style */ 80968); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../../events/core/events_engine */ 55994)); var _wheel = __webpack_require__( /*! ../../../../events/core/wheel */ 765); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109)); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/scroll_view/ui.scrollable */ 41183)); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../m_utils */ 60082)); var _m_columns_view = __webpack_require__( /*! ../views/m_columns_view */ 57318); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const getTransparentColumnIndex = function(fixedColumns) { let transparentColumnIndex = -1; (0, _iterator.each)(fixedColumns, ((index, column) => { if ("transparent" === column.command) { transparentColumnIndex = index; return false } return })); return transparentColumnIndex }; const normalizeColumnWidths = function(fixedColumns, widths, fixedWidths) { let fixedColumnIndex = 0; if (fixedColumns && widths && fixedWidths) { for (let i = 0; i < fixedColumns.length; i++) { if ("transparent" === fixedColumns[i].command) { fixedColumnIndex += fixedColumns[i].colspan } else { if (widths[fixedColumnIndex] < fixedWidths[i]) { widths[fixedColumnIndex] = fixedWidths[i] } fixedColumnIndex++ } } } return widths }; const baseFixedColumns = Base => class extends Base { init() { super.init(); this._isFixedTableRendering = false; this._isFixedColumns = false } _createCol(column) { return super._createCol(column).toggleClass("dx-col-fixed", !!(this._isFixedTableRendering && (column.fixed || column.command && "transparent" !== column.command))) } isIndicesArray(arr) { return Array.isArray(arr) && arr.length > 0 } _correctColumnIndicesForFixedColumns(fixedColumns, change) { var _change$items; const columnIndicesArray = null === change || void 0 === change ? void 0 : change.columnIndices; if (!this.isIndicesArray(columnIndicesArray)) { return } const transparentColumnIndex = getTransparentColumnIndex(fixedColumns); const transparentColspan = fixedColumns[transparentColumnIndex].colspan; const transparentOffset = transparentColumnIndex + transparentColspan; const rowTypes = null === change || void 0 === change || null === (_change$items = change.items) || void 0 === _change$items ? void 0 : _change$items.map((_ref => { let { rowType: rowType } = _ref; return rowType })); change.columnIndices = columnIndicesArray.map(((columnIndices, idx) => { if (!this.isIndicesArray(columnIndices)) { return columnIndices } const isGroupRow = rowTypes && "group" === rowTypes[idx]; if (isGroupRow) { return [...columnIndices] } return columnIndices.reduce(((result, colIdx) => { switch (true) { case colIdx < transparentColumnIndex: result.push(colIdx); break; case colIdx >= transparentOffset: result.push(colIdx - transparentColspan + 1) } return result }), []) })) } _partialUpdateFixedTable(fixedColumns, rows) { const fixedTableElement = this._fixedTableElement; const $rows = this._getRowElementsCore(fixedTableElement); const $colgroup = fixedTableElement.children("colgroup"); $colgroup.replaceWith(this._createColGroup(fixedColumns)); for (let i = 0; i < rows.length; i++) { this._partialUpdateFixedRow((0, _renderer.default)($rows[i]), fixedColumns, rows[i]) } } _partialUpdateFixedRow($row, fixedColumns, row) { const cellElements = $row.get(0).childNodes; const transparentColumnIndex = getTransparentColumnIndex(fixedColumns); const transparentColumn = fixedColumns[transparentColumnIndex]; const columnIndexOffset = this._columnsController.getColumnIndexOffset(); let groupCellOptions; let colIndex = columnIndexOffset + 1; let { colspan: colspan } = transparentColumn; if ($row.hasClass("dx-master-detail-row")) { var _this$_columnsControl; cellElements[0].setAttribute("colspan", null === (_this$_columnsControl = this._columnsController.getVisibleColumns()) || void 0 === _this$_columnsControl ? void 0 : _this$_columnsControl.length); return } if ($row.hasClass("dx-group-row")) { groupCellOptions = this._getGroupCellOptions({ row: row, columns: this._columnsController.getVisibleColumns() }); const hasSummary = row.summaryCells.length > 0; if (hasSummary) { const alignByColumnCellCount = this._getAlignByColumnCellCount(groupCellOptions.colspan, { columns: this._columnsController.getVisibleColumns(), row: row, isFixed: true }); colspan = groupCellOptions.colspan - alignByColumnCellCount } else { colspan = groupCellOptions.colspan - Math.max(0, cellElements.length - (groupCellOptions.columnIndex + 2)) } } for (let j = 0; j < cellElements.length; j++) { const needUpdateColspan = groupCellOptions ? j === groupCellOptions.columnIndex + 1 : j === transparentColumnIndex; cellElements[j].setAttribute("aria-colindex", colIndex); if (needUpdateColspan) { cellElements[j].setAttribute("colspan", colspan); colIndex += colspan } else { colIndex++ } } } _renderTable(options) { let $fixedTable; const fixedColumns = this.getFixedColumns(); this._isFixedColumns = !!fixedColumns.length; const $table = super._renderTable(options); if (this._isFixedColumns) { var _change$items2; const change = null === options || void 0 === options ? void 0 : options.change; const $fixedDataRows = this._getRowElements(this._fixedTableElement); const needPartialUpdate = (null === change || void 0 === change ? void 0 : change.virtualColumnsScrolling) && $fixedDataRows.length === (null === change || void 0 === change || null === (_change$items2 = change.items) || void 0 === _change$items2 ? void 0 : _change$items2.length); this._isFixedTableRendering = true; if (needPartialUpdate && true !== this.option("scrolling.legacyMode")) { var _options$change; this._partialUpdateFixedTable(fixedColumns, null === options || void 0 === options || null === (_options$change = options.change) || void 0 === _options$change ? void 0 : _options$change.items); this._isFixedTableRendering = false } else { const columnIndices = null === change || void 0 === change ? void 0 : change.columnIndices; this._correctColumnIndicesForFixedColumns(fixedColumns, change); $fixedTable = this._createTable(fixedColumns); this._renderRows($fixedTable, (0, _extend.extend)({}, options, { columns: fixedColumns })); this._updateContent($fixedTable, change, true); if (columnIndices) { change.columnIndices = columnIndices } this._isFixedTableRendering = false } } else { this._fixedTableElement && this._fixedTableElement.parent().remove(); this._fixedTableElement = null } return $table } _renderRow($table, options) { let fixedCorrection; let { cells: cells } = options.row; super._renderRow.apply(this, arguments); if (this._isFixedTableRendering && cells && cells.length) { fixedCorrection = 0; const fixedCells = options.row.cells || []; cells = cells.slice(); options.row.cells = cells; for (let i = 0; i < fixedCells.length; i++) { if (fixedCells[i].column && "transparent" === fixedCells[i].column.command) { fixedCorrection = (fixedCells[i].column.colspan || 1) - 1; continue } cells[i + fixedCorrection] = fixedCells[i] } } } _createCell(options) { const that = this; const { column: column } = options; const columnCommand = column && column.command; const { rowType: rowType } = options; const $cell = super._createCell.apply(that, arguments); let fixedColumns; let prevFixedColumn; let transparentColumnIndex; if (that._isFixedTableRendering || "filter" === rowType) { fixedColumns = that.getFixedColumns(); transparentColumnIndex = getTransparentColumnIndex(fixedColumns); prevFixedColumn = fixedColumns[transparentColumnIndex - 1] } if (that._isFixedTableRendering) { if ("transparent" === columnCommand) { $cell.addClass("dx-pointer-events-none").toggleClass("dx-first-cell", 0 === transparentColumnIndex || prevFixedColumn && "expand" === prevFixedColumn.command).toggleClass("dx-last-cell", fixedColumns.length && transparentColumnIndex === fixedColumns.length - 1); if ("freeSpace" !== rowType) { _m_utils.default.setEmptyText($cell) } } } else if ("filter" === rowType) { $cell.toggleClass("dx-first-cell", options.columnIndex === transparentColumnIndex) } const isRowAltStyle = that.option("rowAlternationEnabled") && options.isAltRow; const isSelectAllCell = "multiple" === that.option("selection.mode") && 0 === options.columnIndex && "header" === options.rowType; if (_browser.default.mozilla && options.column.fixed && "group" !== options.rowType && !isRowAltStyle && !isSelectAllCell) { $cell.addClass("dx-col-fixed") } return $cell } _getContent(isFixedTableRendering) { var _this$_fixedTableElem; return isFixedTableRendering ? null === (_this$_fixedTableElem = this._fixedTableElement) || void 0 === _this$_fixedTableElem ? void 0 : _this$_fixedTableElem.parent() : super._getContent.apply(this, arguments) } _wrapTableInScrollContainer($table, isFixedTableRendering) { const $scrollContainer = super._wrapTableInScrollContainer.apply(this, arguments); if (this._isFixedTableRendering || isFixedTableRendering) { $scrollContainer.addClass(this.addWidgetPrefix("content-fixed")) } return $scrollContainer } _renderCellContent($cell, options) { let isEmptyCell; const { column: column } = options; const isFixedTableRendering = this._isFixedTableRendering; const isGroupCell = "group" === options.rowType && (0, _type.isDefined)(column.groupIndex); if (isFixedTableRendering && isGroupCell && !column.command && !column.groupCellTemplate) { $cell.css("pointerEvents", "none") } if (!isFixedTableRendering && this._isFixedColumns) { isEmptyCell = column.fixed || column.command && false !== column.fixed; if (isGroupCell) { isEmptyCell = false; if (options.row.summaryCells && options.row.summaryCells.length) { var _this$_getAlignByColu; const columns = this._columnsController.getVisibleColumns(); const alignByFixedColumnCellCount = (null === (_this$_getAlignByColu = this._getAlignByColumnCellCount) || void 0 === _this$_getAlignByColu ? void 0 : _this$_getAlignByColu.call(this, column.colspan, { columns: columns, row: options.row, isFixed: true })) ?? 0; if (alignByFixedColumnCellCount > 0) { const transparentColumnIndex = getTransparentColumnIndex(this._columnsController.getFixedColumns()); isEmptyCell = columns.length - alignByFixedColumnCellCount < transparentColumnIndex } } } if (isEmptyCell) { if (column.command && "buttons" !== column.type || "group" === options.rowType) { $cell.html(" ").addClass(column.cssClass); return } $cell.addClass("dx-hidden-cell") } } if ("transparent" !== column.command) { super._renderCellContent.apply(this, arguments) } } _getCellElementsCore(rowIndex) { const cellElements = super._getCellElementsCore.apply(this, arguments); const isGroupRow = null === cellElements || void 0 === cellElements ? void 0 : cellElements.parent().hasClass("dx-group-row"); const headerRowIndex = "columnHeadersView" === this.name ? rowIndex : void 0; if (this._fixedTableElement && cellElements) { const fixedColumns = this.getFixedColumns(headerRowIndex); const fixedCellElements = this._getRowElements(this._fixedTableElement).eq(rowIndex).children("td"); (0, _iterator.each)(fixedCellElements, ((columnIndex, cell) => { if (isGroupRow) { if (cellElements[columnIndex] && "hidden" !== cell.style.visibility) { cellElements[columnIndex] = cell } } else { const fixedColumn = fixedColumns[columnIndex]; if (fixedColumn) { if ("transparent" === fixedColumn.command) { if (fixedCellElements.eq(columnIndex).hasClass("dx-master-detail-cell")) { cellElements[columnIndex] = cell || cellElements[columnIndex] } } else { const fixedColumnIndex = this._columnsController.getVisibleIndexByColumn(fixedColumn, headerRowIndex); cellElements[fixedColumnIndex] = cell || cellElements[fixedColumnIndex] } } } })) } return cellElements } getColumnWidths(fixedTableElement) { const result = super.getColumnWidths(); const fixedColumns = this.getFixedColumns(); const fixedWidths = this._fixedTableElement && result.length ? super.getColumnWidths(this._fixedTableElement) : void 0; return normalizeColumnWidths(fixedColumns, result, fixedWidths) } getTableElement(isFixedTableRendering) { isFixedTableRendering = this._isFixedTableRendering || isFixedTableRendering; const tableElement = isFixedTableRendering ? this._fixedTableElement : super.getTableElement(); return tableElement } setTableElement(tableElement, isFixedTableRendering) { if (this._isFixedTableRendering || isFixedTableRendering) { this._fixedTableElement = tableElement.addClass("dx-pointer-events-none") } else { super.setTableElement(tableElement) } } getColumns(rowIndex) { const $tableElement = this.getTableElement(); if (this._isFixedTableRendering) { return this.getFixedColumns(rowIndex) } return super.getColumns(rowIndex, $tableElement) } getRowIndex($row) { const $fixedTable = this._fixedTableElement; if ($fixedTable && $fixedTable.find($row).length) { return this._getRowElements($fixedTable).index($row) } return super.getRowIndex($row) } getTableElements() { let result = super.getTableElements.apply(this, arguments); if (this._fixedTableElement) { result = (0, _renderer.default)([result.get(0), this._fixedTableElement.get(0)]) } return result } getFixedColumns(rowIndex) { return this._columnsController.getFixedColumns(rowIndex) } getFixedColumnsOffset() { let offset = { left: 0, right: 0 }; let $transparentColumn; if (this._fixedTableElement) { $transparentColumn = this.getTransparentColumnElement(); const positionTransparentColumn = $transparentColumn.position(); offset = { left: positionTransparentColumn.left, right: (0, _size.getOuterWidth)(this.element(), true) - ((0, _size.getOuterWidth)($transparentColumn, true) + positionTransparentColumn.left) } } return offset } getTransparentColumnElement() { return this._fixedTableElement && this._fixedTableElement.find(".dx-pointer-events-none").first() } getFixedTableElement() { return this._fixedTableElement } isFixedColumns() { return this._isFixedColumns } _resizeCore() { super._resizeCore(); this.synchronizeRows() } setColumnWidths(options) { var _options$optionNames; const { widths: widths } = options; const visibleColumns = this._columnsController.getVisibleColumns(); const isColumnWidthsSynced = (null === widths || void 0 === widths ? void 0 : widths.length) && visibleColumns.some((column => (0, _type.isDefined)(column.visibleWidth))); const isColumnWidthChanged = null === (_options$optionNames = options.optionNames) || void 0 === _options$optionNames ? void 0 : _options$optionNames.width; super.setColumnWidths(options); if (this._fixedTableElement) { const hasAutoWidth = null === widths || void 0 === widths ? void 0 : widths.some((width => "auto" === width || !(0, _type.isDefined)(width))); const needVisibleColumns = hasAutoWidth && (!isColumnWidthsSynced || !this.isScrollbarVisible(true)); const columns = needVisibleColumns ? visibleColumns : this.getFixedColumns(); this.setFixedTableColumnWidths(columns, widths) } const wordWrapEnabled = this.option("wordWrapEnabled"); const needSynchronizeRows = isColumnWidthsSynced || isColumnWidthChanged && wordWrapEnabled; if (needSynchronizeRows) { this.synchronizeRows() } } setFixedTableColumnWidths(columns, widths) { if (!this._fixedTableElement || !widths) { return } const $cols = this._fixedTableElement.children("colgroup").children("col"); $cols.toArray().forEach((col => col.removeAttribute("style"))); let columnIndex = 0; columns.forEach((column => { if (column.colspan) { columnIndex += column.colspan; return } const colWidth = (0, _m_columns_view.normalizeWidth)(widths[columnIndex]); if ((0, _type.isDefined)(colWidth)) { (0, _style.setWidth)($cols.eq(columnIndex), colWidth) } columnIndex += 1 })) } _getClientHeight(element) { const boundingClientRectElement = element.getBoundingClientRect && (0, _position.getBoundingRect)(element); return boundingClientRectElement && boundingClientRectElement.height ? boundingClientRectElement.height : element.clientHeight } synchronizeRows() { const rowHeights = []; const fixedRowHeights = []; let rowIndex; let $rowElements; let $fixedRowElements; let $contentElement; this.waitAsyncTemplates(true).done((() => { if (this._isFixedColumns && this._tableElement && this._fixedTableElement) { const heightTable = this._getClientHeight(this._tableElement.get(0)); const heightFixedTable = this._getClientHeight(this._fixedTableElement.get(0)); $rowElements = this._getRowElements(this._tableElement); $fixedRowElements = this._getRowElements(this._fixedTableElement); $contentElement = this._findContentElement(); if (heightTable !== heightFixedTable) { $contentElement && $contentElement.css("height", heightTable); $rowElements.css("height", ""); $fixedRowElements.css("height", ""); for (rowIndex = 0; rowIndex < $rowElements.length; rowIndex++) { rowHeights.push(this._getClientHeight($rowElements.get(rowIndex))); fixedRowHeights.push(this._getClientHeight($fixedRowElements.get(rowIndex))) } for (rowIndex = 0; rowIndex < $rowElements.length; rowIndex++) { const rowHeight = rowHeights[rowIndex]; const fixedRowHeight = fixedRowHeights[rowIndex]; if (rowHeight > fixedRowHeight) { $fixedRowElements.eq(rowIndex).css("height", rowHeight) } else if (rowHeight < fixedRowHeight) { $rowElements.eq(rowIndex).css("height", fixedRowHeight) } } $contentElement && $contentElement.css("height", "") } } })) } setScrollerSpacing(width, hWidth) { const rtlEnabled = this.option("rtlEnabled"); super.setScrollerSpacing(width); this.element().children(`.${this.addWidgetPrefix("content-fixed")}`).css({ paddingLeft: rtlEnabled ? width : "", paddingRight: !rtlEnabled ? width : "" }) } }; exports.columnFixingModule = { defaultOptions: () => ({ columnFixing: { enabled: false, texts: { fix: _message.default.format("dxDataGrid-columnFixingFix"), unfix: _message.default.format("dxDataGrid-columnFixingUnfix"), leftPosition: _message.default.format("dxDataGrid-columnFixingLeftPosition"), rightPosition: _message.default.format("dxDataGrid-columnFixingRightPosition") } } }), extenders: { views: { columnHeadersView: Base => class extends(baseFixedColumns(Base)) { _getRowVisibleColumns(rowIndex) { if (this._isFixedTableRendering) { return this.getFixedColumns(rowIndex) } return super._getRowVisibleColumns(rowIndex) } getContextMenuItems(options) { const { column: column } = options; const columnFixingOptions = this.option("columnFixing"); let items = super.getContextMenuItems(options); if (options.row && "header" === options.row.rowType) { if (true === columnFixingOptions.enabled && column && column.allowFixing) { const onItemClick = params => { switch (params.itemData.value) { case "none": this._columnsController.columnOption(column.index, "fixed", false); break; case "left": this._columnsController.columnOption(column.index, { fixed: true, fixedPosition: "left" }); break; case "right": this._columnsController.columnOption(column.index, { fixed: true, fixedPosition: "right" }) } }; items = items || []; items.push({ text: columnFixingOptions.texts.fix, beginGroup: true, items: [{ text: columnFixingOptions.texts.leftPosition, value: "left", disabled: column.fixed && (!column.fixedPosition || "left" === column.fixedPosition), onItemClick: onItemClick }, { text: columnFixingOptions.texts.rightPosition, value: "right", disabled: column.fixed && "right" === column.fixedPosition, onItemClick: onItemClick }] }, { text: columnFixingOptions.texts.unfix, value: "none", disabled: !column.fixed, onItemClick: onItemClick }) } } return items } getFixedColumnElements(rowIndex) { const that = this; if ((0, _type.isDefined)(rowIndex)) { return this._fixedTableElement && this._getRowElements(this._fixedTableElement).eq(rowIndex).children() } const columnElements = that.getColumnElements(); const $transparentColumnElement = that.getTransparentColumnElement(); if (columnElements && $transparentColumnElement && $transparentColumnElement.length) { const transparentColumnIndex = getTransparentColumnIndex(that.getFixedColumns()); columnElements.splice(transparentColumnIndex, $transparentColumnElement.get(0).colSpan, $transparentColumnElement.get(0)) } return columnElements } getColumnWidths() { const that = this; let fixedWidths; const result = super.getColumnWidths(); const $fixedColumnElements = that.getFixedColumnElements(); const fixedColumns = that.getFixedColumns(); if (that._fixedTableElement) { if ($fixedColumnElements && $fixedColumnElements.length) { fixedWidths = that._getWidths($fixedColumnElements) } else { fixedWidths = super.getColumnWidths(that._fixedTableElement) } } return normalizeColumnWidths(fixedColumns, result, fixedWidths) } }, rowsView: Base => class extends(baseFixedColumns(Base)) { dispose() { super.dispose.apply(this, arguments); clearTimeout(this._fixedScrollTimeout) } optionChanged(args) { super.optionChanged(args); if ("hoverStateEnabled" === args.name && this._isFixedColumns) { args.value ? this._attachHoverEvents() : this._detachHoverEvents() } } _detachHoverEvents() { const element = this.element(); if (this._fixedTableElement && this._tableElement) { _events_engine.default.off(element, "mouseover mouseout", ".dx-data-row") } } _attachHoverEvents() { if (this._fixedTableElement && this._tableElement) { _events_engine.default.on(this.element(), "mouseover mouseout", ".dx-data-row", this.createAction((args => { const { event: event } = args; const rowIndex = this.getRowIndex((0, _renderer.default)(event.target).closest(".dx-row")); const isHover = "mouseover" === event.type; if (rowIndex >= 0) { this._tableElement && this._getRowElements(this._tableElement).eq(rowIndex).toggleClass("dx-state-hover", isHover); this._fixedTableElement && this._getRowElements(this._fixedTableElement).eq(rowIndex).toggleClass("dx-state-hover", isHover) } }))) } } _getScrollDelay() { var _this$_resizingContro; const hasResizeTimeout = null === (_this$_resizingContro = this._resizingController) || void 0 === _this$_resizingContro ? void 0 : _this$_resizingContro.hasResizeTimeout(); if (hasResizeTimeout) { return this.option("scrolling.updateTimeout") } return _browser.default.mozilla ? 60 : 0 } _findContentElement(isFixedTableRendering) { let $content; let scrollTop; const contentClass = this.addWidgetPrefix("content"); const element = this.element(); isFixedTableRendering = this._isFixedTableRendering || isFixedTableRendering; if (element && isFixedTableRendering) { $content = element.children(`.${contentClass}`); const scrollable = this.getScrollable(); if (!$content.length && scrollable) { $content = (0, _renderer.default)("
").addClass(contentClass); _events_engine.default.on($content, "scroll", (e => { const { target: target } = e; const scrollDelay = this._getScrollDelay(); clearTimeout(this._fixedScrollTimeout); this._fixedScrollTimeout = setTimeout((() => { scrollTop = (0, _renderer.default)(target).scrollTop(); scrollable.scrollTo({ y: scrollTop }) }), scrollDelay) })); _events_engine.default.on($content, _wheel.name, (e => { const $nearestScrollable = (0, _renderer.default)(e.target).closest(".dx-scrollable"); let shouldScroll = false; if (scrollable && scrollable.$element().is($nearestScrollable)) { shouldScroll = true } else { const nearestScrollableInstance = $nearestScrollable.length && _ui.default.getInstance($nearestScrollable.get(0)); const nearestScrollableHasVerticalScrollbar = nearestScrollableInstance && nearestScrollableInstance.scrollHeight() - nearestScrollableInstance.clientHeight() > 0; shouldScroll = nearestScrollableInstance && !nearestScrollableHasVerticalScrollbar } if (shouldScroll) { scrollTop = scrollable.scrollTop(); scrollable.scrollTo({ y: scrollTop - e.delta }); const scrollableTop = scrollable.scrollTop() + scrollable.clientHeight(); const scrollableHeight = scrollable.scrollHeight() + this.getScrollbarWidth(); const isPreventDefault = scrollable.scrollTop() > 0 && scrollableTop < scrollableHeight; if (isPreventDefault) { return false } } return })); $content.appendTo(element) } return $content } return super._findContentElement() } _updateScrollable() { super._updateScrollable(); const scrollable = this.getScrollable(); if (null !== scrollable && void 0 !== scrollable && scrollable._disposed) { return } const scrollTop = scrollable && scrollable.scrollOffset().top; this._updateFixedTablePosition(scrollTop) } _renderContent(contentElement, tableElement, isFixedTableRendering) { if (this._isFixedTableRendering || isFixedTableRendering) { return contentElement.empty().addClass(`${this.addWidgetPrefix("content")} ${this.addWidgetPrefix("content-fixed")}`).append(tableElement) } return super._renderContent(contentElement, tableElement) } _getGroupCellOptions(options) { if (this._isFixedTableRendering) { return super._getGroupCellOptions((0, _extend.extend)({}, options, { columns: this._columnsController.getVisibleColumns() })) } return super._getGroupCellOptions(options) } _renderGroupedCells($row, options) { return super._renderGroupedCells($row, (0, _extend.extend)({}, options, { columns: this._columnsController.getVisibleColumns() })) } _renderGroupSummaryCells($row, options) { if (this._isFixedTableRendering) { super._renderGroupSummaryCells($row, (0, _extend.extend)({}, options, { columns: this._columnsController.getVisibleColumns() })) } else { super._renderGroupSummaryCells($row, options) } } _hasAlignByColumnSummaryItems(columnIndex, options) { const result = super._hasAlignByColumnSummaryItems.apply(this, arguments); const column = options.columns[columnIndex]; if (options.isFixed) { return column.fixed && (result || "right" === column.fixedPosition) } return result && (!this._isFixedColumns || !column.fixed) } _renderGroupSummaryCellsCore($groupCell, options, groupCellColSpan, alignByColumnCellCount) { let alignByFixedColumnCellCount; if (this._isFixedTableRendering) { options.isFixed = true; alignByFixedColumnCellCount = this._getAlignByColumnCellCount(groupCellColSpan, options); options.isFixed = false; const startColumnIndex = options.columns.length - alignByFixedColumnCellCount; options = (0, _extend.extend)({}, options, { columns: this.getFixedColumns() }); const transparentColumnIndex = getTransparentColumnIndex(options.columns); if (startColumnIndex < transparentColumnIndex) { alignByFixedColumnCellCount -= options.columns[transparentColumnIndex].colspan - 1 || 0; groupCellColSpan -= options.columns[transparentColumnIndex].colspan - 1 || 0 } else if (alignByColumnCellCount > 0) { $groupCell.css("visibility", "hidden") } alignByColumnCellCount = alignByFixedColumnCellCount } super._renderGroupSummaryCellsCore($groupCell, options, groupCellColSpan, alignByColumnCellCount) } _getSummaryCellIndex(columnIndex, columns) { if (this._isFixedTableRendering) { const transparentColumnIndex = getTransparentColumnIndex(columns); if (columnIndex > transparentColumnIndex) { columnIndex += columns[transparentColumnIndex].colspan - 1 } return columnIndex } return super._getSummaryCellIndex.apply(this, arguments) } _renderCore(change) { this._detachHoverEvents(); const deferred = super._renderCore(change); const isFixedColumns = this._isFixedColumns; this.element().toggleClass("dx-fixed-columns", isFixedColumns); if (this.option("hoverStateEnabled") && isFixedColumns) { this._attachHoverEvents() } return deferred } setAriaOwns(headerTableId, footerTableId, isFixed) { if (isFixed) { var _this$element; const contentFixedClass = this.addWidgetPrefix("content-fixed"); const $contentFixedElement = null === (_this$element = this.element()) || void 0 === _this$element ? void 0 : _this$element.children(`.${contentFixedClass}`); const $fixedTableElement = this.getFixedTableElement(); if ($contentFixedElement.length && null !== $fixedTableElement && void 0 !== $fixedTableElement && $fixedTableElement.length) { this.setAria("owns", `${headerTableId??""} ${$fixedTableElement.attr("id")??""} ${footerTableId??""}`.trim(), $contentFixedElement) } } else { super.setAriaOwns.apply(this, arguments) } } setRowsOpacity(columnIndex, value) { super.setRowsOpacity(columnIndex, value); const $rows = this._getRowElements(this._fixedTableElement); this._setRowsOpacityCore($rows, this.getFixedColumns(), columnIndex, value) } getCellIndex($cell) { const $fixedTable = this._fixedTableElement; let cellIndex = 0; if ($fixedTable && $cell.is("td") && $cell.closest($fixedTable).length) { const columns = this.getFixedColumns(); (0, _iterator.each)(columns, ((index, column) => { if (index === $cell[0].cellIndex) { return false } if (column.colspan) { cellIndex += column.colspan; return } cellIndex++; return })); return cellIndex } return super.getCellIndex.apply(this, arguments) } _updateFixedTablePosition(scrollTop, needFocus) { if (this._fixedTableElement && this._tableElement) { let $focusedElement; this._fixedTableElement.parent().scrollTop(scrollTop); if (needFocus && this._editorFactoryController) { $focusedElement = this._editorFactoryController.focus(); $focusedElement && this._editorFactoryController.focus($focusedElement) } } } setScrollerSpacing(vWidth, hWidth) { const that = this; const styles = { marginBottom: 0 }; const $fixedContent = that.element().children(`.${this.addWidgetPrefix("content-fixed")}`); if ($fixedContent.length && that._fixedTableElement) { $fixedContent.css(styles); that._fixedTableElement.css(styles); styles[that.option("rtlEnabled") ? "marginLeft" : "marginRight"] = vWidth; styles.marginBottom = hWidth; const useNativeScrolling = that._scrollable && that._scrollable.option("useNative"); (useNativeScrolling ? $fixedContent : that._fixedTableElement).css(styles) } } _getElasticScrollTop(e) { let elasticScrollTop = 0; if (e.scrollOffset.top < 0) { elasticScrollTop = -e.scrollOffset.top } else if (e.reachedBottom) { const $scrollableContent = (0, _renderer.default)(e.component.content()); const $scrollableContainer = (0, _renderer.default)(e.component.container()); const maxScrollTop = Math.max($scrollableContent.get(0).clientHeight - $scrollableContainer.get(0).clientHeight, 0); elasticScrollTop = Math.min(maxScrollTop - e.scrollOffset.top, 0) } return Math.floor(elasticScrollTop) } _applyElasticScrolling(e) { if (this._fixedTableElement) { const elasticScrollTop = this._getElasticScrollTop(e); if (0 !== Math.ceil(elasticScrollTop)) { (0, _translator.move)(this._fixedTableElement, { top: elasticScrollTop }) } else { this._fixedTableElement.css("transform", "") } } } _handleScroll(e) { this._updateFixedTablePosition(e.scrollOffset.top, true); this._applyElasticScrolling(e); super._handleScroll(e) } _updateContentPosition(isRender) { super._updateContentPosition.apply(this, arguments); if (!isRender) { this._updateFixedTablePosition(this._scrollTop) } } _afterRowPrepared(e) { if (this._isFixedTableRendering) { return } super._afterRowPrepared(e) } _scrollToElement($element) { super._scrollToElement($element, this.getFixedColumnsOffset()) } }, footerView: Base => class extends(baseFixedColumns(Base)) {} }, controllers: { draggingHeader: Base => class extends Base { _generatePointsByColumns(options) { const visibleColumns = options.columns; const { targetDraggingPanel: targetDraggingPanel } = options; if (targetDraggingPanel && "headers" === targetDraggingPanel.getName() && targetDraggingPanel.isFixedColumns()) { if (options.sourceColumn.fixed) { if (!options.rowIndex) { options.columnElements = targetDraggingPanel.getFixedColumnElements(0) } options.columns = targetDraggingPanel.getFixedColumns(options.rowIndex); const pointsByColumns = super._generatePointsByColumns(options); ! function(columns, fixedColumns, pointsByColumns) { const transparentColumnIndex = getTransparentColumnIndex(fixedColumns); const correctIndex = columns.length - fixedColumns.length; (0, _iterator.each)(pointsByColumns, ((_, point) => { if (point.index > transparentColumnIndex) { point.columnIndex += correctIndex; point.index += correctIndex } })); return pointsByColumns }(visibleColumns, options.columns, pointsByColumns); return pointsByColumns } } return super._generatePointsByColumns(options) } _pointCreated(point, columns, location, sourceColumn) { const result = super._pointCreated.apply(this, arguments); const targetColumn = columns[point.columnIndex]; const $transparentColumn = this._columnHeadersView.getTransparentColumnElement(); if (!result && "headers" === location && $transparentColumn && $transparentColumn.length) { const boundingRect = (0, _position.getBoundingRect)($transparentColumn.get(0)); if (sourceColumn && sourceColumn.fixed) { return "right" === sourceColumn.fixedPosition ? point.x < boundingRect.right : point.x > boundingRect.left } if (targetColumn && targetColumn.fixed && "right" !== targetColumn.fixedPosition) { return true } return point.x < boundingRect.left || point.x > boundingRect.right } return result } }, columnsResizer: Base => class extends Base { _generatePointsByColumns() { const that = this; const columnsController = that._columnsController; const columns = columnsController && that._columnsController.getVisibleColumns(); const fixedColumns = columnsController && that._columnsController.getFixedColumns(); const transparentColumnIndex = getTransparentColumnIndex(fixedColumns); const correctIndex = columns.length - fixedColumns.length; const cells = that._columnHeadersView.getFixedColumnElements(); super._generatePointsByColumns(); if (cells && cells.length > 0) { that._pointsByFixedColumns = _m_utils.default.getPointsByColumns(cells, (point => { if (point.index > transparentColumnIndex) { point.columnIndex += correctIndex; point.index += correctIndex } return that._pointCreated(point, columns.length, columns) })) } } _getTargetPoint(pointsByColumns, currentX, deltaX) { const $transparentColumn = this._columnHeadersView.getTransparentColumnElement(); if ($transparentColumn && $transparentColumn.length) { const boundingRect = (0, _position.getBoundingRect)($transparentColumn.get(0)); if (currentX <= boundingRect.left || currentX >= boundingRect.right) { return super._getTargetPoint(this._pointsByFixedColumns, currentX, deltaX) } } return super._getTargetPoint(pointsByColumns, currentX, deltaX) } }, resizing: Base => class extends Base { _setAriaOwns() { var _this$_columnHeadersV, _this$_footerView, _this$_rowsView; super._setAriaOwns.apply(this, arguments); const headerFixedTable = null === (_this$_columnHeadersV = this._columnHeadersView) || void 0 === _this$_columnHeadersV ? void 0 : _this$_columnHeadersV.getFixedTableElement(); const footerFixedTable = null === (_this$_footerView = this._footerView) || void 0 === _this$_footerView ? void 0 : _this$_footerView.getFixedTableElement(); null === (_this$_rowsView = this._rowsView) || void 0 === _this$_rowsView || _this$_rowsView.setAriaOwns(null === headerFixedTable || void 0 === headerFixedTable ? void 0 : headerFixedTable.attr("id"), null === footerFixedTable || void 0 === footerFixedTable ? void 0 : footerFixedTable.attr("id"), true) } }, keyboardNavigation: Base => class extends Base { _toggleInertAttr(value) { var _this$_rowsView2; const $fixedContent = null === (_this$_rowsView2 = this._rowsView) || void 0 === _this$_rowsView2 ? void 0 : _this$_rowsView2.getFixedContentElement(); if (value) { null === $fixedContent || void 0 === $fixedContent || $fixedContent.attr("inert", true) } else { null === $fixedContent || void 0 === $fixedContent || $fixedContent.removeAttr("inert") } } } } } } }, 14509: /*!***********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/column_headers/m_column_headers.js ***! \***********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.columnHeadersModule = exports.ColumnHeadersView = void 0; var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../../core/dom_adapter */ 73349)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _size = __webpack_require__( /*! ../../../../core/utils/size */ 58664); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../../events/core/events_engine */ 55994)); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109)); var _m_accessibility = __webpack_require__( /*! ../m_accessibility */ 9130); var _m_columns_view = __webpack_require__( /*! ../views/m_columns_view */ 57318); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const createCellContent = function(that, $cell, options) { const $cellContent = (0, _renderer.default)("
").addClass(that.addWidgetPrefix("text-content")); that.setAria("role", "presentation", $cellContent); addCssClassesToCellContent(that, $cell, options.column, $cellContent); const showColumnLines = that.option("showColumnLines"); const contentAlignment = that.getController("columns").getHeaderContentAlignment(options.column.alignment); return $cellContent[showColumnLines || "right" === contentAlignment ? "appendTo" : "prependTo"]($cell) }; function addCssClassesToCellContent(that, $cell, column, $cellContent) { const $indicatorElements = that._getIndicatorElements($cell, true); const $visibleIndicatorElements = that._getIndicatorElements($cell); const indicatorCount = $indicatorElements && $indicatorElements.length; const columnAlignment = that._getColumnAlignment(column.alignment); const sortIndicatorClassName = `.${that._getIndicatorClassName("sort")}`; const sortIndexIndicatorClassName = `.${that._getIndicatorClassName("sortIndex")}`; const $sortIndicator = $visibleIndicatorElements.filter(sortIndicatorClassName); const $sortIndexIndicator = $visibleIndicatorElements.children().filter(sortIndexIndicatorClassName); $cellContent = $cellContent || $cell.children(`.${that.addWidgetPrefix("text-content")}`); $cellContent.toggleClass("dx-text-content-alignment-" + columnAlignment, indicatorCount > 0).toggleClass("dx-text-content-alignment-" + ("left" === columnAlignment ? "right" : "left"), indicatorCount > 0 && "center" === column.alignment).toggleClass("dx-sort-indicator", !!$sortIndicator.length).toggleClass("dx-sort-index-indicator", !!$sortIndexIndicator.length).toggleClass("dx-header-filter-indicator", !!$visibleIndicatorElements.filter(`.${that._getIndicatorClassName("headerFilter")}`).length) } class ColumnHeadersView extends _m_columns_view.ColumnsView { init() { super.init(); this._headerPanelView = this.getView("headerPanel"); this._headerFilterController = this.getController("headerFilter"); this._dataController = this.getController("data") } _createTable() { const $table = super._createTable.apply(this, arguments); _events_engine.default.on($table, "mousedown selectstart", this.createAction((e => { const { event: event } = e; if (event.shiftKey) { event.preventDefault() } }))); return $table } _isLegacyKeyboardNavigation() { return this.option("useLegacyKeyboardNavigation") } _getDefaultTemplate(column) { const that = this; return function($container, options) { const { caption: caption } = column; const needCellContent = !column.command || caption && "expand" !== column.command; if ("empty" === column.command) { that._renderEmptyMessage($container, options) } else if (needCellContent) { const $content = createCellContent(that, $container, options); $content.text(caption) } else if (column.command) { $container.html(" ") } } } _renderEmptyMessage($container, options) { const textEmpty = this._getEmptyHeaderText(); if (!textEmpty) { $container.html(" "); return } const $cellContent = createCellContent(this, $container, options); const needSplit = textEmpty.includes("{0}"); if (needSplit) { const [leftPart, rightPart] = textEmpty.split("{0}"); const columnChooserTitle = _message.default.format("dxDataGrid-emptyHeaderColumnChooserText"); const columnChooserView = this._columnChooserView; const $link = (0, _renderer.default)("").text(columnChooserTitle).addClass("dx-link"); _events_engine.default.on($link, "click", this.createAction((() => columnChooserView.showColumnChooser()))); $cellContent.append(_dom_adapter.default.createTextNode(leftPart)).append($link).append(_dom_adapter.default.createTextNode(rightPart)) } else { $cellContent.text(textEmpty) } } _getEmptyHeaderText() { const hasHiddenColumns = !!this._columnChooserView.hasHiddenColumns(); const hasGroupedColumns = !!this._headerPanelView.hasGroupedColumns(); switch (true) { case hasHiddenColumns && hasGroupedColumns: return _message.default.format("dxDataGrid-emptyHeaderWithColumnChooserAndGroupPanelText"); case hasGroupedColumns: return _message.default.format("dxDataGrid-emptyHeaderWithGroupPanelText"); case hasHiddenColumns: return _message.default.format("dxDataGrid-emptyHeaderWithColumnChooserText"); default: return "" } } _getHeaderTemplate(column) { return column.headerCellTemplate || { allowRenderToDetachedContainer: true, render: this._getDefaultTemplate(column) } } _processTemplate(template, options) { const that = this; let resultTemplate; const { column: column } = options; const renderingTemplate = super._processTemplate(template); if ("header" === options.rowType && renderingTemplate && column.headerCellTemplate && !column.command) { resultTemplate = { render(options) { const $content = createCellContent(that, options.container, options.model); renderingTemplate.render((0, _extend.extend)({}, options, { container: $content })) } } } else { resultTemplate = renderingTemplate } return resultTemplate } _handleDataChanged(e) { if ("refresh" !== e.changeType) { return } if (this._isGroupingChanged || this._requireReady) { this._isGroupingChanged = false; this.render() } } _renderCell($row, options) { const $cell = super._renderCell($row, options); if ("header" === options.row.rowType) { $cell.addClass("dx-cell-focus-disabled"); if (!this._isLegacyKeyboardNavigation()) { if (options.column && !options.column.type) { $cell.attr("tabindex", this.option("tabindex") || 0) } } } return $cell } _setCellAriaAttributes($cell, cellOptions) { super._setCellAriaAttributes($cell, cellOptions); if ("header" === cellOptions.rowType) { if (!cellOptions.column.type) { this.setAria("role", "columnheader", $cell) } if (cellOptions.column && !cellOptions.column.command && !cellOptions.column.isBand) { $cell.attr("id", cellOptions.column.headerId); this.setAria("label", `${_message.default.format("dxDataGrid-ariaColumn")} ${cellOptions.column.caption}`, $cell) } } } _createRow(row) { const $row = super._createRow.apply(this, arguments); $row.toggleClass("dx-column-lines", this.option("showColumnLines")); if ("header" === row.rowType) { $row.addClass("dx-header-row"); if (!this._isLegacyKeyboardNavigation()) { (0, _m_accessibility.registerKeyboardAction)("columnHeaders", this, $row, "td", this._handleActionKeyDown.bind(this)) } } return $row } _processHeaderAction(event, $row) {} _handleActionKeyDown(args) { const { event: event } = args; const $target = (0, _renderer.default)(event.target); this._lastActionElement = event.target; if ($target.is(".dx-header-filter")) { const headerFilterController = this._headerFilterController; const $column = $target.closest("td"); const columnIndex = this.getColumnIndexByElement($column); if (columnIndex >= 0) { headerFilterController.showHeaderFilterMenu(columnIndex, false) } } else { const $row = $target.closest(".dx-row"); this._processHeaderAction(event, $row) } event.preventDefault() } _renderCore() { const $container = this.element(); const change = {}; if (this._tableElement && !this._dataController.isLoaded() && !this._hasRowElements) { return } $container.addClass(this.addWidgetPrefix("headers")).toggleClass(this.addWidgetPrefix("nowrap"), !this.option("wordWrapEnabled")).empty(); this.setAria("role", "presentation", $container); const deferred = this._updateContent(this._renderTable({ change: change }), change); if (this.getRowCount() > 1) { $container.addClass("dx-header-multi-row") } super._renderCore.apply(this, arguments); return deferred } _renderRows() { const that = this; if (that._dataController.isLoaded() || that._hasRowElements) { super._renderRows.apply(that, arguments); that._hasRowElements = true } } _renderRow($table, options) { const rowIndex = 1 === this.getRowCount() ? null : options.row.rowIndex; options.columns = this.getColumns(rowIndex); super._renderRow($table, options) } _createCell(options) { const { column: column } = options; const $cellElement = super._createCell.apply(this, arguments); column.rowspan > 1 && "header" === options.rowType && $cellElement.attr("rowSpan", column.rowspan); return $cellElement } _getRows() { const result = []; const rowCount = this.getRowCount(); if (this.option("showColumnHeaders")) { for (let i = 0; i < rowCount; i++) { result.push({ rowType: "header", rowIndex: i }) } } return result } _getCellTemplate(options) { if ("header" === options.rowType) { return this._getHeaderTemplate(options.column) } } _columnOptionChanged(e) { const { changeTypes: changeTypes } = e; const { optionNames: optionNames } = e; if (changeTypes.grouping || changeTypes.groupExpanding) { if (changeTypes.grouping) { this._isGroupingChanged = true } return } super._columnOptionChanged(e); if (optionNames.width || optionNames.visible) { this.resizeCompleted.fire() } } _isElementVisible(elementOptions) { return elementOptions && elementOptions.visible } _alignCaptionByCenter($cell) { let $indicatorsContainer = this._getIndicatorContainer($cell, true); if ($indicatorsContainer && $indicatorsContainer.length) { $indicatorsContainer.filter(".dx-visibility-hidden").remove(); $indicatorsContainer = this._getIndicatorContainer($cell); $indicatorsContainer.clone().addClass("dx-visibility-hidden").css("float", "").insertBefore($cell.children(`.${this.addWidgetPrefix("text-content")}`)) } } _updateCell($cell, options) { if ("header" === options.rowType && "center" === options.column.alignment) { this._alignCaptionByCenter($cell) } super._updateCell.apply(this, arguments) } _updateIndicator($cell, column, indicatorName) { const $indicatorElement = super._updateIndicator.apply(this, arguments); if ("center" === column.alignment) { this._alignCaptionByCenter($cell) } addCssClassesToCellContent(this, $cell, column); return $indicatorElement } _getIndicatorContainer($cell, returnAll) { const $indicatorsContainer = super._getIndicatorContainer($cell); return returnAll ? $indicatorsContainer : $indicatorsContainer.filter(":not(.dx-visibility-hidden)") } _isSortableElement($target) { return true } getHeadersRowHeight() { const $tableElement = this.getTableElement(); const $headerRows = $tableElement && $tableElement.find(".dx-header-row"); return $headerRows && $headerRows.toArray().reduce(((sum, headerRow) => sum + (0, _size.getHeight)(headerRow)), 0) || 0 } getHeaderElement(index) { const columnElements = this.getColumnElements(); return columnElements && columnElements.eq(index) } getColumnElements(index, bandColumnIndex) { const that = this; let $cellElement; const columnsController = that._columnsController; const rowCount = that.getRowCount(); if (that.option("showColumnHeaders")) { if (rowCount > 1 && (!(0, _type.isDefined)(index) || (0, _type.isDefined)(bandColumnIndex))) { const result = []; const visibleColumns = (0, _type.isDefined)(bandColumnIndex) ? columnsController.getChildrenByBandColumn(bandColumnIndex, true) : columnsController.getVisibleColumns(); (0, _iterator.each)(visibleColumns, ((_, column) => { const rowIndex = (0, _type.isDefined)(index) ? index : columnsController.getRowIndex(column.index); $cellElement = that._getCellElement(rowIndex, columnsController.getVisibleIndex(column.index, rowIndex)); $cellElement && result.push($cellElement.get(0)) })); return (0, _renderer.default)(result) } if (!index || index < rowCount) { return that.getCellElements(index || 0) } } return } getColumnIndexByElement($cell) { const cellIndex = this.getCellIndex($cell); const $row = $cell.closest(".dx-row"); const { rowIndex: rowIndex } = $row[0]; const column = this.getColumns(rowIndex)[cellIndex]; return column ? column.index : -1 } getVisibleColumnIndex(columnIndex, rowIndex) { const column = this.getColumns()[columnIndex]; return column ? this._columnsController.getVisibleIndex(column.index, rowIndex) : -1 } getColumnWidths() { const $columnElements = this.getColumnElements(); if ($columnElements && $columnElements.length) { return this._getWidths($columnElements) } return super.getColumnWidths.apply(this, arguments) } allowDragging(column) { const rowIndex = column && this._columnsController.getRowIndex(column.index); const columns = this.getColumns(rowIndex); const isReorderingEnabled = this.option("allowColumnReordering") ?? this._columnsController.isColumnOptionUsed("allowReordering"); return isReorderingEnabled && column.allowReordering && columns.length > 1 } getBoundingRect() { const that = this; const $columnElements = that.getColumnElements(); if ($columnElements && $columnElements.length) { const offset = that.getTableElement().offset(); return { top: offset.top } } return null } getName() { return "headers" } getColumnCount() { const $columnElements = this.getColumnElements(); return $columnElements ? $columnElements.length : 0 } isVisible() { return this.option("showColumnHeaders") } optionChanged(args) { const that = this; switch (args.name) { case "showColumnHeaders": case "wordWrapEnabled": case "showColumnLines": that._invalidate(true, true); args.handled = true; break; default: super.optionChanged(args) } } getHeight() { return this.getElementHeight() } getContextMenuItems(options) { const that = this; const { column: column } = options; if (options.row && ("header" === options.row.rowType || "detailAdaptive" === options.row.rowType)) { const sortingOptions = that.option("sorting"); if (sortingOptions && "none" !== sortingOptions.mode && column && column.allowSorting) { const onItemClick = function(params) { setTimeout((() => { that._columnsController.changeSortOrder(column.index, params.itemData.value) })) }; return [{ text: sortingOptions.ascendingText, value: "asc", disabled: "asc" === column.sortOrder, icon: "context-menu-sort-asc", onItemClick: onItemClick }, { text: sortingOptions.descendingText, value: "desc", disabled: "desc" === column.sortOrder, icon: "context-menu-sort-desc", onItemClick: onItemClick }, { text: sortingOptions.clearText, value: "none", disabled: !column.sortOrder, icon: "context-menu-sort-none", onItemClick: onItemClick }] } } return } getRowCount() { return this._columnsController && this._columnsController.getRowCount() } setRowsOpacity(columnIndex, value, rowIndex) { let i; let columnElements; const rowCount = this.getRowCount(); const columns = this._columnsController.getColumns(); const column = columns && columns[columnIndex]; const columnID = column && column.isBand && column.index; const setColumnOpacity = (column, index) => { if (column.ownerBand === columnID) { columnElements.eq(index).css({ opacity: value }); if (column.isBand) { this.setRowsOpacity(column.index, value, i + 1) } } }; if ((0, _type.isDefined)(columnID)) { rowIndex = rowIndex || 0; for (i = rowIndex; i < rowCount; i++) { columnElements = this.getCellElements(i); if (columnElements) { const rowColumns = this.getColumns(i); rowColumns.forEach(setColumnOpacity) } } } } } exports.ColumnHeadersView = ColumnHeadersView; exports.columnHeadersModule = { defaultOptions: () => ({ showColumnHeaders: true, cellHintEnabled: true }), views: { columnHeadersView: ColumnHeadersView } } }, 51255: /*!*******************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/column_state_mixin/m_column_state_mixin.js ***! \*******************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.ColumnStateMixin = void 0; var _renderer = (obj = __webpack_require__( /*! ../../../../core/renderer */ 68374), obj && obj.__esModule ? obj : { default: obj }); var obj; var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _position = __webpack_require__( /*! ../../../../core/utils/position */ 37518); const ColumnStateMixin = Base => class extends Base { _applyColumnState(options) { var _that$component; const rtlEnabled = this.option("rtlEnabled"); const columnAlignment = this._getColumnAlignment(options.column.alignment, rtlEnabled); const parameters = (0, _extend.extend)(true, { columnAlignment: columnAlignment }, options); const isGroupPanelItem = parameters.rootElement.hasClass("dx-group-panel-item"); const $indicatorsContainer = this._createIndicatorContainer(parameters, isGroupPanelItem); const $span = (0, _renderer.default)("").addClass(this._getIndicatorClassName(options.name)); const columnsController = null === (_that$component = this.component) || void 0 === _that$component ? void 0 : _that$component.getController("columns"); const indicatorAlignment = (null === columnsController || void 0 === columnsController ? void 0 : columnsController.getHeaderContentAlignment(columnAlignment)) || columnAlignment; parameters.container = $indicatorsContainer; parameters.indicator = $span; this._renderIndicator(parameters); $indicatorsContainer[(isGroupPanelItem || !options.showColumnLines) && "left" === indicatorAlignment ? "appendTo" : "prependTo"](options.rootElement); return $span } _getIndicatorClassName(name) {} _getColumnAlignment(alignment, rtlEnabled) { rtlEnabled = rtlEnabled || this.option("rtlEnabled"); return alignment && "center" !== alignment ? alignment : (0, _position.getDefaultAlignment)(rtlEnabled) } _createIndicatorContainer(options, ignoreIndicatorAlignment) { let $indicatorsContainer = this._getIndicatorContainer(options.rootElement); const indicatorAlignment = "left" === options.columnAlignment ? "right" : "left"; if (!$indicatorsContainer.length) { $indicatorsContainer = (0, _renderer.default)("
").addClass("dx-column-indicators") } this.setAria("role", "presentation", $indicatorsContainer); return $indicatorsContainer.css("float", options.showColumnLines && !ignoreIndicatorAlignment ? indicatorAlignment : null) } _getIndicatorContainer($cell) { return $cell && $cell.find(".dx-column-indicators") } _getIndicatorElements($cell) { const $indicatorContainer = this._getIndicatorContainer($cell); return $indicatorContainer && $indicatorContainer.children() } _renderIndicator(options) { const $container = options.container; const $indicator = options.indicator; $container && $indicator && $container.append($indicator) } _updateIndicators(indicatorName) { const that = this; const columns = that.getColumns(); const $cells = that.getColumnElements(); let $cell; if (!$cells || columns.length !== $cells.length) { return } for (let i = 0; i < columns.length; i++) { $cell = $cells.eq(i); that._updateIndicator($cell, columns[i], indicatorName); const rowOptions = $cell.parent().data("options"); if (rowOptions && rowOptions.cells) { rowOptions.cells[$cell.index()].column = columns[i] } } } _updateIndicator($cell, column, indicatorName) { if (!column.command) { return this._applyColumnState({ name: indicatorName, rootElement: $cell, column: column, showColumnLines: this.option("showColumnLines") }) } return } }; exports.ColumnStateMixin = ColumnStateMixin; exports.default = ColumnStateMixin }, 54057: /*!****************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/columns_controller/const.js ***! \****************************************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.USER_STATE_FIELD_NAMES_15_1 = exports.USER_STATE_FIELD_NAMES = exports.MAX_SAFE_INTEGER = exports.IGNORE_COLUMN_OPTION_NAMES = exports.GROUP_LOCATION = exports.GROUP_COMMAND_COLUMN_NAME = exports.DETAIL_COMMAND_COLUMN_NAME = exports.DEFAULT_COLUMN_OPTIONS = exports.DATATYPE_OPERATIONS = exports.COMMAND_EXPAND_CLASS = exports.COLUMN_OPTION_REGEXP = exports.COLUMN_INDEX_OPTIONS = exports.COLUMN_CHOOSER_LOCATION = void 0; const USER_STATE_FIELD_NAMES_15_1 = exports.USER_STATE_FIELD_NAMES_15_1 = ["filterValues", "filterType", "fixed", "fixedPosition"]; exports.USER_STATE_FIELD_NAMES = ["visibleIndex", "dataField", "name", "dataType", "width", "visible", "sortOrder", "lastSortOrder", "sortIndex", "groupIndex", "filterValue", "bufferedFilterValue", "selectedFilterOperation", "bufferedSelectedFilterOperation", "added"].concat(USER_STATE_FIELD_NAMES_15_1); exports.IGNORE_COLUMN_OPTION_NAMES = { visibleWidth: true, bestFitWidth: true, bufferedFilterValue: true }; exports.COMMAND_EXPAND_CLASS = "dx-command-expand"; exports.MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991; exports.GROUP_COMMAND_COLUMN_NAME = "groupExpand"; exports.DETAIL_COMMAND_COLUMN_NAME = "detailExpand"; exports.COLUMN_OPTION_REGEXP = /columns\[(\d+)\]\.?/gi; exports.DEFAULT_COLUMN_OPTIONS = { visible: true, showInColumnChooser: true }; exports.DATATYPE_OPERATIONS = { number: ["=", "<>", "<", ">", "<=", ">=", "between"], string: ["contains", "notcontains", "startswith", "endswith", "=", "<>"], date: ["=", "<>", "<", ">", "<=", ">=", "between"], datetime: ["=", "<>", "<", ">", "<=", ">=", "between"] }; exports.COLUMN_INDEX_OPTIONS = { visibleIndex: true, groupIndex: true, grouped: true, sortIndex: true, sortOrder: true }; exports.GROUP_LOCATION = "group"; exports.COLUMN_CHOOSER_LOCATION = "columnChooser" }, 10279: /*!*******************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/columns_controller/m_columns_controller.js ***! \*******************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.columnsControllerModule = exports.ColumnsController = void 0; var _config = _interopRequireDefault(__webpack_require__( /*! ../../../../core/config */ 80209)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _callbacks = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/callbacks */ 44504)); var _data = __webpack_require__( /*! ../../../../core/utils/data */ 47617); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _inflector = __webpack_require__( /*! ../../../../core/utils/inflector */ 78008); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _object = __webpack_require__( /*! ../../../../core/utils/object */ 48013); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _variable_wrapper = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/variable_wrapper */ 26974)); var _abstract_store = _interopRequireDefault(__webpack_require__( /*! ../../../../data/abstract_store */ 67403)); var _data_source = __webpack_require__( /*! ../../../../data/data_source/data_source */ 85273); var _utils = __webpack_require__( /*! ../../../../data/data_source/utils */ 9234); var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/date */ 91500)); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109)); var _filtering = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/shared/filtering */ 18740)); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/widget/ui.errors */ 96688)); var _m_modules = _interopRequireDefault(__webpack_require__( /*! ../m_modules */ 15943)); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../m_utils */ 60082)); var _const = __webpack_require__( /*! ./const */ 54057); var _m_columns_controller_utils = __webpack_require__( /*! ./m_columns_controller_utils */ 22732); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } class ColumnsController extends _m_modules.default.Controller { init(isApplyingUserState) { this._dataController = this.getController("data"); this._focusController = this.getController("focus"); this._stateStoringController = this.getController("stateStoring"); const columns = this.option("columns"); this._commandColumns = this._commandColumns || []; this._columns = this._columns || []; this._isColumnsFromOptions = !!columns; if (this._isColumnsFromOptions) { (0, _m_columns_controller_utils.assignColumns)(this, columns ? (0, _m_columns_controller_utils.createColumnsFromOptions)(this, columns) : []); (0, _m_columns_controller_utils.applyUserState)(this) } else { (0, _m_columns_controller_utils.assignColumns)(this, this._columnsUserState ? (0, _m_columns_controller_utils.createColumnsFromOptions)(this, this._columnsUserState) : this._columns) }(0, _m_columns_controller_utils.addExpandColumn)(this); if (this._dataSourceApplied) { this.applyDataSource(this._dataSource, true, isApplyingUserState) } else { (0, _m_columns_controller_utils.updateIndexes)(this) } this._checkColumns() } _getExpandColumnOptions() { return { type: "expand", command: "expand", width: "auto", cssClass: _const.COMMAND_EXPAND_CLASS, allowEditing: false, allowGrouping: false, allowSorting: false, allowResizing: false, allowReordering: false, allowHiding: false } } _getFirstItems(dataSource) { let groupsCount; let items = []; const getFirstItemsCore = function(items, groupsCount) { if (!items || !groupsCount) { return items } for (let i = 0; i < items.length; i++) { const childItems = getFirstItemsCore(items[i].items || items[i].collapsedItems, groupsCount - 1); if (childItems && childItems.length) { return childItems } } }; if (dataSource && dataSource.items().length > 0) { groupsCount = _m_utils.default.normalizeSortingInfo(dataSource.group()).length; items = getFirstItemsCore(dataSource.items(), groupsCount) || [] } return items } _endUpdateCore() { !this._skipProcessingColumnsChange && (0, _m_columns_controller_utils.fireColumnsChanged)(this) } callbackNames() { return ["columnsChanged"] } getColumnByPath(path, columns) { const that = this; let column; const columnIndexes = []; path.replace(_const.COLUMN_OPTION_REGEXP, ((_, columnIndex) => { columnIndexes.push(parseInt(columnIndex)); return "" })); if (columnIndexes.length) { if (columns) { column = columnIndexes.reduce(((column, index) => column && column.columns && column.columns[index]), { columns: columns }) } else { column = (0, _m_columns_controller_utils.getColumnByIndexes)(that, columnIndexes) } } return column } optionChanged(args) { let needUpdateRequireResize; switch (args.name) { case "adaptColumnWidthByRatio": args.handled = true; break; case "dataSource": if (args.value !== args.previousValue && !this.option("columns") && (!Array.isArray(args.value) || !Array.isArray(args.previousValue))) { this._columns = [] } break; case "columns": needUpdateRequireResize = this._skipProcessingColumnsChange; args.handled = true; if (!this._skipProcessingColumnsChange) { if (args.name === args.fullName) { this._columnsUserState = null; this._ignoreColumnOptionNames = null; this.init() } else { this._columnOptionChanged(args); needUpdateRequireResize = true } } if (needUpdateRequireResize) { this._updateRequireResize(args) } break; case "commonColumnSettings": case "columnAutoWidth": case "allowColumnResizing": case "allowColumnReordering": case "columnFixing": case "grouping": case "groupPanel": case "regenerateColumnsByVisibleItems": case "customizeColumns": case "columnHidingEnabled": case "dateSerializationFormat": case "columnResizingMode": case "columnMinWidth": case "columnWidth": { args.handled = true; const ignoreColumnOptionNames = "columnWidth" === args.fullName && ["width"]; this.reinit(ignoreColumnOptionNames); break } case "rtlEnabled": this.reinit(); break; default: super.optionChanged(args) } } _columnOptionChanged(args) { let columnOptionValue = {}; const column = this.getColumnByPath(args.fullName); const columnOptionName = args.fullName.replace(_const.COLUMN_OPTION_REGEXP, ""); if (column) { if (columnOptionName) { columnOptionValue[columnOptionName] = args.value } else { columnOptionValue = args.value } this._skipProcessingColumnsChange = args.fullName; this.columnOption(column.index, columnOptionValue); this._skipProcessingColumnsChange = false } } _updateRequireResize(args) { const { component: component } = this; if ("width" === args.fullName.replace(_const.COLUMN_OPTION_REGEXP, "") && component._updateLockCount) { component._requireResize = true } } publicMethods() { return ["addColumn", "deleteColumn", "columnOption", "columnCount", "clearSorting", "clearGrouping", "getVisibleColumns", "getVisibleColumnIndex"] } applyDataSource(dataSource, forceApplying, isApplyingUserState) { const that = this; const isDataSourceLoaded = dataSource && dataSource.isLoaded(); that._dataSource = dataSource; if (!that._dataSourceApplied || 0 === that._dataSourceColumnsCount || forceApplying || that.option("regenerateColumnsByVisibleItems")) { if (isDataSourceLoaded) { if (!that._isColumnsFromOptions) { const columnsFromDataSource = (0, _m_columns_controller_utils.createColumnsFromDataSource)(that, dataSource); if (columnsFromDataSource.length) { (0, _m_columns_controller_utils.assignColumns)(that, columnsFromDataSource); that._dataSourceColumnsCount = that._columns.length; (0, _m_columns_controller_utils.applyUserState)(that) } } return that.updateColumns(dataSource, forceApplying, isApplyingUserState) } that._dataSourceApplied = false; (0, _m_columns_controller_utils.updateIndexes)(that) } else if (isDataSourceLoaded && !that.isAllDataTypesDefined(true) && that.updateColumnDataTypes(dataSource)) { (0, _m_columns_controller_utils.updateColumnChanges)(that, "columns"); (0, _m_columns_controller_utils.fireColumnsChanged)(that); return (new _deferred.Deferred).reject().promise() } } reset() { this._dataSource = null; this._dataSourceApplied = false; this._dataSourceColumnsCount = void 0; this.reinit() } resetColumnsCache() { this._visibleColumns = void 0; this._fixedColumns = void 0; this._rowCount = void 0; (0, _m_columns_controller_utils.resetBandColumnsCache)(this) } reinit(ignoreColumnOptionNames) { this._columnsUserState = this.getUserState(); this._ignoreColumnOptionNames = ignoreColumnOptionNames || null; this.init(); if (ignoreColumnOptionNames) { this._ignoreColumnOptionNames = null } } isInitialized() { return !!this._columns.length || !!this.option("columns") } isDataSourceApplied() { return this._dataSourceApplied } getCommonSettings(column) { const commonColumnSettings = (!column || !column.type) && this.option("commonColumnSettings") || {}; const groupingOptions = this.option("grouping") ?? {}; const groupPanelOptions = this.option("groupPanel") ?? {}; return (0, _extend.extend)({ allowFixing: this.option("columnFixing.enabled"), allowResizing: this.option("allowColumnResizing") || void 0, allowReordering: this.option("allowColumnReordering"), minWidth: this.option("columnMinWidth"), width: this.option("columnWidth"), autoExpandGroup: groupingOptions.autoExpandAll, allowCollapsing: groupingOptions.allowCollapsing, allowGrouping: groupPanelOptions.allowColumnDragging && groupPanelOptions.visible || groupingOptions.contextMenuEnabled }, commonColumnSettings) } isColumnOptionUsed(optionName) { for (let i = 0; i < this._columns.length; i++) { if (this._columns[i][optionName]) { return true } } } isAllDataTypesDefined(checkSerializers) { const columns = this._columns; if (!columns.length) { return false } for (let i = 0; i < columns.length; i++) { if (!columns[i].dataField && columns[i].calculateCellValue === columns[i].defaultCalculateCellValue) { continue } if (!columns[i].dataType || checkSerializers && columns[i].deserializeValue && void 0 === columns[i].serializationFormat) { return false } } return true } getColumns() { return this._columns } isBandColumnsUsed() { return this.getColumns().some((column => column.isBand)) } getGroupColumns() { const result = []; (0, _iterator.each)(this._columns, (function() { const column = this; if ((0, _type.isDefined)(column.groupIndex)) { result[column.groupIndex] = column } })); return result } _shouldReturnVisibleColumns() { return true } _compileVisibleColumns(rowIndex) { this._visibleColumns = this._visibleColumns || this._compileVisibleColumnsCore(); rowIndex = (0, _type.isDefined)(rowIndex) ? rowIndex : this._visibleColumns.length - 1; return this._visibleColumns[rowIndex] || [] } getVisibleColumns(rowIndex, isBase) { if (!this._shouldReturnVisibleColumns()) { return [] } return this._compileVisibleColumns.apply(this, arguments) } getFixedColumns(rowIndex) { this._fixedColumns = this._fixedColumns || this._getFixedColumnsCore(); rowIndex = (0, _type.isDefined)(rowIndex) ? rowIndex : this._fixedColumns.length - 1; return this._fixedColumns[rowIndex] || [] } getFilteringColumns() { return this.getColumns().filter((item => (item.dataField || item.name) && (item.allowFiltering || item.allowHeaderFiltering))).map((item => { const field = (0, _extend.extend)(true, {}, item); if (!(0, _type.isDefined)(field.dataField)) { field.dataField = field.name } field.filterOperations = item.filterOperations !== item.defaultFilterOperations ? field.filterOperations : null; return field })) } getColumnIndexOffset() { return 0 } _getFixedColumnsCore() { const that = this; const result = []; const rowCount = that.getRowCount(); const isColumnFixing = that._isColumnFixing(); const transparentColumn = { command: "transparent" }; let transparentColspan = 0; let notFixedColumnCount; let transparentColumnIndex; let lastFixedPosition; if (isColumnFixing) { for (let i = 0; i <= rowCount; i++) { notFixedColumnCount = 0; lastFixedPosition = null; transparentColumnIndex = null; const visibleColumns = that.getVisibleColumns(i, true); for (let j = 0; j < visibleColumns.length; j++) { const prevColumn = visibleColumns[j - 1]; const column = visibleColumns[j]; if (!column.fixed) { if (0 === i) { if (column.isBand && column.colspan) { transparentColspan += column.colspan } else { transparentColspan++ } } notFixedColumnCount++; if (!(0, _type.isDefined)(transparentColumnIndex)) { transparentColumnIndex = j } } else if (prevColumn && prevColumn.fixed && (0, _m_columns_controller_utils.getFixedPosition)(that, prevColumn) !== (0, _m_columns_controller_utils.getFixedPosition)(that, column)) { if (!(0, _type.isDefined)(transparentColumnIndex)) { transparentColumnIndex = j } } else { lastFixedPosition = column.fixedPosition } } if (0 === i && (0 === notFixedColumnCount || notFixedColumnCount >= visibleColumns.length)) { return [] } if (!(0, _type.isDefined)(transparentColumnIndex)) { transparentColumnIndex = "right" === lastFixedPosition ? 0 : visibleColumns.length } result[i] = visibleColumns.slice(0); if (!transparentColumn.colspan) { transparentColumn.colspan = transparentColspan } result[i].splice(transparentColumnIndex, notFixedColumnCount, transparentColumn) } } return result.map((columns => columns.map((column => { const newColumn = _extends({}, column); if (newColumn.headerId) { newColumn.headerId += "-fixed" } return newColumn })))) } _isColumnFixing() { let isColumnFixing = this.option("columnFixing.enabled"); !isColumnFixing && (0, _iterator.each)(this._columns, ((_, column) => { if (column.fixed) { isColumnFixing = true; return false } })); return isColumnFixing } _getExpandColumnsCore() { return this.getGroupColumns() } getExpandColumns() { let expandColumns = this._getExpandColumnsCore(); let expandColumn; const firstGroupColumn = expandColumns.filter((column => 0 === column.groupIndex))[0]; const isFixedFirstGroupColumn = firstGroupColumn && firstGroupColumn.fixed; const isColumnFixing = this._isColumnFixing(); const rtlEnabled = this.option("rtlEnabled"); if (expandColumns.length) { expandColumn = this.columnOption("command:expand") } expandColumns = (0, _iterator.map)(expandColumns, (column => (0, _extend.extend)({}, column, { visibleWidth: null, minWidth: null, cellTemplate: !(0, _type.isDefined)(column.groupIndex) ? column.cellTemplate : null, headerCellTemplate: null, fixed: !(0, _type.isDefined)(column.groupIndex) || !isFixedFirstGroupColumn ? isColumnFixing : true, fixedPosition: rtlEnabled ? "right" : "left" }, expandColumn, { index: column.index, type: column.type || _const.GROUP_COMMAND_COLUMN_NAME }))); return expandColumns } getBandColumnsCache() { if (!this._bandColumnsCache) { const columns = this._columns; const columnChildrenByIndex = {}; const columnParentByIndex = {}; let isPlain = true; columns.forEach((column => { const { ownerBand: ownerBand } = column; let parentIndex = (0, _type.isObject)(ownerBand) ? ownerBand.index : ownerBand; const parent = columns[parentIndex]; if (column.hasColumns) { isPlain = false } if (column.colspan) { column.colspan = void 0 } if (column.rowspan) { column.rowspan = void 0 } if (parent) { columnParentByIndex[column.index] = parent } else { parentIndex = -1 } columnChildrenByIndex[parentIndex] = columnChildrenByIndex[parentIndex] || []; columnChildrenByIndex[parentIndex].push(column) })); this._bandColumnsCache = { isPlain: isPlain, columnChildrenByIndex: columnChildrenByIndex, columnParentByIndex: columnParentByIndex } } return this._bandColumnsCache } _isColumnVisible(column) { return column.visible && this.isParentColumnVisible(column.index) } _isColumnInGroupPanel(column) { return (0, _type.isDefined)(column.groupIndex) && !column.showWhenGrouped } hasVisibleDataColumns() { const columns = this._columns; return columns.some((column => { const isVisible = this._isColumnVisible(column); const isInGroupPanel = this._isColumnInGroupPanel(column); const isCommand = !!column.command; return isVisible && !isInGroupPanel && !isCommand })) } _compileVisibleColumnsCore() { const bandColumnsCache = this.getBandColumnsCache(); const columns = (0, _m_columns_controller_utils.mergeColumns)(this, this._columns, this._commandColumns, true); (0, _m_columns_controller_utils.processBandColumns)(this, columns, bandColumnsCache); const indexedColumns = this._getIndexedColumns(columns); const visibleColumns = this._getVisibleColumnsFromIndexed(indexedColumns); const isDataColumnsInvisible = !this.hasVisibleDataColumns(); if (isDataColumnsInvisible && this._columns.length) { visibleColumns[visibleColumns.length - 1].push({ command: "empty" }) } return visibleColumns } _getIndexedColumns(columns) { const rtlEnabled = this.option("rtlEnabled"); const rowCount = this.getRowCount(); const columnDigitsCount = (0, _m_columns_controller_utils.digitsCount)(columns.length); const bandColumnsCache = this.getBandColumnsCache(); const positiveIndexedColumns = []; const negativeIndexedColumns = []; for (let i = 0; i < rowCount; i += 1) { negativeIndexedColumns[i] = [{}]; positiveIndexedColumns[i] = [{}, {}, {}] } columns.forEach((column => { let { visibleIndex: visibleIndex } = column; let indexedColumns; const parentBandColumns = (0, _m_columns_controller_utils.getParentBandColumns)(column.index, bandColumnsCache.columnParentByIndex); const isVisible = this._isColumnVisible(column); const isInGroupPanel = this._isColumnInGroupPanel(column); if (isVisible && !isInGroupPanel) { const rowIndex = parentBandColumns.length; if (visibleIndex < 0) { visibleIndex = -visibleIndex; indexedColumns = negativeIndexedColumns[rowIndex] } else { var _parentBandColumns$, _parentBandColumns$2; column.fixed = (null === (_parentBandColumns$ = parentBandColumns[0]) || void 0 === _parentBandColumns$ ? void 0 : _parentBandColumns$.fixed) ?? column.fixed; column.fixedPosition = (null === (_parentBandColumns$2 = parentBandColumns[0]) || void 0 === _parentBandColumns$2 ? void 0 : _parentBandColumns$2.fixedPosition) ?? column.fixedPosition; if (column.fixed) { const isDefaultCommandColumn = !!column.command && !(0, _m_columns_controller_utils.isCustomCommandColumn)(this, column); let isFixedToEnd = "right" === column.fixedPosition; if (rtlEnabled && !isDefaultCommandColumn) { isFixedToEnd = !isFixedToEnd } indexedColumns = isFixedToEnd ? positiveIndexedColumns[rowIndex][2] : positiveIndexedColumns[rowIndex][0] } else { indexedColumns = positiveIndexedColumns[rowIndex][1] } } if (parentBandColumns.length) { visibleIndex = (0, _m_columns_controller_utils.numberToString)(visibleIndex, columnDigitsCount); for (let i = parentBandColumns.length - 1; i >= 0; i -= 1) { visibleIndex = (0, _m_columns_controller_utils.numberToString)(parentBandColumns[i].visibleIndex, columnDigitsCount) + visibleIndex } } indexedColumns[visibleIndex] = indexedColumns[visibleIndex] || []; indexedColumns[visibleIndex].push(column) } })); return { positiveIndexedColumns: positiveIndexedColumns, negativeIndexedColumns: negativeIndexedColumns } } _getVisibleColumnsFromIndexed(_ref) { let { positiveIndexedColumns: positiveIndexedColumns, negativeIndexedColumns: negativeIndexedColumns } = _ref; const result = []; const rowCount = this.getRowCount(); const expandColumns = (0, _m_columns_controller_utils.mergeColumns)(this, this.getExpandColumns(), this._columns); let rowspanGroupColumns = 0; let rowspanExpandColumns = 0; for (let rowIndex = 0; rowIndex < rowCount; rowIndex += 1) { result.push([]); (0, _object.orderEach)(negativeIndexedColumns[rowIndex], ((_, columns) => { result[rowIndex].unshift.apply(result[rowIndex], columns) })); const firstPositiveIndexColumn = result[rowIndex].length; const positiveIndexedRowColumns = positiveIndexedColumns[rowIndex]; positiveIndexedRowColumns.forEach((columnsByFixing => { (0, _object.orderEach)(columnsByFixing, ((_, columnsByVisibleIndex) => { result[rowIndex].push.apply(result[rowIndex], columnsByVisibleIndex) })) })); if (rowspanExpandColumns <= rowIndex) { rowspanExpandColumns += _m_columns_controller_utils.processExpandColumns.call(this, result[rowIndex], expandColumns, _const.DETAIL_COMMAND_COLUMN_NAME, firstPositiveIndexColumn) } if (rowspanGroupColumns <= rowIndex) { rowspanGroupColumns += _m_columns_controller_utils.processExpandColumns.call(this, result[rowIndex], expandColumns, _const.GROUP_COMMAND_COLUMN_NAME, firstPositiveIndexColumn) } } result.push((0, _m_columns_controller_utils.getDataColumns)(result)); return result } getInvisibleColumns(columns, bandColumnIndex) { const that = this; let result = []; let hiddenColumnsByBand; columns = columns || that._columns; (0, _iterator.each)(columns, ((_, column) => { if (column.ownerBand !== bandColumnIndex) { return } if (column.isBand) { if (!column.visible) { hiddenColumnsByBand = that.getChildrenByBandColumn(column.index) } else { hiddenColumnsByBand = that.getInvisibleColumns(that.getChildrenByBandColumn(column.index), column.index) } if (hiddenColumnsByBand.length) { result.push(column); result = result.concat(hiddenColumnsByBand) } return } if (!column.visible) { result.push(column) } })); return result } getChooserColumns(getAllColumns) { const columns = getAllColumns ? this.getColumns() : this.getInvisibleColumns(); const columnChooserColumns = columns.filter((column => column.showInColumnChooser)); const sortOrder = this.option("columnChooser.sortOrder"); return (0, _m_columns_controller_utils.sortColumns)(columnChooserColumns, sortOrder) } allowMoveColumn(fromVisibleIndex, toVisibleIndex, sourceLocation, targetLocation) { const columnIndex = (0, _m_columns_controller_utils.getColumnIndexByVisibleIndex)(this, fromVisibleIndex, sourceLocation); const sourceColumn = this._columns[columnIndex]; if (sourceColumn && (sourceColumn.allowReordering || sourceColumn.allowGrouping || sourceColumn.allowHiding)) { if (sourceLocation === targetLocation) { if (sourceLocation === _const.COLUMN_CHOOSER_LOCATION) { return false } fromVisibleIndex = (0, _type.isObject)(fromVisibleIndex) ? fromVisibleIndex.columnIndex : fromVisibleIndex; toVisibleIndex = (0, _type.isObject)(toVisibleIndex) ? toVisibleIndex.columnIndex : toVisibleIndex; return fromVisibleIndex !== toVisibleIndex && fromVisibleIndex + 1 !== toVisibleIndex } if (sourceLocation === _const.GROUP_LOCATION && targetLocation !== _const.COLUMN_CHOOSER_LOCATION || targetLocation === _const.GROUP_LOCATION) { return sourceColumn && sourceColumn.allowGrouping } if (sourceLocation === _const.COLUMN_CHOOSER_LOCATION || targetLocation === _const.COLUMN_CHOOSER_LOCATION) { return sourceColumn && sourceColumn.allowHiding } return true } return false } moveColumn(fromVisibleIndex, toVisibleIndex, sourceLocation, targetLocation) { const that = this; const options = {}; let prevGroupIndex; const fromIndex = (0, _m_columns_controller_utils.getColumnIndexByVisibleIndex)(that, fromVisibleIndex, sourceLocation); const toIndex = (0, _m_columns_controller_utils.getColumnIndexByVisibleIndex)(that, toVisibleIndex, targetLocation); let targetGroupIndex; if (fromIndex >= 0) { const column = that._columns[fromIndex]; toVisibleIndex = (0, _type.isObject)(toVisibleIndex) ? toVisibleIndex.columnIndex : toVisibleIndex; targetGroupIndex = toIndex >= 0 ? that._columns[toIndex].groupIndex : -1; if ((0, _type.isDefined)(column.groupIndex) && sourceLocation === _const.GROUP_LOCATION) { if (targetGroupIndex > column.groupIndex) { targetGroupIndex-- } if (targetLocation !== _const.GROUP_LOCATION) { options.groupIndex = void 0 } else { prevGroupIndex = column.groupIndex; delete column.groupIndex; (0, _m_columns_controller_utils.updateColumnGroupIndexes)(that) } } if (targetLocation === _const.GROUP_LOCATION) { options.groupIndex = (0, _m_columns_controller_utils.moveColumnToGroup)(that, column, targetGroupIndex); column.groupIndex = prevGroupIndex } else if (toVisibleIndex >= 0) { const targetColumn = that._columns[toIndex]; if (!targetColumn || column.ownerBand !== targetColumn.ownerBand) { options.visibleIndex = _const.MAX_SAFE_INTEGER } else if ((0, _m_columns_controller_utils.isColumnFixed)(that, column) ^ (0, _m_columns_controller_utils.isColumnFixed)(that, targetColumn)) { options.visibleIndex = _const.MAX_SAFE_INTEGER } else { options.visibleIndex = targetColumn.visibleIndex } } const isVisible = targetLocation !== _const.COLUMN_CHOOSER_LOCATION; if (column.visible !== isVisible) { options.visible = isVisible } that.columnOption(column.index, options) } } changeSortOrder(columnIndex, sortOrder) { const that = this; const options = {}; const sortingOptions = that.option("sorting"); const sortingMode = sortingOptions && sortingOptions.mode; const needResetSorting = "single" === sortingMode || !sortOrder; const allowSorting = "single" === sortingMode || "multiple" === sortingMode; const column = that._columns[columnIndex]; if (allowSorting && column && column.allowSorting) { if (needResetSorting && !(0, _type.isDefined)(column.groupIndex)) { (0, _iterator.each)(that._columns, (function(index) { if (index !== columnIndex && this.sortOrder) { if (!(0, _type.isDefined)(this.groupIndex)) { delete this.sortOrder } delete this.sortIndex } })) } if ((0, _m_columns_controller_utils.isSortOrderValid)(sortOrder)) { if (column.sortOrder !== sortOrder) { options.sortOrder = sortOrder } } else if ("none" === sortOrder) { if (column.sortOrder) { options.sortIndex = void 0; options.sortOrder = void 0 } } else { ! function(column) { if ("ctrl" === sortOrder) { if (!("sortOrder" in column && "sortIndex" in column)) { return false } options.sortOrder = void 0; options.sortIndex = void 0 } else if ((0, _type.isDefined)(column.groupIndex) || (0, _type.isDefined)(column.sortIndex)) { options.sortOrder = "desc" === column.sortOrder ? "asc" : "desc" } else { options.sortOrder = "asc" } return true }(column) } } that.columnOption(column.index, options) } getSortDataSourceParameters(useLocalSelector) { const sortColumns = []; const sort = []; (0, _iterator.each)(this._columns, (function() { if ((this.dataField || this.selector || this.calculateCellValue) && (0, _type.isDefined)(this.sortIndex) && !(0, _type.isDefined)(this.groupIndex)) { sortColumns[this.sortIndex] = this } })); (0, _iterator.each)(sortColumns, (function() { const sortOrder = this && this.sortOrder; if ((0, _m_columns_controller_utils.isSortOrderValid)(sortOrder)) { const sortItem = { selector: this.calculateSortValue || this.displayField || this.calculateDisplayValue || useLocalSelector && this.selector || this.dataField || this.calculateCellValue, desc: "desc" === this.sortOrder }; if (this.sortingMethod) { sortItem.compare = this.sortingMethod.bind(this) } sort.push(sortItem) } })); return sort.length > 0 ? sort : null } getGroupDataSourceParameters(useLocalSelector) { const group = []; (0, _iterator.each)(this.getGroupColumns(), (function() { const selector = this.calculateGroupValue || this.displayField || this.calculateDisplayValue || useLocalSelector && this.selector || this.dataField || this.calculateCellValue; if (selector) { const groupItem = { selector: selector, desc: "desc" === this.sortOrder, isExpanded: !!this.autoExpandGroup }; if (this.sortingMethod) { groupItem.compare = this.sortingMethod.bind(this) } group.push(groupItem) } })); return group.length > 0 ? group : null } refresh(updateNewLookupsOnly) { const deferreds = []; (0, _iterator.each)(this._columns, (function() { const { lookup: lookup } = this; if (lookup && !this.calculateDisplayValue) { if (updateNewLookupsOnly && lookup.valueMap) { return } if (lookup.update) { deferreds.push(lookup.update()) } } })); return _deferred.when.apply(_renderer.default, deferreds).done(_m_columns_controller_utils.resetColumnsCache.bind(null, this)) } _updateColumnOptions(column, columnIndex) { var _this$_previousColumn, _this$_previousColumn2; const shouldTakeOriginalCallbackFromPrevious = this._reinitAfterLookupChanges && (null === (_this$_previousColumn = this._previousColumns) || void 0 === _this$_previousColumn ? void 0 : _this$_previousColumn[columnIndex]); column.selector = column.selector ?? (data => column.calculateCellValue(data)); column.selector.columnIndex = columnIndex; column.selector.originalCallback = shouldTakeOriginalCallbackFromPrevious ? (null === (_this$_previousColumn2 = this._previousColumns[columnIndex].selector) || void 0 === _this$_previousColumn2 ? void 0 : _this$_previousColumn2.originalCallback) ?? column.selector : column.selector; (0, _iterator.each)(["calculateSortValue", "calculateGroupValue", "calculateDisplayValue"], ((_, calculateCallbackName) => { const calculateCallback = column[calculateCallbackName]; if ((0, _type.isFunction)(calculateCallback)) { if (!calculateCallback.originalCallback) { const context = { column: column }; column[calculateCallbackName] = function(data) { return calculateCallback.call(context.column, data) }; column[calculateCallbackName].originalCallback = calculateCallback; column[calculateCallbackName].columnIndex = columnIndex; column[calculateCallbackName].context = context } else { column[calculateCallbackName].context.column = column } } })); if ((0, _type.isString)(column.calculateDisplayValue)) { column.displayField = column.calculateDisplayValue; column.calculateDisplayValue = (0, _data.compileGetter)(column.displayField) } if (column.calculateDisplayValue) { column.displayValueMap = column.displayValueMap || {} }(0, _m_columns_controller_utils.updateSerializers)(column, column.dataType); const { lookup: lookup } = column; if (lookup) { (0, _m_columns_controller_utils.updateSerializers)(lookup, lookup.dataType) } const dataType = lookup ? lookup.dataType : column.dataType; if (dataType) { column.alignment = column.alignment || (0, _m_columns_controller_utils.getAlignmentByDataType)(dataType, this.option("rtlEnabled")); column.format = column.format || _m_utils.default.getFormatByDataType(dataType); column.customizeText = column.customizeText || (0, _m_columns_controller_utils.getCustomizeTextByDataType)(dataType); column.defaultFilterOperations = column.defaultFilterOperations || !lookup && _const.DATATYPE_OPERATIONS[dataType] || []; if (!(0, _type.isDefined)(column.filterOperations)) { (0, _m_columns_controller_utils.setFilterOperationsAsDefaultValues)(column) } column.defaultFilterOperation = column.filterOperations && column.filterOperations[0] || "="; column.showEditorAlways = (0, _type.isDefined)(column.showEditorAlways) ? column.showEditorAlways : "boolean" === dataType && !column.cellTemplate && !column.lookup } } updateColumnDataTypes(dataSource) { const that = this; const dateSerializationFormat = that.option("dateSerializationFormat"); const firstItems = that._getFirstItems(dataSource); let isColumnDataTypesUpdated = false; (0, _iterator.each)(that._columns, ((index, column) => { let i; let value; let dataType; let lookupDataType; let valueDataType; const { lookup: lookup } = column; if (_m_utils.default.isDateType(column.dataType) && void 0 === column.serializationFormat) { column.serializationFormat = dateSerializationFormat } if (lookup && _m_utils.default.isDateType(lookup.dataType) && void 0 === column.serializationFormat) { lookup.serializationFormat = dateSerializationFormat } if (column.calculateCellValue && firstItems.length) { if (!column.dataType || lookup && !lookup.dataType) { for (i = 0; i < firstItems.length; i++) { value = column.calculateCellValue(firstItems[i]); if (!column.dataType) { valueDataType = (0, _m_columns_controller_utils.getValueDataType)(value); dataType = dataType || valueDataType; if (dataType && valueDataType && dataType !== valueDataType) { dataType = "string" } } if (lookup && !lookup.dataType) { valueDataType = (0, _m_columns_controller_utils.getValueDataType)(_m_utils.default.getDisplayValue(column, value, firstItems[i])); lookupDataType = lookupDataType || valueDataType; if (lookupDataType && valueDataType && lookupDataType !== valueDataType) { lookupDataType = "string" } } } if (dataType || lookupDataType) { if (dataType) { column.dataType = dataType } if (lookup && lookupDataType) { lookup.dataType = lookupDataType } isColumnDataTypesUpdated = true } } if (void 0 === column.serializationFormat || lookup && void 0 === lookup.serializationFormat) { for (i = 0; i < firstItems.length; i++) { value = column.calculateCellValue(firstItems[i], true); if (void 0 === column.serializationFormat) { column.serializationFormat = (0, _m_columns_controller_utils.getSerializationFormat)(column.dataType, value) } if (lookup && void 0 === lookup.serializationFormat) { lookup.serializationFormat = (0, _m_columns_controller_utils.getSerializationFormat)(lookup.dataType, lookup.calculateCellValue(value, true)) } } } } that._updateColumnOptions(column, index) })); return isColumnDataTypesUpdated } _customizeColumns(columns) { const that = this; const customizeColumns = that.option("customizeColumns"); if (customizeColumns) { const hasOwnerBand = columns.some((column => (0, _type.isObject)(column.ownerBand))); if (hasOwnerBand) { (0, _m_columns_controller_utils.updateIndexes)(that) } customizeColumns(columns); (0, _m_columns_controller_utils.assignColumns)(that, (0, _m_columns_controller_utils.createColumnsFromOptions)(that, columns)) } } updateColumns(dataSource, forceApplying, isApplyingUserState) { if (!forceApplying) { this.updateSortingGrouping(dataSource) } if (!dataSource || dataSource.isLoaded()) { const sortParameters = dataSource ? dataSource.sort() || [] : this.getSortDataSourceParameters(); const groupParameters = dataSource ? dataSource.group() || [] : this.getGroupDataSourceParameters(); const filterParameters = null === dataSource || void 0 === dataSource ? void 0 : dataSource.lastLoadOptions().filter; if (!isApplyingUserState) { this._customizeColumns(this._columns) }(0, _m_columns_controller_utils.updateIndexes)(this); const columns = this._columns; return (0, _deferred.when)(this.refresh(true)).always((() => { if (this._columns !== columns) { return } this._updateChanges(dataSource, { sorting: sortParameters, grouping: groupParameters, filtering: filterParameters }); (0, _m_columns_controller_utils.fireColumnsChanged)(this) })) } } _updateChanges(dataSource, parameters) { if (dataSource) { this.updateColumnDataTypes(dataSource); this._dataSourceApplied = true } if (!_m_utils.default.equalSortParameters(parameters.sorting, this.getSortDataSourceParameters())) { (0, _m_columns_controller_utils.updateColumnChanges)(this, "sorting") } if (!_m_utils.default.equalSortParameters(parameters.grouping, this.getGroupDataSourceParameters())) { (0, _m_columns_controller_utils.updateColumnChanges)(this, "grouping") } if (this._dataController && !_m_utils.default.equalFilterParameters(parameters.filtering, this._dataController.getCombinedFilter())) { (0, _m_columns_controller_utils.updateColumnChanges)(this, "filtering") }(0, _m_columns_controller_utils.updateColumnChanges)(this, "columns") } updateSortingGrouping(dataSource, fromDataSource) { const that = this; let sortParameters; let isColumnsChanged; const updateSortGroupParameterIndexes = function(columns, sortParameters, indexParameterName) { (0, _iterator.each)(columns, ((index, column) => { delete column[indexParameterName]; if (sortParameters) { for (let i = 0; i < sortParameters.length; i++) { const { selector: selector } = sortParameters[i]; const { isExpanded: isExpanded } = sortParameters[i]; if (selector === column.dataField || selector === column.name || selector === column.displayField || selector === column.selector || selector === column.calculateCellValue || selector === column.calculateGroupValue || selector === column.calculateDisplayValue) { if (fromDataSource) { column.sortOrder = "sortOrder" in column ? column.sortOrder : sortParameters[i].desc ? "desc" : "asc" } else { column.sortOrder = column.sortOrder || (sortParameters[i].desc ? "desc" : "asc") } if (void 0 !== isExpanded) { column.autoExpandGroup = isExpanded } column[indexParameterName] = i; break } } } })) }; if (dataSource) { sortParameters = _m_utils.default.normalizeSortingInfo(dataSource.sort()); const groupParameters = _m_utils.default.normalizeSortingInfo(dataSource.group()); const columnsGroupParameters = that.getGroupDataSourceParameters(); const columnsSortParameters = that.getSortDataSourceParameters(); const groupingChanged = !_m_utils.default.equalSortParameters(groupParameters, columnsGroupParameters, true); const groupExpandingChanged = !groupingChanged && !_m_utils.default.equalSortParameters(groupParameters, columnsGroupParameters); if (!that._columns.length) { (0, _iterator.each)(groupParameters, ((index, group) => { that._columns.push(group.selector) })); (0, _iterator.each)(sortParameters, ((index, sort) => { if (!(0, _type.isFunction)(sort.selector)) { that._columns.push(sort.selector) } })); (0, _m_columns_controller_utils.assignColumns)(that, (0, _m_columns_controller_utils.createColumnsFromOptions)(that, that._columns)) } if ((fromDataSource || !columnsGroupParameters && !that._hasUserState) && (groupingChanged || groupExpandingChanged)) { updateSortGroupParameterIndexes(that._columns, groupParameters, "groupIndex"); if (fromDataSource) { groupingChanged && (0, _m_columns_controller_utils.updateColumnChanges)(that, "grouping"); groupExpandingChanged && (0, _m_columns_controller_utils.updateColumnChanges)(that, "groupExpanding"); isColumnsChanged = true } } if ((fromDataSource || !columnsSortParameters && !that._hasUserState) && !_m_utils.default.equalSortParameters(sortParameters, columnsSortParameters)) { updateSortGroupParameterIndexes(that._columns, sortParameters, "sortIndex"); if (fromDataSource) { (0, _m_columns_controller_utils.updateColumnChanges)(that, "sorting"); isColumnsChanged = true } } if (isColumnsChanged) { (0, _m_columns_controller_utils.fireColumnsChanged)(that) } } } updateFilter(filter, remoteFiltering, columnIndex, filterValue) { const that = this; if (!Array.isArray(filter)) { return filter } filter = (0, _extend.extend)([], filter); columnIndex = void 0 !== filter.columnIndex ? filter.columnIndex : columnIndex; filterValue = void 0 !== filter.filterValue ? filter.filterValue : filterValue; if ((0, _type.isString)(filter[0]) && "!" !== filter[0]) { const column = that.columnOption(filter[0]); if (remoteFiltering) { if ((0, _config.default)().forceIsoDateParsing && column && column.serializeValue && filter.length > 1) { filter[filter.length - 1] = column.serializeValue(filter[filter.length - 1], "filter") } } else if (column && column.selector) { filter[0] = column.selector; filter[0].columnIndex = column.index } } else if ((0, _type.isFunction)(filter[0])) { filter[0].columnIndex = columnIndex; filter[0].filterValue = filterValue; filter[0].selectedFilterOperation = filter.selectedFilterOperation } for (let i = 0; i < filter.length; i++) { filter[i] = that.updateFilter(filter[i], remoteFiltering, columnIndex, filterValue) } return filter } columnCount() { return this._columns ? this._columns.length : 0 } columnOption(identifier, option, value, notFireEvent) { const that = this; const columns = that._columns.concat(that._commandColumns); const column = (0, _m_columns_controller_utils.findColumn)(columns, identifier); if (column) { if (1 === arguments.length) { return (0, _extend.extend)({}, column) } if ((0, _type.isString)(option)) { if (2 === arguments.length) { return (0, _m_columns_controller_utils.columnOptionCore)(that, column, option) }(0, _m_columns_controller_utils.columnOptionCore)(that, column, option, value, notFireEvent) } else if ((0, _type.isObject)(option)) { (0, _iterator.each)(option, ((optionName, value) => { (0, _m_columns_controller_utils.columnOptionCore)(that, column, optionName, value, notFireEvent) })) }(0, _m_columns_controller_utils.fireColumnsChanged)(that) } } clearSorting() { const that = this; const columnCount = this.columnCount(); that.beginUpdate(); for (let i = 0; i < columnCount; i++) { that.columnOption(i, "sortOrder", void 0); delete(0, _m_columns_controller_utils.findColumn)(that._columns, i).sortOrder } that.endUpdate() } clearGrouping() { const that = this; const columnCount = this.columnCount(); that.beginUpdate(); for (let i = 0; i < columnCount; i++) { that.columnOption(i, "groupIndex", void 0) } that.endUpdate() } getVisibleIndex(index, rowIndex) { const columns = this.getVisibleColumns(rowIndex); for (let i = columns.length - 1; i >= 0; i--) { if (columns[i].index === index) { return i } } return -1 } getVisibleIndexByColumn(column, rowIndex) { const visibleColumns = this.getVisibleColumns(rowIndex); const visibleColumn = visibleColumns.filter((col => col.index === column.index && col.command === column.command))[0]; return visibleColumns.indexOf(visibleColumn) } getVisibleColumnIndex(id, rowIndex) { const index = this.columnOption(id, "index"); return this.getVisibleIndex(index, rowIndex) } addColumn(options) { const that = this; let column = (0, _m_columns_controller_utils.createColumn)(that, options); const index = that._columns.length; that._columns.push(column); if (column.isBand) { that._columns = (0, _m_columns_controller_utils.createColumnsFromOptions)(that, that._columns); column = that._columns[index] } column.added = options; (0, _m_columns_controller_utils.updateIndexes)(that, column); that.updateColumns(that._dataSource); that._checkColumns() } deleteColumn(id) { const that = this; const column = that.columnOption(id); if (column && column.index >= 0) { (0, _m_columns_controller_utils.convertOwnerBandToColumnReference)(that._columns); that._columns.splice(column.index, 1); if (column.isBand) { const childIndexes = that.getChildrenByBandColumn(column.index).map((column => column.index)); that._columns = that._columns.filter((column => childIndexes.indexOf(column.index) < 0)) }(0, _m_columns_controller_utils.updateIndexes)(that); that.updateColumns(that._dataSource) } } addCommandColumn(options) { let commandColumn = this._commandColumns.filter((column => column.command === options.command))[0]; if (!commandColumn) { commandColumn = options; this._commandColumns.push(commandColumn) } } getUserState() { const columns = this._columns; const result = []; let i; function handleStateField(index, value) { if (void 0 !== columns[i][value]) { result[i][value] = columns[i][value] } } for (i = 0; i < columns.length; i++) { result[i] = {}; (0, _iterator.each)(_const.USER_STATE_FIELD_NAMES, handleStateField) } return result } setName(column) { column.name = column.name || column.dataField || column.type } setUserState(state) { const that = this; const dataSource = that._dataSource; let ignoreColumnOptionNames = that.option("stateStoring.ignoreColumnOptionNames"); null === state || void 0 === state || state.forEach(this.setName); if (!ignoreColumnOptionNames) { ignoreColumnOptionNames = []; const commonColumnSettings = that.getCommonSettings(); if (!that.option("columnChooser.enabled")) { ignoreColumnOptionNames.push("visible") } if ("none" === that.option("sorting.mode")) { ignoreColumnOptionNames.push("sortIndex", "sortOrder") } if (!commonColumnSettings.allowGrouping) { ignoreColumnOptionNames.push("groupIndex") } if (!commonColumnSettings.allowFixing) { ignoreColumnOptionNames.push("fixed", "fixedPosition") } if (!commonColumnSettings.allowResizing) { ignoreColumnOptionNames.push("width", "visibleWidth") } const isFilterPanelHidden = !that.option("filterPanel.visible"); if (!that.option("filterRow.visible") && isFilterPanelHidden) { ignoreColumnOptionNames.push("filterValue", "selectedFilterOperation") } if (!that.option("headerFilter.visible") && isFilterPanelHidden) { ignoreColumnOptionNames.push("filterValues", "filterType") } } that._columnsUserState = state; that._ignoreColumnOptionNames = ignoreColumnOptionNames; that._hasUserState = !!state; (0, _m_columns_controller_utils.updateColumnChanges)(that, "filtering"); that.init(true); if (dataSource) { dataSource.sort(that.getSortDataSourceParameters()); dataSource.group(that.getGroupDataSourceParameters()) } } _checkColumns() { const usedNames = {}; let hasEditableColumnWithoutName = false; const duplicatedNames = []; this._columns.forEach((column => { var _column$columns; const { name: name } = column; const isBand = null === (_column$columns = column.columns) || void 0 === _column$columns ? void 0 : _column$columns.length; const isEditable = column.allowEditing && (column.dataField || column.setCellValue) && !isBand; if (name) { if (usedNames[name]) { duplicatedNames.push(`"${name}"`) } usedNames[name] = true } else if (isEditable) { hasEditableColumnWithoutName = true } })); if (duplicatedNames.length) { _ui.default.log("E1059", duplicatedNames.join(", ")) } if (hasEditableColumnWithoutName) { _ui.default.log("E1060") } } _createCalculatedColumnOptions(columnOptions, bandColumn) { let calculatedColumnOptions = {}; let { dataField: dataField } = columnOptions; if (Array.isArray(columnOptions.columns) && columnOptions.columns.length || columnOptions.isBand) { calculatedColumnOptions.isBand = true; dataField = null } if (dataField) { if ((0, _type.isString)(dataField)) { const getter = (0, _data.compileGetter)(dataField); calculatedColumnOptions = { caption: (0, _inflector.captionize)(dataField), calculateCellValue(data, skipDeserialization) { const value = getter(data); return this.deserializeValue && !skipDeserialization ? this.deserializeValue(value) : value }, setCellValue: _m_columns_controller_utils.defaultSetCellValue, parseValue(text) { const column = this; let result; let parsedValue; if ("number" === column.dataType) { if ((0, _type.isString)(text) && column.format) { result = (0, _m_columns_controller_utils.strictParseNumber)(text.trim(), column.format) } else if ((0, _type.isDefined)(text) && (0, _type.isNumeric)(text)) { result = Number(text) } } else if ("boolean" === column.dataType) { if (text === column.trueText) { result = true } else if (text === column.falseText) { result = false } } else if (_m_utils.default.isDateType(column.dataType)) { parsedValue = _date.default.parse(text, column.format); if (parsedValue) { result = parsedValue } } else { result = text } return result } } } calculatedColumnOptions.allowFiltering = true } else { calculatedColumnOptions.allowFiltering = !!columnOptions.calculateFilterExpression } calculatedColumnOptions.calculateFilterExpression = function() { return _filtering.default.defaultCalculateFilterExpression.apply(this, arguments) }; calculatedColumnOptions.defaultFilterOperation = "="; calculatedColumnOptions.createFilterExpression = function(filterValue, selectedFilterOperation) { let result; if (this.calculateFilterExpression) { result = this.calculateFilterExpression.apply(this, arguments) } if ((0, _type.isFunction)(result)) { result = [result, "=", true] } if (result) { result.columnIndex = this.index; result.filterValue = filterValue; result.selectedFilterOperation = selectedFilterOperation } return result }; if (!dataField || !(0, _type.isString)(dataField)) { (0, _extend.extend)(true, calculatedColumnOptions, { allowSorting: false, allowGrouping: false, calculateCellValue: () => null }) } if (bandColumn) { calculatedColumnOptions.allowFixing = false } if (columnOptions.dataType) { calculatedColumnOptions.userDataType = columnOptions.dataType } if (columnOptions.selectedFilterOperation && !("defaultSelectedFilterOperation" in calculatedColumnOptions)) { calculatedColumnOptions.defaultSelectedFilterOperation = columnOptions.selectedFilterOperation } if (columnOptions.lookup) { calculatedColumnOptions.lookup = { calculateCellValue(value, skipDeserialization) { if (this.valueExpr) { value = this.valueMap && this.valueMap[value] } return this.deserializeValue && !skipDeserialization ? this.deserializeValue(value) : value }, updateValueMap() { this.valueMap = {}; if (this.items) { const calculateValue = (0, _data.compileGetter)(this.valueExpr); const calculateDisplayValue = (0, _data.compileGetter)(this.displayExpr); for (let i = 0; i < this.items.length; i++) { const item = this.items[i]; const displayValue = calculateDisplayValue(item); this.valueMap[calculateValue(item)] = displayValue; this.dataType = this.dataType || (0, _m_columns_controller_utils.getValueDataType)(displayValue) } } }, update() { const that = this; let { dataSource: dataSource } = that; if (dataSource) { if ((0, _type.isFunction)(dataSource) && !_variable_wrapper.default.isWrapped(dataSource)) { dataSource = dataSource({}) } if ((0, _type.isPlainObject)(dataSource) || dataSource instanceof _abstract_store.default || Array.isArray(dataSource)) { if (that.valueExpr) { const dataSourceOptions = (0, _utils.normalizeDataSourceOptions)(dataSource); dataSourceOptions.paginate = false; dataSource = new _data_source.DataSource(dataSourceOptions); return dataSource.load().done((data => { that.items = data; that.updateValueMap && that.updateValueMap() })) } } else { _ui.default.log("E1016") } } else { that.updateValueMap && that.updateValueMap() } } } } calculatedColumnOptions.resizedCallbacks = (0, _callbacks.default)(); if (columnOptions.resized) { calculatedColumnOptions.resizedCallbacks.add(columnOptions.resized.bind(columnOptions)) }(0, _iterator.each)(calculatedColumnOptions, (optionName => { if ((0, _type.isFunction)(calculatedColumnOptions[optionName]) && 0 !== optionName.indexOf("default")) { const defaultOptionName = `default${optionName.charAt(0).toUpperCase()}${optionName.substr(1)}`; calculatedColumnOptions[defaultOptionName] = calculatedColumnOptions[optionName] } })); return calculatedColumnOptions } getRowCount() { this._rowCount = this._rowCount || (0, _m_columns_controller_utils.getRowCount)(this); return this._rowCount } getRowIndex(columnIndex, alwaysGetRowIndex) { const column = this._columns[columnIndex]; const bandColumnsCache = this.getBandColumnsCache(); return column && (alwaysGetRowIndex || column.visible && !(column.command || (0, _type.isDefined)(column.groupIndex))) ? (0, _m_columns_controller_utils.getParentBandColumns)(columnIndex, bandColumnsCache.columnParentByIndex).length : 0 } getChildrenByBandColumn(bandColumnIndex, onlyVisibleDirectChildren) { const bandColumnsCache = this.getBandColumnsCache(); const result = (0, _m_columns_controller_utils.getChildrenByBandColumn)(bandColumnIndex, bandColumnsCache.columnChildrenByIndex, !onlyVisibleDirectChildren); if (onlyVisibleDirectChildren) { return result.filter((column => column.visible && !column.command)).sort(((column1, column2) => column1.visibleIndex - column2.visibleIndex)) } return result } isParentBandColumn(columnIndex, bandColumnIndex) { let result = false; const column = this._columns[columnIndex]; const bandColumnsCache = this.getBandColumnsCache(); const parentBandColumns = column && (0, _m_columns_controller_utils.getParentBandColumns)(columnIndex, bandColumnsCache.columnParentByIndex); if (parentBandColumns) { (0, _iterator.each)(parentBandColumns, ((_, bandColumn) => { if (bandColumn.index === bandColumnIndex) { result = true; return false } })) } return result } isParentColumnVisible(columnIndex) { let result = true; const bandColumnsCache = this.getBandColumnsCache(); const bandColumns = columnIndex >= 0 && (0, _m_columns_controller_utils.getParentBandColumns)(columnIndex, bandColumnsCache.columnParentByIndex); bandColumns && (0, _iterator.each)(bandColumns, ((_, bandColumn) => { result = result && bandColumn.visible; return result })); return result } getColumnId(column) { if (column.command && column.type === _const.GROUP_COMMAND_COLUMN_NAME) { if ((0, _m_columns_controller_utils.isCustomCommandColumn)(this, column)) { return `type:${column.type}` } return `command:${column.command}` } return column.index } getCustomizeTextByDataType(dataType) { return (0, _m_columns_controller_utils.getCustomizeTextByDataType)(dataType) } getHeaderContentAlignment(columnAlignment) { const rtlEnabled = this.option("rtlEnabled"); if (rtlEnabled) { return "left" === columnAlignment ? "right" : "left" } return columnAlignment } } exports.ColumnsController = ColumnsController; exports.columnsControllerModule = { defaultOptions: () => ({ commonColumnSettings: { allowFiltering: true, allowHiding: true, allowSorting: true, allowEditing: true, encodeHtml: true, trueText: _message.default.format("dxDataGrid-trueText"), falseText: _message.default.format("dxDataGrid-falseText") }, allowColumnReordering: false, allowColumnResizing: false, columnResizingMode: "nextColumn", columnMinWidth: void 0, columnWidth: void 0, adaptColumnWidthByRatio: true, columns: void 0, regenerateColumnsByVisibleItems: false, customizeColumns: null, dateSerializationFormat: void 0 }), controllers: { columns: ColumnsController } } }, 22732: /*!*************************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/columns_controller/m_columns_controller_utils.js ***! \*************************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.applyUserState = exports.addExpandColumn = void 0; exports.assignColumns = assignColumns; exports.isCustomCommandColumn = exports.isColumnFixed = exports.getValueDataType = exports.getSerializationFormat = exports.getRowCount = exports.getParentBandColumns = exports.getFixedPosition = exports.getDataColumns = exports.getCustomizeTextByDataType = exports.getColumnIndexByVisibleIndex = exports.getColumnFullPath = exports.getColumnByIndexes = exports.getChildrenByBandColumn = exports.getAlignmentByDataType = exports.fireOptionChanged = exports.fireColumnsChanged = exports.findColumn = exports.digitsCount = exports.defaultSetCellValue = exports.customizeTextForBooleanDataType = exports.createColumnsFromOptions = exports.createColumnsFromDataSource = exports.createColumn = exports.convertOwnerBandToColumnReference = exports.columnOptionCore = exports.calculateColspan = void 0; exports.isSortOrderValid = isSortOrderValid; exports.updateSortOrderWhenGrouping = exports.updateSerializers = exports.updateIndexes = exports.updateColumnVisibleIndexes = exports.updateColumnSortIndexes = exports.updateColumnIndexes = exports.updateColumnGroupIndexes = exports.updateColumnChanges = exports.strictParseNumber = exports.sortColumns = exports.setFilterOperationsAsDefaultValues = exports.resetColumnsCache = exports.resetBandColumnsCache = exports.processExpandColumns = exports.processBandColumns = exports.numberToString = exports.moveColumnToGroup = exports.mergeColumns = void 0; var _array = __webpack_require__( /*! ../../../../core/utils/array */ 89386); var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _data = __webpack_require__( /*! ../../../../core/utils/data */ 47617); var _date_serialization = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date_serialization */ 69434)); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _object = __webpack_require__( /*! ../../../../core/utils/object */ 48013); var _position = __webpack_require__( /*! ../../../../core/utils/position */ 37518); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _variable_wrapper = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/variable_wrapper */ 26974)); var _number = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/number */ 18016)); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../m_utils */ 60082)); var _const = __webpack_require__( /*! ./const */ 54057); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const setFilterOperationsAsDefaultValues = function(column) { column.filterOperations = column.defaultFilterOperations }; exports.setFilterOperationsAsDefaultValues = setFilterOperationsAsDefaultValues; let globalColumnId = 1; const createColumn = function(that, columnOptions, userStateColumnOptions, bandColumn) { let commonColumnOptions = {}; if (columnOptions) { if ((0, _type.isString)(columnOptions)) { columnOptions = { dataField: columnOptions } } that.setName(columnOptions); let result = {}; if (columnOptions.command) { result = (0, _object.deepExtendArraySafe)(commonColumnOptions, columnOptions) } else { commonColumnOptions = that.getCommonSettings(columnOptions); if (userStateColumnOptions && userStateColumnOptions.name && userStateColumnOptions.dataField) { columnOptions = (0, _extend.extend)({}, columnOptions, { dataField: userStateColumnOptions.dataField }) } const calculatedColumnOptions = that._createCalculatedColumnOptions(columnOptions, bandColumn); if (!columnOptions.type) { result = { headerId: "dx-col-" + globalColumnId++ } } result = (0, _object.deepExtendArraySafe)(result, _const.DEFAULT_COLUMN_OPTIONS); (0, _object.deepExtendArraySafe)(result, commonColumnOptions); (0, _object.deepExtendArraySafe)(result, calculatedColumnOptions); (0, _object.deepExtendArraySafe)(result, columnOptions); (0, _object.deepExtendArraySafe)(result, { selector: null }) } if (columnOptions.filterOperations === columnOptions.defaultFilterOperations) { setFilterOperationsAsDefaultValues(result) } return result } }; exports.createColumn = createColumn; const createColumnsFromOptions = function(that, columnsOptions, bandColumn, createdColumnCount) { let result = []; if (columnsOptions) { (0, _iterator.each)(columnsOptions, ((index, columnOptions) => { const currentIndex = (createdColumnCount ?? 0) + result.length; const userStateColumnOptions = that._columnsUserState && checkUserStateColumn(columnOptions, that._columnsUserState[currentIndex]) && that._columnsUserState[currentIndex]; const column = createColumn(that, columnOptions, userStateColumnOptions, bandColumn); if (column) { if (bandColumn) { column.ownerBand = bandColumn } result.push(column); if (column.columns) { result = result.concat(createColumnsFromOptions(that, column.columns, column, result.length)); delete column.columns; column.hasColumns = true } } })) } return result }; exports.createColumnsFromOptions = createColumnsFromOptions; const getParentBandColumns = function(columnIndex, columnParentByIndex) { const result = []; let parent = columnParentByIndex[columnIndex]; while (parent) { result.unshift(parent); columnIndex = parent.index; parent = columnParentByIndex[columnIndex] } return result }; exports.getParentBandColumns = getParentBandColumns; const getChildrenByBandColumn = function(columnIndex, columnChildrenByIndex, recursive) { let result = []; const children = columnChildrenByIndex[columnIndex]; if (children) { for (let i = 0; i < children.length; i++) { const column = children[i]; if (!(0, _type.isDefined)(column.groupIndex) || column.showWhenGrouped) { result.push(column); if (recursive && column.isBand) { result = result.concat(getChildrenByBandColumn(column.index, columnChildrenByIndex, recursive)) } } } } return result }; exports.getChildrenByBandColumn = getChildrenByBandColumn; exports.getColumnByIndexes = function(that, columnIndexes) { let result; let columns; const bandColumnsCache = that.getBandColumnsCache(); const callbackFilter = function(column) { const ownerBand = result ? result.index : void 0; return column.ownerBand === ownerBand }; if (bandColumnsCache.isPlain) { result = that._columns[columnIndexes[0]] } else { columns = that._columns.filter(callbackFilter); for (let i = 0; i < columnIndexes.length; i++) { result = columns[columnIndexes[i]]; if (result) { columns = that._columns.filter(callbackFilter) } } } return result }; const getColumnFullPath = function(that, column) { let result = []; let columns; const bandColumnsCache = that.getBandColumnsCache(); const callbackFilter = function(item) { return item.ownerBand === column.ownerBand }; if (bandColumnsCache.isPlain) { const columnIndex = that._columns.indexOf(column); if (columnIndex >= 0) { result = [`columns[${columnIndex}]`] } } else { columns = that._columns.filter(callbackFilter); while (columns.length && -1 !== columns.indexOf(column)) { result.unshift(`columns[${columns.indexOf(column)}]`); column = bandColumnsCache.columnParentByIndex[column.index]; columns = column ? that._columns.filter(callbackFilter) : [] } } return result.join(".") }; exports.getColumnFullPath = getColumnFullPath; const calculateColspan = function(that, columnID) { let colspan = 0; const columns = that.getChildrenByBandColumn(columnID, true); (0, _iterator.each)(columns, ((_, column) => { if (column.isBand) { column.colspan = column.colspan || calculateColspan(that, column.index); colspan += column.colspan || 1 } else { colspan += 1 } })); return colspan }; exports.calculateColspan = calculateColspan; exports.processBandColumns = function(that, columns, bandColumnsCache) { let rowspan; for (let i = 0; i < columns.length; i++) { const column = columns[i]; if (column.visible || column.command) { if (column.isBand) { column.colspan = column.colspan || calculateColspan(that, column.index) } if (!column.isBand || !column.colspan) { rowspan = that.getRowCount(); if (!column.command && (!(0, _type.isDefined)(column.groupIndex) || column.showWhenGrouped)) { rowspan -= getParentBandColumns(column.index, bandColumnsCache.columnParentByIndex).length } if (rowspan > 1) { column.rowspan = rowspan } } } } }; exports.getValueDataType = function(value) { let dataType = (0, _type.type)(value); if ("string" !== dataType && "boolean" !== dataType && "number" !== dataType && "date" !== dataType && "object" !== dataType) { dataType = void 0 } return dataType }; exports.getSerializationFormat = function(dataType, value) { switch (dataType) { case "date": case "datetime": return _date_serialization.default.getDateSerializationFormat(value); case "number": if ((0, _type.isString)(value)) { return "string" } if ((0, _type.isNumeric)(value)) { return null } } }; exports.updateSerializers = function(options, dataType) { if (!options.deserializeValue) { if (_m_utils.default.isDateType(dataType)) { options.deserializeValue = function(value) { return _date_serialization.default.deserializeDate(value) }; options.serializeValue = function(value) { return (0, _type.isString)(value) ? value : _date_serialization.default.serializeDate(value, this.serializationFormat) } } if ("number" === dataType) { options.deserializeValue = function(value) { const parsedValue = parseFloat(value); return isNaN(parsedValue) ? value : parsedValue }; options.serializeValue = function(value, target) { if ("filter" === target) { return value } return (0, _type.isDefined)(value) && "string" === this.serializationFormat ? value.toString() : value } } } }; exports.getAlignmentByDataType = function(dataType, isRTL) { switch (dataType) { case "number": return "right"; case "boolean": return "center"; default: return (0, _position.getDefaultAlignment)(isRTL) } }; const customizeTextForBooleanDataType = function(e) { if (true === e.value) { return this.trueText || "true" } if (false === e.value) { return this.falseText || "false" } return e.valueText || "" }; exports.customizeTextForBooleanDataType = customizeTextForBooleanDataType; exports.getCustomizeTextByDataType = function(dataType) { if ("boolean" === dataType) { return customizeTextForBooleanDataType } }; exports.createColumnsFromDataSource = function(that, dataSource) { const firstItems = that._getFirstItems(dataSource); let fieldName; const processedFields = {}; const result = []; for (let i = 0; i < firstItems.length; i++) { if (firstItems[i]) { for (fieldName in firstItems[i]) { if (!(0, _type.isFunction)(firstItems[i][fieldName]) || _variable_wrapper.default.isWrapped(firstItems[i][fieldName])) { processedFields[fieldName] = true } } } } for (fieldName in processedFields) { if (0 !== fieldName.indexOf("__")) { const column = createColumn(that, fieldName); result.push(column) } } return result }; const updateColumnIndexes = function(that) { (0, _iterator.each)(that._columns, ((index, column) => { column.index = index })); (0, _iterator.each)(that._columns, ((index, column) => { if ((0, _type.isObject)(column.ownerBand)) { column.ownerBand = column.ownerBand.index } })); (0, _iterator.each)(that._commandColumns, ((index, column) => { column.index = -(index + 1) })) }; exports.updateColumnIndexes = updateColumnIndexes; const updateColumnGroupIndexes = function(that, currentColumn) { (0, _array.normalizeIndexes)(that._columns, "groupIndex", currentColumn, (column => { const { grouped: grouped } = column; delete column.grouped; return grouped })) }; exports.updateColumnGroupIndexes = updateColumnGroupIndexes; const updateColumnSortIndexes = function(that, currentColumn) { (0, _iterator.each)(that._columns, ((index, column) => { if ((0, _type.isDefined)(column.sortIndex) && !isSortOrderValid(column.sortOrder)) { delete column.sortIndex } })); (0, _array.normalizeIndexes)(that._columns, "sortIndex", currentColumn, (column => !(0, _type.isDefined)(column.groupIndex) && isSortOrderValid(column.sortOrder))) }; exports.updateColumnSortIndexes = updateColumnSortIndexes; const updateColumnVisibleIndexes = function(that, currentColumn) { let column; const result = []; const bandColumnsCache = that.getBandColumnsCache(); const bandedColumns = []; const columns = that._columns.filter((column => !column.command)); for (let i = 0; i < columns.length; i++) { column = columns[i]; const parentBandColumns = getParentBandColumns(i, bandColumnsCache.columnParentByIndex); if (parentBandColumns.length) { bandedColumns.push(column) } else { result.push(column) } }(0, _array.normalizeIndexes)(bandedColumns, "visibleIndex", currentColumn); (0, _array.normalizeIndexes)(result, "visibleIndex", currentColumn) }; exports.updateColumnVisibleIndexes = updateColumnVisibleIndexes; exports.getColumnIndexByVisibleIndex = function(that, visibleIndex, location) { const rowIndex = (0, _type.isObject)(visibleIndex) ? visibleIndex.rowIndex : null; const columns = location === _const.GROUP_LOCATION ? that.getGroupColumns() : location === _const.COLUMN_CHOOSER_LOCATION ? that.getChooserColumns() : that.getVisibleColumns(rowIndex); let column; visibleIndex = (0, _type.isObject)(visibleIndex) ? visibleIndex.columnIndex : visibleIndex; column = columns[visibleIndex]; if (column && column.type === _const.GROUP_COMMAND_COLUMN_NAME) { column = that._columns.filter((col => column.type === col.type))[0] || column } return column && (0, _type.isDefined)(column.index) ? column.index : -1 }; exports.moveColumnToGroup = function(that, column, groupIndex) { const groupColumns = that.getGroupColumns(); let i; if (groupIndex >= 0) { for (i = 0; i < groupColumns.length; i++) { if (groupColumns[i].groupIndex >= groupIndex) { groupColumns[i].groupIndex++ } } } else { groupIndex = 0; for (i = 0; i < groupColumns.length; i++) { groupIndex = Math.max(groupIndex, groupColumns[i].groupIndex + 1) } } return groupIndex }; function checkUserStateColumn(column, userStateColumn) { return column && userStateColumn && userStateColumn.name === (column.name || column.dataField) && (userStateColumn.dataField === column.dataField || column.name) } exports.applyUserState = function(that) { const columnsUserState = that._columnsUserState; const ignoreColumnOptionNames = that._ignoreColumnOptionNames || []; const columns = that._columns; const columnCountById = {}; let resultColumns = []; let allColumnsHaveState = true; const userStateColumnIndexes = []; let column; let userStateColumnIndex; let i; function applyFieldsState(column, userStateColumn) { if (!userStateColumn) { return } for (let index = 0; index < _const.USER_STATE_FIELD_NAMES.length; index++) { const fieldName = _const.USER_STATE_FIELD_NAMES[index]; if (ignoreColumnOptionNames.includes(fieldName)) { continue } if ("dataType" === fieldName) { column[fieldName] = column[fieldName] || userStateColumn[fieldName] } else if (_const.USER_STATE_FIELD_NAMES_15_1.includes(fieldName)) { if (fieldName in userStateColumn) { column[fieldName] = userStateColumn[fieldName] } } else { if ("selectedFilterOperation" === fieldName && userStateColumn[fieldName]) { column.defaultSelectedFilterOperation = column[fieldName] || null } column[fieldName] = userStateColumn[fieldName] } } } function findUserStateColumn(columnsUserState, column) { const id = column.name || column.dataField; let count = columnCountById[id] || 0; for (let j = 0; j < columnsUserState.length; j++) { if (checkUserStateColumn(column, columnsUserState[j])) { if (count) { count-- } else { columnCountById[id] = columnCountById[id] || 0; columnCountById[id]++; return j } } } return -1 } if (columnsUserState) { for (i = 0; i < columns.length; i++) { userStateColumnIndex = findUserStateColumn(columnsUserState, columns[i]); allColumnsHaveState = allColumnsHaveState && userStateColumnIndex >= 0; userStateColumnIndexes.push(userStateColumnIndex) } for (i = 0; i < columns.length; i++) { column = columns[i]; userStateColumnIndex = userStateColumnIndexes[i]; if (that._hasUserState || allColumnsHaveState) { applyFieldsState(column, columnsUserState[userStateColumnIndex]) } if (userStateColumnIndex >= 0 && (0, _type.isDefined)(columnsUserState[userStateColumnIndex].initialIndex)) { resultColumns[userStateColumnIndex] = column } else { resultColumns.push(column) } } let hasAddedBands = false; for (i = 0; i < columnsUserState.length; i++) { const columnUserState = columnsUserState[i]; if (columnUserState.added && findUserStateColumn(columns, columnUserState) < 0) { column = createColumn(that, columnUserState.added); applyFieldsState(column, columnUserState); resultColumns.push(column); if (columnUserState.added.columns) { hasAddedBands = true } } } if (hasAddedBands) { updateColumnIndexes(that); resultColumns = createColumnsFromOptions(that, resultColumns) } assignColumns(that, resultColumns) } }; const updateIndexes = function(that, column) { updateColumnIndexes(that); updateColumnGroupIndexes(that, column); updateColumnSortIndexes(that, column); resetBandColumnsCache(that); updateColumnVisibleIndexes(that, column) }; exports.updateIndexes = updateIndexes; const resetColumnsCache = function(that) { that.resetColumnsCache() }; exports.resetColumnsCache = resetColumnsCache; function assignColumns(that, columns) { that._previousColumns = that._columns; that._columns = columns; resetColumnsCache(that); that.updateColumnDataTypes() } const updateColumnChanges = function(that, changeType, optionName, columnIndex) { const columnChanges = that._columnChanges || { optionNames: { length: 0 }, changeTypes: { length: 0 }, columnIndex: columnIndex }; optionName = optionName || "all"; optionName = optionName.split(".")[0]; const { changeTypes: changeTypes } = columnChanges; if (changeType && !changeTypes[changeType]) { changeTypes[changeType] = true; changeTypes.length++ } const { optionNames: optionNames } = columnChanges; if (optionName && !optionNames[optionName]) { optionNames[optionName] = true; optionNames.length++ } if (void 0 === columnIndex || columnIndex !== columnChanges.columnIndex) { if ((0, _type.isDefined)(columnIndex)) { columnChanges.columnIndices ?? (columnChanges.columnIndices = []); if ((0, _type.isDefined)(columnChanges.columnIndex)) { columnChanges.columnIndices.push(columnChanges.columnIndex) } columnChanges.columnIndices.push(columnIndex) } delete columnChanges.columnIndex } that._columnChanges = columnChanges; resetColumnsCache(that) }; exports.updateColumnChanges = updateColumnChanges; exports.fireColumnsChanged = function(that) { const onColumnsChanging = that.option("onColumnsChanging"); const columnChanges = that._columnChanges; const reinitOptionNames = ["dataField", "lookup", "dataType", "columns"]; if (that.isInitialized() && !that._updateLockCount && columnChanges) { if (onColumnsChanging) { that._updateLockCount++; onColumnsChanging((0, _extend.extend)({ component: that.component }, columnChanges)); that._updateLockCount-- } that._columnChanges = void 0; if (options = columnChanges.optionNames, options && reinitOptionNames.some((name => options[name]))) { that._reinitAfterLookupChanges = null === columnChanges || void 0 === columnChanges ? void 0 : columnChanges.optionNames.lookup; that.reinit(); that._reinitAfterLookupChanges = void 0 } else { that.columnsChanged.fire(columnChanges) } } var options }; const updateSortOrderWhenGrouping = function(that, column, groupIndex, prevGroupIndex) { const columnWasGrouped = prevGroupIndex >= 0; if (groupIndex >= 0) { if (!columnWasGrouped) { column.lastSortOrder = column.sortOrder } } else { const sortMode = that.option("sorting.mode"); let sortOrder = column.lastSortOrder; if ("single" === sortMode) { const sortedByAnotherColumn = that._columns.some((col => col !== column && (0, _type.isDefined)(col.sortIndex))); if (sortedByAnotherColumn) { sortOrder = void 0 } } column.sortOrder = sortOrder } }; exports.updateSortOrderWhenGrouping = updateSortOrderWhenGrouping; const fireOptionChanged = function(that, options) { const { value: value } = options; const { optionName: optionName } = options; const { prevValue: prevValue } = options; const { fullOptionName: fullOptionName } = options; const fullOptionPath = `${fullOptionName}.${optionName}`; if (!_const.IGNORE_COLUMN_OPTION_NAMES[optionName] && that._skipProcessingColumnsChange !== fullOptionPath) { that._skipProcessingColumnsChange = fullOptionPath; that.component._notifyOptionChanged(fullOptionPath, value, prevValue); that._skipProcessingColumnsChange = false } }; exports.fireOptionChanged = fireOptionChanged; exports.columnOptionCore = function(that, column, optionName, value, notFireEvent) { const optionGetter = (0, _data.compileGetter)(optionName); const columnIndex = column.index; let columns; let changeType; let initialColumn; if (3 === arguments.length) { return optionGetter(column, { functionsAsIs: true }) } const prevValue = optionGetter(column, { functionsAsIs: true }); if (!(0, _common.equalByValue)(prevValue, value, { maxDepth: 5 })) { if ("groupIndex" === optionName || "calculateGroupValue" === optionName) { changeType = "grouping"; updateSortOrderWhenGrouping(that, column, value, prevValue) } else if ("sortIndex" === optionName || "sortOrder" === optionName || "calculateSortValue" === optionName) { changeType = "sorting" } else { changeType = "columns" } const optionSetter = (0, _data.compileSetter)(optionName); optionSetter(column, value, { functionsAsIs: true }); const fullOptionName = getColumnFullPath(that, column); if (_const.COLUMN_INDEX_OPTIONS[optionName]) { updateIndexes(that, column); value = optionGetter(column) } if ("name" === optionName || "allowEditing" === optionName) { that._checkColumns() } if (!(0, _type.isDefined)(prevValue) && !(0, _type.isDefined)(value) && 0 !== optionName.indexOf("buffer")) { notFireEvent = true } if (!notFireEvent) { if (!_const.USER_STATE_FIELD_NAMES.includes(optionName) && "visibleWidth" !== optionName) { columns = that.option("columns"); initialColumn = that.getColumnByPath(fullOptionName, columns); if ((0, _type.isString)(initialColumn)) { initialColumn = columns[columnIndex] = { dataField: initialColumn } } if (initialColumn && checkUserStateColumn(initialColumn, column)) { optionSetter(initialColumn, value, { functionsAsIs: true }) } } updateColumnChanges(that, changeType, optionName, columnIndex) } else { resetColumnsCache(that) } fullOptionName && fireOptionChanged(that, { fullOptionName: fullOptionName, optionName: optionName, value: value, prevValue: prevValue }) } }; function isSortOrderValid(sortOrder) { return "asc" === sortOrder || "desc" === sortOrder } exports.addExpandColumn = function(that) { const options = that._getExpandColumnOptions(); that.addCommandColumn(options) }; exports.defaultSetCellValue = function(data, value) { if (!this.dataField) { return } const path = this.dataField.split("."); const dotCount = path.length - 1; if (this.serializeValue) { value = this.serializeValue(value) } for (let i = 0; i < dotCount; i++) { const name = path[i]; data = data[name] = data[name] || {} } data[path[dotCount]] = value }; const getDataColumns = function(columns, rowIndex, bandColumnID) { const result = []; rowIndex = rowIndex || 0; columns[rowIndex] && (0, _iterator.each)(columns[rowIndex], ((_, column) => { if (column.ownerBand === bandColumnID || column.type === _const.GROUP_COMMAND_COLUMN_NAME) { if (!column.isBand || !column.colspan) { if (!column.command || rowIndex < 1) { result.push(column) } } else { result.push.apply(result, getDataColumns(columns, rowIndex + 1, column.index)) } } })); return result }; exports.getDataColumns = getDataColumns; exports.getRowCount = function(that) { let rowCount = 1; const bandColumnsCache = that.getBandColumnsCache(); const { columnParentByIndex: columnParentByIndex } = bandColumnsCache; that._columns.forEach((column => { const parents = getParentBandColumns(column.index, columnParentByIndex); const invisibleParents = parents.filter((column => !column.visible)); if (column.visible && !invisibleParents.length) { rowCount = Math.max(rowCount, parents.length + 1) } })); return rowCount }; const isCustomCommandColumn = (that, commandColumn) => { const customCommandColumns = that._columns.filter((column => column.type === commandColumn.type)); return !!customCommandColumns.length }; exports.isCustomCommandColumn = isCustomCommandColumn; exports.getFixedPosition = function(that, column) { const rtlEnabled = that.option("rtlEnabled"); if (column.command && !isCustomCommandColumn(that, column) || !column.fixedPosition) { return rtlEnabled ? "right" : "left" } return column.fixedPosition }; exports.processExpandColumns = function(columns, expandColumns, type, columnIndex) { let customColumnIndex; const rowCount = this.getRowCount(); let rowspan = columns[columnIndex] && columns[columnIndex].rowspan; let expandColumnsByType = expandColumns.filter((column => column.type === type)); columns.forEach(((column, index) => { if (column.type === type) { customColumnIndex = index; rowspan = columns[index + 1] ? columns[index + 1].rowspan : rowCount } })); if (rowspan > 1) { expandColumnsByType = (0, _iterator.map)(expandColumnsByType, (expandColumn => (0, _extend.extend)({}, expandColumn, { rowspan: rowspan }))) } expandColumnsByType.unshift.apply(expandColumnsByType, (0, _type.isDefined)(customColumnIndex) ? [customColumnIndex, 1] : [columnIndex, 0]); columns.splice.apply(columns, expandColumnsByType); return rowspan || 1 }; exports.digitsCount = function(number) { let i; for (i = 0; number > 1; i++) { number /= 10 } return i }; exports.numberToString = function(number, digitsCount) { let str = number ? number.toString() : "0"; while (str.length < digitsCount) { str = `0${str}` } return str }; exports.mergeColumns = (that, columns, commandColumns, needToExtend) => { let column; let commandColumnIndex; let result = columns.slice().map((column => (0, _extend.extend)({}, column))); const isColumnFixing = that._isColumnFixing(); let defaultCommandColumns = commandColumns.slice().map((column => (0, _extend.extend)({ fixed: isColumnFixing }, column))); const getCommandColumnIndex = column => commandColumns.reduce(((result, commandColumn, index) => { const columnType = needToExtend && column.type === _const.GROUP_COMMAND_COLUMN_NAME ? "expand" : column.type; return commandColumn.type === columnType || commandColumn.command === column.command ? index : result }), -1); const callbackFilter = commandColumn => commandColumn.command !== commandColumns[commandColumnIndex].command; for (let i = 0; i < columns.length; i++) { column = columns[i]; commandColumnIndex = column && (column.type || column.command) ? getCommandColumnIndex(column) : -1; if (commandColumnIndex >= 0) { if (needToExtend) { result[i] = (0, _extend.extend)({ fixed: isColumnFixing }, commandColumns[commandColumnIndex], column); if (column.type !== _const.GROUP_COMMAND_COLUMN_NAME) { defaultCommandColumns = defaultCommandColumns.filter(callbackFilter) } } else { const columnOptions = { visibleIndex: column.visibleIndex, index: column.index, headerId: column.headerId, allowFixing: 0 === column.groupIndex, allowReordering: 0 === column.groupIndex, groupIndex: column.groupIndex }; result[i] = (0, _extend.extend)({}, column, commandColumns[commandColumnIndex], column.type === _const.GROUP_COMMAND_COLUMN_NAME && columnOptions) } } } if (columns.length && needToExtend && defaultCommandColumns.length) { result = result.concat(defaultCommandColumns) } return result }; exports.isColumnFixed = (that, column) => (0, _type.isDefined)(column.fixed) || !column.type ? column.fixed : that._isColumnFixing(); exports.convertOwnerBandToColumnReference = columns => { columns.forEach((column => { if ((0, _type.isDefined)(column.ownerBand)) { column.ownerBand = columns[column.ownerBand] } })) }; const resetBandColumnsCache = that => { that._bandColumnsCache = void 0 }; exports.resetBandColumnsCache = resetBandColumnsCache; exports.findColumn = (columns, identifier) => { const identifierOptionName = (0, _type.isString)(identifier) && identifier.substr(0, identifier.indexOf(":")); let column; if (void 0 === identifier) { return } if (identifierOptionName) { identifier = identifier.substr(identifierOptionName.length + 1) } if (identifierOptionName) { column = columns.filter((column => `${column[identifierOptionName]}` === identifier))[0] } else { ["index", "name", "dataField", "caption"].some((optionName => { column = columns.filter((column => column[optionName] === identifier))[0]; return !!column })) } return column }; exports.sortColumns = (columns, sortOrder) => { if ("asc" !== sortOrder && "desc" !== sortOrder) { return columns } const sign = "asc" === sortOrder ? 1 : -1; columns.sort(((column1, column2) => { const caption1 = column1.caption || ""; const caption2 = column2.caption || ""; return sign * caption1.localeCompare(caption2) })); return columns }; exports.strictParseNumber = function(text, format) { const parsedValue = _number.default.parse(text); if ((0, _type.isNumeric)(parsedValue)) { const formattedValue = _number.default.format(parsedValue, format); const formattedValueWithDefaultFormat = _number.default.format(parsedValue, "decimal"); if (formattedValue === text || formattedValueWithDefaultFormat === text) { return parsedValue } } } }, 49505: /*!*************************************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/columns_resizing_reordering/m_columns_resizing_reordering.js ***! \*************************************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.columnsResizingReorderingModule = exports.TrackerView = exports.TablePositionViewController = exports.SeparatorView = exports.DraggingHeaderViewController = exports.DraggingHeaderView = exports.ColumnsSeparatorView = exports.ColumnsResizerViewController = exports.BlockSeparatorView = void 0; var _fx = _interopRequireDefault(__webpack_require__( /*! ../../../../animation/fx */ 87209)); var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../../core/dom_adapter */ 73349)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _callbacks = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/callbacks */ 44504)); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _position = __webpack_require__( /*! ../../../../core/utils/position */ 37518); var _size = __webpack_require__( /*! ../../../../core/utils/size */ 58664); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../../events/core/events_engine */ 55994)); var _drag = __webpack_require__( /*! ../../../../events/drag */ 23174); var _pointer = _interopRequireDefault(__webpack_require__( /*! ../../../../events/pointer */ 93786)); var _index = __webpack_require__( /*! ../../../../events/utils/index */ 39611); var _swatch_container = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/widget/swatch_container */ 92591)); var _m_modules = _interopRequireDefault(__webpack_require__( /*! ../m_modules */ 15943)); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../m_utils */ 60082)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const MODULE_NAMESPACE = "dxDataGridResizingReordering"; const allowResizing = function(that) { return that.option("allowColumnResizing") || that.getController("columns").isColumnOptionUsed("allowResizing") }; const allowReordering = function(that) { return that.option("allowColumnReordering") || that.getController("columns").isColumnOptionUsed("allowReordering") }; class TrackerView extends _m_modules.default.View { init() { super.init(); this._tablePositionController = this.getController("tablePosition"); this._subscribeToCallback() } dispose() { this._unsubscribeFromCallback(); super.dispose() } optionChanged(args) { if ("allowColumnResizing" === args.name) { this._unsubscribeFromCallback(); if (args.value) { this._subscribeToCallback(); this._invalidate() } } super.optionChanged(args) } _renderCore() { const deferred = super._renderCore(); this.element().addClass(this.addWidgetPrefix("tracker")); this.hide(); return deferred } _unsubscribeFromCallback() { if (this._positionChanged) { this._tablePositionController.positionChanged.remove(this._positionChanged) } } _subscribeToCallback() { const that = this; that._positionChanged = function(position) { const $element = that.element(); if ($element && $element.hasClass(that.addWidgetPrefix("tracker"))) { $element.css({ top: position.top }); (0, _size.setHeight)($element, position.height) } }; this._tablePositionController.positionChanged.add(that._positionChanged) } isVisible() { return allowResizing(this) } show() { this.element().show() } hide() { this.element() && this.element().hide() } setHeight(value) { (0, _size.setHeight)(this.element(), value) } } exports.TrackerView = TrackerView; class SeparatorView extends _m_modules.default.View { _renderSeparator() {} _renderCore(options) { const deferred = super._renderCore(options); this._isShown = true; this._renderSeparator(); this.hide(); return deferred } show() { this._isShown = true } hide() { this._isShown = false } height(value) { const $element = this.element(); if ($element) { if ((0, _type.isDefined)(value)) { (0, _size.setHeight)($element, value) } else { return (0, _size.getHeight)($element) } } } width(value) { const $element = this.element(); if ($element) { if ((0, _type.isDefined)(value)) { (0, _size.setWidth)($element, value) } else { return (0, _size.getWidth)($element) } } } } exports.SeparatorView = SeparatorView; class ColumnsSeparatorView extends SeparatorView { init() { super.init(); this._tablePositionController = this.getController("tablePosition"); this._init() } dispose() { this._unsubscribeFromCallback(); super.dispose() } optionChanged(args) { if ("allowColumnResizing" === args.name) { if (args.value) { this._init(); this._invalidate(); this.hide(true) } else { this._unsubscribeFromCallback(); this._isTransparent = allowResizing(this); this.hide(true) } } super.optionChanged(args) } _renderSeparator() { super._renderSeparator(); const $element = this.element(); $element.addClass(this.addWidgetPrefix("columns-separator")) } _subscribeToCallback() { const that = this; let $element; that._positionChanged = function(position) { $element = that.element(); if ($element) { $element.css({ top: position.top }); (0, _size.setHeight)($element, position.height) } }; that._tablePositionController.positionChanged.add(that._positionChanged) } _unsubscribeFromCallback() { this._positionChanged && this._tablePositionController.positionChanged.remove(this._positionChanged) } _init() { this._isTransparent = allowResizing(this); if (this.isVisible()) { this._subscribeToCallback() } } isVisible() { return this.option("showColumnHeaders") && (allowReordering(this) || allowResizing(this)) } show() { const that = this; const $element = this.element(); if ($element && !that._isShown) { if (that._isTransparent) { $element.removeClass(that.addWidgetPrefix("columns-separator-transparent")) } else { $element.show() } } super.show() } hide(force) { const $element = this.element(); const columnsSeparatorTransparent = this.addWidgetPrefix("columns-separator-transparent"); if ($element && (this._isShown || force)) { if (this._isTransparent) { $element.addClass(columnsSeparatorTransparent); $element.css("left", ""); $element.show() } else { if ($element.hasClass(columnsSeparatorTransparent)) { $element.removeClass(columnsSeparatorTransparent) } $element.hide() } } super.hide() } moveByX(outerX) { const $element = this.element(); if ($element) { $element.css("left", null === outerX ? 0 : outerX - this._parentElement().offset().left) } } changeCursor(cursorName) { cursorName = (0, _type.isDefined)(cursorName) ? cursorName : ""; const $element = this.element(); if ($element) { $element.css("cursor", cursorName) } } } exports.ColumnsSeparatorView = ColumnsSeparatorView; class BlockSeparatorView extends SeparatorView { init() { super.init(); const dataController = this.getController("data"); dataController.loadingChanged.add((isLoading => { if (!isLoading) { this.hide() } })) } _renderSeparator() { super._renderSeparator(); this.element().addClass("dx-block-separator").html(" ") } hide() { const that = this; const $parent = this._parentElement(); const $element = this.element(); if ($element && this._isShown) { $element.css("display", "none") } if ($parent && !$parent.children(".dx-block-separator").length) { $parent.prepend(that.element()) } super.hide() } isVisible() { const groupPanelOptions = this.option("groupPanel"); const columnChooserOptions = this.option("columnChooser"); return groupPanelOptions && groupPanelOptions.visible || columnChooserOptions && columnChooserOptions.enabled } show(targetLocation) { const $element = this.element(); if ($element && !this._isShown) { switch (targetLocation) { case "group": this.element().css("display", "block"); break; case "columnChooser": ! function(toOptions) { _fx.default.stop($element, true); _fx.default.animate($element, { type: "slide", from: { width: 0, display: toOptions.display }, to: toOptions, duration: 300, easing: "swing" }) }({ width: "100%", display: "block" }); break; default: $element.css("display", "") } } super.show() } } exports.BlockSeparatorView = BlockSeparatorView; class DraggingHeaderView extends _m_modules.default.View { init() { super.init(); const dataController = this.getController("data"); this._controller = this.getController("draggingHeader"); this._columnsResizerViewController = this.getController("columnsResizer"); this._columnsController = this.getController("columns"); this._isDragging = false; dataController.loadingChanged.add((isLoading => { const element = this.element(); if (!isLoading && element) { element.hide() } })) } isDragging() { return this._isDragging } _getDraggingPanelByPos(pos) { let result; (0, _iterator.each)(this._dragOptions.draggingPanels, ((index, draggingPanel) => { if (draggingPanel) { const boundingRect = draggingPanel.getBoundingRect(); if (boundingRect && (void 0 === boundingRect.bottom || pos.y < boundingRect.bottom) && (void 0 === boundingRect.top || pos.y > boundingRect.top) && (void 0 === boundingRect.left || pos.x > boundingRect.left) && (void 0 === boundingRect.right || pos.x < boundingRect.right)) { result = draggingPanel; return false } } return })); return result } _renderCore() { this.element().addClass(`${this.addWidgetPrefix("drag-header")} ${this.addWidgetPrefix("text-content")} dx-widget`).hide() } _resetTargetColumnOptions() { const params = this._dropOptions; params.targetColumnIndex = -1; delete params.targetColumnElement; delete params.isLast; delete params.posX; delete params.posY } _getVisibleIndexObject(rowIndex, visibleIndex) { if ((0, _type.isDefined)(rowIndex)) { return { columnIndex: visibleIndex, rowIndex: rowIndex } } return visibleIndex } dispose() { const element = this.element(); this._dragOptions = null; element && element.parent().find(`.${this.addWidgetPrefix("drag-header")}`).remove() } isVisible() { const commonColumnSettings = this._columnsController.getCommonSettings(); return this.option("showColumnHeaders") && (allowReordering(this) || commonColumnSettings.allowGrouping || commonColumnSettings.allowHiding) } dragHeader(options) { const { columnElement: columnElement } = options; const isCommandColumn = !!options.sourceColumn.type; this._isDragging = true; this._dragOptions = options; this._dropOptions = { sourceIndex: options.index, sourceColumnIndex: this._getVisibleIndexObject(options.rowIndex, options.columnIndex), sourceColumnElement: options.columnElement, sourceLocation: options.sourceLocation }; const document = _dom_adapter.default.getDocument(); this._onSelectStart = document.onselectstart; document.onselectstart = function() { return false }; this._controller.drag(this._dropOptions); this.element().css({ textAlign: columnElement && columnElement.css("textAlign"), height: columnElement && (isCommandColumn && columnElement.get(0).clientHeight || (0, _size.getHeight)(columnElement)), width: columnElement && (isCommandColumn && columnElement.get(0).clientWidth || (0, _size.getWidth)(columnElement)), whiteSpace: columnElement && columnElement.css("whiteSpace") }).addClass(this.addWidgetPrefix("drag-action")).toggleClass("dx-drag-command-cell", isCommandColumn).text(isCommandColumn ? "" : options.sourceColumn.caption); this.element().appendTo(_swatch_container.default.getSwatchContainer(columnElement)) } moveHeader(args) { const e = args.event; const { that: that } = e.data; const eventData = (0, _index.eventData)(e); const isResizing = that._columnsResizerViewController ? that._columnsResizerViewController.isResizing() : false; const dragOptions = that._dragOptions; if (that._isDragging && !isResizing) { const $element = that.element(); const moveDeltaX = Math.abs(eventData.x - dragOptions.columnElement.offset().left - dragOptions.deltaX); const moveDeltaY = Math.abs(eventData.y - dragOptions.columnElement.offset().top - dragOptions.deltaY); if ($element.is(":visible") || moveDeltaX > 5 || moveDeltaY > 5) { $element.show(); const newLeft = eventData.x - dragOptions.deltaX; const newTop = eventData.y - dragOptions.deltaY; $element.css({ left: newLeft, top: newTop }); that.dockHeader(eventData) } e.preventDefault() } } dockHeader(eventData) { const that = this; const targetDraggingPanel = that._getDraggingPanelByPos(eventData); const controller = that._controller; const params = that._dropOptions; const dragOptions = that._dragOptions; if (targetDraggingPanel) { const rtlEnabled = that.option("rtlEnabled"); const isVerticalOrientation = "columnChooser" === targetDraggingPanel.getName(); const axisName = isVerticalOrientation ? "y" : "x"; const targetLocation = targetDraggingPanel.getName(); const rowIndex = "headers" === targetLocation ? dragOptions.rowIndex : void 0; const { sourceColumn: sourceColumn } = dragOptions; const columnElements = targetDraggingPanel.getColumnElements(rowIndex, null === sourceColumn || void 0 === sourceColumn ? void 0 : sourceColumn.ownerBand) || []; const pointsByTarget = dragOptions.pointsByTarget = dragOptions.pointsByTarget || {}; const pointsByColumns = "columnChooser" === targetLocation ? [] : pointsByTarget[targetLocation] || controller._generatePointsByColumns((0, _extend.extend)({}, dragOptions, { targetDraggingPanel: targetDraggingPanel, columns: targetDraggingPanel.getColumns(rowIndex), columnElements: columnElements, isVerticalOrientation: isVerticalOrientation, startColumnIndex: "headers" === targetLocation && (0, _renderer.default)(columnElements[0]).index() })); pointsByTarget[targetLocation] = pointsByColumns; params.targetLocation = targetLocation; if (pointsByColumns.length > 0) { for (let i = 0; i < pointsByColumns.length; i++) { const centerPosition = pointsByColumns[i + 1] && (pointsByColumns[i][axisName] + pointsByColumns[i + 1][axisName]) / 2; if (void 0 === centerPosition || (rtlEnabled && "x" === axisName ? eventData[axisName] > centerPosition : eventData[axisName] < centerPosition)) { params.targetColumnIndex = that._getVisibleIndexObject(rowIndex, pointsByColumns[i].columnIndex); if (columnElements[i]) { params.targetColumnElement = columnElements.eq(i); params.isLast = false } else { params.targetColumnElement = columnElements.last(); params.isLast = true } params.posX = pointsByColumns[i].x; params.posY = pointsByColumns[i].y; controller.dock(params); break } } } else { that._resetTargetColumnOptions(); controller.dock(params) } } } dropHeader(args) { const e = args.event; const { that: that } = e.data; const controller = that._controller; that.element().hide(); if (controller && that._isDragging) { controller.drop(that._dropOptions) } that.element().appendTo(that._parentElement()); that._dragOptions = null; that._dropOptions = null; that._isDragging = false; _dom_adapter.default.getDocument().onselectstart = that._onSelectStart || null } } exports.DraggingHeaderView = DraggingHeaderView; const isNextColumnResizingMode = function(that) { return "widget" !== that.option("columnResizingMode") }; class ColumnsResizerViewController extends _m_modules.default.ViewController { init() { this._subscribesToCallbacks = []; if (allowResizing(this)) { this._init() } } dispose() { this._unsubscribes(); super.dispose() } optionChanged(args) { super.optionChanged(args); if ("allowColumnResizing" === args.name) { if (args.value) { this._init(); this._subscribeToEvents() } else { this._unsubscribes() } } } _isHeadersRowArea(posY) { if (this._columnHeadersView) { const element = this._columnHeadersView.element(); if (element) { const offsetTop = element.offset().top; const headersRowHeight = this._columnHeadersView.getHeadersRowHeight(); return posY >= offsetTop && posY <= offsetTop + headersRowHeight } } return false } _isRtlParentStyle() { var _this$_$parentContain; return this.option("rtlEnabled") && "rtl" === (null === (_this$_$parentContain = this._$parentContainer) || void 0 === _this$_$parentContain ? void 0 : _this$_$parentContain.parent().css("direction")) } _pointCreated(point, cellsLength, columns) { const isNextColumnMode = isNextColumnResizingMode(this); const rtlEnabled = this.option("rtlEnabled"); const isRtlParentStyle = this._isRtlParentStyle(); const firstPointColumnIndex = !isNextColumnMode && rtlEnabled && !isRtlParentStyle ? 0 : 1; if (point.index >= firstPointColumnIndex && point.index < cellsLength + (!isNextColumnMode && (!rtlEnabled || isRtlParentStyle) ? 1 : 0)) { point.columnIndex -= firstPointColumnIndex; const currentColumn = columns[point.columnIndex] || {}; const nextColumn = columns[point.columnIndex + 1] || {}; return !(isNextColumnMode ? currentColumn.allowResizing && nextColumn.allowResizing : currentColumn.allowResizing) } return true } _getTargetPoint(pointsByColumns, currentX, deltaX) { if (pointsByColumns) { for (let i = 0; i < pointsByColumns.length; i++) { if (pointsByColumns[i].x === pointsByColumns[0].x && pointsByColumns[i + 1] && pointsByColumns[i].x === pointsByColumns[i + 1].x) { continue } if (pointsByColumns[i].x - deltaX <= currentX && currentX <= pointsByColumns[i].x + deltaX) { return pointsByColumns[i] } } } return null } _moveSeparator(args) { var _that$_draggingHeader; const e = args.event; const that = e.data; const columnsSeparatorWidth = that._columnsSeparatorView.width(); const isNextColumnMode = isNextColumnResizingMode(that); const deltaX = columnsSeparatorWidth / 2; const parentOffset = that._$parentContainer.offset(); const parentOffsetLeft = parentOffset.left; const eventData = (0, _index.eventData)(e); const rtlEnabled = that.option("rtlEnabled"); const isRtlParentStyle = this._isRtlParentStyle(); const isDragging = null === (_that$_draggingHeader = that._draggingHeaderView) || void 0 === _that$_draggingHeader ? void 0 : _that$_draggingHeader.isDragging(); if (that._isResizing && that._resizingInfo) { if ((parentOffsetLeft <= eventData.x || !isNextColumnMode && isRtlParentStyle) && (!isNextColumnMode || eventData.x <= parentOffsetLeft + (0, _size.getWidth)(that._$parentContainer))) { if (that._updateColumnsWidthIfNeeded(eventData.x)) { const $cell = that._columnHeadersView.getColumnElements().eq(that._resizingInfo.currentColumnIndex); const cell = $cell[0]; if (cell) { const outerWidth = cell.getBoundingClientRect().width; that._columnsSeparatorView.moveByX($cell.offset().left + ((isNextColumnMode || isRtlParentStyle) && rtlEnabled ? 0 : outerWidth)); that._tablePositionController.update(that._targetPoint.y); e.preventDefault() } } } } else if (!isDragging) { if (that._isHeadersRowArea(eventData.y)) { if (that._previousParentOffset) { if (that._previousParentOffset.left !== parentOffset.left || that._previousParentOffset.top !== parentOffset.top) { that.pointsByColumns(null) } } that._targetPoint = that._getTargetPoint(that.pointsByColumns(), eventData.x, columnsSeparatorWidth); that._previousParentOffset = parentOffset; that._isReadyResizing = false; if (that._targetPoint) { that._columnsSeparatorView.changeCursor("col-resize"); that._columnsSeparatorView.moveByX(that._targetPoint.x - deltaX); that._tablePositionController.update(that._targetPoint.y); that._isReadyResizing = true; e.preventDefault() } else { that._columnsSeparatorView.changeCursor(); that._columnsSeparatorView.moveByX(null) } } else { that.pointsByColumns(null); that._isReadyResizing = false; that._columnsSeparatorView.changeCursor(); that._columnsSeparatorView.moveByX(null) } } } _endResizing(args) { const e = args.event; const that = e.data; if (that._isResizing) { that.pointsByColumns(null); that._resizingInfo = null; that._columnsSeparatorView.hide(); that._columnsSeparatorView.changeCursor(); that._trackerView.hide(); that._isReadyResizing = false; that._isResizing = false } } _getNextColumnIndex(currentColumnIndex) { return currentColumnIndex + 1 } _setupResizingInfo(posX) { const currentColumnIndex = this._targetPoint.columnIndex; const nextColumnIndex = this._getNextColumnIndex(currentColumnIndex); const currentHeader = this._columnHeadersView.getHeaderElement(currentColumnIndex); const nextHeader = this._columnHeadersView.getHeaderElement(nextColumnIndex); this._resizingInfo = { startPosX: posX, currentColumnIndex: currentColumnIndex, currentColumnWidth: currentHeader && currentHeader.length > 0 ? (0, _position.getBoundingRect)(currentHeader[0]).width : 0, nextColumnIndex: nextColumnIndex, nextColumnWidth: nextHeader && nextHeader.length > 0 ? (0, _position.getBoundingRect)(nextHeader[0]).width : 0 } } _startResizing(args) { const e = args.event; const that = e.data; const eventData = (0, _index.eventData)(e); if ((0, _index.isTouchEvent)(e)) { if (that._isHeadersRowArea(eventData.y)) { that._targetPoint = that._getTargetPoint(that.pointsByColumns(), eventData.x, 10); if (that._targetPoint) { that._columnsSeparatorView.moveByX(that._targetPoint.x - that._columnsSeparatorView.width() / 2); that._isReadyResizing = true } } else { that._isReadyResizing = false } } if (that._isReadyResizing) { that._setupResizingInfo(eventData.x); that._isResizing = true; that._tablePositionController.update(that._targetPoint.y); that._columnsSeparatorView.show(); that._trackerView.show(); const scrollable = that.component.getScrollable(); if (scrollable && that._isRtlParentStyle()) { that._scrollRight = (0, _size.getWidth)(scrollable.$content()) - (0, _size.getWidth)(scrollable.container()) - scrollable.scrollLeft() } e.preventDefault(); e.stopPropagation() } if (this.isResizing()) { this._editorFactoryController.loseFocus() } } _generatePointsByColumns() { const that = this; const columns = that._columnsController ? that._columnsController.getVisibleColumns() : []; const cells = that._columnHeadersView.getColumnElements(); let pointsByColumns = []; if (cells && cells.length > 0) { pointsByColumns = _m_utils.default.getPointsByColumns(cells, (point => that._pointCreated(point, cells.length, columns))) } that._pointsByColumns = pointsByColumns } _unsubscribeFromEvents() { this._moveSeparatorHandler && _events_engine.default.off(_dom_adapter.default.getDocument(), (0, _index.addNamespace)(_pointer.default.move, MODULE_NAMESPACE), this._moveSeparatorHandler); this._startResizingHandler && _events_engine.default.off(this._$parentContainer, (0, _index.addNamespace)(_pointer.default.down, MODULE_NAMESPACE), this._startResizingHandler); if (this._endResizingHandler) { _events_engine.default.off(this._columnsSeparatorView.element(), (0, _index.addNamespace)(_pointer.default.up, MODULE_NAMESPACE), this._endResizingHandler); _events_engine.default.off(_dom_adapter.default.getDocument(), (0, _index.addNamespace)(_pointer.default.up, MODULE_NAMESPACE), this._endResizingHandler) } } _subscribeToEvents() { this._moveSeparatorHandler = this.createAction(this._moveSeparator); this._startResizingHandler = this.createAction(this._startResizing); this._endResizingHandler = this.createAction(this._endResizing); _events_engine.default.on(_dom_adapter.default.getDocument(), (0, _index.addNamespace)(_pointer.default.move, MODULE_NAMESPACE), this, this._moveSeparatorHandler); _events_engine.default.on(this._$parentContainer, (0, _index.addNamespace)(_pointer.default.down, MODULE_NAMESPACE), this, this._startResizingHandler); _events_engine.default.on(this._columnsSeparatorView.element(), (0, _index.addNamespace)(_pointer.default.up, MODULE_NAMESPACE), this, this._endResizingHandler); _events_engine.default.on(_dom_adapter.default.getDocument(), (0, _index.addNamespace)(_pointer.default.up, MODULE_NAMESPACE), this, this._endResizingHandler) } _updateColumnsWidthIfNeeded(posX) { let deltaX; let needUpdate = false; let contentWidth = this._rowsView.contentWidth(); const resizingInfo = this._resizingInfo; const columnsController = this._columnsController; const visibleColumns = columnsController.getVisibleColumns(); const columnsSeparatorWidth = this._columnsSeparatorView.width(); const isNextColumnMode = isNextColumnResizingMode(this); const adaptColumnWidthByRatio = isNextColumnMode && this.option("adaptColumnWidthByRatio") && !this.option("columnAutoWidth"); const rtlEnabled = this.option("rtlEnabled"); const isRtlParentStyle = this._isRtlParentStyle(); const column = visibleColumns[resizingInfo.currentColumnIndex]; const nextColumn = visibleColumns[resizingInfo.nextColumnIndex]; function isPercentWidth(width) { return (0, _type.isString)(width) && width.endsWith("%") } function setColumnWidth(column, columnWidth, contentWidth, adaptColumnWidthByRatio) { if (column) { const oldColumnWidth = column.width; if (oldColumnWidth) { adaptColumnWidthByRatio = isPercentWidth(oldColumnWidth) } if (adaptColumnWidthByRatio) { columnsController.columnOption(column.index, "visibleWidth", columnWidth); columnsController.columnOption(column.index, "width", `${(columnWidth/contentWidth*100).toFixed(3)}%`) } else { columnsController.columnOption(column.index, "visibleWidth", null); columnsController.columnOption(column.index, "width", columnWidth) } } } deltaX = posX - resizingInfo.startPosX; if ((isNextColumnMode || isRtlParentStyle) && rtlEnabled) { deltaX = -deltaX } let { cellWidth: cellWidth, nextCellWidth: nextCellWidth } = function(delta) { let nextMinWidth; let nextCellWidth; let needCorrectionNextCellWidth; const cellWidth = resizingInfo.currentColumnWidth + delta; const minWidth = column && column.minWidth || columnsSeparatorWidth; const result = {}; if (cellWidth >= minWidth) { result.cellWidth = cellWidth } else { result.cellWidth = minWidth; needCorrectionNextCellWidth = true } if (isNextColumnMode) { nextCellWidth = resizingInfo.nextColumnWidth - delta; nextMinWidth = nextColumn && nextColumn.minWidth || columnsSeparatorWidth; if (nextCellWidth >= nextMinWidth) { if (needCorrectionNextCellWidth) { result.nextCellWidth = resizingInfo.nextColumnWidth - (delta + minWidth - cellWidth) } else { result.nextCellWidth = nextCellWidth } } else { result.nextCellWidth = nextMinWidth; result.cellWidth = resizingInfo.currentColumnWidth + (delta - nextMinWidth + nextCellWidth) } } return result }(deltaX); needUpdate = column.width !== cellWidth; if (needUpdate) { columnsController.beginUpdate(); cellWidth = Math.floor(cellWidth); contentWidth = function(contentWidth, visibleColumns) { const allColumnsHaveWidth = visibleColumns.every((column => column.width)); if (allColumnsHaveWidth) { const totalPercent = visibleColumns.reduce(((sum, column) => { if (isPercentWidth(column.width)) { sum += parseFloat(column.width) } return sum }), 0); if (totalPercent > 100) { contentWidth = contentWidth / totalPercent * 100 } } return contentWidth }(contentWidth, visibleColumns); setColumnWidth(column, cellWidth, contentWidth, adaptColumnWidthByRatio); if (isNextColumnMode) { nextCellWidth = Math.floor(nextCellWidth); setColumnWidth(nextColumn, nextCellWidth, contentWidth, adaptColumnWidthByRatio) } else { const columnWidths = this._columnHeadersView.getColumnWidths(); columnWidths[resizingInfo.currentColumnIndex] = cellWidth; const hasScroll = columnWidths.reduce(((totalWidth, width) => totalWidth + width), 0) > this._rowsView.contentWidth(); if (!hasScroll) { const lastColumnIndex = _m_utils.default.getLastResizableColumnIndex(visibleColumns); if (lastColumnIndex >= 0) { columnsController.columnOption(visibleColumns[lastColumnIndex].index, "visibleWidth", "auto") } } for (let i = 0; i < columnWidths.length; i++) { if (visibleColumns[i] && visibleColumns[i] !== column && void 0 === visibleColumns[i].width) { columnsController.columnOption(visibleColumns[i].index, "width", columnWidths[i]) } } } columnsController.endUpdate(); if (!isNextColumnMode) { this.component.updateDimensions(); const scrollable = this.component.getScrollable(); if (scrollable && isRtlParentStyle) { const left = (0, _size.getWidth)(scrollable.$content()) - (0, _size.getWidth)(scrollable.container()) - this._scrollRight; scrollable.scrollTo({ left: left }) } } } return needUpdate } _subscribeToCallback(callback, handler) { callback.add(handler); this._subscribesToCallbacks.push({ callback: callback, handler: handler }) } _unsubscribeFromCallbacks() { for (let i = 0; i < this._subscribesToCallbacks.length; i++) { const subscribe = this._subscribesToCallbacks[i]; subscribe.callback.remove(subscribe.handler) } this._subscribesToCallbacks = [] } _unsubscribes() { this._unsubscribeFromEvents(); this._unsubscribeFromCallbacks() } _init() { const generatePointsByColumnsHandler = () => { if (!this._isResizing) { this.pointsByColumns(null) } }; const generatePointsByColumnsScrollHandler = offset => { if (this._scrollLeft !== offset.left) { this._scrollLeft = offset.left; this.pointsByColumns(null) } }; this._columnsSeparatorView = this.getView("columnsSeparatorView"); this._columnHeadersView = this.getView("columnHeadersView"); this._trackerView = this.getView("trackerView"); this._rowsView = this.getView("rowsView"); this._columnsController = this.getController("columns"); this._tablePositionController = this.getController("tablePosition"); this._editorFactoryController = this.getController("editorFactory"); this._draggingHeaderView = this.component.getView("draggingHeaderView"); this._$parentContainer = this.component.$element(); this._subscribeToCallback(this._columnHeadersView.renderCompleted, generatePointsByColumnsHandler); this._subscribeToCallback(this._columnHeadersView.resizeCompleted, generatePointsByColumnsHandler); this._subscribeToCallback(this._columnsSeparatorView.renderCompleted, (() => { this._unsubscribeFromEvents(); this._subscribeToEvents() })); this._subscribeToCallback(this._rowsView.renderCompleted, (() => { this._rowsView.scrollChanged.remove(generatePointsByColumnsScrollHandler); this._rowsView.scrollChanged.add(generatePointsByColumnsScrollHandler) })); let previousScrollbarVisibility = 0 !== this._rowsView.getScrollbarWidth(); let previousTableHeight = 0; this._subscribeToCallback(this._tablePositionController.positionChanged, (e => { if (this._isResizing && !this._rowsView.isResizing) { const scrollbarVisibility = 0 !== this._rowsView.getScrollbarWidth(); if (previousScrollbarVisibility !== scrollbarVisibility || previousTableHeight && previousTableHeight !== e.height) { previousScrollbarVisibility = scrollbarVisibility; previousTableHeight = e.height; this.component.updateDimensions() } else { this._rowsView.updateFreeSpaceRowHeight() } } previousTableHeight = e.height })) } isResizing() { return this._isResizing } pointsByColumns(value) { if (void 0 !== value) { this._pointsByColumns = value } else { if (!this._pointsByColumns) { this._generatePointsByColumns() } return this._pointsByColumns } } } exports.ColumnsResizerViewController = ColumnsResizerViewController; class TablePositionViewController extends _m_modules.default.ViewController { constructor(component) { super(component); this.positionChanged = (0, _callbacks.default)() } init() { super.init(); this._columnsResizerController = this.getController("columnsResizer"); this._columnHeadersView = this.getView("columnHeadersView"); this._rowsView = this.getView("rowsView"); this._pagerView = this.getView("pagerView"); this._rowsView.resizeCompleted.add((() => { if (this.option("allowColumnResizing")) { const targetPoint = this._columnsResizerController._targetPoint; this.update(targetPoint ? targetPoint.y : null) } })) } update(top) { const params = {}; const $element = this._columnHeadersView.element(); const offset = $element && $element.offset(); const offsetTop = offset && offset.top || 0; const diffOffsetTop = (0, _type.isDefined)(top) ? Math.abs(top - offsetTop) : 0; const columnsHeadersHeight = this._columnHeadersView ? this._columnHeadersView.getHeight() : 0; const scrollBarWidth = this._rowsView.getScrollbarWidth(true); const rowsHeight = this._rowsView ? this._rowsView.height() - scrollBarWidth : 0; const draggingHeaderView = this.component.getView("draggingHeaderView"); params.height = columnsHeadersHeight; const isDraggingOrResizing = this._columnsResizerController.isResizing() || draggingHeaderView.isDragging(); if (isDraggingOrResizing) { params.height += rowsHeight - diffOffsetTop } if (null !== top && $element && $element.length) { params.top = $element[0].offsetTop + diffOffsetTop } this.positionChanged.fire(params) } } exports.TablePositionViewController = TablePositionViewController; class DraggingHeaderViewController extends _m_modules.default.ViewController { init() { super.init(); this._columnsController = this.getController("columns"); this._tablePositionController = this.getController("tablePosition"); this._columnHeadersView = this.getView("columnHeadersView"); this._columnsSeparatorView = this.getView("columnsSeparatorView"); this._draggingHeaderView = this.getView("draggingHeaderView"); this._rowsView = this.getView("rowsView"); this._blockSeparatorView = this.getView("blockSeparatorView"); this._headerPanelView = this.getView("headerPanel"); this._columnChooserView = this.getView("columnChooserView"); const subscribeToEvents = () => { if (this._draggingHeaderView) { const draggingPanels = [this._columnChooserView, this._columnHeadersView, this._headerPanelView]; this._unsubscribeFromEvents(this._draggingHeaderView, draggingPanels); this._subscribeToEvents(this._draggingHeaderView, draggingPanels) } }; this._columnHeadersView.renderCompleted.add(subscribeToEvents); this._headerPanelView && this._headerPanelView.renderCompleted.add(subscribeToEvents); this._columnChooserView && this._columnChooserView.renderCompleted.add(subscribeToEvents) } dispose() { if (this._draggingHeaderView) { this._unsubscribeFromEvents(this._draggingHeaderView, [this._columnChooserView, this._columnHeadersView, this._headerPanelView]) } } _generatePointsByColumns(options) { const that = this; this.isCustomGroupColumnPosition = this.checkIsCustomGroupColumnPosition(options); const points = _m_utils.default.getPointsByColumns(options.columnElements, (point => that._pointCreated(point, options.columns, options.targetDraggingPanel.getName(), options.sourceColumn)), options.isVerticalOrientation, options.startColumnIndex); return points } checkIsCustomGroupColumnPosition(options) { let wasOnlyCommandColumns = true; for (let i = 0; i < options.columns.length; i += 1) { const col = options.columns[i]; if ("expand" === col.command && !wasOnlyCommandColumns) { return true } if (!col.command) { wasOnlyCommandColumns = false } } return false } _pointCreated(point, columns, location, sourceColumn) { const targetColumn = columns[point.columnIndex]; const prevColumn = columns[point.columnIndex - 1]; const isColumnAfterExpandColumn = "expand" === (null === prevColumn || void 0 === prevColumn ? void 0 : prevColumn.command); const isFirstExpandColumn = "expand" === (null === targetColumn || void 0 === targetColumn ? void 0 : targetColumn.command) && "expand" !== (null === prevColumn || void 0 === prevColumn ? void 0 : prevColumn.command); const sourceColumnReorderingDisabled = sourceColumn && !sourceColumn.allowReordering; const otherColumnsReorderingDisabled = !(null !== targetColumn && void 0 !== targetColumn && targetColumn.allowReordering) && !(null !== prevColumn && void 0 !== prevColumn && prevColumn.allowReordering); switch (location) { case "columnChooser": return true; case "headers": if (sourceColumnReorderingDisabled) { return true } if (!isFirstExpandColumn) { return isColumnAfterExpandColumn || otherColumnsReorderingDisabled } if (this.isCustomGroupColumnPosition) { return false } while ("expand" === (null === (_columns$point$column = columns[point.columnIndex]) || void 0 === _columns$point$column ? void 0 : _columns$point$column.command)) { var _columns$point$column; point.columnIndex += 1 } return false; default: return 0 === columns.length } } _subscribeToEvents(draggingHeader, draggingPanels) { const that = this; (0, _iterator.each)(draggingPanels, ((_, draggingPanel) => { if (draggingPanel) { let columns; const rowCount = draggingPanel.getRowCount ? draggingPanel.getRowCount() : 1; const nameDraggingPanel = draggingPanel.getName(); const subscribeToEvents = function(index, columnElement) { if (!columnElement) { return } const $columnElement = (0, _renderer.default)(columnElement); const column = columns[index]; if (column && draggingPanel.allowDragging(column)) { $columnElement.addClass(that.addWidgetPrefix("drag-action")); _events_engine.default.on($columnElement, (0, _index.addNamespace)(_drag.start, MODULE_NAMESPACE), that.createAction((args => { const e = args.event; const eventData = (0, _index.eventData)(e); draggingHeader.dragHeader({ deltaX: eventData.x - (0, _renderer.default)(e.currentTarget).offset().left, deltaY: eventData.y - (0, _renderer.default)(e.currentTarget).offset().top, sourceColumn: column, index: column.index, columnIndex: index, columnElement: $columnElement, sourceLocation: nameDraggingPanel, draggingPanels: draggingPanels, rowIndex: that._columnsController.getRowIndex(column.index, true) }) }))); _events_engine.default.on($columnElement, (0, _index.addNamespace)(_drag.move, MODULE_NAMESPACE), { that: draggingHeader }, that.createAction(draggingHeader.moveHeader)); _events_engine.default.on($columnElement, (0, _index.addNamespace)(_drag.end, MODULE_NAMESPACE), { that: draggingHeader }, that.createAction(draggingHeader.dropHeader)) } }; for (let i = 0; i < rowCount; i++) { const columnElements = draggingPanel.getColumnElements(i) || []; if (columnElements.length) { columns = draggingPanel.getColumns(i) || []; (0, _iterator.each)(columnElements, subscribeToEvents) } } } })) } _unsubscribeFromEvents(draggingHeader, draggingPanels) { const that = this; (0, _iterator.each)(draggingPanels, ((_, draggingPanel) => { if (draggingPanel) { const columnElements = draggingPanel.getColumnElements() || []; (0, _iterator.each)(columnElements, ((index, columnElement) => { const $columnElement = (0, _renderer.default)(columnElement); _events_engine.default.off($columnElement, (0, _index.addNamespace)(_drag.start, MODULE_NAMESPACE)); _events_engine.default.off($columnElement, (0, _index.addNamespace)(_drag.move, MODULE_NAMESPACE)); _events_engine.default.off($columnElement, (0, _index.addNamespace)(_drag.end, MODULE_NAMESPACE)); $columnElement.removeClass(that.addWidgetPrefix("drag-action")) })) } })) } _getSeparator(targetLocation) { return "headers" === targetLocation ? this._columnsSeparatorView : this._blockSeparatorView } hideSeparators(type) { const blockSeparator = this._blockSeparatorView; const columnsSeparator = this._columnsSeparatorView; this._animationColumnIndex = void 0; blockSeparator && blockSeparator.hide(); "block" !== type && columnsSeparator && columnsSeparator.hide() } allowDrop(parameters) { return this._columnsController.allowMoveColumn(parameters.sourceColumnIndex, parameters.targetColumnIndex, parameters.sourceLocation, parameters.targetLocation) } drag(parameters) { const { sourceIndex: sourceIndex } = parameters; const { sourceLocation: sourceLocation } = parameters; const { sourceColumnElement: sourceColumnElement } = parameters; const headersView = this._columnHeadersView; const rowsView = this._rowsView; if (sourceColumnElement) { sourceColumnElement.css({ opacity: .5 }); if ("headers" === sourceLocation) { headersView && headersView.setRowsOpacity(sourceIndex, .5); rowsView && rowsView.setRowsOpacity(sourceIndex, .5) } } } dock(parameters) { const that = this; const targetColumnIndex = (0, _type.isObject)(parameters.targetColumnIndex) ? parameters.targetColumnIndex.columnIndex : parameters.targetColumnIndex; const { sourceLocation: sourceLocation } = parameters; const { targetLocation: targetLocation } = parameters; const separator = that._getSeparator(targetLocation); const hasTargetVisibleIndex = targetColumnIndex >= 0; that._columnHeadersView.element().find(".dx-header-row").toggleClass(that.addWidgetPrefix("drop-highlight"), "headers" !== sourceLocation && "headers" === targetLocation && !hasTargetVisibleIndex); if (separator) { if (that.allowDrop(parameters) && hasTargetVisibleIndex) { if ("group" === targetLocation || "columnChooser" === targetLocation) { ! function() { if (that._animationColumnIndex !== targetColumnIndex) { that.hideSeparators(); separator.element()[parameters.isLast ? "insertAfter" : "insertBefore"](parameters.targetColumnElement); that._animationColumnIndex = targetColumnIndex; separator.show(targetLocation) } }() } else { that.hideSeparators("block"); that._tablePositionController.update(parameters.posY); separator.moveByX(parameters.posX - separator.width()); separator.show() } } else { that.hideSeparators() } } } drop(parameters) { const { sourceColumnElement: sourceColumnElement } = parameters; if (sourceColumnElement) { sourceColumnElement.css({ opacity: "" }); this._columnHeadersView.setRowsOpacity(parameters.sourceIndex, ""); this._rowsView.setRowsOpacity(parameters.sourceIndex, ""); this._columnHeadersView.element().find(".dx-header-row").removeClass(this.addWidgetPrefix("drop-highlight")) } if (this.allowDrop(parameters)) { const separator = this._getSeparator(parameters.targetLocation); if (separator) { separator.hide() } this._columnsController.moveColumn(parameters.sourceColumnIndex, parameters.targetColumnIndex, parameters.sourceLocation, parameters.targetLocation) } } } exports.DraggingHeaderViewController = DraggingHeaderViewController; exports.columnsResizingReorderingModule = { views: { columnsSeparatorView: ColumnsSeparatorView, blockSeparatorView: BlockSeparatorView, draggingHeaderView: DraggingHeaderView, trackerView: TrackerView }, controllers: { draggingHeader: DraggingHeaderViewController, tablePosition: TablePositionViewController, columnsResizer: ColumnsResizerViewController }, extenders: { views: { rowsView: Base => class extends Base { _needUpdateRowHeight(itemCount) { const wordWrapEnabled = this.option("wordWrapEnabled"); const isResizing = this._columnsResizerController.isResizing(); return super._needUpdateRowHeight.apply(this, arguments) || itemCount > 0 && !!wordWrapEnabled && !!isResizing } } }, controllers: { editorFactory: Base => class extends Base { renderFocusOverlay() { if (this._columnsResizerController.isResizing()) { return } return super.renderFocusOverlay.apply(this, arguments) } } } } } }, 69823: /*!*******************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/context_menu/m_context_menu.js ***! \*******************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.contextMenuModule = exports.ContextMenuView = exports.ContextMenuController = void 0; var _element = __webpack_require__( /*! ../../../../core/element */ 6415); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _context_menu = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/context_menu */ 10042)); var _m_modules = _interopRequireDefault(__webpack_require__( /*! ../m_modules */ 15943)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const viewName = { columnHeadersView: "header", rowsView: "content", footerView: "footer", headerPanel: "headerPanel" }; const VIEW_NAMES = ["columnHeadersView", "rowsView", "footerView", "headerPanel"]; class ContextMenuController extends _m_modules.default.ViewController { init() { this.createAction("onContextMenuPreparing") } getContextMenuItems(dxEvent) { if (!dxEvent) { return false } const that = this; const $targetElement = (0, _renderer.default)(dxEvent.target); let $element; let $targetRowElement; let $targetCellElement; let menuItems; (0, _iterator.each)(VIEW_NAMES, (function() { const view = that.getView(this); $element = view && view.element(); if ($element && ($element.is($targetElement) || $element.find($targetElement).length)) { var _rowOptions$cells; $targetCellElement = $targetElement.closest(".dx-row > td, .dx-row > tr"); $targetRowElement = $targetCellElement.parent(); const rowIndex = view.getRowIndex($targetRowElement); const columnIndex = $targetCellElement[0] && $targetCellElement[0].cellIndex; const rowOptions = $targetRowElement.data("options"); const options = { event: dxEvent, targetElement: (0, _element.getPublicElement)($targetElement), target: viewName[this], rowIndex: rowIndex, row: view._getRows()[rowIndex], columnIndex: columnIndex, column: null === rowOptions || void 0 === rowOptions || null === (_rowOptions$cells = rowOptions.cells) || void 0 === _rowOptions$cells || null === (_rowOptions$cells = _rowOptions$cells[columnIndex]) || void 0 === _rowOptions$cells ? void 0 : _rowOptions$cells.column }; options.items = view.getContextMenuItems && view.getContextMenuItems(options); that.executeAction("onContextMenuPreparing", options); that._contextMenuPrepared(options); menuItems = options.items; if (menuItems) { return false } } return })); return menuItems } _contextMenuPrepared(options) {} } exports.ContextMenuController = ContextMenuController; class ContextMenuView extends _m_modules.default.View { init() { super.init(); this._contextMenuController = this.getController("contextMenu") } _renderCore() { const $element = this.element().addClass("dx-context-menu"); this.setAria("role", "presentation", $element); this._createComponent($element, _context_menu.default, { onPositioning: actionArgs => { const { event: event } = actionArgs; const contextMenuInstance = actionArgs.component; const items = this._contextMenuController.getContextMenuItems(event); if (items) { contextMenuInstance.option("items", items); event.stopPropagation() } else { actionArgs.cancel = true } }, onItemClick(params) { var _params$itemData, _params$itemData$onIt; null === (_params$itemData = params.itemData) || void 0 === _params$itemData || null === (_params$itemData$onIt = _params$itemData.onItemClick) || void 0 === _params$itemData$onIt || _params$itemData$onIt.call(_params$itemData, params) }, cssClass: this.getWidgetContainerClass(), target: this.component.$element() }) } } exports.ContextMenuView = ContextMenuView; exports.contextMenuModule = { defaultOptions: () => ({ onContextMenuPreparing: null }), controllers: { contextMenu: ContextMenuController }, views: { contextMenuView: ContextMenuView } } }, 72119: /*!*************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/data_controller/m_data_controller.js ***! \*************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.dataControllerModule = exports.DataController = void 0; var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _array_compare = __webpack_require__( /*! ../../../../core/utils/array_compare */ 34671); var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _array_store = _interopRequireDefault(__webpack_require__( /*! ../../../../data/array_store */ 26562)); var _custom_store = _interopRequireDefault(__webpack_require__( /*! ../../../../data/custom_store */ 88036)); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/widget/ui.errors */ 96688)); var _m_modules = _interopRequireDefault(__webpack_require__( /*! ../m_modules */ 15943)); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../m_utils */ 60082)); var _m_data_helper_mixin = __webpack_require__( /*! ./m_data_helper_mixin */ 8279); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const changePaging = function(that, optionName, value) { const dataSource = that._dataSource; if (dataSource) { if (void 0 !== value) { const oldValue = that._getPagingOptionValue(optionName); if (oldValue !== value) { if ("pageSize" === optionName) { dataSource.pageIndex(0) } dataSource[optionName](value); that._skipProcessingPagingChange = true; that.option(`paging.${optionName}`, value); that._skipProcessingPagingChange = false; const pageIndex = dataSource.pageIndex(); that._isPaging = "pageIndex" === optionName; return dataSource["pageIndex" === optionName ? "load" : "reload"]().done((() => { that._isPaging = false; that.pageChanged.fire(pageIndex) })) } return (0, _deferred.Deferred)().resolve().promise() } return dataSource[optionName]() } return 0 }; class DataController extends((0, _m_data_helper_mixin.DataHelperMixin)(_m_modules.default.Controller)) { init() { this._items = []; this._cachedProcessedItems = null; this._columnsController = this.getController("columns"); this._adaptiveColumnsController = this.getController("adaptiveColumns"); this._editingController = this.getController("editing"); this._editorFactoryController = this.getController("editorFactory"); this._errorHandlingController = this.getController("errorHandling"); this._filterSyncController = this.getController("filterSync"); this._applyFilterController = this.getController("applyFilter"); this._keyboardNavigationController = this.getController("keyboardNavigation"); this._focusController = this.getController("focus"); this._headerFilterController = this.getController("headerFilter"); this._selectionController = this.getController("selection"); this._stateStoringController = this.getController("stateStoring"); this._validatingController = this.getController("validating"); this._isPaging = false; this._currentOperationTypes = null; this._dataChangedHandler = e => { this._currentOperationTypes = this._dataSource.operationTypes(); this._handleDataChanged(e); this._currentOperationTypes = null }; this._columnsChangedHandler = this._handleColumnsChanged.bind(this); this._loadingChangedHandler = this._handleLoadingChanged.bind(this); this._loadErrorHandler = this._handleLoadError.bind(this); this._customizeStoreLoadOptionsHandler = this._handleCustomizeStoreLoadOptions.bind(this); this._changingHandler = this._handleChanging.bind(this); this._dataPushedHandler = this._handleDataPushed.bind(this); this._columnsController.columnsChanged.add(this._columnsChangedHandler); this._isLoading = false; this._isCustomLoading = false; this._repaintChangesOnly = void 0; this._changes = []; this.createAction("onDataErrorOccurred"); this.dataErrorOccurred.add((error => this.executeAction("onDataErrorOccurred", { error: error }))); this._refreshDataSource(); this.postCtor() } _getPagingOptionValue(optionName) { return this._dataSource[optionName]() } callbackNames() { return ["changed", "loadingChanged", "dataErrorOccurred", "pageChanged", "dataSourceChanged", "pushed"] } callbackFlags(name) { if ("dataErrorOccurred" === name) { return { stopOnFalse: true } } return } publicMethods() { return ["_disposeDataSource", "beginCustomLoading", "byKey", "clearFilter", "endCustomLoading", "filter", "getCombinedFilter", "getDataByKeys", "getDataSource", "getKeyByRowIndex", "getRowIndexByKey", "getVisibleRows", "keyOf", "pageCount", "pageIndex", "pageSize", "refresh", "repaintRows", "totalCount"] } reset() { this._columnsController.reset(); this._items = []; this._refreshDataSource() } _handleDataSourceChange(args) { if (args.value === args.previousValue || this.option("columns") && Array.isArray(args.value) && Array.isArray(args.previousValue)) { const isValueChanged = args.value !== args.previousValue; if (isValueChanged) { const store = this.store(); if (store) { store._array = args.value } } if (this.needToRefreshOnDataSourceChange(args)) { this.refresh(this.option("repaintChangesOnly")) } return true } return false } needToRefreshOnDataSourceChange(args) { return true } optionChanged(args) { const that = this; let dataSource; let changedPagingOptions; function handled() { args.handled = true } if ("dataSource" === args.name && args.name === args.fullName && this._handleDataSourceChange(args)) { handled(); return } switch (args.name) { case "cacheEnabled": case "repaintChangesOnly": case "highlightChanges": case "loadingTimeout": handled(); break; case "remoteOperations": case "keyExpr": case "dataSource": case "scrolling": handled(); that.reset(); break; case "paging": dataSource = that.dataSource(); if (dataSource) { changedPagingOptions = that._setPagingOptions(dataSource); if (changedPagingOptions) { const pageIndex = dataSource.pageIndex(); this._isPaging = changedPagingOptions.isPageIndexChanged; dataSource.load().done((() => { this._isPaging = false; that.pageChanged.fire(pageIndex) })) } } handled(); break; case "rtlEnabled": that.reset(); break; case "columns": dataSource = that.dataSource(); if (dataSource && dataSource.isLoading() && args.name === args.fullName) { this._useSortingGroupingFromColumns = true; dataSource.load() } break; default: super.optionChanged(args) } } isReady() { return !this._isLoading } getDataSource() { return this._dataSource && this._dataSource._dataSource } getCombinedFilter(returnDataField) { return this.combinedFilter(void 0, returnDataField) } combinedFilter(filter, returnDataField) { if (!this._dataSource) { return filter } let combined = filter ?? this._dataSource.filter(); const isColumnsTypesDefined = this._columnsController.isDataSourceApplied() || this._columnsController.isAllDataTypesDefined(); if (isColumnsTypesDefined) { const additionalFilter = this._calculateAdditionalFilter(); combined = additionalFilter ? _m_utils.default.combineFilters([additionalFilter, combined]) : combined } const isRemoteFiltering = this._dataSource.remoteOperations().filtering || returnDataField; combined = this._columnsController.updateFilter(combined, isRemoteFiltering); return combined } waitReady() { if (this._updateLockCount) { this._readyDeferred = new _deferred.Deferred; return this._readyDeferred } return (0, _deferred.when)() } _endUpdateCore() { const changes = this._changes; if (changes.length) { this._changes = []; const repaintChangesOnly = changes.every((change => change.repaintChangesOnly)); this.updateItems(1 === changes.length ? changes[0] : { repaintChangesOnly: repaintChangesOnly }) } if (this._readyDeferred) { this._readyDeferred.resolve(); this._readyDeferred = null } } _handleCustomizeStoreLoadOptions(e) { var _storeLoadOptions$fil; const columnsController = this._columnsController; const dataSource = this._dataSource; const { storeLoadOptions: storeLoadOptions } = e; if (e.isCustomLoading && !storeLoadOptions.isLoadingAll) { return } storeLoadOptions.filter = this.combinedFilter(storeLoadOptions.filter); if (1 === (null === (_storeLoadOptions$fil = storeLoadOptions.filter) || void 0 === _storeLoadOptions$fil ? void 0 : _storeLoadOptions$fil.length) && "!" === storeLoadOptions.filter[0]) { e.data = []; e.extra = e.extra || {}; e.extra.totalCount = 0 } if (!columnsController.isDataSourceApplied()) { columnsController.updateColumnDataTypes(dataSource) } this._columnsUpdating = true; columnsController.updateSortingGrouping(dataSource, !this._useSortingGroupingFromColumns); this._columnsUpdating = false; storeLoadOptions.sort = columnsController.getSortDataSourceParameters(); storeLoadOptions.group = columnsController.getGroupDataSourceParameters(); dataSource.sort(storeLoadOptions.sort); dataSource.group(storeLoadOptions.group); storeLoadOptions.sort = columnsController.getSortDataSourceParameters(!dataSource.remoteOperations().sorting); e.group = columnsController.getGroupDataSourceParameters(!dataSource.remoteOperations().grouping) } _handleColumnsChanged(e) { const that = this; const { changeTypes: changeTypes } = e; const { optionNames: optionNames } = e; let filterValue; let filterValues; let filterApplied; const updateItemsHandler = function(change) { var _change$changeTypes; that._columnsController.columnsChanged.remove(updateItemsHandler); that.updateItems({ repaintChangesOnly: false, virtualColumnsScrolling: null === change || void 0 === change || null === (_change$changeTypes = change.changeTypes) || void 0 === _change$changeTypes ? void 0 : _change$changeTypes.virtualColumnsScrolling }) }; if (changeTypes.sorting || changeTypes.grouping) { if (that._dataSource && !that._columnsUpdating) { that._dataSource.group(that._columnsController.getGroupDataSourceParameters()); that._dataSource.sort(that._columnsController.getSortDataSourceParameters()); that.reload() } } else if (changeTypes.columns) { filterValues = that._columnsController.columnOption(e.columnIndex, "filterValues"); if (optionNames.filterValues || optionNames.filterType && Array.isArray(filterValues) || optionNames.filterValue || optionNames.selectedFilterOperation || optionNames.allowFiltering) { filterValue = that._columnsController.columnOption(e.columnIndex, "filterValue"); if (Array.isArray(filterValues) || void 0 === e.columnIndex || (0, _type.isDefined)(filterValue) || !optionNames.selectedFilterOperation || optionNames.filterValue) { that._applyFilter(); filterApplied = true } } if (!that._needApplyFilter && !_m_utils.default.checkChanges(optionNames, ["width", "visibleWidth", "filterValue", "bufferedFilterValue", "selectedFilterOperation", "filterValues", "filterType"])) { that._columnsController.columnsChanged.add(updateItemsHandler) } if ((0, _type.isDefined)(optionNames.visible)) { const column = that._columnsController.columnOption(e.columnIndex); if (column && ((0, _type.isDefined)(column.filterValue) || (0, _type.isDefined)(column.filterValues))) { that._applyFilter(); filterApplied = true } } } if (!filterApplied && changeTypes.filtering && !this._needApplyFilter) { that.reload() } } _handleDataChanged(e) { const that = this; const dataSource = that._dataSource; const columnsController = that._columnsController; let isAsyncDataSourceApplying = false; this._useSortingGroupingFromColumns = false; if (dataSource && !that._isDataSourceApplying) { that._isDataSourceApplying = true; (0, _deferred.when)(that._columnsController.applyDataSource(dataSource)).done((() => { if (that._isLoading) { that._handleLoadingChanged(false) } if (isAsyncDataSourceApplying && e && e.isDelayed) { e.isDelayed = false } that._isDataSourceApplying = false; const needApplyFilter = that._needApplyFilter; that._needApplyFilter = false; if (needApplyFilter && !that._isAllDataTypesDefined && (() => { const additionalFilter = that._calculateAdditionalFilter(); return additionalFilter && additionalFilter.length })()) { _ui.default.log("W1005", that.component.NAME); that._applyFilter() } else { that.updateItems(e, true) } })).fail((() => { that._isDataSourceApplying = false })); if (that._isDataSourceApplying) { isAsyncDataSourceApplying = true; that._handleLoadingChanged(true) } that._needApplyFilter = !that._columnsController.isDataSourceApplied(); that._isAllDataTypesDefined = columnsController.isAllDataTypesDefined() } } _handleLoadingChanged(isLoading) { this._isLoading = isLoading; this._fireLoadingChanged() } _handleLoadError(e) { this.dataErrorOccurred.fire(e) } _handleDataPushed(changes) { this.pushed.fire(changes) } fireError() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key] } this.dataErrorOccurred.fire(_ui.default.Error.apply(_ui.default, args)) } _setPagingOptions(dataSource) { const pageIndex = this.option("paging.pageIndex"); const pageSize = this.option("paging.pageSize"); const pagingEnabled = this.option("paging.enabled"); const scrollingMode = this.option("scrolling.mode"); const appendMode = "infinite" === scrollingMode; const virtualMode = "virtual" === scrollingMode; const paginate = pagingEnabled || virtualMode || appendMode; let isPaginateChanged = false; let isPageSizeChanged = false; let isPageIndexChanged = false; dataSource.requireTotalCount(!appendMode); if (void 0 !== pagingEnabled && dataSource.paginate() !== paginate) { dataSource.paginate(paginate); isPaginateChanged = true } if (void 0 !== pageSize && dataSource.pageSize() !== pageSize) { dataSource.pageSize(pageSize); isPageSizeChanged = true } if (void 0 !== pageIndex && dataSource.pageIndex() !== pageIndex) { dataSource.pageIndex(pageIndex); isPageIndexChanged = true } if (isPaginateChanged || isPageSizeChanged || isPageIndexChanged) { return { isPaginateChanged: isPaginateChanged, isPageSizeChanged: isPageSizeChanged, isPageIndexChanged: isPageIndexChanged } } return false } _getSpecificDataSourceOption() { const dataSource = this.option("dataSource"); if (Array.isArray(dataSource)) { return { store: { type: "array", data: dataSource, key: this.option("keyExpr") } } } return dataSource } _initDataSource() { const that = this; const oldDataSource = this._dataSource; super._initDataSource(); const dataSource = that._dataSource; that._useSortingGroupingFromColumns = true; that._cachedProcessedItems = null; if (dataSource) { const changedPagingOptions = that._setPagingOptions(dataSource); this._isPaging = null === changedPagingOptions || void 0 === changedPagingOptions ? void 0 : changedPagingOptions.isPageIndexChanged; that.setDataSource(dataSource) } else if (oldDataSource) { that.updateItems() } } _loadDataSource() { const that = this; const dataSource = that._dataSource; const result = new _deferred.Deferred; (0, _deferred.when)(this._columnsController.refresh(true)).always((() => { if (dataSource) { dataSource.load().done((function() { that._isPaging = false; result.resolve.apply(result, arguments) })).fail(result.reject) } else { result.resolve() } })); return result.promise() } _beforeProcessItems(items) { return items.slice(0) } getRowIndexDelta() { return 0 } getDataIndex(change) { const visibleItems = this._items; const lastVisibleItem = "append" === change.changeType && visibleItems.length > 0 ? visibleItems[visibleItems.length - 1] : null; return (0, _type.isDefined)(null === lastVisibleItem || void 0 === lastVisibleItem ? void 0 : lastVisibleItem.dataIndex) ? lastVisibleItem.dataIndex + 1 : 0 } _processItems(items, change) { const that = this; const rowIndexDelta = that.getRowIndexDelta(); const { changeType: changeType } = change; const visibleColumns = that._columnsController.getVisibleColumns(null, "loadingAll" === changeType); const dataIndex = this.getDataIndex(change); const options = { visibleColumns: visibleColumns, dataIndex: dataIndex }; const result = []; (0, _iterator.each)(items, ((index, item) => { if ((0, _type.isDefined)(item)) { options.rowIndex = index - rowIndexDelta; item = that._processItem(item, options); result.push(item) } })); return result } _processItem(item, options) { item = this._generateDataItem(item, options); item = this._processDataItem(item, options); item.dataIndex = options.dataIndex++; return item } _generateDataItem(data, options) { return { rowType: "data", data: data, key: this.keyOf(data) } } _processDataItem(dataItem, options) { dataItem.values = this.generateDataValues(dataItem.data, options.visibleColumns); return dataItem } generateDataValues(data, columns, isModified) { const values = []; let value; for (let i = 0; i < columns.length; i++) { const column = columns[i]; value = isModified ? void 0 : null; if (!column.command) { if (column.calculateCellValue) { value = column.calculateCellValue(data) } else if (column.dataField) { value = data[column.dataField] } } values.push(value) } return values } _applyChange(change) { const that = this; if ("update" === change.changeType) { that._applyChangeUpdate(change) } else if (that.items().length && change.repaintChangesOnly && "refresh" === change.changeType) { that._applyChangesOnly(change) } else if ("refresh" === change.changeType) { that._applyChangeFull(change) } } _applyChangeFull(change) { this._items = change.items.slice(0) } _getRowIndices(change) { const rowIndices = change.rowIndices.slice(0); const rowIndexDelta = this.getRowIndexDelta(); rowIndices.sort(((a, b) => a - b)); for (let i = 0; i < rowIndices.length; i++) { let correctedRowIndex = rowIndices[i]; if (change.allowInvisibleRowIndices) { correctedRowIndex += rowIndexDelta } if (correctedRowIndex < 0) { rowIndices.splice(i, 1); i-- } } return rowIndices } _applyChangeUpdate(change) { const that = this; const { items: items } = change; const rowIndices = that._getRowIndices(change); const rowIndexDelta = that.getRowIndexDelta(); const repaintChangesOnly = that.option("repaintChangesOnly"); let prevIndex = -1; let rowIndexCorrection = 0; let changeType; change.items = []; change.rowIndices = []; change.columnIndices = []; change.changeTypes = []; const equalItems = function(item1, item2, strict) { let result = item1 && item2 && (0, _common.equalByValue)(item1.key, item2.key); if (result && strict) { result = item1.rowType === item2.rowType && ("detail" !== item2.rowType || item1.isEditing === item2.isEditing) } return result }; (0, _iterator.each)(rowIndices, ((index, rowIndex) => { let columnIndices; rowIndex += rowIndexCorrection + rowIndexDelta; if (prevIndex === rowIndex) { return } prevIndex = rowIndex; const oldItem = that._items[rowIndex]; const oldNextItem = that._items[rowIndex + 1]; const newItem = items[rowIndex]; const newNextItem = items[rowIndex + 1]; const strict = equalItems(oldItem, oldNextItem) || equalItems(newItem, newNextItem); if (newItem) { newItem.rowIndex = rowIndex; change.items.push(newItem) } if (oldItem && newItem && equalItems(oldItem, newItem, strict)) { changeType = "update"; that._items[rowIndex] = newItem; if (oldItem.visible !== newItem.visible) { change.items.splice(-1, 1, { visible: newItem.visible }) } else if (repaintChangesOnly && !change.isFullUpdate) { columnIndices = that._partialUpdateRow(oldItem, newItem, rowIndex - rowIndexDelta) } } else if (newItem && !oldItem || newNextItem && equalItems(oldItem, newNextItem, strict)) { changeType = "insert"; that._items.splice(rowIndex, 0, newItem); rowIndexCorrection++ } else if (oldItem && !newItem || oldNextItem && equalItems(newItem, oldNextItem, strict)) { changeType = "remove"; that._items.splice(rowIndex, 1); rowIndexCorrection--; prevIndex = -1 } else if (newItem) { changeType = "update"; that._items[rowIndex] = newItem } else { return } change.rowIndices.push(rowIndex - rowIndexDelta); change.changeTypes.push(changeType); change.columnIndices.push(columnIndices) })) } _isCellChanged(oldRow, newRow, visibleRowIndex, columnIndex, isLiveUpdate) { if (JSON.stringify(oldRow.values[columnIndex]) !== JSON.stringify(newRow.values[columnIndex])) { return true } function isCellModified(row, columnIndex) { return row.modifiedValues ? void 0 !== row.modifiedValues[columnIndex] : false } if (isCellModified(oldRow, columnIndex) !== isCellModified(newRow, columnIndex)) { return true } return false } _getChangedColumnIndices(oldItem, newItem, visibleRowIndex, isLiveUpdate) { let columnIndices; if (oldItem.rowType === newItem.rowType) { if ("group" !== newItem.rowType && "groupFooter" !== newItem.rowType) { columnIndices = []; if ("detail" !== newItem.rowType) { for (let columnIndex = 0; columnIndex < oldItem.values.length; columnIndex++) { if (this._isCellChanged(oldItem, newItem, visibleRowIndex, columnIndex, isLiveUpdate)) { columnIndices.push(columnIndex) } } } } if ("group" === newItem.rowType && oldItem.cells) { const isRowStateEquals = newItem.isExpanded === oldItem.isExpanded && newItem.data.isContinuation === oldItem.data.isContinuation && newItem.data.isContinuationOnNextPage === oldItem.data.isContinuationOnNextPage; if (isRowStateEquals) { columnIndices = oldItem.cells.map(((cell, index) => { var _cell$column; return "groupExpand" !== (null === (_cell$column = cell.column) || void 0 === _cell$column ? void 0 : _cell$column.type) ? index : -1 })).filter((index => index >= 0)) } } } return columnIndices } _partialUpdateRow(oldItem, newItem, visibleRowIndex, isLiveUpdate) { var _changedColumnIndices; let changedColumnIndices = this._getChangedColumnIndices(oldItem, newItem, visibleRowIndex, isLiveUpdate); if (null !== (_changedColumnIndices = changedColumnIndices) && void 0 !== _changedColumnIndices && _changedColumnIndices.length && this.option("dataRowTemplate")) { changedColumnIndices = void 0 } if (changedColumnIndices) { oldItem.cells && oldItem.cells.forEach(((cell, columnIndex) => { const isCellChanged = changedColumnIndices.indexOf(columnIndex) >= 0; if (!isCellChanged && cell && cell.update) { cell.update(newItem) } })); newItem.update = oldItem.update; newItem.watch = oldItem.watch; newItem.cells = oldItem.cells; if (isLiveUpdate) { newItem.oldValues = oldItem.values } oldItem.update && oldItem.update(newItem) } return changedColumnIndices } _isItemEquals(item1, item2) { if (JSON.stringify(item1.values) !== JSON.stringify(item2.values)) { return false } if (["modified", "isNewRow", "removed", "isEditing"].some((field => item1[field] !== item2[field]))) { return false } if ("group" === item1.rowType || "groupFooter" === item1.rowType) { var _item1$data, _item2$data, _item1$data2, _item2$data2; const expandedMatch = item1.isExpanded === item2.isExpanded; const summaryCellsMatch = JSON.stringify(item1.summaryCells) === JSON.stringify(item2.summaryCells); const continuationMatch = (null === (_item1$data = item1.data) || void 0 === _item1$data ? void 0 : _item1$data.isContinuation) === (null === (_item2$data = item2.data) || void 0 === _item2$data ? void 0 : _item2$data.isContinuation) && (null === (_item1$data2 = item1.data) || void 0 === _item1$data2 ? void 0 : _item1$data2.isContinuationOnNextPage) === (null === (_item2$data2 = item2.data) || void 0 === _item2$data2 ? void 0 : _item2$data2.isContinuationOnNextPage); if (!expandedMatch || !summaryCellsMatch || !continuationMatch) { return false } } return true } _applyChangesOnly(change) { const rowIndices = []; const columnIndices = []; const changeTypes = []; const items = []; const newIndexByKey = {}; const isLiveUpdate = (null === change || void 0 === change ? void 0 : change.isLiveUpdate) ?? true; function getRowKey(row) { if (row) { return `${row.rowType},${JSON.stringify(row.key)}` } return } const currentItems = this._items; const oldItems = currentItems.slice(); change.items.forEach(((item, index) => { const key = getRowKey(item); newIndexByKey[key] = index; item.rowIndex = index })); const result = (0, _array_compare.findChanges)(oldItems, change.items, getRowKey, ((item1, item2) => { if (!this._isItemEquals(item1, item2)) { return false } if (item1.cells) { item1.update && item1.update(item2); item1.cells.forEach((cell => { if (cell && cell.update) { cell.update(item2, true) } })) } return true })); if (!result) { this._applyChangeFull(change); return } result.forEach((change => { switch (change.type) { case "update": { const { index: index } = change; const newItem = change.data; const { oldItem: oldItem } = change; const changedColumnIndices = this._partialUpdateRow(oldItem, newItem, index, isLiveUpdate); rowIndices.push(index); changeTypes.push("update"); items.push(newItem); currentItems[index] = newItem; columnIndices.push(changedColumnIndices); break } case "insert": rowIndices.push(change.index); changeTypes.push("insert"); items.push(change.data); columnIndices.push(void 0); currentItems.splice(change.index, 0, change.data); break; case "remove": rowIndices.push(change.index); changeTypes.push("remove"); currentItems.splice(change.index, 1); items.push(change.oldItem); columnIndices.push(void 0) } })); change.repaintChangesOnly = true; change.changeType = "update"; change.rowIndices = rowIndices; change.columnIndices = columnIndices; change.changeTypes = changeTypes; change.items = items; if (oldItems.length) { change.isLiveUpdate = true } this._correctRowIndices((rowIndex => { const oldRowIndexOffset = this._rowIndexOffset || 0; const rowIndexOffset = this.getRowIndexOffset(); const oldItem = oldItems[rowIndex - oldRowIndexOffset]; const key = getRowKey(oldItem); const newVisibleRowIndex = newIndexByKey[key]; return newVisibleRowIndex >= 0 ? newVisibleRowIndex + rowIndexOffset - rowIndex : 0 })) } _correctRowIndices(rowIndex) {} _afterProcessItems(items, change) { return items } _updateItemsCore(change) { let items; const dataSource = this._dataSource; const changeType = change.changeType || "refresh"; change.changeType = changeType; if (dataSource) { const cachedProcessedItems = this._cachedProcessedItems; if (change.useProcessedItemsCache && cachedProcessedItems) { items = cachedProcessedItems } else { items = change.items || dataSource.items(); items = this._beforeProcessItems(items); items = this._processItems(items, change); this._cachedProcessedItems = items } items = this._afterProcessItems(items, change); change.items = items; const oldItems = this._items.length === items.length && this._items; this._applyChange(change); const rowIndexDelta = this.getRowIndexDelta(); (0, _iterator.each)(this._items, ((index, item) => { item.rowIndex = index - rowIndexDelta; if (oldItems) { item.cells = oldItems[index].cells ?? [] } const newItem = items[index]; if (newItem) { item.loadIndex = newItem.loadIndex } })); this._rowIndexOffset = this.getRowIndexOffset() } else { this._items = [] } } _handleChanging(e) { const rows = this.getVisibleRows(); const dataSource = this.dataSource(); if (dataSource) { e.changes.forEach((change => { if ("insert" === change.type && change.index >= 0) { let dataIndex = 0; for (let i = 0; i < change.index; i++) { const row = rows[i]; if (row && ("data" === row.rowType || "group" === row.rowType)) { dataIndex++ } } change.index = dataIndex } })) } } updateItems(change, isDataChanged) { change = change || {}; const that = this; if (void 0 !== that._repaintChangesOnly) { change.repaintChangesOnly = change.repaintChangesOnly ?? that._repaintChangesOnly; change.needUpdateDimensions = change.needUpdateDimensions || that._needUpdateDimensions } else if (change.changes) { change.repaintChangesOnly = that.option("repaintChangesOnly") } else if (isDataChanged) { const operationTypes = that.dataSource().operationTypes(); change.repaintChangesOnly = operationTypes && !operationTypes.grouping && !operationTypes.filtering && that.option("repaintChangesOnly"); change.isDataChanged = true; if (operationTypes && (operationTypes.reload || operationTypes.paging || operationTypes.groupExpanding)) { change.needUpdateDimensions = true } } if (that._updateLockCount && !change.cancel) { that._changes.push(change); return } that._updateItemsCore(change); if (change.cancel) { return } that._fireChanged(change) } loadingOperationTypes() { const dataSource = this.dataSource(); return dataSource && dataSource.loadingOperationTypes() || {} } _fireChanged(change) { if (this._currentOperationTypes) { change.operationTypes = this._currentOperationTypes; this._currentOperationTypes = null }(0, _common.deferRender)((() => { this.changed.fire(change) })) } isLoading() { return this._isLoading || this._isCustomLoading } _fireLoadingChanged() { this.loadingChanged.fire(this.isLoading(), this._loadingText) } _calculateAdditionalFilter() { return null } _applyFilter() { const dataSource = this._dataSource; if (dataSource) { dataSource.pageIndex(0); this._isFilterApplying = true; return this.reload().done((() => { if (this._isFilterApplying) { this.pageChanged.fire() } })) } return (new _deferred.Deferred).resolve() } resetFilterApplying() { this._isFilterApplying = false } filter(filterExpr) { const dataSource = this._dataSource; const filter = dataSource && dataSource.filter(); if (0 === arguments.length) { return filter } filterExpr = arguments.length > 1 ? Array.prototype.slice.call(arguments, 0) : filterExpr; if (_m_utils.default.equalFilterParameters(filter, filterExpr)) { return } if (dataSource) { dataSource.filter(filterExpr) } this._applyFilter() } clearFilter(filterName) { const that = this; const columnsController = that._columnsController; const clearColumnOption = function(optionName) { const columnCount = columnsController.columnCount(); for (let index = 0; index < columnCount; index++) { columnsController.columnOption(index, optionName, void 0) } }; that.component.beginUpdate(); if (arguments.length > 0) { switch (filterName) { case "dataSource": that.filter(null); break; case "search": that.searchByText(""); break; case "header": clearColumnOption("filterValues"); break; case "row": clearColumnOption("filterValue") } } else { that.filter(null); that.searchByText(""); clearColumnOption("filterValue"); clearColumnOption("bufferedFilterValue"); clearColumnOption("filterValues") } that.component.endUpdate() } _fireDataSourceChanged() { const that = this; const changedHandler = function() { that.changed.remove(changedHandler); that.dataSourceChanged.fire() }; that.changed.add(changedHandler) } _getDataSourceAdapter() {} _createDataSourceAdapterCore(dataSource, remoteOperations) { const dataSourceAdapterProvider = this._getDataSourceAdapter(); const dataSourceAdapter = dataSourceAdapterProvider.create(this.component); dataSourceAdapter.init(dataSource, remoteOperations); return dataSourceAdapter } isLocalStore() { let store = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.store(); return store instanceof _array_store.default } isCustomStore(store) { store = store || this.store(); return store instanceof _custom_store.default } _createDataSourceAdapter(dataSource) { let remoteOperations = this.option("remoteOperations"); const store = dataSource.store(); const enabledRemoteOperations = { filtering: true, sorting: true, paging: true, grouping: true, summary: true }; if ((0, _type.isObject)(remoteOperations) && remoteOperations.groupPaging) { remoteOperations = (0, _extend.extend)({}, enabledRemoteOperations, remoteOperations) } if ("auto" === remoteOperations) { remoteOperations = this.isLocalStore(store) || this.isCustomStore(store) ? {} : { filtering: true, sorting: true, paging: true } } if (true === remoteOperations) { remoteOperations = enabledRemoteOperations } return this._createDataSourceAdapterCore(dataSource, remoteOperations) } setDataSource(dataSource) { const that = this; const oldDataSource = that._dataSource; if (!dataSource && oldDataSource) { oldDataSource.cancelAll(); oldDataSource.changed.remove(that._dataChangedHandler); oldDataSource.loadingChanged.remove(that._loadingChangedHandler); oldDataSource.loadError.remove(that._loadErrorHandler); oldDataSource.customizeStoreLoadOptions.remove(that._customizeStoreLoadOptionsHandler); oldDataSource.changing.remove(that._changingHandler); oldDataSource.pushed.remove(that._dataPushedHandler); oldDataSource.dispose(that._isSharedDataSource) } if (dataSource) { dataSource = that._createDataSourceAdapter(dataSource) } that._dataSource = dataSource; if (dataSource) { that._fireDataSourceChanged(); that._isLoading = !dataSource.isLoaded(); that._needApplyFilter = true; that._isAllDataTypesDefined = that._columnsController.isAllDataTypesDefined(); dataSource.changed.add(that._dataChangedHandler); dataSource.loadingChanged.add(that._loadingChangedHandler); dataSource.loadError.add(that._loadErrorHandler); dataSource.customizeStoreLoadOptions.add(that._customizeStoreLoadOptionsHandler); dataSource.changing.add(that._changingHandler); dataSource.pushed.add(that._dataPushedHandler) } } items(byLoaded) { return this._items } isEmpty() { return !this.items().length } pageCount() { return this._dataSource ? this._dataSource.pageCount() : 1 } dataSource() { return this._dataSource } store() { const dataSource = this._dataSource; return dataSource && dataSource.store() } loadAll(data) { let skipFilter = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : false; const that = this; const d = new _deferred.Deferred; const dataSource = that._dataSource; if (dataSource) { if (data) { const options = { data: data, isCustomLoading: true, storeLoadOptions: { isLoadingAll: true }, loadOptions: { filter: skipFilter ? null : that.getCombinedFilter(), group: dataSource.group(), sort: dataSource.sort() } }; dataSource._handleDataLoaded(options); (0, _deferred.when)(options.data).done((data => { var _options$extra; data = that._beforeProcessItems(data); d.resolve(that._processItems(data, { changeType: "loadingAll" }), null === (_options$extra = options.extra) || void 0 === _options$extra ? void 0 : _options$extra.summary) })).fail(d.reject) } else if (!dataSource.isLoading()) { const loadOptions = (0, _extend.extend)({}, dataSource.loadOptions(), { isLoadingAll: true, requireTotalCount: false }); dataSource.load(loadOptions).done(((items, extra) => { items = that._beforeProcessItems(items); items = that._processItems(items, { changeType: "loadingAll" }); d.resolve(items, extra && extra.summary) })).fail(d.reject) } else { d.reject() } } else { d.resolve([]) } return d } getKeyByRowIndex(rowIndex, byLoaded) { const item = this.items(byLoaded)[rowIndex]; if (item) { return item.key } } getRowIndexByKey(key, byLoaded) { return _m_utils.default.getIndexByKey(key, this.items(byLoaded)) } keyOf(data) { const store = this.store(); if (store) { return store.keyOf(data) } } byKey(key) { const store = this.store(); const rowIndex = this.getRowIndexByKey(key); let result; if (!store) { return } if (rowIndex >= 0) { result = (new _deferred.Deferred).resolve(this.items()[rowIndex].data) } return result || store.byKey(key) } key() { const store = this.store(); if (store) { return store.key() } } getRowIndexOffset(byLoadedRows) { return 0 } getDataByKeys(rowKeys) { const that = this; const result = new _deferred.Deferred; const deferreds = []; const data = []; (0, _iterator.each)(rowKeys, ((index, key) => { deferreds.push(that.byKey(key).done((keyData => { data[index] = keyData }))) })); _deferred.when.apply(_renderer.default, deferreds).always((() => { result.resolve(data) })); return result } pageIndex(value) { return changePaging(this, "pageIndex", value) } pageSize(value) { return changePaging(this, "pageSize", value) } beginCustomLoading(messageText) { this._isCustomLoading = true; this._loadingText = messageText || ""; this._fireLoadingChanged() } endCustomLoading() { this._isCustomLoading = false; this._loadingText = void 0; this._fireLoadingChanged() } refresh(options) { if (true === options) { options = { reload: true, changesOnly: true } } else if (!options) { options = { lookup: true, selection: true, reload: true } } const that = this; const dataSource = that.getDataSource(); const { changesOnly: changesOnly } = options; const d = new _deferred.Deferred; const customizeLoadResult = function() { that._repaintChangesOnly = !!changesOnly }; (0, _deferred.when)(!options.lookup || that._columnsController.refresh()).always((() => { if (options.load || options.reload) { dataSource && dataSource.on("customizeLoadResult", customizeLoadResult); (0, _deferred.when)(that.reload(options.reload, changesOnly)).always((() => { dataSource && dataSource.off("customizeLoadResult", customizeLoadResult); that._repaintChangesOnly = void 0 })).done(d.resolve).fail(d.reject) } else { that.updateItems({ repaintChangesOnly: options.changesOnly }); d.resolve() } })); return d.promise() } getVisibleRows() { return this.items() } _disposeDataSource() { if (this._dataSource && this._dataSource._eventsStrategy) { this._dataSource._eventsStrategy.off("loadingChanged", this.readyWatcher) } this.setDataSource(null) } dispose() { this._disposeDataSource(); super.dispose() } repaintRows(rowIndexes, changesOnly) { rowIndexes = Array.isArray(rowIndexes) ? rowIndexes : [rowIndexes]; if (rowIndexes.length > 1 || (0, _type.isDefined)(rowIndexes[0])) { this.updateItems({ changeType: "update", rowIndices: rowIndexes, isFullUpdate: !changesOnly }) } } skipProcessingPagingChange(fullName) { return this._skipProcessingPagingChange && ("paging.pageIndex" === fullName || "paging.pageSize" === fullName) } getUserState() { return { searchText: this.option("searchPanel.text"), pageIndex: this.pageIndex(), pageSize: this.pageSize() } } getCachedStoreData() { return this._dataSource && this._dataSource.getCachedStoreData() } isLastPageLoaded() { const pageIndex = this.pageIndex(); const pageCount = this.pageCount(); return pageIndex === pageCount - 1 } load() { var _this$_dataSource; return null === (_this$_dataSource = this._dataSource) || void 0 === _this$_dataSource ? void 0 : _this$_dataSource.load() } reload(reload, changesOnly) { var _this$_dataSource2; return null === (_this$_dataSource2 = this._dataSource) || void 0 === _this$_dataSource2 ? void 0 : _this$_dataSource2.reload(reload, changesOnly) } push() { var _this$_dataSource3; for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2] } return null === (_this$_dataSource3 = this._dataSource) || void 0 === _this$_dataSource3 ? void 0 : _this$_dataSource3.push(...args) } itemsCount() { var _this$_dataSource4; return this._dataSource ? null === (_this$_dataSource4 = this._dataSource) || void 0 === _this$_dataSource4 ? void 0 : _this$_dataSource4.itemsCount() : 0 } totalItemsCount() { var _this$_dataSource5; return this._dataSource ? null === (_this$_dataSource5 = this._dataSource) || void 0 === _this$_dataSource5 ? void 0 : _this$_dataSource5.totalItemsCount() : 0 } hasKnownLastPage() { var _this$_dataSource6; return this._dataSource ? null === (_this$_dataSource6 = this._dataSource) || void 0 === _this$_dataSource6 ? void 0 : _this$_dataSource6.hasKnownLastPage() : true } isLoaded() { var _this$_dataSource7; return this._dataSource ? null === (_this$_dataSource7 = this._dataSource) || void 0 === _this$_dataSource7 ? void 0 : _this$_dataSource7.isLoaded() : true } totalCount() { var _this$_dataSource8; return this._dataSource ? null === (_this$_dataSource8 = this._dataSource) || void 0 === _this$_dataSource8 ? void 0 : _this$_dataSource8.totalCount() : 0 } hasLoadOperation() { var _this$_dataSource9; const operationTypes = (null === (_this$_dataSource9 = this._dataSource) || void 0 === _this$_dataSource9 ? void 0 : _this$_dataSource9.operationTypes()) ?? {}; return Object.keys(operationTypes).some((type => operationTypes[type])) } } exports.DataController = DataController; exports.dataControllerModule = { defaultOptions: () => ({ loadingTimeout: 0, dataSource: null, cacheEnabled: true, repaintChangesOnly: false, highlightChanges: false, onDataErrorOccurred: null, remoteOperations: "auto", paging: { enabled: true, pageSize: void 0, pageIndex: void 0 } }), controllers: { data: DataController } } }, 8279: /*!***************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/data_controller/m_data_helper_mixin.js ***! \***************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.DataHelperMixin = void 0; var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _data_source = __webpack_require__( /*! ../../../../data/data_source/data_source */ 85273); var _utils = __webpack_require__( /*! ../../../../data/data_source/utils */ 9234); var _m_data_controller = (obj = __webpack_require__( /*! ../../../ui/collection/m_data_controller */ 30136), obj && obj.__esModule ? obj : { default: obj }); var obj; exports.DataHelperMixin = Base => class extends Base { postCtor() { this.on("disposing", (() => { this._disposeDataSource() })) } _refreshDataSource() { this._initDataSource(); this._loadDataSource() } _initDataSource() { let dataSourceOptions = "_getSpecificDataSourceOption" in this ? this._getSpecificDataSourceOption() : this.option("dataSource"); let widgetDataSourceOptions; let dataSourceType; this._disposeDataSource(); if (dataSourceOptions) { if (dataSourceOptions instanceof _data_source.DataSource) { this._isSharedDataSource = true; this._dataSource = dataSourceOptions } else { widgetDataSourceOptions = "_dataSourceOptions" in this ? this._dataSourceOptions() : {}; dataSourceType = this._dataSourceType ? this._dataSourceType() : _data_source.DataSource; dataSourceOptions = (0, _utils.normalizeDataSourceOptions)(dataSourceOptions, { fromUrlLoadMode: "_dataSourceFromUrlLoadMode" in this && this._dataSourceFromUrlLoadMode() }); this._dataSource = new dataSourceType((0, _extend.extend)(true, {}, widgetDataSourceOptions, dataSourceOptions)) } if ("_normalizeDataSource" in this) { this._dataSource = this._normalizeDataSource(this._dataSource) } this._addDataSourceHandlers(); this._initDataController() } } _initDataController() { var _this$option; const dataController = null === (_this$option = this.option) || void 0 === _this$option ? void 0 : _this$option.call(this, "_dataController"); const dataSource = this._dataSource; if (dataController) { this._dataController = dataController } else { this._dataController = new _m_data_controller.default(dataSource) } } _addDataSourceHandlers() { if ("_dataSourceChangedHandler" in this) { this._addDataSourceChangeHandler() } if ("_dataSourceLoadErrorHandler" in this) { this._addDataSourceLoadErrorHandler() } if ("_dataSourceLoadingChangedHandler" in this) { this._addDataSourceLoadingChangedHandler() } this._addReadyWatcher() } _addReadyWatcher() { this.readyWatcher = function(isLoading) { this._ready && this._ready(!isLoading) }.bind(this); this._dataSource.on("loadingChanged", this.readyWatcher) } _addDataSourceChangeHandler() { const dataSource = this._dataSource; this._proxiedDataSourceChangedHandler = function(e) { this._dataSourceChangedHandler(dataSource.items(), e) }.bind(this); dataSource.on("changed", this._proxiedDataSourceChangedHandler) } _addDataSourceLoadErrorHandler() { this._proxiedDataSourceLoadErrorHandler = this._dataSourceLoadErrorHandler.bind(this); this._dataSource.on("loadError", this._proxiedDataSourceLoadErrorHandler) } _addDataSourceLoadingChangedHandler() { this._proxiedDataSourceLoadingChangedHandler = this._dataSourceLoadingChangedHandler.bind(this); this._dataSource.on("loadingChanged", this._proxiedDataSourceLoadingChangedHandler) } _loadDataSource() { const dataSource = this._dataSource; if (dataSource) { if (dataSource.isLoaded()) { this._proxiedDataSourceChangedHandler && this._proxiedDataSourceChangedHandler() } else { dataSource.load() } } } _loadSingle(key, value) { key = "this" === key ? this._dataSource.key() || "this" : key; return this._dataSource.loadSingle(key, value) } _isLastPage() { return !this._dataSource || this._dataSource.isLastPage() || !this._dataSource._pageSize } _isDataSourceLoading() { return this._dataSource && this._dataSource.isLoading() } _disposeDataSource() { 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); if (this._dataSource._eventsStrategy) { this._dataSource._eventsStrategy.off("loadingChanged", this.readyWatcher) } } else { this._dataSource.dispose() } delete this._dataSource; delete this._proxiedDataSourceChangedHandler; delete this._proxiedDataSourceLoadErrorHandler; delete this._proxiedDataSourceLoadingChangedHandler } } getDataSource() { return this._dataSource || null } } }, 30945: /*!*********************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/data_source_adapter/m_data_source_adapter.js ***! \*********************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _callbacks = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/callbacks */ 44504)); var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _array_store = _interopRequireDefault(__webpack_require__( /*! ../../../../data/array_store */ 26562)); var _array_utils = __webpack_require__( /*! ../../../../data/array_utils */ 60637); var _m_modules = _interopRequireDefault(__webpack_require__( /*! ../m_modules */ 15943)); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../m_utils */ 60082)); var _m_data_source_adapter_utils = __webpack_require__( /*! ./m_data_source_adapter_utils */ 19787); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } class DataSourceAdapter extends _m_modules.default.Controller { init(dataSource, remoteOperations) { const that = this; that._dataSource = dataSource; that._remoteOperations = remoteOperations || {}; that._isLastPage = !dataSource.isLastPage(); that._hasLastPage = false; that._currentTotalCount = 0; that._cachedData = (0, _m_data_source_adapter_utils.createEmptyCachedData)(); that._lastOperationTypes = {}; that._eventsStrategy = dataSource._eventsStrategy; that._totalCountCorrection = 0; that._isLoadingAll = false; that.changed = (0, _callbacks.default)(); that.loadingChanged = (0, _callbacks.default)(); that.loadError = (0, _callbacks.default)(); that.customizeStoreLoadOptions = (0, _callbacks.default)(); that.changing = (0, _callbacks.default)(); that.pushed = (0, _callbacks.default)(); that._dataChangedHandler = that._handleDataChanged.bind(that); that._customizeStoreLoadOptionsHandler = that._handleCustomizeStoreLoadOptions.bind(that); that._dataLoadedHandler = that._handleDataLoaded.bind(that); that._loadingChangedHandler = that._handleLoadingChanged.bind(that); that._loadErrorHandler = that._handleLoadError.bind(that); that._pushHandler = that._handlePush.bind(that); that._changingHandler = that._handleChanging.bind(that); dataSource.on("changed", that._dataChangedHandler); dataSource.on("customizeStoreLoadOptions", that._customizeStoreLoadOptionsHandler); dataSource.on("customizeLoadResult", that._dataLoadedHandler); dataSource.on("loadingChanged", that._loadingChangedHandler); dataSource.on("loadError", that._loadErrorHandler); dataSource.on("changing", that._changingHandler); dataSource.store().on("beforePush", that._pushHandler); (0, _iterator.each)(dataSource, ((memberName, member) => { if (!that[memberName] && (0, _type.isFunction)(member)) { that[memberName] = function() { return this._dataSource[memberName].apply(this._dataSource, arguments) } } })) } dispose(isSharedDataSource) { const dataSource = this._dataSource; const store = dataSource.store(); dataSource.off("changed", this._dataChangedHandler); dataSource.off("customizeStoreLoadOptions", this._customizeStoreLoadOptionsHandler); dataSource.off("customizeLoadResult", this._dataLoadedHandler); dataSource.off("loadingChanged", this._loadingChangedHandler); dataSource.off("loadError", this._loadErrorHandler); dataSource.off("changing", this._changingHandler); store && store.off("beforePush", this._pushHandler); if (!isSharedDataSource) { dataSource.dispose() } } remoteOperations() { return this._remoteOperations } refresh(options, operationTypes) { const that = this; const dataSource = that._dataSource; if (operationTypes.reload) { that.resetCurrentTotalCount(); that._isLastPage = !dataSource.paginate(); that._hasLastPage = that._isLastPage } } resetCurrentTotalCount() { this._currentTotalCount = 0; this._totalCountCorrection = 0 } resetCache() { this._cachedStoreData = void 0; this._cachedPagingData = void 0 } resetPagesCache(isLiveUpdate) { this._cachedData = (0, _m_data_source_adapter_utils.createEmptyCachedData)() } _needClearStoreDataCache() { const remoteOperations = this.remoteOperations(); const operationTypes = (0, _m_data_source_adapter_utils.calculateOperationTypes)(this._lastLoadOptions || {}, {}); const isLocalOperations = Object.keys(remoteOperations).every((operationName => !operationTypes[operationName] || !remoteOperations[operationName])); return !isLocalOperations } push(changes, fromStore) { const store = this.store(); if (this._needClearStoreDataCache()) { this._cachedStoreData = void 0 } this._cachedPagingData = void 0; this.resetPagesCache(true); if (this._cachedStoreData) { (0, _array_utils.applyBatch)({ keyInfo: store, data: this._cachedStoreData, changes: changes }) } if (!fromStore) { this._applyBatch(changes) } this.pushed.fire(changes) } getDataIndexGetter() { if (!this._dataIndexGetter) { let indexByKey; let storeData; const store = this.store(); this._dataIndexGetter = data => { const isCacheUpdated = storeData && storeData !== this._cachedStoreData; if (!indexByKey || isCacheUpdated) { storeData = this._cachedStoreData || []; indexByKey = {}; for (let i = 0; i < storeData.length; i++) { indexByKey[(0, _common.getKeyHash)(store.keyOf(storeData[i]))] = i } } return indexByKey[(0, _common.getKeyHash)(store.keyOf(data))] } } return this._dataIndexGetter } _getKeyInfo() { return this.store() } _needToCopyDataObject() { return true } _applyBatch(changes, fromStore) { const keyInfo = this._getKeyInfo(); const dataSource = this._dataSource; const groupCount = _m_utils.default.normalizeSortingInfo(this.group()).length; const isReshapeMode = "reshape" === this.option("editing.refreshMode"); const isVirtualMode = "virtual" === this.option("scrolling.mode"); changes = changes.filter((change => !dataSource.paginate() || "insert" !== change.type || void 0 !== change.index)); const getItemCount = () => groupCount ? this.itemsCount() : this.items().length; const oldItemCount = getItemCount(); (0, _array_utils.applyBatch)({ keyInfo: keyInfo, data: this._items, changes: changes, groupCount: groupCount, useInsertIndex: true, skipCopying: !this._needToCopyDataObject() }); (0, _array_utils.applyBatch)({ keyInfo: keyInfo, data: dataSource.items(), changes: changes, groupCount: groupCount, useInsertIndex: true, skipCopying: !this._needToCopyDataObject() }); const needUpdateTotalCountCorrection = this._currentTotalCount > 0 || (fromStore || !isReshapeMode) && isVirtualMode; if (needUpdateTotalCountCorrection) { this._totalCountCorrection += getItemCount() - oldItemCount } changes.splice(0, changes.length) } _handlePush(_ref) { let { changes: changes } = _ref; this.push(changes, true) } _handleChanging(e) { this.changing.fire(e); this._applyBatch(e.changes, true) } _needCleanCacheByOperation(operationType, remoteOperations) { const operationTypesByOrder = ["filtering", "sorting", "paging"]; const operationTypeIndex = operationTypesByOrder.indexOf(operationType); const currentOperationTypes = operationTypeIndex >= 0 ? operationTypesByOrder.slice(operationTypeIndex) : [operationType]; return currentOperationTypes.some((operationType => remoteOperations[operationType])) } _customizeRemoteOperations(options, operationTypes) { let cachedStoreData = this._cachedStoreData; let cachedPagingData = this._cachedPagingData; let cachedData = this._cachedData; if (options.storeLoadOptions.filter && !options.remoteOperations.filtering || options.storeLoadOptions.sort && !options.remoteOperations.sorting) { options.remoteOperations = { filtering: options.remoteOperations.filtering, summary: options.remoteOperations.summary } } if (operationTypes.fullReload) { cachedStoreData = void 0; cachedPagingData = void 0; cachedData = (0, _m_data_source_adapter_utils.createEmptyCachedData)() } else { if (operationTypes.reload) { cachedPagingData = void 0; cachedData = (0, _m_data_source_adapter_utils.createEmptyCachedData)() } else if (operationTypes.groupExpanding) { cachedData = (0, _m_data_source_adapter_utils.createEmptyCachedData)() }(0, _iterator.each)(operationTypes, ((operationType, value) => { if (value && this._needCleanCacheByOperation(operationType, options.remoteOperations)) { cachedStoreData = void 0; cachedPagingData = void 0 } })) } if (cachedPagingData) { options.remoteOperations.paging = false } options.cachedStoreData = cachedStoreData; options.cachedPagingData = cachedPagingData; options.cachedData = cachedData; if (!options.isCustomLoading) { this._cachedStoreData = cachedStoreData; this._cachedPagingData = cachedPagingData; this._cachedData = cachedData } } _handleCustomizeStoreLoadOptions(options) { var _options$data; this._handleDataLoading(options); if (!(0 === (null === (_options$data = options.data) || void 0 === _options$data ? void 0 : _options$data.length))) { options.data = (0, _m_data_source_adapter_utils.getPageDataFromCache)(options, true) || options.cachedStoreData } } _handleDataLoading(options) { const dataSource = this._dataSource; const lastLoadOptions = this._lastLoadOptions; this.customizeStoreLoadOptions.fire(options); options.delay = this.option("loadingTimeout"); options.originalStoreLoadOptions = options.storeLoadOptions; options.remoteOperations = (0, _extend.extend)({}, this.remoteOperations()); const isFullReload = !this.isLoaded() && !this._isRefreshing; if (this.option("integrationOptions.renderedOnServer") && !this.isLoaded()) { options.delay = void 0 } const loadOptions = (0, _extend.extend)({ pageIndex: this.pageIndex(), pageSize: this.pageSize() }, options.storeLoadOptions); const operationTypes = (0, _m_data_source_adapter_utils.calculateOperationTypes)(loadOptions, lastLoadOptions, isFullReload); this._customizeRemoteOperations(options, operationTypes); if (!options.isCustomLoading) { const isRefreshing = this._isRefreshing; options.pageIndex = dataSource.pageIndex(); options.lastLoadOptions = loadOptions; options.operationTypes = operationTypes; this._loadingOperationTypes = operationTypes; this._isRefreshing = true; (0, _deferred.when)(isRefreshing || this._isRefreshed || this.refresh(options, operationTypes)).done((() => { if (this._lastOperationId === options.operationId) { this._isRefreshed = true; this.load().always((() => { this._isRefreshed = false })) } })).fail((() => { dataSource.cancel(options.operationId) })).always((() => { this._isRefreshing = false })); dataSource.cancel(this._lastOperationId); this._lastOperationId = options.operationId; if (this._isRefreshing) { dataSource.cancel(this._lastOperationId) } } this._handleDataLoadingCore(options) } _handleDataLoadingCore(options) { const { remoteOperations: remoteOperations } = options; options.loadOptions = {}; const cachedExtra = options.cachedData.extra; const localLoadOptionNames = { filter: !remoteOperations.filtering, sort: !remoteOperations.sorting, group: !remoteOperations.grouping, summary: !remoteOperations.summary, skip: !remoteOperations.paging, take: !remoteOperations.paging, requireTotalCount: cachedExtra && "totalCount" in cachedExtra || !remoteOperations.paging, langParams: !remoteOperations.filtering || !remoteOperations.sorting }; (0, _iterator.each)(options.storeLoadOptions, ((optionName, optionValue) => { if (localLoadOptionNames[optionName]) { options.loadOptions[optionName] = optionValue; delete options.storeLoadOptions[optionName] } })); if (cachedExtra) { options.extra = cachedExtra } } _handleDataLoaded(options) { const { loadOptions: loadOptions } = options; const localPaging = options.remoteOperations && !options.remoteOperations.paging; const { cachedData: cachedData } = options; const { storeLoadOptions: storeLoadOptions } = options; const needCache = false !== this.option("cacheEnabled") && storeLoadOptions; const needPageCache = needCache && !options.isCustomLoading && cachedData && (!localPaging || storeLoadOptions.group); const needPagingCache = needCache && localPaging; const needStoreCache = needPagingCache && !options.isCustomLoading; if (!loadOptions) { this._dataSource.cancel(options.operationId); return } if (localPaging) { options.skip = loadOptions.skip; options.take = loadOptions.take; delete loadOptions.skip; delete loadOptions.take } if (loadOptions.group) { loadOptions.group = options.group || loadOptions.group } const groupCount = _m_utils.default.normalizeSortingInfo(options.group || storeLoadOptions.group || loadOptions.group).length; if (options.cachedDataPartBegin) { options.data = options.cachedDataPartBegin.concat(options.data) } if (options.cachedDataPartEnd) { options.data = options.data.concat(options.cachedDataPartEnd) } if (!needPageCache || !(0, _m_data_source_adapter_utils.getPageDataFromCache)(options)) { var _options$extra; if (needPagingCache && options.cachedPagingData) { options.data = (0, _m_data_source_adapter_utils.cloneItems)(options.cachedPagingData, groupCount) } else { if (needStoreCache) { if (!this._cachedStoreData) { this._cachedStoreData = (0, _m_data_source_adapter_utils.cloneItems)(options.data, _m_utils.default.normalizeSortingInfo(storeLoadOptions.group).length) } else if (options.mergeStoreLoadData) { options.data = this._cachedStoreData = this._cachedStoreData.concat(options.data) } } new _array_store.default(options.data).load(loadOptions).done((data => { options.data = data; if (needStoreCache) { this._cachedPagingData = (0, _m_data_source_adapter_utils.cloneItems)(options.data, groupCount) } })).fail((error => { options.data = (new _deferred.Deferred).reject(error) })) } if (loadOptions.requireTotalCount && localPaging) { options.extra = (0, _type.isPlainObject)(options.extra) ? options.extra : {}; options.extra.totalCount = options.data.length } if (options.extra && options.extra.totalCount >= 0 && (false === storeLoadOptions.requireTotalCount || false === loadOptions.requireTotalCount)) { options.extra.totalCount = -1 } if (!loadOptions.data && (storeLoadOptions.requireTotalCount || ((null === (_options$extra = options.extra) || void 0 === _options$extra ? void 0 : _options$extra.totalCount) ?? -1) >= 0)) { this._totalCountCorrection = 0 } this._handleDataLoadedCore(options); if (needPageCache) { cachedData.extra = cachedData.extra || (0, _extend.extend)({}, options.extra); (0, _deferred.when)(options.data).done((data => { (0, _m_data_source_adapter_utils.setPageDataToCache)(options, data, groupCount) })) } }(0, _deferred.when)(options.data).done((() => { if (options.lastLoadOptions) { this._lastLoadOptions = options.lastLoadOptions; Object.keys(options.operationTypes).forEach((operationType => { this._lastOperationTypes[operationType] = this._lastOperationTypes[operationType] || options.operationTypes[operationType] })) } })); options.storeLoadOptions = options.originalStoreLoadOptions } _handleDataLoadedCore(options) { if (options.remoteOperations && !options.remoteOperations.paging && Array.isArray(options.data)) { if (void 0 !== options.skip) { options.data = options.data.slice(options.skip) } if (void 0 !== options.take) { options.data = options.data.slice(0, options.take) } } } _handleLoadingChanged(isLoading) { this.loadingChanged.fire(isLoading) } _handleLoadError(error) { this.loadError.fire(error); this.changed.fire({ changeType: "loadError", error: error }) } _loadPageSize() { return this.pageSize() } _handleDataChanged(args) { let currentTotalCount; const dataSource = this._dataSource; let isLoading = false; const isDataLoading = !args || (0, _type.isDefined)(args.changeType); const itemsCount = this.itemsCount(); if (isDataLoading) { this._isLastPage = !itemsCount || !this._loadPageSize() || itemsCount < this._loadPageSize(); if (this._isLastPage) { this._hasLastPage = true } } if (dataSource.totalCount() >= 0) { if (dataSource.pageIndex() >= this.pageCount()) { dataSource.pageIndex(this.pageCount() - 1); this.pageIndex(dataSource.pageIndex()); this.resetPagesCache(); dataSource.load(); isLoading = true } } else if (isDataLoading) { currentTotalCount = dataSource.pageIndex() * this.pageSize() + itemsCount; if (currentTotalCount > this._currentTotalCount) { this._currentTotalCount = currentTotalCount; if (0 === dataSource.pageIndex() || !this.option("scrolling.legacyMode")) { this._totalCountCorrection = 0 } } if (0 === itemsCount && dataSource.pageIndex() >= this.pageCount()) { dataSource.pageIndex(this.pageCount() - 1); if ("infinite" !== this.option("scrolling.mode")) { dataSource.load(); isLoading = true } } } if (!isLoading) { this._operationTypes = this._lastOperationTypes; this._lastOperationTypes = {}; this.component._optionCache = {}; this.changed.fire(args); this.component._optionCache = void 0 } } _scheduleCustomLoadCallbacks(deferred) { const that = this; that._isCustomLoading = true; deferred.always((() => { that._isCustomLoading = false })) } loadingOperationTypes() { return this._loadingOperationTypes } operationTypes() { return this._operationTypes } lastLoadOptions() { return this._lastLoadOptions || {} } isLastPage() { return this._isLastPage } _dataSourceTotalCount() { return this._dataSource.totalCount() } _changeRowExpandCore(path) {} changeRowExpand(path) {} totalCount() { return parseInt((this._currentTotalCount || this._dataSourceTotalCount()) + this._totalCountCorrection) } totalCountCorrection() { return this._totalCountCorrection } items() {} itemsCount() { return this._dataSource.items().length } totalItemsCount() { return this.totalCount() } pageSize() { const dataSource = this._dataSource; if (!arguments.length && !dataSource.paginate()) { return 0 } return dataSource.pageSize.apply(dataSource, arguments) } pageCount() { const count = this.totalItemsCount() - this._totalCountCorrection; const pageSize = this.pageSize(); if (pageSize && count > 0) { return Math.max(1, Math.ceil(count / pageSize)) } return 1 } hasKnownLastPage() { return this._hasLastPage || this._dataSource.totalCount() >= 0 } loadFromStore(loadOptions, store) { const dataSource = this._dataSource; const d = new _deferred.Deferred; if (!dataSource) { return } store = store || dataSource.store(); store.load(loadOptions).done(((data, extra) => { if (data && !Array.isArray(data) && Array.isArray(data.data)) { extra = data; data = data.data } d.resolve(data, extra) })).fail(d.reject); return d } isCustomLoading() { return !!this._isCustomLoading } load(options) { const that = this; const dataSource = that._dataSource; const d = new _deferred.Deferred; if (options) { const store = dataSource.store(); const dataSourceLoadOptions = dataSource.loadOptions(); const loadResult = { storeLoadOptions: (0, _extend.extend)({}, options, { langParams: null === dataSourceLoadOptions || void 0 === dataSourceLoadOptions ? void 0 : dataSourceLoadOptions.langParams }), isCustomLoading: true }; (0, _iterator.each)(store._customLoadOptions() || [], ((_, optionName) => { if (!(optionName in loadResult.storeLoadOptions)) { loadResult.storeLoadOptions[optionName] = dataSourceLoadOptions[optionName] } })); this._isLoadingAll = options.isLoadingAll; that._scheduleCustomLoadCallbacks(d); dataSource._scheduleLoadCallbacks(d); that._handleCustomizeStoreLoadOptions(loadResult); (0, _m_data_source_adapter_utils.executeTask)((() => { if (!dataSource.store()) { return d.reject("canceled") }(0, _deferred.when)(loadResult.data || that.loadFromStore(loadResult.storeLoadOptions)).done(((data, extra) => { loadResult.data = data; loadResult.extra = extra || {}; that._handleDataLoaded(loadResult); if (options.requireTotalCount && void 0 === loadResult.extra.totalCount) { loadResult.extra.totalCount = store.totalCount(loadResult.storeLoadOptions) }(0, _deferred.when)(loadResult.data, loadResult.extra.totalCount).done(((data, totalCount) => { loadResult.extra.totalCount = totalCount; d.resolve(data, loadResult.extra) })).fail(d.reject) })).fail(d.reject) }), that.option("loadingTimeout")); return d.fail((function() { that._eventsStrategy.fireEvent("loadError", arguments) })).always((() => { this._isLoadingAll = false })).promise() } return dataSource.load() } reload(full) { return full ? this._dataSource.reload() : this._dataSource.load() } getCachedStoreData() { return this._cachedStoreData } isLoaded() {} pageIndex(pageIndex) {} } exports.default = DataSourceAdapter }, 19787: /*!***************************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/data_source_adapter/m_data_source_adapter_utils.js ***! \***************************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.updatePagingOptionsByCache = exports.setPageDataToCache = exports.getPageDataFromCache = exports.getItemFromCache = exports.getGroupItemFromCache = exports.getCacheItem = exports.fillItemsFromCache = exports.executeTask = exports.createEmptyCachedData = exports.cloneItems = exports.calculateOperationTypes = void 0; var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _m_utils = (obj = __webpack_require__( /*! ../m_utils */ 60082), obj && obj.__esModule ? obj : { default: obj }); var obj; function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const cloneItems = function(items, groupCount) { if (items) { items = items.slice(0); if (groupCount) { for (let i = 0; i < items.length; i++) { items[i] = (0, _extend.extend)({ key: items[i].key }, items[i]); items[i].items = cloneItems(items[i].items, groupCount - 1) } } } return items }; exports.cloneItems = cloneItems; exports.calculateOperationTypes = function(loadOptions, lastLoadOptions, isFullReload) { let operationTypes = { reload: true, fullReload: true }; if (lastLoadOptions) { operationTypes = { sorting: !_m_utils.default.equalSortParameters(loadOptions.sort, lastLoadOptions.sort), grouping: !_m_utils.default.equalSortParameters(loadOptions.group, lastLoadOptions.group, true), groupExpanding: !_m_utils.default.equalSortParameters(loadOptions.group, lastLoadOptions.group) || lastLoadOptions.groupExpand, filtering: !_m_utils.default.equalFilterParameters(loadOptions.filter, lastLoadOptions.filter), pageIndex: loadOptions.pageIndex !== lastLoadOptions.pageIndex, skip: loadOptions.skip !== lastLoadOptions.skip, take: loadOptions.take !== lastLoadOptions.take, pageSize: loadOptions.pageSize !== lastLoadOptions.pageSize, fullReload: isFullReload, reload: false, paging: false }; operationTypes.reload = isFullReload || operationTypes.sorting || operationTypes.grouping || operationTypes.filtering; operationTypes.paging = operationTypes.pageIndex || operationTypes.pageSize || operationTypes.take } return operationTypes }; exports.executeTask = function(action, timeout) { if ((0, _type.isDefined)(timeout)) { (0, _common.executeAsync)(action, timeout) } else { action() } }; exports.createEmptyCachedData = function() { return { items: {} } }; exports.getPageDataFromCache = function(options, updatePaging) { const groupCount = _m_utils.default.normalizeSortingInfo(options.group || options.storeLoadOptions.group || options.loadOptions.group).length; const items = []; if (fillItemsFromCache(items, options, groupCount)) { return items } if (updatePaging) { updatePagingOptionsByCache(items, options, groupCount) } }; const fillItemsFromCache = function(items, options, groupCount, fromEnd) { var _options$cachedData; const { storeLoadOptions: storeLoadOptions } = options; const take = options.take ?? storeLoadOptions.take ?? 0; const cachedItems = null === (_options$cachedData = options.cachedData) || void 0 === _options$cachedData ? void 0 : _options$cachedData.items; if (take && cachedItems) { const skip = options.skip ?? storeLoadOptions.skip ?? 0; for (let i = 0; i < take; i += 1) { const localIndex = fromEnd ? take - 1 - i : i; const cacheItemIndex = localIndex + skip; const cacheItem = cachedItems[cacheItemIndex]; if (void 0 === cacheItem && cacheItemIndex in cachedItems) { return true } const item = getItemFromCache(options, cacheItem, groupCount, localIndex, take); if (item) { items.push(item) } else { return false } } return true } return false }; exports.fillItemsFromCache = fillItemsFromCache; const getItemFromCache = function(options, cacheItem, groupCount, index, take) { if (groupCount && cacheItem) { const skips = 0 === index && options.skips || []; const takes = index === take - 1 && options.takes || []; return getGroupItemFromCache(cacheItem, groupCount, skips, takes) } return cacheItem }; exports.getItemFromCache = getItemFromCache; const getGroupItemFromCache = function(cacheItem, groupCount, skips, takes) { if (groupCount && cacheItem) { const result = _extends({}, cacheItem); const skip = skips[0] || 0; const take = takes[0]; const { items: items } = cacheItem; if (items) { if (void 0 === take && !items[skip]) { return } result.items = []; if (skips.length) { result.isContinuation = true } if (take) { result.isContinuationOnNextPage = cacheItem.count > take } for (let i = 0; void 0 === take ? items[i + skip] : i < take; i += 1) { const childCacheItem = items[i + skip]; const isLast = i + 1 === take; const item = getGroupItemFromCache(childCacheItem, groupCount - 1, 0 === i ? skips.slice(1) : [], isLast ? takes.slice(1) : []); if (void 0 !== item) { result.items.push(item) } else { return } } } return result } return cacheItem }; exports.getGroupItemFromCache = getGroupItemFromCache; const updatePagingOptionsByCache = function(cacheItemsFromBegin, options, groupCount) { const cacheItemBeginCount = cacheItemsFromBegin.length; const { storeLoadOptions: storeLoadOptions } = options; if (void 0 !== storeLoadOptions.skip && storeLoadOptions.take && !groupCount) { const cacheItemsFromEnd = []; fillItemsFromCache(cacheItemsFromEnd, options, groupCount, true); const cacheItemEndCount = cacheItemsFromEnd.length; if (cacheItemBeginCount || cacheItemEndCount) { options.skip = options.skip ?? storeLoadOptions.skip; options.take = options.take ?? storeLoadOptions.take } if (cacheItemBeginCount) { storeLoadOptions.skip += cacheItemBeginCount; storeLoadOptions.take -= cacheItemBeginCount; options.cachedDataPartBegin = cacheItemsFromBegin } if (cacheItemEndCount) { storeLoadOptions.take -= cacheItemEndCount; options.cachedDataPartEnd = cacheItemsFromEnd.reverse() } } }; exports.updatePagingOptionsByCache = updatePagingOptionsByCache; exports.setPageDataToCache = function(options, data, groupCount) { const { storeLoadOptions: storeLoadOptions } = options; const skip = options.skip ?? storeLoadOptions.skip ?? 0; const take = options.take ?? storeLoadOptions.take ?? 0; for (let i = 0; i < take; i += 1) { const globalIndex = i + skip; const cacheItems = options.cachedData.items; const skips = 0 === i && options.skips || []; cacheItems[globalIndex] = getCacheItem(cacheItems[globalIndex], data[i], groupCount, skips) } }; const getCacheItem = function(cacheItem, loadedItem, groupCount, skips) { if (groupCount && loadedItem) { const result = _extends({}, loadedItem); delete result.isContinuation; delete result.isContinuationOnNextPage; const skip = skips[0] || 0; if (loadedItem.items) { result.items = (null === cacheItem || void 0 === cacheItem ? void 0 : cacheItem.items) || {}; loadedItem.items.forEach(((item, index) => { const globalIndex = index + skip; const childSkips = 0 === index ? skips.slice(1) : []; result.items[globalIndex] = getCacheItem(result.items[globalIndex], item, groupCount - 1, childSkips) })) } return result } return loadedItem }; exports.getCacheItem = getCacheItem }, 72313: /*!*****************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/editing/const.js ***! \*****************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.VIEWPORT_TOP_NEW_ROW_POSITION = exports.VIEWPORT_BOTTOM_NEW_ROW_POSITION = exports.TARGET_COMPONENT_NAME = exports.ROW_SELECTED_CLASS = exports.ROW_SELECTED = exports.ROW_REMOVED = exports.ROW_MODIFIED = exports.ROW_INSERTED = exports.ROW_CLASS = exports.ROW_BASED_MODES = exports.REQUIRED_EDITOR_LABELLEDBY_MODES = exports.READONLY_CLASS = exports.PAGE_TOP_NEW_ROW_POSITION = exports.PAGE_BOTTOM_NEW_ROW_POSITION = exports.MODES_WITH_DELAYED_FOCUS = exports.METHOD_NAMES = exports.LINK_ICON_CLASS = exports.LINK_CLASS = exports.LAST_NEW_ROW_POSITION = exports.INSERT_INDEX = exports.FORM_BUTTONS_CONTAINER_CLASS = exports.FOCUS_OVERLAY_CLASS = exports.FOCUSABLE_ELEMENT_SELECTOR = exports.FOCUSABLE_ELEMENT_CLASS = exports.FIRST_NEW_ROW_POSITION = exports.FILTER_ROW_CLASS = exports.EDIT_ROW = exports.EDIT_POPUP_FORM_CLASS = exports.EDIT_POPUP_CLASS = exports.EDIT_MODE_ROW = exports.EDIT_MODE_POPUP = exports.EDIT_MODE_FORM = exports.EDIT_MODE_CELL = exports.EDIT_MODE_BATCH = exports.EDIT_MODES = exports.EDIT_LINK_CLASS = exports.EDIT_ICON_CLASS = exports.EDIT_FORM_ITEM_CLASS = exports.EDIT_FORM_CLASS = exports.EDIT_BUTTON_CLASS = exports.EDITOR_CELL_CLASS = exports.EDITORS_INPUT_SELECTOR = exports.EDITING_POPUP_OPTION_NAME = exports.EDITING_NAMESPACE = exports.EDITING_FORM_OPTION_NAME = exports.EDITING_EDITROWKEY_OPTION_NAME = exports.EDITING_EDITCOLUMNNAME_OPTION_NAME = exports.EDITING_CHANGES_OPTION_NAME = exports.DROPDOWN_EDITOR_OVERLAY_CLASS = exports.DEFAULT_START_EDIT_ACTION = exports.DATA_ROW_CLASS = exports.DATA_EDIT_DATA_UPDATE_TYPE = exports.DATA_EDIT_DATA_REMOVE_TYPE = exports.DATA_EDIT_DATA_INSERT_TYPE = exports.COMMAND_EDIT_WITH_ICONS_CLASS = exports.COMMAND_EDIT_CLASS = exports.CELL_MODIFIED_CLASS = exports.CELL_MODIFIED = exports.CELL_FOCUS_DISABLED_CLASS = exports.CELL_BASED_MODES = exports.BUTTON_NAMES = exports.BUTTON_CLASS = exports.ADD_ROW_BUTTON_CLASS = exports.ACTION_OPTION_NAMES = void 0; var _ui = (obj = __webpack_require__( /*! ../../../../ui/scroll_view/ui.scrollable */ 41183), obj && obj.__esModule ? obj : { default: obj }); var obj; exports.EDITOR_CELL_CLASS = "dx-editor-cell"; exports.ROW_CLASS = "dx-row"; exports.CELL_MODIFIED_CLASS = "dx-cell-modified"; exports.ROW_SELECTED_CLASS = "dx-selection"; exports.EDIT_FORM_CLASS = "edit-form"; exports.DATA_EDIT_DATA_INSERT_TYPE = "insert"; exports.DATA_EDIT_DATA_REMOVE_TYPE = "remove"; exports.EDITING_POPUP_OPTION_NAME = "editing.popup"; exports.EDITING_FORM_OPTION_NAME = "editing.form"; exports.EDITING_EDITROWKEY_OPTION_NAME = "editing.editRowKey"; exports.EDITING_EDITCOLUMNNAME_OPTION_NAME = "editing.editColumnName"; exports.TARGET_COMPONENT_NAME = "targetComponent"; const EDITORS_INPUT_SELECTOR = exports.EDITORS_INPUT_SELECTOR = "input:not([type='hidden'])"; exports.FOCUSABLE_ELEMENT_SELECTOR = `[tabindex]:not([disabled]), ${EDITORS_INPUT_SELECTOR}:not([disabled])`; const EDIT_MODE_BATCH = exports.EDIT_MODE_BATCH = "batch"; const EDIT_MODE_ROW = exports.EDIT_MODE_ROW = "row"; const EDIT_MODE_CELL = exports.EDIT_MODE_CELL = "cell"; const EDIT_MODE_FORM = exports.EDIT_MODE_FORM = "form"; const EDIT_MODE_POPUP = exports.EDIT_MODE_POPUP = "popup"; exports.FIRST_NEW_ROW_POSITION = "first"; exports.LAST_NEW_ROW_POSITION = "last"; exports.PAGE_BOTTOM_NEW_ROW_POSITION = "pageBottom"; exports.PAGE_TOP_NEW_ROW_POSITION = "pageTop"; exports.VIEWPORT_BOTTOM_NEW_ROW_POSITION = "viewportBottom"; exports.VIEWPORT_TOP_NEW_ROW_POSITION = "viewportTop"; exports.EDIT_MODES = [EDIT_MODE_BATCH, EDIT_MODE_ROW, EDIT_MODE_CELL, EDIT_MODE_FORM, EDIT_MODE_POPUP]; exports.ROW_BASED_MODES = [EDIT_MODE_ROW, EDIT_MODE_FORM, EDIT_MODE_POPUP]; exports.CELL_BASED_MODES = [EDIT_MODE_BATCH, EDIT_MODE_CELL]; exports.REQUIRED_EDITOR_LABELLEDBY_MODES = [EDIT_MODE_BATCH, EDIT_MODE_ROW, EDIT_MODE_CELL]; exports.MODES_WITH_DELAYED_FOCUS = [EDIT_MODE_ROW, EDIT_MODE_FORM]; exports.READONLY_CLASS = "readonly"; exports.LINK_CLASS = "dx-link"; exports.LINK_ICON_CLASS = "dx-link-icon"; exports.ROW_SELECTED = "dx-selection"; exports.EDIT_BUTTON_CLASS = "dx-edit-button"; const COMMAND_EDIT_CLASS = exports.COMMAND_EDIT_CLASS = "dx-command-edit"; exports.COMMAND_EDIT_WITH_ICONS_CLASS = `${COMMAND_EDIT_CLASS}-with-icons`; exports.INSERT_INDEX = "__DX_INSERT_INDEX__"; exports.ROW_INSERTED = "dx-row-inserted"; exports.ROW_MODIFIED = "dx-row-modified"; exports.CELL_MODIFIED = "dx-cell-modified"; exports.EDITING_NAMESPACE = "dxDataGridEditing"; exports.CELL_FOCUS_DISABLED_CLASS = "dx-cell-focus-disabled"; exports.DATA_EDIT_DATA_UPDATE_TYPE = "update"; exports.DEFAULT_START_EDIT_ACTION = "click"; exports.EDIT_LINK_CLASS = { save: "dx-link-save", cancel: "dx-link-cancel", edit: "dx-link-edit", undelete: "dx-link-undelete", delete: "dx-link-delete", add: "dx-link-add" }; exports.EDIT_ICON_CLASS = { save: "save", cancel: "revert", edit: "edit", undelete: "revert", delete: "trash", add: "add" }; exports.METHOD_NAMES = { edit: "editRow", delete: "deleteRow", undelete: "undeleteRow", save: "saveEditData", cancel: "cancelEditData", add: "addRowByRowIndex" }; exports.ACTION_OPTION_NAMES = { add: "allowAdding", edit: "allowUpdating", delete: "allowDeleting" }; exports.BUTTON_NAMES = ["edit", "save", "cancel", "delete", "undelete"]; exports.EDITING_CHANGES_OPTION_NAME = "editing.changes"; exports.FOCUS_OVERLAY_CLASS = "focus-overlay"; exports.ADD_ROW_BUTTON_CLASS = "addrow-button"; exports.DROPDOWN_EDITOR_OVERLAY_CLASS = "dx-dropdowneditor-overlay"; exports.DATA_ROW_CLASS = "dx-data-row"; exports.ROW_REMOVED = "dx-row-removed"; exports.FILTER_ROW_CLASS = "filter-row"; const isRenovatedScrollable = !!_ui.default.IS_RENOVATED_WIDGET; exports.EDIT_FORM_ITEM_CLASS = "edit-form-item"; exports.EDIT_POPUP_CLASS = "edit-popup"; exports.EDIT_POPUP_FORM_CLASS = "edit-popup-form"; exports.FOCUSABLE_ELEMENT_CLASS = isRenovatedScrollable ? "dx-scrollable" : "dx-scrollable-container"; exports.BUTTON_CLASS = "dx-button"; exports.FORM_BUTTONS_CONTAINER_CLASS = "form-buttons-container"; exports.EDIT_ROW = "dx-edit-row" }, 22324: /*!*********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/editing/m_editing.js ***! \*********************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.editingModule = exports.dataControllerEditingExtenderMixin = void 0; var _devices = _interopRequireDefault(__webpack_require__( /*! ../../../../core/devices */ 20530)); var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../../core/dom_adapter */ 73349)); var _guid = _interopRequireDefault(__webpack_require__( /*! ../../../../core/guid */ 73176)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _dom = __webpack_require__( /*! ../../../../core/utils/dom */ 3532); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var iconUtils = function(e, r) { if (!r && e && e.__esModule) { return e } if (null === e || "object" != typeof e && "function" != typeof e) { return { default: e } } var t = _getRequireWildcardCache(r); if (t && t.has(e)) { return t.get(e) } var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u] } } return n.default = e, t && t.set(e, n), n }(__webpack_require__( /*! ../../../../core/utils/icon */ 44899)); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _object = __webpack_require__( /*! ../../../../core/utils/object */ 48013); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _array_utils = __webpack_require__( /*! ../../../../data/array_utils */ 60637); var _click = __webpack_require__( /*! ../../../../events/click */ 95429); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../../events/core/events_engine */ 55994)); var _pointer = _interopRequireDefault(__webpack_require__( /*! ../../../../events/pointer */ 93786)); var _remove = __webpack_require__( /*! ../../../../events/remove */ 29007); var _index = __webpack_require__( /*! ../../../../events/utils/index */ 39611); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109)); var _dialog = __webpack_require__( /*! ../../../../ui/dialog */ 15029); var _themes = __webpack_require__( /*! ../../../../ui/themes */ 75811); var _m_modules = _interopRequireDefault(__webpack_require__( /*! ../m_modules */ 15943)); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../m_utils */ 60082)); var _const = __webpack_require__( /*! ./const */ 72313); var _m_editing_utils = __webpack_require__( /*! ./m_editing_utils */ 89237); function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) { return null } var r = new WeakMap, t = new WeakMap; return (_getRequireWildcardCache = function(e) { return e ? t : r })(e) } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } class EditingControllerImpl extends _m_modules.default.ViewController { init() { this._columnsController = this.getController("columns"); this._dataController = this.getController("data"); this._adaptiveColumnsController = this.getController("adaptiveColumns"); this._validatingController = this.getController("validating"); this._editorFactoryController = this.getController("editorFactory"); this._focusController = this.getController("focus"); this._keyboardNavigationController = this.getController("keyboardNavigation"); this._columnsResizerController = this.getController("columnsResizer"); this._errorHandlingController = this.getController("errorHandling"); this._rowsView = this.getView("rowsView"); this._headerPanelView = this.getView("headerPanel"); this._lastOperation = null; this._changes = []; if (this._deferreds) { this._deferreds.forEach((d => { d.reject("cancel") })) } this._deferreds = []; if (!this._dataChangedHandler) { this._dataChangedHandler = this._handleDataChanged.bind(this); this._dataController.changed.add(this._dataChangedHandler) } if (!this._saveEditorHandler) { this.createAction("onInitNewRow", { excludeValidators: ["disabled", "readOnly"] }); this.createAction("onRowInserting", { excludeValidators: ["disabled", "readOnly"] }); this.createAction("onRowInserted", { excludeValidators: ["disabled", "readOnly"] }); this.createAction("onEditingStart", { excludeValidators: ["disabled", "readOnly"] }); this.createAction("onRowUpdating", { excludeValidators: ["disabled", "readOnly"] }); this.createAction("onRowUpdated", { excludeValidators: ["disabled", "readOnly"] }); this.createAction("onRowRemoving", { excludeValidators: ["disabled", "readOnly"] }); this.createAction("onRowRemoved", { excludeValidators: ["disabled", "readOnly"] }); this.createAction("onSaved", { excludeValidators: ["disabled", "readOnly"] }); this.createAction("onSaving", { excludeValidators: ["disabled", "readOnly"] }); this.createAction("onEditCanceling", { excludeValidators: ["disabled", "readOnly"] }); this.createAction("onEditCanceled", { excludeValidators: ["disabled", "readOnly"] }) } this._updateEditColumn(); this._updateEditButtons(); if (!this._internalState) { this._internalState = [] } this.component._optionsByReference[_const.EDITING_EDITROWKEY_OPTION_NAME] = true; this.component._optionsByReference[_const.EDITING_CHANGES_OPTION_NAME] = true } getEditMode() { const editMode = this.option("editing.mode") ?? _const.EDIT_MODE_ROW; if (_const.EDIT_MODES.includes(editMode)) { return editMode } return _const.EDIT_MODE_ROW } isCellBasedEditMode() { const editMode = this.getEditMode(); return _const.CELL_BASED_MODES.includes(editMode) } _getDefaultEditorTemplate() { return (container, options) => { const $editor = (0, _renderer.default)("
").appendTo(container); const editorOptions = (0, _extend.extend)({}, options.column, { value: options.value, setValue: options.setValue, row: options.row, parentType: "dataRow", width: null, readOnly: !options.setValue, isOnForm: options.isOnForm, id: options.id }); const needLabel = _const.REQUIRED_EDITOR_LABELLEDBY_MODES.includes(this.getEditMode()); if (needLabel) { editorOptions["aria-labelledby"] = options.column.headerId } this._editorFactoryController.createEditor($editor, editorOptions) } } _getNewRowPosition() { const newRowPosition = this.option("editing.newRowPosition"); const scrollingMode = this.option("scrolling.mode"); if ("virtual" === scrollingMode) { switch (newRowPosition) { case _const.PAGE_TOP_NEW_ROW_POSITION: return _const.VIEWPORT_TOP_NEW_ROW_POSITION; case _const.PAGE_BOTTOM_NEW_ROW_POSITION: return _const.VIEWPORT_BOTTOM_NEW_ROW_POSITION; default: return newRowPosition } } return newRowPosition } getChanges() { return this.option(_const.EDITING_CHANGES_OPTION_NAME) } getInsertRowCount() { const changes = this.option(_const.EDITING_CHANGES_OPTION_NAME); return changes.filter((change => "insert" === change.type)).length } resetChanges() { const changes = this.getChanges(); const needReset = null === changes || void 0 === changes ? void 0 : changes.length; if (needReset) { this._silentOption(_const.EDITING_CHANGES_OPTION_NAME, []) } } _getInternalData(key) { return this._internalState.filter((item => (0, _common.equalByValue)(item.key, key)))[0] } _addInternalData(params) { const internalData = this._getInternalData(params.key); if (internalData) { return (0, _extend.extend)(internalData, params) } this._internalState.push(params); return params } _getOldData(key) { var _this$_getInternalDat; return null === (_this$_getInternalDat = this._getInternalData(key)) || void 0 === _this$_getInternalDat ? void 0 : _this$_getInternalDat.oldData } getUpdatedData(data) { const key = this._dataController.keyOf(data); const changes = this.getChanges(); const editIndex = _m_utils.default.getIndexByKey(key, changes); if (changes[editIndex]) { return (0, _array_utils.createObjectWithChanges)(data, changes[editIndex].data) } return data } getInsertedData() { return this.getChanges().filter((change => change.data && change.type === _const.DATA_EDIT_DATA_INSERT_TYPE)).map((change => change.data)) } getRemovedData() { return this.getChanges().filter((change => this._getOldData(change.key) && change.type === _const.DATA_EDIT_DATA_REMOVE_TYPE)).map((change => this._getOldData(change.key))) } _fireDataErrorOccurred(arg) { if ("cancel" === arg) { return } const $popupContent = this.getPopupContent(); this._dataController.dataErrorOccurred.fire(arg, $popupContent) } _needToCloseEditableCell($targetElement) {} _closeEditItem($targetElement) {} _handleDataChanged(args) {} _isDefaultButtonVisible(button, options) { let result = true; switch (button.name) { case "delete": result = this.allowDeleting(options); break; case "undelete": result = false } return result } isPopupEditMode() { const editMode = this.option("editing.mode"); return editMode === _const.EDIT_MODE_POPUP } _isButtonVisible(button, options) { const { visible: visible } = button; if (!(0, _type.isDefined)(visible)) { return this._isDefaultButtonVisible(button, options) } return (0, _type.isFunction)(visible) ? visible.call(button, { component: options.component, row: options.row, column: options.column }) : visible } _isButtonDisabled(button, options) { const { disabled: disabled } = button; return (0, _type.isFunction)(disabled) ? disabled.call(button, { component: options.component, row: options.row, column: options.column }) : !!disabled } _getButtonConfig(button, options) { const config = (0, _type.isObject)(button) ? button : {}; const buttonName = (0, _m_editing_utils.getButtonName)(button); const editingTexts = (0, _m_editing_utils.getEditingTexts)(options); const methodName = _const.METHOD_NAMES[buttonName]; const editingOptions = this.option("editing"); const actionName = _const.ACTION_OPTION_NAMES[buttonName]; const allowAction = actionName ? editingOptions[actionName] : true; return (0, _extend.extend)({ name: buttonName, text: editingTexts[buttonName], cssClass: _const.EDIT_LINK_CLASS[buttonName] }, { onClick: methodName && (e => { const { event: event } = e; event.stopPropagation(); event.preventDefault(); setTimeout((() => { options.row && allowAction && this[methodName] && this[methodName](options.row.rowIndex) })) }) }, config) } _getEditingButtons(options) { let buttonIndex; const haveCustomButtons = !!options.column.buttons; let buttons = (options.column.buttons || []).slice(); if (haveCustomButtons) { buttonIndex = (0, _m_editing_utils.getButtonIndex)(buttons, "edit"); if (buttonIndex >= 0) { if ((0, _m_editing_utils.getButtonIndex)(buttons, "save") < 0) { buttons.splice(buttonIndex + 1, 0, "save") } if ((0, _m_editing_utils.getButtonIndex)(buttons, "cancel") < 0) { buttons.splice((0, _m_editing_utils.getButtonIndex)(buttons, "save") + 1, 0, "cancel") } } buttonIndex = (0, _m_editing_utils.getButtonIndex)(buttons, "delete"); if (buttonIndex >= 0 && (0, _m_editing_utils.getButtonIndex)(buttons, "undelete") < 0) { buttons.splice(buttonIndex + 1, 0, "undelete") } } else { buttons = _const.BUTTON_NAMES.slice() } return buttons.map((button => this._getButtonConfig(button, options))) } _renderEditingButtons($container, buttons, options, change) { buttons.forEach((button => { if (this._isButtonVisible(button, options)) { this._createButton($container, button, options, change) } })) } _getEditCommandCellTemplate() { return (container, options, change) => { const $container = (0, _renderer.default)(container); if ("data" === options.rowType) { const buttons = this._getEditingButtons(options); this._renderEditingButtons($container, buttons, options, change); if (options.watch) { const dispose = options.watch((() => buttons.map((button => ({ visible: this._isButtonVisible(button, options), disabled: this._isButtonDisabled(button, options) })))), (() => { $container.empty(); this._renderEditingButtons($container, buttons, options) })); _events_engine.default.on($container, _remove.removeEvent, dispose) } } else { _m_utils.default.setEmptyText($container) } } } isRowBasedEditMode() { const editMode = this.getEditMode(); return _const.ROW_BASED_MODES.includes(editMode) } getFirstEditableColumnIndex() { let columnIndex; const visibleColumns = this._columnsController.getVisibleColumns(); (0, _iterator.each)(visibleColumns, ((index, column) => { if (column.allowEditing) { columnIndex = index; return false } })); return columnIndex } getFirstEditableCellInRow(rowIndex) { var _this$_rowsView; const columnIndex = this.getFirstEditableColumnIndex(); return null === (_this$_rowsView = this._rowsView) || void 0 === _this$_rowsView ? void 0 : _this$_rowsView._getCellElement(rowIndex || 0, columnIndex) } getFocusedCellInRow(rowIndex) { return this.getFirstEditableCellInRow(rowIndex) } getIndexByKey(key, items) { return _m_utils.default.getIndexByKey(key, items) } hasChanges(rowIndex) { const changes = this.getChanges(); let result = false; for (let i = 0; i < (null === changes || void 0 === changes ? void 0 : changes.length); i++) { if (changes[i].type && (!(0, _type.isDefined)(rowIndex) || this._dataController.getRowIndexByKey(changes[i].key) === rowIndex)) { result = true; break } } return result } dispose() { super.dispose(); clearTimeout(this._inputFocusTimeoutID); _events_engine.default.off(_dom_adapter.default.getDocument(), _pointer.default.up, this._pointerUpEditorHandler); _events_engine.default.off(_dom_adapter.default.getDocument(), _pointer.default.down, this._pointerDownEditorHandler); _events_engine.default.off(_dom_adapter.default.getDocument(), _click.name, this._saveEditorHandler) } _silentOption(name, value) { if ("editing.changes" === name) { this._changes = (0, _object.deepExtendArraySafe)([], value) } super._silentOption(name, value) } optionChanged(args) { if ("editing" === args.name) { const { fullName: fullName } = args; if (fullName === _const.EDITING_EDITROWKEY_OPTION_NAME) { this._handleEditRowKeyChange(args) } else if (fullName === _const.EDITING_CHANGES_OPTION_NAME) { const isEqual = (0, _common.equalByValue)(args.value, this._changes, { maxDepth: 4 }); if (!isEqual) { this._changes = (0, _object.deepExtendArraySafe)([], args.value); this._handleChangesChange(args) } } else if (!args.handled) { this._columnsController.reinit(); this.init(); this.resetChanges(); this._resetEditColumnName(); this._resetEditRowKey() } args.handled = true } else { super.optionChanged(args) } } _handleEditRowKeyChange(args) { const rowIndex = this._dataController.getRowIndexByKey(args.value); const oldRowIndexCorrection = this._getEditRowIndexCorrection(); const oldRowIndex = this._dataController.getRowIndexByKey(args.previousValue) + oldRowIndexCorrection; if ((0, _type.isDefined)(args.value)) { if (args.value !== args.previousValue) { this._editRowFromOptionChanged(rowIndex, oldRowIndex) } } else { this.cancelEditData() } } _handleChangesChange(args) { const dataController = this._dataController; const changes = args.value; if (!args.value.length && !args.previousValue.length) { return } changes.forEach((change => { if ("insert" === change.type) { this._addInsertInfo(change) } else { var _dataController$items; const items = dataController.getCachedStoreData() || (null === (_dataController$items = dataController.items()) || void 0 === _dataController$items ? void 0 : _dataController$items.map((item => item.data))); const rowIndex = _m_utils.default.getIndexByKey(change.key, items, dataController.key()); this._addInternalData({ key: change.key, oldData: items[rowIndex] }) } })); dataController.updateItems({ repaintChangesOnly: true, isLiveUpdate: false, isOptionChanged: true }) } publicMethods() { return ["addRow", "deleteRow", "undeleteRow", "editRow", "saveEditData", "cancelEditData", "hasEditData"] } refresh() { if (!(0, _type.isDefined)(this._pageIndex)) { return } this._refreshCore.apply(this, arguments) } _refreshCore(params) {} isEditing() { const isEditRowKeyDefined = (0, _type.isDefined)(this.option(_const.EDITING_EDITROWKEY_OPTION_NAME)); return isEditRowKeyDefined } isEditRow(rowIndex) { return false } _setEditRowKey(value, silent) { if (silent) { this._silentOption(_const.EDITING_EDITROWKEY_OPTION_NAME, value) } else { this.option(_const.EDITING_EDITROWKEY_OPTION_NAME, value) } if (this._refocusEditCell) { this._refocusEditCell = false; this._focusEditingCell() } } _setEditRowKeyByIndex(rowIndex, silent) { const key = this._dataController.getKeyByRowIndex(rowIndex); if (void 0 === key) { this._dataController.fireError("E1043"); return } this._setEditRowKey(key, silent) } getEditRowIndex() { return this._getVisibleEditRowIndex() } getEditFormRowIndex() { return -1 } isEditRowByIndex(rowIndex) { const key = this._dataController.getKeyByRowIndex(rowIndex); const isKeyEqual = (0, _type.isDefined)(key) && (0, _common.equalByValue)(this.option(_const.EDITING_EDITROWKEY_OPTION_NAME), key); if (isKeyEqual) { return this._getVisibleEditRowIndex() === rowIndex } return isKeyEqual } isEditCell(visibleRowIndex, columnIndex) { return this.isEditRowByIndex(visibleRowIndex) && this._getVisibleEditColumnIndex() === columnIndex } getPopupContent() {} _isProcessedItem(item) { return false } _getInsertRowIndex(items, change, isProcessedItems) { let result = -1; const dataController = this._dataController; const key = this._getInsertAfterOrBeforeKey(change); if (!(0, _type.isDefined)(key) && 0 === items.length) { result = 0 } else if ((0, _type.isDefined)(key)) { items.some(((item, index) => { const isProcessedItem = isProcessedItems || this._isProcessedItem(item); if ((0, _type.isObject)(item)) { if (isProcessedItem || (0, _type.isDefined)(item[_const.INSERT_INDEX])) { if ((0, _common.equalByValue)(item.key, key)) { result = index } } else if ((0, _common.equalByValue)(dataController.keyOf(item), key)) { result = index } } if (result >= 0) { const nextItem = items[result + 1]; if (nextItem && ("detail" === nextItem.rowType || "detailAdaptive" === nextItem.rowType) && (0, _type.isDefined)(change.insertAfterKey)) { return } if ((0, _type.isDefined)(change.insertAfterKey)) { result += 1 } return true } })) } return result } _generateNewItem(key) { var _this$_getInternalDat2; const item = { key: key }; const insertInfo = null === (_this$_getInternalDat2 = this._getInternalData(key)) || void 0 === _this$_getInternalDat2 ? void 0 : _this$_getInternalDat2.insertInfo; if (null !== insertInfo && void 0 !== insertInfo && insertInfo[_const.INSERT_INDEX]) { item[_const.INSERT_INDEX] = insertInfo[_const.INSERT_INDEX] } return item } _getLoadedRowIndex(items, change, isProcessedItems) { let loadedRowIndex = this._getInsertRowIndex(items, change, isProcessedItems); const dataController = this._dataController; if (loadedRowIndex < 0) { const newRowPosition = this._getNewRowPosition(); const pageIndex = dataController.pageIndex(); const insertAfterOrBeforeKey = this._getInsertAfterOrBeforeKey(change); if (newRowPosition !== _const.LAST_NEW_ROW_POSITION && 0 === pageIndex && !(0, _type.isDefined)(insertAfterOrBeforeKey)) { loadedRowIndex = 0 } else if (newRowPosition === _const.LAST_NEW_ROW_POSITION && dataController.isLastPageLoaded()) { loadedRowIndex = items.length } } return loadedRowIndex } processItems(items, e) { const { changeType: changeType } = e; this.update(changeType); const changes = this.getChanges(); changes.forEach((change => { var _this$_getInternalDat3; const isInsert = change.type === _const.DATA_EDIT_DATA_INSERT_TYPE; if (!isInsert) { return } let { key: key } = change; let insertInfo = null === (_this$_getInternalDat3 = this._getInternalData(key)) || void 0 === _this$_getInternalDat3 ? void 0 : _this$_getInternalDat3.insertInfo; if (!(0, _type.isDefined)(key) || !(0, _type.isDefined)(insertInfo)) { insertInfo = this._addInsertInfo(change); key = insertInfo.key } const loadedRowIndex = this._getLoadedRowIndex(items, change); const item = this._generateNewItem(key); if (loadedRowIndex >= 0) { items.splice(loadedRowIndex, 0, item) } })); return items } processDataItem(item, options, generateDataValues) { const columns = options.visibleColumns; const key = item.data[_const.INSERT_INDEX] ? item.data.key : item.key; const changes = this.getChanges(); const editIndex = _m_utils.default.getIndexByKey(key, changes); item.isEditing = false; if (editIndex >= 0) { this._processDataItemCore(item, changes[editIndex], key, columns, generateDataValues) } } _processDataItemCore(item, change, key, columns, generateDataValues) { const { data: data, type: type } = change; switch (type) { case _const.DATA_EDIT_DATA_INSERT_TYPE: item.isNewRow = true; item.key = key; item.data = data; break; case _const.DATA_EDIT_DATA_UPDATE_TYPE: item.modified = true; item.oldData = item.data; item.data = (0, _array_utils.createObjectWithChanges)(item.data, data); item.modifiedValues = generateDataValues(data, columns, true); break; case _const.DATA_EDIT_DATA_REMOVE_TYPE: item.removed = true } } _initNewRow(options) { this.executeAction("onInitNewRow", options); if (options.promise) { const deferred = new _deferred.Deferred; (0, _deferred.when)((0, _deferred.fromPromise)(options.promise)).done(deferred.resolve).fail((0, _m_editing_utils.createFailureHandler)(deferred)).fail((arg => this._fireDataErrorOccurred(arg))); return deferred } } _createInsertInfo() { const insertInfo = {}; insertInfo[_const.INSERT_INDEX] = this._getInsertIndex(); return insertInfo } _addInsertInfo(change, parentKey) { var _this$_getInternalDat4; let insertInfo; change.key = this.getChangeKeyValue(change); const { key: key } = change; insertInfo = null === (_this$_getInternalDat4 = this._getInternalData(key)) || void 0 === _this$_getInternalDat4 ? void 0 : _this$_getInternalDat4.insertInfo; if (!(0, _type.isDefined)(insertInfo)) { const insertAfterOrBeforeKey = this._getInsertAfterOrBeforeKey(change); insertInfo = this._createInsertInfo(); if (!(0, _type.isDefined)(insertAfterOrBeforeKey)) { this._setInsertAfterOrBeforeKey(change, parentKey) } } this._addInternalData({ insertInfo: insertInfo, key: key }); return { insertInfo: insertInfo, key: key } } getChangeKeyValue(change) { if ((0, _type.isDefined)(change.key)) { return change.key } const keyExpr = this._dataController.key(); let keyValue; if (change.data && keyExpr && !Array.isArray(keyExpr)) { keyValue = change.data[keyExpr] } if (!(0, _type.isDefined)(keyValue)) { keyValue = (0, _m_editing_utils.generateNewRowTempKey)() } return keyValue } _setInsertAfterOrBeforeKey(change, parentKey) { const rowsView = this.getView("rowsView"); const dataController = this._dataController; const allItems = dataController.items(true); const newRowPosition = this._getNewRowPosition(); switch (newRowPosition) { case _const.FIRST_NEW_ROW_POSITION: case _const.LAST_NEW_ROW_POSITION: break; case _const.PAGE_TOP_NEW_ROW_POSITION: case _const.PAGE_BOTTOM_NEW_ROW_POSITION: if (allItems.length) { const itemIndex = newRowPosition === _const.PAGE_TOP_NEW_ROW_POSITION ? 0 : allItems.length - 1; change[0 === itemIndex ? "insertBeforeKey" : "insertAfterKey"] = allItems[itemIndex].key } break; default: { const isViewportBottom = newRowPosition === _const.VIEWPORT_BOTTOM_NEW_ROW_POSITION; let visibleItemIndex = isViewportBottom ? null === rowsView || void 0 === rowsView ? void 0 : rowsView.getBottomVisibleItemIndex() : null === rowsView || void 0 === rowsView ? void 0 : rowsView.getTopVisibleItemIndex(); const row = dataController.getVisibleRows()[visibleItemIndex]; if (row && (!row.isEditing && "detail" === row.rowType || "detailAdaptive" === row.rowType)) { visibleItemIndex++ } const insertKey = dataController.getKeyByRowIndex(visibleItemIndex); if ((0, _type.isDefined)(insertKey)) { change.insertBeforeKey = insertKey } } } } _getInsertIndex() { let maxInsertIndex = 0; this.getChanges().forEach((editItem => { var _this$_getInternalDat5; const insertInfo = null === (_this$_getInternalDat5 = this._getInternalData(editItem.key)) || void 0 === _this$_getInternalDat5 ? void 0 : _this$_getInternalDat5.insertInfo; if ((0, _type.isDefined)(insertInfo) && editItem.type === _const.DATA_EDIT_DATA_INSERT_TYPE && insertInfo[_const.INSERT_INDEX] > maxInsertIndex) { maxInsertIndex = insertInfo[_const.INSERT_INDEX] } })); return maxInsertIndex + 1 } _getInsertAfterOrBeforeKey(insertChange) { return insertChange.insertAfterKey ?? insertChange.insertBeforeKey } _getPageIndexToInsertRow() { const newRowPosition = this._getNewRowPosition(); const dataController = this._dataController; const pageIndex = dataController.pageIndex(); const lastPageIndex = dataController.pageCount() - 1; if (newRowPosition === _const.FIRST_NEW_ROW_POSITION && 0 !== pageIndex) { return 0 } if (newRowPosition === _const.LAST_NEW_ROW_POSITION && pageIndex !== lastPageIndex) { return lastPageIndex } return -1 } addRow(parentKey) { const dataController = this._dataController; const store = dataController.store(); if (!store) { dataController.fireError("E1052", this.component.NAME); return (new _deferred.Deferred).reject() } return this._addRow(parentKey) } _addRow(parentKey) { const dataController = this._dataController; const store = dataController.store(); const key = store && store.key(); const param = { data: {} }; const oldEditRowIndex = this._getVisibleEditRowIndex(); const deferred = new _deferred.Deferred; this.refresh({ allowCancelEditing: true }); if (!this._allowRowAdding()) { (0, _deferred.when)(this._navigateToNewRow(oldEditRowIndex)).done(deferred.resolve).fail(deferred.reject); return deferred.promise() } if (!key) { param.data.__KEY__ = String(new _guid.default) }(0, _deferred.when)(this._initNewRow(param, parentKey)).done((() => { if (this._allowRowAdding()) { (0, _deferred.when)(this._addRowCore(param.data, parentKey, oldEditRowIndex)).done(deferred.resolve).fail(deferred.reject) } else { deferred.reject("cancel") } })).fail(deferred.reject); return deferred.promise() } _allowRowAdding(params) { const insertIndex = this._getInsertIndex(); if (insertIndex > 1) { return false } return true } _addRowCore(data, parentKey, initialOldEditRowIndex) { const change = { data: data, type: _const.DATA_EDIT_DATA_INSERT_TYPE }; const editRowIndex = this._getVisibleEditRowIndex(); const insertInfo = this._addInsertInfo(change, parentKey); const { key: key } = insertInfo; this._setEditRowKey(key, true); this._addChange(change); return this._navigateToNewRow(initialOldEditRowIndex, change, editRowIndex) } _navigateToNewRow(oldEditRowIndex, change, editRowIndex) { const d = new _deferred.Deferred; const dataController = this._dataController; editRowIndex = editRowIndex ?? -1; change = change ?? this.getChanges().filter((c => c.type === _const.DATA_EDIT_DATA_INSERT_TYPE))[0]; if (!change) { return d.reject("cancel").promise() } const pageIndexToInsertRow = this._getPageIndexToInsertRow(); let rowIndex = this._getLoadedRowIndex(dataController.items(), change, true); const navigateToRowByKey = key => { var _this$_focusControlle; (0, _deferred.when)(null === (_this$_focusControlle = this._focusController) || void 0 === _this$_focusControlle ? void 0 : _this$_focusControlle.navigateToRow(key)).done((() => { rowIndex = dataController.getRowIndexByKey(change.key); d.resolve() })) }; const insertAfterOrBeforeKey = this._getInsertAfterOrBeforeKey(change); if (pageIndexToInsertRow >= 0) { dataController.pageIndex(pageIndexToInsertRow).done((() => { navigateToRowByKey(change.key) })).fail(d.reject) } else if (rowIndex < 0 && (0, _type.isDefined)(insertAfterOrBeforeKey)) { navigateToRowByKey(insertAfterOrBeforeKey) } else { dataController.updateItems({ changeType: "update", rowIndices: [oldEditRowIndex, editRowIndex, rowIndex] }); rowIndex = dataController.getRowIndexByKey(change.key); if (rowIndex < 0) { navigateToRowByKey(change.key) } else { d.resolve() } } d.done((() => { var _this$_rowsView2; null === (_this$_rowsView2 = this._rowsView) || void 0 === _this$_rowsView2 || _this$_rowsView2.waitAsyncTemplates(true).done((() => { this._showAddedRow(rowIndex); this._afterInsertRow(change.key) })) })); return d.promise() } _showAddedRow(rowIndex) { this._focusFirstEditableCellInRow(rowIndex) } _beforeFocusElementInRow(rowIndex) {} _focusFirstEditableCellInRow(rowIndex) { var _this$_keyboardNaviga; const dataController = this._dataController; const key = dataController.getKeyByRowIndex(rowIndex); const $firstCell = this.getFirstEditableCellInRow(rowIndex); null === (_this$_keyboardNaviga = this._keyboardNavigationController) || void 0 === _this$_keyboardNaviga || _this$_keyboardNaviga.focus($firstCell); this.option("focusedRowKey", key); this._editCellInProgress = true; this._delayedInputFocus($firstCell, (() => { rowIndex = dataController.getRowIndexByKey(key); this._editCellInProgress = false; this._beforeFocusElementInRow(rowIndex) })) } _isEditingStart(options) { this.executeAction("onEditingStart", options); return options.cancel } _beforeUpdateItems(rowIndices, rowIndex) {} _getVisibleEditColumnIndex() { const editColumnName = this.option(_const.EDITING_EDITCOLUMNNAME_OPTION_NAME); if (!(0, _type.isDefined)(editColumnName)) { return -1 } return this._columnsController.getVisibleColumnIndex(editColumnName) } _setEditColumnNameByIndex(index, silent) { var _visibleColumns$index; const visibleColumns = this._columnsController.getVisibleColumns(); this._setEditColumnName(null === (_visibleColumns$index = visibleColumns[index]) || void 0 === _visibleColumns$index ? void 0 : _visibleColumns$index.name, silent) } _setEditColumnName(name, silent) { if (silent) { this._silentOption(_const.EDITING_EDITCOLUMNNAME_OPTION_NAME, name) } else { this.option(_const.EDITING_EDITCOLUMNNAME_OPTION_NAME, name) } } _resetEditColumnName() { this._setEditColumnName(null, true) } _getEditColumn() { const editColumnName = this.option(_const.EDITING_EDITCOLUMNNAME_OPTION_NAME); return this._getColumnByName(editColumnName) } _getColumnByName(name) { const visibleColumns = this._columnsController.getVisibleColumns(); let editColumn; (0, _type.isDefined)(name) && visibleColumns.some((column => { if (column.name === name) { editColumn = column; return true } })); return editColumn } _getVisibleEditRowIndex(columnName) { const dataController = this._dataController; const editRowKey = this.option(_const.EDITING_EDITROWKEY_OPTION_NAME); const rowIndex = dataController.getRowIndexByKey(editRowKey); if (-1 === rowIndex) { return rowIndex } return rowIndex + this._getEditRowIndexCorrection(columnName) } _getEditRowIndexCorrection(columnName) { const editColumn = columnName ? this._getColumnByName(columnName) : this._getEditColumn(); const isColumnHidden = "adaptiveHidden" === (null === editColumn || void 0 === editColumn ? void 0 : editColumn.visibleWidth); return isColumnHidden ? 1 : 0 } _resetEditRowKey() { this._refocusEditCell = false; this._setEditRowKey(null, true) } _resetEditIndices() { this._resetEditColumnName(); this._resetEditRowKey() } editRow(rowIndex) { const dataController = this._dataController; const items = dataController.items(); const item = items[rowIndex]; const params = { data: item && item.data, cancel: false }; const oldRowIndex = this._getVisibleEditRowIndex(); if (!item) { return } if (rowIndex === oldRowIndex) { return true } if (void 0 === item.key) { this._dataController.fireError("E1043"); return } if (!item.isNewRow) { params.key = item.key } if (this._isEditingStart(params)) { return } this.resetChanges(); this.init(); this._resetEditColumnName(); this._pageIndex = dataController.pageIndex(); this._addInternalData({ key: item.key, oldData: item.oldData ?? item.data }); this._setEditRowKey(item.key) } _editRowFromOptionChanged(rowIndex, oldRowIndex) { const rowIndices = [oldRowIndex, rowIndex]; this._beforeUpdateItems(rowIndices, rowIndex, oldRowIndex); this._editRowFromOptionChangedCore(rowIndices, rowIndex) } _editRowFromOptionChangedCore(rowIndices, rowIndex, preventRendering) { this._needFocusEditor = true; this._dataController.updateItems({ changeType: "update", rowIndices: rowIndices, cancel: preventRendering }) } _focusEditorIfNeed() {} _showEditPopup(rowIndex, repaintForm) {} _repaintEditPopup() {} _getEditPopupHiddenHandler() { return e => { if (this.isEditing()) { this.cancelEditData() } } } _getPopupEditFormTemplate(rowIndex) {} _getSaveButtonConfig() { const buttonConfig = { text: this.option("editing.texts.saveRowChanges"), onClick: this.saveEditData.bind(this) }; if ((0, _themes.isFluent)((0, _themes.current)())) { buttonConfig.stylingMode = "contained"; buttonConfig.type = "default" } return buttonConfig } _getCancelButtonConfig() { const buttonConfig = { text: this.option("editing.texts.cancelRowChanges"), onClick: this.cancelEditData.bind(this) }; if ((0, _themes.isFluent)((0, _themes.current)())) { buttonConfig.stylingMode = "outlined" } return buttonConfig } _removeInternalData(key) { const internalData = this._getInternalData(key); const index = this._internalState.indexOf(internalData); if (index > -1) { this._internalState.splice(index, 1) } } _updateInsertAfterOrBeforeKeys(changes, index) { const removeChange = changes[index]; changes.forEach((change => { const insertAfterOrBeforeKey = this._getInsertAfterOrBeforeKey(change); if ((0, _common.equalByValue)(insertAfterOrBeforeKey, removeChange.key)) { change[(0, _type.isDefined)(change.insertAfterKey) ? "insertAfterKey" : "insertBeforeKey"] = this._getInsertAfterOrBeforeKey(removeChange) } })) } _removeChange(index) { if (index >= 0) { const changes = [...this.getChanges()]; const { key: key } = changes[index]; this._removeInternalData(key); this._updateInsertAfterOrBeforeKeys(changes, index); changes.splice(index, 1); this._silentOption(_const.EDITING_CHANGES_OPTION_NAME, changes); if ((0, _common.equalByValue)(this.option(_const.EDITING_EDITROWKEY_OPTION_NAME), key)) { this._resetEditIndices() } } } executeOperation(deferred, func) { this._lastOperation && this._lastOperation.reject(); this._lastOperation = deferred; this.waitForDeferredOperations().done((() => { if ("rejected" === deferred.state()) { return } func(); this._lastOperation = null })).fail((() => { deferred.reject(); this._lastOperation = null })) } waitForDeferredOperations() { return (0, _deferred.when)(...this._deferreds) } _processCanceledEditingCell() {} _repaintEditCell(column, oldColumn, oldEditRowIndex) { if (!column || !column.showEditorAlways || oldColumn && !oldColumn.showEditorAlways) { this._editCellInProgress = true; this._needFocusEditor = true; this._editorFactoryController.loseFocus(); this._dataController.updateItems({ changeType: "update", rowIndices: [oldEditRowIndex, this._getVisibleEditRowIndex()] }) } else if (column !== oldColumn) { this._needFocusEditor = true; this._dataController.updateItems({ changeType: "update", rowIndices: [] }) } } _delayedInputFocus($cell, beforeFocusCallback, callBeforeFocusCallbackAlways) { const inputFocus = () => { if (beforeFocusCallback) { beforeFocusCallback() } if ($cell) { const $focusableElement = $cell.find(_const.FOCUSABLE_ELEMENT_SELECTOR).first(); _m_utils.default.focusAndSelectElement(this, $focusableElement) } this._beforeFocusCallback = null }; if (_devices.default.real().ios || _devices.default.real().android) { inputFocus() } else { if (this._beforeFocusCallback) { this._beforeFocusCallback() } clearTimeout(this._inputFocusTimeoutID); if (callBeforeFocusCallbackAlways) { this._beforeFocusCallback = beforeFocusCallback } this._inputFocusTimeoutID = setTimeout(inputFocus) } } _focusEditingCell(beforeFocusCallback, $editCell, callBeforeFocusCallbackAlways) { const editColumnIndex = this._getVisibleEditColumnIndex(); $editCell = $editCell || this._rowsView && this._rowsView._getCellElement(this._getVisibleEditRowIndex(), editColumnIndex); if ($editCell) { this._delayedInputFocus($editCell, beforeFocusCallback, callBeforeFocusCallbackAlways) } } deleteRow(rowIndex) { this._checkAndDeleteRow(rowIndex) } _checkAndDeleteRow(rowIndex) { const editingOptions = this.option("editing"); const editingTexts = null === editingOptions || void 0 === editingOptions ? void 0 : editingOptions.texts; const confirmDelete = null === editingOptions || void 0 === editingOptions ? void 0 : editingOptions.confirmDelete; const confirmDeleteMessage = null === editingTexts || void 0 === editingTexts ? void 0 : editingTexts.confirmDeleteMessage; const item = this._dataController.items()[rowIndex]; const allowDeleting = !this.isEditing() || item.isNewRow; if (item && allowDeleting) { if (!confirmDelete || !confirmDeleteMessage) { this._deleteRowCore(rowIndex) } else { const confirmDeleteTitle = editingTexts && editingTexts.confirmDeleteTitle; const showDialogTitle = (0, _type.isDefined)(confirmDeleteTitle) && confirmDeleteTitle.length > 0; (0, _dialog.confirm)(confirmDeleteMessage, confirmDeleteTitle, showDialogTitle).done((confirmResult => { if (confirmResult) { this._deleteRowCore(rowIndex) } })) } } } _deleteRowCore(rowIndex) { const dataController = this._dataController; const item = dataController.items()[rowIndex]; const key = item && item.key; const oldEditRowIndex = this._getVisibleEditRowIndex(); this.refresh(); const changes = this.getChanges(); const editIndex = _m_utils.default.getIndexByKey(key, changes); if (editIndex >= 0) { if (changes[editIndex].type === _const.DATA_EDIT_DATA_INSERT_TYPE) { this._removeChange(editIndex) } else { this._addChange({ key: key, type: _const.DATA_EDIT_DATA_REMOVE_TYPE }) } } else { this._addChange({ key: key, oldData: item.data, type: _const.DATA_EDIT_DATA_REMOVE_TYPE }) } return this._afterDeleteRow(rowIndex, oldEditRowIndex) } _afterDeleteRow(rowIndex, oldEditRowIndex) { return this.saveEditData() } undeleteRow(rowIndex) { const dataController = this._dataController; const item = dataController.items()[rowIndex]; const oldEditRowIndex = this._getVisibleEditRowIndex(); const key = item && item.key; const changes = this.getChanges(); if (item) { const editIndex = _m_utils.default.getIndexByKey(key, changes); if (editIndex >= 0) { const { data: data } = changes[editIndex]; if ((0, _type.isEmptyObject)(data)) { this._removeChange(editIndex) } else { this._addChange({ key: key, type: _const.DATA_EDIT_DATA_UPDATE_TYPE }) } dataController.updateItems({ changeType: "update", rowIndices: [oldEditRowIndex, rowIndex] }) } } } _fireOnSaving() { const onSavingParams = { cancel: false, promise: null, changes: [...this.getChanges()] }; this.executeAction("onSaving", onSavingParams); const d = new _deferred.Deferred; (0, _deferred.when)((0, _deferred.fromPromise)(onSavingParams.promise)).done((() => { d.resolve(onSavingParams) })).fail((arg => { (0, _m_editing_utils.createFailureHandler)(d); this._fireDataErrorOccurred(arg); d.resolve({ cancel: true }) })); return d } _executeEditingAction(actionName, params, func) { if (this.component._disposed) { return null } const deferred = new _deferred.Deferred; this.executeAction(actionName, params); (0, _deferred.when)((0, _deferred.fromPromise)(params.cancel)).done((cancel => { if (cancel) { setTimeout((() => { deferred.resolve("cancel") })) } else { func(params).done(deferred.resolve).fail((0, _m_editing_utils.createFailureHandler)(deferred)) } })).fail((0, _m_editing_utils.createFailureHandler)(deferred)); return deferred } _processChanges(deferreds, results, dataChanges, changes) { const store = this._dataController.store(); (0, _iterator.each)(changes, ((index, change) => { const oldData = this._getOldData(change.key); const { data: data, type: type } = change; const changeCopy = _extends({}, change); let deferred; let params; if (this._beforeSaveEditData(change, index)) { return } switch (type) { case _const.DATA_EDIT_DATA_REMOVE_TYPE: params = { data: oldData, key: change.key, cancel: false }; deferred = this._executeEditingAction("onRowRemoving", params, (() => store.remove(change.key).done((key => { dataChanges.push({ type: "remove", key: key }) })))); break; case _const.DATA_EDIT_DATA_INSERT_TYPE: params = { data: data, cancel: false }; deferred = this._executeEditingAction("onRowInserting", params, (() => store.insert(params.data).done(((data, key) => { if ((0, _type.isDefined)(key)) { changeCopy.key = key } if (data && (0, _type.isObject)(data) && data !== params.data) { changeCopy.data = data } dataChanges.push({ type: "insert", data: data, index: 0 }) })))); break; case _const.DATA_EDIT_DATA_UPDATE_TYPE: params = { newData: data, oldData: oldData, key: change.key, cancel: false }; deferred = this._executeEditingAction("onRowUpdating", params, (() => store.update(change.key, params.newData).done(((data, key) => { if (data && (0, _type.isObject)(data) && data !== params.newData) { changeCopy.data = data } dataChanges.push({ type: "update", key: key, data: data }) })))) } changes[index] = changeCopy; if (deferred) { const doneDeferred = new _deferred.Deferred; deferred.always((data => { results.push({ key: change.key, result: data }) })).always(doneDeferred.resolve); deferreds.push(doneDeferred.promise()) } })) } _processRemoveIfError(changes, editIndex) { const change = changes[editIndex]; if ((null === change || void 0 === change ? void 0 : change.type) === _const.DATA_EDIT_DATA_REMOVE_TYPE) { if (editIndex >= 0) { changes.splice(editIndex, 1) } } return true } _processRemove(changes, editIndex, cancel) { const change = changes[editIndex]; if (!cancel || !change || change.type === _const.DATA_EDIT_DATA_REMOVE_TYPE) { return this._processRemoveCore(changes, editIndex, !cancel || !change) } } _processRemoveCore(changes, editIndex, processIfBatch) { if (editIndex >= 0) { changes.splice(editIndex, 1) } return true } _processSaveEditDataResult(results) { let hasSavedData = false; const changes = [...this.getChanges()]; const changesLength = changes.length; for (let i = 0; i < results.length; i++) { const arg = results[i].result; const cancel = "cancel" === arg; const editIndex = _m_utils.default.getIndexByKey(results[i].key, changes); const change = changes[editIndex]; const isError = arg && arg instanceof Error; if (isError) { if (change) { this._addInternalData({ key: change.key, error: arg }) } this._fireDataErrorOccurred(arg); if (this._processRemoveIfError(changes, editIndex)) { break } } else if (this._processRemove(changes, editIndex, cancel)) { hasSavedData = !cancel } } if (changes.length < changesLength) { this._silentOption(_const.EDITING_CHANGES_OPTION_NAME, changes) } return hasSavedData } _fireSaveEditDataEvents(changes) { (0, _iterator.each)(changes, ((_, _ref) => { let { data: data, key: key, type: type } = _ref; const internalData = this._addInternalData({ key: key }); const params = { key: key, data: data }; if (internalData.error) { params.error = internalData.error } switch (type) { case _const.DATA_EDIT_DATA_REMOVE_TYPE: this.executeAction("onRowRemoved", (0, _extend.extend)({}, params, { data: internalData.oldData })); break; case _const.DATA_EDIT_DATA_INSERT_TYPE: this.executeAction("onRowInserted", params); break; case _const.DATA_EDIT_DATA_UPDATE_TYPE: this.executeAction("onRowUpdated", params) } })); this.executeAction("onSaved", { changes: changes }) } saveEditData() { const deferred = new _deferred.Deferred; this.waitForDeferredOperations().done((() => { if (this.isSaving()) { this._resolveAfterSave(deferred); return }(0, _deferred.when)(this._beforeSaveEditData()).done((cancel => { if (cancel) { this._resolveAfterSave(deferred, { cancel: cancel }); return } this._saving = true; this._saveEditDataInner().always((() => { this._saving = false; if (this._refocusEditCell) { this._focusEditingCell() } })).done(deferred.resolve).fail(deferred.reject) })).fail(deferred.reject) })).fail(deferred.reject); return deferred.promise() } _resolveAfterSave(deferred) { let { cancel: cancel, error: error } = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; (0, _deferred.when)(this._afterSaveEditData(cancel)).done((() => { deferred.resolve(error) })).fail(deferred.reject) } _saveEditDataInner() { const result = new _deferred.Deferred; const results = []; const deferreds = []; const dataChanges = []; const dataSource = this._dataController.dataSource(); (0, _deferred.when)(this._fireOnSaving()).done((_ref2 => { let { cancel: cancel, changes: changes } = _ref2; if (cancel) { return result.resolve().promise() } this._processChanges(deferreds, results, dataChanges, changes); if (deferreds.length) { this._refocusEditCell = true; null === dataSource || void 0 === dataSource || dataSource.beginLoading(); (0, _deferred.when)(...deferreds).done((() => { if (this._processSaveEditDataResult(results)) { this._endSaving(dataChanges, changes, result) } else { null === dataSource || void 0 === dataSource || dataSource.endLoading(); result.resolve() } })).fail((error => { null === dataSource || void 0 === dataSource || dataSource.endLoading(); result.resolve(error) })); return result.always((() => { this._refocusEditCell = true })).promise() } this._cancelSaving(result) })).fail(result.reject); return result.promise() } _beforeEndSaving(changes) { this._resetEditIndices() } _endSaving(dataChanges, changes, deferred) { const dataSource = this._dataController.dataSource(); this._beforeEndSaving(changes); null === dataSource || void 0 === dataSource || dataSource.endLoading(); this._refreshDataAfterSave(dataChanges, changes, deferred) } _cancelSaving(result) { this.executeAction("onSaved", { changes: [] }); this._resolveAfterSave(result) } _refreshDataAfterSave(dataChanges, changes, deferred) { const dataController = this._dataController; const refreshMode = this.option("editing.refreshMode"); const isFullRefresh = "reshape" !== refreshMode && "repaint" !== refreshMode; if (!isFullRefresh) { dataController.push(dataChanges) }(0, _deferred.when)(dataController.refresh({ selection: isFullRefresh, reload: isFullRefresh, load: "reshape" === refreshMode, changesOnly: this.option("repaintChangesOnly") })).always((() => { this._fireSaveEditDataEvents(changes) })).done((() => { this._resolveAfterSave(deferred) })).fail((error => { this._resolveAfterSave(deferred, { error: error }) })) } isSaving() { return this._saving } _updateEditColumn() { const isEditColumnVisible = this._isEditColumnVisible(); const useIcons = this.option("editing.useIcons"); const cssClass = _const.COMMAND_EDIT_CLASS + (useIcons ? ` ${_const.COMMAND_EDIT_WITH_ICONS_CLASS}` : ""); this._columnsController.addCommandColumn({ type: "buttons", command: "edit", visible: isEditColumnVisible, cssClass: cssClass, width: "auto", alignment: "center", cellTemplate: this._getEditCommandCellTemplate(), fixedPosition: "right" }); this._columnsController.columnOption("command:edit", { visible: isEditColumnVisible, cssClass: cssClass }) } _isEditColumnVisible() { const editingOptions = this.option("editing"); return editingOptions.allowDeleting } _isEditButtonDisabled() { const hasChanges = this.hasChanges(); const isEditRowDefined = (0, _type.isDefined)(this.option("editing.editRowKey")); return !(isEditRowDefined || hasChanges) } _updateEditButtons() { const isButtonDisabled = this._isEditButtonDisabled(); if (this._headerPanelView) { this._headerPanelView.setToolbarItemDisabled("saveButton", isButtonDisabled); this._headerPanelView.setToolbarItemDisabled("revertButton", isButtonDisabled) } } _applyModified($element, options) { $element && $element.addClass(_const.CELL_MODIFIED) } _beforeCloseEditCellInBatchMode(rowIndices) {} cancelEditData() { const changes = this.getChanges(); const params = { cancel: false, changes: changes }; this.executeAction("onEditCanceling", params); if (!params.cancel) { this._cancelEditDataCore(); this.executeAction("onEditCanceled", { changes: changes }) } } _cancelEditDataCore() { const rowIndex = this._getVisibleEditRowIndex(); this._beforeCancelEditData(); this.init(); this.resetChanges(); this._resetEditColumnName(); this._resetEditRowKey(); this._afterCancelEditData(rowIndex) } _afterCancelEditData(rowIndex) { const dataController = this._dataController; dataController.updateItems({ repaintChangesOnly: this.option("repaintChangesOnly") }) } _hideEditPopup() {} hasEditData() { return this.hasChanges() } update(changeType) { const dataController = this._dataController; if (dataController && this._pageIndex !== dataController.pageIndex()) { if ("refresh" === changeType) { this.refresh({ isPageChanged: true }) } this._pageIndex = dataController.pageIndex() } this._updateEditButtons() } _getRowIndicesForCascadeUpdating(row, skipCurrentRow) { return skipCurrentRow ? [] : [row.rowIndex] } addDeferred(deferred) { if (!this._deferreds.includes(deferred)) { this._deferreds.push(deferred); deferred.always((() => { const index = this._deferreds.indexOf(deferred); if (index >= 0) { this._deferreds.splice(index, 1) } })) } } _prepareChange(options, value, text) { var _options$row; const newData = {}; const oldData = null === (_options$row = options.row) || void 0 === _options$row ? void 0 : _options$row.data; const rowKey = options.key; const deferred = new _deferred.Deferred; if (void 0 !== rowKey) { options.value = value; const setCellValueResult = (0, _deferred.fromPromise)(options.column.setCellValue(newData, value, (0, _extend.extend)(true, {}, oldData), text)); setCellValueResult.done((() => { deferred.resolve({ data: newData, key: rowKey, oldData: oldData, type: _const.DATA_EDIT_DATA_UPDATE_TYPE }) })).fail((0, _m_editing_utils.createFailureHandler)(deferred)).fail((arg => this._fireDataErrorOccurred(arg))); if ((0, _type.isDefined)(text) && options.column.displayValueMap) { options.column.displayValueMap[value] = text } this._updateRowValues(options); this.addDeferred(deferred) } return deferred } _updateRowValues(options) { if (options.values) { const dataController = this._dataController; const rowIndex = dataController.getRowIndexByKey(options.key); const row = dataController.getVisibleRows()[rowIndex]; if (row) { options.row.values = row.values; options.values = row.values } options.values[options.columnIndex] = options.value } } updateFieldValue(options, value, text, forceUpdateRow) { const rowKey = options.key; const deferred = new _deferred.Deferred; if (void 0 === rowKey) { this._dataController.fireError("E1043") } if (options.column.setCellValue) { this._prepareChange(options, value, text).done((params => { (0, _deferred.when)(this._applyChange(options, params, forceUpdateRow)).always((() => { deferred.resolve() })) })) } else { deferred.resolve() } return deferred.promise() } _focusPreviousEditingCellIfNeed(options) { if (this.hasEditData() && !this.isEditCell(options.rowIndex, options.columnIndex)) { this._focusEditingCell(); this._updateEditRow(options.row, true); return true } } _needUpdateRow(column) { const visibleColumns = this._columnsController.getVisibleColumns(); if (!column) { column = this._getEditColumn() } const isCustomSetCellValue = column && column.setCellValue !== column.defaultSetCellValue; const isCustomCalculateCellValue = visibleColumns.some((visibleColumn => visibleColumn.calculateCellValue !== visibleColumn.defaultCalculateCellValue)); return isCustomSetCellValue || isCustomCalculateCellValue } _applyChange(options, params, forceUpdateRow) { const changeOptions = _extends({}, options, { forceUpdateRow: forceUpdateRow }); this._addChange(params, changeOptions); this._updateEditButtons(); return this._applyChangeCore(options, changeOptions.forceUpdateRow) } _applyChangeCore(options, forceUpdateRow) { const isCustomSetCellValue = options.column.setCellValue !== options.column.defaultSetCellValue; const { row: row } = options; if (row) { if (forceUpdateRow || isCustomSetCellValue) { this._updateEditRow(row, forceUpdateRow, isCustomSetCellValue) } else if (row.update) { row.update() } } } _updateEditRowCore(row, skipCurrentRow, isCustomSetCellValue) { this._dataController.updateItems({ changeType: "update", rowIndices: this._getRowIndicesForCascadeUpdating(row, skipCurrentRow) }) } _updateEditRow(row, forceUpdateRow, isCustomSetCellValue) { if (forceUpdateRow) { this._updateRowImmediately(row, forceUpdateRow, isCustomSetCellValue) } else { this._updateRowWithDelay(row, isCustomSetCellValue) } } _updateRowImmediately(row, forceUpdateRow, isCustomSetCellValue) { this._updateEditRowCore(row, !forceUpdateRow, isCustomSetCellValue); this._validateEditFormAfterUpdate(row, isCustomSetCellValue); if (!forceUpdateRow) { this._focusEditingCell() } } _updateRowWithDelay(row, isCustomSetCellValue) { const deferred = new _deferred.Deferred; this.addDeferred(deferred); setTimeout((() => { var _this$_editForm; const elementContainer = (null === (_this$_editForm = this._editForm) || void 0 === _this$_editForm ? void 0 : _this$_editForm.element()) || this.component.$element().get(0); const $focusedElement = (0, _renderer.default)(_dom_adapter.default.getActiveElement(elementContainer)); const columnIndex = this._rowsView.getCellIndex($focusedElement, row.rowIndex); let focusedElement = $focusedElement.get(0); const selectionRange = _m_utils.default.getSelectionRange(focusedElement); this._updateEditRowCore(row, false, isCustomSetCellValue); this._validateEditFormAfterUpdate(row, isCustomSetCellValue); if (columnIndex >= 0) { const $focusedItem = this._rowsView._getCellElement(row.rowIndex, columnIndex); this._delayedInputFocus($focusedItem, (() => { setTimeout((() => { var _this$component$$elem; focusedElement = _dom_adapter.default.getActiveElement(null === (_this$component$$elem = this.component.$element()) || void 0 === _this$component$$elem ? void 0 : _this$component$$elem.get(0)); if (selectionRange.selectionStart >= 0) { _m_utils.default.setSelectionRange(focusedElement, selectionRange) } })) })) } deferred.resolve() })) } _validateEditFormAfterUpdate() {} _addChange(changeParams, options) { var _this$getChanges; const row = null === options || void 0 === options ? void 0 : options.row; const changes = [...this.getChanges()]; let index = _m_utils.default.getIndexByKey(changeParams.key, changes); if (index < 0) { index = changes.length; this._addInternalData({ key: changeParams.key, oldData: changeParams.oldData }); delete changeParams.oldData; changes.push(changeParams) } const change = _extends({}, changes[index]); if (change) { if (changeParams.data) { change.data = (0, _array_utils.createObjectWithChanges)(change.data, changeParams.data) } if ((!change.type || !changeParams.data) && changeParams.type) { change.type = changeParams.type } if (row) { row.oldData = this._getOldData(row.key); row.data = (0, _array_utils.createObjectWithChanges)(row.data, changeParams.data) } } changes[index] = change; this._silentOption(_const.EDITING_CHANGES_OPTION_NAME, changes); if (options && change !== (null === (_this$getChanges = this.getChanges()) || void 0 === _this$getChanges ? void 0 : _this$getChanges[index])) { options.forceUpdateRow = true } return change } _getFormEditItemTemplate(cellOptions, column) { return column.editCellTemplate || this._getDefaultEditorTemplate() } getColumnTemplate(options) { const { column: column } = options; const rowIndex = options.row && options.row.rowIndex; let template; const isRowMode = this.isRowBasedEditMode(); const isRowEditing = this.isEditRow(rowIndex); const isCellEditing = this.isEditCell(rowIndex, options.columnIndex); let editingStartOptions; if ((column.showEditorAlways || column.setCellValue && (isRowEditing && column.allowEditing || isCellEditing)) && ("data" === options.rowType || "detailAdaptive" === options.rowType) && !column.command) { const allowUpdating = this.allowUpdating(options); if (((allowUpdating || isRowEditing) && column.allowEditing || isCellEditing) && (isRowEditing || !isRowMode)) { if (column.showEditorAlways && !isRowMode) { editingStartOptions = { cancel: false, key: options.row.isNewRow ? void 0 : options.row.key, data: options.row.data, column: column }; this._isEditingStart(editingStartOptions) } if (!editingStartOptions || !editingStartOptions.cancel) { options.setValue = (value, text) => { this.updateFieldValue(options, value, text) } } } template = column.editCellTemplate || this._getDefaultEditorTemplate() } else if ("detail" === column.command && "detail" === options.rowType && isRowEditing) { template = null === this || void 0 === this ? void 0 : this.getEditFormTemplate(options) } return template } _createButton($container, button, options, change) { let icon = _const.EDIT_ICON_CLASS[button.name]; const useIcons = this.option("editing.useIcons"); const useLegacyColumnButtonTemplate = this.option("useLegacyColumnButtonTemplate"); let $button = (0, _renderer.default)("").attr("href", "#").addClass(_const.LINK_CLASS).addClass(button.cssClass); if (button.template && useLegacyColumnButtonTemplate) { this._rowsView.renderTemplate($container, button.template, options, true) } else { if (button.template) { $button = (0, _renderer.default)("").addClass(button.cssClass) } else if (useIcons && icon || button.icon) { icon = button.icon || icon; const iconType = iconUtils.getImageSourceType(icon); if ("image" === iconType || "svg" === iconType) { $button = iconUtils.getImageContainer(icon).addClass(button.cssClass) } else { $button.addClass(`dx-icon${"dxIcon"===iconType?"-":" "}${icon}`).attr("title", button.text) } $button.addClass(_const.LINK_ICON_CLASS); $container.addClass(_const.COMMAND_EDIT_WITH_ICONS_CLASS); const localizationName = this.getButtonLocalizationNames()[button.name]; localizationName && $button.attr("aria-label", _message.default.format(localizationName)) } else { $button.text(button.text) } if ((0, _type.isDefined)(button.hint)) { $button.attr("title", button.hint) } if (this._isButtonDisabled(button, options)) { $button.addClass("dx-state-disabled") } else if (!button.template || button.onClick) { _events_engine.default.on($button, (0, _index.addNamespace)("click", _const.EDITING_NAMESPACE), this.createAction((e => { var _button$onClick; null === (_button$onClick = button.onClick) || void 0 === _button$onClick || _button$onClick.call(button, (0, _extend.extend)({}, e, { row: options.row, column: options.column })); e.event.preventDefault(); e.event.stopPropagation() }))) } $container.append($button); if (button.template) { options.renderAsync = false; this._rowsView.renderTemplate($button, button.template, options, true, change) } } } getButtonLocalizationNames() { return { edit: "dxDataGrid-editingEditRow", save: "dxDataGrid-editingSaveRowChanges", delete: "dxDataGrid-editingDeleteRow", undelete: "dxDataGrid-editingUndeleteRow", cancel: "dxDataGrid-editingCancelRowChanges" } } prepareButtonItem(headerPanel, name, methodName, sortIndex) { const editingTexts = this.option("editing.texts") ?? {}; const titleButtonTextByClassNames = { revert: editingTexts.cancelAllChanges, save: editingTexts.saveAllChanges, addRow: editingTexts.addRow }; const className = { revert: "cancel", save: "save", addRow: "addrow" } [name]; const hintText = titleButtonTextByClassNames[name]; const isButtonDisabled = ("save" === className || "cancel" === className) && this._isEditButtonDisabled(); return { widget: "dxButton", options: { onInitialized: e => { (0, _renderer.default)(e.element).addClass(headerPanel._getToolbarButtonClass(`${_const.EDIT_BUTTON_CLASS} ${this.addWidgetPrefix(className)}-button`)) }, icon: `edit-button-${className}`, disabled: isButtonDisabled, onClick: () => { setTimeout((() => { this[methodName]() })) }, text: hintText, hint: hintText }, showText: "inMenu", name: `${name}Button`, location: "after", locateInMenu: "auto", sortIndex: sortIndex } } prepareEditButtons(headerPanel) { const editingOptions = this.option("editing") ?? {}; const buttonItems = []; if (editingOptions.allowAdding) { buttonItems.push(this.prepareButtonItem(headerPanel, "addRow", "addRow", 20)) } return buttonItems } highlightDataCell($cell, params) { this.shouldHighlightCell(params) && $cell.addClass(_const.CELL_MODIFIED) } _afterInsertRow(key) {} _beforeSaveEditData(change) { if (change && !(0, _type.isDefined)(change.key) && (0, _type.isDefined)(change.type)) { return true } } _afterSaveEditData() {} _beforeCancelEditData() {} _allowEditAction(actionName, options) { let allowEditAction = this.option(`editing.${actionName}`); if ((0, _type.isFunction)(allowEditAction)) { allowEditAction = allowEditAction({ component: this.component, row: options.row }) } return allowEditAction } allowUpdating(options, eventName) { const startEditAction = this.option("editing.startEditAction") ?? _const.DEFAULT_START_EDIT_ACTION; const needCallback = arguments.length > 1 ? startEditAction === eventName || "down" === eventName : true; return needCallback && this._allowEditAction("allowUpdating", options) } allowDeleting(options) { return this._allowEditAction("allowDeleting", options) } isCellModified(parameters) { var _parameters$row, _parameters$row2; const { columnIndex: columnIndex } = parameters; let modifiedValue = null === parameters || void 0 === parameters || null === (_parameters$row = parameters.row) || void 0 === _parameters$row || null === (_parameters$row = _parameters$row.modifiedValues) || void 0 === _parameters$row ? void 0 : _parameters$row[columnIndex]; if (null !== parameters && void 0 !== parameters && null !== (_parameters$row2 = parameters.row) && void 0 !== _parameters$row2 && _parameters$row2.isNewRow) { modifiedValue = parameters.value } return void 0 !== modifiedValue } isNewRowInEditMode() { const visibleEditRowIndex = this._getVisibleEditRowIndex(); const rows = this._dataController.items(); return visibleEditRowIndex >= 0 ? rows[visibleEditRowIndex].isNewRow : false } _isRowDeleteAllowed() {} shouldHighlightCell(parameters) { const cellModified = this.isCellModified(parameters); return cellModified && parameters.column.setCellValue && (this.getEditMode() !== _const.EDIT_MODE_ROW || !parameters.row.isEditing) } } const dataControllerEditingExtenderMixin = Base => class extends Base { reload(full, repaintChangesOnly) { !repaintChangesOnly && this._editingController.refresh(); return super.reload.apply(this, arguments) } repaintRows() { if (this._editingController.isSaving()) { return } return super.repaintRows.apply(this, arguments) } _updateEditRow(items) { const editRowKey = this.option(_const.EDITING_EDITROWKEY_OPTION_NAME); const editRowIndex = _m_utils.default.getIndexByKey(editRowKey, items); const editItem = items[editRowIndex]; if (editItem) { var _this$_updateEditItem; editItem.isEditing = true; null === (_this$_updateEditItem = this._updateEditItem) || void 0 === _this$_updateEditItem || _this$_updateEditItem.call(this, editItem) } } _updateItemsCore(change) { super._updateItemsCore(change); this._updateEditRow(this.items(true)) } _applyChangeUpdate(change) { this._updateEditRow(change.items); super._applyChangeUpdate(change) } _applyChangesOnly(change) { this._updateEditRow(change.items); super._applyChangesOnly(change) } _processItems(items, change) { items = this._editingController.processItems(items, change); return super._processItems(items, change) } _processDataItem(dataItem, options) { this._editingController.processDataItem(dataItem, options, this.generateDataValues); return super._processDataItem(dataItem, options) } _processItem(item, options) { item = super._processItem(item, options); if (item.isNewRow) { options.dataIndex--; delete item.dataIndex } return item } _getChangedColumnIndices(oldItem, newItem, rowIndex, isLiveUpdate) { if (oldItem.isNewRow !== newItem.isNewRow || oldItem.removed !== newItem.removed) { return } return super._getChangedColumnIndices.apply(this, arguments) } _isCellChanged(oldRow, newRow, visibleRowIndex, columnIndex, isLiveUpdate) { const cell = oldRow.cells && oldRow.cells[columnIndex]; const isEditing = this._editingController && this._editingController.isEditCell(visibleRowIndex, columnIndex); if (isLiveUpdate && isEditing) { return false } if (cell && cell.column && !cell.column.showEditorAlways && cell.isEditing !== isEditing) { return true } return super._isCellChanged.apply(this, arguments) } needToRefreshOnDataSourceChange(args) { const isParasiteChange = Array.isArray(args.value) && args.value === args.previousValue && this._editingController.isSaving(); return !isParasiteChange } _handleDataSourceChange(args) { const result = super._handleDataSourceChange(args); const changes = this.option("editing.changes"); const dataSource = args.value; if (Array.isArray(dataSource) && changes.length) { const dataSourceKeys = dataSource.map((item => this.keyOf(item))); const newChanges = changes.filter((change => "insert" === change.type || dataSourceKeys.some((key => (0, _common.equalByValue)(change.key, key))))); if (newChanges.length !== changes.length) { this.option("editing.changes", newChanges) } const editRowKey = this.option("editing.editRowKey"); const isEditNewItem = newChanges.some((change => "insert" === change.type && (0, _common.equalByValue)(editRowKey, change.key))); if (!isEditNewItem && dataSourceKeys.every((key => !(0, _common.equalByValue)(editRowKey, key)))) { this.option("editing.editRowKey", null) } } return result } }; exports.dataControllerEditingExtenderMixin = dataControllerEditingExtenderMixin; exports.editingModule = { defaultOptions: () => ({ editing: { mode: "row", refreshMode: "full", newRowPosition: _const.VIEWPORT_TOP_NEW_ROW_POSITION, allowAdding: false, allowUpdating: false, allowDeleting: false, useIcons: false, selectTextOnEditStart: false, confirmDelete: true, texts: { editRow: _message.default.format("dxDataGrid-editingEditRow"), saveAllChanges: _message.default.format("dxDataGrid-editingSaveAllChanges"), saveRowChanges: _message.default.format("dxDataGrid-editingSaveRowChanges"), cancelAllChanges: _message.default.format("dxDataGrid-editingCancelAllChanges"), cancelRowChanges: _message.default.format("dxDataGrid-editingCancelRowChanges"), addRow: _message.default.format("dxDataGrid-editingAddRow"), deleteRow: _message.default.format("dxDataGrid-editingDeleteRow"), undeleteRow: _message.default.format("dxDataGrid-editingUndeleteRow"), confirmDeleteMessage: _message.default.format("dxDataGrid-editingConfirmDeleteMessage"), confirmDeleteTitle: "" }, form: { colCount: 2 }, popup: {}, startEditAction: "click", editRowKey: null, editColumnName: null, changes: [] }, useLegacyColumnButtonTemplate: false }), controllers: { editing: EditingControllerImpl }, extenders: { controllers: { data: dataControllerEditingExtenderMixin }, views: { rowsView: Base => class extends Base { getCellIndex($cell, rowIndex) { if (!$cell.is("td") && rowIndex >= 0) { const $cellElements = this.getCellElements(rowIndex); let cellIndex = -1; (0, _iterator.each)($cellElements, ((index, cellElement) => { if ((0, _renderer.default)(cellElement).find($cell).length) { cellIndex = index } })); return cellIndex } return super.getCellIndex.apply(this, arguments) } publicMethods() { return super.publicMethods().concat(["cellValue"]) } _getCellTemplate(options) { const template = this._editingController.getColumnTemplate(options); return template || super._getCellTemplate(options) } _createRow(row) { const $row = super._createRow.apply(this, arguments); if (row) { const isRowRemoved = !!row.removed; const isRowInserted = !!row.isNewRow; const isRowModified = !!row.modified; isRowInserted && $row.addClass(_const.ROW_INSERTED); isRowModified && $row.addClass(_const.ROW_MODIFIED); if (isRowInserted || isRowRemoved) { $row.removeClass(_const.ROW_SELECTED) } } return $row } _getColumnIndexByElement($element) { let $tableElement = $element.closest("table"); const $tableElements = this.getTableElements(); while ($tableElement.length && !$tableElements.filter($tableElement).length) { $element = $tableElement.closest("td"); $tableElement = $element.closest("table") } return this._getColumnIndexByElementCore($element) } _getColumnIndexByElementCore($element) { const $targetElement = $element.closest(`.${_const.ROW_CLASS}> td:not(.dx-master-detail-cell)`); return this.getCellIndex($targetElement) } _editCellByClick(e, eventName) { const editingController = this._editingController; const $targetElement = (0, _renderer.default)(e.event.target); const columnIndex = this._getColumnIndexByElement($targetElement); const row = this._dataController.items()[e.rowIndex]; const allowUpdating = editingController.allowUpdating({ row: row }, eventName) || row && row.isNewRow; const column = this._columnsController.getVisibleColumns()[columnIndex]; const isEditedCell = editingController.isEditCell(e.rowIndex, columnIndex); const allowEditing = allowUpdating && column && (column.allowEditing || isEditedCell); const startEditAction = this.option("editing.startEditAction") || "click"; const isShowEditorAlways = column && column.showEditorAlways; if (isEditedCell) { return true } if ("down" === eventName) { if (_devices.default.real().ios || _devices.default.real().android) { (0, _dom.resetActiveElement)() } return isShowEditorAlways && allowEditing && editingController.editCell(e.rowIndex, columnIndex) } if ("click" === eventName && "dblClick" === startEditAction && this._pointerDownTarget === $targetElement.get(0)) { const isError = false; const withoutSaveEditData = null === row || void 0 === row ? void 0 : row.isNewRow; editingController.closeEditCell(isError, withoutSaveEditData) } if (allowEditing && eventName === startEditAction) { return editingController.editCell(e.rowIndex, columnIndex) || editingController.isEditRow(e.rowIndex) } } _rowPointerDown(e) { this._pointerDownTarget = e.event.target; this._pointerDownTimeout = setTimeout((() => { this._editCellByClick(e, "down") })) } _rowClickTreeListHack(e) { super._rowClick.apply(this, arguments) } _rowClick(e) { const isEditForm = (0, _renderer.default)(e.rowElement).hasClass(this.addWidgetPrefix(_const.EDIT_FORM_CLASS)); e.event[_const.TARGET_COMPONENT_NAME] = this.component; if (!this._editCellByClick(e, "click") && !isEditForm) { super._rowClick.apply(this, arguments) } } _rowDblClickTreeListHack(e) { super._rowDblClick.apply(this, arguments) } _rowDblClick(e) { if (!this._editCellByClick(e, "dblClick")) { super._rowDblClick.apply(this, arguments) } } _cellPrepared($cell, parameters) { var _parameters$column; const editingController = this._editingController; const isCommandCell = !!parameters.column.command; const isEditableCell = parameters.setValue; const isEditRow = editingController.isEditRow(parameters.rowIndex); const isEditing = (0, _m_editing_utils.isEditingCell)(isEditRow, parameters); if ((0, _m_editing_utils.isEditingOrShowEditorAlwaysDataCell)(isEditRow, parameters)) { const { alignment: alignment } = parameters.column; $cell.toggleClass(this.addWidgetPrefix(_const.READONLY_CLASS), !isEditableCell).toggleClass(_const.CELL_FOCUS_DISABLED_CLASS, !isEditableCell); if (alignment) { $cell.find(_const.EDITORS_INPUT_SELECTOR).first().css("textAlign", alignment) } } if (isEditing) { this._editCellPrepared($cell) } const hasTemplate = !!(null !== (_parameters$column = parameters.column) && void 0 !== _parameters$column && _parameters$column.cellTemplate); if (parameters.column && !isCommandCell && (!hasTemplate || editingController.shouldHighlightCell(parameters))) { editingController.highlightDataCell($cell, parameters) } super._cellPrepared.apply(this, arguments) } _getCellOptions(options) { const cellOptions = super._getCellOptions(options); const { columnIndex: columnIndex, row: row } = options; cellOptions.isEditing = this._editingController.isEditCell(cellOptions.rowIndex, cellOptions.columnIndex); cellOptions.removed = row.removed; if (row.modified) { cellOptions.modified = void 0 !== row.modifiedValues[columnIndex] } return cellOptions } _setCellAriaAttributes($cell, cellOptions) { super._setCellAriaAttributes($cell, cellOptions); if (cellOptions.removed) { this.setAria("roledescription", _message.default.format("dxDataGrid-ariaDeletedCell"), $cell) } if (cellOptions.modified) { this.setAria("roledescription", _message.default.format("dxDataGrid-ariaModifiedCell"), $cell) } const isEditableCell = cellOptions.column.allowEditing && !cellOptions.removed && !cellOptions.modified && "data" === cellOptions.rowType && cellOptions.column.calculateCellValue === cellOptions.column.defaultCalculateCellValue && this._editingController.isCellBasedEditMode(); if (isEditableCell) { this.setAria("roledescription", _message.default.format("dxDataGrid-ariaEditableCell"), $cell) } } _createCell(options) { const $cell = super._createCell(options); const isEditRow = this._editingController.isEditRow(options.rowIndex); (0, _m_editing_utils.isEditingOrShowEditorAlwaysDataCell)(isEditRow, options) && $cell.addClass(_const.EDITOR_CELL_CLASS); return $cell } cellValue(rowIndex, columnIdentifier, value, text) { const cellOptions = this.getCellOptions(rowIndex, columnIdentifier); if (cellOptions) { if (void 0 === value) { return cellOptions.value } this._editingController.updateFieldValue(cellOptions, value, text, true) } } dispose() { super.dispose.apply(this, arguments); clearTimeout(this._pointerDownTimeout) } _renderCore() { super._renderCore.apply(this, arguments); return this.waitAsyncTemplates(true).done((() => { this._editingController._focusEditorIfNeed() })) } _editCellPrepared() {} _formItemPrepared() {} }, headerPanel: Base => class extends Base { optionChanged(args) { const { fullName: fullName } = args; switch (args.name) { case "editing": { const excludedOptions = [_const.EDITING_POPUP_OPTION_NAME, _const.EDITING_CHANGES_OPTION_NAME, _const.EDITING_EDITCOLUMNNAME_OPTION_NAME, _const.EDITING_EDITROWKEY_OPTION_NAME]; const shouldInvalidate = fullName && !excludedOptions.some((optionName => optionName === fullName)); shouldInvalidate && this._invalidate(); super.optionChanged(args); break } case "useLegacyColumnButtonTemplate": args.handled = true; break; default: super.optionChanged(args) } } _getToolbarItems() { const items = super._getToolbarItems(); const editButtonItems = this._editingController.prepareEditButtons(this); return editButtonItems.concat(items) } isVisible() { const editingOptions = this._editingController.option("editing"); return super.isVisible() || (null === editingOptions || void 0 === editingOptions ? void 0 : editingOptions.allowAdding) } } } } } }, 68802: /*!********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/editing/m_editing_cell_based.js ***! \********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.editingCellBasedModule = void 0; var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../../core/dom_adapter */ 73349)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _deferred2 = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _dom = __webpack_require__( /*! ../../../../core/utils/dom */ 3532); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _array_utils = __webpack_require__( /*! ../../../../data/array_utils */ 60637); var _click = __webpack_require__( /*! ../../../../events/click */ 95429); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../../events/core/events_engine */ 55994)); var _hold = _interopRequireDefault(__webpack_require__( /*! ../../../../events/hold */ 11699)); var _pointer = _interopRequireDefault(__webpack_require__( /*! ../../../../events/pointer */ 93786)); var _index = __webpack_require__( /*! ../../../../events/utils/index */ 39611); var _const = __webpack_require__( /*! ./const */ 72313); var _m_editing_utils = __webpack_require__( /*! ./m_editing_utils */ 89237); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } exports.editingCellBasedModule = { extenders: { controllers: { editing: Base => class extends Base { init() { const needCreateHandlers = !this._saveEditorHandler; super.init(); if (needCreateHandlers) { let $pointerDownTarget; let isResizing; this._pointerUpEditorHandler = () => { var _this$_columnsResizer; isResizing = null === (_this$_columnsResizer = this._columnsResizerController) || void 0 === _this$_columnsResizer ? void 0 : _this$_columnsResizer.isResizing() }; this._pointerDownEditorHandler = e => $pointerDownTarget = (0, _renderer.default)(e.target); this._saveEditorHandler = this.createAction((function(e) { const { event: event } = e; const $target = (0, _renderer.default)(event.target); const targetComponent = event[_const.TARGET_COMPONENT_NAME]; const { component: component } = this; if ((0, _m_editing_utils.isEditable)($pointerDownTarget) && !$pointerDownTarget.is($target)) { return } function checkEditorPopup($element) { if (!$element) { return false } const $dropDownEditorOverlay = $element.closest(`.${_const.DROPDOWN_EDITOR_OVERLAY_CLASS}`); const $componentElement = component.$element(); return $dropDownEditorOverlay.length > 0 && 0 === $componentElement.closest($dropDownEditorOverlay).length } if (this.isCellOrBatchEditMode() && !this._editCellInProgress) { const isEditorPopup = checkEditorPopup($target) || checkEditorPopup(null === targetComponent || void 0 === targetComponent ? void 0 : targetComponent.$element()); const isAnotherComponent = targetComponent && !targetComponent._disposed && targetComponent !== this.component; const isAddRowButton = !!$target.closest(`.${this.addWidgetPrefix(_const.ADD_ROW_BUTTON_CLASS)}`).length; const isFocusOverlay = $target.hasClass(this.addWidgetPrefix(_const.FOCUS_OVERLAY_CLASS)); const isCellEditMode = this.isCellEditMode(); if (!isResizing && !isEditorPopup && !isFocusOverlay && !(isAddRowButton && isCellEditMode && this.isEditing()) && ((0, _dom.isElementInDom)($target) || isAnotherComponent)) { this._closeEditItem.bind(this)($target) } } })); _events_engine.default.on(_dom_adapter.default.getDocument(), _pointer.default.up, this._pointerUpEditorHandler); _events_engine.default.on(_dom_adapter.default.getDocument(), _pointer.default.down, this._pointerDownEditorHandler); _events_engine.default.on(_dom_adapter.default.getDocument(), _click.name, this._saveEditorHandler) } } isCellEditMode() { return this.option("editing.mode") === _const.EDIT_MODE_CELL } isBatchEditMode() { return this.option("editing.mode") === _const.EDIT_MODE_BATCH } isCellOrBatchEditMode() { return this.isCellEditMode() || this.isBatchEditMode() } _needToCloseEditableCell($targetElement) { const $element = this.component.$element(); let result = this.isEditing(); const isCurrentComponentElement = !$element || !!$targetElement.closest($element).length; if (isCurrentComponentElement) { const isDataRow = $targetElement.closest(`.${_const.DATA_ROW_CLASS}`).length; if (isDataRow) { const $targetCell = $targetElement.closest(`.${_const.ROW_CLASS}> td`); const rowIndex = this._rowsView.getRowIndex($targetCell.parent()); const cellElements = this._rowsView.getCellElements(rowIndex); if (null !== cellElements && void 0 !== cellElements && cellElements.length) { var _visibleColumns$colum; const columnIndex = cellElements.index($targetCell); const visibleColumns = this._columnsController.getVisibleColumns(); const allowEditing = null === (_visibleColumns$colum = visibleColumns[columnIndex]) || void 0 === _visibleColumns$colum ? void 0 : _visibleColumns$colum.allowEditing; const isEditingCell = this.isEditCell(rowIndex, columnIndex); result = result && !allowEditing && !isEditingCell } } } return result || super._needToCloseEditableCell($targetElement) } _closeEditItem($targetElement) { if (this._needToCloseEditableCell($targetElement)) { this.closeEditCell() } } _focusEditorIfNeed() { if (this._needFocusEditor && this.isCellOrBatchEditMode()) { var _this$_rowsView; const editColumnIndex = this._getVisibleEditColumnIndex(); const $cell = null === (_this$_rowsView = this._rowsView) || void 0 === _this$_rowsView ? void 0 : _this$_rowsView._getCellElement(this._getVisibleEditRowIndex(), editColumnIndex); this._refocusEditCell = false; clearTimeout(this._inputFocusTimeoutID); if ($cell && !$cell.find(":focus").length) { this._focusEditingCell((() => { this._editCellInProgress = false }), $cell, true) } else { this._editCellInProgress = false } this._needFocusEditor = false } else { super._focusEditorIfNeed() } } isEditing() { if (this.isCellOrBatchEditMode()) { const isEditRowKeyDefined = (0, _type.isDefined)(this.option(_const.EDITING_EDITROWKEY_OPTION_NAME)); const isEditColumnNameDefined = (0, _type.isDefined)(this.option(_const.EDITING_EDITCOLUMNNAME_OPTION_NAME)); return isEditRowKeyDefined && isEditColumnNameDefined } return super.isEditing() } _handleEditColumnNameChange(args) { const oldRowIndex = this._getVisibleEditRowIndex(args.previousValue); if (this.isCellOrBatchEditMode() && -1 !== oldRowIndex && (0, _type.isDefined)(args.value) && args.value !== args.previousValue) { const columnIndex = this._columnsController.getVisibleColumnIndex(args.value); const oldColumnIndex = this._columnsController.getVisibleColumnIndex(args.previousValue); this._editCellFromOptionChanged(columnIndex, oldColumnIndex, oldRowIndex) } } _addRow(parentKey) { if (this.isCellEditMode() && this.hasChanges()) { const deferred = new _deferred2.Deferred; this.saveEditData().done((() => { if (!this.hasChanges()) { this.addRow(parentKey).done(deferred.resolve).fail(deferred.reject) } else { deferred.reject("cancel") } })); return deferred.promise() } return super._addRow(parentKey) } editCell(rowIndex, columnIndex) { return this._editCell({ rowIndex: rowIndex, columnIndex: columnIndex }) } _editCell(options) { const d = new _deferred2.Deferred; let coreResult; this.executeOperation(d, (() => { coreResult = this._editCellCore(options); (0, _deferred2.when)(coreResult).done(d.resolve).fail(d.reject) })); return void 0 !== coreResult ? coreResult : d.promise() } _editCellCore(options) { const dataController = this._dataController; const isEditByOptionChanged = (0, _type.isDefined)(options.oldColumnIndex) || (0, _type.isDefined)(options.oldRowIndex); const { columnIndex: columnIndex, rowIndex: rowIndex, column: column, item: item } = this._getNormalizedEditCellOptions(options); const params = { data: null === item || void 0 === item ? void 0 : item.data, cancel: false, column: column }; if (void 0 === item.key) { this._dataController.fireError("E1043"); return } if (column && ("data" === item.rowType || "detailAdaptive" === item.rowType) && !item.removed && this.isCellOrBatchEditMode()) { if (!isEditByOptionChanged && this.isEditCell(rowIndex, columnIndex)) { return true } const editRowIndex = rowIndex + dataController.getRowIndexOffset(); return (0, _deferred2.when)(this._beforeEditCell(rowIndex, columnIndex, item)).done((cancel => { if (cancel) { return } if (!this._prepareEditCell(params, item, columnIndex, editRowIndex)) { this._processCanceledEditingCell() } })) } return false } _beforeEditCell(rowIndex, columnIndex, item) { if (this.isCellEditMode() && !item.isNewRow && this.hasChanges()) { const isSaving = new _deferred2.Deferred; this.saveEditData().always((() => { isSaving.resolve(this.hasChanges()) })); this.addDeferred(isSaving); return isSaving } return false } publicMethods() { const publicMethods = super.publicMethods(); return publicMethods.concat(["editCell", "closeEditCell"]) } _getNormalizedEditCellOptions(_ref) { let { oldColumnIndex: oldColumnIndex, oldRowIndex: oldRowIndex, columnIndex: columnIndex, rowIndex: rowIndex } = _ref; const columnsController = this._columnsController; const visibleColumns = columnsController.getVisibleColumns(); const items = this._dataController.items(); const item = items[rowIndex]; let oldColumn; if ((0, _type.isDefined)(oldColumnIndex)) { oldColumn = visibleColumns[oldColumnIndex] } else { oldColumn = this._getEditColumn() } if (!(0, _type.isDefined)(oldRowIndex)) { oldRowIndex = this._getVisibleEditRowIndex() } if ((0, _type.isString)(columnIndex)) { columnIndex = columnsController.columnOption(columnIndex, "index"); columnIndex = columnsController.getVisibleIndex(columnIndex) } const column = visibleColumns[columnIndex]; return { oldColumn: oldColumn, columnIndex: columnIndex, oldRowIndex: oldRowIndex, rowIndex: rowIndex, column: column, item: item } } _prepareEditCell(params, item, editColumnIndex, editRowIndex) { if (!item.isNewRow) { params.key = item.key } if (this._isEditingStart(params)) { return false } this._pageIndex = this._dataController.pageIndex(); this._setEditRowKey(item.key); this._setEditColumnNameByIndex(editColumnIndex); if (!params.column.showEditorAlways) { this._addInternalData({ key: item.key, oldData: item.oldData ?? item.data }) } return true } closeEditCell(isError, withoutSaveEditData) { let result = (0, _deferred2.when)(); const oldEditRowIndex = this._getVisibleEditRowIndex(); if (this.isCellOrBatchEditMode()) { const deferred = new _deferred2.Deferred; result = new _deferred2.Deferred; this.executeOperation(deferred, (() => { this._closeEditCellCore(isError, oldEditRowIndex, withoutSaveEditData).always(result.resolve) })) } return result.promise() } _closeEditCellCore(isError, oldEditRowIndex, withoutSaveEditData) { const dataController = this._dataController; const deferred = new _deferred2.Deferred; const promise = deferred.promise(); if (this.isCellEditMode() && this.hasChanges()) { if (!withoutSaveEditData) { this.saveEditData().done((error => { if (!this.hasChanges()) { this.closeEditCell(!!error).always(deferred.resolve); return } deferred.resolve() })); return promise } } else { this._resetEditRowKey(); this._resetEditColumnName(); if (oldEditRowIndex >= 0) { const rowIndices = [oldEditRowIndex]; this._beforeCloseEditCellInBatchMode(rowIndices); if (!isError) { dataController.updateItems({ changeType: "update", rowIndices: rowIndices }) } } } deferred.resolve(); return promise } _resetModifiedClassCells(changes) { if (this.isBatchEditMode()) { const columnsCount = this._columnsController.getVisibleColumns().length; changes.forEach((_ref2 => { let { key: key } = _ref2; const rowIndex = this._dataController.getRowIndexByKey(key); for (let columnIndex = 0; columnIndex < columnsCount; columnIndex++) { const cellElement = this._rowsView._getCellElement(rowIndex, columnIndex); null === cellElement || void 0 === cellElement || cellElement.removeClass(_const.CELL_MODIFIED_CLASS) } })) } } _prepareChange(options, value, text) { const $cellElement = (0, _renderer.default)(options.cellElement); if (this.isBatchEditMode() && void 0 !== options.key) { this._applyModified($cellElement, options) } return super._prepareChange(options, value, text) } _cancelSaving(result) { const dataController = this._dataController; if (this.isCellOrBatchEditMode()) { if (this.isBatchEditMode()) { this._resetEditIndices() } dataController.updateItems() } super._cancelSaving(result) } optionChanged(args) { const { fullName: fullName } = args; if ("editing" === args.name && fullName === _const.EDITING_EDITCOLUMNNAME_OPTION_NAME) { this._handleEditColumnNameChange(args); args.handled = true } else { super.optionChanged(args) } } _editCellFromOptionChanged(columnIndex, oldColumnIndex, oldRowIndex) { const columns = this._columnsController.getVisibleColumns(); if (columnIndex > -1) { (0, _common.deferRender)((() => { this._repaintEditCell(columns[columnIndex], columns[oldColumnIndex], oldRowIndex) })) } } _handleEditRowKeyChange(args) { if (this.isCellOrBatchEditMode()) { const columnIndex = this._getVisibleEditColumnIndex(); const oldRowIndexCorrection = this._getEditRowIndexCorrection(); const oldRowIndex = this._dataController.getRowIndexByKey(args.previousValue) + oldRowIndexCorrection; if ((0, _type.isDefined)(args.value) && args.value !== args.previousValue) { var _this$_editCellFromOp; null === (_this$_editCellFromOp = this._editCellFromOptionChanged) || void 0 === _this$_editCellFromOp || _this$_editCellFromOp.call(this, columnIndex, columnIndex, oldRowIndex) } } else { super._handleEditRowKeyChange(args) } } deleteRow(rowIndex) { if (this.isCellEditMode() && this.isEditing()) { const { isNewRow: isNewRow } = this._dataController.items()[rowIndex]; const rowKey = this._dataController.getKeyByRowIndex(rowIndex); this.closeEditCell(null, isNewRow).always((() => { rowIndex = this._dataController.getRowIndexByKey(rowKey); this._checkAndDeleteRow(rowIndex) })) } else { super.deleteRow(rowIndex) } } _checkAndDeleteRow(rowIndex) { if (this.isBatchEditMode()) { this._deleteRowCore(rowIndex) } else { super._checkAndDeleteRow(rowIndex) } } _refreshCore(params) { const { isPageChanged: isPageChanged } = params ?? {}; const needResetIndexes = this.isBatchEditMode() || isPageChanged && "virtual" !== this.option("scrolling.mode"); if (this.isCellOrBatchEditMode()) { if (needResetIndexes) { this._resetEditColumnName(); this._resetEditRowKey() } } else { super._refreshCore(params) } } _allowRowAdding(params) { if (this.isBatchEditMode()) { return true } return super._allowRowAdding(params) } _afterDeleteRow(rowIndex, oldEditRowIndex) { const dataController = this._dataController; if (this.isBatchEditMode()) { dataController.updateItems({ changeType: "update", rowIndices: [oldEditRowIndex, rowIndex] }); return (new _deferred2.Deferred).resolve() } return super._afterDeleteRow(rowIndex, oldEditRowIndex) } _updateEditRow(row, forceUpdateRow, isCustomSetCellValue) { if (this.isCellOrBatchEditMode()) { this._updateRowImmediately(row, forceUpdateRow, isCustomSetCellValue) } else { super._updateEditRow(row, forceUpdateRow, isCustomSetCellValue) } } _isDefaultButtonVisible(button, options) { if (this.isCellOrBatchEditMode()) { const isBatchMode = this.isBatchEditMode(); switch (button.name) { case "save": case "cancel": case "edit": return false; case "delete": return super._isDefaultButtonVisible(button, options) && (!isBatchMode || !options.row.removed); case "undelete": return isBatchMode && this.allowDeleting(options) && options.row.removed; default: return super._isDefaultButtonVisible(button, options) } } return super._isDefaultButtonVisible(button, options) } _isRowDeleteAllowed() { const callBaseResult = super._isRowDeleteAllowed(); return callBaseResult || this.isBatchEditMode() } _beforeEndSaving(changes) { if (this.isCellEditMode()) { var _changes$; if ("update" !== (null === (_changes$ = changes[0]) || void 0 === _changes$ ? void 0 : _changes$.type)) { super._beforeEndSaving(changes) } } else { if (this.isBatchEditMode()) { this._resetModifiedClassCells(changes) } super._beforeEndSaving(changes) } } prepareEditButtons(headerPanel) { const editingOptions = this.option("editing") ?? {}; const buttonItems = super.prepareEditButtons(headerPanel); const needEditingButtons = editingOptions.allowUpdating || editingOptions.allowAdding || editingOptions.allowDeleting; if (needEditingButtons && this.isBatchEditMode()) { buttonItems.push(this.prepareButtonItem(headerPanel, "save", "saveEditData", 21)); buttonItems.push(this.prepareButtonItem(headerPanel, "revert", "cancelEditData", 22)) } return buttonItems } _saveEditDataInner() { var _deferred; const editRow = this._dataController.getVisibleRows()[this.getEditRowIndex()]; const editColumn = this._getEditColumn(); const showEditorAlways = null === editColumn || void 0 === editColumn ? void 0 : editColumn.showEditorAlways; const isUpdateInCellMode = this.isCellEditMode() && !(null !== editRow && void 0 !== editRow && editRow.isNewRow); let deferred; if (isUpdateInCellMode && showEditorAlways) { deferred = new _deferred2.Deferred; this.addDeferred(deferred) } return super._saveEditDataInner().always(null === (_deferred = deferred) || void 0 === _deferred ? void 0 : _deferred.resolve) } _applyChange(options, params, forceUpdateRow) { const isUpdateInCellMode = this.isCellEditMode() && options.row && !options.row.isNewRow; const { showEditorAlways: showEditorAlways } = options.column; const isCustomSetCellValue = options.column.setCellValue !== options.column.defaultSetCellValue; const focusPreviousEditingCell = showEditorAlways && !forceUpdateRow && isUpdateInCellMode && this.hasEditData() && !this.isEditCell(options.rowIndex, options.columnIndex); if (focusPreviousEditingCell) { this._focusEditingCell(); this._updateEditRow(options.row, true, isCustomSetCellValue); return } return super._applyChange(options, params, forceUpdateRow) } _applyChangeCore(options, forceUpdateRow) { const { showEditorAlways: showEditorAlways } = options.column; const isUpdateInCellMode = this.isCellEditMode() && options.row && !options.row.isNewRow; if (showEditorAlways && !forceUpdateRow) { if (isUpdateInCellMode) { this._setEditRowKey(options.row.key, true); this._setEditColumnNameByIndex(options.columnIndex, true); return this.saveEditData() } if (this.isBatchEditMode()) { forceUpdateRow = this._needUpdateRow(options.column); return super._applyChangeCore(options, forceUpdateRow) } } return super._applyChangeCore(options, forceUpdateRow) } _processDataItemCore(item, change, key, columns, generateDataValues) { const { data: data, type: type } = change; if (this.isBatchEditMode() && type === _const.DATA_EDIT_DATA_REMOVE_TYPE) { item.data = (0, _array_utils.createObjectWithChanges)(item.data, data) } super._processDataItemCore(item, change, key, columns, generateDataValues) } _processRemoveCore(changes, editIndex, processIfBatch) { if (this.isBatchEditMode() && !processIfBatch) { return } return super._processRemoveCore(changes, editIndex, processIfBatch) } _processRemoveIfError(changes, editIndex) { if (this.isBatchEditMode()) { return } return super._processRemoveIfError(changes, editIndex) } _beforeFocusElementInRow(rowIndex) { super._beforeFocusElementInRow(rowIndex); const editRowIndex = rowIndex >= 0 ? rowIndex : 0; const columnIndex = this.getFirstEditableColumnIndex(); columnIndex >= 0 && this.editCell(editRowIndex, columnIndex) } } }, views: { rowsView: Base => class extends Base { _createTable() { const $table = super._createTable.apply(this, arguments); const editingController = this._editingController; if (editingController.isCellOrBatchEditMode() && this.option("editing.allowUpdating")) { _events_engine.default.on($table, (0, _index.addNamespace)(_hold.default.name, "dxDataGridRowsView"), `td:not(.${_const.EDITOR_CELL_CLASS})`, this.createAction((() => { if (editingController.isEditing()) { editingController.closeEditCell() } }))) } return $table } _createRow(row) { const $row = super._createRow.apply(this, arguments); if (row) { const editingController = this._editingController; const isRowRemoved = !!row.removed; if (editingController.isBatchEditMode()) { isRowRemoved && $row.addClass(_const.ROW_REMOVED) } } return $row } }, headerPanel: Base => class extends Base { isVisible() { const editingOptions = this._editingController.option("editing"); return super.isVisible() || editingOptions && (editingOptions.allowUpdating || editingOptions.allowDeleting) && editingOptions.mode === _const.EDIT_MODE_BATCH } } } } } }, 99211: /*!********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/editing/m_editing_form_based.js ***! \********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.editingFormBasedModule = void 0; var _devices = _interopRequireDefault(__webpack_require__( /*! ../../../../core/devices */ 20530)); var _guid = _interopRequireDefault(__webpack_require__( /*! ../../../../core/guid */ 73176)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _dom = __webpack_require__( /*! ../../../../core/utils/dom */ 3532); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../../events/core/events_engine */ 55994)); var _remove = __webpack_require__( /*! ../../../../events/remove */ 29007); var _button = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/button */ 63008)); var _form = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/form */ 17737)); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/popup/ui.popup */ 51495)); var _ui2 = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/scroll_view/ui.scrollable */ 41183)); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../m_utils */ 60082)); var _const = __webpack_require__( /*! ./const */ 72313); var _m_editing_utils = __webpack_require__( /*! ./m_editing_utils */ 89237); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } exports.editingFormBasedModule = { extenders: { controllers: { editing: Base => class extends Base { init() { this._editForm = null; this._updateEditFormDeferred = null; super.init() } isEditRow(rowIndex) { return !this.isPopupEditMode() && super.isEditRow(rowIndex) } isFormOrPopupEditMode() { return this.isPopupEditMode() || this.isFormEditMode() } isFormEditMode() { const editMode = this.option("editing.mode"); return editMode === _const.EDIT_MODE_FORM } getFirstEditableColumnIndex() { const firstFormItem = this._firstFormItem; if (this.isFormEditMode() && firstFormItem) { const editRowKey = this.option(_const.EDITING_EDITROWKEY_OPTION_NAME); const editRowIndex = this._dataController.getRowIndexByKey(editRowKey); const $editFormElements = this._rowsView.getCellElements(editRowIndex); return this._rowsView._getEditFormEditorVisibleIndex($editFormElements, firstFormItem.column) } return super.getFirstEditableColumnIndex() } getEditFormRowIndex() { return this.isFormOrPopupEditMode() ? this._getVisibleEditRowIndex() : super.getEditFormRowIndex() } _isEditColumnVisible() { const result = super._isEditColumnVisible(); const editingOptions = this.option("editing"); return this.isFormOrPopupEditMode() ? editingOptions.allowUpdating || result : result } _handleDataChanged(args) { if (this.isPopupEditMode()) { var _args$items, _args$changeTypes; const editRowKey = this.option("editing.editRowKey"); const hasEditRow = null === args || void 0 === args || null === (_args$items = args.items) || void 0 === _args$items ? void 0 : _args$items.some((item => (0, _common.equalByValue)(item.key, editRowKey))); const onlyInsertChanges = (null === (_args$changeTypes = args.changeTypes) || void 0 === _args$changeTypes ? void 0 : _args$changeTypes.length) && args.changeTypes.every((item => "insert" === item)); if (("refresh" === args.changeType || hasEditRow && args.isOptionChanged) && !onlyInsertChanges) { this._repaintEditPopup() } } super._handleDataChanged(args) } getPopupContent() { var _this$_editPopup; const popupVisible = null === (_this$_editPopup = this._editPopup) || void 0 === _this$_editPopup ? void 0 : _this$_editPopup.option("visible"); if (this.isPopupEditMode() && popupVisible) { return this._$popupContent } } _showAddedRow(rowIndex) { if (this.isPopupEditMode()) { this._showEditPopup(rowIndex) } else { super._showAddedRow(rowIndex) } } _cancelEditDataCore() { super._cancelEditDataCore(); if (this.isPopupEditMode()) { this._hideEditPopup() } } _updateEditRowCore(row, skipCurrentRow, isCustomSetCellValue) { const editForm = this._editForm; if (this.isPopupEditMode()) { if (this.option("repaintChangesOnly")) { var _row$update; null === (_row$update = row.update) || void 0 === _row$update || _row$update.call(row, row); this._rowsView.renderDelayedTemplates() } else if (editForm) { this._updateEditFormDeferred = (new _deferred.Deferred).done((() => editForm.repaint())); if (!this._updateLockCount) { this._updateEditFormDeferred.resolve() } } } else { super._updateEditRowCore(row, skipCurrentRow, isCustomSetCellValue) } } _showEditPopup(rowIndex, repaintForm) { const isMobileDevice = "desktop" !== _devices.default.current().deviceType; const editPopupClass = this.addWidgetPrefix(_const.EDIT_POPUP_CLASS); const popupOptions = (0, _extend.extend)({ showTitle: false, fullScreen: isMobileDevice, wrapperAttr: { class: editPopupClass }, toolbarItems: [{ toolbar: "bottom", location: "after", widget: "dxButton", options: this._getSaveButtonConfig() }, { toolbar: "bottom", location: "after", widget: "dxButton", options: this._getCancelButtonConfig() }], contentTemplate: this._getPopupEditFormTemplate(rowIndex) }, this.option(_const.EDITING_POPUP_OPTION_NAME)); if (!this._editPopup) { const $popupContainer = (0, _renderer.default)("
").appendTo(this.component.$element()).addClass(editPopupClass); this._editPopup = this._createComponent($popupContainer, _ui.default); this._editPopup.on("hiding", this._getEditPopupHiddenHandler()); this._editPopup.on("shown", (e => { _events_engine.default.trigger(e.component.$content().find(_const.FOCUSABLE_ELEMENT_SELECTOR).not(`.${_const.FOCUSABLE_ELEMENT_CLASS}`).first(), "focus"); if (repaintForm) { var _this$_editForm; null === (_this$_editForm = this._editForm) || void 0 === _this$_editForm || _this$_editForm.repaint() } })) } this._editPopup.option(popupOptions); this._editPopup.show(); super._showEditPopup(rowIndex, repaintForm) } _getPopupEditFormTemplate(rowIndex) { const row = this.component.getVisibleRows()[rowIndex]; const templateOptions = { row: row, values: row.values, rowType: row.rowType, key: row.key, rowIndex: rowIndex }; this._rowsView._addWatchMethod(templateOptions, row); return container => { const formTemplate = this.getEditFormTemplate(); const scrollable = this._createComponent((0, _renderer.default)("
").appendTo(container), _ui2.default); this._$popupContent = (0, _renderer.default)(scrollable.content()); formTemplate(this._$popupContent, templateOptions, { isPopupForm: true }); this._rowsView.renderDelayedTemplates(); (0, _renderer.default)(container).parent().attr("aria-label", this.localize("dxDataGrid-ariaEditForm")) } } _repaintEditPopup() { const rowIndex = this._getVisibleEditRowIndex(); if (rowIndex >= 0) { var _this$_editPopup2, _this$_editPopup3; const defaultAnimation = null === (_this$_editPopup2 = this._editPopup) || void 0 === _this$_editPopup2 ? void 0 : _this$_editPopup2.option("animation"); null === (_this$_editPopup3 = this._editPopup) || void 0 === _this$_editPopup3 || _this$_editPopup3.option("animation", null); this._showEditPopup(rowIndex, true); if (void 0 !== defaultAnimation) { this._editPopup.option("animation", defaultAnimation) } } } _hideEditPopup() { var _this$_editPopup4; null === (_this$_editPopup4 = this._editPopup) || void 0 === _this$_editPopup4 || _this$_editPopup4.option("visible", false) } optionChanged(args) { if ("editing" === args.name && this.isFormOrPopupEditMode()) { const { fullName: fullName } = args; if (0 === fullName.indexOf(_const.EDITING_FORM_OPTION_NAME)) { this._handleFormOptionChange(args); args.handled = true } else if (0 === fullName.indexOf(_const.EDITING_POPUP_OPTION_NAME)) { this._handlePopupOptionChange(args); args.handled = true } } super.optionChanged(args) } _handleFormOptionChange(args) { var _this$_editPopup5; if (this.isFormEditMode()) { const editRowIndex = this._getVisibleEditRowIndex(); if (editRowIndex >= 0) { this._dataController.updateItems({ changeType: "update", rowIndices: [editRowIndex] }) } } else if (null !== (_this$_editPopup5 = this._editPopup) && void 0 !== _this$_editPopup5 && _this$_editPopup5.option("visible") && 0 === args.fullName.indexOf(_const.EDITING_FORM_OPTION_NAME)) { this._repaintEditPopup() } } _handlePopupOptionChange(args) { const editPopup = this._editPopup; if (editPopup) { const popupOptionName = args.fullName.slice(_const.EDITING_POPUP_OPTION_NAME.length + 1); if (popupOptionName) { editPopup.option(popupOptionName, args.value) } else { editPopup.option(args.value) } } } renderFormEditorTemplate(detailCellOptions, item, formTemplateOptions, container, isReadOnly) { const that = this; const $container = (0, _renderer.default)(container); const { column: column } = item; const editorType = (0, _m_editing_utils.getEditorType)(item); const row = null === detailCellOptions || void 0 === detailCellOptions ? void 0 : detailCellOptions.row; const rowData = null === row || void 0 === row ? void 0 : row.data; const form = formTemplateOptions.component; const value = column.calculateCellValue(rowData); const displayValue = _m_utils.default.getDisplayValue(column, value, rowData, null === row || void 0 === row ? void 0 : row.rowType); const { label: label, labelMark: labelMark, labelMode: labelMode } = formTemplateOptions.editorOptions || {}; const cellOptions = (0, _extend.extend)({}, detailCellOptions, { data: rowData, cellElement: null, isOnForm: true, item: item, id: form.getItemID(item.name || item.dataField), column: (0, _extend.extend)({}, column, { editorType: editorType, editorOptions: (0, _extend.extend)({ label: label, labelMark: labelMark, labelMode: labelMode }, column.editorOptions, item.editorOptions) }), columnIndex: column.index, setValue: !isReadOnly && column.allowEditing && function(value, text) { that.updateFieldValue(cellOptions, value, text) } }); cellOptions.value = value; cellOptions.displayValue = displayValue; cellOptions.text = !column.command ? _m_utils.default.formatValue(displayValue, column) : ""; const template = this._getFormEditItemTemplate.bind(this)(cellOptions, column); this._rowsView.renderTemplate($container, template, cellOptions, !!(0, _dom.isElementInDom)($container)).done((() => { this._rowsView._updateCell($container, cellOptions) })); return cellOptions } getFormEditorTemplate(cellOptions, item) { const column = this.component.columnOption(item.name || item.dataField); return (options, container) => { const $container = (0, _renderer.default)(container); const { row: row } = cellOptions; if (null !== row && void 0 !== row && row.watch) { const dispose = row.watch((() => column.selector(row.data)), (() => { var _validator; let $editorElement = $container.find(".dx-widget").first(); let validator = $editorElement.data("dxValidator"); const validatorOptions = null === (_validator = validator) || void 0 === _validator ? void 0 : _validator.option(); $container.contents().remove(); cellOptions = this.renderFormEditorTemplate.bind(this)(cellOptions, item, options, $container); $editorElement = $container.find(".dx-widget").first(); validator = $editorElement.data("dxValidator"); if (validatorOptions && !validator) { $editorElement.dxValidator({ validationRules: validatorOptions.validationRules, validationGroup: validatorOptions.validationGroup, dataGetter: validatorOptions.dataGetter }) } })); _events_engine.default.on($container, _remove.removeEvent, dispose) } cellOptions = this.renderFormEditorTemplate.bind(this)(cellOptions, item, options, $container) } } getEditFormOptions(detailOptions) { var _this$_getValidationG; const editFormOptions = null === (_this$_getValidationG = this._getValidationGroupsInForm) || void 0 === _this$_getValidationG ? void 0 : _this$_getValidationG.call(this, detailOptions); const userCustomizeItem = this.option("editing.form.customizeItem"); const editFormItemClass = this.addWidgetPrefix(_const.EDIT_FORM_ITEM_CLASS); let items = this.option("editing.form.items"); const isCustomEditorType = {}; if (!items) { const columns = this._columnsController.getColumns(); items = []; (0, _iterator.each)(columns, ((_, column) => { if (!column.isBand && !column.type) { items.push({ column: column, name: column.name, dataField: column.dataField }) } })) } else { (0, _m_editing_utils.forEachFormItems)(items, (item => { const itemId = (null === item || void 0 === item ? void 0 : item.name) || (null === item || void 0 === item ? void 0 : item.dataField); if (itemId) { isCustomEditorType[itemId] = !!item.editorType } })) } return (0, _extend.extend)({}, editFormOptions, { items: items, formID: `dx-${new _guid.default}`, customizeItem: item => { let column; const itemId = item.name || item.dataField; if (item.column || itemId) { column = item.column || this._columnsController.columnOption(item.name ? `name:${item.name}` : `dataField:${item.dataField}`) } if (column) { item.label = item.label || {}; item.label.text = item.label.text || column.caption; if ("boolean" === column.dataType && void 0 === item.label.visible) { const labelMode = this.option("editing.form.labelMode"); if ("floating" === labelMode || "static" === labelMode) { item.label.visible = true } } item.template = item.template || this.getFormEditorTemplate(detailOptions, item); item.column = column; item.isCustomEditorType = isCustomEditorType[itemId]; if (column.formItem) { (0, _extend.extend)(item, column.formItem) } if (void 0 === item.isRequired && column.validationRules) { item.isRequired = column.validationRules.some((rule => "required" === rule.type)); item.validationRules = [] } const itemVisible = (0, _type.isDefined)(item.visible) ? item.visible : true; if (!this._firstFormItem && itemVisible) { this._firstFormItem = item } } null === userCustomizeItem || void 0 === userCustomizeItem || userCustomizeItem.call(this, item); item.cssClass = (0, _type.isString)(item.cssClass) ? `${item.cssClass} ${editFormItemClass}` : editFormItemClass } }) } getEditFormTemplate() { return ($container, detailOptions, options) => { const editFormOptions = this.option(_const.EDITING_FORM_OPTION_NAME); const baseEditFormOptions = this.getEditFormOptions(detailOptions); const $formContainer = (0, _renderer.default)("
").appendTo($container); const isPopupForm = null === options || void 0 === options ? void 0 : options.isPopupForm; this._firstFormItem = void 0; if (isPopupForm) { $formContainer.addClass(this.addWidgetPrefix(_const.EDIT_POPUP_FORM_CLASS)) } this._editForm = this._createComponent($formContainer, _form.default, (0, _extend.extend)({}, editFormOptions, baseEditFormOptions)); if (!isPopupForm) { const $buttonsContainer = (0, _renderer.default)("
").addClass(this.addWidgetPrefix(_const.FORM_BUTTONS_CONTAINER_CLASS)).appendTo($container); this._createComponent((0, _renderer.default)("
").appendTo($buttonsContainer), _button.default, this._getSaveButtonConfig()); this._createComponent((0, _renderer.default)("
").appendTo($buttonsContainer), _button.default, this._getCancelButtonConfig()) } this._editForm.on("contentReady", (() => { var _this$_editPopup6; this._rowsView.renderDelayedTemplates(); null === (_this$_editPopup6 = this._editPopup) || void 0 === _this$_editPopup6 || _this$_editPopup6.repaint() })) } } getEditForm() { return this._editForm } _endUpdateCore() { var _this$_updateEditForm; null === (_this$_updateEditForm = this._updateEditFormDeferred) || void 0 === _this$_updateEditForm || _this$_updateEditForm.resolve() } _beforeEndSaving(changes) { super._beforeEndSaving(changes); if (this.isPopupEditMode()) { var _this$_editPopup7; null === (_this$_editPopup7 = this._editPopup) || void 0 === _this$_editPopup7 || _this$_editPopup7.hide() } } _processDataItemCore(item, change, key, columns, generateDataValues) { const { type: type } = change; if (this.isPopupEditMode() && type === _const.DATA_EDIT_DATA_INSERT_TYPE) { item.visible = false } super._processDataItemCore(item, change, key, columns, generateDataValues) } _editRowFromOptionChangedCore(rowIndices, rowIndex) { const isPopupEditMode = this.isPopupEditMode(); super._editRowFromOptionChangedCore(rowIndices, rowIndex, isPopupEditMode); if (isPopupEditMode) { this._showEditPopup(rowIndex) } } }, data: Base => class extends Base { _updateEditItem(item) { if (this._editingController.isFormEditMode()) { item.rowType = "detail" } } _getChangedColumnIndices(oldItem, newItem, visibleRowIndex, isLiveUpdate) { if (false === isLiveUpdate && newItem.isEditing && this._editingController.isFormEditMode()) { return } return super._getChangedColumnIndices.apply(this, arguments) } } }, views: { rowsView: Base => class extends Base { _renderCellContent($cell, options) { if ("data" === options.rowType && this._editingController.isPopupEditMode() && false === options.row.visible) { return } super._renderCellContent.apply(this, arguments) } getCellElements(rowIndex) { const $cellElements = super.getCellElements(rowIndex); const editingController = this._editingController; const editForm = editingController.getEditForm(); const editFormRowIndex = editingController.getEditFormRowIndex(); if (editFormRowIndex === rowIndex && $cellElements && editForm) { return editForm.$element().find(`.${this.addWidgetPrefix(_const.EDIT_FORM_ITEM_CLASS)}, .${_const.BUTTON_CLASS}`) } return $cellElements } _getVisibleColumnIndex($cells, rowIndex, columnIdentifier) { const editFormRowIndex = this._editingController.getEditFormRowIndex(); if (editFormRowIndex === rowIndex && (0, _type.isString)(columnIdentifier)) { const column = this._columnsController.columnOption(columnIdentifier); return this._getEditFormEditorVisibleIndex($cells, column) } return super._getVisibleColumnIndex.apply(this, arguments) } _getEditFormEditorVisibleIndex($cells, column) { let visibleIndex = -1; (0, _iterator.each)($cells, ((index, cellElement) => { const item = (0, _renderer.default)(cellElement).find(".dx-field-item-content").data("dx-form-item"); if (null !== item && void 0 !== item && item.column && column && item.column.index === column.index) { visibleIndex = index; return false } })); return visibleIndex } _isFormItem(parameters) { const isDetailRow = "detail" === parameters.rowType || "detailAdaptive" === parameters.rowType; const isPopupEditing = "data" === parameters.rowType && this._editingController.isPopupEditMode(); return (isDetailRow || isPopupEditing) && parameters.item } _updateCell($cell, parameters) { if (this._isFormItem(parameters)) { this._formItemPrepared(parameters, $cell) } else { super._updateCell($cell, parameters) } } _updateContent() { const editingController = this._editingController; const oldEditForm = editingController.getEditForm(); const validationGroup = null === oldEditForm || void 0 === oldEditForm ? void 0 : oldEditForm.option("validationGroup"); const deferred = super._updateContent.apply(this, arguments); return deferred.done((() => { const newEditForm = editingController.getEditForm(); if (validationGroup && newEditForm && newEditForm !== oldEditForm) { newEditForm.option("validationGroup", validationGroup) } })) } } } } } }, 55597: /*!*******************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/editing/m_editing_row_based.js ***! \*******************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.editingRowBasedModule = void 0; var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _const = __webpack_require__( /*! ./const */ 72313); exports.editingRowBasedModule = { extenders: { controllers: { editing: Base => class extends Base { isRowEditMode() { return this.getEditMode() === _const.EDIT_MODE_ROW } _afterCancelEditData(rowIndex) { const dataController = this._dataController; if (this.isRowBasedEditMode() && rowIndex >= 0) { dataController.updateItems({ changeType: "update", rowIndices: [rowIndex, rowIndex + 1] }) } else { super._afterCancelEditData(rowIndex) } } _isDefaultButtonVisible(button, options) { const isRowMode = this.isRowBasedEditMode(); const isPopupEditMode = this.isPopupEditMode(); const isEditRow = !isPopupEditMode && options.row && (0, _common.equalByValue)(options.row.key, this.option(_const.EDITING_EDITROWKEY_OPTION_NAME)); if (isRowMode) { switch (button.name) { case "edit": return !isEditRow && this.allowUpdating(options); case "delete": return super._isDefaultButtonVisible(button, options) && !isEditRow; case "save": case "cancel": return isEditRow; default: return super._isDefaultButtonVisible(button, options) } } return super._isDefaultButtonVisible(button, options) } isEditRow(rowIndex) { return this.isRowBasedEditMode() && this.isEditRowByIndex(rowIndex) } _cancelSaving(result) { if (this.isRowBasedEditMode()) { if (!this.hasChanges()) { this._cancelEditDataCore() } } super._cancelSaving(result) } _refreshCore(params) { const { allowCancelEditing: allowCancelEditing } = params ?? {}; if (this.isRowBasedEditMode()) { const hasUpdateChanges = this.getChanges().filter((it => "update" === it.type)).length > 0; this.init(); allowCancelEditing && hasUpdateChanges && this._cancelEditDataCore() } super._refreshCore(params) } _isEditColumnVisible() { const result = super._isEditColumnVisible(); const editingOptions = this.option("editing"); const isRowEditMode = this.isRowEditMode(); const isVisibleInRowEditMode = editingOptions.allowUpdating || editingOptions.allowAdding; return result || isRowEditMode && isVisibleInRowEditMode } _focusEditorIfNeed() { const editMode = this.getEditMode(); if (this._needFocusEditor) { if (_const.MODES_WITH_DELAYED_FOCUS.includes(editMode)) { const $editingCell = this.getFocusedCellInRow(this._getVisibleEditRowIndex()); this._delayedInputFocus($editingCell, (() => { $editingCell && this.component.focus($editingCell) })) } this._needFocusEditor = false } } }, data: Base => class extends Base { _getChangedColumnIndices(oldItem, newItem, rowIndex, isLiveUpdate) { if (this._editingController.isRowBasedEditMode() && oldItem.isEditing !== newItem.isEditing) { return } return super._getChangedColumnIndices.apply(this, arguments) } } }, views: { rowsView: Base => class extends Base { _createRow(row) { const $row = super._createRow.apply(this, arguments); if (row) { const editingController = this._editingController; const isEditRow = editingController.isEditRow(row.rowIndex); if (isEditRow) { $row.addClass(_const.EDIT_ROW); $row.removeClass(_const.ROW_SELECTED_CLASS); if ("detail" === row.rowType) { $row.addClass(this.addWidgetPrefix(_const.EDIT_FORM_CLASS)) } } } return $row } _update(change) { super._update(change); if ("updateSelection" === change.changeType) { this.getTableElements().children("tbody").children(`.${_const.EDIT_ROW}`).removeClass(_const.ROW_SELECTED_CLASS) } } } } } } }, 89237: /*!***************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/editing/m_editing_utils.js ***! \***************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.getButtonIndex = exports.generateNewRowTempKey = exports.forEachFormItems = exports.createFailureHandler = void 0; exports.getButtonName = getButtonName; exports.getEditorType = exports.getEditingTexts = void 0; exports.isEditable = function($element) { return $element && ($element.is("input") || $element.is("textarea")) }; exports.isNewRowTempKey = exports.isEditingOrShowEditorAlwaysDataCell = exports.isEditingCell = void 0; var _guid = (obj = __webpack_require__( /*! ../../../../core/guid */ 73176), obj && obj.__esModule ? obj : { default: obj }); var obj; var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); exports.createFailureHandler = function(deferred) { return function(arg) { const error = arg instanceof Error ? arg : new Error(arg && String(arg) || "Unknown error"); deferred.reject(error) } }; const isEditingCell = function(isEditRow, cellOptions) { return cellOptions.isEditing || isEditRow && cellOptions.column.allowEditing }; exports.isEditingCell = isEditingCell; exports.isEditingOrShowEditorAlwaysDataCell = function(isEditRow, cellOptions) { const isCommandCell = !!cellOptions.column.command; const isEditing = isEditingCell(isEditRow, cellOptions); const isEditorCell = !isCommandCell && (isEditing || cellOptions.column.showEditorAlways); return "data" === cellOptions.rowType && isEditorCell }; exports.getEditingTexts = options => { const editingTexts = options.component.option("editing.texts") || {}; return { save: editingTexts.saveRowChanges, cancel: editingTexts.cancelRowChanges, edit: editingTexts.editRow, undelete: editingTexts.undeleteRow, delete: editingTexts.deleteRow, add: editingTexts.addRowToNode } }; exports.generateNewRowTempKey = () => `_DX_KEY_${new _guid.default}`; exports.isNewRowTempKey = key => "string" === typeof key && key.startsWith("_DX_KEY_") && 44 === key.length; exports.getButtonIndex = (buttons, name) => { let result = -1; buttons.some(((button, index) => { if (getButtonName(button) === name) { result = index; return true } })); return result }; function getButtonName(button) { return (0, _type.isObject)(button) ? button.name : button } exports.getEditorType = item => { var _column$formItem; const { column: column } = item; return item.isCustomEditorType ? item.editorType : null === (_column$formItem = column.formItem) || void 0 === _column$formItem ? void 0 : _column$formItem.editorType }; const forEachFormItems = (items, callBack) => { items.forEach((item => { if (item.items || item.tabs) { forEachFormItems(item.items || item.tabs, callBack) } else { callBack(item) } })) }; exports.forEachFormItems = forEachFormItems }, 80070: /*!***********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/editor_factory/m_editor_factory.js ***! \***********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.editorFactoryModule = exports.EditorFactory = void 0; var _position = _interopRequireDefault(__webpack_require__( /*! ../../../../animation/position */ 49387)); var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../../core/dom_adapter */ 73349)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _browser = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/browser */ 47810)); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _position2 = __webpack_require__( /*! ../../../../core/utils/position */ 37518); var _size = __webpack_require__( /*! ../../../../core/utils/size */ 58664); var _click = __webpack_require__( /*! ../../../../events/click */ 95429); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../../events/core/events_engine */ 55994)); var _pointer = _interopRequireDefault(__webpack_require__( /*! ../../../../events/pointer */ 93786)); var _index = __webpack_require__( /*! ../../../../events/utils/index */ 39611); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/shared/ui.editor_factory_mixin */ 15653)); var _m_modules = _interopRequireDefault(__webpack_require__( /*! ../m_modules */ 15943)); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../m_utils */ 60082)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const UPDATE_FOCUS_EVENTS = (0, _index.addNamespace)([_pointer.default.down, "focusin", _click.name].join(" "), "dxDataGridEditorFactory"); const ViewControllerWithMixin = (0, _ui.default)(_m_modules.default.ViewController); class EditorFactory extends ViewControllerWithMixin { init() { this.createAction("onEditorPreparing", { excludeValidators: ["disabled", "readOnly"], category: "rendering" }); this.createAction("onEditorPrepared", { excludeValidators: ["disabled", "readOnly"], category: "rendering" }); this._columnsResizerController = this.getController("columnsResizer"); this._editingController = this.getController("editing"); this._keyboardNavigationController = this.getController("keyboardNavigation"); this._columnsController = this.getController("columns"); this._validatingController = this.getController("validating"); this._rowsView = this.getView("rowsView"); this._updateFocusHandler = this._updateFocusHandler || this.createAction(this._updateFocus.bind(this)); this._subscribedContainerRoot = this._getContainerRoot(); _events_engine.default.on(this._subscribedContainerRoot, UPDATE_FOCUS_EVENTS, this._updateFocusHandler); this._attachContainerEventHandlers() } dispose() { clearTimeout(this._focusTimeoutID); clearTimeout(this._updateFocusTimeoutID); _events_engine.default.off(this._subscribedContainerRoot, UPDATE_FOCUS_EVENTS, this._updateFocusHandler) } _getFocusedElement($dataGridElement) { const rowSelector = this.option("focusedRowEnabled") ? "tr[tabindex]:focus" : "tr[tabindex]:not(.dx-data-row):focus"; const focusedElementSelector = ["td[tabindex]:focus", `${rowSelector}`, "input:focus", "button:focus", "textarea:focus", "div[tabindex]:focus", ".dx-lookup-field:focus", ".dx-checkbox:focus", ".dx-switch:focus", ".dx-dropdownbutton .dx-buttongroup:focus", ".dx-adaptive-item-text:focus"].join(","); const $focusedElement = $dataGridElement.find(focusedElementSelector); return this.elementIsInsideGrid($focusedElement) && $focusedElement } _getFocusCellSelector() { return ".dx-row > td" } _updateFocusCore() { const $dataGridElement = this.component && this.component.$element(); if ($dataGridElement) { let $focus = this._getFocusedElement($dataGridElement); if ($focus && $focus.length) { let isHideBorder; if (!$focus.hasClass("dx-cell-focus-disabled") && !$focus.hasClass("dx-row")) { const $focusCell = $focus.closest(`${this._getFocusCellSelector()}, .dx-cell-focus-disabled`); if ($focusCell.get(0) !== $focus.get(0)) { isHideBorder = this._needHideBorder($focusCell); $focus = $focusCell } } if ($focus.length && !$focus.hasClass("dx-cell-focus-disabled")) { this.focus($focus, isHideBorder); return } } } this.loseFocus() } _needHideBorder($element) { const rowsViewElement = this._rowsView.element(); const isRowsView = $element.closest(rowsViewElement).length > 0; const isEditing = this._editingController.isEditing(); return $element.hasClass("dx-editor-inline-block") || isRowsView && !isEditing } _updateFocus(e) { const that = this; const isFocusOverlay = e && e.event && (0, _renderer.default)(e.event.target).hasClass(that.addWidgetPrefix("focus-overlay")); that._isFocusOverlay = that._isFocusOverlay || isFocusOverlay; clearTimeout(that._updateFocusTimeoutID); that._updateFocusTimeoutID = setTimeout((() => { delete that._updateFocusTimeoutID; if (!that._isFocusOverlay) { that._updateFocusCore() } that._isFocusOverlay = false })) } _updateFocusOverlaySize($element, position) { $element.hide(); const location = _position.default.calculate($element, (0, _extend.extend)({ collision: "fit" }, position)); if (location.h.oversize > 0) { (0, _size.setOuterWidth)($element, (0, _size.getOuterWidth)($element) - location.h.oversize) } if (location.v.oversize > 0) { (0, _size.setOuterHeight)($element, (0, _size.getOuterHeight)($element) - location.v.oversize) } $element.show() } callbackNames() { return ["focused"] } focus($element, isHideBorder) { const that = this; if (void 0 === $element) { return that._$focusedElement } if ($element) { if (!$element.is(that._$focusedElement)) { that._$focusedElement && that._$focusedElement.removeClass("dx-focused") } that._$focusedElement = $element; clearTimeout(that._focusTimeoutID); that._focusTimeoutID = setTimeout((() => { delete that._focusTimeoutID; that.renderFocusOverlay($element, isHideBorder); $element.addClass("dx-focused"); that.focused.fire($element) })) } } refocus() { const $focus = this.focus(); this.focus($focus) } renderFocusOverlay($element, isHideBorder) { const that = this; if (!_m_utils.default.isElementInCurrentGrid(this, $element)) { return } if (!that._$focusOverlay) { that._$focusOverlay = (0, _renderer.default)("
").addClass(that.addWidgetPrefix("focus-overlay")) } if (isHideBorder) { that._$focusOverlay.addClass("dx-hidden") } else if ($element.length) { const align = _browser.default.mozilla ? "right bottom" : "left top"; const $content = $element.closest(`.${that.addWidgetPrefix("content")}`); const elemCoord = (0, _position2.getBoundingRect)($element.get(0)); const isFocusedCellInvalid = $element.hasClass(this.addWidgetPrefix("invalid")); const isFocusedCellModified = $element.hasClass("dx-cell-modified") && !isFocusedCellInvalid; that._$focusOverlay.removeClass("dx-hidden").toggleClass("dx-focused-cell-invalid", isFocusedCellInvalid).toggleClass("dx-focused-cell-modified", isFocusedCellModified).appendTo($content); (0, _size.setOuterHeight)(that._$focusOverlay, elemCoord.bottom - elemCoord.top + 1); (0, _size.setOuterWidth)(that._$focusOverlay, elemCoord.right - elemCoord.left + 1); const focusOverlayPosition = { precise: true, my: align, at: align, of: $element, boundary: $content.length && $content }; that._updateFocusOverlaySize(that._$focusOverlay, focusOverlayPosition); _position.default.setup(that._$focusOverlay, focusOverlayPosition); that._$focusOverlay.css("visibility", "visible") } } resize() { const $focusedElement = this._$focusedElement; if ($focusedElement) { this.focus($focusedElement) } } loseFocus(skipValidator) { this._$focusedElement && this._$focusedElement.removeClass("dx-focused"); this._$focusedElement = null; this._$focusOverlay && this._$focusOverlay.addClass("dx-hidden") } _getContainerRoot() { var _this$component; const $container = null === (_this$component = this.component) || void 0 === _this$component ? void 0 : _this$component.$element(); const root = _dom_adapter.default.getRootNode(null === $container || void 0 === $container ? void 0 : $container.get(0)); if (root.nodeType === Node.DOCUMENT_FRAGMENT_NODE && !root.host) { return _dom_adapter.default.getDocument() } return root } _attachContainerEventHandlers() { const that = this; const $container = that.component && that.component.$element(); if ($container) { _events_engine.default.on($container, (0, _index.addNamespace)("keydown", "dxDataGridEditorFactory"), (e => { if ("tab" === (0, _index.normalizeKeyName)(e)) { that._updateFocusHandler(e) } })) } } } exports.EditorFactory = EditorFactory; exports.editorFactoryModule = { defaultOptions: () => ({}), controllers: { editorFactory: EditorFactory } } }, 31152: /*!***********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/error_handling/m_error_handling.js ***! \***********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.errorHandlingModule = exports.ErrorHandlingController = void 0; var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _click = __webpack_require__( /*! ../../../../events/click */ 95429); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../../events/core/events_engine */ 55994)); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109)); var _m_modules = _interopRequireDefault(__webpack_require__( /*! ../m_modules */ 15943)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } class ErrorHandlingController extends _m_modules.default.ViewController { init() { this._resizingController = this.getController("resizing"); this._columnsController = this.getController("columns"); this._columnHeadersView = this.getView("columnHeadersView"); this._rowsView = this.getView("rowsView") } _createErrorRow(error, $tableElements) { let $errorRow; let $closeButton; const $errorMessage = this._renderErrorMessage(error); if ($tableElements) { $errorRow = (0, _renderer.default)("").attr("role", "row").addClass("dx-error-row"); $closeButton = (0, _renderer.default)("
").addClass("dx-closebutton").addClass(this.addWidgetPrefix("action")); _events_engine.default.on($closeButton, _click.name, this.createAction((args => { var _this$_resizingContro, _this$_resizingContro2; const e = args.event; let $errorRow; const errorRowIndex = (0, _renderer.default)(e.currentTarget).closest(".dx-error-row").index(); e.stopPropagation(); (0, _iterator.each)($tableElements, ((_, tableElement) => { $errorRow = (0, _renderer.default)(tableElement).children("tbody").children("tr").eq(errorRowIndex); this.removeErrorRow($errorRow) })); null === (_this$_resizingContro = this._resizingController) || void 0 === _this$_resizingContro || null === (_this$_resizingContro2 = _this$_resizingContro.fireContentReadyAction) || void 0 === _this$_resizingContro2 || _this$_resizingContro2.call(_this$_resizingContro) }))); (0, _renderer.default)("").attr({ colSpan: this._columnsController.getVisibleColumns().length, role: "gridcell" }).prepend($closeButton).append($errorMessage).appendTo($errorRow); return $errorRow } return $errorMessage } _renderErrorMessage(error) { const message = error.url ? error.message.replace(error.url, "") : error.message || error; const $message = (0, _renderer.default)("
").attr("role", "alert").attr("aria-roledescription", _message.default.format("dxDataGrid-ariaError")).addClass("dx-error-message").text(message); if (error.url) { (0, _renderer.default)("").attr("href", error.url).text(error.url).appendTo($message) } return $message } renderErrorRow(error, rowIndex, $popupContent) { var _this$_resizingContro3, _this$_resizingContro4; const that = this; let $errorMessageElement; let $firstErrorRow; if ($popupContent) { $popupContent.find(".dx-error-message").remove(); $errorMessageElement = that._createErrorRow(error); $popupContent.prepend($errorMessageElement); return $errorMessageElement } const viewElement = rowIndex >= 0 || !that._columnHeadersView.isVisible() ? that._rowsView : that._columnHeadersView; const $tableElements = viewElement.getTableElements(); (0, _iterator.each)($tableElements, ((_, tableElement) => { $errorMessageElement = that._createErrorRow(error, $tableElements); $firstErrorRow = $firstErrorRow || $errorMessageElement; if (rowIndex >= 0) { const $row = viewElement._getRowElements((0, _renderer.default)(tableElement)).eq(rowIndex); that.removeErrorRow($row.next()); $errorMessageElement.insertAfter($row) } else { const $tbody = (0, _renderer.default)(tableElement).children("tbody"); const rowElements = $tbody.children("tr"); if (that._columnHeadersView.isVisible()) { that.removeErrorRow(rowElements.last()); (0, _renderer.default)(tableElement).append($errorMessageElement) } else { that.removeErrorRow(rowElements.first()); $tbody.first().prepend($errorMessageElement) } } })); null === (_this$_resizingContro3 = this._resizingController) || void 0 === _this$_resizingContro3 || null === (_this$_resizingContro4 = _this$_resizingContro3.fireContentReadyAction) || void 0 === _this$_resizingContro4 || _this$_resizingContro4.call(_this$_resizingContro3); return $firstErrorRow } removeErrorRow($row) { if (!$row) { const $columnHeaders = this._columnHeadersView && this._columnHeadersView.element(); $row = $columnHeaders && $columnHeaders.find(".dx-error-row"); if (!$row || !$row.length) { const $rowsViewElement = this._rowsView.element(); $row = $rowsViewElement && $rowsViewElement.find(".dx-error-row") } } $row && $row.hasClass("dx-error-row") && $row.remove() } optionChanged(args) { if ("errorRowEnabled" === args.name) { args.handled = true } else { super.optionChanged(args) } } } exports.ErrorHandlingController = ErrorHandlingController; exports.errorHandlingModule = { defaultOptions: () => ({ errorRowEnabled: true }), controllers: { errorHandling: ErrorHandlingController }, extenders: { controllers: { data: Base => class extends Base { init() { super.init(); this.dataErrorOccurred.add(((error, $popupContent) => { if (this.option("errorRowEnabled")) { this._errorHandlingController.renderErrorRow(error, void 0, $popupContent) } })); this.changed.add((e => { if (e && "loadError" === e.changeType) { return } if (this._editingController && !this._editingController.hasChanges()) { var _this$_errorHandlingC, _this$_errorHandlingC2; null === (_this$_errorHandlingC = this._errorHandlingController) || void 0 === _this$_errorHandlingC || null === (_this$_errorHandlingC2 = _this$_errorHandlingC.removeErrorRow) || void 0 === _this$_errorHandlingC2 || _this$_errorHandlingC2.call(_this$_errorHandlingC) } })) } } } } } }, 62690: /*!***************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/filter/m_filter_builder.js ***! \***************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.filterBuilderModule = exports.FilterBuilderView = void 0; var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109)); var _filter_builder = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/filter_builder */ 20301)); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/popup/ui.popup */ 51495)); var _scroll_view = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/scroll_view */ 4741)); var _accessibility = __webpack_require__( /*! ../../../../ui/shared/accessibility */ 56756); var _m_modules = _interopRequireDefault(__webpack_require__( /*! ../m_modules */ 15943)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } class FilterBuilderView extends _m_modules.default.View { init() { super.init(); this._columnsController = this.getController("columns"); this._filterSyncController = this.getController("filterSync") } optionChanged(args) { switch (args.name) { case "filterBuilder": case "filterBuilderPopup": this._invalidate(); args.handled = true; break; default: super.optionChanged(args) } } _renderCore() { this._updatePopupOptions() } _updatePopupOptions() { if (this.option("filterBuilderPopup.visible")) { this._initPopup() } else if (this._filterBuilderPopup) { this._filterBuilderPopup.hide() } } _disposePopup() { if (this._filterBuilderPopup) { this._filterBuilderPopup.dispose(); this._filterBuilderPopup = void 0 } if (this._filterBuilder) { this._filterBuilder.dispose(); this._filterBuilder = void 0 } } _initPopup() { const that = this; that._disposePopup(); that._filterBuilderPopup = that._createComponent(that.element(), _ui.default, (0, _extend.extend)({ title: _message.default.format("dxDataGrid-filterBuilderPopupTitle"), contentTemplate: $contentElement => that._getPopupContentTemplate($contentElement), onOptionChanged(args) { if ("visible" === args.name) { that.option("filterBuilderPopup.visible", args.value) } }, toolbarItems: that._getPopupToolbarItems() }, that.option("filterBuilderPopup"), { onHidden() { (0, _accessibility.restoreFocus)(that); that._disposePopup() } })) } _getPopupContentTemplate(contentElement) { const $contentElement = (0, _renderer.default)(contentElement); const $filterBuilderContainer = (0, _renderer.default)("
").appendTo((0, _renderer.default)(contentElement)); this._filterBuilder = this._createComponent($filterBuilderContainer, _filter_builder.default, (0, _extend.extend)({ value: this.option("filterValue"), fields: this._columnsController.getFilteringColumns() }, this.option("filterBuilder"), { customOperations: this._filterSyncController.getCustomFilterOperations() })); this._createComponent($contentElement, _scroll_view.default, { direction: "both" }) } _getPopupToolbarItems() { const that = this; return [{ toolbar: "bottom", location: "after", widget: "dxButton", options: { text: _message.default.format("OK"), onClick() { const filter = that._filterBuilder.option("value"); that.option("filterValue", filter); that._filterBuilderPopup.hide() } } }, { toolbar: "bottom", location: "after", widget: "dxButton", options: { text: _message.default.format("Cancel"), onClick() { that._filterBuilderPopup.hide() } } }] } } exports.FilterBuilderView = FilterBuilderView; exports.filterBuilderModule = { defaultOptions: () => ({ filterBuilder: { groupOperationDescriptions: { and: _message.default.format("dxFilterBuilder-and"), or: _message.default.format("dxFilterBuilder-or"), notAnd: _message.default.format("dxFilterBuilder-notAnd"), notOr: _message.default.format("dxFilterBuilder-notOr") }, filterOperationDescriptions: { between: _message.default.format("dxFilterBuilder-filterOperationBetween"), equal: _message.default.format("dxFilterBuilder-filterOperationEquals"), notEqual: _message.default.format("dxFilterBuilder-filterOperationNotEquals"), lessThan: _message.default.format("dxFilterBuilder-filterOperationLess"), lessThanOrEqual: _message.default.format("dxFilterBuilder-filterOperationLessOrEquals"), greaterThan: _message.default.format("dxFilterBuilder-filterOperationGreater"), greaterThanOrEqual: _message.default.format("dxFilterBuilder-filterOperationGreaterOrEquals"), startsWith: _message.default.format("dxFilterBuilder-filterOperationStartsWith"), contains: _message.default.format("dxFilterBuilder-filterOperationContains"), notContains: _message.default.format("dxFilterBuilder-filterOperationNotContains"), endsWith: _message.default.format("dxFilterBuilder-filterOperationEndsWith"), isBlank: _message.default.format("dxFilterBuilder-filterOperationIsBlank"), isNotBlank: _message.default.format("dxFilterBuilder-filterOperationIsNotBlank") } }, filterBuilderPopup: {} }), views: { filterBuilderView: FilterBuilderView } } }, 9622: /*!*************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/filter/m_filter_custom_operations.js ***! \*************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.anyOf = function(grid) { return (0, _extend.extend)(baseOperation(grid), { name: "anyof", icon: "selectall", caption: _message.default.format("dxFilterBuilder-filterOperationAnyOf") }) }; exports.noneOf = function(grid) { const baseOp = baseOperation(grid); return (0, _extend.extend)({}, baseOp, { calculateFilterExpression(filterValue, field, fields) { const baseFilter = baseOp.calculateFilterExpression(filterValue, field, fields); if (!baseFilter || 0 === baseFilter.length) { return null } return "!" === baseFilter[0] ? baseFilter : ["!", baseFilter] }, name: "noneof", icon: "unselectall", caption: _message.default.format("dxFilterBuilder-filterOperationNoneOf") }) }; var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _data_source = __webpack_require__( /*! ../../../../data/data_source/data_source */ 85273); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109)); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/widget/ui.errors */ 96688)); var _m_utils = __webpack_require__( /*! ../../../filter_builder/m_utils */ 70474); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function baseOperation(grid) { const getFullText = function(itemText, parentText) { return parentText ? `${parentText}/${itemText}` : itemText }; const getSelectedItemsTexts = function(items, parentText) { let result = []; items.forEach((item => { if (item.items) { const selectedItemsTexts = getSelectedItemsTexts(item.items, getFullText(item.text, parentText)); result = result.concat(selectedItemsTexts) } item.selected && result.push(getFullText(item.text, parentText)) })); return result }; const headerFilterController = grid && grid.getController("headerFilter"); return { dataTypes: ["string", "date", "datetime", "number", "boolean", "object"], calculateFilterExpression: function(filterValue, field, fields) { const result = []; const lastIndex = filterValue.length - 1; filterValue && filterValue.forEach(((value, index) => { if ((0, _m_utils.isCondition)(value) || (0, _m_utils.isGroup)(value)) { const filterExpression = (0, _m_utils.getFilterExpression)(value, fields, [], "headerFilter"); result.push(filterExpression) } else { const filterExpression = (0, _m_utils.getFilterExpression)([field.dataField, "=", value], fields, [], "headerFilter"); result.push(filterExpression) } index !== lastIndex && result.push("or") })); if (1 === result.length) { return result[0] } return result }, editorTemplate(conditionInfo, container) { const div = (0, _renderer.default)("
").addClass("dx-filterbuilder-item-value-text").appendTo(container); const column = (0, _extend.extend)(true, {}, grid.columnOption(conditionInfo.field.dataField)); (0, _m_utils.renderValueText)(div, conditionInfo.text && conditionInfo.text.split("|")); column.filterType = "include"; column.filterValues = conditionInfo.value ? conditionInfo.value.slice() : []; headerFilterController.showHeaderFilterMenuBase({ columnElement: div, column: column, apply() { value = this.filterValues, void conditionInfo.setValue(value); var value; headerFilterController.hideHeaderFilterMenu(); conditionInfo.closeEditor() }, onHidden() { conditionInfo.closeEditor() }, isFilterBuilder: true }); return container }, customizeText: function(fieldInfo, options) { options = options || {}; const { value: value } = fieldInfo; let column = grid.columnOption(fieldInfo.field.dataField); const headerFilter = column && column.headerFilter; const lookup = column && column.lookup; const values = options.values || [value]; if (headerFilter && headerFilter.dataSource || lookup && lookup.dataSource) { const result = new _deferred.Deferred; const itemsDeferred = options.items || new _deferred.Deferred; if (!options.items) { column = (0, _extend.extend)({}, column, { filterType: "include", filterValues: values }); const dataSourceOptions = headerFilterController.getDataSource(column); dataSourceOptions.paginate = false; const dataSource = new _data_source.DataSource(dataSourceOptions); const key = dataSource.store().key(); if (key) { const { values: values } = options; if (values && values.length > 1) { const filter = values.reduce(((result, value) => { if (result.length) { result.push("or") } result.push([key, "=", value]); return result }), []); dataSource.filter(filter) } else { dataSource.filter([key, "=", fieldInfo.value]) } } else if (fieldInfo.field.calculateDisplayValue) { _ui.default.log("W1017") } options.items = itemsDeferred; dataSource.load().done(itemsDeferred.resolve) } itemsDeferred.done((items => { const index = values.indexOf(fieldInfo.value); result.resolve(getSelectedItemsTexts(items, null)[index]) })); return result } const text = headerFilterController.getHeaderItemText(value, column, 0, grid.option("headerFilter")); return text } } } }, 4062: /*!*************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/filter/m_filter_panel.js ***! \*************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.filterPanelModule = exports.FilterPanelView = void 0; var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _inflector = __webpack_require__( /*! ../../../../core/utils/inflector */ 78008); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../../events/core/events_engine */ 55994)); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109)); var _check_box = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/check_box */ 18859)); var _m_utils = __webpack_require__( /*! ../../../filter_builder/m_utils */ 70474); var _m_accessibility = __webpack_require__( /*! ../m_accessibility */ 9130); var _m_modules = _interopRequireDefault(__webpack_require__( /*! ../m_modules */ 15943)); var _m_utils2 = _interopRequireDefault(__webpack_require__( /*! ../m_utils */ 60082)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } class FilterPanelView extends _m_modules.default.View { init() { this._dataController = this.getController("data"); this._columnsController = this.getController("columns"); this._filterSyncController = this.getController("filterSync"); this._dataController.dataSourceChanged.add((() => this.render())) } isVisible() { return this.option("filterPanel.visible") && this._dataController.dataSource() } _renderCore() { const $element = this.element(); $element.empty(); const isColumnsDefined = !!this._columnsController.getColumns().length; if (!isColumnsDefined) { return } $element.addClass(this.addWidgetPrefix("filter-panel")); const $leftContainer = (0, _renderer.default)("
").addClass(this.addWidgetPrefix("filter-panel-left")).appendTo($element); this._renderFilterBuilderText($element, $leftContainer) } _renderFilterBuilderText($element, $leftContainer) { const $filterElement = this._getFilterElement(); const $textElement = this._getTextElement(); if (this.option("filterValue") || this._filterValueBuffer) { const $checkElement = this._getCheckElement(); const $removeButtonElement = this._getRemoveButtonElement(); $leftContainer.append($checkElement).append($filterElement).append($textElement); $element.append($removeButtonElement); return } $leftContainer.append($filterElement).append($textElement) } _getCheckElement() { const that = this; const $element = (0, _renderer.default)("
").addClass(this.addWidgetPrefix("filter-panel-checkbox")); that._createComponent($element, _check_box.default, { value: that.option("filterPanel.filterEnabled"), onValueChanged(e) { that.option("filterPanel.filterEnabled", e.value) } }); $element.attr("title", this.option("filterPanel.texts.filterEnabledHint")); return $element } _getFilterElement() { const that = this; const $element = (0, _renderer.default)("
").addClass("dx-icon-filter"); _events_engine.default.on($element, "click", (() => that._showFilterBuilder())); (0, _m_accessibility.registerKeyboardAction)("filterPanel", that, $element, void 0, (() => that._showFilterBuilder())); that._addTabIndexToElement($element); return $element } _getTextElement() { const that = this; const $textElement = (0, _renderer.default)("
").addClass(that.addWidgetPrefix("filter-panel-text")); let filterText; const filterValue = that.option("filterValue"); if (filterValue) { (0, _deferred.when)(that.getFilterText(filterValue, this._filterSyncController.getCustomFilterOperations())).done((filterText => { const customizeText = that.option("filterPanel.customizeText"); if (customizeText) { const customText = customizeText({ component: that.component, filterValue: filterValue, text: filterText }); if ("string" === typeof customText) { filterText = customText } } $textElement.text(filterText) })) } else { filterText = that.option("filterPanel.texts.createFilter"); $textElement.text(filterText) } _events_engine.default.on($textElement, "click", (() => that._showFilterBuilder())); (0, _m_accessibility.registerKeyboardAction)("filterPanel", that, $textElement, void 0, (() => that._showFilterBuilder())); that._addTabIndexToElement($textElement); return $textElement } _showFilterBuilder() { this.option("filterBuilderPopup.visible", true) } _getRemoveButtonElement() { const that = this; const clearFilterValue = () => that.option("filterValue", null); const $element = (0, _renderer.default)("
").addClass(that.addWidgetPrefix("filter-panel-clear-filter")).text(that.option("filterPanel.texts.clearFilter")); _events_engine.default.on($element, "click", clearFilterValue); (0, _m_accessibility.registerKeyboardAction)("filterPanel", this, $element, void 0, clearFilterValue); that._addTabIndexToElement($element); return $element } _addTabIndexToElement($element) { if (!this.option("useLegacyKeyboardNavigation")) { const tabindex = this.option("tabindex") || 0; $element.attr("tabindex", tabindex) } } optionChanged(args) { switch (args.name) { case "filterValue": this._invalidate(); this.option("filterPanel.filterEnabled", true); args.handled = true; break; case "filterPanel": this._invalidate(); args.handled = true; break; default: super.optionChanged(args) } } _getConditionText(fieldText, operationText, valueText) { let result = `[${fieldText}] ${operationText}`; if ((0, _type.isDefined)(valueText)) { result += valueText } return result } _getValueMaskedText(value) { return Array.isArray(value) ? `('${value.join("', '")}')` : ` '${value}'` } _getValueText(field, customOperation, value) { const deferred = new _deferred.Deferred; const hasCustomOperation = customOperation && customOperation.customizeText; if ((0, _type.isDefined)(value) || hasCustomOperation) { if (!hasCustomOperation && field.lookup) { (0, _m_utils.getCurrentLookupValueText)(field, value, (data => { deferred.resolve(this._getValueMaskedText(data)) })) } else { const displayValue = Array.isArray(value) ? value : _m_utils2.default.getDisplayValue(field, value, null); (0, _deferred.when)((0, _m_utils.getCurrentValueText)(field, displayValue, customOperation, "filterPanel")).done((data => { deferred.resolve(this._getValueMaskedText(data)) })) } } else { deferred.resolve("") } return deferred.promise() } getConditionText(filterValue, options) { const that = this; const operation = filterValue[1]; const deferred = new _deferred.Deferred; const customOperation = (0, _m_utils.getCustomOperation)(options.customOperations, operation); let operationText; const field = (0, _m_utils.getField)(filterValue[0], options.columns); const fieldText = field.caption || ""; const value = filterValue[2]; if (customOperation) { operationText = customOperation.caption || (0, _inflector.captionize)(customOperation.name) } else if (null === value) { operationText = (0, _m_utils.getCaptionByOperation)("=" === operation ? "isblank" : "isnotblank", options.filterOperationDescriptions) } else { operationText = (0, _m_utils.getCaptionByOperation)(operation, options.filterOperationDescriptions) } this._getValueText(field, customOperation, value).done((valueText => { deferred.resolve(that._getConditionText(fieldText, operationText, valueText)) })); return deferred } getGroupText(filterValue, options, isInnerGroup) { const that = this; const result = new _deferred.Deferred; const textParts = []; const groupValue = (0, _m_utils.getGroupValue)(filterValue); filterValue.forEach((item => { if ((0, _m_utils.isCondition)(item)) { textParts.push(that.getConditionText(item, options)) } else if ((0, _m_utils.isGroup)(item)) { textParts.push(that.getGroupText(item, options, true)) } })); _deferred.when.apply(this, textParts).done((function() { let text; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key] } if (groupValue.startsWith("!")) { const groupText = options.groupOperationDescriptions[`not${groupValue.substring(1,2).toUpperCase()}${groupValue.substring(2)}`].split(" "); text = `${groupText[0]} ${args[0]}` } else { text = args.join(` ${options.groupOperationDescriptions[groupValue]} `) } if (isInnerGroup) { text = `(${text})` } result.resolve(text) })); return result } getFilterText(filterValue, customOperations) { const options = { customOperations: customOperations, columns: this._columnsController.getFilteringColumns(), filterOperationDescriptions: this.option("filterBuilder.filterOperationDescriptions"), groupOperationDescriptions: this.option("filterBuilder.groupOperationDescriptions") }; return (0, _m_utils.isCondition)(filterValue) ? this.getConditionText(filterValue, options) : this.getGroupText(filterValue, options) } } exports.FilterPanelView = FilterPanelView; exports.filterPanelModule = { defaultOptions: () => ({ filterPanel: { visible: false, filterEnabled: true, texts: { createFilter: _message.default.format("dxDataGrid-filterPanelCreateFilter"), clearFilter: _message.default.format("dxDataGrid-filterPanelClearFilter"), filterEnabledHint: _message.default.format("dxDataGrid-filterPanelFilterEnabledHint") } } }), views: { filterPanelView: FilterPanelView }, extenders: { controllers: { data: Base => class extends Base { optionChanged(args) { if ("filterPanel" === args.name) { this._applyFilter(); args.handled = true } else { super.optionChanged(args) } } } } } } }, 12302: /*!***********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/filter/m_filter_row.js ***! \***********************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.filterRowModule = exports.ApplyFilterViewController = void 0; var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _size = __webpack_require__( /*! ../../../../core/utils/size */ 58664); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../../events/core/events_engine */ 55994)); var _index = __webpack_require__( /*! ../../../../events/utils/index */ 39611); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109)); var _editor = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/editor/editor */ 96452)); var _menu = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/menu */ 76995)); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/overlay/ui.overlay */ 89799)); var _accessibility = __webpack_require__( /*! ../../../../ui/shared/accessibility */ 56756); var _m_modules = _interopRequireDefault(__webpack_require__( /*! ../m_modules */ 15943)); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../m_utils */ 60082)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const OPERATION_ICONS = { "=": "filter-operation-equals", "<>": "filter-operation-not-equals", "<": "filter-operation-less", "<=": "filter-operation-less-equal", ">": "filter-operation-greater", ">=": "filter-operation-greater-equal", default: "filter-operation-default", notcontains: "filter-operation-not-contains", contains: "filter-operation-contains", startswith: "filter-operation-starts-with", endswith: "filter-operation-ends-with", between: "filter-operation-between" }; const OPERATION_DESCRIPTORS = { "=": "equal", "<>": "notEqual", "<": "lessThan", "<=": "lessThanOrEqual", ">": "greaterThan", ">=": "greaterThanOrEqual", startswith: "startsWith", contains: "contains", notcontains: "notContains", endswith: "endsWith", between: "between" }; const BETWEEN_OPERATION_DATA_TYPES = ["date", "datetime", "number"]; const ARIA_SEARCH_BOX = _message.default.format("dxDataGrid-ariaSearchBox"); function isOnClickApplyFilterMode(that) { return "onClick" === that.option("filterRow.applyFilter") } const getEditorInstance = function($editorContainer) { const $editor = $editorContainer && $editorContainer.children(); const componentNames = $editor && $editor.data("dxComponents"); const editor = componentNames && componentNames.length && $editor.data(componentNames[0]); if (editor instanceof _editor.default) { return editor } return null }; const getRangeTextByFilterValue = function(that, column) { let result = ""; let rangeEnd = ""; const filterValue = getColumnFilterValue(that, column); const formatOptions = _m_utils.default.getFormatOptionsByColumn(column, "filterRow"); if (Array.isArray(filterValue)) { result = _m_utils.default.formatValue(filterValue[0], formatOptions); rangeEnd = _m_utils.default.formatValue(filterValue[1], formatOptions); if ("" !== rangeEnd) { result += ` - ${rangeEnd}` } } else if ((0, _type.isDefined)(filterValue)) { result = _m_utils.default.formatValue(filterValue, formatOptions) } return result }; function getColumnFilterValue(that, column) { if (column) { return isOnClickApplyFilterMode(that) && void 0 !== column.bufferedFilterValue ? column.bufferedFilterValue : column.filterValue } } const getColumnSelectedFilterOperation = function(that, column) { if (column) { return isOnClickApplyFilterMode(that) && void 0 !== column.bufferedSelectedFilterOperation ? column.bufferedSelectedFilterOperation : column.selectedFilterOperation } }; const getFilterValue = function(that, columnIndex, $editorContainer) { const column = that._columnsController.columnOption(columnIndex); const filterValue = getColumnFilterValue(that, column); const isFilterRange = $editorContainer.closest(`.${that.addWidgetPrefix("filter-range-overlay")}`).length; const isRangeStart = $editorContainer.hasClass(that.addWidgetPrefix("filter-range-start")); if (filterValue && Array.isArray(filterValue) && "between" === getColumnSelectedFilterOperation(that, column)) { if (isRangeStart) { return filterValue[0] } return filterValue[1] } return !isFilterRange && function(filterValue, column) { if (column && BETWEEN_OPERATION_DATA_TYPES.includes(column.dataType) && Array.isArray(filterValue)) { return false } return void 0 !== filterValue }(filterValue, column) ? filterValue : null }; const updateFilterValue = function(that, options) { const value = "" === options.value ? null : options.value; const $editorContainer = options.container; const column = that._columnsController.columnOption(options.column.index); const filterValue = getFilterValue(that, column.index, $editorContainer); if (!(0, _type.isDefined)(filterValue) && !(0, _type.isDefined)(value)) { return } that._applyFilterViewController.setHighLight($editorContainer, filterValue !== value); const columnOptionName = isOnClickApplyFilterMode(that) ? "bufferedFilterValue" : "filterValue"; const normalizedValue = function(that, filterValue, column, $editorContainer) { if ("between" === getColumnSelectedFilterOperation(that, column)) { const columnFilterValue = getColumnFilterValue(that, column); if ($editorContainer.hasClass(that.addWidgetPrefix("filter-range-start"))) { return [filterValue, Array.isArray(columnFilterValue) ? columnFilterValue[1] : void 0] } return [Array.isArray(columnFilterValue) ? columnFilterValue[0] : columnFilterValue, filterValue] } return filterValue }(that, value, column, $editorContainer); const isBetween = "between" === getColumnSelectedFilterOperation(that, column); const notFireEvent = options.notFireEvent || isBetween && Array.isArray(normalizedValue) && normalizedValue.includes(void 0); that._columnsController.columnOption(column.index, columnOptionName, normalizedValue, notFireEvent) }; class ApplyFilterViewController extends _m_modules.default.ViewController { init() { this._columnsController = this.getController("columns") } _getHeaderPanel() { if (!this._headerPanel) { this._headerPanel = this.getView("headerPanel") } return this._headerPanel } setHighLight($element, value) { if (isOnClickApplyFilterMode(this)) { $element && $element.toggleClass("dx-highlight-outline", value) && $element.closest(".dx-editor-cell").toggleClass("dx-filter-modified", value); this._getHeaderPanel().enableApplyButton(value) } } applyFilter() { const columns = this._columnsController.getColumns(); this._columnsController.beginUpdate(); for (let i = 0; i < columns.length; i++) { const column = columns[i]; if (void 0 !== column.bufferedFilterValue) { this._columnsController.columnOption(i, "filterValue", column.bufferedFilterValue); column.bufferedFilterValue = void 0 } if (void 0 !== column.bufferedSelectedFilterOperation) { this._columnsController.columnOption(i, "selectedFilterOperation", column.bufferedSelectedFilterOperation); column.bufferedSelectedFilterOperation = void 0 } } this._columnsController.endUpdate(); this.removeHighLights() } removeHighLights() { if (isOnClickApplyFilterMode(this)) { const columnHeadersViewElement = this.getView("columnHeadersView").element(); columnHeadersViewElement.find(`.${this.addWidgetPrefix("filter-row")} .dx-highlight-outline`).removeClass("dx-highlight-outline"); columnHeadersViewElement.find(`.${this.addWidgetPrefix("filter-row")} .dx-filter-modified`).removeClass("dx-filter-modified"); this._getHeaderPanel().enableApplyButton(false) } } setCurrentColumnForFiltering(column) { this._currentColumn = column } getCurrentColumnForFiltering() { return this._currentColumn } } exports.ApplyFilterViewController = ApplyFilterViewController; exports.filterRowModule = { defaultOptions: () => ({ syncLookupFilterValues: true, filterRow: { visible: false, showOperationChooser: true, showAllText: _message.default.format("dxDataGrid-filterRowShowAllText"), resetOperationText: _message.default.format("dxDataGrid-filterRowResetOperationText"), applyFilter: "auto", applyFilterText: _message.default.format("dxDataGrid-applyFilterText"), operationDescriptions: { equal: _message.default.format("dxDataGrid-filterRowOperationEquals"), notEqual: _message.default.format("dxDataGrid-filterRowOperationNotEquals"), lessThan: _message.default.format("dxDataGrid-filterRowOperationLess"), lessThanOrEqual: _message.default.format("dxDataGrid-filterRowOperationLessOrEquals"), greaterThan: _message.default.format("dxDataGrid-filterRowOperationGreater"), greaterThanOrEqual: _message.default.format("dxDataGrid-filterRowOperationGreaterOrEquals"), startsWith: _message.default.format("dxDataGrid-filterRowOperationStartsWith"), contains: _message.default.format("dxDataGrid-filterRowOperationContains"), notContains: _message.default.format("dxDataGrid-filterRowOperationNotContains"), endsWith: _message.default.format("dxDataGrid-filterRowOperationEndsWith"), between: _message.default.format("dxDataGrid-filterRowOperationBetween"), isBlank: _message.default.format("dxFilterBuilder-filterOperationIsBlank"), isNotBlank: _message.default.format("dxFilterBuilder-filterOperationIsNotBlank") }, betweenStartText: _message.default.format("dxDataGrid-filterRowOperationBetweenStartText"), betweenEndText: _message.default.format("dxDataGrid-filterRowOperationBetweenEndText") } }), controllers: { applyFilter: ApplyFilterViewController }, extenders: { controllers: { data: Base => class extends Base { skipCalculateColumnFilters() { return false } _calculateAdditionalFilter() { if (this.skipCalculateColumnFilters()) { return super._calculateAdditionalFilter() } const filters = [super._calculateAdditionalFilter()]; const columns = this._columnsController.getVisibleColumns(null, true); const applyFilterController = this._applyFilterController; (0, _iterator.each)(columns, (function() { var _applyFilterControlle; const shouldSkip = (null === (_applyFilterControlle = applyFilterController.getCurrentColumnForFiltering()) || void 0 === _applyFilterControlle ? void 0 : _applyFilterControlle.index) === this.index; if (this.allowFiltering && this.calculateFilterExpression && (0, _type.isDefined)(this.filterValue) && !shouldSkip) { const filter = this.createFilterExpression(this.filterValue, this.selectedFilterOperation || this.defaultFilterOperation, "filterRow"); filters.push(filter) } })); return _m_utils.default.combineFilters(filters) } }, columnsResizer: Base => class extends Base { _startResizing() { const that = this; super._startResizing.apply(that, arguments); if (that.isResizing()) { const overlayInstance = that._columnHeadersView.getFilterRangeOverlayInstance(); if (overlayInstance) { const cellIndex = overlayInstance.$element().closest("td").index(); if (cellIndex === that._targetPoint.columnIndex || cellIndex === that._targetPoint.columnIndex + 1) { overlayInstance.$content().hide() } } } } _endResizing() { const that = this; let $cell; if (that.isResizing()) { const overlayInstance = that._columnHeadersView.getFilterRangeOverlayInstance(); if (overlayInstance) { $cell = overlayInstance.$element().closest("td"); that._columnHeadersView._updateFilterRangeOverlay({ width: (0, _size.getOuterWidth)($cell, true) + 1 }); overlayInstance.$content().show() } } super._endResizing.apply(that, arguments) } }, editing: Base => class extends Base { updateFieldValue(options) { if (options.column.lookup) { this._needUpdateLookupDataSource = true } return super.updateFieldValue.apply(this, arguments) } _afterSaveEditData(cancel) { if (this._needUpdateLookupDataSource && !cancel) { var _this$getView; null === (_this$getView = this.getView("columnHeadersView")) || void 0 === _this$getView || _this$getView.updateLookupDataSource() } this._needUpdateLookupDataSource = false; return super._afterSaveEditData.apply(this, arguments) } _afterCancelEditData() { this._needUpdateLookupDataSource = false; return super._afterCancelEditData.apply(this, arguments) } } }, views: { columnHeadersView: Base => class extends Base { init() { super.init(); this._applyFilterViewController = this.getController("applyFilter") } optionChanged(args) { switch (args.name) { case "filterRow": case "showColumnLines": this._invalidate(true, true); args.handled = true; break; case "syncLookupFilterValues": if (args.value) { this.updateLookupDataSource() } else { this.render() } args.handled = true; break; default: super.optionChanged(args) } } _updateEditorValue(column, $editorContainer) { const editor = getEditorInstance($editorContainer); editor && editor.option("value", getFilterValue(this, column.index, $editorContainer)) } _columnOptionChanged(e) { const that = this; const { optionNames: optionNames } = e; let $cell; let $editorContainer; let $editorRangeElements; let $menu; if (_m_utils.default.checkChanges(optionNames, ["filterValue", "bufferedFilterValue", "selectedFilterOperation", "bufferedSelectedFilterOperation", "filterValues", "filterType"]) && void 0 !== e.columnIndex) { const visibleIndex = that._columnsController.getVisibleIndex(e.columnIndex); const column = that._columnsController.columnOption(e.columnIndex); $cell = that._getCellElement(that.element().find(`.${that.addWidgetPrefix("filter-row")}`).index(), visibleIndex) ?? (0, _renderer.default)(); $editorContainer = $cell.find(".dx-editor-container").first(); if (optionNames.filterValue || optionNames.bufferedFilterValue) { that._updateEditorValue(column, $editorContainer); const overlayInstance = $cell.find(`.${that.addWidgetPrefix("filter-range-overlay")}`).data("dxOverlay"); if (overlayInstance) { $editorRangeElements = overlayInstance.$content().find(".dx-editor-container"); that._updateEditorValue(column, $editorRangeElements.first()); that._updateEditorValue(column, $editorRangeElements.last()) } if (!overlayInstance || !overlayInstance.option("visible")) { that._updateFilterRangeContent($cell, getRangeTextByFilterValue(that, column)) } } if (optionNames.selectedFilterOperation || optionNames.bufferedSelectedFilterOperation) { if (visibleIndex >= 0 && column) { $menu = $cell.find(".dx-menu"); if ($menu.length) { that._updateFilterOperationChooser($menu, column, $editorContainer); if ("between" === getColumnSelectedFilterOperation(that, column)) { that._renderFilterRangeContent($cell, column) } else if ($editorContainer.find(".dx-filter-range-content").length) { that._renderEditor($editorContainer, that._getEditorOptions($editorContainer, column)); that._hideFilterRange() } } } } return } super._columnOptionChanged(e) } _renderCore() { this._filterRangeOverlayInstance = null; return super._renderCore.apply(this, arguments) } _resizeCore() { var _this$_filterRangeOve; super._resizeCore.apply(this, arguments); null === (_this$_filterRangeOve = this._filterRangeOverlayInstance) || void 0 === _this$_filterRangeOve || _this$_filterRangeOve.repaint() } isFilterRowVisible() { return this._isElementVisible(this.option("filterRow")) } isVisible() { return super.isVisible() || this.isFilterRowVisible() } _initFilterRangeOverlay($cell, column) { const that = this; const sharedData = {}; const $editorContainer = $cell.find(".dx-editor-container"); const filterRangeOverlayClass = that.addWidgetPrefix("filter-range-overlay"); const $overlay = (0, _renderer.default)("
").addClass(filterRangeOverlayClass).appendTo($cell); return that._createComponent($overlay, _ui.default, { height: "auto", shading: false, showTitle: false, focusStateEnabled: false, hideOnOutsideClick: true, wrapperAttr: { class: filterRangeOverlayClass }, animation: false, position: { my: "top", at: "top", of: $editorContainer.length && $editorContainer || $cell, offset: "0 -1" }, contentTemplate(contentElement) { let editorOptions; let $editor = (0, _renderer.default)("
").addClass(`dx-editor-container ${that.addWidgetPrefix("filter-range-start")}`).appendTo(contentElement); column = that._columnsController.columnOption(column.index); editorOptions = that._getEditorOptions($editor, column); editorOptions.sharedData = sharedData; that._renderEditor($editor, editorOptions); _events_engine.default.on($editor.find("input:not([type='hidden'])"), "keydown", (e => { let $prevElement = $cell.find("[tabindex]").not(e.target).first(); if ("tab" === (0, _index.normalizeKeyName)(e) && e.shiftKey) { e.preventDefault(); that._hideFilterRange(); if (!$prevElement.length) { $prevElement = $cell.prev().find("[tabindex]").last() } _events_engine.default.trigger($prevElement, "focus") } })); $editor = (0, _renderer.default)("
").addClass(`dx-editor-container ${that.addWidgetPrefix("filter-range-end")}`).appendTo(contentElement); editorOptions = that._getEditorOptions($editor, column); editorOptions.sharedData = sharedData; that._renderEditor($editor, editorOptions); _events_engine.default.on($editor.find("input:not([type='hidden'])"), "keydown", (e => { if ("tab" === (0, _index.normalizeKeyName)(e) && !e.shiftKey) { e.preventDefault(); that._hideFilterRange(); _events_engine.default.trigger($cell.next().find("[tabindex]").first(), "focus") } })); return (0, _renderer.default)(contentElement).addClass(that.getWidgetContainerClass()) }, onShown(e) { const $editor = e.component.$content().find(".dx-editor-container").first(); _events_engine.default.trigger($editor.find("input:not([type='hidden'])"), "focus") }, onHidden() { column = that._columnsController.columnOption(column.index); $cell.find(".dx-menu").parent().addClass("dx-editor-with-menu"); if ("between" === getColumnSelectedFilterOperation(that, column)) { that._updateFilterRangeContent($cell, getRangeTextByFilterValue(that, column)); that.component.updateDimensions() } } }) } _updateFilterRangeOverlay(options) { const overlayInstance = this._filterRangeOverlayInstance; overlayInstance && overlayInstance.option(options) } _showFilterRange($cell, column) { const that = this; const $overlay = $cell.children(`.${that.addWidgetPrefix("filter-range-overlay")}`); let overlayInstance = $overlay.length && $overlay.data("dxOverlay"); if (!overlayInstance && column) { overlayInstance = that._initFilterRangeOverlay($cell, column) } if (!overlayInstance.option("visible")) { that._filterRangeOverlayInstance && that._filterRangeOverlayInstance.hide(); that._filterRangeOverlayInstance = overlayInstance; that._updateFilterRangeOverlay({ width: (0, _size.getOuterWidth)($cell, true) + 1 }); that._filterRangeOverlayInstance && that._filterRangeOverlayInstance.show() } } _hideFilterRange() { const overlayInstance = this._filterRangeOverlayInstance; overlayInstance && overlayInstance.hide() } getFilterRangeOverlayInstance() { return this._filterRangeOverlayInstance } _createRow(row) { const $row = super._createRow(row); if ("filter" === row.rowType) { $row.addClass(this.addWidgetPrefix("filter-row")); if (!this.option("useLegacyKeyboardNavigation")) { _events_engine.default.on($row, "keydown", (event => (0, _accessibility.selectView)("filterRow", this, event))) } } return $row } _getRows() { const result = super._getRows(); if (this.isFilterRowVisible()) { result.push({ rowType: "filter" }) } return result } _renderFilterCell(cell, options) { const that = this; const { column: column } = options; const $cell = (0, _renderer.default)(cell); if (that.component.option("showColumnHeaders")) { that.setAria("describedby", column.headerId, $cell) } that.setAria("label", _message.default.format("dxDataGrid-ariaFilterCell"), $cell); $cell.addClass("dx-editor-cell"); const $container = (0, _renderer.default)("
").appendTo($cell); const $editorContainer = (0, _renderer.default)("
").addClass("dx-editor-container").appendTo($container); if ("between" === getColumnSelectedFilterOperation(that, column)) { that._renderFilterRangeContent($cell, column) } else { const editorOptions = that._getEditorOptions($editorContainer, column); that._renderEditor($editorContainer, editorOptions) } const { alignment: alignment } = column; if (alignment && "center" !== alignment) { $cell.find("input:not([type='hidden'])").first().css("textAlign", column.alignment) } if (column.filterOperations && column.filterOperations.length) { that._renderFilterOperationChooser($container, column, $editorContainer) } } _renderCellContent($cell, options) { const that = this; const { column: column } = options; if ("filter" === options.rowType) { if (column.command) { $cell.html(" ") } else if (column.allowFiltering) { that.renderTemplate($cell, that._renderFilterCell.bind(that), options).done((() => { that._updateCell($cell, options) })); return } } super._renderCellContent.apply(this, arguments) } _getEditorOptions($editorContainer, column) { const that = this; const accessibilityOptions = { editorOptions: { inputAttr: that._getFilterInputAccessibilityAttributes(column) } }; const result = (0, _extend.extend)(accessibilityOptions, column, { value: getFilterValue(that, column.index, $editorContainer), parentType: "filterRow", showAllText: that.option("filterRow.showAllText"), updateValueTimeout: "onClick" === that.option("filterRow.applyFilter") ? 0 : 700, width: null, setValue(value, notFireEvent) { updateFilterValue(that, { column: column, value: value, container: $editorContainer, notFireEvent: notFireEvent }) } }); if ("between" === getColumnSelectedFilterOperation(that, column)) { if ($editorContainer.hasClass(that.addWidgetPrefix("filter-range-start"))) { result.placeholder = that.option("filterRow.betweenStartText") } else { result.placeholder = that.option("filterRow.betweenEndText") } } return result } _getFilterInputAccessibilityAttributes(column) { const columnAriaLabel = _message.default.format("dxDataGrid-ariaFilterCell"); if (this.component.option("showColumnHeaders")) { return { "aria-label": columnAriaLabel, "aria-describedby": column.headerId } } return { "aria-label": columnAriaLabel } } _renderEditor($editorContainer, options) { $editorContainer.empty(); const $element = (0, _renderer.default)("
").appendTo($editorContainer); const dataSource = this._dataController.dataSource(); if (options.lookup && this.option("syncLookupFilterValues")) { this._applyFilterViewController.setCurrentColumnForFiltering(options); const filter = this._dataController.getCombinedFilter(); this._applyFilterViewController.setCurrentColumnForFiltering(null); const lookupDataSource = _m_utils.default.getWrappedLookupDataSource(options, dataSource, filter); const lookupOptions = _extends({}, options, { lookup: _extends({}, options.lookup, { dataSource: lookupDataSource }) }); return this._editorFactoryController.createEditor($element, lookupOptions) } return this._editorFactoryController.createEditor($element, options) } _renderFilterRangeContent($cell, column) { const that = this; const $editorContainer = $cell.find(".dx-editor-container").first(); $editorContainer.empty(); const $filterRangeContent = (0, _renderer.default)("
").addClass("dx-filter-range-content").attr("tabindex", this.option("tabIndex")); _events_engine.default.on($filterRangeContent, "focusin", (() => { that._showFilterRange($cell, column) })); $filterRangeContent.appendTo($editorContainer); that._updateFilterRangeContent($cell, getRangeTextByFilterValue(that, column)) } _updateFilterRangeContent($cell, value) { const $filterRangeContent = $cell.find(".dx-filter-range-content"); if ($filterRangeContent.length) { if ("" === value) { $filterRangeContent.html(" ") } else { $filterRangeContent.text(value) } } } _updateFilterOperationChooser($menu, column, $editorContainer) { const that = this; let isCellWasFocused; const restoreFocus = function() { const menu = _menu.default.getInstance($menu); menu && menu.option("focusedElement", null); isCellWasFocused && that._focusEditor($editorContainer) }; const editorFactoryController = this._editorFactoryController; that._createComponent($menu, _menu.default, { integrationOptions: {}, activeStateEnabled: false, selectionMode: "single", cssClass: `${that.getWidgetContainerClass()} dx-cell-focus-disabled dx-filter-menu`, showFirstSubmenuMode: "onHover", hideSubmenuOnMouseLeave: true, items: [{ disabled: !(column.filterOperations && column.filterOperations.length), icon: OPERATION_ICONS[getColumnSelectedFilterOperation(that, column) || "default"], selectable: false, items: that._getFilterOperationMenuItems(column) }], onItemRendered: _ref => { let { itemElement: itemElement } = _ref; this.setAria("label", ARIA_SEARCH_BOX, (0, _renderer.default)(itemElement)) }, onItemClick(properties) { const selectedFilterOperation = properties.itemData.name; const columnSelectedFilterOperation = getColumnSelectedFilterOperation(that, column); let notFocusEditor = false; const isOnClickMode = isOnClickApplyFilterMode(that); const options = {}; if (properties.itemData.items || selectedFilterOperation && selectedFilterOperation === columnSelectedFilterOperation) { return } if (selectedFilterOperation) { options[isOnClickMode ? "bufferedSelectedFilterOperation" : "selectedFilterOperation"] = selectedFilterOperation; if ("between" === selectedFilterOperation || "between" === columnSelectedFilterOperation) { notFocusEditor = "between" === selectedFilterOperation; options[isOnClickMode ? "bufferedFilterValue" : "filterValue"] = null } } else { options[isOnClickMode ? "bufferedFilterValue" : "filterValue"] = null; options[isOnClickMode ? "bufferedSelectedFilterOperation" : "selectedFilterOperation"] = column.defaultSelectedFilterOperation || null } that._columnsController.columnOption(column.index, options); that._applyFilterViewController.setHighLight($editorContainer, true); if (!selectedFilterOperation) { const editor = getEditorInstance($editorContainer); if (editor && "dxDateBox" === editor.NAME && !editor.option("isValid")) { editor.clear(); editor.option("isValid", true) } } if (!notFocusEditor) { that._focusEditor($editorContainer) } else { that._showFilterRange($editorContainer.closest(".dx-editor-cell"), column) } }, onSubmenuShowing() { isCellWasFocused = that._isEditorFocused($editorContainer); editorFactoryController.loseFocus() }, onSubmenuHiding() { _events_engine.default.trigger($menu, "blur"); restoreFocus() }, onContentReady(e) { _events_engine.default.on($menu, "blur", (() => { const menu = e.component; menu._hideSubmenuAfterTimeout(); restoreFocus() })) }, rtlEnabled: that.option("rtlEnabled") }) } _isEditorFocused($container) { return $container.hasClass("dx-focused") || $container.parents(".dx-focused").length } _focusEditor($container) { this._editorFactoryController.focus($container); _events_engine.default.trigger($container.find("input:not([type='hidden'])"), "focus") } _renderFilterOperationChooser($container, column, $editorContainer) { const that = this; let $menu; if (that.option("filterRow.showOperationChooser")) { $container.addClass("dx-editor-with-menu"); $menu = (0, _renderer.default)("
").prependTo($container); that._updateFilterOperationChooser($menu, column, $editorContainer) } } _getFilterOperationMenuItems(column) { const that = this; let result = [{}]; const filterRowOptions = that.option("filterRow"); const operationDescriptions = filterRowOptions && filterRowOptions.operationDescriptions || {}; if (column.filterOperations && column.filterOperations.length) { const availableFilterOperations = column.filterOperations.filter((value => (0, _type.isDefined)(OPERATION_DESCRIPTORS[value]))); result = (0, _iterator.map)(availableFilterOperations, (value => { const descriptionName = OPERATION_DESCRIPTORS[value]; return { name: value, selected: (getColumnSelectedFilterOperation(that, column) || column.defaultFilterOperation) === value, text: operationDescriptions[descriptionName], icon: OPERATION_ICONS[value] } })); result.push({ name: null, text: filterRowOptions && filterRowOptions.resetOperationText, icon: OPERATION_ICONS.default }) } return result } _handleDataChanged(e) { var _this$_dataController, _this$_dataController2, _dataSource$lastLoadO, _e$operationTypes, _e$operationTypes2; const dataSource = null === (_this$_dataController = this._dataController) || void 0 === _this$_dataController || null === (_this$_dataController2 = _this$_dataController.dataSource) || void 0 === _this$_dataController2 ? void 0 : _this$_dataController2.call(_this$_dataController); const lastLoadOptions = null === dataSource || void 0 === dataSource || null === (_dataSource$lastLoadO = dataSource.lastLoadOptions) || void 0 === _dataSource$lastLoadO ? void 0 : _dataSource$lastLoadO.call(dataSource); super._handleDataChanged.apply(this, arguments); if (null !== (_e$operationTypes = e.operationTypes) && void 0 !== _e$operationTypes && _e$operationTypes.filtering || null !== (_e$operationTypes2 = e.operationTypes) && void 0 !== _e$operationTypes2 && _e$operationTypes2.fullReload) { var _e$operationTypes3; this.updateLookupDataSource((null === (_e$operationTypes3 = e.operationTypes) || void 0 === _e$operationTypes3 ? void 0 : _e$operationTypes3.filtering) || (null === lastLoadOptions || void 0 === lastLoadOptions ? void 0 : lastLoadOptions.filter)) } } updateLookupDataSource(filterChanged) { if (!this.option("syncLookupFilterValues")) { return } if (!this.element()) { return } const columns = this._columnsController.getVisibleColumns(); const dataSource = this._dataController.dataSource(); const applyFilterViewController = this._applyFilterViewController; const rowIndex = this.element().find(`.${this.addWidgetPrefix("filter-row")}`).index(); if (-1 === rowIndex) { return } columns.forEach(((column, index) => { if (!column.lookup || column.calculateCellValue !== column.defaultCalculateCellValue) { return } const $cell = this._getCellElement(rowIndex, index); const editor = getEditorInstance(null === $cell || void 0 === $cell ? void 0 : $cell.find(".dx-editor-container")); if (editor) { applyFilterViewController.setCurrentColumnForFiltering(column); const filter = this._dataController.getCombinedFilter() || null; applyFilterViewController.setCurrentColumnForFiltering(null); const editorDataSource = editor.option("dataSource"); const shouldUpdateFilter = !filterChanged || !(0, _common.equalByValue)(editorDataSource.__dataGridSourceFilter || null, filter); if (shouldUpdateFilter) { const lookupDataSource = _m_utils.default.getWrappedLookupDataSource(column, dataSource, filter); editor.option("dataSource", lookupDataSource) } } })) } }, headerPanel: Base => class extends Base { init() { super.init(); this._dataController = this.getController("data"); this._applyFilterViewController = this.getController("applyFilter") } optionChanged(args) { if ("filterRow" === args.name) { this._invalidate(); args.handled = true } else { super.optionChanged(args) } } _getToolbarItems() { const items = super._getToolbarItems(); const filterItem = this._prepareFilterItem(); return filterItem.concat(items) } _prepareFilterItem() { const that = this; const filterItem = []; if (that._isShowApplyFilterButton()) { const hintText = that.option("filterRow.applyFilterText"); const columns = that._columnsController.getColumns(); const disabled = !columns.filter((column => void 0 !== column.bufferedFilterValue)).length; const onInitialized = function(e) { (0, _renderer.default)(e.element).addClass(that._getToolbarButtonClass("dx-apply-button")) }; const onClickHandler = function() { that._applyFilterViewController.applyFilter() }; const toolbarItem = { widget: "dxButton", options: { icon: "apply-filter", disabled: disabled, onClick: onClickHandler, hint: hintText, text: hintText, onInitialized: onInitialized }, showText: "inMenu", name: "applyFilterButton", location: "after", locateInMenu: "auto", sortIndex: 10 }; filterItem.push(toolbarItem) } return filterItem } _isShowApplyFilterButton() { const filterRowOptions = this.option("filterRow"); return !!(null !== filterRowOptions && void 0 !== filterRowOptions && filterRowOptions.visible) && "onClick" === filterRowOptions.applyFilter } enableApplyButton(value) { this.setToolbarItemDisabled("applyFilterButton", !value) } isVisible() { return super.isVisible() || this._isShowApplyFilterButton() } } } } } }, 14407: /*!************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/filter/m_filter_sync.js ***! \************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.filterSyncModule = exports.FilterSyncController = void 0; var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _filtering = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/shared/filtering */ 18740)); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/widget/ui.errors */ 96688)); var _m_utils = __webpack_require__( /*! ../../../filter_builder/m_utils */ 70474); var _m_modules = _interopRequireDefault(__webpack_require__( /*! ../m_modules */ 15943)); var _m_utils2 = _interopRequireDefault(__webpack_require__( /*! ../m_utils */ 60082)); var _m_filter_custom_operations = __webpack_require__( /*! ./m_filter_custom_operations */ 9622); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const FILTER_ROW_OPERATIONS = ["=", "<>", "<", "<=", ">", ">=", "notcontains", "contains", "startswith", "endswith", "between"]; function getColumnIdentifier(column) { return column.name || column.dataField } const canSyncHeaderFilterWithFilterRow = function(column) { const filterValues = column.filterValues || []; return !_filtering.default.getGroupInterval(column) && !(column.headerFilter && column.headerFilter.dataSource) || 1 === filterValues.length && null === filterValues[0] }; const getConditionFromFilterRow = function(column) { const value = column.filterValue; if ((0, _type.isDefined)(value)) { const operation = column.selectedFilterOperation || column.defaultFilterOperation || (0, _m_utils.getDefaultOperation)(column); const filter = [getColumnIdentifier(column), operation, column.filterValue]; return filter } return null }; const getConditionFromHeaderFilter = function(column) { let selectedOperation; let value; const { filterValues: filterValues } = column; if (!filterValues) { return null } if (1 === filterValues.length && canSyncHeaderFilterWithFilterRow(column) && !Array.isArray(filterValues[0])) { "exclude" === column.filterType ? selectedOperation = "<>" : selectedOperation = "="; value = filterValues[0] } else { "exclude" === column.filterType ? selectedOperation = "noneof" : selectedOperation = "anyof"; value = filterValues } return [getColumnIdentifier(column), selectedOperation, value] }; const updateHeaderFilterCondition = function(columnsController, column, headerFilterCondition) { const headerFilter = function(headerFilterCondition, column) { if (!headerFilterCondition) { return { filterType: "include", filterValues: void 0 } } let filterType; const selectedFilterOperation = headerFilterCondition[1]; const value = headerFilterCondition[2]; const hasArrayValue = Array.isArray(value); if (!hasArrayValue) { if (!canSyncHeaderFilterWithFilterRow(column)) { return { filterType: "include", filterValues: void 0 } } } switch (selectedFilterOperation) { case "anyof": case "=": filterType = "include"; break; case "noneof": case "<>": filterType = "exclude"; break; default: return { filterType: "include", filterValues: void 0 } } return { filterType: filterType, filterValues: hasArrayValue ? value : [value] } }(headerFilterCondition, column); columnsController.columnOption(getColumnIdentifier(column), headerFilter) }; const updateFilterRowCondition = function(columnsController, column, condition) { let filterRowOptions; let selectedFilterOperation = null === condition || void 0 === condition ? void 0 : condition[1]; const filterValue = null === condition || void 0 === condition ? void 0 : condition[2]; const filterOperations = column.filterOperations || column.defaultFilterOperations; if ((!filterOperations || filterOperations.indexOf(selectedFilterOperation) >= 0 || selectedFilterOperation === column.defaultFilterOperation) && FILTER_ROW_OPERATIONS.includes(selectedFilterOperation) && null !== filterValue) { if (selectedFilterOperation === column.defaultFilterOperation && !(0, _type.isDefined)(column.selectedFilterOperation)) { selectedFilterOperation = column.selectedFilterOperation } filterRowOptions = { filterValue: filterValue, selectedFilterOperation: selectedFilterOperation } } else { filterRowOptions = { filterValue: void 0, selectedFilterOperation: void 0 } } columnsController.columnOption(getColumnIdentifier(column), filterRowOptions) }; class FilterSyncController extends _m_modules.default.Controller { init() { this._dataController = this.getController("data"); this._columnsController = this.getController("columns"); if (this._dataController.isFilterSyncActive()) { if (this._columnsController.isAllDataTypesDefined()) { this._initSync() } else { this._dataController.dataSourceChanged.add((() => this._initSync())) } } } publicMethods() { return ["getCustomFilterOperations"] } syncFilterValue() { const that = this; const columns = this._columnsController.getFilteringColumns(); this._skipSyncColumnOptions = true; columns.forEach((column => { const filterConditions = (0, _m_utils.getMatchedConditions)(that.option("filterValue"), getColumnIdentifier(column)); if (1 === filterConditions.length) { const filterCondition = filterConditions[0]; updateHeaderFilterCondition(this._columnsController, column, filterCondition); updateFilterRowCondition(this._columnsController, column, filterCondition) } else { (0, _type.isDefined)(column.filterValues) && updateHeaderFilterCondition(this._columnsController, column, null); (0, _type.isDefined)(column.filterValue) && updateFilterRowCondition(this._columnsController, column, null) } })); this._skipSyncColumnOptions = false } _initSync() { const columns = this._columnsController.getColumns(); const pageIndex = this._dataController.pageIndex(); ! function(columns) { columns.forEach((column => { const identifier = getColumnIdentifier(column); if (!(0, _type.isDefined)(identifier) && column.allowFiltering) { throw new _ui.default.Error("E1049", column.caption) } })) }(columns); if (!this.option("filterValue")) { const filteringColumns = this._columnsController.getFilteringColumns(); const filterValue = this.getFilterValueFromColumns(filteringColumns); this._silentOption("filterValue", filterValue) } this.syncFilterValue(); this._dataController.pageIndex(pageIndex) } _getSyncFilterRow(filterValue, column) { const filter = getConditionFromFilterRow(column); if ((0, _type.isDefined)(filter)) { return (0, _m_utils.syncFilters)(filterValue, filter) } return (0, _m_utils.removeFieldConditionsFromFilter)(filterValue, getColumnIdentifier(column)) } _getSyncHeaderFilter(filterValue, column) { const filter = getConditionFromHeaderFilter(column); if (filter) { return (0, _m_utils.syncFilters)(filterValue, filter) } return (0, _m_utils.removeFieldConditionsFromFilter)(filterValue, getColumnIdentifier(column)) } getFilterValueFromColumns(columns) { if (!this._dataController.isFilterSyncActive()) { return null } const filterValue = ["and"]; columns && columns.forEach((column => { const headerFilter = getConditionFromHeaderFilter(column); const filterRow = getConditionFromFilterRow(column); headerFilter && (0, _m_utils.addItem)(headerFilter, filterValue); filterRow && (0, _m_utils.addItem)(filterRow, filterValue) })); return (0, _m_utils.getNormalizedFilter)(filterValue) } syncFilterRow(column, filterValue) { this.option("filterValue", this._getSyncFilterRow(this.option("filterValue"), column)) } syncHeaderFilter(column) { this.option("filterValue", this._getSyncHeaderFilter(this.option("filterValue"), column)) } getCustomFilterOperations() { const filterBuilderCustomOperations = this.option("filterBuilder.customOperations") ?? []; return [(0, _m_filter_custom_operations.anyOf)(this.component), (0, _m_filter_custom_operations.noneOf)(this.component)].concat(filterBuilderCustomOperations) } } exports.FilterSyncController = FilterSyncController; exports.filterSyncModule = { defaultOptions: () => ({ filterValue: null, filterSyncEnabled: "auto" }), controllers: { filterSync: FilterSyncController }, extenders: { controllers: { data: Base => class extends Base { optionChanged(args) { switch (args.name) { case "filterValue": this._applyFilter(); this.isFilterSyncActive() && this._filterSyncController.syncFilterValue(); args.handled = true; break; case "filterSyncEnabled": args.handled = true; break; case "columns": if (this.isFilterSyncActive()) { const column = this._columnsController.getColumnByPath(args.fullName); if (column && !this._filterSyncController._skipSyncColumnOptions) { const propertyName = this._parseColumnPropertyName(args.fullName); this._filterSyncController._skipSyncColumnOptions = true; if ("filterType" === propertyName) { if ("exclude" === args.value || "exclude" === args.previousValue) { this._filterSyncController.syncHeaderFilter(column) } } else if ("filterValues" === propertyName) { this._filterSyncController.syncHeaderFilter(column) } else if (["filterValue", "selectedFilterOperation"].includes(propertyName)) { this._filterSyncController.syncFilterRow(column, column.filterValue) } this._filterSyncController._skipSyncColumnOptions = false } } super.optionChanged(args); break; default: super.optionChanged(args) } } isFilterSyncActive() { const filterSyncEnabledValue = this.option("filterSyncEnabled"); return "auto" === filterSyncEnabledValue ? this.option("filterPanel.visible") : filterSyncEnabledValue } skipCalculateColumnFilters() { return ((0, _type.isDefined)(this.option("filterValue")) || this._filterSyncController._skipSyncColumnOptions) && this.isFilterSyncActive() } _calculateAdditionalFilter() { if (false === this.option("filterPanel.filterEnabled")) { return super._calculateAdditionalFilter() } const filters = [super._calculateAdditionalFilter()]; const columns = this._columnsController.getFilteringColumns(); let filterValue = this.option("filterValue"); if (this.isFilterSyncActive()) { const currentColumnForHeaderFilter = this._headerFilterController.getCurrentColumn(); const currentColumnForFilterRow = this._applyFilterController.getCurrentColumnForFiltering(); const currentColumn = currentColumnForHeaderFilter || currentColumnForFilterRow; const needRemoveCurrentColumnFilter = currentColumnForHeaderFilter || (0, _type.isDefined)(null === currentColumnForFilterRow || void 0 === currentColumnForFilterRow ? void 0 : currentColumnForFilterRow.filterValue); if (needRemoveCurrentColumnFilter && filterValue) { filterValue = (0, _m_utils.removeFieldConditionsFromFilter)(filterValue, getColumnIdentifier(currentColumn)) } } const customOperations = this._filterSyncController.getCustomFilterOperations(); const calculatedFilterValue = (0, _m_utils.getFilterExpression)(filterValue, columns, customOperations, "filterBuilder"); if (calculatedFilterValue) { filters.push(calculatedFilterValue) } return _m_utils2.default.combineFilters(filters) } _parseColumnPropertyName(fullName) { const matched = fullName.match(/.*\.(.*)/); if (matched) { return matched[1] } return null } clearFilter(filterName) { this.component.beginUpdate(); if (arguments.length > 0) { if ("filterValue" === filterName) { this.option("filterValue", null) } super.clearFilter(filterName) } else { this.option("filterValue", null); super.clearFilter() } this.component.endUpdate() } _applyFilter() { if (this._filterSyncController._skipSyncColumnOptions) { return (new _deferred.Deferred).resolve() } return super._applyFilter.apply(this, arguments) } } }, views: { columnHeadersView: Base => class extends Base { optionChanged(args) { if ("filterValue" === args.name) { this._updateHeaderFilterIndicators() } else { super.optionChanged(args) } } _isHeaderFilterEmpty(column) { if (this._dataController.isFilterSyncActive()) { return !(0, _m_utils.filterHasField)(this.option("filterValue"), getColumnIdentifier(column)) } return super._isHeaderFilterEmpty(column) } _needUpdateFilterIndicators() { return !this._dataController.isFilterSyncActive() } } } } } }, 5325: /*!*****************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/focus/m_focus.js ***! \*****************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.focusModule = exports.FocusController = void 0; var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _m_editing_utils = __webpack_require__( /*! ../editing/m_editing_utils */ 89237); var _m_modules = _interopRequireDefault(__webpack_require__( /*! ../m_modules */ 15943)); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../m_utils */ 60082)); var _m_focus_utils = __webpack_require__( /*! ./m_focus_utils */ 32710); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } class FocusController extends _m_modules.default.ViewController { getKeyboardController() { return this.getController("keyboardNavigation") } getDataController() { return this.getController("data") } init() { this.component._optionsByReference.focusedRowKey = true } optionChanged(args) { const { name: name, value: value, previousValue: previousValue } = args; switch (name) { case "focusedRowIndex": this._focusRowByIndex(value); this.getKeyboardController()._fireFocusedRowChanged(); args.handled = true; break; case "focusedRowKey": if (Array.isArray(value) && JSON.stringify(value) === JSON.stringify(previousValue)) { return } this._focusRowByKey(value); this.getKeyboardController()._fireFocusedRowChanged(); args.handled = true; break; case "focusedColumnIndex": case "focusedRowEnabled": case "autoNavigateToFocusedRow": args.handled = true; break; default: super.optionChanged(args) } } publicMethods() { return ["navigateToRow", "isRowFocused"] } isAutoNavigateToFocusedRow() { return "infinite" !== this.option("scrolling.mode") && this.option("autoNavigateToFocusedRow") } _focusRowByIndex(index, operationTypes) { if (!this.option("focusedRowEnabled")) { return } index = void 0 !== index ? index : this.option("focusedRowIndex"); if (index < 0) { if (this.isAutoNavigateToFocusedRow()) { this._resetFocusedRow() } } else { this._focusRowByIndexCore(index, operationTypes) } } _focusRowByIndexCore(index, operationTypes) { const pageSize = this.getDataController().pageSize(); const setKeyByIndex = () => { if (this._isValidFocusedRowIndex(index)) { let rowIndex = index - this.getDataController().getRowIndexOffset(true); if (!operationTypes || operationTypes.paging && !operationTypes.filtering) { const lastItemIndex = this.getDataController()._getLastItemIndex(); rowIndex = Math.min(rowIndex, lastItemIndex) } const focusedRowKey = this.getDataController().getKeyByRowIndex(rowIndex, true); if ((0, _type.isDefined)(focusedRowKey) && !this.isRowFocused(focusedRowKey)) { this.option("focusedRowKey", focusedRowKey) } } }; if (pageSize >= 0) { if (!this._isLocalRowIndex(index)) { const pageIndex = Math.floor(index / this.getDataController().pageSize()); (0, _deferred.when)(this.getDataController().pageIndex(pageIndex), this.getDataController().waitReady()).done((() => { setKeyByIndex() })) } else { setKeyByIndex() } } } _isLocalRowIndex(index) { const isVirtualScrolling = this.getKeyboardController()._isVirtualScrolling(); if (isVirtualScrolling) { const pageIndex = Math.floor(index / this.getDataController().pageSize()); const virtualItems = this.getDataController().virtualItemsCount(); const virtualItemsBegin = virtualItems ? virtualItems.begin : -1; const visibleRowsCount = this.getDataController().getVisibleRows().length + this.getDataController().getRowIndexOffset(); const visiblePagesCount = Math.ceil(visibleRowsCount / this.getDataController().pageSize()); return virtualItemsBegin <= index && visiblePagesCount > pageIndex } return true } _setFocusedRowKeyByIndex(index) { if (this._isValidFocusedRowIndex(index)) { const rowIndex = Math.min(index - this.getDataController().getRowIndexOffset(), this.getDataController().items().length - 1); const focusedRowKey = this.getDataController().getKeyByRowIndex(rowIndex); if ((0, _type.isDefined)(focusedRowKey) && !this.isRowFocused(focusedRowKey)) { this.option("focusedRowKey", focusedRowKey) } } } _focusRowByKey(key) { if (!(0, _type.isDefined)(key)) { this._resetFocusedRow() } else { this._navigateToRow(key, true) } } _resetFocusedRow() { const focusedRowKey = this.option("focusedRowKey"); const isFocusedRowKeyDefined = (0, _type.isDefined)(focusedRowKey); if (!isFocusedRowKeyDefined && this.option("focusedRowIndex") < 0) { return } if (isFocusedRowKeyDefined) { this.option("focusedRowKey", null) } this.getKeyboardController().setFocusedRowIndex(-1); this.option("focusedRowIndex", -1); this.getDataController().updateItems({ changeType: "updateFocusedRow", focusedRowKey: null }); this.getKeyboardController()._fireFocusedRowChanged() } _isValidFocusedRowIndex(rowIndex) { const row = this.getDataController().getVisibleRows()[rowIndex]; return !row || "data" === row.rowType || "group" === row.rowType } navigateToRow(key) { if (!this.isAutoNavigateToFocusedRow()) { this.option("focusedRowIndex", -1) } return this._navigateToRow(key) } _navigateToRow(key, needFocusRow) { const that = this; const isAutoNavigate = that.isAutoNavigateToFocusedRow(); const d = new _deferred.Deferred; if (void 0 === key || !this.getDataController().dataSource()) { return d.reject().promise() } const rowIndexByKey = that.getFocusedRowIndexByKey(key); if (!isAutoNavigate && needFocusRow || rowIndexByKey >= 0) { that._navigateTo(key, d, needFocusRow) } else { this.getDataController().getPageIndexByKey(key).done((pageIndex => { if (pageIndex < 0) { d.resolve(-1); return } if (pageIndex === this.getDataController().pageIndex()) { this.getDataController().reload().done((() => { if (that.isRowFocused(key) && this.getDataController().getRowIndexByKey(key) >= 0) { d.resolve(that.getFocusedRowIndexByKey(key)) } else { that._navigateTo(key, d, needFocusRow) } })).fail(d.reject) } else { this.getDataController().pageIndex(pageIndex).done((() => { that._navigateTo(key, d, needFocusRow) })).fail(d.reject) } })).fail(d.reject) } return d.promise() } _navigateTo(key, deferred, needFocusRow) { const visibleRowIndex = this.getDataController().getRowIndexByKey(key); const isVirtualRowRenderingMode = _m_utils.default.isVirtualRowRendering(this); const isAutoNavigate = this.isAutoNavigateToFocusedRow(); if (isAutoNavigate && isVirtualRowRenderingMode && visibleRowIndex < 0) { this._navigateToVirtualRow(key, deferred, needFocusRow) } else { this._navigateToVisibleRow(key, deferred, needFocusRow) } } _navigateToVisibleRow(key, deferred, needFocusRow) { if (needFocusRow) { this._triggerUpdateFocusedRow(key, deferred) } else { const focusedRowIndex = this.getFocusedRowIndexByKey(key); this.getView("rowsView").scrollToRowElement(key, deferred).done((() => { deferred.resolve(focusedRowIndex) })) } } _navigateToVirtualRow(key, deferred, needFocusRow) { const rowsScrollController = this.getDataController()._rowsScrollController; const rowIndex = _m_utils.default.getIndexByKey(key, this.getDataController().items(true)); const scrollable = this.getView("rowsView").getScrollable(); if (rowsScrollController && scrollable && rowIndex >= 0) { const focusedRowIndex = rowIndex + this.getDataController().getRowIndexOffset(true); const offset = rowsScrollController.getItemOffset(focusedRowIndex); const triggerUpdateFocusedRow = () => { if (this.getDataController().totalCount() && !this.getDataController().items().length) { return } this.component.off("contentReady", triggerUpdateFocusedRow); if (needFocusRow) { this._triggerUpdateFocusedRow(key, deferred) } else { deferred.resolve(focusedRowIndex) } }; this.component.on("contentReady", triggerUpdateFocusedRow); this.getView("rowsView").scrollTopPosition(offset) } else { deferred.resolve(-1) } } _triggerUpdateFocusedRow(key, deferred) { const focusedRowIndex = this.getFocusedRowIndexByKey(key); if (this._isValidFocusedRowIndex(focusedRowIndex)) { let d; if (this.option("focusedRowEnabled")) { this.getDataController().updateItems({ changeType: "updateFocusedRow", focusedRowKey: key }) } else { d = this.getView("rowsView").scrollToRowElement(key) }(0, _deferred.when)(d).done((() => { this.getKeyboardController().setFocusedRowIndex(focusedRowIndex); deferred && deferred.resolve(focusedRowIndex) })) } else { deferred && deferred.resolve(-1) } } getFocusedRowIndexByKey(key) { const loadedRowIndex = this.getDataController().getRowIndexByKey(key, true); return loadedRowIndex >= 0 ? loadedRowIndex + this.getDataController().getRowIndexOffset(true) : -1 } _focusRowByKeyOrIndex() { const focusedRowKey = this.option("focusedRowKey"); let currentFocusedRowIndex = this.option("focusedRowIndex"); if ((0, _type.isDefined)(focusedRowKey)) { const visibleRowIndex = this.getDataController().getRowIndexByKey(focusedRowKey); if (visibleRowIndex >= 0) { if (this.getKeyboardController()._isVirtualScrolling()) { currentFocusedRowIndex = visibleRowIndex + this.getDataController().getRowIndexOffset() } this.getKeyboardController().setFocusedRowIndex(currentFocusedRowIndex); this._triggerUpdateFocusedRow(focusedRowKey) } else { this._navigateToRow(focusedRowKey, true).done((focusedRowIndex => { if (currentFocusedRowIndex >= 0 && focusedRowIndex < 0) { this._focusRowByIndex() } else if (currentFocusedRowIndex < 0 && focusedRowIndex >= 0) { this.getKeyboardController().setFocusedRowIndex(focusedRowIndex) } })) } } else if (currentFocusedRowIndex >= 0) { this._focusRowByIndex(currentFocusedRowIndex) } } isRowFocused(key) { const focusedRowKey = this.option("focusedRowKey"); if ((0, _type.isDefined)(focusedRowKey)) { return (0, _common.equalByValue)(key, this.option("focusedRowKey")) } return } updateFocusedRow(e) { const that = this; const focusedRowIndex = e.focusedRowIndex ?? that.getDataController().getRowIndexByKey(e.focusedRowKey); const rowsView = that.getView("rowsView"); let $tableElement; let $mainRow; (0, _iterator.each)(rowsView.getTableElements(), ((index, element) => { const isMainTable = 0 === index; $tableElement = (0, _renderer.default)(element); that._clearPreviousFocusedRow($tableElement, focusedRowIndex); const $row = that._prepareFocusedRow({ changedItem: that.getDataController().getVisibleRows()[focusedRowIndex], $tableElement: $tableElement, focusedRowIndex: focusedRowIndex }); if (isMainTable) { $mainRow = $row } })); if (!e.preventScroll && $mainRow) { rowsView.scrollToElementVertically($mainRow) } } _clearPreviousFocusedRow($tableElement, focusedRowIndex) { const $prevRowFocusedElement = $tableElement.find(".dx-row.dx-row-focused").filter(((_, focusedRow) => { const $focusedRowTable = (0, _renderer.default)(focusedRow).closest(`.${this.addWidgetPrefix("table")}`); return $tableElement.is($focusedRowTable) })); $prevRowFocusedElement.removeClass("dx-row-focused").removeClass("dx-cell-focus-disabled").removeAttr("tabindex"); $prevRowFocusedElement.children("td").removeAttr("tabindex"); if (0 !== focusedRowIndex) { const $firstRow = (0, _renderer.default)(this.getView("rowsView").getRowElement(0)); $firstRow.removeClass("dx-cell-focus-disabled").removeAttr("tabIndex") } } _prepareFocusedRow(options) { let $row; const { changedItem: changedItem } = options; if (changedItem && ("data" === changedItem.rowType || "group" === changedItem.rowType)) { const { focusedRowIndex: focusedRowIndex } = options; const { $tableElement: $tableElement } = options; const tabIndex = this.option("tabindex") || 0; const rowsView = this.getView("rowsView"); $row = (0, _renderer.default)(rowsView._getRowElements($tableElement).eq(focusedRowIndex)); $row.addClass("dx-row-focused").attr("tabindex", tabIndex) } return $row } } exports.FocusController = FocusController; exports.focusModule = { defaultOptions: () => ({ focusedRowEnabled: false, autoNavigateToFocusedRow: true, focusedRowKey: null, focusedRowIndex: -1, focusedColumnIndex: -1 }), controllers: { focus: FocusController }, extenders: { controllers: { keyboardNavigation: Base => class extends Base { init() { const rowIndex = this.option("focusedRowIndex"); const columnIndex = this.option("focusedColumnIndex"); this.createAction("onFocusedRowChanging", { excludeValidators: ["disabled", "readOnly"] }); this.createAction("onFocusedRowChanged", { excludeValidators: ["disabled", "readOnly"] }); this.createAction("onFocusedCellChanging", { excludeValidators: ["disabled", "readOnly"] }); this.createAction("onFocusedCellChanged", { excludeValidators: ["disabled", "readOnly"] }); super.init(); this.setRowFocusType(); this._focusedCellPosition = {}; if ((0, _type.isDefined)(rowIndex) && rowIndex >= 0) { this._focusedCellPosition.rowIndex = rowIndex } if ((0, _type.isDefined)(columnIndex) && columnIndex >= 0) { this._focusedCellPosition.columnIndex = columnIndex } } setFocusedRowIndex(rowIndex) { super.setFocusedRowIndex(rowIndex); this.option("focusedRowIndex", rowIndex) } setFocusedColumnIndex(columnIndex) { super.setFocusedColumnIndex(columnIndex); this.option("focusedColumnIndex", columnIndex) } _escapeKeyHandler(eventArgs, isEditing) { if (isEditing || !this.option("focusedRowEnabled")) { return super._escapeKeyHandler(eventArgs, isEditing) } if (this.isCellFocusType()) { this.setRowFocusType(); this._focus(this._getCellElementFromTarget(eventArgs.originalEvent.target), true); return true } return false } _updateFocusedCellPosition($cell, direction) { const position = super._updateFocusedCellPosition($cell, direction); if (position && position.columnIndex >= 0) { this._fireFocusedCellChanged($cell) } return position } }, editorFactory: Base => class extends Base { renderFocusOverlay($element, isHideBorder) { var _this$_keyboardNaviga; const focusedRowEnabled = this.option("focusedRowEnabled"); let $cell; if (!focusedRowEnabled || !(null !== (_this$_keyboardNaviga = this._keyboardNavigationController) && void 0 !== _this$_keyboardNaviga && _this$_keyboardNaviga.isRowFocusType()) || this._editingController.isEditing()) { super.renderFocusOverlay($element, isHideBorder) } else if (focusedRowEnabled) { const isRowElement = "row" === this._keyboardNavigationController._getElementType($element); if (isRowElement && !$element.hasClass("dx-row-focused")) { $cell = this._keyboardNavigationController.getFirstValidCellInRow($element); this._keyboardNavigationController.focus($cell) } } } }, columns: Base => class extends Base { getSortDataSourceParameters(_, sortByKey) { let result = super.getSortDataSourceParameters.apply(this, arguments); const dataSource = this._dataController._dataSource; const store = this._dataController.store(); let key = store && store.key(); const remoteOperations = dataSource && dataSource.remoteOperations() || {}; const isLocalOperations = Object.keys(remoteOperations).every((operationName => !remoteOperations[operationName])); if (key && (this.option("focusedRowEnabled") && false !== this._focusController.isAutoNavigateToFocusedRow() || sortByKey)) { key = Array.isArray(key) ? key : [key]; const notSortedKeys = key.filter((key => !this.columnOption(key, "sortOrder"))); if (notSortedKeys.length) { result = result || []; if (isLocalOperations) { result.push({ selector: dataSource.getDataIndexGetter(), desc: false }) } else { notSortedKeys.forEach((notSortedKey => result.push({ selector: notSortedKey, desc: false }))) } } } return result } }, data: Base => class extends Base { constructor() { super(...arguments); this._needToUpdateFocusedRowByIndex = false } _applyChange(change) { if (change && "updateFocusedRow" === change.changeType) { return } return super._applyChange.apply(this, arguments) } _fireChanged(e) { super._fireChanged(e); if (this.option("focusedRowEnabled") && this._dataSource) { const isPartialUpdate = "update" === e.changeType && e.repaintChangesOnly; const isPartialUpdateWithDeleting = isPartialUpdate && e.changeTypes && e.changeTypes.indexOf("remove") >= 0; if (this._needToUpdateFocusedRowByIndex) { this._needToUpdateFocusedRowByIndex = false; this._focusController._focusRowByIndex() } else if ("refresh" === e.changeType && e.items.length || isPartialUpdateWithDeleting) { this._updatePageIndexes(); this._updateFocusedRow(e) } else if ("append" === e.changeType || "prepend" === e.changeType) { this._updatePageIndexes() } else if ("update" === e.changeType && e.repaintChangesOnly) { this._updateFocusedRow(e) } } } _handleDataPushed(changes) { super._handleDataPushed(changes); const focusedRowKey = this.option("focusedRowKey"); this._needToUpdateFocusedRowByIndex = null === changes || void 0 === changes ? void 0 : changes.some((change => "remove" === change.type && (0, _common.equalByValue)(change.key, focusedRowKey))) } _updatePageIndexes() { const prevRenderingPageIndex = this._lastRenderingPageIndex || 0; const renderingPageIndex = this._rowsScrollController ? this._rowsScrollController.pageIndex() : 0; this._lastRenderingPageIndex = renderingPageIndex; this._isPagingByRendering = renderingPageIndex !== prevRenderingPageIndex } isPagingByRendering() { return this._isPagingByRendering } _updateFocusedRow(e) { const operationTypes = e.operationTypes || {}; const { reload: reload, fullReload: fullReload, pageIndex: pageIndex, paging: paging } = operationTypes; const isVirtualScrolling = this._keyboardNavigationController._isVirtualScrolling(); const pagingWithoutVirtualScrolling = paging && !isVirtualScrolling; const focusedRowKey = this.option("focusedRowKey"); const isAutoNavigate = this._focusController.isAutoNavigateToFocusedRow(); const isReload = reload && false === pageIndex; if (isReload && !fullReload && (0, _type.isDefined)(focusedRowKey)) { this._focusController._navigateToRow(focusedRowKey, true).done((focusedRowIndex => { if (focusedRowIndex < 0) { this._focusController._focusRowByIndex(void 0, operationTypes) } })) } else if (pagingWithoutVirtualScrolling && isAutoNavigate) { const rowIndexByKey = this.getRowIndexByKey(focusedRowKey); const focusedRowIndex = this.option("focusedRowIndex"); const isValidRowIndexByKey = rowIndexByKey >= 0; const isValidFocusedRowIndex = focusedRowIndex >= 0; const isSameRowIndex = focusedRowIndex === rowIndexByKey; if (isValidFocusedRowIndex && (isSameRowIndex || !isValidRowIndexByKey)) { this._focusController._focusRowByIndex(focusedRowIndex, operationTypes) } } else if (pagingWithoutVirtualScrolling && !isAutoNavigate && this.getRowIndexByKey(focusedRowKey) < 0) { this.option("focusedRowIndex", -1) } else if (operationTypes.fullReload) { this._focusController._focusRowByKeyOrIndex() } } getPageIndexByKey(key) { const that = this; const d = new _deferred.Deferred; that.getGlobalRowIndexByKey(key).done((globalIndex => { d.resolve(globalIndex >= 0 ? Math.floor(globalIndex / that.pageSize()) : -1) })).fail(d.reject); return d.promise() } getGlobalRowIndexByKey(key) { if (this._dataSource.group()) { return this._calculateGlobalRowIndexByGroupedData(key) } return this._calculateGlobalRowIndexByFlatData(key) } _calculateGlobalRowIndexByFlatData(key, groupFilter, useGroup) { const that = this; const deferred = new _deferred.Deferred; const dataSource = that._dataSource; if (Array.isArray(key) || (0, _m_editing_utils.isNewRowTempKey)(key)) { return deferred.resolve(-1).promise() } let filter = that._generateFilterByKey(key); dataSource.load({ filter: that._concatWithCombinedFilter(filter), skip: 0, take: 1 }).done((data => { if (data.length > 0) { filter = that._generateOperationFilterByKey(key, data[0], useGroup); dataSource.load({ filter: that._concatWithCombinedFilter(filter, groupFilter), skip: 0, take: 1, requireTotalCount: true }).done(((_, extra) => { deferred.resolve(extra.totalCount) })) } else { deferred.resolve(-1) } })); return deferred.promise() } _concatWithCombinedFilter(filter, groupFilter) { const combinedFilter = this.getCombinedFilter(); return _m_utils.default.combineFilters([filter, combinedFilter, groupFilter]) } _generateBooleanFilter(selector, value, sortInfo) { const { desc: desc } = sortInfo; switch (true) { case false === value && desc: return [selector, "=", true]; case false === value && !desc: return [selector, "=", null]; case true === value && !desc: case !(0, _type.isBoolean)(value) && desc: return [selector, "<>", value]; default: return } } _generateOperationFilterByKey(key, rowData, useGroup) { const that = this; const dateSerializationFormat = that.option("dateSerializationFormat"); const isRemoteFiltering = that._dataSource.remoteOperations().filtering; const isRemoteSorting = that._dataSource.remoteOperations().sorting; let filter = that._generateFilterByKey(key, "<"); let sort = that._columnsController.getSortDataSourceParameters(!isRemoteFiltering, true); if (useGroup) { const group = that._columnsController.getGroupDataSourceParameters(!isRemoteFiltering); if (group) { sort = sort ? group.concat(sort) : group } } if (sort) { sort.slice().reverse().forEach((sortInfo => { const { selector: selector, desc: desc, compare: compare } = sortInfo; const { getter: getter, rawValue: rawValue, safeValue: safeValue } = _m_focus_utils.UiGridCoreFocusUtils.getSortFilterValue(sortInfo, rowData, { isRemoteFiltering: isRemoteFiltering, dateSerializationFormat: dateSerializationFormat, getSelector: selector => that._columnsController.columnOption(selector, "selector") }); filter = [ [selector, "=", safeValue], "and", filter ]; if (null === rawValue || (0, _type.isBoolean)(rawValue)) { const booleanFilter = that._generateBooleanFilter(selector, safeValue, desc); if (booleanFilter) { filter = [booleanFilter, "or", filter] } } else { const filterOperation = desc ? ">" : "<"; let sortFilter; if (compare && !isRemoteSorting) { sortFilter = data => { if ("<" === filterOperation) { return compare(rawValue, getter(data)) >= 1 } return compare(rawValue, getter(data)) <= -1 } } else { sortFilter = [selector, filterOperation, safeValue]; if (!desc) { sortFilter = [sortFilter, "or", [selector, "=", null]] } } filter = [sortFilter, "or", filter] } })) } return filter } _generateFilterByKey(key, operation) { const dataSourceKey = this._dataSource.key(); let filter = []; if (!operation) { operation = "=" } if (Array.isArray(dataSourceKey)) { for (let i = 0; i < dataSourceKey.length; ++i) { const keyPart = key[dataSourceKey[i]]; if (keyPart) { if (filter.length > 0) { filter.push("and") } filter.push([dataSourceKey[i], operation, keyPart]) } } } else { filter = [dataSourceKey, operation, key] } return filter } _getLastItemIndex() { return this.items(true).length - 1 } }, editing: Base => class extends Base { _deleteRowCore(rowIndex) { const deferred = super._deleteRowCore.apply(this, arguments); const rowKey = this._dataController.getKeyByRowIndex(rowIndex); deferred.done((() => { const rowIndex = this._dataController.getRowIndexByKey(rowKey); const visibleRows = this._dataController.getVisibleRows(); if (-1 === rowIndex && !visibleRows.length) { this._focusController._resetFocusedRow() } })) } } }, views: { rowsView: Base => class extends Base { _createRow(row) { const $row = super._createRow.apply(this, arguments); if (this.option("focusedRowEnabled") && row) { if (this._focusController.isRowFocused(row.key)) { $row.addClass("dx-row-focused") } } return $row } _checkRowKeys(options) { super._checkRowKeys.apply(this, arguments); if (this.option("focusedRowEnabled") && this.option("dataSource")) { const store = this._dataController.store(); if (store && !store.key()) { this._dataController.fireError("E1042", "Row focusing") } } } _update(change) { if ("updateFocusedRow" === change.changeType) { if (this.option("focusedRowEnabled")) { this._focusController.updateFocusedRow(change) } } else { super._update(change) } } updateFocusElementTabIndex($cellElements, preventScroll) { if (this.option("focusedRowEnabled")) { this._setFocusedRowElementTabIndex(preventScroll) } else { super.updateFocusElementTabIndex($cellElements) } } _setFocusedRowElementTabIndex(preventScroll) { const focusedRowKey = this.option("focusedRowKey"); const tabIndex = this.option("tabIndex") ?? 0; const columnsController = this._columnsController; let rowIndex = this._dataController.getRowIndexByKey(focusedRowKey); let columnIndex = this.option("focusedColumnIndex"); const $row = this._findRowElementForTabIndex(); const dataSource = this._dataController.dataSource(); const operationTypes = null === dataSource || void 0 === dataSource ? void 0 : dataSource.operationTypes(); const isPaging = !operationTypes || operationTypes.paging; if (!(0, _type.isDefined)(this._scrollToFocusOnResize)) { this._scrollToFocusOnResize = () => { this.scrollToElementVertically(this._findRowElementForTabIndex()); this.resizeCompleted.remove(this._scrollToFocusOnResize) } } $row.attr("tabIndex", tabIndex); const rowIndexFromOption = this.option("focusedRowIndex") - this._dataController.getRowIndexOffset(true); if (!isPaging && rowIndex < 0 && rowIndexFromOption >= 0) { this._focusController.updateFocusedRow({ focusedRowIndex: rowIndexFromOption, preventScroll: preventScroll }) } if (rowIndex >= 0 && !preventScroll) { if (columnIndex < 0) { columnIndex = 0 } rowIndex += this._dataController.getRowIndexOffset(); columnIndex += columnsController.getColumnIndexOffset(); this._keyboardNavigationController.setFocusedCellPosition(rowIndex, columnIndex); if (this._focusController.isAutoNavigateToFocusedRow()) { if (!isPaging && !this._dataController.isPagingByRendering()) { this.resizeCompleted.remove(this._scrollToFocusOnResize); this.resizeCompleted.add(this._scrollToFocusOnResize) } } } } _findRowElementForTabIndex() { const focusedRowKey = this.option("focusedRowKey"); const rowIndex = this._dataController.getRowIndexByKey(focusedRowKey); return (0, _renderer.default)(this.getRowElement(rowIndex >= 0 ? rowIndex : 0)) } scrollToRowElement(key) { const rowIndex = this._dataController.getRowIndexByKey(key); const $row = (0, _renderer.default)(this.getRow(rowIndex)); return this.scrollToElementVertically($row) } scrollToElementVertically($row) { const scrollable = this.getScrollable(); if (scrollable && $row.length) { const position = scrollable.getScrollElementPosition($row, "vertical"); return this.scrollTopPosition(position) } return (new _deferred.Deferred).resolve() } scrollTopPosition(scrollTop) { const d = new _deferred.Deferred; const scrollable = this.getScrollable(); if (scrollable) { const currentScrollTop = scrollable.scrollTop(); const scrollHandler = () => { scrollable.off("scroll", scrollHandler); d.resolve() }; if (scrollTop !== currentScrollTop) { scrollable.on("scroll", scrollHandler); this._dataController.resetFilterApplying(); scrollable.scrollTo({ top: scrollTop }); return d.promise() } } return d.resolve() } } } } } }, 32710: /*!***********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/focus/m_focus_utils.js ***! \***********************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.UiGridCoreFocusUtils = void 0; var _date_serialization = (obj = __webpack_require__( /*! ../../../../core/utils/date_serialization */ 69434), obj && obj.__esModule ? obj : { default: obj }); var obj; var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); exports.UiGridCoreFocusUtils = { getSortFilterValue: (sortInfo, rowData, _ref) => { let { isRemoteFiltering: isRemoteFiltering, dateSerializationFormat: dateSerializationFormat, getSelector: getSelector } = _ref; const { selector: selector } = sortInfo; const getter = (0, _type.isFunction)(selector) ? selector : getSelector(selector); const rawValue = getter ? getter(rowData) : rowData[selector]; const safeValue = isRemoteFiltering && (0, _type.isDate)(rawValue) ? _date_serialization.default.serializeDate(rawValue, dateSerializationFormat) : rawValue; return { getter: getter, rawValue: rawValue, safeValue: safeValue } } } }, 68796: /*!*********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/header_filter/m_header_filter.js ***! \*********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.headerFilterModule = exports.HeaderFilterController = void 0; exports.invertFilterExpression = function(filter) { return ["!", filter] }; var _data = __webpack_require__( /*! ../../../../core/utils/data */ 47617); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _position = __webpack_require__( /*! ../../../../core/utils/position */ 37518); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _utils = __webpack_require__( /*! ../../../../data/data_source/utils */ 9234); var _query = _interopRequireDefault(__webpack_require__( /*! ../../../../data/query */ 96687)); var _store_helper = _interopRequireDefault(__webpack_require__( /*! ../../../../data/store_helper */ 99236)); var _click = __webpack_require__( /*! ../../../../events/click */ 95429); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../../events/core/events_engine */ 55994)); var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/date */ 91500)); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109)); var _accessibility = __webpack_require__( /*! ../../../../ui/shared/accessibility */ 56756); var _filtering = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/shared/filtering */ 18740)); var _m_modules = _interopRequireDefault(__webpack_require__( /*! ../../../grids/grid_core/m_modules */ 15943)); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../m_utils */ 60082)); var _m_header_filter_core = __webpack_require__( /*! ./m_header_filter_core */ 37565); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const DATE_INTERVAL_FORMATS = { month: value => _date.default.getMonthNames()[value - 1], quarter: value => _date.default.format(new Date(2e3, 3 * value - 1), "quarter") }; function ungroupUTCDates(items, dateParts, dates) { dateParts = dateParts || []; dates = dates || []; items.forEach((item => { if ((0, _type.isDefined)(item.key)) { const isMonthPart = 1 === dateParts.length; dateParts.push(isMonthPart ? item.key - 1 : item.key); if (item.items) { ungroupUTCDates(item.items, dateParts, dates) } else { const date = new Date(Date.UTC.apply(Date, dateParts)); dates.push(date) } dateParts.pop() } else { dates.push(null) } })); return dates } function convertDataFromUTCToLocal(data, column) { const dates = ungroupUTCDates(data); const query = (0, _query.default)(dates); const group = _m_utils.default.getHeaderFilterGroupParameters(_extends({}, column, { calculateCellValue: date => date })); return _store_helper.default.queryByOptions(query, { group: group }).toArray() } class HeaderFilterController extends _m_modules.default.ViewController { init() { this._columnsController = this.getController("columns"); this._dataController = this.getController("data"); this._headerFilterView = this.getView("headerFilterView") } _updateSelectedState(items, column) { let i = items.length; const isExclude = "exclude" === column.filterType; while (i--) { const item = items[i]; if ("items" in items[i]) { this._updateSelectedState(items[i].items, column) }(0, _m_header_filter_core.updateHeaderFilterItemSelectionState)(item, _m_utils.default.getIndexByKey(items[i].value, column.filterValues, null) > -1, isExclude) } } _normalizeGroupItem(item, currentLevel, options) { let value; let displayValue; const { path: path } = options; const { valueSelector: valueSelector } = options; const { displaySelector: displaySelector } = options; const { column: column } = options; if (valueSelector && displaySelector) { value = valueSelector(item); displayValue = displaySelector(item) } else { value = item.key; displayValue = value } if (!(0, _type.isObject)(item)) { item = {} } else { item = (0, _extend.extend)({}, item) } path.push(value); if (1 === path.length) { item.value = path[0] } else { item.value = path.join("/") } item.text = this.getHeaderItemText(displayValue, column, currentLevel, options.headerFilterOptions); return item } getHeaderItemText(displayValue, column, currentLevel, headerFilterOptions) { let text = _m_utils.default.formatValue(displayValue, function(value, column, currentLevel) { const groupInterval = _filtering.default.getGroupInterval(column); const result = _m_utils.default.getFormatOptionsByColumn(column, "headerFilter"); if (groupInterval) { result.groupInterval = groupInterval[currentLevel]; if (_m_utils.default.isDateType(column.dataType)) { result.format = DATE_INTERVAL_FORMATS[groupInterval[currentLevel]] } else if ("number" === column.dataType) { result.getDisplayFormat = function() { const formatOptions = { format: column.format, target: "headerFilter" }; const firstValueText = _m_utils.default.formatValue(value, formatOptions); const secondValue = value + groupInterval[currentLevel]; const secondValueText = _m_utils.default.formatValue(secondValue, formatOptions); return firstValueText && secondValueText ? `${firstValueText} - ${secondValueText}` : "" } } } return result }(displayValue, column, currentLevel)); if (!text) { text = headerFilterOptions.texts.emptyValue } return text } _processGroupItems(groupItems, currentLevel, path, options) { const that = this; let displaySelector; let valueSelector; const { column: column } = options; const { lookup: lookup } = column; const { level: level } = options; path = path || []; currentLevel = currentLevel || 0; if (lookup) { displaySelector = (0, _data.compileGetter)(lookup.displayExpr); valueSelector = (0, _data.compileGetter)(lookup.valueExpr) } for (let i = 0; i < groupItems.length; i++) { groupItems[i] = that._normalizeGroupItem(groupItems[i], currentLevel, { column: options.column, headerFilterOptions: options.headerFilterOptions, displaySelector: displaySelector, valueSelector: valueSelector, path: path }); if ("items" in groupItems[i]) { if (currentLevel === level || !(0, _type.isDefined)(groupItems[i].value)) { delete groupItems[i].items } else { that._processGroupItems(groupItems[i].items, currentLevel + 1, path, options) } } path.pop() } } getDataSource(column) { var _column$headerFilter; const dataSource = this._dataController.dataSource(); const remoteGrouping = null === dataSource || void 0 === dataSource ? void 0 : dataSource.remoteOperations().grouping; const group = _m_utils.default.getHeaderFilterGroupParameters(column, remoteGrouping); const headerFilterDataSource = null === (_column$headerFilter = column.headerFilter) || void 0 === _column$headerFilter ? void 0 : _column$headerFilter.dataSource; const headerFilterOptions = this.option("headerFilter"); let isLookup = false; const options = { component: this.component }; if (!dataSource) { return } if ((0, _type.isDefined)(headerFilterDataSource) && !(0, _type.isFunction)(headerFilterDataSource)) { options.dataSource = (0, _utils.normalizeDataSourceOptions)(headerFilterDataSource) } else if (column.lookup) { isLookup = true; if (this.option("syncLookupFilterValues")) { this._currentColumn = column; const filter = this._dataController.getCombinedFilter(); this._currentColumn = null; options.dataSource = _m_utils.default.getWrappedLookupDataSource(column, dataSource, filter) } else { options.dataSource = _m_utils.default.normalizeLookupDataSource(column.lookup) } } else { const cutoffLevel = Array.isArray(group) ? group.length - 1 : 0; this._currentColumn = column; const filter = this._dataController.getCombinedFilter(); this._currentColumn = null; options.dataSource = { filter: filter, group: group, useDefaultSearch: true, load: options => { const d = new _deferred.Deferred; options.dataField = column.dataField || column.name; dataSource.load(options).done((data => { const convertUTCDates = remoteGrouping && (format = column.serializationFormat, "Z" === (null === format || void 0 === format ? void 0 : format.slice(-1)) || "'Z'" === (null === format || void 0 === format ? void 0 : format.slice(-3))) && cutoffLevel > 3; var format; if (convertUTCDates) { data = convertDataFromUTCToLocal(data, column) } that._processGroupItems(data, null, null, { level: cutoffLevel, column: column, headerFilterOptions: headerFilterOptions }); d.resolve(data) })).fail(d.reject); return d } } } if ((0, _type.isFunction)(headerFilterDataSource)) { headerFilterDataSource.call(column, options) } const origPostProcess = options.dataSource.postProcess; const that = this; options.dataSource.postProcess = function(data) { let items = data; if (isLookup) { items = items.filter((item => null !== item[column.lookup.valueExpr])); if (0 === this.pageIndex() && !this.searchValue()) { items = items.slice(0); items.unshift(null) } that._processGroupItems(items, null, null, { level: 0, column: column, headerFilterOptions: headerFilterOptions }) } items = origPostProcess && origPostProcess.call(this, items) || items; that._updateSelectedState(items, column); return items }; return options.dataSource } getCurrentColumn() { return this._currentColumn } showHeaderFilterMenu(columnIndex, isGroupPanel) { const columnsController = this._columnsController; const column = (0, _extend.extend)(true, {}, this._columnsController.getColumns()[columnIndex]); if (column) { const visibleIndex = columnsController.getVisibleIndex(columnIndex); const view = isGroupPanel ? this.getView("headerPanel") : this.getView("columnHeadersView"); const $columnElement = view.getColumnElements().eq(isGroupPanel ? column.groupIndex : visibleIndex); this.showHeaderFilterMenuBase({ columnElement: $columnElement, column: column, applyFilter: true, apply() { columnsController.columnOption(columnIndex, { filterValues: this.filterValues, filterType: this.filterType }) } }) } } showHeaderFilterMenuBase(options) { const that = this; const { column: column } = options; if (column) { const groupInterval = _filtering.default.getGroupInterval(column); const dataSource = that._dataController.dataSource(); const remoteFiltering = dataSource && dataSource.remoteOperations().filtering; const previousOnHidden = options.onHidden; (0, _extend.extend)(options, column, { type: groupInterval && groupInterval.length > 1 ? "tree" : "list", remoteFiltering: remoteFiltering, onShowing: e => { const dxResizableInstance = e.component.$overlayContent().dxResizable("instance"); dxResizableInstance && dxResizableInstance.option("onResizeEnd", (e => { let headerFilterByColumn = this._columnsController.columnOption(options.dataField, "headerFilter"); headerFilterByColumn = headerFilterByColumn || {}; headerFilterByColumn.width = e.width; headerFilterByColumn.height = e.height; this._columnsController.columnOption(options.dataField, "headerFilter", headerFilterByColumn, true) })) }, onHidden: () => { null === previousOnHidden || void 0 === previousOnHidden || previousOnHidden(); (0, _accessibility.restoreFocus)(this) } }); options.dataSource = that.getDataSource(options); if (options.isFilterBuilder) { options.dataSource.filter = null; options.alignment = "right" } that._headerFilterView.showHeaderFilterMenu(options.columnElement, options) } } hideHeaderFilterMenu() { this._headerFilterView.hideHeaderFilterMenu() } } exports.HeaderFilterController = HeaderFilterController; exports.headerFilterModule = { defaultOptions: () => ({ syncLookupFilterValues: true, headerFilter: { visible: false, width: 252, height: 325, allowSelectAll: true, search: { enabled: false, timeout: 500, mode: "contains", editorOptions: {} }, texts: { emptyValue: _message.default.format("dxDataGrid-headerFilterEmptyValue"), ok: _message.default.format("dxDataGrid-headerFilterOK"), cancel: _message.default.format("dxDataGrid-headerFilterCancel") } } }), controllers: { headerFilter: HeaderFilterController }, views: { headerFilterView: _m_header_filter_core.HeaderFilterView }, extenders: { controllers: { data: Base => class extends Base { skipCalculateColumnFilters() { return false } _calculateAdditionalFilter() { if (this.skipCalculateColumnFilters()) { return super._calculateAdditionalFilter() } const filters = [super._calculateAdditionalFilter()]; const columns = this._columnsController.getVisibleColumns(null, true); const headerFilterController = this._headerFilterController; const currentColumn = headerFilterController.getCurrentColumn(); (0, _iterator.each)(columns, ((_, column) => { let filter; if (currentColumn && currentColumn.index === column.index) { return } if ((0, _m_header_filter_core.allowHeaderFiltering)(column) && column.calculateFilterExpression && Array.isArray(column.filterValues) && column.filterValues.length) { let filterValues = []; (0, _iterator.each)(column.filterValues, ((_, filterValue) => { if (Array.isArray(filterValue)) { filter = filterValue } else { if (column.deserializeValue && !_m_utils.default.isDateType(column.dataType) && "number" !== column.dataType) { filterValue = column.deserializeValue(filterValue) } filter = column.createFilterExpression(filterValue, "=", "headerFilter") } if (filter) { filter.columnIndex = column.index } filterValues.push(filter) })); filterValues = _m_utils.default.combineFilters(filterValues, "or"); filters.push("exclude" === column.filterType ? ["!", filterValues] : filterValues) } })); return _m_utils.default.combineFilters(filters) } } }, views: { columnHeadersView: Base => class extends((0, _m_header_filter_core.headerFilterMixin)(Base)) { _renderCellContent($cell, options) { const that = this; let $headerFilterIndicator; const { column: column } = options; if (!column.command && (0, _m_header_filter_core.allowHeaderFiltering)(column) && that.option("headerFilter.visible") && "header" === options.rowType) { $headerFilterIndicator = that._applyColumnState({ name: "headerFilter", rootElement: $cell, column: column, showColumnLines: that.option("showColumnLines") }); $headerFilterIndicator && that._subscribeToIndicatorEvent($headerFilterIndicator, column, "headerFilter") } super._renderCellContent.apply(this, arguments) } _subscribeToIndicatorEvent($indicator, column, indicatorName) { if ("headerFilter" === indicatorName) { _events_engine.default.on($indicator, _click.name, this.createAction((e => { e.event.stopPropagation(); (0, _accessibility.saveFocusedElementInfo)($indicator, this); this._headerFilterController.showHeaderFilterMenu(column.index, false) }))) } } _updateIndicator($cell, column, indicatorName) { const $indicator = super._updateIndicator($cell, column, indicatorName); $indicator && this._subscribeToIndicatorEvent($indicator, column, indicatorName) } _updateHeaderFilterIndicators() { if (this.option("headerFilter.visible")) { this._updateIndicators("headerFilter") } } _needUpdateFilterIndicators() { return true } _columnOptionChanged(e) { const { optionNames: optionNames } = e; const isFilterRowAndHeaderFilterValuesChanged = _m_utils.default.checkChanges(optionNames, ["filterValues", "filterValue"]); const isHeaderFilterValuesAndTypeChanged = _m_utils.default.checkChanges(optionNames, ["filterValues", "filterType"]); const shouldUpdateFilterIndicators = (isFilterRowAndHeaderFilterValuesChanged || isHeaderFilterValuesAndTypeChanged) && this._needUpdateFilterIndicators(); if (shouldUpdateFilterIndicators) { this._updateHeaderFilterIndicators() } if (!isHeaderFilterValuesAndTypeChanged) { super._columnOptionChanged(e) } } }, headerPanel: Base => class extends((0, _m_header_filter_core.headerFilterMixin)(Base)) { _createGroupPanelItem($rootElement, groupColumn) { const that = this; const $item = super._createGroupPanelItem.apply(that, arguments); let $headerFilterIndicator; if (!groupColumn.command && (0, _m_header_filter_core.allowHeaderFiltering)(groupColumn) && that.option("headerFilter.visible")) { $headerFilterIndicator = that._applyColumnState({ name: "headerFilter", rootElement: $item, column: { alignment: (0, _position.getDefaultAlignment)(that.option("rtlEnabled")), filterValues: groupColumn.filterValues, allowHeaderFiltering: true, caption: groupColumn.caption }, showColumnLines: true }); $headerFilterIndicator && _events_engine.default.on($headerFilterIndicator, _click.name, that.createAction((e => { const { event: event } = e; event.stopPropagation(); this._headerFilterController.showHeaderFilterMenu(groupColumn.index, true) }))) } return $item } } } } } }, 37565: /*!**************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/header_filter/m_header_filter_core.js ***! \**************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.headerFilterMixin = exports.allowHeaderFiltering = exports.HeaderFilterView = void 0; exports.updateHeaderFilterItemSelectionState = function(item, filterValuesMatch, isExcludeFilter) { if (filterValuesMatch ^ isExcludeFilter) { item.selected = true; if (isExcludeFilter && item.items) { for (let j = 0; j < item.items.length; j++) { if (!item.items[j].selected) { item.selected = void 0; break } } } } else if (isExcludeFilter || item.selected) { item.selected = false; resetChildrenItemSelection(item.items) } }; __webpack_require__( /*! ../../../ui/list/modules/m_search */ 86738); __webpack_require__( /*! ../../../ui/list/modules/m_selection */ 19067); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109)); var _list_light = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/list_light */ 56757)); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/popup/ui.popup */ 51495)); var _tree_view = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/tree_view */ 30254)); var _m_modules = _interopRequireDefault(__webpack_require__( /*! ../../../grids/grid_core/m_modules */ 15943)); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../m_utils */ 60082)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function resetChildrenItemSelection(items) { items = items || []; for (let i = 0; i < items.length; i++) { items[i].selected = false; resetChildrenItemSelection(items[i].items) } } function getSelectAllCheckBox(listComponent) { const selector = "dxTreeView" === listComponent.NAME ? ".dx-treeview-select-all-item" : ".dx-list-select-all-checkbox"; return listComponent.$element().find(selector).dxCheckBox("instance") } function updateListSelectAllState(e, filterValues) { if (e.component.option("searchValue")) { return } const selectAllCheckBox = getSelectAllCheckBox(e.component); if (selectAllCheckBox && filterValues && filterValues.length) { selectAllCheckBox.option("value", void 0) } } class HeaderFilterView extends _m_modules.default.View { getPopupContainer() { return this._popupContainer } getListComponent() { return this._listComponent } applyHeaderFilter(options) { const list = this.getListComponent(); const searchValue = list.option("searchValue"); const selectAllCheckBox = getSelectAllCheckBox(list); const isAllSelected = !searchValue && !options.isFilterBuilder && (null === selectAllCheckBox || void 0 === selectAllCheckBox ? void 0 : selectAllCheckBox.option("value")); const filterValues = []; const fillSelectedItemKeys = function(filterValues, items, isExclude) { (0, _iterator.each)(items, ((_, item) => { if (void 0 !== item.selected && !!item.selected ^ isExclude) { const node = list._getNode(item); const hasChildren = list._hasChildren(node); const hasChildrenWithSelection = hasChildren && item.items && item.items.some((item => item.selected)); if (!searchValue || !hasChildrenWithSelection) { filterValues.push(item.value); return } } if (item.items && item.items.length) { fillSelectedItemKeys(filterValues, item.items, isExclude) } })) }; if (!isAllSelected) { if ("tree" === options.type) { if (options.filterType) { options.filterType = "include" } fillSelectedItemKeys(filterValues, list.option("items"), false); options.filterValues = filterValues } } else { if ("tree" === options.type) { options.filterType = "exclude" } if (Array.isArray(options.filterValues)) { options.filterValues = [] } } if (options.filterValues && !options.filterValues.length) { options.filterValues = null } options.apply(); this.hideHeaderFilterMenu() } showHeaderFilterMenu($columnElement, options) { const that = this; if (options) { that._initializePopupContainer(options); const popupContainer = that.getPopupContainer(); that.hideHeaderFilterMenu(); that.updatePopup($columnElement, options); popupContainer.show() } } hideHeaderFilterMenu() { const headerFilterMenu = this.getPopupContainer(); headerFilterMenu && headerFilterMenu.hide() } updatePopup($element, options) { const that = this; const showColumnLines = this.option("showColumnLines"); const alignment = "right" === options.alignment ^ !showColumnLines ? "left" : "right"; that._popupContainer.setAria({ role: "dialog", label: _message.default.format("dxDataGrid-headerFilterLabel") }); if (that._popupContainer) { that._cleanPopupContent(); that._popupContainer.option("position", { my: `${alignment} top`, at: `${alignment} bottom`, of: $element, collision: "fit fit" }) } } _getSearchExpr(options, headerFilterOptions) { const { lookup: lookup } = options; const { useDefaultSearchExpr: useDefaultSearchExpr } = options; const headerFilterDataSource = headerFilterOptions.dataSource; const filterSearchExpr = headerFilterOptions.search.searchExpr; if (filterSearchExpr) { return filterSearchExpr } if (useDefaultSearchExpr || (0, _type.isDefined)(headerFilterDataSource) && !(0, _type.isFunction)(headerFilterDataSource)) { return "text" } if (lookup) { return lookup.displayExpr || "this" } if (options.dataSource) { const { group: group } = options.dataSource; if (Array.isArray(group) && group.length > 0) { return group[0].selector } if ((0, _type.isFunction)(group) && !options.remoteFiltering) { return group } } return options.dataField || options.selector } _cleanPopupContent() { this._popupContainer && this._popupContainer.$content().empty() } _initializePopupContainer(options) { const that = this; const $element = that.element(); const headerFilterOptions = this._normalizeHeaderFilterOptions(options); const { height: height, width: width } = headerFilterOptions; const dxPopupOptions = { width: width, height: height, visible: false, shading: false, showTitle: false, showCloseButton: false, hideOnParentScroll: false, dragEnabled: false, hideOnOutsideClick: true, wrapperAttr: { class: "dx-header-filter-menu" }, focusStateEnabled: false, toolbarItems: [{ toolbar: "bottom", location: "after", widget: "dxButton", options: { text: headerFilterOptions.texts.ok, onClick() { that.applyHeaderFilter(options) } } }, { toolbar: "bottom", location: "after", widget: "dxButton", options: { text: headerFilterOptions.texts.cancel, onClick() { that.hideHeaderFilterMenu() } } }], resizeEnabled: true, onShowing(e) { e.component.$content().parent().addClass("dx-dropdowneditor-overlay"); that._initializeListContainer(options, headerFilterOptions); options.onShowing && options.onShowing(e) }, onShown() { that.getListComponent().focus() }, onHidden: options.onHidden, onInitialized(e) { const { component: component } = e; component.option("animation", component._getDefaultOptions().animation) } }; if (!(0, _type.isDefined)(that._popupContainer)) { that._popupContainer = that._createComponent($element, _ui.default, dxPopupOptions) } else { that._popupContainer.option(dxPopupOptions) } } _initializeListContainer(options, headerFilterOptions) { const that = this; const $content = that._popupContainer.$content(); const needShowSelectAllCheckbox = !options.isFilterBuilder && headerFilterOptions.allowSelectAll; const widgetOptions = { searchEnabled: headerFilterOptions.search.enabled, searchTimeout: headerFilterOptions.search.timeout, searchEditorOptions: headerFilterOptions.search.editorOptions, searchMode: headerFilterOptions.search.mode || "", dataSource: options.dataSource, onContentReady() { that.renderCompleted.fire() }, itemTemplate(data, _, element) { const $element = (0, _renderer.default)(element); if (options.encodeHtml) { return $element.text(data.text) } return $element.html(data.text) } }; function onOptionChanged(e) { if ("searchValue" === e.fullName && needShowSelectAllCheckbox && false !== that.option("headerFilter.hideSelectAllOnSearch")) { if ("tree" === options.type) { e.component.option("showCheckBoxesMode", e.value ? "normal" : "selectAll") } else { e.component.option("selectionMode", e.value ? "multiple" : "all") } } } if ("tree" === options.type) { that._listComponent = that._createComponent((0, _renderer.default)("
").appendTo($content), _tree_view.default, (0, _extend.extend)(widgetOptions, { showCheckBoxesMode: needShowSelectAllCheckbox ? "selectAll" : "normal", onOptionChanged: onOptionChanged, keyExpr: "id" })) } else { that._listComponent = that._createComponent((0, _renderer.default)("
").appendTo($content), _list_light.default, (0, _extend.extend)(widgetOptions, { searchExpr: that._getSearchExpr(options, headerFilterOptions), pageLoadMode: "scrollBottom", showSelectionControls: true, selectionMode: needShowSelectAllCheckbox ? "all" : "multiple", onOptionChanged: onOptionChanged, onSelectionChanged(e) { const items = e.component.option("items"); const selectedItems = e.component.option("selectedItems"); if (!e.component._selectedItemsUpdating && !e.component.option("searchValue") && !options.isFilterBuilder) { const filterValues = options.filterValues || []; const isExclude = "exclude" === options.filterType; if (0 === selectedItems.length && items.length && (filterValues.length <= 1 || isExclude && filterValues.length === items.length - 1)) { options.filterType = "include"; options.filterValues = [] } else if (selectedItems.length === items.length) { options.filterType = "exclude"; options.filterValues = [] } }(0, _iterator.each)(items, ((index, item) => { const selected = _m_utils.default.getIndexByKey(item, selectedItems, null) >= 0; const oldSelected = !!item.selected; if (oldSelected !== selected) { item.selected = selected; options.filterValues = options.filterValues || []; const filterValueIndex = _m_utils.default.getIndexByKey(item.value, options.filterValues, null); if (filterValueIndex >= 0) { options.filterValues.splice(filterValueIndex, 1) } const isExcludeFilterType = "exclude" === options.filterType; if (selected ^ isExcludeFilterType) { options.filterValues.push(item.value) } } })); updateListSelectAllState(e, options.filterValues) }, onContentReady(e) { const { component: component } = e; const items = component.option("items"); const selectedItems = []; (0, _iterator.each)(items, (function() { if (this.selected) { selectedItems.push(this) } })); component._selectedItemsUpdating = true; component.option("selectedItems", selectedItems); component._selectedItemsUpdating = false; updateListSelectAllState(e, options.filterValues) } })) } } _normalizeHeaderFilterOptions(options) { const generalHeaderFilter = this.option("headerFilter") || {}; const specificHeaderFilter = options.headerFilter || {}; const generalDeprecated = { search: { enabled: generalHeaderFilter.allowSearch, timeout: generalHeaderFilter.searchTimeout } }; const specificDeprecated = { search: { enabled: specificHeaderFilter.allowSearch, mode: specificHeaderFilter.searchMode, timeout: specificHeaderFilter.searchTimeout } }; return (0, _extend.extend)(true, {}, generalHeaderFilter, generalDeprecated, specificHeaderFilter, specificDeprecated) } _renderCore() { this.element().addClass("dx-header-filter-menu") } } exports.HeaderFilterView = HeaderFilterView; const allowHeaderFiltering = function(column) { return (0, _type.isDefined)(column.allowHeaderFiltering) ? column.allowHeaderFiltering : column.allowFiltering }; exports.allowHeaderFiltering = allowHeaderFiltering; exports.headerFilterMixin = Base => class extends Base { optionChanged(args) { if ("headerFilter" === args.name) { const requireReady = "columnHeadersView" === this.name; this._invalidate(requireReady, requireReady); args.handled = true } else { super.optionChanged(args) } } _applyColumnState(options) { let $headerFilterIndicator; const { rootElement: rootElement } = options; const { column: column } = options; if ("headerFilter" === options.name) { rootElement.find(".dx-header-filter").remove(); if (allowHeaderFiltering(column)) { $headerFilterIndicator = super._applyColumnState(options).toggleClass("dx-header-filter-empty", this._isHeaderFilterEmpty(column)); if (!this.option("useLegacyKeyboardNavigation")) { $headerFilterIndicator.attr("tabindex", this.option("tabindex") || 0) } const indicatorLabel = _message.default.format("dxDataGrid-headerFilterIndicatorLabel", column.caption); $headerFilterIndicator.attr("aria-label", indicatorLabel); $headerFilterIndicator.attr("aria-haspopup", "dialog"); $headerFilterIndicator.attr("role", "button") } return $headerFilterIndicator } return super._applyColumnState(options) } _isHeaderFilterEmpty(column) { return !column.filterValues || !column.filterValues.length } _getIndicatorClassName(name) { if ("headerFilter" === name) { return "dx-header-filter" } return super._getIndicatorClassName(name) } _renderIndicator(options) { const $container = options.container; const $indicator = options.indicator; if ("headerFilter" === options.name) { const rtlEnabled = this.option("rtlEnabled"); if ($container.children().length && (!rtlEnabled && "right" === options.columnAlignment || rtlEnabled && "left" === options.columnAlignment)) { $container.prepend($indicator); return } } super._renderIndicator(options) } } }, 92468: /*!*******************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/header_panel/m_header_panel.js ***! \*******************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.headerPanelModule = exports.HeaderPanel = void 0; var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _data = __webpack_require__( /*! ../../../../core/utils/data */ 47617); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109)); var _toolbar = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/toolbar */ 71042)); var _m_columns_view = __webpack_require__( /*! ../views/m_columns_view */ 57318); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const DEFAULT_TOOLBAR_ITEM_NAMES = ["addRowButton", "applyFilterButton", "columnChooserButton", "exportButton", "groupPanel", "revertButton", "saveButton", "searchPanel"]; class HeaderPanel extends _m_columns_view.ColumnsView { init() { super.init(); this._editingController = this.getController("editing"); this._headerFilterController = this.getController("headerFilter"); this.createAction("onToolbarPreparing", { excludeValidators: ["disabled", "readOnly"] }) } _getToolbarItems() { return [] } _getButtonContainer() { return (0, _renderer.default)("
").addClass(this.addWidgetPrefix("toolbar-button")) } _getToolbarButtonClass(specificClass) { const secondClass = specificClass ? ` ${specificClass}` : ""; return this.addWidgetPrefix("toolbar-button") + secondClass } _getToolbarOptions() { const userToolbarOptions = this.option("toolbar"); const options = { toolbarOptions: { items: this._getToolbarItems(), visible: null === userToolbarOptions || void 0 === userToolbarOptions ? void 0 : userToolbarOptions.visible, disabled: null === userToolbarOptions || void 0 === userToolbarOptions ? void 0 : userToolbarOptions.disabled, onItemRendered(e) { const itemRenderedCallback = e.itemData.onItemRendered; if (itemRenderedCallback) { itemRenderedCallback(e) } } } }; const userItems = null === userToolbarOptions || void 0 === userToolbarOptions ? void 0 : userToolbarOptions.items; options.toolbarOptions.items = this._normalizeToolbarItems(options.toolbarOptions.items, userItems); this.executeAction("onToolbarPreparing", options); if (options.toolbarOptions && !(0, _type.isDefined)(options.toolbarOptions.visible)) { const toolbarItems = options.toolbarOptions.items; options.toolbarOptions.visible = !!(null !== toolbarItems && void 0 !== toolbarItems && toolbarItems.length) } return options.toolbarOptions } _normalizeToolbarItems(defaultItems, userItems) { defaultItems.forEach((button => { if (!DEFAULT_TOOLBAR_ITEM_NAMES.includes(button.name)) { throw new Error(`Default toolbar item '${button.name}' is not added to DEFAULT_TOOLBAR_ITEM_NAMES`) } })); const defaultProps = { location: "after" }; const isArray = Array.isArray(userItems); if (!(0, _type.isDefined)(userItems)) { return defaultItems } if (!isArray) { userItems = [userItems] } const defaultButtonsByNames = {}; defaultItems.forEach((button => { defaultButtonsByNames[button.name] = button })); const normalizedItems = userItems.map((button => { if ((0, _type.isString)(button)) { button = { name: button } } if ((0, _type.isDefined)(button.name)) { if ((0, _type.isDefined)(defaultButtonsByNames[button.name])) { button = (0, _extend.extend)(true, {}, defaultButtonsByNames[button.name], button) } else if (DEFAULT_TOOLBAR_ITEM_NAMES.includes(button.name)) { button = _extends({}, button, { visible: false }) } } return (0, _extend.extend)(true, {}, defaultProps, button) })); return isArray ? normalizedItems : normalizedItems[0] } _renderCore() { if (!this._toolbar) { const $headerPanel = this.element(); $headerPanel.addClass(this.addWidgetPrefix("header-panel")); const label = _message.default.format(this.component.NAME + "-ariaToolbar"); const $toolbar = (0, _renderer.default)("
").attr("aria-label", label).appendTo($headerPanel); this._toolbar = this._createComponent($toolbar, _toolbar.default, this._toolbarOptions) } else { this._toolbar.option(this._toolbarOptions) } } _columnOptionChanged() {} _handleDataChanged() { if (this._requireReady) { this.render() } } _isDisabledDefinedByUser(name) { var _this$option; const userItems = null === (_this$option = this.option("toolbar")) || void 0 === _this$option ? void 0 : _this$option.items; const userItem = null === userItems || void 0 === userItems ? void 0 : userItems.find((item => (null === item || void 0 === item ? void 0 : item.name) === name)); return (0, _type.isDefined)(null === userItem || void 0 === userItem ? void 0 : userItem.disabled) } render() { this._toolbarOptions = this._getToolbarOptions(); super.render.apply(this, arguments) } setToolbarItemDisabled(name, disabled) { const toolbar = this._toolbar; const isDefinedByUser = this._isDisabledDefinedByUser(name); if (!toolbar || isDefinedByUser) { return } const items = toolbar.option("items") ?? []; const itemIndex = items.findIndex((item => item.name === name)); if (itemIndex < 0) { return } const item = toolbar.option(`items[${itemIndex}]`); toolbar.option(`items[${itemIndex}].disabled`, disabled); if (item.options) { toolbar.option(`items[${itemIndex}].options.disabled`, disabled) } } updateToolbarDimensions() { var _this$_toolbar; null === (_this$_toolbar = this._toolbar) || void 0 === _this$_toolbar || _this$_toolbar.updateDimensions() } getHeaderPanel() { return this.element() } getHeight() { return this.getElementHeight() } optionChanged(args) { if ("onToolbarPreparing" === args.name) { this._invalidate(); args.handled = true } if ("toolbar" === args.name) { const parts = (0, _data.getPathParts)(args.fullName); const optionName = args.fullName.replace(/^toolbar\./, ""); if (1 === parts.length) { this._invalidate() } else if ("items" === parts[1]) { if (2 === parts.length) { var _this$_toolbar2; const toolbarOptions = this._getToolbarOptions(); null === (_this$_toolbar2 = this._toolbar) || void 0 === _this$_toolbar2 || _this$_toolbar2.option("items", toolbarOptions.items) } else if (3 === parts.length) { var _this$_toolbar3; const normalizedItem = this._normalizeToolbarItems(this._getToolbarItems(), args.value); null === (_this$_toolbar3 = this._toolbar) || void 0 === _this$_toolbar3 || _this$_toolbar3.option(optionName, normalizedItem) } else if (parts.length >= 4) { var _this$_toolbar4; null === (_this$_toolbar4 = this._toolbar) || void 0 === _this$_toolbar4 || _this$_toolbar4.option(optionName, args.value) } } else { this._invalidate() } args.handled = true } super.optionChanged(args) } isVisible() { return !!(this._toolbarOptions && this._toolbarOptions.visible) } allowDragging() {} hasGroupedColumns() {} } exports.HeaderPanel = HeaderPanel; exports.headerPanelModule = { defaultOptions: () => ({}), views: { headerPanel: HeaderPanel }, extenders: { controllers: { resizing: Base => class extends Base { _updateDimensionsCore() { super._updateDimensionsCore.apply(this, arguments); this.getView("headerPanel").updateToolbarDimensions() } } } } } }, 67004: /*!*****************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/keyboard_navigation/const.js ***! \*****************************************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.WIDGET_CLASS = exports.VIRTUAL_ROW_CLASS = exports.ROW_CLASS = exports.ROWS_VIEW_CLASS = exports.ROWS_VIEW = exports.REVERT_BUTTON_CLASS = exports.NON_FOCUSABLE_ELEMENTS_SELECTOR = exports.MASTER_DETAIL_ROW_CLASS = exports.MASTER_DETAIL_CELL_CLASS = exports.INTERACTIVE_ELEMENTS_SELECTOR = exports.HEADER_ROW_CLASS = exports.GROUP_ROW_CLASS = exports.GROUP_FOOTER_CLASS = exports.FUNCTIONAL_KEYS = exports.FREESPACE_ROW_CLASS = exports.FOCUS_TYPE_ROW = exports.FOCUS_TYPE_CELL = exports.FOCUS_STATE_CLASS = exports.FOCUSED_CLASS = exports.FAST_EDITING_DELETE_KEY = exports.EDIT_MODE_FORM = exports.EDIT_FORM_ITEM_CLASS = exports.EDIT_FORM_CLASS = exports.EDITOR_CELL_CLASS = exports.DROPDOWN_EDITOR_OVERLAY_CLASS = exports.DATEBOX_WIDGET_NAME = exports.DATA_ROW_CLASS = exports.COMMAND_SELECT_CLASS = exports.COMMAND_EXPAND_CLASS = exports.COMMAND_EDIT_CLASS = exports.COMMAND_CELL_SELECTOR = exports.COLUMN_HEADERS_VIEW = exports.CELL_FOCUS_DISABLED_CLASS = exports.ATTRIBUTES = exports.ADAPTIVE_COLUMN_NAME_CLASS = void 0; exports.ATTRIBUTES = { ariaColIndex: "aria-colindex", dragCell: "dx-drag-cell" }; exports.ROWS_VIEW_CLASS = "rowsview"; exports.EDIT_FORM_CLASS = "edit-form"; exports.GROUP_FOOTER_CLASS = "group-footer"; exports.ROW_CLASS = "dx-row"; exports.DATA_ROW_CLASS = "dx-data-row"; exports.GROUP_ROW_CLASS = "dx-group-row"; exports.HEADER_ROW_CLASS = "dx-header-row"; exports.EDIT_FORM_ITEM_CLASS = "edit-form-item"; exports.MASTER_DETAIL_ROW_CLASS = "dx-master-detail-row"; exports.FREESPACE_ROW_CLASS = "dx-freespace-row"; exports.VIRTUAL_ROW_CLASS = "dx-virtual-row"; exports.MASTER_DETAIL_CELL_CLASS = "dx-master-detail-cell"; exports.EDITOR_CELL_CLASS = "dx-editor-cell"; exports.DROPDOWN_EDITOR_OVERLAY_CLASS = "dx-dropdowneditor-overlay"; exports.COMMAND_EXPAND_CLASS = "dx-command-expand"; exports.ADAPTIVE_COLUMN_NAME_CLASS = "dx-command-adaptive"; exports.COMMAND_SELECT_CLASS = "dx-command-select"; exports.COMMAND_EDIT_CLASS = "dx-command-edit"; exports.COMMAND_CELL_SELECTOR = "[class^=dx-command]"; exports.CELL_FOCUS_DISABLED_CLASS = "dx-cell-focus-disabled"; exports.DATEBOX_WIDGET_NAME = "dxDateBox"; exports.FOCUS_STATE_CLASS = "dx-state-focused"; exports.WIDGET_CLASS = "dx-widget"; exports.REVERT_BUTTON_CLASS = "dx-revert-button"; exports.FOCUSED_CLASS = "dx-focused"; exports.FAST_EDITING_DELETE_KEY = "delete"; const INTERACTIVE_ELEMENTS_SELECTOR = exports.INTERACTIVE_ELEMENTS_SELECTOR = '\n input:not([type="hidden"]):not([disabled]),\n textarea:not([disabled]),\n a:not([disabled]),\n select:not([disabled]),\n button:not([disabled]),\n [tabindex]:not([disabled]),\n .dx-checkbox:not([disabled],.dx-state-readonly)\n'; exports.NON_FOCUSABLE_ELEMENTS_SELECTOR = `${INTERACTIVE_ELEMENTS_SELECTOR}, .dx-dropdowneditor-icon`; exports.EDIT_MODE_FORM = "form"; exports.FOCUS_TYPE_ROW = "row"; exports.FOCUS_TYPE_CELL = "cell"; exports.COLUMN_HEADERS_VIEW = "columnHeadersView"; exports.ROWS_VIEW = "rowsView"; exports.FUNCTIONAL_KEYS = ["shift", "control", "alt"] }, 83066: /*!***************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/keyboard_navigation/dom.js ***! \***************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.GridCoreKeyboardNavigationDom = void 0; var _const = __webpack_require__( /*! ./const */ 67004); exports.GridCoreKeyboardNavigationDom = { isDragCell: $cell => void 0 !== $cell.attr(_const.ATTRIBUTES.dragCell), getCellToFocus: ($cellElements, columnIndex) => $cellElements.filter((columnIndex => [`[${_const.ATTRIBUTES.ariaColIndex}="${columnIndex+1}"]`, `:not([${_const.ATTRIBUTES.dragCell}])`, ":not([aria-hidden=true])"].join(""))(columnIndex)).first() } }, 31822: /*!*********************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/keyboard_navigation/m_keyboard_navigation.js ***! \*********************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.keyboardNavigationModule = exports.KeyboardNavigationController = void 0; var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../../core/dom_adapter */ 73349)); var _element = __webpack_require__( /*! ../../../../core/element */ 6415); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _browser = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/browser */ 47810)); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _size = __webpack_require__( /*! ../../../../core/utils/size */ 58664); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _click = __webpack_require__( /*! ../../../../events/click */ 95429); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../../events/core/events_engine */ 55994)); var _pointer = _interopRequireDefault(__webpack_require__( /*! ../../../../events/pointer */ 93786)); var _short = __webpack_require__( /*! ../../../../events/short */ 72918); var _index = __webpack_require__( /*! ../../../../events/utils/index */ 39611); var accessibility = function(e, r) { if (!r && e && e.__esModule) { return e } if (null === e || "object" != typeof e && "function" != typeof e) { return { default: e } } var t = _getRequireWildcardCache(r); if (t && t.has(e)) { return t.get(e) } var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u] } } return n.default = e, t && t.set(e, n), n }(__webpack_require__( /*! ../../../../ui/shared/accessibility */ 56756)); var _selectors = __webpack_require__( /*! ../../../../ui/widget/selectors */ 31421); var _memoize = __webpack_require__( /*! ../../../utils/memoize */ 18945); var _const = __webpack_require__( /*! ../editing/const */ 72313); var _m_modules = _interopRequireDefault(__webpack_require__( /*! ../m_modules */ 15943)); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../m_utils */ 60082)); var _const2 = __webpack_require__( /*! ./const */ 67004); var _dom = __webpack_require__( /*! ./dom */ 83066); var _m_keyboard_navigation_utils = __webpack_require__( /*! ./m_keyboard_navigation_utils */ 67250); var _scrollable_a11y = __webpack_require__( /*! ./scrollable_a11y */ 91355); function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) { return null } var r = new WeakMap, t = new WeakMap; return (_getRequireWildcardCache = function(e) { return e ? t : r })(e) } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } class KeyboardNavigationController extends _m_modules.default.ViewController { init() { this._dataController = this.getController("data"); this._selectionController = this.getController("selection"); this._editingController = this.getController("editing"); this._headerPanel = this.getView("headerPanel"); this._rowsView = this.getView("rowsView"); this._columnsController = this.getController("columns"); this._editorFactory = this.getController("editorFactory"); this._focusController = this.getController("focus"); this._adaptiveColumnsController = this.getController("adaptiveColumns"); this._columnResizerController = this.getController("columnsResizer"); this._memoFireFocusedCellChanged = (0, _memoize.memoize)(this._memoFireFocusedCellChanged.bind(this), { compareType: "value" }); this._memoFireFocusedRowChanged = (0, _memoize.memoize)(this._memoFireFocusedRowChanged.bind(this), { compareType: "value" }); this.focusedHandlerWithContext = this.focusedHandlerWithContext || this.focusedHandler.bind(this); this.renderCompletedWithContext = this.renderCompletedWithContext || this.renderCompleted.bind(this); this.rowsViewFocusHandlerContext = this.rowsViewFocusHandlerContext || this.rowsViewFocusHandler.bind(this); this.rowsViewFocusOutHandlerContext = this.rowsViewFocusOutHandlerContext ?? this.rowsViewFocusOutHandler.bind(this); this._updateFocusTimeout = null; this._fastEditingStarted = false; this._focusedCellPosition = {}; this._canceledCellPosition = null; if (this.isKeyboardEnabled()) { var _this$_editorFactory; accessibility.subscribeVisibilityChange(); null === (_this$_editorFactory = this._editorFactory) || void 0 === _this$_editorFactory || _this$_editorFactory.focused.add(this.focusedHandlerWithContext); this.createAction("onKeyDown") } else { var _this$_editorFactory2; accessibility.unsubscribeVisibilityChange(); null === (_this$_editorFactory2 = this._editorFactory) || void 0 === _this$_editorFactory2 || _this$_editorFactory2.focused.remove(this.focusedHandlerWithContext) } this.initViewHandlers(); this.initDocumentHandlers() } dispose() { super.dispose(); this._resetFocusedView(); _short.keyboard.off(this._keyDownListener); _events_engine.default.off(_dom_adapter.default.getDocument(), (0, _index.addNamespace)(_pointer.default.down, "dxDataGridKeyboardNavigation"), this._documentClickHandler); clearTimeout(this._updateFocusTimeout); accessibility.unsubscribeVisibilityChange() } focusedHandler($element) { this.setupFocusedView(); if (this._isNeedScroll) { if ($element.is(":visible") && this._focusedView && this._focusedView.getScrollable()) { this._focusedView._scrollToElement($element); this._isNeedScroll = false } } } rowsViewFocusHandler(event) { const $element = (0, _renderer.default)(event.target); const isRelatedTargetInRowsView = (0, _renderer.default)(event.relatedTarget).closest(this._rowsView.element()).length; const isLink = $element.is("a"); if (event.relatedTarget && isLink && !isRelatedTargetInRowsView && this._isEventInCurrentGrid(event)) { let $focusedCell = this._getFocusedCell(); $focusedCell = !(0, _m_keyboard_navigation_utils.isElementDefined)($focusedCell) ? this._rowsView.getCellElements(0).filter("[tabindex]").eq(0) : $focusedCell; if (!$element.closest($focusedCell).length) { event.preventDefault(); _events_engine.default.trigger($focusedCell, "focus") } } const isCell = $element.is("td"); const needSetFocusPosition = (this.option("focusedRowIndex") ?? -1) < 0; if (isCell && needSetFocusPosition) { this._updateFocusedCellPosition($element) } } rowsViewFocusOutHandler() { this._toggleInertAttr(false) } subscribeToRowsViewFocusEvent() { var _this$_rowsView; const $rowsView = null === (_this$_rowsView = this._rowsView) || void 0 === _this$_rowsView ? void 0 : _this$_rowsView.element(); _events_engine.default.on($rowsView, "focusin", this.rowsViewFocusHandlerContext); _events_engine.default.on($rowsView, "focusout", this.rowsViewFocusOutHandlerContext) } unsubscribeFromRowsViewFocusEvent() { var _this$_rowsView2; const $rowsView = null === (_this$_rowsView2 = this._rowsView) || void 0 === _this$_rowsView2 ? void 0 : _this$_rowsView2.element(); _events_engine.default.off($rowsView, "focusin", this.rowsViewFocusHandlerContext); _events_engine.default.off($rowsView, "focusout", this.rowsViewFocusOutHandlerContext) } renderCompleted(e) { const $rowsView = this._rowsView.element(); const isFullUpdate = !e || "refresh" === e.changeType; const isFocusedViewCorrect = this._focusedView && this._focusedView.name === this._rowsView.name; let needUpdateFocus = false; const isAppend = e && ("append" === e.changeType || "prepend" === e.changeType); const root = (0, _renderer.default)(_dom_adapter.default.getRootNode($rowsView.get && $rowsView.get(0))); const $focusedElement = root.find(":focus"); const isFocusedElementCorrect = !$focusedElement.length || $focusedElement.closest($rowsView).length; this.unsubscribeFromRowsViewFocusEvent(); this.subscribeToRowsViewFocusEvent(); this.initPointerEventHandler(); this.initKeyDownHandler(); this._setRowsViewAttributes(); if (isFocusedViewCorrect && isFocusedElementCorrect) { needUpdateFocus = this._isNeedFocus ? !isAppend : this._isHiddenFocus && isFullUpdate && !(null !== e && void 0 !== e && e.virtualColumnsScrolling); needUpdateFocus && this._updateFocus(true) } } initViewHandlers() { var _this$_rowsView3; this.unsubscribeFromRowsViewFocusEvent(); this.unsubscribeFromPointerEvent(); this.unsubscribeFromKeyDownEvent(); null === (_this$_rowsView3 = this._rowsView) || void 0 === _this$_rowsView3 || null === (_this$_rowsView3 = _this$_rowsView3.renderCompleted) || void 0 === _this$_rowsView3 || _this$_rowsView3.remove(this.renderCompletedWithContext); if (this.isKeyboardEnabled()) { this._rowsView.renderCompleted.add(this.renderCompletedWithContext) } } initDocumentHandlers() { const document = _dom_adapter.default.getDocument(); this._documentClickHandler = this._documentClickHandler || this.createAction((e => { const $target = (0, _renderer.default)(e.event.target); const isCurrentRowsViewClick = this._isEventInCurrentGrid(e.event) && $target.closest(`.${this.addWidgetPrefix(_const2.ROWS_VIEW_CLASS)}`).length; const isEditorOverlay = $target.closest(`.${_const2.DROPDOWN_EDITOR_OVERLAY_CLASS}`).length; const isColumnResizing = !!this._columnResizerController && this._columnResizerController.isResizing(); if (!isCurrentRowsViewClick && !isEditorOverlay && !isColumnResizing) { const targetInsideFocusedView = this._focusedView ? $target.parents().filter(this._focusedView.element()).length > 0 : false; !targetInsideFocusedView && this._resetFocusedCell(true); this._resetFocusedView() } })); _events_engine.default.off(document, (0, _index.addNamespace)(_pointer.default.down, "dxDataGridKeyboardNavigation"), this._documentClickHandler); if (this.isKeyboardEnabled()) { _events_engine.default.on(document, (0, _index.addNamespace)(_pointer.default.down, "dxDataGridKeyboardNavigation"), this._documentClickHandler) } } _setRowsViewAttributes() { const $rowsView = this._getRowsViewElement(); const isGridEmpty = !this._dataController.getVisibleRows().length; if (isGridEmpty) { this._applyTabIndexToElement($rowsView) } } unsubscribeFromPointerEvent() { const pointerEventName = !(0, _m_keyboard_navigation_utils.isMobile)() ? _pointer.default.down : _click.name; const $rowsView = this._getRowsViewElement(); this._pointerEventAction && _events_engine.default.off($rowsView, (0, _index.addNamespace)(pointerEventName, "dxDataGridKeyboardNavigation"), this._pointerEventAction) } subscribeToPointerEvent() { const pointerEventName = !(0, _m_keyboard_navigation_utils.isMobile)() ? _pointer.default.down : _click.name; const $rowsView = this._getRowsViewElement(); const clickSelector = `.${_const.ROW_CLASS} > td, .${_const.ROW_CLASS}`; _events_engine.default.on($rowsView, (0, _index.addNamespace)(pointerEventName, "dxDataGridKeyboardNavigation"), clickSelector, this._pointerEventAction) } initPointerEventHandler() { this._pointerEventAction = this._pointerEventAction || this.createAction(this._pointerEventHandler); this.unsubscribeFromPointerEvent(); this.subscribeToPointerEvent() } unsubscribeFromKeyDownEvent() { _short.keyboard.off(this._keyDownListener) } subscribeToKeyDownEvent() { const $rowsView = this._getRowsViewElement(); this._keyDownListener = _short.keyboard.on($rowsView, null, (e => this._keyDownHandler(e))) } initKeyDownHandler() { this._keyDownListener && this.unsubscribeFromKeyDownEvent(); this.subscribeToKeyDownEvent() } optionChanged(args) { switch (args.name) { case "keyboardNavigation": if ("keyboardNavigation.enabled" === args.fullName) { this.init() } args.handled = true; break; case "useLegacyKeyboardNavigation": this.init(); args.handled = true; break; default: super.optionChanged(args) } } isRowFocusType() { return this.focusType === _const2.FOCUS_TYPE_ROW } isCellFocusType() { return this.focusType === _const2.FOCUS_TYPE_CELL } setRowFocusType() { if (this.option("focusedRowEnabled")) { this.focusType = _const2.FOCUS_TYPE_ROW } } setCellFocusType() { this.focusType = _const2.FOCUS_TYPE_CELL } _keyDownHandler(e) { var _this$_editingControl; let needStopPropagation = true; this._isNeedFocus = true; this._isNeedScroll = true; let isHandled = this._processOnKeyDown(e); const isEditing = null === (_this$_editingControl = this._editingController) || void 0 === _this$_editingControl ? void 0 : _this$_editingControl.isEditing(); const { originalEvent: originalEvent } = e; if (originalEvent.isDefaultPrevented()) { this._isNeedFocus = false; this._isNeedScroll = false; return }!_const2.FUNCTIONAL_KEYS.includes(e.keyName) && this._updateFocusedCellPositionByTarget(originalEvent.target); if (!isHandled) { switch (e.keyName) { case "leftArrow": case "rightArrow": this._leftRightKeysHandler(e, isEditing); isHandled = true; break; case "upArrow": case "downArrow": if (e.ctrl) { accessibility.selectView("rowsView", this, originalEvent) } else { this._upDownKeysHandler(e, isEditing) } isHandled = true; break; case "pageUp": case "pageDown": this._pageUpDownKeyHandler(e); isHandled = true; break; case "space": isHandled = this._spaceKeyHandler(e, isEditing); break; case "A": if ((0, _index.isCommandKeyPressed)(e.originalEvent)) { this._ctrlAKeyHandler(e, isEditing); isHandled = true } else { isHandled = this._beginFastEditing(e.originalEvent) } break; case "tab": this._tabKeyHandler(e, isEditing); isHandled = true; break; case "enter": this._enterKeyHandler(e, isEditing); isHandled = true; break; case "escape": isHandled = this._escapeKeyHandler(e, isEditing); break; case "F": if ((0, _index.isCommandKeyPressed)(e.originalEvent)) { this._ctrlFKeyHandler(e); isHandled = true } else { isHandled = this._beginFastEditing(e.originalEvent) } break; case "F2": this._f2KeyHandler(); isHandled = true; break; case "del": case "backspace": if (this._isFastEditingAllowed() && !this._isFastEditingStarted()) { isHandled = this._beginFastEditing(originalEvent, true) } } if (!isHandled && !this._beginFastEditing(originalEvent)) { this._isNeedFocus = false; this._isNeedScroll = false; needStopPropagation = false } if (needStopPropagation) { originalEvent.stopPropagation() } } } _processOnKeyDown(eventArgs) { const { originalEvent: originalEvent } = eventArgs; const args = { handled: false, event: originalEvent }; this.executeAction("onKeyDown", args); eventArgs.ctrl = originalEvent.ctrlKey; eventArgs.alt = originalEvent.altKey; eventArgs.shift = originalEvent.shiftKey; return !!args.handled } _closeEditCell() { const d = (0, _deferred.Deferred)(); setTimeout((() => { this._editingController.closeEditCell().always(d.resolve) })); return d } _leftRightKeysHandler(eventArgs, isEditing) { const rowIndex = this.getVisibleRowIndex(); const $event = eventArgs.originalEvent; const $row = this._focusedView && this._focusedView.getRow(rowIndex); const directionCode = this._getDirectionCodeByKey(eventArgs.keyName); const isEditingNavigationMode = this._isFastEditingStarted(); const allowNavigate = (!isEditing || isEditingNavigationMode) && (0, _m_keyboard_navigation_utils.isDataRow)($row); if (allowNavigate) { this.setCellFocusType(); isEditingNavigationMode && this._closeEditCell(); if (this._isVirtualColumnRender()) { this._processVirtualHorizontalPosition(directionCode) } const $cell = this._getNextCell(directionCode); if ((0, _m_keyboard_navigation_utils.isElementDefined)($cell)) { this._arrowKeysHandlerFocusCell($event, $cell, directionCode) } $event && $event.preventDefault() } } isInsideMasterDetail($target) { const $masterDetail = $target.closest(`.${_const2.MASTER_DETAIL_CELL_CLASS}`); return !!$masterDetail.get(0) && this.elementIsInsideGrid($masterDetail) && !$target.is($masterDetail) } _upDownKeysHandler(eventArgs, isEditing) { var _this$_editingControl2, _this$_editingControl3; const visibleRowIndex = this.getVisibleRowIndex(); const $row = this._focusedView && this._focusedView.getRow(visibleRowIndex); const $event = eventArgs.originalEvent; const isUpArrow = "upArrow" === eventArgs.keyName; const dataSource = this._dataController.dataSource(); const isRowEditingInCurrentRow = null === (_this$_editingControl2 = this._editingController) || void 0 === _this$_editingControl2 || null === (_this$_editingControl3 = _this$_editingControl2.isEditRowByIndex) || void 0 === _this$_editingControl3 ? void 0 : _this$_editingControl3.call(_this$_editingControl2, visibleRowIndex); const isEditingNavigationMode = this._isFastEditingStarted(); const isInsideMasterDetail = this.isInsideMasterDetail((0, _renderer.default)(null === $event || void 0 === $event ? void 0 : $event.target)); const allowNavigate = (!isRowEditingInCurrentRow || !isEditing || isEditingNavigationMode) && $row && !(0, _m_keyboard_navigation_utils.isEditForm)($row) && !isInsideMasterDetail; if (allowNavigate) { isEditingNavigationMode && this._closeEditCell(); if (!this._navigateNextCell($event, eventArgs.keyName)) { if (this._isVirtualRowRender() && isUpArrow && dataSource && !dataSource.isLoading()) { const rowHeight = (0, _size.getOuterHeight)($row); const rowIndex = this._focusedCellPosition.rowIndex - 1; this._scrollBy(0, -rowHeight, rowIndex, $event) } } $event && $event.preventDefault() } } _pageUpDownKeyHandler(eventArgs) { const pageIndex = this._dataController.pageIndex(); const pageCount = this._dataController.pageCount(); const pagingEnabled = this.option("paging.enabled"); const isPageUp = "pageUp" === eventArgs.keyName; const pageStep = isPageUp ? -1 : 1; const scrollable = this._rowsView.getScrollable(); if (pagingEnabled && !this._isVirtualScrolling()) { if ((isPageUp ? pageIndex > 0 : pageIndex < pageCount - 1) && !this._isVirtualScrolling()) { this._dataController.pageIndex(pageIndex + pageStep); eventArgs.originalEvent.preventDefault() } } else if (scrollable && (0, _size.getHeight)(scrollable.container()) < (0, _size.getHeight)(scrollable.$content())) { this._scrollBy(0, (0, _size.getHeight)(scrollable.container()) * pageStep); eventArgs.originalEvent.preventDefault() } } _spaceKeyHandler(eventArgs, isEditing) { const rowIndex = this.getVisibleRowIndex(); const $target = (0, _renderer.default)(eventArgs.originalEvent && eventArgs.originalEvent.target); if (this.option("selection") && "none" !== this.option("selection").mode && !isEditing) { const isFocusedRowElement = "row" === this._getElementType($target) && this.isRowFocusType() && (0, _m_keyboard_navigation_utils.isDataRow)($target); const isFocusedSelectionCell = $target.hasClass(_const2.COMMAND_SELECT_CLASS); if (isFocusedSelectionCell && "onClick" === this.option("selection.showCheckBoxesMode")) { this._selectionController.startSelectionWithCheckboxes() } if (isFocusedRowElement || $target.parent().hasClass(_const2.DATA_ROW_CLASS) || $target.hasClass(this.addWidgetPrefix(_const2.ROWS_VIEW_CLASS))) { this._selectionController.changeItemSelection(rowIndex, { shift: eventArgs.shift, control: eventArgs.ctrl }); eventArgs.originalEvent.preventDefault(); return true } return false } return this._beginFastEditing(eventArgs.originalEvent) } _ctrlAKeyHandler(eventArgs, isEditing) { if (!isEditing && !eventArgs.alt && "multiple" === this.option("selection.mode") && this.option("selection.allowSelectAll")) { this._selectionController.selectAll(); eventArgs.originalEvent.preventDefault() } } _toggleInertAttr(value) {} _tabKeyHandler(eventArgs, isEditing) { const editingOptions = this.option("editing"); const direction = eventArgs.shift ? "previous" : "next"; const isCellPositionDefined = (0, _type.isDefined)(this._focusedCellPosition) && !(0, _type.isEmptyObject)(this._focusedCellPosition); const isFirstValidCell = eventArgs.shift && this._isFirstValidCell(this._focusedCellPosition); const isLastValidCell = !eventArgs.shift && this._isLastValidCell(this._focusedCellPosition); let isOriginalHandlerRequired = !isCellPositionDefined || isFirstValidCell || isLastValidCell; const eventTarget = eventArgs.originalEvent.target; const focusedViewElement = this._focusedView && this._focusedView.element(); if (this._handleTabKeyOnMasterDetailCell(eventTarget, direction)) { return }(0, _renderer.default)(focusedViewElement).addClass(_const2.FOCUS_STATE_CLASS); if (editingOptions && eventTarget && !isOriginalHandlerRequired) { if ((0, _renderer.default)(eventTarget).hasClass(this.addWidgetPrefix(_const2.ROWS_VIEW_CLASS))) { this._resetFocusedCell() } if (this._isVirtualColumnRender()) { this._processVirtualHorizontalPosition(direction) } if (isEditing) { if (!this._editingCellTabHandler(eventArgs, direction)) { return } } else if (this._targetCellTabHandler(eventArgs, direction)) { isOriginalHandlerRequired = true } } if (isOriginalHandlerRequired) { const $cell = this._getFocusedCell(); const isCommandCell = $cell.is(_const2.COMMAND_CELL_SELECTOR); if (isLastValidCell && !isCommandCell) { this._toggleInertAttr(true) } this._editorFactory.loseFocus(); if (this._editingController.isEditing() && !this._isRowEditMode()) { this._resetFocusedCell(true); this._resetFocusedView(); this._closeEditCell() } } else { eventArgs.originalEvent.preventDefault() } } _getMaxHorizontalOffset() { const scrollable = this.component.getScrollable(); return scrollable ? scrollable.scrollWidth() - (0, _size.getWidth)(this._rowsView.element()) : 0 } _isColumnRendered(columnIndex) { const allVisibleColumns = this._columnsController.getVisibleColumns(null, true); const renderedVisibleColumns = this._columnsController.getVisibleColumns(); const column = allVisibleColumns[columnIndex]; let result = false; if (column) { result = renderedVisibleColumns.indexOf(column) >= 0 } return result } _isFixedColumn(columnIndex) { const allVisibleColumns = this._columnsController.getVisibleColumns(null, true); const column = allVisibleColumns[columnIndex]; return !!column && !!column.fixed } _isColumnVirtual(columnIndex) { const localColumnIndex = columnIndex - this._columnsController.getColumnIndexOffset(); const visibleColumns = this._columnsController.getVisibleColumns(); const column = visibleColumns[localColumnIndex]; return !!column && "virtual" === column.command } _processVirtualHorizontalPosition(direction) { const scrollable = this.component.getScrollable(); const columnIndex = this.getColumnIndex(); let nextColumnIndex; let horizontalScrollPosition = 0; let needToScroll = false; switch (direction) { case "next": case "nextInRow": { const columnsCount = this._getVisibleColumnCount(); nextColumnIndex = columnIndex + 1; horizontalScrollPosition = this.option("rtlEnabled") ? this._getMaxHorizontalOffset() : 0; if ("next" === direction) { needToScroll = columnsCount === nextColumnIndex || this._isFixedColumn(columnIndex) && !this._isColumnRendered(nextColumnIndex) } else { needToScroll = columnsCount > nextColumnIndex && this._isFixedColumn(columnIndex) && !this._isColumnRendered(nextColumnIndex) } break } case "previous": case "previousInRow": nextColumnIndex = columnIndex - 1; horizontalScrollPosition = this.option("rtlEnabled") ? 0 : this._getMaxHorizontalOffset(); if ("previous" === direction) { const columnIndexOffset = this._columnsController.getColumnIndexOffset(); const leftEdgePosition = nextColumnIndex < 0 && 0 === columnIndexOffset; needToScroll = leftEdgePosition || this._isFixedColumn(columnIndex) && !this._isColumnRendered(nextColumnIndex) } else { needToScroll = nextColumnIndex >= 0 && this._isFixedColumn(columnIndex) && !this._isColumnRendered(nextColumnIndex) } } if (needToScroll) { scrollable.scrollTo({ left: horizontalScrollPosition }) } else if ((0, _type.isDefined)(nextColumnIndex) && (0, _type.isDefined)(direction) && this._isColumnVirtual(nextColumnIndex)) { horizontalScrollPosition = this._getHorizontalScrollPositionOffset(direction); 0 !== horizontalScrollPosition && scrollable.scrollBy({ left: horizontalScrollPosition, top: 0 }) } } _getHorizontalScrollPositionOffset(direction) { let positionOffset = 0; const $currentCell = this._getCell(this._focusedCellPosition); const currentCellWidth = $currentCell && (0, _size.getOuterWidth)($currentCell); if (currentCellWidth > 0) { const rtlMultiplier = this.option("rtlEnabled") ? -1 : 1; positionOffset = "nextInRow" === direction || "next" === direction ? currentCellWidth * rtlMultiplier : currentCellWidth * rtlMultiplier * -1 } return positionOffset } _editingCellTabHandler(eventArgs, direction) { const eventTarget = eventArgs.originalEvent.target; let $cell = this._getCellElementFromTarget(eventTarget); let isEditingAllowed; const $event = eventArgs.originalEvent; const elementType = this._getElementType(eventTarget); if ($cell.is(_const2.COMMAND_CELL_SELECTOR)) { return !this._targetCellTabHandler(eventArgs, direction) } this._updateFocusedCellPosition($cell); const nextCellInfo = this._getNextCellByTabKey($event, direction, elementType); $cell = nextCellInfo.$cell; if (!$cell || this._handleTabKeyOnMasterDetailCell($cell, direction)) { return false } const column = this._getColumnByCellElement($cell); const $row = $cell.parent(); const rowIndex = this._getRowIndex($row); const row = this._dataController.items()[rowIndex]; const editingController = this._editingController; if (column && column.allowEditing) { const isDataRow = !row || "data" === row.rowType; isEditingAllowed = editingController.allowUpdating({ row: row }) ? isDataRow : row && row.isNewRow } if (!isEditingAllowed) { this._closeEditCell() } if (this._focusCell($cell, !nextCellInfo.isHighlighted)) { if (!this._isRowEditMode() && isEditingAllowed) { this._editFocusedCell() } else { this._focusInteractiveElement($cell, eventArgs.shift) } } return true } _targetCellTabHandler(eventArgs, direction) { const $event = eventArgs.originalEvent; let eventTarget = $event.target; let elementType = this._getElementType(eventTarget); let $cell = this._getCellElementFromTarget(eventTarget); const $lastInteractiveElement = "cell" === elementType && this._getInteractiveElement($cell, !eventArgs.shift); let isOriginalHandlerRequired = false; if (!(0, _m_keyboard_navigation_utils.isEditorCell)(this, $cell) && null !== $lastInteractiveElement && void 0 !== $lastInteractiveElement && $lastInteractiveElement.length && eventTarget !== $lastInteractiveElement.get(0)) { isOriginalHandlerRequired = true } else { if (void 0 === this._focusedCellPosition.rowIndex && (0, _renderer.default)(eventTarget).hasClass(_const.ROW_CLASS)) { this._updateFocusedCellPosition($cell) } elementType = this._getElementType(eventTarget); if (this.isRowFocusType()) { this.setCellFocusType(); if ("row" === elementType && (0, _m_keyboard_navigation_utils.isDataRow)((0, _renderer.default)(eventTarget))) { eventTarget = this.getFirstValidCellInRow((0, _renderer.default)(eventTarget)); elementType = this._getElementType(eventTarget) } } const nextCellInfo = this._getNextCellByTabKey($event, direction, elementType); $cell = nextCellInfo.$cell; if (!$cell) { return false } $cell = this._checkNewLineTransition($event, $cell); if (!$cell) { return false } this._focusCell($cell, !nextCellInfo.isHighlighted); if (!(0, _m_keyboard_navigation_utils.isEditorCell)(this, $cell)) { this._focusInteractiveElement($cell, eventArgs.shift) } } return isOriginalHandlerRequired } _getNextCellByTabKey($event, direction, elementType) { let $cell = this._getNextCell(direction, elementType); const args = $cell && this._fireFocusedCellChanging($event, $cell, true); if (!args || args.cancel) { return {} } if (args.$newCellElement) { $cell = args.$newCellElement } return { $cell: $cell, isHighlighted: args.isHighlighted } } _checkNewLineTransition($event, $cell) { const rowIndex = this.getVisibleRowIndex(); const $row = $cell.parent(); if (rowIndex !== this._getRowIndex($row)) { const cellPosition = this._getCellPosition($cell); const args = this._fireFocusedRowChanging($event, $row); if (args.cancel) { return } if (args.rowIndexChanged && cellPosition) { this.setFocusedColumnIndex(cellPosition.columnIndex); $cell = this._getFocusedCell() } } return $cell } _enterKeyHandler(eventArgs, isEditing) { var _this$_focusedView, _this$getMasterDetail; const rowIndex = this.getVisibleRowIndex(); const key = this._dataController.getKeyByRowIndex(rowIndex); const $row = null === (_this$_focusedView = this._focusedView) || void 0 === _this$_focusedView ? void 0 : _this$_focusedView.getRow(rowIndex); const $cell = this._getFocusedCell(); const needExpandGroupRow = this.option("grouping.allowCollapsing") && (0, _m_keyboard_navigation_utils.isGroupRow)($row); const needExpandMasterDetailRow = this.option("masterDetail.enabled") && (null === $cell || void 0 === $cell ? void 0 : $cell.hasClass(_const2.COMMAND_EXPAND_CLASS)); const needExpandAdaptiveRow = null === $cell || void 0 === $cell ? void 0 : $cell.hasClass(_const2.ADAPTIVE_COLUMN_NAME_CLASS); if (needExpandGroupRow || needExpandMasterDetailRow) { const item = this._dataController.items()[rowIndex]; const isNotContinuation = (null === item || void 0 === item ? void 0 : item.data) && !item.data.isContinuation; if ((0, _type.isDefined)(key) && isNotContinuation) { this._dataController.changeRowExpand(key) } } else if (needExpandAdaptiveRow) { this._adaptiveColumnsController.toggleExpandAdaptiveDetailRow(key); this._updateFocusedCellPosition($cell) } else if (null !== (_this$getMasterDetail = this.getMasterDetailCell($cell)) && void 0 !== _this$getMasterDetail && _this$getMasterDetail.is($cell)) { if ($cell.is(":focus")) { this.focusFirstInteractiveElementInside($cell) } } else if (!(null !== $cell && void 0 !== $cell && $cell.hasClass(_const2.COMMAND_EDIT_CLASS))) { this._processEnterKeyForDataCell(eventArgs, isEditing) } } focusFirstInteractiveElementInside($el) { $el.find(_const2.INTERACTIVE_ELEMENTS_SELECTOR).get(0).focus() } _processEnterKeyForDataCell(eventArgs, isEditing) { const direction = this._getEnterKeyDirection(eventArgs); const allowEditingOnEnterKey = this._allowEditingOnEnterKey(); if (isEditing || !allowEditingOnEnterKey && direction) { this._handleEnterKeyEditingCell(eventArgs.originalEvent).done((() => { if ("next" === direction || "previous" === direction) { this._targetCellTabHandler(eventArgs, direction) } else if ("upArrow" === direction || "downArrow" === direction) { this._navigateNextCell(eventArgs.originalEvent, direction) } })) } else if (allowEditingOnEnterKey) { this._startEditing(eventArgs) } } _getEnterKeyDirection(eventArgs) { const enterKeyDirection = this.option("keyboardNavigation.enterKeyDirection"); const isShift = eventArgs.shift; if ("column" === enterKeyDirection) { return isShift ? "upArrow" : "downArrow" } if ("row" === enterKeyDirection) { return isShift ? "previous" : "next" } return } _handleEnterKeyEditingCell(event) { const d = (0, _deferred.Deferred)(); const { target: target } = event; const $cell = this._getCellElementFromTarget(target); const isRowEditMode = this._isRowEditMode(); this._updateFocusedCellPosition($cell); if (isRowEditMode) { this._focusEditFormCell($cell); setTimeout(this._editingController.saveEditData.bind(this._editingController)); d.resolve() } else { _events_engine.default.trigger((0, _renderer.default)(target), "change"); this._closeEditCell().always(d.resolve); event.preventDefault() } return d } _escapeKeyHandler(eventArgs, isEditing) { const $cell = this._getCellElementFromTarget(eventArgs.originalEvent.target); if (isEditing) { this._updateFocusedCellPosition($cell); if (!this._isRowEditMode()) { if ("cell" === this._editingController.getEditMode()) { this._editingController.cancelEditData() } else { this._closeEditCell() } } else { this._focusEditFormCell($cell); this._editingController.cancelEditData(); if (0 === this._dataController.items().length) { this._resetFocusedCell(); this._editorFactory.loseFocus() } } eventArgs.originalEvent.preventDefault(); return true } const masterDetailCell = this.getMasterDetailCell($cell); if (masterDetailCell) { this._focusCell(masterDetailCell); return true } return false } _ctrlFKeyHandler(eventArgs) { if (this.option("searchPanel.visible")) { const searchTextEditor = this._headerPanel.getSearchTextEditor(); if (searchTextEditor) { searchTextEditor.focus(); eventArgs.originalEvent.preventDefault() } } } _f2KeyHandler() { const isEditing = this._editingController.isEditing(); const rowIndex = this.getVisibleRowIndex(); const $row = this._focusedView && this._focusedView.getRow(rowIndex); if (!isEditing && (0, _m_keyboard_navigation_utils.isDataRow)($row)) { this._startEditing() } } _navigateNextCell($event, keyCode) { const $cell = this._getNextCell(keyCode); const directionCode = this._getDirectionCodeByKey(keyCode); const isCellValid = $cell && this._isCellValid($cell); const result = isCellValid ? this._arrowKeysHandlerFocusCell($event, $cell, directionCode) : false; return result } _arrowKeysHandlerFocusCell($event, $nextCell, direction) { const isVerticalDirection = "prevRow" === direction || "nextRow" === direction; const args = this._fireFocusChangingEvents($event, $nextCell, isVerticalDirection, true); $nextCell = args.$newCellElement; if (!args.cancel && this._isCellValid($nextCell)) { this._focus($nextCell, !args.isHighlighted); return true } return false } _beginFastEditing(originalEvent, isDeleting) { if (!this._isFastEditingAllowed() || originalEvent.altKey || originalEvent.ctrlKey || this._editingController.isEditing()) { return false } if (isDeleting) { this._startEditing(originalEvent, _const2.FAST_EDITING_DELETE_KEY) } else { const { key: key } = originalEvent; const keyCode = originalEvent.keyCode || originalEvent.which; const fastEditingKey = key || keyCode && String.fromCharCode(keyCode); if (fastEditingKey && (1 === fastEditingKey.length || fastEditingKey === _const2.FAST_EDITING_DELETE_KEY)) { this._startEditing(originalEvent, fastEditingKey) } } return true } _pointerEventHandler(e) { var _this$_rowsView4; const event = e.event || e; let $target = (0, _renderer.default)(event.currentTarget); const focusedViewElement = null === (_this$_rowsView4 = this._rowsView) || void 0 === _this$_rowsView4 ? void 0 : _this$_rowsView4.element(); const $parent = $target.parent(); const isInteractiveElement = (0, _renderer.default)(event.target).is(_const2.INTERACTIVE_ELEMENTS_SELECTOR); const isRevertButton = !!(0, _renderer.default)(event.target).closest(`.${_const2.REVERT_BUTTON_CLASS}`).length; const isExpandCommandCell = $target.hasClass(_const2.COMMAND_EXPAND_CLASS); if (!this._isEventInCurrentGrid(event)) { return } if (!isRevertButton && (this._isCellValid($target, !isInteractiveElement) || isExpandCommandCell)) { $target = this._isInsideEditForm($target) ? (0, _renderer.default)(event.target) : $target; this._focusView(); (0, _renderer.default)(focusedViewElement).removeClass(_const2.FOCUS_STATE_CLASS); if ($parent.hasClass(_const2.FREESPACE_ROW_CLASS)) { this._updateFocusedCellPosition($target); this._applyTabIndexToElement(this._focusedView.element()); this._focusedView.focus(true) } else if (!this.getMasterDetailCell($target)) { this._clickTargetCellHandler(event, $target) } else { this._updateFocusedCellPosition($target) } } else if ($target.is("td")) { this._resetFocusedCell() } } _clickTargetCellHandler(event, $cell) { const column = this._getColumnByCellElement($cell); const isCellEditMode = this._isCellEditMode(); this.setCellFocusType(); const args = this._fireFocusChangingEvents(event, $cell, true); $cell = args.$newCellElement; if (!args.cancel) { if (args.resetFocusedRow) { this._focusController._resetFocusedRow(); return } if (args.rowIndexChanged) { $cell = this._getFocusedCell() } if (!args.isHighlighted && !isCellEditMode) { this.setRowFocusType() } this._updateFocusedCellPosition($cell); if (this._allowRowUpdating() && isCellEditMode && column && column.allowEditing) { this._isNeedFocus = false; this._isHiddenFocus = false } else { $cell = this._getFocusedCell(); const $target = event && (0, _renderer.default)(event.target).closest(`${_const2.NON_FOCUSABLE_ELEMENTS_SELECTOR}, td`); const skipFocusEvent = $target && $target.not($cell).is(_const2.NON_FOCUSABLE_ELEMENTS_SELECTOR); const isEditor = !!column && !column.command && $cell.hasClass(_const.EDITOR_CELL_CLASS); const isDisabled = !isEditor && (!args.isHighlighted || skipFocusEvent); this._focus($cell, isDisabled, skipFocusEvent) } } else { this.setRowFocusType(); this.setFocusedRowIndex(args.prevRowIndex); if (this._editingController.isEditing() && isCellEditMode) { this._closeEditCell() } } } _allowRowUpdating() { const rowIndex = this.getVisibleRowIndex(); const row = this._dataController.items()[rowIndex]; return this._editingController.allowUpdating({ row: row }, "click") } focus(element) { let activeElementSelector; const focusedRowEnabled = this.option("focusedRowEnabled"); const isHighlighted = this._isCellElement((0, _renderer.default)(element)); if (!element) { activeElementSelector = ".dx-datagrid-rowsview .dx-row[tabindex]"; if (!focusedRowEnabled) { activeElementSelector += ", .dx-datagrid-rowsview .dx-row > td[tabindex]" } element = this.component.$element().find(activeElementSelector).first() } element && this._focusElement((0, _renderer.default)(element), isHighlighted) } getFocusedView() { return this._focusedView } setupFocusedView() { if (this.isKeyboardEnabled() && !(0, _type.isDefined)(this._focusedView)) { this._focusView() } } _focusElement($element, isHighlighted) { const rowsViewElement = (0, _renderer.default)(this._getRowsViewElement()); const $focusedView = $element.closest(rowsViewElement); const isRowFocusType = this.isRowFocusType(); let args = {}; if (!$focusedView.length || this._isCellElement($element) && !this._isCellValid($element)) { return } this._focusView(); this._isNeedFocus = true; this._isNeedScroll = true; if (this._isCellElement($element) || (0, _m_keyboard_navigation_utils.isGroupRow)($element)) { this.setCellFocusType(); args = this._fireFocusChangingEvents(null, $element, true, isHighlighted); $element = args.$newCellElement; if (isRowFocusType && !args.isHighlighted) { this.setRowFocusType() } } if (!args.cancel) { this._focus($element, !args.isHighlighted); this._focusInteractiveElement($element) } } _getFocusedViewByElement($element) { const view = this.getFocusedView(); const $view = view && (0, _renderer.default)(view.element()); return $element && 0 !== $element.closest($view).length } _focusView() { this._focusedView = this._rowsView } _resetFocusedView() { this.setRowFocusType(); this._focusedView = null } _focusInteractiveElement($cell, isLast) { if (!$cell) { return } const $focusedElement = this._getInteractiveElement($cell, isLast); _m_utils.default.focusAndSelectElement(this, $focusedElement) } _focus($cell, disableFocus, skipFocusEvent) { const $row = $cell && !$cell.hasClass(_const.ROW_CLASS) ? $cell.closest(`.${_const.ROW_CLASS}`) : $cell; if ($row && (0, _m_keyboard_navigation_utils.isNotFocusedRow)($row)) { return } const focusedView = this._focusedView; const $focusViewElement = focusedView && focusedView.element(); let $focusElement; this._isHiddenFocus = disableFocus; const isRowFocus = (0, _m_keyboard_navigation_utils.isGroupRow)($row) || (0, _m_keyboard_navigation_utils.isGroupFooterRow)($row) || this.isRowFocusType(); if (isRowFocus) { $focusElement = $row; if (focusedView) { this.setFocusedRowIndex(this._getRowIndex($row)) } } else if (this._isCellElement($cell)) { $focusElement = $cell; this._updateFocusedCellPosition($cell) } if ($focusElement) { if ($focusViewElement) { $focusViewElement.find(".dx-row[tabindex], .dx-row > td[tabindex]").filter(((i, node) => _m_utils.default.isElementInCurrentGrid(this, (0, _renderer.default)(node)))).not($focusElement).removeClass(_const2.CELL_FOCUS_DISABLED_CLASS).removeClass(_const2.FOCUSED_CLASS).removeAttr("tabindex") } _events_engine.default.one($focusElement, "blur", (e => { if (e.relatedTarget) { $focusElement.removeClass(_const2.CELL_FOCUS_DISABLED_CLASS).removeClass(_const2.FOCUSED_CLASS) } })); if (!skipFocusEvent) { this._applyTabIndexToElement($focusElement); _events_engine.default.trigger($focusElement, "focus") } if (disableFocus) { $focusElement.addClass(_const2.CELL_FOCUS_DISABLED_CLASS); if (isRowFocus) { $cell.addClass(_const2.CELL_FOCUS_DISABLED_CLASS) } } else { this._editorFactory.focus($focusElement) } } } _updateFocus(isRenderView) { this._updateFocusTimeout = setTimeout((() => { if (this._needFocusEditingCell()) { this._editingController._focusEditingCell(); return } let $cell = this._getFocusedCell(); const isEditing = this._editingController.isEditing(); if (!this.getMasterDetailCell($cell) || this._isRowEditMode()) { if (this._hasSkipRow($cell.parent())) { const direction = this._focusedCellPosition && this._focusedCellPosition.rowIndex > 0 ? "upArrow" : "downArrow"; $cell = this._getNextCell(direction) } if ((0, _m_keyboard_navigation_utils.isElementDefined)($cell)) { if ($cell.is("td") || $cell.hasClass(this.addWidgetPrefix(_const2.EDIT_FORM_ITEM_CLASS))) { const isCommandCell = $cell.is(_const2.COMMAND_CELL_SELECTOR); const $focusedElementInsideCell = $cell.find(":focus"); const isFocusedElementDefined = (0, _m_keyboard_navigation_utils.isElementDefined)($focusedElementInsideCell); const column = this._getColumnByCellElement($cell); if ((isRenderView || !isCommandCell) && this._editorFactory.focus()) { if (isCommandCell && isFocusedElementDefined) { _m_utils.default.focusAndSelectElement(this, $focusedElementInsideCell); return }!isFocusedElementDefined && this._focus($cell) } else if (!isFocusedElementDefined && (this._isNeedFocus || this._isHiddenFocus)) { this._focus($cell, this._isHiddenFocus) } if (isEditing && !(null !== column && void 0 !== column && column.showEditorAlways)) { this._focusInteractiveElement.bind(this)($cell) } } else { _events_engine.default.trigger($cell, "focus") } } } })) } _getColumnByCellElement($cell) { const cellIndex = this._rowsView.getCellIndex($cell); const columnIndex = cellIndex + this._columnsController.getColumnIndexOffset(); return this._columnsController.getVisibleColumns(null, true)[columnIndex] } _needFocusEditingCell() { const isCellEditMode = this._editingController.getEditMode() === _const.EDIT_MODE_CELL; const isBatchEditMode = this._editingController.getEditMode() === _const.EDIT_MODE_BATCH; const cellEditModeHasChanges = isCellEditMode && this._editingController.hasChanges(); const isNewRowBatchEditMode = isBatchEditMode && this._editingController.isNewRowInEditMode(); const $cell = this._getFocusedCell(); return (0 === $cell.children().length || $cell.find(_const.FOCUSABLE_ELEMENT_SELECTOR).length > 0) && (cellEditModeHasChanges || isNewRowBatchEditMode) } _getFocusedCell() { return (0, _renderer.default)(this._getCell(this._focusedCellPosition)) } _updateFocusedCellPositionByTarget(target) { var _this$_focusedCellPos; const elementType = this._getElementType(target); if ("row" === elementType && (0, _type.isDefined)(null === (_this$_focusedCellPos = this._focusedCellPosition) || void 0 === _this$_focusedCellPos ? void 0 : _this$_focusedCellPos.columnIndex)) { const $row = (0, _renderer.default)(target); this._focusedView && (0, _m_keyboard_navigation_utils.isGroupRow)($row) && this.setFocusedRowIndex(this._getRowIndex($row)) } else { this._updateFocusedCellPosition(this._getCellElementFromTarget(target)) } } _updateFocusedCellPosition($cell, direction) { const position = this._getCellPosition($cell, direction); if (position) { if (!$cell.length || position.rowIndex >= 0 && position.columnIndex >= 0) { this.setFocusedCellPosition(position.rowIndex, position.columnIndex) } } return position } _getFocusedColumnIndexOffset(columnIndex) { let offset = 0; const column = this._columnsController.getVisibleColumns()[columnIndex]; if (column && column.fixed) { offset = this._getFixedColumnIndexOffset(column) } else if (columnIndex >= 0) { offset = this._columnsController.getColumnIndexOffset() } return offset } _getFixedColumnIndexOffset(column) { const offset = (0, _m_keyboard_navigation_utils.isFixedColumnIndexOffsetRequired)(this, column) ? this._getVisibleColumnCount() - this._columnsController.getVisibleColumns().length : 0; return offset } _getCellPosition($cell, direction) { let columnIndex; const $row = (0, _m_keyboard_navigation_utils.isElementDefined)($cell) && $cell.closest("tr"); if ((0, _m_keyboard_navigation_utils.isElementDefined)($row)) { const rowIndex = this._getRowIndex($row); columnIndex = this._rowsView.getCellIndex($cell, rowIndex); columnIndex += this._getFocusedColumnIndexOffset(columnIndex); if (direction) { columnIndex = "previous" === direction ? columnIndex - 1 : columnIndex + 1; columnIndex = this._applyColumnIndexBoundaries(columnIndex) } return { rowIndex: rowIndex, columnIndex: columnIndex } } return } _focusCell($cell, isDisabled) { if (this._isCellValid($cell)) { this._focus($cell, isDisabled); return true } return } _focusEditFormCell($cell) { if ($cell.hasClass(_const2.MASTER_DETAIL_CELL_CLASS)) { this._editorFactory.focus($cell, true) } } _resetFocusedCell(preventScroll) { var _this$_focusedView2; const $cell = this._getFocusedCell(); (0, _m_keyboard_navigation_utils.isElementDefined)($cell) && $cell.removeAttr("tabindex"); this._isNeedFocus = false; this._isNeedScroll = false; this._focusedCellPosition = {}; clearTimeout(this._updateFocusTimeout); null === (_this$_focusedView2 = this._focusedView) || void 0 === _this$_focusedView2 || _this$_focusedView2.renderFocusState({ preventScroll: preventScroll }) } restoreFocusableElement(rowIndex, $event) { const that = this; let args; let $rowElement; const isUpArrow = (0, _type.isDefined)(rowIndex); const $rowsViewElement = this._rowsView.element(); const { columnIndex: columnIndex } = that._focusedCellPosition; const rowIndexOffset = that._dataController.getRowIndexOffset(); rowIndex = isUpArrow ? rowIndex : this._rowsView.getTopVisibleItemIndex() + rowIndexOffset; if (!isUpArrow) { that._editorFactory.loseFocus(); that._applyTabIndexToElement($rowsViewElement); _events_engine.default.trigger($rowsViewElement, "focus") } else { $rowElement = this._rowsView.getRow(rowIndex - rowIndexOffset); args = that._fireFocusedRowChanging($event, $rowElement); if (!args.cancel && args.rowIndexChanged) { rowIndex = args.newRowIndex } } if (!isUpArrow || !args.cancel) { that.setFocusedCellPosition(rowIndex, columnIndex) } isUpArrow && that._updateFocus() } _getNewPositionByCode(cellPosition, elementType, code) { let { columnIndex: columnIndex } = cellPosition; let { rowIndex: rowIndex } = cellPosition; let visibleColumnsCount; if (void 0 === cellPosition.rowIndex && "next" === code) { return { columnIndex: 0, rowIndex: 0 } } switch (code) { case "nextInRow": case "next": visibleColumnsCount = this._getVisibleColumnCount(); if (columnIndex < visibleColumnsCount - 1 && "row" !== elementType && this._hasValidCellAfterPosition({ columnIndex: columnIndex, rowIndex: rowIndex })) { columnIndex++ } else if (!this._isLastRow(rowIndex) && "next" === code) { columnIndex = 0; rowIndex++ } break; case "previousInRow": case "previous": if (columnIndex > 0 && "row" !== elementType && this._hasValidCellBeforePosition({ columnIndex: columnIndex, rowIndex: rowIndex })) { columnIndex-- } else if (rowIndex > 0 && "previous" === code) { rowIndex--; visibleColumnsCount = this._getVisibleColumnCount(); columnIndex = visibleColumnsCount - 1 } break; case "upArrow": rowIndex = rowIndex > 0 ? rowIndex - 1 : rowIndex; break; case "downArrow": rowIndex = !this._isLastRow(rowIndex) ? rowIndex + 1 : rowIndex } return { columnIndex: columnIndex, rowIndex: rowIndex } } setFocusedCellPosition(rowIndex, columnIndex) { this.setFocusedRowIndex(rowIndex); this.setFocusedColumnIndex(columnIndex) } setFocusedRowIndex(rowIndex) { if (!this._focusedCellPosition) { this._focusedCellPosition = {} } this._focusedCellPosition.rowIndex = rowIndex } setFocusedColumnIndex(columnIndex) { if (!this._focusedCellPosition) { this._focusedCellPosition = {} } this._focusedCellPosition.columnIndex = columnIndex } getRowIndex() { return this._focusedCellPosition ? this._focusedCellPosition.rowIndex : -1 } getColumnIndex() { return this._focusedCellPosition ? this._focusedCellPosition.columnIndex : -1 } getVisibleRowIndex() { var _this$_focusedCellPos2; const rowIndex = null === (_this$_focusedCellPos2 = this._focusedCellPosition) || void 0 === _this$_focusedCellPos2 ? void 0 : _this$_focusedCellPos2.rowIndex; return !(0, _type.isDefined)(rowIndex) || rowIndex < 0 ? -1 : rowIndex - this._dataController.getRowIndexOffset() } getVisibleColumnIndex() { var _this$_focusedCellPos3; const columnIndex = null === (_this$_focusedCellPos3 = this._focusedCellPosition) || void 0 === _this$_focusedCellPos3 ? void 0 : _this$_focusedCellPos3.columnIndex; return !(0, _type.isDefined)(columnIndex) ? -1 : columnIndex - this._columnsController.getColumnIndexOffset() } _applyColumnIndexBoundaries(columnIndex) { const visibleColumnsCount = this._getVisibleColumnCount(); if (columnIndex < 0) { columnIndex = 0 } else if (columnIndex >= visibleColumnsCount) { columnIndex = visibleColumnsCount - 1 } return columnIndex } _isCellByPositionValid(cellPosition) { const $cell = (0, _renderer.default)(this._getCell(cellPosition)); return this._isCellValid($cell) } _isLastRow(rowIndex) { const dataController = this._dataController; if (this._isVirtualRowRender()) { return rowIndex >= dataController.getMaxRowIndex() } const lastVisibleIndex = Math.max(...dataController.items().map(((item, index) => false !== item.visible ? index : -1))); return rowIndex === lastVisibleIndex } _isFirstValidCell(cellPosition) { let isFirstValidCell = false; if (0 === cellPosition.rowIndex && cellPosition.columnIndex >= 0) { isFirstValidCell = isFirstValidCell || !this._hasValidCellBeforePosition(cellPosition) } return isFirstValidCell } _hasValidCellBeforePosition(cellPosition) { let { columnIndex: columnIndex } = cellPosition; let hasValidCells = false; while (columnIndex > 0 && !hasValidCells) { const checkingPosition = { columnIndex: --columnIndex, rowIndex: cellPosition.rowIndex }; hasValidCells = this._isCellByPositionValid(checkingPosition) } return hasValidCells } _hasValidCellAfterPosition(cellPosition) { let { columnIndex: columnIndex } = cellPosition; let hasValidCells = false; const visibleColumnCount = this._getVisibleColumnCount(); while (columnIndex < visibleColumnCount - 1 && !hasValidCells) { const checkingPosition = { columnIndex: ++columnIndex, rowIndex: cellPosition.rowIndex }; hasValidCells = this._isCellByPositionValid(checkingPosition) } return hasValidCells } _isLastValidCell(cellPosition) { const nextColumnIndex = cellPosition.columnIndex >= 0 ? cellPosition.columnIndex + 1 : 0; const { rowIndex: rowIndex } = cellPosition; const checkingPosition = { columnIndex: nextColumnIndex, rowIndex: rowIndex }; const visibleRows = this._dataController.getVisibleRows(); const row = visibleRows && visibleRows[rowIndex]; const isLastRow = this._isLastRow(rowIndex); if (!isLastRow) { return false } const isFullRowFocus = "group" === (null === row || void 0 === row ? void 0 : row.rowType) || "groupFooter" === (null === row || void 0 === row ? void 0 : row.rowType); if (isFullRowFocus && cellPosition.columnIndex > 0) { return true } if (cellPosition.columnIndex === this._getVisibleColumnCount() - 1) { return true } if (this._isCellByPositionValid(checkingPosition)) { return false } return this._isLastValidCell(checkingPosition) } _isCellValid($cell, isClick) { if ((0, _m_keyboard_navigation_utils.isElementDefined)($cell)) { const $row = $cell.parent(); const columnIndex = this._rowsView.getCellIndex($cell) + this._columnsController.getColumnIndexOffset(); const column = this._getColumnByCellElement($cell); const visibleColumnCount = this._getVisibleColumnCount(); const editingController = this._editingController; const isMasterDetailRow = (0, _m_keyboard_navigation_utils.isDetailRow)($row); const isShowWhenGrouped = column && column.showWhenGrouped; const isDataCell = column && !$cell.hasClass(_const2.COMMAND_EXPAND_CLASS) && (0, _m_keyboard_navigation_utils.isDataRow)($row); const isValidGroupSpaceColumn = function() { return !isMasterDetailRow && column && (!(0, _type.isDefined)(column.groupIndex) || isShowWhenGrouped && isDataCell) || parseInt($cell.attr("colspan"), 10) > 1 }; const isDragCell = _dom.GridCoreKeyboardNavigationDom.isDragCell($cell); if (isDragCell) { return false } if (this.getMasterDetailCell($cell)) { return true } if (visibleColumnCount > columnIndex && isValidGroupSpaceColumn()) { const rowItems = this._dataController.items(); const visibleRowIndex = this._rowsView.getRowIndex($row); const row = rowItems[visibleRowIndex]; const isCellEditing = editingController && this._isCellEditMode() && editingController.isEditing(); const isRowEditingInCurrentRow = editingController && editingController.isEditRow(visibleRowIndex); const isEditing = isRowEditingInCurrentRow || isCellEditing; if (column.command) { if (this._isLegacyNavigation()) { return !isEditing && "expand" === column.command } if (isCellEditing) { return false } if (isRowEditingInCurrentRow) { return "select" !== column.command } return !isEditing } if (isCellEditing && row && "data" !== row.rowType) { return false } return !isEditing || column.allowEditing || isClick } } } getFirstValidCellInRow($row, columnIndex) { const that = this; const $cells = $row.find("> td"); let $cell; let $result; columnIndex = columnIndex || 0; for (let i = columnIndex; i < $cells.length; ++i) { $cell = $cells.eq(i); if (that._isCellValid($cell)) { $result = $cell; break } } return $result } _getNextCell(keyCode, elementType, cellPosition) { const focusedCellPosition = cellPosition || this._focusedCellPosition; const isRowFocusType = this.isRowFocusType(); const includeCommandCells = isRowFocusType || ["next", "previous"].includes(keyCode); let $cell; let $row; if (this._focusedView && focusedCellPosition) { const newFocusedCellPosition = this._getNewPositionByCode(focusedCellPosition, elementType, keyCode); $cell = (0, _renderer.default)(this._getCell(newFocusedCellPosition)); const isLastCellOnDirection = "previous" === keyCode ? this._isFirstValidCell(newFocusedCellPosition) : this._isLastValidCell(newFocusedCellPosition); if ((0, _m_keyboard_navigation_utils.isElementDefined)($cell) && !this._isCellValid($cell) && this._isCellInRow(newFocusedCellPosition, includeCommandCells) && !isLastCellOnDirection) { if (isRowFocusType) { $cell = this.getFirstValidCellInRow($cell.parent(), newFocusedCellPosition.columnIndex) } else { $cell = this._getNextCell(keyCode, "cell", newFocusedCellPosition) } } $row = (0, _m_keyboard_navigation_utils.isElementDefined)($cell) && $cell.parent(); if (this._hasSkipRow($row)) { const rowIndex = this._getRowIndex($row); if (!this._isLastRow(rowIndex)) { $cell = this._getNextCell(keyCode, "row", { columnIndex: focusedCellPosition.columnIndex, rowIndex: rowIndex }) } else { return null } } return (0, _m_keyboard_navigation_utils.isElementDefined)($cell) ? $cell : null } return null } _startEditing(eventArgs, fastEditingKey) { const focusedCellPosition = this._focusedCellPosition; const visibleRowIndex = this.getVisibleRowIndex(); const visibleColumnIndex = this.getVisibleColumnIndex(); const row = this._dataController.items()[visibleRowIndex]; const column = this._columnsController.getVisibleColumns()[visibleColumnIndex]; if (this._isAllowEditing(row, column)) { if (this._isRowEditMode()) { this._editingController.editRow(visibleRowIndex) } else if (focusedCellPosition) { this._startEditCell(eventArgs, fastEditingKey) } } } _isAllowEditing(row, column) { return this._editingController.allowUpdating({ row: row }) && column && column.allowEditing } _editFocusedCell() { const rowIndex = this.getVisibleRowIndex(); const colIndex = this.getVisibleColumnIndex(); return this._editingController.editCell(rowIndex, colIndex) } _startEditCell(eventArgs, fastEditingKey) { this._fastEditingStarted = (0, _type.isDefined)(fastEditingKey); const editResult = this._editFocusedCell(); const isEditResultDeferred = (0, _type.isDeferred)(editResult); const isFastEditingStarted = this._isFastEditingStarted(); if (!isFastEditingStarted || !isEditResultDeferred && !editResult) { return } const editorValue = isEditResultDeferred && fastEditingKey === _const2.FAST_EDITING_DELETE_KEY ? "" : fastEditingKey; const editResultDeferred = isEditResultDeferred ? editResult : (0, _deferred.Deferred)().resolve(); const waitTemplatesDeferred = this._rowsView.waitAsyncTemplates(true); (0, _deferred.when)(editResultDeferred, waitTemplatesDeferred).done((() => { this._editingCellHandler(eventArgs, editorValue) })) } _editingCellHandler(eventArgs, editorValue) { var _$inputElement$select; const $input = this._getFocusedCell().find(_const2.INTERACTIVE_ELEMENTS_SELECTOR).eq(0); const $inputElement = $input.get(0); if (!$inputElement) { return } const keyDownEvent = (0, _index.createEvent)(eventArgs, { type: "keydown", target: $inputElement }); const keyPressEvent = (0, _index.createEvent)(eventArgs, { type: "keypress", target: $inputElement }); const inputEvent = (0, _index.createEvent)(eventArgs, { type: "input", target: $inputElement }); if (inputEvent.originalEvent) { inputEvent.originalEvent = (0, _index.createEvent)(inputEvent.originalEvent, { data: editorValue }) } null === (_$inputElement$select = $inputElement.select) || void 0 === _$inputElement$select || _$inputElement$select.call($inputElement); _events_engine.default.trigger($input, keyDownEvent); if (!keyDownEvent.isDefaultPrevented()) { _events_engine.default.trigger($input, keyPressEvent); if (!keyPressEvent.isDefaultPrevented()) { const timeout = _browser.default.mozilla ? 25 : 0; setTimeout((() => { const inputValue = this._getKeyPressInputValue($input, editorValue); $input.val(inputValue); const $widgetContainer = $input.closest(`.${_const2.WIDGET_CLASS}`); _events_engine.default.off($widgetContainer, "focusout"); _events_engine.default.one($widgetContainer, "focusout", (() => { _events_engine.default.trigger($input, "change") })); _events_engine.default.trigger($input, inputEvent) }), timeout) } } } _getKeyPressInputValue($input, editorValue) { const inputCurrentValue = $input.val(); return "-" === editorValue && "-0" === inputCurrentValue ? "-0" : editorValue } _fireFocusChangingEvents($event, $cell, fireRowEvent, isHighlighted) { let args = {}; const cellPosition = this._getCellPosition($cell) ?? {}; if (this.isCellFocusType()) { args = this._fireFocusedCellChanging($event, $cell, isHighlighted); if (!args.cancel) { cellPosition.columnIndex = args.newColumnIndex; cellPosition.rowIndex = args.newRowIndex; isHighlighted = args.isHighlighted; $cell = (0, _renderer.default)(this._getCell(cellPosition)) } } if (!args.cancel && fireRowEvent && $cell) { args = this._fireFocusedRowChanging($event, $cell.parent()); if (!args.cancel) { cellPosition.rowIndex = args.newRowIndex; args.isHighlighted = isHighlighted } } args.$newCellElement = (0, _renderer.default)(this._getCell(cellPosition)); if (!args.$newCellElement.length) { args.$newCellElement = $cell } return args } _fireFocusedCellChanging($event, $cellElement, isHighlighted) { const prevColumnIndex = this.option("focusedColumnIndex"); const prevRowIndex = this.option("focusedRowIndex"); const cellPosition = this._getCellPosition($cellElement); const columnIndex = cellPosition ? cellPosition.columnIndex : -1; const rowIndex = cellPosition ? cellPosition.rowIndex : -1; const visibleRows = this._dataController.getVisibleRows(); const visibleColumns = this._columnsController.getVisibleColumns(); const args = { cellElement: $cellElement, prevColumnIndex: prevColumnIndex, prevRowIndex: prevRowIndex, newColumnIndex: columnIndex, newRowIndex: rowIndex, rows: visibleRows, columns: visibleColumns, event: $event, isHighlighted: isHighlighted || false, cancel: false }; this._canceledCellPosition = null; this.executeAction("onFocusedCellChanging", args); if (args.newColumnIndex !== columnIndex || args.newRowIndex !== rowIndex) { args.$newCellElement = (0, _renderer.default)(this._getCell({ columnIndex: args.newColumnIndex, rowIndex: args.newRowIndex })) } if (args.cancel) { this._canceledCellPosition = { rowIndex: rowIndex, columnIndex: columnIndex } } return args } _fireFocusedCellChanged($cell) { const columnIndex = this._rowsView.getCellIndex($cell); const rowOptions = null === $cell || void 0 === $cell ? void 0 : $cell.parent().data("options"); const focusedRowKey = null === rowOptions || void 0 === rowOptions ? void 0 : rowOptions.key; this._memoFireFocusedCellChanged(focusedRowKey, columnIndex) } _memoFireFocusedCellChanged(rowKey, columnIndex) { const $cell = this._getFocusedCell(); const rowIndex = this._getRowIndex(null === $cell || void 0 === $cell ? void 0 : $cell.parent()); const localRowIndex = Math.min(rowIndex - this._dataController.getRowIndexOffset(), this._dataController.items().length - 1); const isEditingCell = this._editingController.isEditCell(localRowIndex, columnIndex); if (isEditingCell) { return } const row = this._dataController.items()[localRowIndex]; const column = this._columnsController.getVisibleColumns()[columnIndex]; this.executeAction("onFocusedCellChanged", { cellElement: $cell ? (0, _element.getPublicElement)($cell) : void 0, columnIndex: columnIndex, rowIndex: rowIndex, row: row, column: column }) } _fireFocusedRowChanging(eventArgs, $newFocusedRow) { const newRowIndex = this._getRowIndex($newFocusedRow); const prevFocusedRowIndex = this.option("focusedRowIndex"); const loadingOperationTypes = this._dataController.loadingOperationTypes(); const args = { rowElement: $newFocusedRow, prevRowIndex: prevFocusedRowIndex, newRowIndex: newRowIndex, event: eventArgs, rows: this._dataController.getVisibleRows(), cancel: false }; const loadingOperations = loadingOperationTypes.sorting || loadingOperationTypes.grouping || loadingOperationTypes.filtering || loadingOperationTypes.paging; if (!this._dataController || this._dataController.isLoading() && loadingOperations) { args.cancel = true; return args } if (this.option("focusedRowEnabled")) { this.executeAction("onFocusedRowChanging", args); if (!args.cancel && args.newRowIndex !== newRowIndex) { args.resetFocusedRow = args.newRowIndex < 0; if (!args.resetFocusedRow) { this.setFocusedRowIndex(args.newRowIndex) } args.rowIndexChanged = true } } return args } _fireFocusedRowChanged() { var _this$_focusControlle; const focusedRowEnabled = this.option("focusedRowEnabled"); const focusedRowKey = this.option("focusedRowKey"); const focusedRowIndex = null === (_this$_focusControlle = this._focusController) || void 0 === _this$_focusControlle ? void 0 : _this$_focusControlle.getFocusedRowIndexByKey(focusedRowKey); if (!focusedRowEnabled || (0, _type.isDefined)(focusedRowKey) && focusedRowIndex < 0) { return } this._memoFireFocusedRowChanged(focusedRowKey, focusedRowIndex) } _memoFireFocusedRowChanged(focusedRowKey, focusedRowIndex) { const localRowIndex = focusedRowIndex - this._dataController.getRowIndexOffset(); this.executeAction("onFocusedRowChanged", { rowElement: focusedRowIndex < 0 ? void 0 : this._rowsView.getRowElement(localRowIndex), rowIndex: focusedRowIndex, row: focusedRowIndex < 0 ? void 0 : this._dataController.getVisibleRows()[localRowIndex] }) } _isEventInCurrentGrid(event) { return _m_utils.default.isElementInCurrentGrid(this, (0, _renderer.default)(event.target)) } _isRowEditMode() { const editMode = this._editingController.getEditMode(); return editMode === _const.EDIT_MODE_ROW || editMode === _const.EDIT_MODE_FORM } _isCellEditMode() { const editMode = this._editingController.getEditMode(); return editMode === _const.EDIT_MODE_CELL || editMode === _const.EDIT_MODE_BATCH } _isFastEditingAllowed() { return this._isCellEditMode() && this.option("keyboardNavigation.editOnKeyPress") } _getInteractiveElement($cell, isLast) { const $focusedElement = $cell.find(_const2.INTERACTIVE_ELEMENTS_SELECTOR).filter(":visible"); return isLast ? $focusedElement.last() : $focusedElement.first() } _applyTabIndexToElement($element) { const tabIndex = this.option("tabIndex") ?? 0; $element.attr("tabindex", tabIndex) } _getCell(cellPosition) { if (this._focusedView && cellPosition) { const rowIndexOffset = this._dataController.getRowIndexOffset(); const column = this._columnsController.getVisibleColumns(null, true)[cellPosition.columnIndex]; const columnIndexOffset = column && column.fixed ? this._getFixedColumnIndexOffset(column) : this._columnsController.getColumnIndexOffset(); const rowIndex = cellPosition.rowIndex >= 0 ? cellPosition.rowIndex - rowIndexOffset : -1; const columnIndex = cellPosition.columnIndex >= 0 ? cellPosition.columnIndex - columnIndexOffset : -1; return this._focusedView.getCell({ rowIndex: rowIndex, columnIndex: columnIndex }) } } _getRowIndex($row) { let rowIndex = this._rowsView.getRowIndex($row); if (rowIndex >= 0) { rowIndex += this._dataController.getRowIndexOffset() } return rowIndex } _hasSkipRow($row) { const row = $row && $row.get(0); return row && "none" === row.style.display } _allowEditingOnEnterKey() { return "startEdit" === this.option("keyboardNavigation.enterKeyAction") } _isLegacyNavigation() { return this.option("useLegacyKeyboardNavigation") } _getDirectionCodeByKey(key) { let directionCode; switch (key) { case "upArrow": directionCode = "prevRow"; break; case "downArrow": directionCode = "nextRow"; break; case "leftArrow": directionCode = this.option("rtlEnabled") ? "nextInRow" : "previousInRow"; break; case "rightArrow": directionCode = this.option("rtlEnabled") ? "previousInRow" : "nextInRow" } return directionCode } _isVirtualScrolling() { const scrollingMode = this.option("scrolling.mode"); return "virtual" === scrollingMode || "infinite" === scrollingMode } _isVirtualRowRender() { return this._isVirtualScrolling() || _m_utils.default.isVirtualRowRendering(this) } _isVirtualColumnRender() { return "virtual" === this.option("scrolling.columnRenderingMode") } _scrollBy(left, top, rowIndex, $event) { const that = this; const scrollable = this._rowsView.getScrollable(); if (that._focusedCellPosition) { const scrollHandler = function() { scrollable.off("scroll", scrollHandler); setTimeout(that.restoreFocusableElement.bind(that, rowIndex, $event)) }; scrollable.on("scroll", scrollHandler) } return scrollable.scrollBy({ left: left, top: top }) } _isInsideEditForm(element) { const $editForm = (0, _renderer.default)(element).closest(`.${this.addWidgetPrefix(_const.EDIT_FORM_CLASS)}`); return $editForm.length && this.elementIsInsideGrid($editForm) } getMasterDetailCell(element) { const $masterDetailCell = (0, _renderer.default)(element).closest(`.${_const2.MASTER_DETAIL_CELL_CLASS}`); if ($masterDetailCell.length && this.elementIsInsideGrid($masterDetailCell)) { return $masterDetailCell } return null } _processNextCellInMasterDetail($nextCell, _$cell) { if (!this._isInsideEditForm($nextCell) && $nextCell) { this._applyTabIndexToElement($nextCell) } } _handleTabKeyOnMasterDetailCell(target, direction) { if (this.getMasterDetailCell(target)) { this._updateFocusedCellPosition((0, _renderer.default)(target), direction); const $nextCell = this._getNextCell(direction, "row"); this._processNextCellInMasterDetail($nextCell, (0, _renderer.default)(target)); return true } return false } _getElementType(target) { return (0, _renderer.default)(target).is("tr") ? "row" : "cell" } _isFastEditingStarted() { return this._isFastEditingAllowed() && this._fastEditingStarted } _getVisibleColumnCount() { return this._columnsController.getVisibleColumns(null, true).length } _isCellInRow(cellPosition, includeCommandCells) { const { columnIndex: columnIndex } = cellPosition; const visibleColumnsCount = this._getVisibleColumnCount(); return includeCommandCells ? columnIndex >= 0 && columnIndex <= visibleColumnsCount - 1 : columnIndex > 0 && columnIndex < visibleColumnsCount - 1 } _isCellElement($element) { return $element.length && "TD" === $element[0].tagName } _getCellElementFromTarget(target) { const elementType = this._getElementType(target); const $targetElement = (0, _renderer.default)(target); let $cell; if ("cell" === elementType) { $cell = $targetElement.closest(`.${_const.ROW_CLASS} > td`) } else { $cell = $targetElement.children().not(`.${_const2.COMMAND_EXPAND_CLASS}`).first() } return $cell } _getRowsViewElement() { var _this$_rowsView5; return null === (_this$_rowsView5 = this._rowsView) || void 0 === _this$_rowsView5 ? void 0 : _this$_rowsView5.element() } isKeyboardEnabled() { return this.option("keyboardNavigation.enabled") } _processCanceledEditCellPosition(rowIndex, columnIndex) { if (this._canceledCellPosition) { const isCanceled = this._canceledCellPosition.rowIndex === rowIndex && this._canceledCellPosition.columnIndex === columnIndex; this._canceledCellPosition = null; return isCanceled } return } updateFocusedRowIndex() { const dataController = this._dataController; const visibleRowIndex = this.getVisibleRowIndex(); const visibleItems = dataController.items(); const lastVisibleIndex = visibleItems.length ? visibleItems.length - 1 : -1; const rowIndexOffset = dataController.getRowIndexOffset(); if (lastVisibleIndex >= 0 && visibleRowIndex > lastVisibleIndex) { this.setFocusedRowIndex(lastVisibleIndex + rowIndexOffset) } } } exports.KeyboardNavigationController = KeyboardNavigationController; exports.keyboardNavigationModule = { defaultOptions: () => ({ useLegacyKeyboardNavigation: false, keyboardNavigation: { enabled: true, enterKeyAction: "startEdit", enterKeyDirection: "none", editOnKeyPress: false } }), controllers: { keyboardNavigation: KeyboardNavigationController }, extenders: { views: { rowsView: Base => class extends Base { _rowClick(e) { const editRowIndex = this._editingController.getEditRowIndex(); const isKeyboardEnabled = this._keyboardNavigationController.isKeyboardEnabled(); if (editRowIndex === e.rowIndex) { this._keyboardNavigationController.setCellFocusType() } const needTriggerPointerEventHandler = ((0, _m_keyboard_navigation_utils.isMobile)() || !isKeyboardEnabled) && this.option("focusedRowEnabled"); if (needTriggerPointerEventHandler) { this._triggerPointerDownEventHandler(e, !isKeyboardEnabled) } super._rowClick.apply(this, arguments) } _triggerPointerDownEventHandler(e, force) { const { originalEvent: originalEvent } = e.event; if (originalEvent) { const $cell = (0, _renderer.default)(originalEvent.target); const columnIndex = this.getCellIndex($cell); const column = this._columnsController.getVisibleColumns()[columnIndex]; const row = this._dataController.items()[e.rowIndex]; if (this._keyboardNavigationController._isAllowEditing(row, column) || force) { const eventArgs = (0, _index.createEvent)(originalEvent, { currentTarget: originalEvent.target }); this._keyboardNavigationController._pointerEventHandler(eventArgs) } } } renderFocusState(params) { super.renderFocusState(params); const { preventScroll: preventScroll, pageSizeChanged: pageSizeChanged } = params ?? {}; const $rowsViewElement = this.element(); if ($rowsViewElement && !(0, _selectors.focused)($rowsViewElement)) { $rowsViewElement.attr("tabindex", null) } pageSizeChanged && this._keyboardNavigationController.updateFocusedRowIndex(); let rowIndex = this._keyboardNavigationController.getVisibleRowIndex(); if (!(0, _type.isDefined)(rowIndex) || rowIndex < 0) { rowIndex = 0 } const cellElements = this.getCellElements(rowIndex); if (this._keyboardNavigationController.isKeyboardEnabled() && null !== cellElements && void 0 !== cellElements && cellElements.length) { this.updateFocusElementTabIndex(cellElements, preventScroll) } } updateFocusElementTabIndex(cellElements, preventScroll) { const $row = cellElements.eq(0).parent(); if ((0, _m_keyboard_navigation_utils.isGroupRow)($row)) { this._keyboardNavigationController._applyTabIndexToElement($row) } else { let columnIndex = this._keyboardNavigationController.getColumnIndex(); if (!(0, _type.isDefined)(columnIndex) || columnIndex < 0) { columnIndex = 0 } this._updateFocusedCellTabIndex(cellElements, columnIndex) } } _updateFocusedCellTabIndex(cellElements, columnIndex) { const keyboardController = this._keyboardNavigationController; const cellElementsLength = cellElements ? cellElements.length : -1; const updateCellTabIndex = function($cell) { const isMasterDetailCell = !!keyboardController.getMasterDetailCell($cell); const isValidCell = keyboardController._isCellValid($cell); if (!isMasterDetailCell && isValidCell && keyboardController._isCellElement($cell)) { keyboardController._applyTabIndexToElement($cell); keyboardController.setCellFocusType(); return true } return }; const $cell = _dom.GridCoreKeyboardNavigationDom.getCellToFocus(cellElements, columnIndex); if ($cell.length) { updateCellTabIndex($cell) } else { if (cellElementsLength <= columnIndex) { columnIndex = cellElementsLength - 1 } for (let i = columnIndex; i < cellElementsLength; ++i) { if (updateCellTabIndex((0, _renderer.default)(cellElements[i]))) { break } } } } renderDelayedTemplates(change) { super.renderDelayedTemplates.apply(this, arguments); this.waitAsyncTemplates().done((() => { this._renderFocusByChange(change) })) } _renderFocusByChange(change) { var _change$changeTypes; const { operationTypes: operationTypes, repaintChangesOnly: repaintChangesOnly } = change ?? {}; const { fullReload: fullReload, pageSize: pageSize } = operationTypes ?? {}; const hasInsertsOrRemoves = !!(null !== change && void 0 !== change && null !== (_change$changeTypes = change.changeTypes) && void 0 !== _change$changeTypes && _change$changeTypes.find((changeType => "insert" === changeType || "remove" === changeType))); if (!change || !repaintChangesOnly || fullReload || pageSize || hasInsertsOrRemoves) { const preventScroll = (0, _m_keyboard_navigation_utils.shouldPreventScroll)(this); this.renderFocusState({ preventScroll: preventScroll, pageSizeChanged: pageSize }) } } _renderCore(change) { const deferred = super._renderCore.apply(this, arguments); this._renderFocusByChange(change); return deferred } _editCellPrepared($cell) { var _this$_keyboardNaviga; const editorInstance = this._getEditorInstance($cell); const isEditingNavigationMode = null === (_this$_keyboardNaviga = this._keyboardNavigationController) || void 0 === _this$_keyboardNaviga ? void 0 : _this$_keyboardNaviga._isFastEditingStarted(); if (editorInstance && isEditingNavigationMode) { this._handleEditingNavigationMode(editorInstance) } super._editCellPrepared.apply(this, arguments) } _handleEditingNavigationMode(editorInstance) { ["downArrow", "upArrow"].forEach((keyName => { const originalKeyHandler = editorInstance._supportedKeys()[keyName]; editorInstance.registerKeyHandler(keyName, (e => { const isDropDownOpened = "true" === editorInstance._input().attr("aria-expanded"); if (isDropDownOpened) { return originalKeyHandler && originalKeyHandler.call(editorInstance, e) } })) })); editorInstance.registerKeyHandler("leftArrow", _common.noop); editorInstance.registerKeyHandler("rightArrow", _common.noop); const isDateBoxWithMask = editorInstance.NAME === _const2.DATEBOX_WIDGET_NAME && editorInstance.option("useMaskBehavior"); if (isDateBoxWithMask) { editorInstance.registerKeyHandler("enter", _common.noop) } } _getEditorInstance($cell) { const $editor = $cell.find(".dx-texteditor").eq(0); return _m_utils.default.getWidgetInstance($editor) } } }, controllers: { editing: Base => class extends Base { editCell(rowIndex, columnIndex) { if (this._keyboardNavigationController._processCanceledEditCellPosition(rowIndex, columnIndex)) { return false } const isCellEditing = super.editCell(rowIndex, columnIndex); if (isCellEditing) { this._keyboardNavigationController.setupFocusedView() } return isCellEditing } editRow(rowIndex) { const visibleColumnIndex = this._keyboardNavigationController.getVisibleColumnIndex(); const column = this._columnsController.getVisibleColumns()[visibleColumnIndex]; if (column && column.type || this.option("editing.mode") === _const.EDIT_MODE_FORM) { this._keyboardNavigationController._resetFocusedCell() } super.editRow(rowIndex); return } addRow(parentKey) { this._keyboardNavigationController.setupFocusedView(); this._keyboardNavigationController.setCellFocusType(); return super.addRow.apply(this, arguments) } getFocusedCellInRow(rowIndex) { let $cell = super.getFocusedCellInRow(rowIndex); const rowIndexOffset = this._dataController.getRowIndexOffset(); const focusedRowIndex = this._keyboardNavigationController._focusedCellPosition.rowIndex - rowIndexOffset; if (this._keyboardNavigationController.isKeyboardEnabled() && focusedRowIndex === rowIndex) { const $focusedCell = this._keyboardNavigationController._getFocusedCell(); if ((0, _m_keyboard_navigation_utils.isElementDefined)($focusedCell) && !$focusedCell.hasClass(_const2.COMMAND_EDIT_CLASS)) { $cell = $focusedCell } } return $cell } _processCanceledEditingCell() { this.closeEditCell().done((() => { this._keyboardNavigationController._updateFocus() })) } closeEditCell() { const keyboardNavigation = this._keyboardNavigationController; keyboardNavigation._fastEditingStarted = false; const result = super.closeEditCell.apply(this, arguments); const $focusedElement = this._getFocusedElement(); const isFilterCell = !!$focusedElement.closest(`.${this.addWidgetPrefix(_const.FILTER_ROW_CLASS)}`).length; if (!isFilterCell) { keyboardNavigation._updateFocus() } return result } _getFocusedElement() { var _this$component$eleme, _this$component; const $element = (0, _renderer.default)(null === (_this$component$eleme = (_this$component = this.component).element) || void 0 === _this$component$eleme ? void 0 : _this$component$eleme.call(_this$component)); const $focusedElement = $element.find(":focus"); return $focusedElement } _delayedInputFocus() { this._keyboardNavigationController._isNeedScroll = true; super._delayedInputFocus.apply(this, arguments) } _isEditingStart() { const cancel = super._isEditingStart.apply(this, arguments); if (cancel && !this._keyboardNavigationController._isNeedFocus) { const $cell = this._keyboardNavigationController._getFocusedCell(); this._keyboardNavigationController._focus($cell, true) } return cancel } }, data: Base => class extends Base { _correctRowIndices(getRowIndexCorrection) { const focusedCellPosition = this._keyboardNavigationController._focusedCellPosition; super._correctRowIndices.apply(this, arguments); if (focusedCellPosition && focusedCellPosition.rowIndex >= 0) { const focusedRowIndexCorrection = getRowIndexCorrection(focusedCellPosition.rowIndex); if (focusedRowIndexCorrection) { focusedCellPosition.rowIndex += focusedRowIndexCorrection; this._editorFactoryController.refocus() } } } getMaxRowIndex() { let result = this.items().length - 1; const virtualItemsCount = this.virtualItemsCount(); if (virtualItemsCount) { const rowIndexOffset = this.getRowIndexOffset(); result += rowIndexOffset + virtualItemsCount.end } return result } }, adaptiveColumns: Base => class extends Base { _showHiddenCellsInView(_ref) { let { viewName: viewName, $cells: $cells, isCommandColumn: isCommandColumn } = _ref; super._showHiddenCellsInView.apply(this, arguments); viewName === _const2.COLUMN_HEADERS_VIEW && !isCommandColumn && $cells.each(((_, cellElement) => { const $cell = (0, _renderer.default)(cellElement); (0, _m_keyboard_navigation_utils.isCellInHeaderRow)($cell) && $cell.attr("tabindex", 0) })) } _hideVisibleCellInView(_ref2) { let { viewName: viewName, $cell: $cell, isCommandColumn: isCommandColumn } = _ref2; super._hideVisibleCellInView.apply(this, arguments); if (viewName === _const2.COLUMN_HEADERS_VIEW && !isCommandColumn && (0, _m_keyboard_navigation_utils.isCellInHeaderRow)($cell)) { $cell.removeAttr("tabindex") } } _hideVisibleColumnInView(_ref3) { let { view: view, isCommandColumn: isCommandColumn, visibleIndex: visibleIndex } = _ref3; super._hideVisibleColumnInView({ view: view, isCommandColumn: isCommandColumn, visibleIndex: visibleIndex }); if (view.name === _const2.ROWS_VIEW) { this._rowsView.renderFocusState(null) } } }, keyboardNavigation: _scrollable_a11y.keyboardNavigationScrollableA11yExtender } } } }, 67250: /*!***************************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/keyboard_navigation/m_keyboard_navigation_utils.js ***! \***************************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.isCellInHeaderRow = function($cell) { return !!$cell.parent(`.${_const2.HEADER_ROW_CLASS}`).length }; exports.isDataRow = function($row) { return $row && $row.hasClass(_const2.DATA_ROW_CLASS) }; exports.isDetailRow = function($row) { return $row && $row.hasClass(_const2.MASTER_DETAIL_ROW_CLASS) }; exports.isEditForm = function($row) { return $row && $row.hasClass(_const2.MASTER_DETAIL_ROW_CLASS) && $row.hasClass(_const2.EDIT_FORM_CLASS) }; exports.isEditorCell = function(that, $cell) { return !that._isRowEditMode() && $cell && !$cell.hasClass(_const2.COMMAND_SELECT_CLASS) && $cell.hasClass(_const.EDITOR_CELL_CLASS) }; exports.isElementDefined = function($element) { return (0, _type.isDefined)($element) && $element.length > 0 }; exports.isFixedColumnIndexOffsetRequired = function(that, column) { const rtlEnabled = that.option("rtlEnabled"); if (rtlEnabled) { return !("right" === column.fixedPosition || (0, _type.isDefined)(column.command) && !(0, _type.isDefined)(column.fixedPosition)) } return !(!(0, _type.isDefined)(column.fixedPosition) || "left" === column.fixedPosition) }; exports.isGroupFooterRow = function($row) { return $row && $row.hasClass(DATAGRID_GROUP_FOOTER_CLASS) }; exports.isGroupRow = function($row) { return $row && $row.hasClass(_const2.GROUP_ROW_CLASS) }; exports.isMobile = function() { return "desktop" !== _devices.default.current().deviceType }; exports.isNotFocusedRow = function($row) { return !$row || $row.hasClass(_const2.FREESPACE_ROW_CLASS) || $row.hasClass(_const2.VIRTUAL_ROW_CLASS) }; exports.shouldPreventScroll = function(that) { const keyboardController = that.getController("keyboardNavigation"); return keyboardController._isVirtualScrolling() ? that.option("focusedRowIndex") === keyboardController.getRowIndex() : false }; var _devices = (obj = __webpack_require__( /*! ../../../../core/devices */ 20530), obj && obj.__esModule ? obj : { default: obj }); var obj; var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _const = __webpack_require__( /*! ../editing/const */ 72313); var _const2 = __webpack_require__( /*! ./const */ 67004); const DATAGRID_GROUP_FOOTER_CLASS = "dx-datagrid-group-footer" }, 91355: /*!***************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/keyboard_navigation/scrollable_a11y.js ***! \***************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.keyboardNavigationScrollableA11yExtender = void 0; var _renderer = (obj = __webpack_require__( /*! ../../../../core/renderer */ 68374), obj && obj.__esModule ? obj : { default: obj }); var obj; var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); exports.keyboardNavigationScrollableA11yExtender = Base => class extends Base { rowsViewFocusHandler(event) { const $target = (0, _renderer.default)(event.target); this.translateFocusIfNeed(event, $target); super.rowsViewFocusHandler(event) } rowsViewFocusOutHandler() { super.rowsViewFocusOutHandler(); this.makeScrollableFocusableIfNeed() } translateFocusIfNeed(event, $target) { const needTranslateFocus = this.isScrollableNeedFocusable(); const isFirstCellFixed = this._isFixedColumn(0); if (!needTranslateFocus || !isFirstCellFixed) { return } const $firstCell = this._rowsView.getCell({ rowIndex: 0, columnIndex: 0 }); const firstCellHasTabIndex = !!$firstCell.attr("tabindex"); const notFixedCellIsTarget = $target.is(this._$firstNotFixedCell); if (firstCellHasTabIndex && notFixedCellIsTarget) { event.preventDefault(); this._focus($firstCell) } } renderCompleted(e) { this._$firstNotFixedCell = this.getFirstNotFixedCell(); this.makeScrollableFocusableIfNeed(); super.renderCompleted(e) } _focus($cell, disableFocus, skipFocusEvent) { super._focus($cell, disableFocus, skipFocusEvent); this.makeScrollableFocusableIfNeed() } _tabKeyHandler(eventArgs, isEditing) { const isCellPositionDefined = (0, _type.isDefined)(this._focusedCellPosition) && !(0, _type.isEmptyObject)(this._focusedCellPosition); const isOriginalHandlerRequired = !isCellPositionDefined || !eventArgs.shift && this._isLastValidCell(this._focusedCellPosition) || eventArgs.shift && this._isFirstValidCell(this._focusedCellPosition); const isNeedFocusable = this.isScrollableNeedFocusable(); if (isOriginalHandlerRequired && isNeedFocusable) { var _this$_$firstNotFixed; null === (_this$_$firstNotFixed = this._$firstNotFixedCell) || void 0 === _this$_$firstNotFixed || _this$_$firstNotFixed.removeAttr("tabIndex") } super._tabKeyHandler(eventArgs, isEditing) } getFirstNotFixedCell() { var _this$_editingControl; const columns = this._columnsController.getVisibleColumns(); const columnIndex = columns.findIndex((_ref => { let { fixed: fixed } = _ref; return !fixed })); const isEditing = null === (_this$_editingControl = this._editingController) || void 0 === _this$_editingControl ? void 0 : _this$_editingControl.isEditing(); return -1 === columnIndex || isEditing ? void 0 : this._rowsView._getCellElement(0, columnIndex) } isScrollableNeedFocusable() { var _this$_rowsView$_fixe, _this$_rowsView$getCe; const hasScrollable = !!this._rowsView.getScrollable(); const hasFixedTable = !!(null !== (_this$_rowsView$_fixe = this._rowsView._fixedTableElement) && void 0 !== _this$_rowsView$_fixe && _this$_rowsView$_fixe.length); const isCellsRendered = !!(null !== (_this$_rowsView$getCe = this._rowsView.getCellElements(0)) && void 0 !== _this$_rowsView$getCe && _this$_rowsView$getCe.length); return hasScrollable && hasFixedTable && isCellsRendered } makeScrollableFocusableIfNeed() { const needFocusable = this.isScrollableNeedFocusable(); if (!needFocusable || !this._$firstNotFixedCell) { return } this._applyTabIndexToElement(this._$firstNotFixedCell) } } }, 9130: /*!*******************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/m_accessibility.js ***! \*******************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.registerKeyboardAction = void 0; var accessibility = function(e, r) { if (!r && e && e.__esModule) { return e } if (null === e || "object" != typeof e && "function" != typeof e) { return { default: e } } var t = _getRequireWildcardCache(r); if (t && t.has(e)) { return t.get(e) } var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u] } } return n.default = e, t && t.set(e, n), n }(__webpack_require__( /*! ../../../ui/shared/accessibility */ 56756)); function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) { return null } var r = new WeakMap, t = new WeakMap; return (_getRequireWildcardCache = function(e) { return e ? t : r })(e) } exports.registerKeyboardAction = function(viewName, instance, $element, selector, action) { const keyboardController = instance.getController("keyboardNavigation"); if (instance.option("useLegacyKeyboardNavigation") || keyboardController && !keyboardController.isKeyboardEnabled()) { return } instance.createAction("onKeyDown"); accessibility.registerKeyboardAction(viewName, instance, $element, selector, action, (args => { instance.executeAction("onKeyDown", args) })) } }, 1229: /*!************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/m_export.js ***! \************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.prepareItems = function(items, emptyCell) { const defaultSetter = value => !value ? 1 : value; const resultItems = []; const cols = (items[0] || []).reduce(((sum, item) => sum + defaultSetter(item.colspan)), 0); const getItem = (items => { let rowIndex = 0; let cellIndex = 0; return () => { const row = items[rowIndex] || []; const item = row[cellIndex++]; if (cellIndex >= row.length) { rowIndex++; cellIndex = 0 } if (item) { item.colspan = defaultSetter(item.colspan); item.rowspan = defaultSetter(item.rowspan) } return item } })(items); const addItem = (rowIndex, cellIndex, item) => { const row = resultItems[rowIndex] = resultItems[rowIndex] || []; row[cellIndex] = item; if (item.colspan > 1 || item.rowspan > 1) { const clone = (item => (0, _extend.extend)({}, item, emptyCell))(item); for (let c = 1; c < item.colspan; c++) { addItem(rowIndex, cellIndex + c, clone) } for (let r = 1; r < item.rowspan; r++) { for (let c = 0; c < item.colspan; c++) { addItem(rowIndex + r, cellIndex + c, clone) } } } }; let item = getItem(); let rowIndex = 0; while (item) { for (let cellIndex = 0; cellIndex < cols; cellIndex++) { if (!item) { break } if (resultItems[rowIndex] && resultItems[rowIndex][cellIndex]) { continue } addItem(rowIndex, cellIndex, item); cellIndex += item.colspan - 1; item = getItem() } rowIndex++ } return resultItems }; var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306) }, 15943: /*!*************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/m_modules.js ***! \*************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.ViewController = exports.View = exports.ModuleItem = exports.Controller = void 0; exports.processModules = processModules; var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374)); var _callbacks = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/callbacks */ 44504)); var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576); var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 95479); var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922); var _window = __webpack_require__( /*! ../../../core/utils/window */ 58201); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../localization/message */ 28109)); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../ui/widget/ui.errors */ 96688)); var _update_views_borders = __webpack_require__( /*! ./views/utils/update_views_borders */ 46958); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } class ModuleItem { constructor(component) { const that = this; that._updateLockCount = 0; that.component = component; that._actions = {}; that._actionConfigs = {}; (0, _iterator.each)(this.callbackNames() || [], (function(index, name) { const flags = that.callbackFlags(name) || {}; flags.unique = true; flags.syncStrategy = true; that[this] = (0, _callbacks.default)(flags) })) } _endUpdateCore() {} init() {} callbackNames() { return } callbackFlags(name) {} publicMethods() { return [] } beginUpdate() { this._updateLockCount++ } endUpdate() { if (this._updateLockCount > 0) { this._updateLockCount--; if (!this._updateLockCount) { this._endUpdateCore() } } } option(name) { const { component: component } = this; const 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) } _silentOption(name, value) { const { component: component } = this; const optionCache = component._optionCache; if (optionCache) { optionCache[name] = value } return component._setOptionWithoutOptionChange(name, value) } localize(name) { const optionCache = this.component._optionCache; if (optionCache) { if (!(name in optionCache)) { optionCache[name] = _message.default.format(name) } return optionCache[name] } return _message.default.format(name) } on(event, callback) { return this.component.on.apply(this.component, arguments) } off() { return this.component.off.apply(this.component, arguments) } optionChanged(args) { if (args.name in this._actions) { this.createAction(args.name, this._actionConfigs[args.name]); args.handled = true } } getAction(actionName) { return this._actions[actionName] } setAria(name, value, $target) { const target = $target.get(0); const prefix = "role" !== name && "id" !== name ? "aria-" : ""; if (target.setAttribute) { target.setAttribute(prefix + name, value) } else { $target.attr(prefix + name, value) } } _createComponent($container, component, options) { return this.component._createComponent($container, component, options) } getController(name) { return this.component._controllers[name] } createAction(actionName, config) { if ((0, _type.isFunction)(actionName)) { const action = this.component._createAction(actionName.bind(this), config); return function(e) { action({ event: e }) } } this._actions[actionName] = this.component._createActionByOption(actionName, config); this._actionConfigs[actionName] = config; return } executeAction(actionName, options) { const action = this._actions[actionName]; return action && action(options) } dispose() { const that = this; (0, _iterator.each)(that.callbackNames() || [], (function() { that[this].empty() })) } addWidgetPrefix(className) { const componentName = this.component.NAME; return `dx-${componentName.slice(2).toLowerCase()}${className?`-${className}`:""}` } getWidgetContainerClass() { const containerName = "dxDataGrid" === this.component.NAME ? null : "container"; return this.addWidgetPrefix(containerName) } elementIsInsideGrid($element) { const $gridElement = $element.closest(`.${this.getWidgetContainerClass()}`).parent(); return $gridElement.is(this.component.$element()) } } exports.ModuleItem = ModuleItem; class Controller extends ModuleItem {} exports.Controller = Controller; class ViewController extends Controller { getView(name) { return this.component._views[name] } getViews() { return this.component._views } } exports.ViewController = ViewController; class View extends ModuleItem { constructor(component) { super(component); this.renderCompleted = (0, _callbacks.default)(); this.resizeCompleted = (0, _callbacks.default)() } _isReady() { return this.component.isReady() } _endUpdateCore() { super._endUpdateCore(); if (!this._isReady() && this._requireReady) { this._requireRender = false; this.component._requireResize = false } if (this._requireRender) { this._requireRender = false; this.render(this._$parent) } } _invalidate(requireResize, requireReady) { this._requireRender = true; this.component._requireResize = (0, _window.hasWindow)() && (this.component._requireResize || requireResize); this._requireReady = this._requireReady || requireReady } _renderCore(options) {} _resizeCore() {} _parentElement() { return this._$parent } element() { return this._$element } getElementHeight() { const $element = this.element(); if (!$element) { return 0 } const marginTop = parseFloat($element.css("marginTop")) || 0; const marginBottom = parseFloat($element.css("marginBottom")) || 0; const { offsetHeight: offsetHeight } = $element.get(0); return offsetHeight + marginTop + marginBottom } isVisible() { return true } getTemplate(name) { return this.component._getTemplate(name) } getView(name) { return this.component._views[name] } _getBorderedViews() { return { columnHeadersView: this.component._views.columnHeadersView, rowsView: this.component._views.rowsView, filterPanelView: this.component._views.filterPanelView, footerView: this.component._views.footerView } } render($parent, options) { let $element = this._$element; const isVisible = this.isVisible(); if (!$element && !$parent) { return } this._requireReady = false; if (!$element) { $element = this._$element = (0, _renderer.default)("
").appendTo($parent); this._$parent = $parent } $element.toggleClass("dx-hidden", !isVisible); if (this.component._views) { (0, _update_views_borders.updateViewsBorders)(this.name, this._getBorderedViews()) } if (isVisible) { this.component._optionCache = {}; const deferred = this._renderCore(options); this.component._optionCache = void 0; if (deferred) { deferred.done((() => { this.renderCompleted.fire(options) })) } else { this.renderCompleted.fire(options) } } } resize() { this.isResizing = true; this._resizeCore(); this.resizeCompleted.fire(); this.isResizing = false } focus(preventScroll) { this.element().get(0).focus({ preventScroll: preventScroll }) } } exports.View = View; const MODULES_ORDER_MAX_INDEX = 1e6; function getExtendedTypes(types) { let moduleExtenders = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; const extendTypes = {}; Object.entries(moduleExtenders).forEach((_ref => { let [name, extender] = _ref; const currentType = types[name]; if (currentType) { if ((0, _type.isFunction)(extender)) { extendTypes[name] = extender(currentType) } else { const classType = currentType; extendTypes[name] = classType.inherit(extender) } } })); return extendTypes } function processModules(componentInstance, componentClass) { const { modules: modules } = componentClass; const { modulesOrder: modulesOrder } = componentClass; function createModuleItems(moduleTypes) { const moduleItems = {}; (0, _iterator.each)(moduleTypes, ((name, moduleType) => { const moduleItem = new moduleType(componentInstance); moduleItem.name = name; ! function(componentInstance, name, moduleItem) { const publicMethods = moduleItem.publicMethods(); if (publicMethods) { (0, _iterator.each)(publicMethods, ((_, methodName) => { if (moduleItem[methodName]) { if (!componentInstance[methodName]) { componentInstance[methodName] = function() { return moduleItem[methodName](...arguments) } } else { throw _ui.default.Error("E1005", methodName) } } else { throw _ui.default.Error("E1006", name, methodName) } })) } }(componentInstance, name, moduleItem); moduleItems[name] = moduleItem })); return moduleItems } if (modulesOrder) { modules.sort(((module1, module2) => { let orderIndex1 = modulesOrder.indexOf(module1.name); let orderIndex2 = modulesOrder.indexOf(module2.name); if (orderIndex1 < 0) { orderIndex1 = MODULES_ORDER_MAX_INDEX } if (orderIndex2 < 0) { orderIndex2 = MODULES_ORDER_MAX_INDEX } return orderIndex1 - orderIndex2 })) } const rootControllerTypes = {}; const rootViewTypes = {}; modules.forEach((_ref2 => { let { name: moduleName, controllers: controllers = {}, views: views = {} } = _ref2; Object.entries(controllers).forEach((_ref3 => { let [name, type] = _ref3; if (rootControllerTypes[name]) { throw _ui.default.Error("E1001", moduleName, name) } else if (!((null === type || void 0 === type ? void 0 : type.prototype) instanceof Controller)) { throw _ui.default.Error("E1002", moduleName, name) } rootControllerTypes[name] = type })); Object.entries(views).forEach((_ref4 => { let [name, type] = _ref4; if (rootViewTypes[name]) { throw _ui.default.Error("E1003", moduleName, name) } else if (!((null === type || void 0 === type ? void 0 : type.prototype) instanceof View)) { throw _ui.default.Error("E1004", moduleName, name) } rootViewTypes[name] = type })) })); const moduleExtenders = modules.filter((_ref5 => { let { extenders: extenders } = _ref5; return !!extenders })); const controllerTypes = moduleExtenders.reduce(((types, _ref6) => { let { extenders: extenders } = _ref6; return _extends({}, types, getExtendedTypes(types, null === extenders || void 0 === extenders ? void 0 : extenders.controllers)) }), rootControllerTypes); const viewTypes = moduleExtenders.reduce(((types, _ref7) => { let { extenders: extenders } = _ref7; return _extends({}, types, getExtendedTypes(types, null === extenders || void 0 === extenders ? void 0 : extenders.views)) }), rootViewTypes); componentInstance._controllers = createModuleItems(controllerTypes); componentInstance._views = createModuleItems(viewTypes) } exports.default = { modules: [], View: View, ViewController: ViewController, Controller: Controller, registerModule(name, module) { const { modules: modules } = this; for (let i = 0; i < modules.length; i++) { if (modules[i].name === name) { return } } module.name = name; modules.push(module) }, registerModulesOrder(moduleNames) { this.modulesOrder = moduleNames }, unregisterModule(name) { this.modules = (0, _common.grep)(this.modules, (module => module.name !== name)) }, processModules: processModules, 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) })) } } } }, 60082: /*!***********************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/m_utils.js ***! \***********************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374)); var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576); var _data = __webpack_require__( /*! ../../../core/utils/data */ 47617); var _deferred = __webpack_require__( /*! ../../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 95479); var _position = __webpack_require__( /*! ../../../core/utils/position */ 37518); var _size = __webpack_require__( /*! ../../../core/utils/size */ 58664); var _string = __webpack_require__( /*! ../../../core/utils/string */ 68752); var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922); var _variable_wrapper = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/variable_wrapper */ 26974)); var _window = __webpack_require__( /*! ../../../core/utils/window */ 58201); var _data_source = __webpack_require__( /*! ../../../data/data_source/data_source */ 85273); var _utils = __webpack_require__( /*! ../../../data/data_source/utils */ 9234); var _utils2 = __webpack_require__( /*! ../../../data/utils */ 16454); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../events/core/events_engine */ 55994)); var _format_helper = _interopRequireDefault(__webpack_require__( /*! ../../../format_helper */ 30343)); var _load_panel = _interopRequireDefault(__webpack_require__( /*! ../../../ui/load_panel */ 97218)); var _filtering = _interopRequireDefault(__webpack_require__( /*! ../../../ui/shared/filtering */ 18740)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const DATE_INTERVAL_SELECTORS = { year: value => value && value.getFullYear(), month: value => value && value.getMonth() + 1, day: value => value && value.getDate(), quarter: value => value && Math.floor(value.getMonth() / 3) + 1, hour: value => value && value.getHours(), minute: value => value && value.getMinutes(), second: value => value && value.getSeconds() }; const getIntervalSelector = function() { const data = arguments[1]; const value = this.calculateCellValue(data); if (!(0, _type.isDefined)(value)) { return null } if (isDateType(this.dataType)) { const nameIntervalSelector = arguments[0]; return DATE_INTERVAL_SELECTORS[nameIntervalSelector](value) } if ("number" === this.dataType) { const groupInterval = arguments[0]; return Math.floor(Number(value) / groupInterval) * groupInterval } }; const equalSelectors = function(selector1, selector2) { if ((0, _type.isFunction)(selector1) && (0, _type.isFunction)(selector2)) { if (selector1.originalCallback && selector2.originalCallback) { return selector1.originalCallback === selector2.originalCallback && selector1.columnIndex === selector2.columnIndex } } return selector1 === selector2 }; function isDateType(dataType) { return "date" === dataType || "datetime" === dataType } const setEmptyText = function($container) { $container.get(0).textContent = "\xa0" }; const normalizeSortingInfo = function(sort) { sort = sort || []; const result = (0, _utils2.normalizeSortingInfo)(sort); for (let 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 }; const formatValue = function(value, options) { const valueText = _format_helper.default.format(value, options.format) || value && value.toString() || ""; const 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 }; const getSummaryText = function(summaryItem, summaryTexts) { const displayFormat = summaryItem.displayFormat || summaryItem.columnCaption && summaryTexts[`${summaryItem.summaryType}OtherColumn`] || summaryTexts[summaryItem.summaryType]; return formatValue(summaryItem.value, { format: summaryItem.valueFormat, getDisplayFormat: valueText => displayFormat ? (0, _string.format)(displayFormat, valueText, summaryItem.columnCaption) : valueText, customizeText: summaryItem.customizeText }) }; const getWidgetInstance = function($element) { const editorData = $element.data && $element.data(); const dxComponents = editorData && editorData.dxComponents; const widgetName = dxComponents && dxComponents[0]; return widgetName && editorData[widgetName] }; const equalFilterParameters = function(filter1, filter2) { if (Array.isArray(filter1) && Array.isArray(filter2)) { if (filter1.length !== filter2.length) { return false } for (let i = 0; i < filter1.length; i++) { if (!equalFilterParameters(filter1[i], filter2[i])) { return false } } return true } 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) && (0, _data.toComparable)(filter1.selectedFilterOperation) === (0, _data.toComparable)(filter2.selectedFilterOperation) } return (0, _data.toComparable)(filter1) == (0, _data.toComparable)(filter2) }; exports.default = { renderNoDataText($element) { const that = this; $element = $element || this.element(); if (!$element) { return } const noDataClass = that.addWidgetPrefix("nodata"); let noDataElement = $element.find(`.${noDataClass}`).last(); const isVisible = this._dataController.isEmpty(); const isLoading = this._dataController.isLoading(); if (!noDataElement.length) { noDataElement = (0, _renderer.default)("").addClass(noDataClass) } if (!noDataElement.parent().is($element)) { noDataElement.appendTo($element) } if (isVisible && !isLoading) { noDataElement.removeClass("dx-hidden").text(that._getNoDataText()) } else { noDataElement.addClass("dx-hidden") } }, renderLoadPanel($element, $container, isLocalStore) { const that = this; let loadPanelOptions; that._loadPanel && that._loadPanel.$element().remove(); loadPanelOptions = that.option("loadPanel"); if (loadPanelOptions && ("auto" === loadPanelOptions.enabled ? !isLocalStore : loadPanelOptions.enabled)) { loadPanelOptions = (0, _extend.extend)({ shading: false, message: loadPanelOptions.text, container: $container }, loadPanelOptions); that._loadPanel = that._createComponent((0, _renderer.default)("
").appendTo($container), _load_panel.default, loadPanelOptions) } else { that._loadPanel = null } }, calculateLoadPanelPosition($element) { const $window = (0, _renderer.default)((0, _window.getWindow)()); if ((0, _size.getHeight)($element) > (0, _size.getHeight)($window)) { return { of: $window, boundary: $element, collision: "fit" } } return { of: $element } }, getIndexByKey(key, items, keyName) { let index = -1; if (void 0 !== key && Array.isArray(items)) { keyName = arguments.length <= 2 ? "key" : keyName; for (let i = 0; i < items.length; i++) { const item = (0, _type.isDefined)(keyName) ? items[i][keyName] : items[i]; if ((0, _common.equalByValue)(key, item)) { index = i; break } } } return index }, combineFilters(filters, operation) { let resultFilter = []; operation = operation || "and"; for (let i = 0; i < filters.length; i++) { var _filters$i; if (!filters[i]) { continue } if (1 === (null === (_filters$i = filters[i]) || void 0 === _filters$i ? void 0 : _filters$i.length) && "!" === filters[i][0]) { if ("and" === operation) { return ["!"] } if ("or" === operation) { continue } } if (resultFilter.length) { resultFilter.push(operation) } resultFilter.push(filters[i]) } if (1 === resultFilter.length) { resultFilter = resultFilter[0] } if (resultFilter.length) { return resultFilter } return }, checkChanges(changes, changeNames) { let changesWithChangeNamesCount = 0; for (let i = 0; i < changeNames.length; i++) { if (changes[changeNames[i]]) { changesWithChangeNamesCount++ } } return changes.length && changes.length === changesWithChangeNamesCount }, equalFilterParameters: equalFilterParameters, proxyMethod(instance, methodName, defaultResult) { if (!instance[methodName]) { instance[methodName] = function() { const dataSource = this._dataSource; return dataSource ? dataSource[methodName].apply(dataSource, arguments) : defaultResult } } }, formatValue: formatValue, getFormatOptionsByColumn: (column, target) => ({ format: column.format, getDisplayFormat: column.getDisplayFormat, customizeText: column.customizeText, target: target, trueText: column.trueText, falseText: column.falseText }), getDisplayValue(column, value, data, rowType) { if (column.displayValueMap && void 0 !== column.displayValueMap[value]) { return column.displayValueMap[value] } if (column.calculateDisplayValue && data && "group" !== rowType) { return column.calculateDisplayValue(data) } if (column.lookup && !("group" === rowType && (column.calculateGroupValue || column.calculateDisplayValue))) { return column.lookup.calculateCellValue(value) } return value }, getGroupRowSummaryText(summaryItems, summaryTexts) { let result = "("; for (let i = 0; i < summaryItems.length; i++) { const summaryItem = summaryItems[i]; result += (i > 0 ? ", " : "") + getSummaryText(summaryItem, summaryTexts) } return result + ")" }, getSummaryText: getSummaryText, normalizeSortingInfo: normalizeSortingInfo, getFormatByDataType(dataType) { switch (dataType) { case "date": return "shortDate"; case "datetime": return "shortDateShortTime"; default: return } }, getHeaderFilterGroupParameters(column, remoteGrouping) { let result = []; const dataField = column.dataField || column.name; const groupInterval = _filtering.default.getGroupInterval(column); if (groupInterval) { (0, _iterator.each)(groupInterval, ((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(data) { let 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(sortParameters1, sortParameters2, ignoreIsExpanded) { sortParameters1 = normalizeSortingInfo(sortParameters1); sortParameters2 = normalizeSortingInfo(sortParameters2); if (Array.isArray(sortParameters1) && Array.isArray(sortParameters2)) { if (sortParameters1.length !== sortParameters2.length) { return false } for (let 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 } return (!sortParameters1 || !sortParameters1.length) === (!sortParameters2 || !sortParameters2.length) }, getPointsByColumns(items, pointCreated, isVertical, startColumnIndex) { const cellsLength = items.length; let notCreatePoint = false; let item; let offset; let columnIndex = startColumnIndex || 0; const result = []; let rtlEnabled; for (let i = 0; i <= cellsLength; i++) { if (i < cellsLength) { item = items.eq(i); offset = item.offset(); rtlEnabled = "rtl" === item.css("direction") } const point = { index: columnIndex, x: offset ? offset.left + (!isVertical && rtlEnabled ^ i === cellsLength ? (0, _position.getBoundingRect)(item[0]).width : 0) : 0, y: offset ? offset.top + (isVertical && i === cellsLength ? (0, _position.getBoundingRect)(item[0]).height : 0) : 0, columnIndex: columnIndex }; if (!isVertical && i > 0) { const 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 }, getExpandCellTemplate: () => ({ allowRenderToDetachedContainer: true, render(container, options) { const $container = (0, _renderer.default)(container); if ((0, _type.isDefined)(options.value) && !(options.data && options.data.isContinuation) && !options.row.isNewRow) { const rowsView = options.component.getView("rowsView"); $container.addClass("dx-datagrid-expand").addClass("dx-selection-disabled"); (0, _renderer.default)("
").addClass(options.value ? "dx-datagrid-group-opened" : "dx-datagrid-group-closed").appendTo($container); rowsView.setAria("label", options.value ? rowsView.localize("dxDataGrid-ariaCollapse") : rowsView.localize("dxDataGrid-ariaExpand"), $container) } else { setEmptyText($container) } } }), setEmptyText: setEmptyText, isDateType: isDateType, getSelectionRange(focusedElement) { try { if (focusedElement) { return { selectionStart: focusedElement.selectionStart, selectionEnd: focusedElement.selectionEnd } } } catch (e) {} return {} }, setSelectionRange(focusedElement, selectionRange) { try { if (focusedElement && focusedElement.setSelectionRange) { focusedElement.setSelectionRange(selectionRange.selectionStart, selectionRange.selectionEnd) } } catch (e) {} }, focusAndSelectElement(component, $element) { const isFocused = $element.is(":focus"); _events_engine.default.trigger($element, "focus"); const isSelectTextOnEditingStart = component.option("editing.selectTextOnEditStart"); const element = $element.get(0); if (!isFocused && isSelectTextOnEditingStart && $element.is(".dx-texteditor-input") && !$element.is("[readonly]")) { const editor = getWidgetInstance($element.closest(".dx-texteditor")); (0, _deferred.when)(editor && editor._loadItemDeferred).done((() => { element.select() })) } }, getWidgetInstance: getWidgetInstance, getLastResizableColumnIndex(columns, resultWidths) { const hasResizableColumns = columns.some((column => column && !column.command && !column.fixed && false !== column.allowResizing)); let lastColumnIndex; for (lastColumnIndex = columns.length - 1; columns[lastColumnIndex]; lastColumnIndex--) { const column = columns[lastColumnIndex]; const width = resultWidths && resultWidths[lastColumnIndex]; const allowResizing = !hasResizableColumns || false !== column.allowResizing; if (!column.command && !column.fixed && "adaptiveHidden" !== width && allowResizing) { break } } return lastColumnIndex }, isElementInCurrentGrid(controller, $element) { if ($element && $element.length) { const $grid = $element.closest(`.${controller.getWidgetContainerClass()}`).parent(); return $grid.is(controller.component.$element()) } return false }, isVirtualRowRendering(that) { const rowRenderingMode = that.option("scrolling.rowRenderingMode"); const isVirtualMode = "virtual" === that.option("scrolling.mode"); const isAppendMode = "infinite" === that.option("scrolling.mode"); if (false === that.option("scrolling.legacyMode") && (isVirtualMode || isAppendMode)) { return true } return "virtual" === rowRenderingMode }, getPixelRatio: window => window.devicePixelRatio || 1, getContentHeightLimit(browser) { if (browser.mozilla) { return 8e6 } return 15e6 / this.getPixelRatio((0, _window.getWindow)()) }, normalizeLookupDataSource(lookup) { let lookupDataSourceOptions; if (lookup.items) { lookupDataSourceOptions = lookup.items } else { lookupDataSourceOptions = lookup.dataSource; if ((0, _type.isFunction)(lookupDataSourceOptions) && !_variable_wrapper.default.isWrapped(lookupDataSourceOptions)) { lookupDataSourceOptions = lookupDataSourceOptions({}) } } return (0, _utils.normalizeDataSourceOptions)(lookupDataSourceOptions) }, getWrappedLookupDataSource(column, dataSource, filter) { if (!dataSource) { return [] } const lookupDataSourceOptions = this.normalizeLookupDataSource(column.lookup); if (column.calculateCellValue !== column.defaultCalculateCellValue) { return lookupDataSourceOptions } const hasGroupPaging = dataSource.remoteOperations().groupPaging; const hasLookupOptimization = column.displayField && (0, _type.isString)(column.displayField); let cachedUniqueRelevantItems; let previousTake; let previousSkip; const sliceItems = (items, loadOptions) => { const start = loadOptions.skip ?? 0; const end = loadOptions.take ? start + loadOptions.take : items.length; return items.slice(start, end) }; const loadUniqueRelevantItems = loadOptions => { const group = function(group) { if (!Array.isArray(group)) { group = [group] } return group.map(((item, i) => { if ((0, _type.isString)(item)) { return { selector: item, isExpanded: i < group.length - 1 } } return item })) }(hasLookupOptimization ? [column.dataField, column.displayField] : column.dataField); const d = new _deferred.Deferred; const canUseCache = cachedUniqueRelevantItems && (!hasGroupPaging || loadOptions.skip === previousSkip && loadOptions.take === previousTake); if (canUseCache) { d.resolve(sliceItems(cachedUniqueRelevantItems, loadOptions)) } else { previousSkip = loadOptions.skip; previousTake = loadOptions.take; dataSource.load({ filter: filter, group: group, take: hasGroupPaging ? loadOptions.take : void 0, skip: hasGroupPaging ? loadOptions.skip : void 0 }).done((items => { cachedUniqueRelevantItems = items; d.resolve(hasGroupPaging ? items : sliceItems(items, loadOptions)) })).fail(d.fail) } return d }; const lookupDataSource = _extends({}, lookupDataSourceOptions, { __dataGridSourceFilter: filter, load: loadOptions => { const d = new _deferred.Deferred; loadUniqueRelevantItems(loadOptions).done((items => { if (0 === items.length) { d.resolve([]); return } const filter = this.combineFilters(items.flatMap((data => data.key)).map((key => [column.lookup.valueExpr, key])), "or"); const newDataSource = new _data_source.DataSource(_extends({}, lookupDataSourceOptions, loadOptions, { filter: this.combineFilters([filter, loadOptions.filter], "and"), paginate: false })); newDataSource.load().done(d.resolve).fail(d.fail) })).fail(d.fail); return d }, key: column.lookup.valueExpr, byKey(key) { const d = (0, _deferred.Deferred)(); this.load({ filter: [column.lookup.valueExpr, "=", key] }).done((arr => { d.resolve(arr[0]) })); return d.promise() } }); return lookupDataSource }, logHeaderFilterDeprecatedWarningIfNeed(component) { const logWarning = component._logDeprecatedOptionWarning.bind(component); if ((0, _type.isDefined)(component.option("headerFilter.allowSearch"))) { logWarning("headerFilter.allowSearch", { since: "23.1", alias: "headerFilter.search.enabled" }) } if ((0, _type.isDefined)(component.option("headerFilter.searchTimeout"))) { logWarning("headerFilter.searchTimeout", { since: "23.1", alias: "headerFilter.search.timeout" }) } const specificName = "dxPivotGrid" === component.NAME ? "dataSource.fields" : "columns"; const columns = component.option(specificName); if (!Array.isArray(columns)) { return } const logSpecificDeprecatedWarningIfNeed = columns => { columns.forEach((column => { var _column$columns; const headerFilter = column.headerFilter || {}; if ((0, _type.isDefined)(headerFilter.allowSearch)) { logWarning(`${specificName}[].headerFilter.allowSearch`, { since: "23.1", alias: `${specificName}[].headerFilter.search.enabled` }) } if ((0, _type.isDefined)(headerFilter.searchMode)) { logWarning(`${specificName}[].headerFilter.searchMode`, { since: "23.1", alias: `${specificName}[].headerFilter.search.mode` }) } if (null !== (_column$columns = column.columns) && void 0 !== _column$columns && _column$columns.length) { logSpecificDeprecatedWarningIfNeed(column.columns) } })) }; logSpecificDeprecatedWarningIfNeed(columns) } } }, 67880: /*!*****************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/m_widget_base.js ***! \*****************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576); var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 95479); var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922); var _ui = (obj = __webpack_require__( /*! ../../../ui/widget/ui.widget */ 14390), obj && obj.__esModule ? obj : { default: obj }); var obj; class GridCoreWidget extends _ui.default { _getDefaultOptions() { const result = super._getDefaultOptions(); (0, _iterator.each)(this.getGridCoreHelper().modules, (function() { if ((0, _type.isFunction)(this.defaultOptions)) { (0, _extend.extend)(true, result, this.defaultOptions()) } })); return result } _init() { this._activeStateUnit = ".dx-row"; super._init() } _setDeprecatedOptions() { super._setDeprecatedOptions(); (0, _extend.extend)(this._deprecatedOptions, { "columnChooser.allowSearch": { since: "23.1", message: 'Use the "columnChooser.search.enabled" option instead' }, "columnChooser.searchTimeout": { since: "23.1", message: 'Use the "columnChooser.search.timeout" option instead' } }) } _clean() {} _optionChanged(args) { this.getGridCoreHelper().callModuleItemsMethod(this, "optionChanged", [args]); if (!args.handled) { super._optionChanged(args) } } _dimensionChanged() { this.updateDimensions(true) } _visibilityChanged(visible) { if (visible) { this.updateDimensions() } } _renderContentImpl() { this.getView("gridView").update() } _renderContent() { const that = this; (0, _common.deferRender)((() => { that._renderContentImpl() })) } _dispose() { super._dispose(); this.getGridCoreHelper().callModuleItemsMethod(this, "dispose") } isReady() { return this.getController("data").isReady() } getController(name) { return this._controllers[name] } getView(name) { return this._views[name] } getGridCoreHelper() {} beginUpdate() { super.beginUpdate(); this.getGridCoreHelper().callModuleItemsMethod(this, "beginUpdate") } endUpdate() { this.getGridCoreHelper().callModuleItemsMethod(this, "endUpdate"); super.endUpdate() } } exports.default = GridCoreWidget }, 82802: /*!*********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/master_detail/m_master_detail.js ***! \*********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.masterDetailModule = exports.dataMasterDetailExtenderMixin = void 0; var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _size = __webpack_require__( /*! ../../../../core/utils/size */ 58664); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109)); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../m_utils */ 60082)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const initMasterDetail = function(that) { that._expandedItems = []; that._isExpandAll = that.option("masterDetail.autoExpandAll") }; const dataMasterDetailExtenderMixin = Base => class extends Base { init() { initMasterDetail(this); super.init() } expandAll(groupIndex) { const that = this; if (groupIndex < 0) { that._isExpandAll = true; that._expandedItems = []; that.updateItems() } else { super.expandAll.apply(that, arguments) } } collapseAll(groupIndex) { const that = this; if (groupIndex < 0) { that._isExpandAll = false; that._expandedItems = []; that.updateItems() } else { super.collapseAll.apply(that, arguments) } } isRowExpandedHack() { return super.isRowExpanded.apply(this, arguments) } isRowExpanded(key) { const that = this; const expandIndex = _m_utils.default.getIndexByKey(key, that._expandedItems); if (Array.isArray(key)) { return super.isRowExpanded.apply(that, arguments) } return !!(that._isExpandAll ^ (expandIndex >= 0 && that._expandedItems[expandIndex].visible)) } _getRowIndicesForExpand(key) { const rowIndex = this.getRowIndexByKey(key); return [rowIndex, rowIndex + 1] } _changeRowExpandCore(key) { const that = this; let result; if (Array.isArray(key)) { result = super._changeRowExpandCore.apply(that, arguments) } else { const expandIndex = _m_utils.default.getIndexByKey(key, that._expandedItems); if (expandIndex >= 0) { const { visible: visible } = that._expandedItems[expandIndex]; that._expandedItems[expandIndex].visible = !visible } else { that._expandedItems.push({ key: key, visible: true }) } that.updateItems({ changeType: "update", rowIndices: that._getRowIndicesForExpand(key) }); result = (new _deferred.Deferred).resolve() } return result } _processDataItemHack() { return super._processDataItem.apply(this, arguments) } _processDataItem(data, options) { const dataItem = super._processDataItem.apply(this, arguments); dataItem.isExpanded = this.isRowExpanded(dataItem.key); if (void 0 === options.detailColumnIndex) { options.detailColumnIndex = -1; (0, _iterator.each)(options.visibleColumns, ((index, column) => { if ("expand" === column.command && !(0, _type.isDefined)(column.groupIndex)) { options.detailColumnIndex = index; return false } return })) } if (options.detailColumnIndex >= 0) { dataItem.values[options.detailColumnIndex] = dataItem.isExpanded } return dataItem } _processItemsHack() { return super._processItems.apply(this, arguments) } _processItems(items, change) { const that = this; const { changeType: changeType } = change; const result = []; items = super._processItems.apply(that, arguments); if ("loadingAll" === changeType) { return items } if ("refresh" === changeType) { that._expandedItems = (0, _common.grep)(that._expandedItems, (item => item.visible)) }(0, _iterator.each)(items, ((index, item) => { result.push(item); const expandIndex = _m_utils.default.getIndexByKey(item.key, that._expandedItems); if ("data" === item.rowType && (item.isExpanded || expandIndex >= 0) && !item.isNewRow) { result.push({ visible: item.isExpanded, rowType: "detail", key: item.key, data: item.data, values: [] }) } })); return result } optionChanged(args) { const that = this; let isEnabledChanged; let isAutoExpandAllChanged; if ("masterDetail" === args.name) { args.name = "dataSource"; switch (args.fullName) { case "masterDetail": { const value = args.value || {}; const previousValue = args.previousValue || {}; isEnabledChanged = value.enabled !== previousValue.enabled; isAutoExpandAllChanged = value.autoExpandAll !== previousValue.autoExpandAll; break } case "masterDetail.template": initMasterDetail(that); break; case "masterDetail.enabled": isEnabledChanged = true; break; case "masterDetail.autoExpandAll": isAutoExpandAllChanged = true } if (isEnabledChanged || isAutoExpandAllChanged) { initMasterDetail(that) } } super.optionChanged(args) } }; exports.dataMasterDetailExtenderMixin = dataMasterDetailExtenderMixin; exports.masterDetailModule = { defaultOptions: () => ({ masterDetail: { enabled: false, autoExpandAll: false, template: null } }), extenders: { controllers: { columns: Base => class extends Base { _getExpandColumnsCore() { const expandColumns = super._getExpandColumnsCore(); if (this.option("masterDetail.enabled")) { expandColumns.push({ type: "detailExpand", cellTemplate: _m_utils.default.getExpandCellTemplate() }) } return expandColumns } }, data: dataMasterDetailExtenderMixin, resizing: Base => class extends Base { fireContentReadyAction() { super.fireContentReadyAction.apply(this, arguments); this._updateParentDataGrids(this.component.$element()) } _updateParentDataGrids($element) { const $masterDetailRow = $element.closest(".dx-master-detail-row"); if ($masterDetailRow.length) { (0, _deferred.when)(this._updateMasterDataGrid($masterDetailRow, $element)).done((() => { this._updateParentDataGrids($masterDetailRow.parent()) })) } } _updateMasterDataGrid($masterDetailRow, $detailElement) { const masterRowOptions = (0, _renderer.default)($masterDetailRow).data("options"); const masterDataGrid = (0, _renderer.default)($masterDetailRow).closest(`.${this.getWidgetContainerClass()}`).parent().data("dxDataGrid"); if (masterRowOptions && masterDataGrid) { return this._updateMasterDataGridCore(masterDataGrid, masterRowOptions) } return } _updateMasterDataGridCore(masterDataGrid, masterRowOptions) { const d = (0, _deferred.Deferred)(); if (masterDataGrid.getView("rowsView").isFixedColumns()) { this._updateFixedMasterDetailGrids(masterDataGrid, masterRowOptions.rowIndex, (0, _renderer.default)(masterRowOptions.rowElement)).done(d.resolve) } else { if (true === masterDataGrid.option("scrolling.useNative")) { masterDataGrid.updateDimensions().done((() => d.resolve(true))); return } const scrollable = masterDataGrid.getScrollable(); if (scrollable) { null === scrollable || void 0 === scrollable || scrollable.update().done((() => d.resolve())) } else { d.resolve() } } return d.promise() } _updateFixedMasterDetailGrids(masterDataGrid, masterRowIndex, $detailElement) { const d = (0, _deferred.Deferred)(); const $rows = (0, _renderer.default)(masterDataGrid.getRowElement(masterRowIndex)); const $tables = (0, _renderer.default)(masterDataGrid.getView("rowsView").getTableElements()); const rowsNotEqual = 2 === (null === $rows || void 0 === $rows ? void 0 : $rows.length) && (0, _size.getHeight)($rows.eq(0)) !== (0, _size.getHeight)($rows.eq(1)); const tablesNotEqual = 2 === (null === $tables || void 0 === $tables ? void 0 : $tables.length) && (0, _size.getHeight)($tables.eq(0)) !== (0, _size.getHeight)($tables.eq(1)); if (rowsNotEqual || tablesNotEqual) { const detailElementWidth = (0, _size.getWidth)($detailElement); masterDataGrid.updateDimensions().done((() => { const isDetailHorizontalScrollCanBeShown = this.option("columnAutoWidth") && true === masterDataGrid.option("scrolling.useNative"); const isDetailGridWidthChanged = isDetailHorizontalScrollCanBeShown && detailElementWidth !== (0, _size.getWidth)($detailElement); if (isDetailHorizontalScrollCanBeShown && isDetailGridWidthChanged) { this.updateDimensions().done((() => d.resolve(true))) } else { d.resolve(true) } })); return d.promise() } return (0, _deferred.Deferred)().resolve() } _toggleBestFitMode(isBestFit) { super._toggleBestFitMode.apply(this, arguments); if (this.option("masterDetail.template")) { const $rowsTable = this._rowsView.getTableElement(); if ($rowsTable) { $rowsTable.find(".dx-master-detail-cell").css("maxWidth", isBestFit ? 0 : "") } } } } }, views: { rowsView: Base => class extends Base { _getCellTemplate(options) { const that = this; const { column: column } = options; const editingController = this._editingController; const isEditRow = editingController && editingController.isEditRow(options.rowIndex); let template; if ("detail" === column.command && !isEditRow) { template = that.option("masterDetail.template") || { allowRenderToDetachedContainer: false, render: that._getDefaultTemplate(column) } } else { template = super._getCellTemplate.apply(that, arguments) } return template } _isDetailRow(row) { return row && row.rowType && 0 === row.rowType.indexOf("detail") } _createRow(row) { const $row = super._createRow.apply(this, arguments); if (row && this._isDetailRow(row)) { this.option("showRowLines") && $row.addClass("dx-row-lines"); $row.addClass("dx-master-detail-row"); if ((0, _type.isDefined)(row.visible)) { $row.toggle(row.visible) } } return $row } _renderCells($row, options) { const { row: row } = options; let $detailCell; const visibleColumns = this._columnsController.getVisibleColumns(); if (row.rowType && this._isDetailRow(row)) { if (this._needRenderCell(0, options.columnIndices)) { $detailCell = this._renderCell($row, { value: null, row: row, rowIndex: row.rowIndex, column: { command: "detail" }, columnIndex: 0, change: options.change }); $detailCell.addClass("dx-cell-focus-disabled").addClass("dx-master-detail-cell").attr("colSpan", visibleColumns.length); const isEditForm = row.isEditing; if (!isEditForm) { $detailCell.attr("aria-roledescription", _message.default.format("dxDataGrid-masterDetail")) } } } else { super._renderCells.apply(this, arguments) } } } } } } }, 3990: /*!*****************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/pager/m_pager.js ***! \*****************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.pagerModule = exports.PagerView = void 0; var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _window = __webpack_require__( /*! ../../../../core/utils/window */ 58201); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109)); var _pager = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/pager */ 79383)); var _m_modules = _interopRequireDefault(__webpack_require__( /*! ../m_modules */ 15943)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const getPageIndex = function(dataController) { return 1 + (parseInt(dataController.pageIndex()) || 0) }; class PagerView extends _m_modules.default.View { init() { const dataController = this.getController("data"); dataController.changed.add((e => { if (e && e.repaintChangesOnly) { const pager = this._pager; if (pager) { pager.option({ pageIndex: getPageIndex(dataController), pageSize: dataController.pageSize(), pageCount: dataController.pageCount(), totalCount: dataController.totalCount(), hasKnownLastPage: dataController.hasKnownLastPage() }) } else { this.render() } } else if (!e || "update" !== e.changeType && "updateSelection" !== e.changeType && "updateFocusedRow" !== e.changeType) { this._pager = null; this.render() } })) } dispose() { this._pager = null } optionChanged(args) { const { name: name } = args; const isPager = "pager" === name; const isPaging = "paging" === name; const isDataSource = "dataSource" === name; const isScrolling = "scrolling" === name; const dataController = this.getController("data"); if (isPager || isPaging || isScrolling || isDataSource) { args.handled = true; if (dataController.skipProcessingPagingChange(args.fullName)) { return } if (isPager || isPaging) { this._pageSizes = null } if (!isDataSource) { this._pager = null; this._invalidate(); if ((0, _window.hasWindow)() && isPager && this.component) { this.component.resize() } } } } _renderCore() { const that = this; const $element = that.element().addClass(that.addWidgetPrefix("pager")); const pagerOptions = that.option("pager") ?? {}; const dataController = that.getController("data"); const keyboardController = that.getController("keyboardNavigation"); const options = { maxPagesCount: 10, pageIndex: getPageIndex(dataController), pageCount: dataController.pageCount(), pageSize: dataController.pageSize(), showPageSizes: pagerOptions.showPageSizeSelector, showInfo: pagerOptions.showInfo, displayMode: pagerOptions.displayMode, pagesNavigatorVisible: pagerOptions.visible, showNavigationButtons: pagerOptions.showNavigationButtons, label: pagerOptions.label, pageSizes: that.getPageSizes(), totalCount: dataController.totalCount(), hasKnownLastPage: dataController.hasKnownLastPage(), pageIndexChanged(pageIndex) { if (dataController.pageIndex() !== pageIndex - 1) { dataController.pageIndex(pageIndex - 1) } }, pageSizeChanged(pageSize) { dataController.pageSize(pageSize) }, onKeyDown: e => keyboardController && keyboardController.executeAction("onKeyDown", e), useLegacyKeyboardNavigation: this.option("useLegacyKeyboardNavigation"), useKeyboard: this.option("keyboardNavigation.enabled") }; if ((0, _type.isDefined)(pagerOptions.infoText)) { options.infoText = pagerOptions.infoText } if (this._pager) { this._pager.repaint(); return } if ((0, _window.hasWindow)()) { this._pager = that._createComponent($element, _pager.default, options) } else { $element.addClass("dx-pager").html('
') } } getPager() { return this._pager } getPageSizes() { const that = this; const dataController = that.getController("data"); const pagerOptions = that.option("pager"); const allowedPageSizes = pagerOptions && pagerOptions.allowedPageSizes; const pageSize = dataController.pageSize(); if (!(0, _type.isDefined)(that._pageSizes) || !that._pageSizes.includes(pageSize)) { that._pageSizes = []; if (pagerOptions) { if (Array.isArray(allowedPageSizes)) { that._pageSizes = allowedPageSizes } else if (allowedPageSizes && pageSize > 1) { that._pageSizes = [Math.floor(pageSize / 2), pageSize, 2 * pageSize] } } } return that._pageSizes } isVisible() { const dataController = this.getController("data"); const pagerOptions = this.option("pager"); let pagerVisible = pagerOptions && pagerOptions.visible; const scrolling = this.option("scrolling"); if ("auto" === pagerVisible) { if (scrolling && ("virtual" === scrolling.mode || "infinite" === scrolling.mode)) { pagerVisible = false } else { pagerVisible = dataController.pageCount() > 1 || dataController.isLoaded() && !dataController.hasKnownLastPage() } } return !!pagerVisible } getHeight() { return this.getElementHeight() } } exports.PagerView = PagerView; exports.pagerModule = { defaultOptions: () => ({ pager: { visible: "auto", showPageSizeSelector: false, allowedPageSizes: "auto", label: _message.default.format("dxPager-ariaLabel") } }), views: { pagerView: PagerView } } }, 92794: /*!**********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/row_dragging/const.js ***! \**********************************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.CLASSES = exports.ATTRIBUTES = void 0; exports.ATTRIBUTES = { dragCell: "dx-drag-cell" }; exports.CLASSES = { cellFocusDisabled: "dx-cell-focus-disabled", handleIcon: "drag-icon", commandDrag: "dx-command-drag", sortableWithoutHandle: "dx-sortable-without-handle", rowsView: "rowsview", dragView: "dragview" } }, 5172: /*!********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/row_dragging/dom.js ***! \********************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.GridCoreRowDraggingDom = void 0; var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../m_utils */ 60082)); var _const = __webpack_require__( /*! ./const */ 92794); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } exports.GridCoreRowDraggingDom = { createHandleTemplateFunc: addWidgetPrefix => (container, options) => { const $container = (0, _renderer.default)(container); if ("data" === options.rowType) { $container.addClass(_const.CLASSES.cellFocusDisabled); return (0, _renderer.default)("").addClass(addWidgetPrefix(_const.CLASSES.handleIcon)) } _m_utils.default.setEmptyText($container); return } } }, 88351: /*!*******************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/row_dragging/m_row_dragging.js ***! \*******************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.rowDraggingModule = void 0; var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/../core/renderer */ 68374)); var _extend = __webpack_require__( /*! ../../../../core/../core/utils/extend */ 13306); var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _size = __webpack_require__( /*! ../../../../core/utils/size */ 58664); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _sortable = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/sortable */ 66843)); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../m_utils */ 60082)); var _const = __webpack_require__( /*! ./const */ 92794); var _dom = __webpack_require__( /*! ./dom */ 5172); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } exports.rowDraggingModule = { defaultOptions: () => ({ rowDragging: { showDragIcons: true, dropFeedbackMode: "indicate", allowReordering: false, allowDropInsideItem: false } }), extenders: { views: { rowsView: Base => class extends Base { init() { super.init.apply(this, arguments); this._updateHandleColumn() } optionChanged(args) { if ("rowDragging" === args.name) { this._updateHandleColumn(); this._invalidate(true, true); args.handled = true } super.optionChanged.apply(this, arguments) } _allowReordering() { const rowDragging = this.option("rowDragging"); return !!(rowDragging && (rowDragging.allowReordering || rowDragging.allowDropInsideItem || rowDragging.group)) } _updateHandleColumn() { const rowDragging = this.option("rowDragging"); const allowReordering = this._allowReordering(); const columnsController = this._columnsController; const isHandleColumnVisible = allowReordering && rowDragging.showDragIcons; null === columnsController || void 0 === columnsController || columnsController.addCommandColumn({ type: "drag", command: "drag", visibleIndex: -2, alignment: "center", elementAttr: [{ name: _const.ATTRIBUTES.dragCell, value: "" }], cssClass: _const.CLASSES.commandDrag, width: "auto", cellTemplate: this._getHandleTemplate(), visible: isHandleColumnVisible }); null === columnsController || void 0 === columnsController || columnsController.columnOption("type:drag", "visible", isHandleColumnVisible) } _renderContent() { const rowDragging = this.option("rowDragging"); const allowReordering = this._allowReordering(); const $content = super._renderContent.apply(this, arguments); const isFixedTableRendering = this._isFixedTableRendering; const currentSortableName = isFixedTableRendering ? "_sortableFixed" : "_sortable"; const anotherSortableName = isFixedTableRendering ? "_sortable" : "_sortableFixed"; const togglePointerEventsStyle = toggle => { var _this$sortableFixedNa; null === (_this$sortableFixedNa = this._sortableFixed) || void 0 === _this$sortableFixedNa || _this$sortableFixedNa.$element().css("pointerEvents", toggle ? "auto" : "") }; const rowSelector = ".dx-row:not(.dx-freespace-row):not(.dx-virtual-row):not(.dx-header-row):not(.dx-footer-row)"; const filter = this.option("dataRowTemplate") ? `> table > tbody${rowSelector}` : `> table > tbody > ${rowSelector}`; if ((allowReordering || this[currentSortableName]) && $content.length) { this[currentSortableName] = this._createComponent($content, _sortable.default, (0, _extend.extend)({ component: this.component, contentTemplate: null, filter: filter, cursorOffset: options => { const { event: event } = options; const rowsViewOffset = (0, _renderer.default)(this.element()).offset(); return { x: event.pageX - rowsViewOffset.left } }, onDraggableElementShown: e => { if (rowDragging.dragTemplate) { return } const $dragElement = (0, _renderer.default)(e.dragElement); const gridInstance = $dragElement.children(".dx-widget").data(this.component.NAME); this._synchronizeScrollLeftPosition(gridInstance) }, dragTemplate: this._getDraggableRowTemplate(), handle: rowDragging.showDragIcons && `.${_const.CLASSES.commandDrag}`, dropFeedbackMode: "indicate" }, rowDragging, { onDragStart: e => { var _this$getController, _rowDragging$onDragSt; null === (_this$getController = this.getController("keyboardNavigation")) || void 0 === _this$getController || _this$getController._resetFocusedCell(); const row = e.component.getVisibleRows()[e.fromIndex]; e.itemData = row && row.data; const isDataRow = row && "data" === row.rowType; e.cancel = !allowReordering || !isDataRow; null === (_rowDragging$onDragSt = rowDragging.onDragStart) || void 0 === _rowDragging$onDragSt || _rowDragging$onDragSt.call(rowDragging, e) }, onDragEnter: e => { if (e.fromComponent !== e.toComponent) { togglePointerEventsStyle(true) } }, onDragLeave: () => { togglePointerEventsStyle(false) }, onDragEnd: e => { var _rowDragging$onDragEn; togglePointerEventsStyle(false); null === (_rowDragging$onDragEn = rowDragging.onDragEnd) || void 0 === _rowDragging$onDragEn || _rowDragging$onDragEn.call(rowDragging, e) }, onAdd: e => { var _rowDragging$onAdd; togglePointerEventsStyle(false); null === (_rowDragging$onAdd = rowDragging.onAdd) || void 0 === _rowDragging$onAdd || _rowDragging$onAdd.call(rowDragging, e) }, dropFeedbackMode: rowDragging.dropFeedbackMode, onOptionChanged: e => { const hasFixedSortable = this._sortableFixed; if (hasFixedSortable) { if ("fromIndex" === e.name || "toIndex" === e.name) { this[anotherSortableName].option(e.name, e.value) } } } })); $content.toggleClass("dx-scrollable-container", isFixedTableRendering); $content.toggleClass(_const.CLASSES.sortableWithoutHandle, allowReordering && !rowDragging.showDragIcons) } return $content } _renderCore(e) { super._renderCore.apply(this, arguments); if (e && "update" === e.changeType && e.repaintChangesOnly && _m_utils.default.isVirtualRowRendering(this)) { (0, _common.deferUpdate)((() => { this._updateSortable() })) } } _updateSortable() { const offset = this._dataController.getRowIndexOffset(); const offsetDiff = offset - this._previousOffset; [this._sortable, this._sortableFixed].forEach((sortable => { const toIndex = null === sortable || void 0 === sortable ? void 0 : sortable.option("toIndex"); if ((0, _type.isDefined)(toIndex) && (0, _type.isDefined)(this._previousOffset)) { null === sortable || void 0 === sortable || sortable.option("toIndex", toIndex - offsetDiff) } null === sortable || void 0 === sortable || sortable.option("offset", offset); null === sortable || void 0 === sortable || sortable.update() })); this._previousOffset = offset } _resizeCore() { super._resizeCore.apply(this, arguments); this._updateSortable() } _getDraggableGridOptions(options) { const gridOptions = this.option(); const columns = this.getColumns(); const $rowElement = (0, _renderer.default)(this.getRowElement(options.rowIndex)); return { dataSource: [{ id: 1, parentId: 0 }], showBorders: true, showColumnHeaders: false, scrolling: { useNative: false, showScrollbar: "never" }, pager: { visible: false }, loadingTimeout: null, columnFixing: gridOptions.columnFixing, columnAutoWidth: gridOptions.columnAutoWidth, showColumnLines: gridOptions.showColumnLines, columns: columns.map((column => ({ width: column.width || column.visibleWidth, fixed: column.fixed, fixedPosition: column.fixedPosition }))), onRowPrepared: e => { const rowsView = e.component.getView("rowsView"); (0, _renderer.default)(e.rowElement).replaceWith($rowElement.eq(rowsView._isFixedTableRendering ? 1 : 0).clone()) } } } _synchronizeScrollLeftPosition(gridInstance) { const scrollable = null === gridInstance || void 0 === gridInstance ? void 0 : gridInstance.getScrollable(); null === scrollable || void 0 === scrollable || scrollable.scrollTo({ x: this._scrollLeft }) } _getDraggableRowTemplate() { return options => { const $rootElement = this.component.$element(); const $dataGridContainer = (0, _renderer.default)("
"); (0, _size.setWidth)($dataGridContainer, (0, _size.getWidth)($rootElement)); const items = this._dataController.items(); const row = items && items[options.fromIndex]; const gridOptions = this._getDraggableGridOptions(row); this._createComponent($dataGridContainer, this.component.NAME, gridOptions); $dataGridContainer.find(".dx-gridbase-container").children(`:not(.${this.addWidgetPrefix(_const.CLASSES.rowsView)})`).hide(); $dataGridContainer.addClass(this.addWidgetPrefix(_const.CLASSES.dragView)); return $dataGridContainer } } _getHandleTemplate() { return _dom.GridCoreRowDraggingDom.createHandleTemplateFunc((string => this.addWidgetPrefix(string))) } } } } } }, 92021: /*!*******************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/search/m_search.js ***! \*******************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.searchModule = void 0; var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../../core/dom_adapter */ 73349)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _data = __webpack_require__( /*! ../../../../core/utils/data */ 47617); var _query = _interopRequireDefault(__webpack_require__( /*! ../../../../data/query */ 96687)); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109)); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../m_utils */ 60082)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function allowSearch(column) { return !!(column.allowSearch ?? column.allowFiltering) } function parseValue(column, text) { const { lookup: lookup } = column; if (!column.parseValue) { return text } if (lookup) { return column.parseValue.call(lookup, text) } return column.parseValue(text) } exports.searchModule = { defaultOptions: () => ({ searchPanel: { visible: false, width: 160, placeholder: _message.default.format("dxDataGrid-searchPanelPlaceholder"), highlightSearchText: true, highlightCaseSensitive: false, text: "", searchVisibleColumnsOnly: false } }), extenders: { controllers: { data: base => class extends base { optionChanged(args) { switch (args.fullName) { case "searchPanel.text": case "searchPanel": this._applyFilter(); args.handled = true; break; default: super.optionChanged(args) } } publicMethods() { return super.publicMethods().concat(["searchByText"]) } _calculateAdditionalFilter() { const filter = super._calculateAdditionalFilter(); const searchFilter = this.calculateSearchFilter(this.option("searchPanel.text")); return _m_utils.default.combineFilters([filter, searchFilter]) } searchByText(text) { this.option("searchPanel.text", text) } calculateSearchFilter(text) { let i; let column; const columns = this._columnsController.getColumns(); const searchVisibleColumnsOnly = this.option("searchPanel.searchVisibleColumnsOnly"); let lookup; const filters = []; if (!text) { return null } function onQueryDone(items) { const valueGetter = (0, _data.compileGetter)(lookup.valueExpr); for (let i = 0; i < items.length; i++) { const value = valueGetter(items[i]); filters.push(column.createFilterExpression(value, null, "search")) } } for (i = 0; i < columns.length; i++) { column = columns[i]; if (searchVisibleColumnsOnly && !column.visible) { continue } if (allowSearch(column) && column.calculateFilterExpression) { lookup = column.lookup; const filterValue = parseValue(column, text); if (lookup && lookup.items) { (0, _query.default)(lookup.items).filter(column.createFilterExpression.call({ dataField: lookup.displayExpr, dataType: lookup.dataType, calculateFilterExpression: column.calculateFilterExpression }, filterValue, null, "search")).enumerate().done(onQueryDone) } else if (void 0 !== filterValue) { filters.push(column.createFilterExpression(filterValue, null, "search")) } } } if (0 === filters.length) { return ["!"] } return _m_utils.default.combineFilters(filters, "or") } } }, views: { headerPanel: Base => class extends Base { optionChanged(args) { if ("searchPanel" === args.name) { if ("searchPanel.text" === args.fullName) { const editor = this.getSearchTextEditor(); if (editor) { editor.option("value", args.value) } } else { this._invalidate() } args.handled = true } else { super.optionChanged(args) } } _getToolbarItems() { const items = super._getToolbarItems(); return this._prepareSearchItem(items) } _prepareSearchItem(items) { const that = this; const dataController = this._dataController; const searchPanelOptions = this.option("searchPanel"); if (searchPanelOptions && searchPanelOptions.visible) { const toolbarItem = { template(data, index, container) { const $search = (0, _renderer.default)("
").addClass(that.addWidgetPrefix("search-panel")).appendTo(container); that._editorFactoryController.createEditor($search, { width: searchPanelOptions.width, placeholder: searchPanelOptions.placeholder, parentType: "searchPanel", value: that.option("searchPanel.text"), updateValueTimeout: 700, setValue(value) { dataController.searchByText(value) }, editorOptions: { inputAttr: { "aria-label": _message.default.format(`${that.component.NAME}-ariaSearchInGrid`) } } }); that.resize() }, name: "searchPanel", location: "after", locateInMenu: "never", sortIndex: 40 }; items.push(toolbarItem) } return items } getSearchTextEditor() { const that = this; const $element = that.element(); const $searchPanel = $element.find(`.${that.addWidgetPrefix("search-panel")}`).filter((function() { return (0, _renderer.default)(this).closest(`.${that.addWidgetPrefix("header-panel")}`).is($element) })); if ($searchPanel.length) { return $searchPanel.dxTextBox("instance") } return null } isVisible() { const searchPanelOptions = this.option("searchPanel"); return super.isVisible() || !!(null !== searchPanelOptions && void 0 !== searchPanelOptions && searchPanelOptions.visible) } }, rowsView: Base => class extends Base { init() { super.init.apply(this, arguments); this._searchParams = []; this._dataController = this.getController("data") } dispose() { clearTimeout(this._highlightTimer); super.dispose() } _getFormattedSearchText(column, searchText) { const value = parseValue(column, searchText); const formatOptions = _m_utils.default.getFormatOptionsByColumn(column, "search"); return _m_utils.default.formatValue(value, formatOptions) } _getStringNormalizer() { var _this$_dataController, _this$_dataController2, _dataSource$loadOptio; const isCaseSensitive = this.option("searchPanel.highlightCaseSensitive"); const dataSource = null === (_this$_dataController = this._dataController) || void 0 === _this$_dataController || null === (_this$_dataController2 = _this$_dataController.getDataSource) || void 0 === _this$_dataController2 ? void 0 : _this$_dataController2.call(_this$_dataController); const langParams = null === dataSource || void 0 === dataSource || null === (_dataSource$loadOptio = dataSource.loadOptions) || void 0 === _dataSource$loadOptio || null === (_dataSource$loadOptio = _dataSource$loadOptio.call(dataSource)) || void 0 === _dataSource$loadOptio ? void 0 : _dataSource$loadOptio.langParams; return str => (0, _data.toComparable)(str, isCaseSensitive, langParams) } _findHighlightingTextNodes(column, cellElement, searchText) { var _$items; const that = this; let $parent = cellElement.parent(); let $items; const stringNormalizer = this._getStringNormalizer(); const normalizedSearchText = stringNormalizer(searchText); const resultTextNodes = []; if (!$parent.length) { $parent = (0, _renderer.default)("
").append(cellElement) } else if (column) { if (column.groupIndex >= 0 && !column.showWhenGrouped) { $items = cellElement } else { const columnIndex = that._columnsController.getVisibleIndex(column.index); $items = $parent.children("td").eq(columnIndex).find("*") } } $items = null !== (_$items = $items) && void 0 !== _$items && _$items.length ? $items : $parent.find("*"); $items.each(((_, element) => { const $contents = (0, _renderer.default)(element).contents(); for (let i = 0; i < $contents.length; i++) { const node = $contents.get(i); if (3 === node.nodeType) { const normalizedText = stringNormalizer(node.textContent ?? node.nodeValue ?? ""); if (normalizedText.includes(normalizedSearchText)) { resultTextNodes.push(node) } } } })); return resultTextNodes } _highlightSearchTextCore($textNode, searchText) { const that = this; const $searchTextSpan = (0, _renderer.default)("").addClass(that.addWidgetPrefix("search-text")); const text = $textNode.text(); const firstContentElement = $textNode[0]; const stringNormalizer = this._getStringNormalizer(); const index = stringNormalizer(text).indexOf(stringNormalizer(searchText)); if (index >= 0) { if (firstContentElement.textContent) { firstContentElement.textContent = text.substr(0, index) } else { firstContentElement.nodeValue = text.substr(0, index) } $textNode.after($searchTextSpan.text(text.substr(index, searchText.length))); $textNode = (0, _renderer.default)(_dom_adapter.default.createTextNode(text.substr(index + searchText.length))).insertAfter($searchTextSpan); return that._highlightSearchTextCore($textNode, searchText) } } _highlightSearchText(cellElement, isEquals, column) { const that = this; const stringNormalizer = this._getStringNormalizer(); let searchText = that.option("searchPanel.text"); if (isEquals && column) { searchText = searchText && that._getFormattedSearchText(column, searchText) } if (searchText && that.option("searchPanel.highlightSearchText")) { const textNodes = that._findHighlightingTextNodes(column, cellElement, searchText); textNodes.forEach((textNode => { if (isEquals) { if (stringNormalizer((0, _renderer.default)(textNode).text()) === stringNormalizer(searchText ?? "")) { (0, _renderer.default)(textNode).replaceWith((0, _renderer.default)("").addClass(that.addWidgetPrefix("search-text")).text((0, _renderer.default)(textNode).text())) } } else { that._highlightSearchTextCore((0, _renderer.default)(textNode), searchText) } })) } } _renderCore() { const deferred = super._renderCore.apply(this, arguments); if (this.option().rowTemplate || this.option("dataRowTemplate")) { if (this.option("templatesRenderAsynchronously")) { clearTimeout(this._highlightTimer); this._highlightTimer = setTimeout((() => { this._highlightSearchText(this.getTableElement()) })) } else { this._highlightSearchText(this.getTableElement()) } } return deferred } _updateCell($cell, parameters) { const { column: column } = parameters; const dataType = column.lookup && column.lookup.dataType || column.dataType; const isEquals = "string" !== dataType; if (allowSearch(column) && !parameters.isOnForm) { if (this.option("templatesRenderAsynchronously")) { if (!this._searchParams.length) { clearTimeout(this._highlightTimer); this._highlightTimer = setTimeout((() => { this._searchParams.forEach((params => { this._highlightSearchText.apply(this, params) })); this._searchParams = [] })) } this._searchParams.push([$cell, isEquals, column]) } else { this._highlightSearchText($cell, isEquals, column) } } super._updateCell($cell, parameters) } } } } } }, 17969: /*!*************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/selection/m_selection.js ***! \*************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.selectionModule = exports.rowsViewSelectionExtenderMixin = exports.dataSelectionExtenderMixin = exports.columnHeadersSelectionExtenderMixin = exports.SelectionController = void 0; var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _support = __webpack_require__( /*! ../../../../core/utils/support */ 60137); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _array_utils = __webpack_require__( /*! ../../../../data/array_utils */ 60637); var _click = __webpack_require__( /*! ../../../../events/click */ 95429); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../../events/core/events_engine */ 55994)); var _hold = _interopRequireDefault(__webpack_require__( /*! ../../../../events/hold */ 11699)); var _index = __webpack_require__( /*! ../../../../events/utils/index */ 39611); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109)); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/widget/ui.errors */ 96688)); var _m_selection = _interopRequireDefault(__webpack_require__( /*! ../../../ui/selection/m_selection */ 23397)); var _m_modules = _interopRequireDefault(__webpack_require__( /*! ../m_modules */ 15943)); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../m_utils */ 60082)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const SHOW_CHECKBOXES_MODE = "selection.showCheckBoxesMode"; const processLongTap = function(that, dxEvent) { const rowsView = that.getView("rowsView"); const selectionController = that.getController("selection"); const $row = (0, _renderer.default)(dxEvent.target).closest(".dx-data-row"); const rowIndex = rowsView.getRowIndex($row); if (rowIndex < 0) { return } if ("onLongTap" === that.option(SHOW_CHECKBOXES_MODE)) { if (selectionController.isSelectionWithCheckboxes()) { selectionController.stopSelectionWithCheckboxes() } else { selectionController.startSelectionWithCheckboxes() } } else { if ("onClick" === that.option(SHOW_CHECKBOXES_MODE)) { selectionController.startSelectionWithCheckboxes() } if ("always" !== that.option(SHOW_CHECKBOXES_MODE)) { selectionController.changeItemSelection(rowIndex, { control: true }) } } }; const selectionCellTemplate = (container, options) => { const { component: component } = options; const rowsView = component.getView("rowsView"); if (component.option("renderAsync") && !component.option("selection.deferred")) { options.value = component.isRowSelected(options.row.key) } rowsView.renderSelectCheckBoxContainer((0, _renderer.default)(container), options) }; const selectionHeaderTemplate = (container, options) => { const { column: column } = options; const $cellElement = (0, _renderer.default)(container); const columnHeadersView = options.component.getView("columnHeadersView"); $cellElement.addClass("dx-editor-cell"); columnHeadersView._renderSelectAllCheckBox($cellElement, column); columnHeadersView._attachSelectAllCheckBoxClickEvent($cellElement) }; class SelectionController extends _m_modules.default.Controller { init() { const { deferred: deferred, selectAllMode: selectAllMode, mode: mode } = this.option("selection") ?? {}; if ("infinite" === this.option("scrolling.mode") && !deferred && "multiple" === mode && "allPages" === selectAllMode) { _ui.default.log("W1018") } this._dataController = this.getController("data"); this._columnsController = this.getController("columns"); this._stateStoringController = this.getController("stateStoring"); this._selectionMode = mode; this._isSelectionWithCheckboxes = false; this._selection = this._createSelection(); this._updateSelectColumn(); this.createAction("onSelectionChanged", { excludeValidators: ["disabled", "readOnly"] }); if (!this._dataPushedHandler) { this._dataPushedHandler = this._handleDataPushed.bind(this); this._dataController.pushed.add(this._dataPushedHandler) } } _handleDataPushed(changes) { this._deselectRemovedOnPush(changes); this._updateSelectedOnPush(changes) } _deselectRemovedOnPush(changes) { const isDeferredSelection = this.option("selection.deferred"); let removedKeys = changes.filter((change => "remove" === change.type)).map((change => change.key)); if (isDeferredSelection) { const selectedKeys = this._dataController.items().filter((item => item.isSelected)).map((item => item.key)); removedKeys = removedKeys.filter((key => selectedKeys.find((selectedKey => (0, _common.equalByValue)(selectedKey, key))))) } removedKeys.length && this.deselectRows(removedKeys) } _updateSelectedOnPush(changes) { const isDeferredSelection = this.option("selection.deferred"); if (isDeferredSelection) { return } const updateChanges = changes.filter((change => "update" === change.type)); const data = this.getSelectedRowsData(); (0, _array_utils.applyBatch)({ keyInfo: this._selection.options, data: data, changes: updateChanges }) } _getSelectionConfig() { const dataController = this._dataController; const columnsController = this._columnsController; const selectionOptions = this.option("selection") ?? {}; const { deferred: deferred } = selectionOptions; const scrollingMode = this.option("scrolling.mode"); const virtualPaging = "virtual" === scrollingMode || "infinite" === scrollingMode; const allowSelectAll = this.option("selection.allowSelectAll"); const legacyScrollingMode = this.option("scrolling.legacyMode"); return { selectedKeys: this.option("selectedRowKeys"), mode: this._selectionMode, deferred: deferred, alwaysSelectByShift: selectionOptions.alwaysSelectByShift, maxFilterLengthInRequest: selectionOptions.maxFilterLengthInRequest, selectionFilter: this.option("selectionFilter"), ignoreDisabledItems: true, isVirtualPaging: virtualPaging, sensitivity: this.option("selection.sensitivity"), allowLoadByRange() { const hasGroupColumns = columnsController.getGroupColumns().length > 0; return virtualPaging && !legacyScrollingMode && !hasGroupColumns && allowSelectAll && !deferred }, key: () => null === dataController || void 0 === dataController ? void 0 : dataController.key(), keyOf: item => null === dataController || void 0 === dataController ? void 0 : dataController.keyOf(item), dataFields() { var _dataController$dataS; return null === (_dataController$dataS = dataController.dataSource()) || void 0 === _dataController$dataS ? void 0 : _dataController$dataS.select() }, load(options) { var _dataController$dataS2; return (null === (_dataController$dataS2 = dataController.dataSource()) || void 0 === _dataController$dataS2 ? void 0 : _dataController$dataS2.load(options)) || (new _deferred.Deferred).resolve([]) }, plainItems: cached => dataController.items(true), isItemSelected: item => item.selected, isSelectableItem: item => "data" === (null === item || void 0 === item ? void 0 : item.rowType) && !item.isNewRow, getItemData: item => (0, _type.isDefined)(null === item || void 0 === item ? void 0 : item.rowType) ? (null === item || void 0 === item ? void 0 : item.oldData) || (null === item || void 0 === item ? void 0 : item.data) : item, filter: () => dataController.getCombinedFilter(deferred), totalCount: () => dataController.totalCount(), getLoadOptions(loadItemIndex, focusedItemIndex, shiftItemIndex) { var _dataController$dataS3; const { sort: sort, filter: filter } = (null === (_dataController$dataS3 = dataController.dataSource()) || void 0 === _dataController$dataS3 ? void 0 : _dataController$dataS3.lastLoadOptions()) ?? {}; let minIndex = Math.min(loadItemIndex, focusedItemIndex); let maxIndex = Math.max(loadItemIndex, focusedItemIndex); if ((0, _type.isDefined)(shiftItemIndex)) { minIndex = Math.min(shiftItemIndex, minIndex); maxIndex = Math.max(shiftItemIndex, maxIndex) } const take = maxIndex - minIndex + 1; return { skip: minIndex, take: take, filter: filter, sort: sort } }, onSelectionChanged: this._updateSelectedItems.bind(this) } } _updateSelectColumn() { const columnsController = this._columnsController; const isSelectColumnVisible = this.isSelectColumnVisible(); columnsController.addCommandColumn({ type: "selection", command: "select", visible: isSelectColumnVisible, visibleIndex: -1, dataType: "boolean", alignment: "center", cssClass: "dx-command-select", width: "auto", cellTemplate: selectionCellTemplate, headerCellTemplate: selectionHeaderTemplate }); columnsController.columnOption("command:select", "visible", isSelectColumnVisible) } _createSelection() { const options = this._getSelectionConfig(); return new _m_selection.default(options) } _fireSelectionChanged(options) { const argument = this.option("selection.deferred") ? { selectionFilter: this.option("selectionFilter") } : { selectedRowKeys: this.option("selectedRowKeys") }; this.selectionChanged.fire(argument); if (options) { this.executeAction("onSelectionChanged", options) } } _updateCheckboxesState(options) { const { isDeferredMode: isDeferredMode } = options; const { selectionFilter: selectionFilter } = options; const { selectedItemKeys: selectedItemKeys } = options; const { removedItemKeys: removedItemKeys } = options; if ("onClick" === this.option(SHOW_CHECKBOXES_MODE)) { if (isDeferredMode ? selectionFilter && function(that, selectionFilter) { let keyIndex = 0; const store = that._dataController.store(); const key = store && store.key(); const isComplexKey = Array.isArray(key); if (!selectionFilter.length) { return false } if (isComplexKey && Array.isArray(selectionFilter[0]) && "and" === selectionFilter[1]) { for (let i = 0; i < selectionFilter.length; i++) { if (Array.isArray(selectionFilter[i])) { if (selectionFilter[i][0] !== key[keyIndex] || "=" !== selectionFilter[i][1]) { return true } keyIndex++ } } return false } return key !== selectionFilter[0] }(this, selectionFilter) : selectedItemKeys.length > 1) { this.startSelectionWithCheckboxes() } else if (isDeferredMode ? selectionFilter && !selectionFilter.length : 0 === selectedItemKeys.length && removedItemKeys.length) { this.stopSelectionWithCheckboxes() } } } _updateSelectedItems(args) { const that = this; let selectionChangedOptions; const isDeferredMode = that.option("selection.deferred"); const selectionFilter = that._selection.selectionFilter(); const dataController = that._dataController; const items = dataController.items(true); const visibleItems = dataController.items(); if (!items) { return } const isSelectionWithCheckboxes = that.isSelectionWithCheckboxes(); const changedItemIndexes = that.getChangedItemIndexes(items); const visibleChangedItemIndexes = that.getChangedItemIndexes(visibleItems); that._updateCheckboxesState({ selectedItemKeys: args.selectedItemKeys, removedItemKeys: args.removedItemKeys, selectionFilter: selectionFilter, isDeferredMode: isDeferredMode }); if (changedItemIndexes.length || isSelectionWithCheckboxes !== that.isSelectionWithCheckboxes()) { dataController.updateItems({ changeType: "updateSelection", itemIndexes: visibleChangedItemIndexes }) } if (isDeferredMode) { that.option("selectionFilter", selectionFilter); selectionChangedOptions = {} } else if (args.addedItemKeys.length || args.removedItemKeys.length) { that._selectedItemsInternalChange = true; that.option("selectedRowKeys", args.selectedItemKeys.slice(0)); that._selectedItemsInternalChange = false; selectionChangedOptions = { selectedRowsData: args.selectedItems.slice(0), selectedRowKeys: args.selectedItemKeys.slice(0), currentSelectedRowKeys: args.addedItemKeys.slice(0), currentDeselectedRowKeys: args.removedItemKeys.slice(0) } } that._fireSelectionChanged(selectionChangedOptions) } getChangedItemIndexes(items) { const that = this; const itemIndexes = []; const isDeferredSelection = this.option("selection.deferred"); for (let i = 0, { length: length } = items; i < length; i++) { const row = items[i]; const isItemSelected = that.isRowSelected(isDeferredSelection ? row.data : row.key); if (that._selection.isDataItem(row) && row.isSelected !== isItemSelected) { itemIndexes.push(i) } } return itemIndexes } callbackNames() { return ["selectionChanged"] } optionChanged(args) { var _this$_selection; super.optionChanged(args); const selectionOptionsExists = !!(null !== (_this$_selection = this._selection) && void 0 !== _this$_selection && _this$_selection.options); switch (args.name) { case "selection": { const oldSelectionMode = this._selectionMode; this.init(); if (selectionOptionsExists && "selection.sensitivity" === args.fullName) { this._selection.options.sensitivity = args.value } if ("selection.showCheckBoxesMode" !== args.fullName) { const selectionMode = this._selectionMode; let selectedRowKeys = this.option("selectedRowKeys"); if (oldSelectionMode !== selectionMode) { if ("single" === selectionMode) { if (selectedRowKeys.length > 1) { selectedRowKeys = [selectedRowKeys[0]] } } else if ("multiple" !== selectionMode) { selectedRowKeys = [] } } this.selectRows(selectedRowKeys).always((() => { this._fireSelectionChanged() })) } this._columnsController.updateColumns(); args.handled = true; break } case "selectionFilter": this._selection.selectionFilter(args.value); args.handled = true; break; case "selectedRowKeys": { const value = args.value || []; if (Array.isArray(value) && !this._selectedItemsInternalChange && (this.component.getDataSource() || !value.length)) { this.selectRows(value) } args.handled = true; break } } } publicMethods() { return ["selectRows", "deselectRows", "selectRowsByIndexes", "getSelectedRowKeys", "getSelectedRowsData", "clearSelection", "selectAll", "deselectAll", "startSelectionWithCheckboxes", "stopSelectionWithCheckboxes", "isRowSelected"] } isRowSelected(arg) { return this._selection.isItemSelected(arg) } isSelectColumnVisible() { return "multiple" === this.option("selection.mode") && ("always" === this.option(SHOW_CHECKBOXES_MODE) || "onClick" === this.option(SHOW_CHECKBOXES_MODE) || this._isSelectionWithCheckboxes) } _isOnePageSelectAll() { return "page" === this.option("selection.selectAllMode") } isSelectAll() { return this._selection.getSelectAllState(this._isOnePageSelectAll()) } selectAll() { if ("onClick" === this.option(SHOW_CHECKBOXES_MODE)) { this.startSelectionWithCheckboxes() } return this._selection.selectAll(this._isOnePageSelectAll()) } deselectAll() { return this._selection.deselectAll(this._isOnePageSelectAll()) } clearSelection() { return this.selectedItemKeys([]) } refresh() { const selectedRowKeys = this.option("selectedRowKeys") ?? []; if (!this.option("selection.deferred") && selectedRowKeys.length) { return this.selectedItemKeys(selectedRowKeys) } return (new _deferred.Deferred).resolve().promise() } selectedItemKeys(value, preserve, isDeselect, isSelectAll) { return this._selection.selectedItemKeys(value, preserve, isDeselect, isSelectAll) } getSelectedRowKeys(mode) { return this._selection.getSelectedItemKeys() } selectRows(keys, preserve) { return this.selectedItemKeys(keys, preserve) } deselectRows(keys) { return this.selectedItemKeys(keys, true, true) } selectRowsByIndexes(indexes) { const items = this._dataController.items(); const keys = []; if (!Array.isArray(indexes)) { indexes = Array.prototype.slice.call(arguments, 0) }(0, _iterator.each)(indexes, (function() { const item = items[this]; if (item && "data" === item.rowType) { keys.push(item.key) } })); return this.selectRows(keys) } getSelectedRowsData(mode) { return this._selection.getSelectedItems() } loadSelectedItemsWithFilter() { return this._selection.loadSelectedItemsWithFilter() } changeItemSelection(visibleItemIndex, keys, setFocusOnly) { keys = keys || {}; if (this.isSelectionWithCheckboxes()) { keys.control = true } const loadedItemIndex = visibleItemIndex + this._dataController.getRowIndexOffset() - this._dataController.getRowIndexOffset(true); return this._selection.changeItemSelection(loadedItemIndex, keys, setFocusOnly) } focusedItemIndex(itemIndex) { const that = this; if ((0, _type.isDefined)(itemIndex)) { that._selection._focusedItemIndex = itemIndex } else { return that._selection._focusedItemIndex } return } isSelectionWithCheckboxes() { return "multiple" === this.option("selection.mode") && ("always" === this.option(SHOW_CHECKBOXES_MODE) || this._isSelectionWithCheckboxes) } startSelectionWithCheckboxes() { const that = this; if ("multiple" === that.option("selection.mode") && !that.isSelectionWithCheckboxes()) { that._isSelectionWithCheckboxes = true; that._updateSelectColumn(); return true } return false } stopSelectionWithCheckboxes() { const that = this; if (that._isSelectionWithCheckboxes) { that._isSelectionWithCheckboxes = false; that._updateSelectColumn(); return true } return false } } exports.SelectionController = SelectionController; const dataSelectionExtenderMixin = Base => class extends Base { init() { const isDeferredMode = this.option("selection.deferred"); super.init.apply(this, arguments); if (isDeferredMode) { this._selectionController._updateCheckboxesState({ isDeferredMode: true, selectionFilter: this.option("selectionFilter") }) } } _loadDataSource() { const that = this; return super._loadDataSource().always((() => { that._selectionController.refresh() })) } _processDataItem(item, options) { const hasSelectColumn = this._selectionController.isSelectColumnVisible(); const isDeferredSelection = options.isDeferredSelection = void 0 === options.isDeferredSelection ? this.option("selection.deferred") : options.isDeferredSelection; const dataItem = super._processDataItem.apply(this, arguments); dataItem.isSelected = this._selectionController.isRowSelected(isDeferredSelection ? dataItem.data : dataItem.key); if (hasSelectColumn && dataItem.values) { for (let i = 0; i < options.visibleColumns.length; i++) { if ("select" === options.visibleColumns[i].command) { dataItem.values[i] = dataItem.isSelected; break } } } return dataItem } refresh(options) { const that = this; const d = new _deferred.Deferred; super.refresh.apply(this, arguments).done((() => { if (!options || options.selection) { that._selectionController.refresh().done(d.resolve).fail(d.reject) } else { d.resolve() } })).fail(d.reject); return d.promise() } _handleDataChanged(e) { const hasLoadOperation = this.hasLoadOperation(); super._handleDataChanged.apply(this, arguments); if (hasLoadOperation && !this._repaintChangesOnly) { this._selectionController.focusedItemIndex(-1) } } _applyChange(change) { if (change && "updateSelection" === change.changeType) { change.items.forEach(((item, index) => { const currentItem = this._items[index]; if (currentItem) { currentItem.isSelected = item.isSelected; currentItem.values = item.values } })); return } return super._applyChange.apply(this, arguments) } _endUpdateCore() { const changes = this._changes; const isUpdateSelection = changes.length > 1 && changes.every((change => "updateSelection" === change.changeType)); if (isUpdateSelection) { const itemIndexes = changes.map((change => change.itemIndexes || [])).reduce(((a, b) => a.concat(b))); this._changes = [{ changeType: "updateSelection", itemIndexes: itemIndexes }] } super._endUpdateCore.apply(this, arguments) } }; exports.dataSelectionExtenderMixin = dataSelectionExtenderMixin; const columnHeadersSelectionExtenderMixin = Base => class extends Base { init() { super.init(); this._selectionController.selectionChanged.add(this._updateSelectAllValue.bind(this)) } _updateSelectAllValue() { const that = this; const $element = that.element(); const $editor = $element && $element.find(".dx-select-checkbox"); if ($element && $editor.length && "multiple" === that.option("selection.mode")) { const selectAllValue = that._selectionController.isSelectAll(); const hasSelection = false !== selectAllValue; const isVisible = that.option("selection.allowSelectAll") ? !that._dataController.isEmpty() : hasSelection; $editor.dxCheckBox("instance").option({ visible: isVisible, value: selectAllValue }) } } _handleDataChanged(e) { super._handleDataChanged(e); if (!e || "refresh" === e.changeType || e.repaintChangesOnly && "update" === e.changeType) { this.waitAsyncTemplates().done((() => { this._updateSelectAllValue() })) } } _renderSelectAllCheckBox($container, column) { const that = this; const isEmptyData = that._dataController.isEmpty(); const groupElement = (0, _renderer.default)("
").appendTo($container).addClass("dx-select-checkbox"); that.setAria("label", _message.default.format("dxDataGrid-ariaSelectAll"), groupElement); that._editorFactoryController.createEditor(groupElement, (0, _extend.extend)({}, column, { parentType: "headerRow", dataType: "boolean", value: this._selectionController.isSelectAll(), editorOptions: { visible: !isEmptyData && (that.option("selection.allowSelectAll") || false !== this._selectionController.isSelectAll()) }, tabIndex: that.option("useLegacyKeyboardNavigation") ? -1 : that.option("tabIndex") || 0, setValue: (value, e) => { const allowSelectAll = that.option("selection.allowSelectAll"); e.component.option("visible", allowSelectAll || false !== e.component.option("value")); if (!e.event || this._selectionController.isSelectAll() === value) { return } if (e.value && !allowSelectAll) { e.component.option("value", false) } else { e.value ? this._selectionController.selectAll() : this._selectionController.deselectAll() } e.event.preventDefault() } })); return groupElement } _attachSelectAllCheckBoxClickEvent($element) { _events_engine.default.on($element, _click.name, this.createAction((e => { const { event: event } = e; if (!(0, _renderer.default)(event.target).closest(".dx-select-checkbox").length) { _events_engine.default.trigger((0, _renderer.default)(event.currentTarget).children(".dx-select-checkbox"), _click.name) } event.preventDefault() }))) } }; exports.columnHeadersSelectionExtenderMixin = columnHeadersSelectionExtenderMixin; const rowsViewSelectionExtenderMixin = Base => class extends Base { renderSelectCheckBoxContainer($container, options) { if ("data" === options.rowType && !options.row.isNewRow) { $container.addClass("dx-editor-cell"); this._attachCheckBoxClickEvent($container); this._renderSelectCheckBox($container, options) } else { _m_utils.default.setEmptyText($container) } } _renderSelectCheckBox(container, options) { const groupElement = (0, _renderer.default)("
").addClass("dx-select-checkbox").appendTo(container); this.setAria("label", _message.default.format("dxDataGrid-ariaSelectRow"), groupElement); this._editorFactoryController.createEditor(groupElement, (0, _extend.extend)({}, options.column, { parentType: "dataRow", dataType: "boolean", lookup: null, value: options.value, setValue(value, e) { var _e$event; if ("keydown" === (null === e || void 0 === e || null === (_e$event = e.event) || void 0 === _e$event ? void 0 : _e$event.type)) { _events_engine.default.trigger(e.element, _click.name, e) } }, row: options.row })); return groupElement } _attachCheckBoxClickEvent($element) { _events_engine.default.on($element, _click.name, this.createAction((function(e) { const { event: event } = e; const rowIndex = this.getRowIndex((0, _renderer.default)(event.currentTarget).closest(".dx-row")); if (rowIndex >= 0) { this._selectionController.startSelectionWithCheckboxes(); this._selectionController.changeItemSelection(rowIndex, { shift: event.shiftKey }); if ((0, _renderer.default)(event.target).closest(".dx-select-checkbox").length) { this._dataController.updateItems({ changeType: "updateSelection", itemIndexes: [rowIndex] }) } } }))) } _update(change) { const that = this; const tableElements = that.getTableElements(); if ("updateSelection" === change.changeType) { if (tableElements.length > 0) { (0, _iterator.each)(tableElements, ((_, tableElement) => { (0, _iterator.each)(change.itemIndexes || [], ((_, index) => { let $row; if (change.items[index]) { $row = that._getRowElements((0, _renderer.default)(tableElement)).eq(index); if ($row.length) { const { isSelected: isSelected } = change.items[index]; $row.toggleClass("dx-selection", void 0 === isSelected ? false : isSelected).find(".dx-select-checkbox").dxCheckBox("option", "value", isSelected); that.setAria("selected", isSelected, $row) } } })) })); that._updateCheckboxesClass() } } else { super._update(change) } } _createTable() { const that = this; const selectionMode = that.option("selection.mode"); const $table = super._createTable.apply(that, arguments); if ("none" !== selectionMode) { if ("onLongTap" === that.option(SHOW_CHECKBOXES_MODE) || !_support.touch) { _events_engine.default.on($table, (0, _index.addNamespace)(_hold.default.name, "dxDataGridRowsView"), ".dx-data-row", that.createAction((e => { processLongTap(that.component, e.event); e.event.stopPropagation() }))) } _events_engine.default.on($table, "mousedown selectstart", that.createAction((e => { const { event: event } = e; if (event.shiftKey) { event.preventDefault() } }))) } return $table } _createRow(row) { const $row = super._createRow.apply(this, arguments); if (row) { const { isSelected: isSelected } = row; if (isSelected) { $row.addClass("dx-selection") } const selectionMode = this.option("selection.mode"); if ("none" !== selectionMode) { this.setAria("selected", isSelected, $row) } } return $row } _rowClickForTreeList(e) { super._rowClick(e) } _rowClick(e) { const that = this; const dxEvent = e.event; const isSelectionDisabled = (0, _renderer.default)(dxEvent.target).closest(".dx-selection-disabled").length; if (!that.isClickableElement((0, _renderer.default)(dxEvent.target))) { if (!isSelectionDisabled && ("multiple" !== that.option("selection.mode") || "always" !== that.option(SHOW_CHECKBOXES_MODE))) { if (that._selectionController.changeItemSelection(e.rowIndex, { control: (0, _index.isCommandKeyPressed)(dxEvent), shift: dxEvent.shiftKey })) { dxEvent.preventDefault(); e.handled = true } } super._rowClick(e) } } isClickableElement($target) { const isCommandSelect = $target.closest(".dx-command-select").length; return !!isCommandSelect } _renderCore(change) { const deferred = super._renderCore(change); this._updateCheckboxesClass(); return deferred } _updateCheckboxesClass() { const tableElements = this.getTableElements(); const isCheckBoxesHidden = this._selectionController.isSelectColumnVisible() && !this._selectionController.isSelectionWithCheckboxes(); (0, _iterator.each)(tableElements, ((_, tableElement) => { (0, _renderer.default)(tableElement).toggleClass("dx-select-checkboxes-hidden", isCheckBoxesHidden) })) } }; exports.rowsViewSelectionExtenderMixin = rowsViewSelectionExtenderMixin; exports.selectionModule = { defaultOptions: () => ({ selection: { mode: "none", showCheckBoxesMode: "onClick", allowSelectAll: true, selectAllMode: "allPages", deferred: false, maxFilterLengthInRequest: 1500, alwaysSelectByShift: false }, selectionFilter: [], selectedRowKeys: [] }), controllers: { selection: SelectionController }, extenders: { controllers: { data: dataSelectionExtenderMixin, contextMenu: Base => class extends Base { _contextMenuPrepared(options) { const dxEvent = options.event; if (dxEvent.originalEvent && "dxhold" !== dxEvent.originalEvent.type || options.items && options.items.length > 0) { return } processLongTap(this, dxEvent) } } }, views: { columnHeadersView: columnHeadersSelectionExtenderMixin, rowsView: rowsViewSelectionExtenderMixin } } } }, 11590: /*!*********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/sorting/m_sorting.js ***! \*********************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.sortingModule = void 0; var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _click = __webpack_require__( /*! ../../../../events/click */ 95429); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../../events/core/events_engine */ 55994)); var _index = __webpack_require__( /*! ../../../../events/utils/index */ 39611); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109)); var _m_sorting_mixin = _interopRequireDefault(__webpack_require__( /*! ./m_sorting_mixin */ 62930)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } exports.sortingModule = { defaultOptions: () => ({ sorting: { mode: "single", ascendingText: _message.default.format("dxDataGrid-sortingAscendingText"), descendingText: _message.default.format("dxDataGrid-sortingDescendingText"), clearText: _message.default.format("dxDataGrid-sortingClearText"), showSortIndexes: true } }), extenders: { views: { columnHeadersView: Base => class extends((0, _m_sorting_mixin.default)(Base)) { optionChanged(args) { const that = this; if ("sorting" === args.name) { that._invalidate(); args.handled = true } else { super.optionChanged(args) } } _createRow(row) { const $row = super._createRow(row); if ("header" === row.rowType) { _events_engine.default.on($row, (0, _index.addNamespace)(_click.name, "dxDataGridColumnHeadersView"), "td", this.createAction((e => { this._processHeaderAction(e.event, $row) }))) } return $row } _processHeaderAction(event, $row) { if ((0, _renderer.default)(event.currentTarget).parent().get(0) !== $row.get(0)) { return } const that = this; let keyName = null; const $cellElementFromEvent = (0, _renderer.default)(event.currentTarget); const rowIndex = $cellElementFromEvent.parent().index(); let columnIndex = -1; [].slice.call(that.getCellElements(rowIndex)).some((($cellElement, index) => { if ($cellElement === $cellElementFromEvent.get(0)) { columnIndex = index; return true } return })); const visibleColumns = that._columnsController.getVisibleColumns(rowIndex); const column = visibleColumns[columnIndex]; const editingController = that.getController("editing"); const editingMode = that.option("editing.mode"); const isCellEditing = editingController && editingController.isEditing() && ("batch" === editingMode || "cell" === editingMode); if (isCellEditing || !that._isSortableElement((0, _renderer.default)(event.target))) { return } if (column && !(0, _type.isDefined)(column.groupIndex) && !column.command) { if (event.shiftKey) { keyName = "shift" } else if ((0, _index.isCommandKeyPressed)(event)) { keyName = "ctrl" } setTimeout((() => { that._columnsController.changeSortOrder(column.index, keyName) })) } } _renderCellContent($cell, options) { const that = this; const { column: column } = options; if (!column.command && "header" === options.rowType) { that._applyColumnState({ name: "sort", rootElement: $cell, column: column, showColumnLines: that.option("showColumnLines") }) } super._renderCellContent.apply(this, arguments) } _columnOptionChanged(e) { const { changeTypes: changeTypes } = e; if (1 === changeTypes.length && changeTypes.sorting) { this._updateIndicators("sort"); return } super._columnOptionChanged(e) } }, headerPanel: Base => class extends((0, _m_sorting_mixin.default)(Base)) { optionChanged(args) { const that = this; if ("sorting" === args.name) { that._invalidate(); args.handled = true } else { super.optionChanged(args) } } _createGroupPanelItem($rootElement, groupColumn) { const that = this; const $item = super._createGroupPanelItem(...arguments); _events_engine.default.on($item, (0, _index.addNamespace)(_click.name, "dxDataGridHeaderPanel"), that.createAction((() => { that._processGroupItemAction(groupColumn.index) }))); that._applyColumnState({ name: "sort", rootElement: $item, column: { alignment: that.option("rtlEnabled") ? "right" : "left", allowSorting: groupColumn.allowSorting, sortOrder: "desc" === groupColumn.sortOrder ? "desc" : "asc", isGrouped: true }, showColumnLines: true }); return $item } _processGroupItemAction(groupColumnIndex) { setTimeout((() => this.getController("columns").changeSortOrder(groupColumnIndex))) } } } } } }, 62930: /*!***************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/sorting/m_sorting_mixin.js ***! \***************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } exports.default = Base => class extends Base { _applyColumnState(options) { const that = this; let ariaSortState; let $sortIndicator; const sortingMode = that.option("sorting.mode"); const { rootElement: rootElement } = options; const { column: column } = options; const $indicatorsContainer = that._getIndicatorContainer(rootElement); if ("sort" === options.name) { rootElement.find(".dx-sort").remove(); !$indicatorsContainer.children().length && $indicatorsContainer.remove(); const isSortingAllowed = "none" !== sortingMode && column.allowSorting; const hasSeveralSortIndexes = that.getController && !!that.getController("columns").columnOption("sortIndex:1"); if (!(0, _type.isDefined)(column.groupIndex) && (isSortingAllowed || (0, _type.isDefined)(column.sortOrder))) { ariaSortState = "asc" === column.sortOrder ? "ascending" : "descending"; $sortIndicator = super._applyColumnState(options).toggleClass("dx-sort-up", "asc" === column.sortOrder).toggleClass("dx-sort-down", "desc" === column.sortOrder); if (hasSeveralSortIndexes && that.option("sorting.showSortIndexes") && column.sortIndex >= 0) { (0, _renderer.default)("").addClass("dx-sort-index-icon").text(column.sortIndex + 1).appendTo($sortIndicator); $sortIndicator.addClass("dx-sort-index") } if (isSortingAllowed) { options.rootElement.addClass(that.addWidgetPrefix("action")) } } this._setAriaSortAttribute(column, ariaSortState, rootElement, hasSeveralSortIndexes); return $sortIndicator } return super._applyColumnState(options) } _setAriaSortAttribute(column, ariaSortState, $rootElement, hasSeveralSortIndexes) { $rootElement.removeAttr("aria-roledescription"); if (column.isGrouped) { let description = this.localize("dxDataGrid-ariaNotSortedColumn"); if ((0, _type.isDefined)(column.sortOrder)) { description = "asc" === column.sortOrder ? this.localize("dxDataGrid-ariaSortedAscendingColumn") : this.localize("dxDataGrid-ariaSortedDescendingColumn") } this.setAria("roledescription", description, $rootElement) } else if (!(0, _type.isDefined)(column.sortOrder)) { this.setAria("sort", "none", $rootElement) } else { this.setAria("sort", ariaSortState, $rootElement); if (hasSeveralSortIndexes && column.sortIndex >= 0) { const ariaColumnHeader = _message.default.format("dxDataGrid-ariaColumnHeader"); const ariaSortIndex = _message.default.format("dxDataGrid-ariaSortIndex", column.sortIndex + 1); const description = `${ariaColumnHeader}, ${ariaSortIndex}`; this.setAria("roledescription", description, $rootElement) } } } _getIndicatorClassName(name) { if ("sort" === name) { return "dx-sort" } if ("sortIndex" === name) { return "dx-sort-index-icon" } return super._getIndicatorClassName(name) } _renderIndicator(options) { const { column: column } = options; const $container = options.container; const $indicator = options.indicator; if ("sort" === options.name) { const rtlEnabled = this.option("rtlEnabled"); if (!(0, _type.isDefined)(column.sortOrder)) { $indicator && $indicator.addClass("dx-sort-none") } if ($container.children().length && (!rtlEnabled && "left" === options.columnAlignment || rtlEnabled && "right" === options.columnAlignment)) { $container.prepend($indicator); return } } super._renderIndicator(options) } _updateIndicator($cell, column, indicatorName) { if ("sort" === indicatorName && (0, _type.isDefined)(column.groupIndex)) { return } return super._updateIndicator.apply(this, arguments) } _getIndicatorElements($cell, returnAll) { const $indicatorElements = super._getIndicatorElements($cell); return returnAll ? $indicatorElements : $indicatorElements && $indicatorElements.not(".dx-sort-none") } } }, 12440: /*!*********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/state_storing/m_state_storing.js ***! \*********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.stateStoringModule = void 0; var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _m_state_storing_core = __webpack_require__( /*! ./m_state_storing_core */ 84651); const processLoadState = that => { const columnsController = that.getController("columns"); const selectionController = that.getController("selection"); const exportController = that.getController("export"); const dataController = that.getController("data"); if (columnsController) { columnsController.columnsChanged.add((() => { that.updateState({ columns: columnsController.getUserState() }) })) } if (selectionController) { selectionController.selectionChanged.add((e => { that.updateState({ selectedRowKeys: e.selectedRowKeys, selectionFilter: e.selectionFilter }) })) } if (dataController) { that._initialPageSize = that.option("paging.pageSize"); that._initialFilterValue = that.option("filterValue"); dataController.changed.add((() => { const state = (that => { const pagerView = that.getView("pagerView"); const dataController = that.getController("data"); const state = { allowedPageSizes: pagerView ? pagerView.getPageSizes() : void 0, filterPanel: { filterEnabled: that.option("filterPanel.filterEnabled") }, filterValue: that.option("filterValue"), focusedRowKey: that.option("focusedRowEnabled") ? that.option("focusedRowKey") : void 0 }; return (0, _extend.extend)(state, dataController.getUserState()) })(that); that.updateState(state) })) } if (exportController) { exportController.selectionOnlyChanged.add((() => { that.updateState({ exportSelectionOnly: exportController.selectionOnly() }) })) } }; exports.stateStoringModule = { defaultOptions: () => ({ stateStoring: { enabled: false, storageKey: null, type: "localStorage", customLoad: null, customSave: null, savingTimeout: 2e3 } }), controllers: { stateStoring: _m_state_storing_core.StateStoringController }, extenders: { views: { rowsView: Base => class extends Base { init() { super.init(); this._dataController.stateLoaded.add((() => { if (this._dataController.isLoaded() && !this._dataController.getDataSource()) { this.setLoading(false); this.renderNoDataText(); const columnHeadersView = this.component.getView("columnHeadersView"); columnHeadersView && columnHeadersView.render(); this.component._fireContentReadyAction() } })) } } }, controllers: { stateStoring: Base => class extends Base { init() { super.init.apply(this, arguments); processLoadState(this); return this } isLoading() { return super.isLoading() || this.getDataController().isStateLoading() } state(state) { const result = super.state.apply(this, arguments); if (void 0 !== state) { this.applyState((0, _extend.extend)(true, {}, state)) } return result } updateState(state) { if (this.isEnabled()) { const oldState = this.state(); const newState = (0, _extend.extend)({}, oldState, state); const oldStateHash = (0, _common.getKeyHash)(oldState); const newStateHash = (0, _common.getKeyHash)(newState); if (!(0, _common.equalByValue)(oldStateHash, newStateHash)) { state = (0, _extend.extend)(true, {}, state); (0, _extend.extend)(this._state, state); this.save() } } else { (0, _extend.extend)(this._state, state) } } applyState(state) { var _this$getView; const { allowedPageSizes: allowedPageSizes } = state; const { searchText: searchText } = state; const { selectedRowKeys: selectedRowKeys } = state; const { selectionFilter: selectionFilter } = state; const scrollingMode = this.option("scrolling.mode"); const isVirtualScrollingMode = "virtual" === scrollingMode || "infinite" === scrollingMode; const showPageSizeSelector = true === this.option("pager.visible") && this.option("pager.showPageSizeSelector"); const hasHeight = null === (_this$getView = this.getView("rowsView")) || void 0 === _this$getView ? void 0 : _this$getView.hasHeight(); this.component.beginUpdate(); if (this.getColumnsController()) { this.getColumnsController().setUserState(state.columns) } if (this.getExportController()) { this.getExportController().selectionOnly(state.exportSelectionOnly) } if (!this.option("selection.deferred")) { this.option("selectedRowKeys", selectedRowKeys || []) } this.option("selectionFilter", selectionFilter); if (allowedPageSizes && "auto" === this.option("pager.allowedPageSizes")) { this.option("pager").allowedPageSizes = allowedPageSizes } if (this.option("focusedRowEnabled")) { this.option("focusedRowIndex", -1); this.option("focusedRowKey", state.focusedRowKey || null) } this.component.endUpdate(); this.option("searchPanel.text", searchText || ""); this.option("filterValue", ((that, state) => { const filterSyncController = that.getController("filterSync"); const columnsController = that.getController("columns"); const hasFilterState = state.columns || void 0 !== state.filterValue; if (filterSyncController) { if (hasFilterState) { return state.filterValue || filterSyncController.getFilterValueFromColumns(state.columns) } return that._initialFilterValue || filterSyncController.getFilterValueFromColumns(columnsController.getColumns()) } return null })(this, state)); this.option("filterPanel.filterEnabled", state.filterPanel ? state.filterPanel.filterEnabled : true); this.option("paging.pageIndex", (!isVirtualScrollingMode || hasHeight) && state.pageIndex || 0); this.option("paging.pageSize", (!isVirtualScrollingMode || showPageSizeSelector) && (0, _type.isDefined)(state.pageSize) ? state.pageSize : this._initialPageSize); this.getDataController() && this.getDataController().reset() } }, columns: Base => class extends Base { _shouldReturnVisibleColumns() { const result = super._shouldReturnVisibleColumns.apply(this, arguments); return result && (!this._stateStoringController.isEnabled() || this._stateStoringController.isLoaded()) } }, data: Base => class extends Base { dispose() { clearTimeout(this._restoreStateTimeoutID); super.dispose() } callbackNames() { return super.callbackNames().concat(["stateLoaded"]) } _refreshDataSource() { if (this._stateStoringController.isEnabled() && !this._stateStoringController.isLoaded()) { clearTimeout(this._restoreStateTimeoutID); const deferred = new _deferred.Deferred; this._restoreStateTimeoutID = setTimeout((() => { this._stateStoringController.load().always((() => { this._restoreStateTimeoutID = null })).done((() => { super._refreshDataSource(); this.stateLoaded.fire(); deferred.resolve() })).fail((error => { this.stateLoaded.fire(); this._handleLoadError(error || "Unknown error"); deferred.reject() })) })); return deferred.promise() } if (!this.isStateLoading()) { super._refreshDataSource() } } isLoading() { return super.isLoading() || this._stateStoringController.isLoading() } isStateLoading() { return (0, _type.isDefined)(this._restoreStateTimeoutID) } isLoaded() { return super.isLoaded() && !this.isStateLoading() } }, selection: Base => class extends Base { _fireSelectionChanged(options) { const isDeferredSelection = this.option("selection.deferred"); if (this._stateStoringController.isLoading() && isDeferredSelection) { return } super._fireSelectionChanged.apply(this, arguments) } } } } } }, 84651: /*!**************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/state_storing/m_state_storing_core.js ***! \**************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.StateStoringController = void 0; var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _storage = __webpack_require__( /*! ../../../../core/utils/storage */ 36613); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _window = __webpack_require__( /*! ../../../../core/utils/window */ 58201); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../../events/core/events_engine */ 55994)); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/widget/ui.errors */ 96688)); var _m_modules = _interopRequireDefault(__webpack_require__( /*! ../m_modules */ 15943)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const DATE_REGEX = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/; const parseDates = function(state) { if (!state) { return }(0, _iterator.each)(state, ((key, value) => { if ((0, _type.isPlainObject)(value) || Array.isArray(value)) { parseDates(value) } else if ("string" === typeof value) { const date = DATE_REGEX.exec(value); if (date) { state[key] = new Date(Date.UTC(+date[1], +date[2] - 1, +date[3], +date[4], +date[5], +date[6])) } } })) }; const getStorage = function(options) { const storage = "sessionStorage" === options.type ? (0, _storage.sessionStorage)() : (0, _window.getWindow)().localStorage; if (!storage) { throw new Error("E1007") } return storage }; const getUniqueStorageKey = function(options) { return (0, _type.isDefined)(options.storageKey) ? options.storageKey : "storage" }; class StateStoringController extends _m_modules.default.ViewController { getDataController() { return this.getController("data") } getExportController() { return this.getController("export") } getColumnsController() { return this.getController("columns") } init() { this._state = {}; this._isLoaded = false; this._isLoading = false; this._windowUnloadHandler = () => { if (void 0 !== this._savingTimeoutID) { this._saveState(this.state()) } }; _events_engine.default.on((0, _window.getWindow)(), "visibilitychange", this._windowUnloadHandler); return this } optionChanged(args) { const that = this; if ("stateStoring" === args.name) { if (that.isEnabled() && !that.isLoading()) { that.load() } args.handled = true } else { super.optionChanged(args) } } dispose() { clearTimeout(this._savingTimeoutID); _events_engine.default.off((0, _window.getWindow)(), "visibilitychange", this._windowUnloadHandler) } _loadState() { const options = this.option("stateStoring"); if ("custom" === options.type) { return options.customLoad && options.customLoad() } try { return JSON.parse(getStorage(options).getItem(getUniqueStorageKey(options))) } catch (e) { _ui.default.log("W1022", "State storing", e.message) } } _saveState(state) { const options = this.option("stateStoring"); if ("custom" === options.type) { options.customSave && options.customSave(state); return } try { getStorage(options).setItem(getUniqueStorageKey(options), JSON.stringify(state)) } catch (e) { _ui.default.log(e.message) } } publicMethods() { return ["state"] } isEnabled() { return this.option("stateStoring.enabled") } isLoaded() { return this._isLoaded } isLoading() { return this._isLoading } load() { this._isLoading = true; const loadResult = (0, _deferred.fromPromise)(this._loadState()); loadResult.always((() => { this._isLoaded = true; this._isLoading = false })).done((state => { if (null !== state && !(0, _type.isEmptyObject)(state)) { this.state(state) } })); return loadResult } state(state) { const that = this; if (!arguments.length) { return (0, _extend.extend)(true, {}, that._state) } that._state = (0, _extend.extend)({}, state); parseDates(that._state) } save() { const that = this; clearTimeout(that._savingTimeoutID); that._savingTimeoutID = setTimeout((() => { that._saveState(that.state()); that._savingTimeoutID = void 0 }), that.option("stateStoring.savingTimeout")) } } exports.StateStoringController = StateStoringController; exports.default = { StateStoringController: StateStoringController } }, 39830: /*!***************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/validating/m_validating.js ***! \***************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.validatingRowsViewExtender = exports.validatingModule = exports.validatingEditorFactoryExtender = exports.validatingEditingExtender = exports.validatingDataControllerExtender = exports.ValidatingController = void 0; var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _browser = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/browser */ 47810)); var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _size = __webpack_require__( /*! ../../../../core/utils/size */ 58664); var _string = __webpack_require__( /*! ../../../../core/utils/string */ 68752); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _array_utils = __webpack_require__( /*! ../../../../data/array_utils */ 60637); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../../events/core/events_engine */ 55994)); var _pointer = _interopRequireDefault(__webpack_require__( /*! ../../../../events/pointer */ 93786)); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109)); var _button = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/button */ 63008)); var _load_indicator = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/load_indicator */ 2492)); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/overlay/ui.overlay */ 89799)); var _themes = __webpack_require__( /*! ../../../../ui/themes */ 75811); var _validation_engine = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/validation_engine */ 90964)); var _validator = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/validator */ 39562)); var _selectors = __webpack_require__( /*! ../../../../ui/widget/selectors */ 31421); var _ui2 = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/widget/ui.errors */ 96688)); var _const = __webpack_require__( /*! ../editing/const */ 72313); var _m_modules = _interopRequireDefault(__webpack_require__( /*! ../m_modules */ 15943)); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../m_utils */ 60082)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const EDIT_MODE_ROW = "row"; const EDIT_MODE_BATCH = "batch"; const EDIT_MODE_CELL = "cell"; const FORM_BASED_MODES = ["popup", "form"]; const VALIDATION_STATUS_valid = "valid", VALIDATION_STATUS_invalid = "invalid", VALIDATION_STATUS_pending = "pending"; const validationResultIsValid = function(result) { return (0, _type.isDefined)(result) && "cancel" !== result }; const cellValueShouldBeValidated = function(value, rowOptions) { return void 0 !== value || void 0 === value && rowOptions && !rowOptions.isNewRow }; class ValidatingController extends _m_modules.default.Controller { constructor() { super(...arguments); this._isValidationInProgress = false; this._disableApplyValidationResults = false } init() { this._editingController = this.getController("editing"); this._editorFactoryController = this.getController("editorFactory"); this._columnsController = this.getController("columns"); this.createAction("onRowValidating"); if (!this._validationState) { this.initValidationState() } } initValidationState() { this._validationState = []; this._validationStateCache = {} } _rowIsValidated(change) { const validationData = this._getValidationData(null === change || void 0 === change ? void 0 : change.key); return !!validationData && !!validationData.validated } _getValidationData(key, create) { const keyHash = (0, _common.getKeyHash)(key); const isObjectKeyHash = (0, _type.isObject)(keyHash); let validationData; if (isObjectKeyHash) { validationData = this._validationState.filter((data => (0, _common.equalByValue)(data.key, key)))[0] } else { validationData = this._validationStateCache[keyHash] } if (!validationData && create) { validationData = { key: key, isValid: true }; this._validationState.push(validationData); if (!isObjectKeyHash) { this._validationStateCache[keyHash] = validationData } } return validationData } _getBrokenRules(validationData, validationResults) { let brokenRules; if (validationResults) { brokenRules = validationResults.brokenRules || validationResults.brokenRule && [validationResults.brokenRule] } else { brokenRules = validationData.brokenRules || [] } return brokenRules } _rowValidating(validationData, validationResults) { const deferred = new _deferred.Deferred; const change = this._editingController.getChangeByKey(null === validationData || void 0 === validationData ? void 0 : validationData.key); const brokenRules = this._getBrokenRules(validationData, validationResults); const isValid = validationResults ? validationResults.isValid : validationData.isValid; const parameters = { brokenRules: brokenRules, isValid: isValid, key: change.key, newData: change.data, oldData: this._editingController._getOldData(change.key), promise: null, errorText: this.getHiddenValidatorsErrorText(brokenRules) }; this.executeAction("onRowValidating", parameters); (0, _deferred.when)((0, _deferred.fromPromise)(parameters.promise)).always((() => { validationData.isValid = parameters.isValid; validationData.errorText = parameters.errorText; deferred.resolve(parameters) })); return deferred.promise() } getHiddenValidatorsErrorText(brokenRules) { const brokenRulesMessages = []; (0, _iterator.each)(brokenRules, ((_, brokenRule) => { const { column: column } = brokenRule; const isGroupExpandColumn = column && void 0 !== column.groupIndex && !column.showWhenGrouped; const isVisibleColumn = column && column.visible; if (!brokenRule.validator.$element().parent().length && (!isVisibleColumn || isGroupExpandColumn)) { brokenRulesMessages.push(brokenRule.message) } })); return brokenRulesMessages.join(", ") } validate(isFull) { let isValid = true; const editingController = this._editingController; const deferred = new _deferred.Deferred; const completeList = []; const editMode = editingController.getEditMode(); isFull = isFull || editMode === EDIT_MODE_ROW; if (this._isValidationInProgress) { return deferred.resolve(false).promise() } this._isValidationInProgress = true; if (isFull) { editingController.addDeferred(deferred); const changes = editingController.getChanges(); (0, _iterator.each)(changes, ((index, _ref) => { let { type: type, key: key } = _ref; if ("remove" !== type) { const validationData = this._getValidationData(key, true); const validationResult = this.validateGroup(validationData); completeList.push(validationResult); validationResult.done((validationResult => { validationData.validated = true; isValid = isValid && validationResult.isValid })) } })) } else if (this._currentCellValidator) { const validationResult = this.validateGroup(this._currentCellValidator._findGroup()); completeList.push(validationResult); validationResult.done((validationResult => { isValid = validationResult.isValid })) }(0, _deferred.when)(...completeList).done((() => { this._isValidationInProgress = false; deferred.resolve(isValid) })); return deferred.promise() } validateGroup(validationData) { var _validationResult; const result = new _deferred.Deferred; const validateGroup = validationData && _validation_engine.default.getGroupConfig(validationData); let validationResult; if (null !== validateGroup && void 0 !== validateGroup && validateGroup.validators.length) { this.resetRowValidationResults(validationData); validationResult = _validation_engine.default.validateGroup(validationData) }(0, _deferred.when)((null === (_validationResult = validationResult) || void 0 === _validationResult ? void 0 : _validationResult.complete) || validationResult).done((validationResult => { (0, _deferred.when)(this._rowValidating(validationData, validationResult)).done(result.resolve) })); return result.promise() } isRowDataModified(change) { return !(0, _type.isEmptyObject)(change.data) } updateValidationState(change) { const editMode = this._editingController.getEditMode(); const { key: key } = change; const validationData = this._getValidationData(key, true); if (!FORM_BASED_MODES.includes(editMode)) { if ("insert" === change.type && !this.isRowDataModified(change)) { validationData.isValid = true; return } this.setDisableApplyValidationResults(true); const groupConfig = _validation_engine.default.getGroupConfig(validationData); if (groupConfig) { const validationResult = _validation_engine.default.validateGroup(validationData); (0, _deferred.when)(validationResult.complete || validationResult).done((validationResult => { validationData.isValid = validationResult.isValid; validationData.brokenRules = validationResult.brokenRules })) } else if (!validationData.brokenRules || !validationData.brokenRules.length) { validationData.isValid = true } this.setDisableApplyValidationResults(false) } else { validationData.isValid = true } } setValidator(validator) { this._currentCellValidator = validator } renderCellPendingIndicator($container) { let $indicator = $container.find(".dx-pending-indicator"); if (!$indicator.length) { const $indicatorContainer = $container; $indicator = (0, _renderer.default)("
").appendTo($indicatorContainer).addClass("dx-pending-indicator"); this._createComponent($indicator, _load_indicator.default); $container.addClass("dx-validation-pending") } } disposeCellPendingIndicator($container) { const $indicator = $container.find(".dx-pending-indicator"); if ($indicator.length) { const indicator = _load_indicator.default.getInstance($indicator); if (indicator) { indicator.dispose(); indicator.$element().remove() } $container.removeClass("dx-validation-pending") } } validationStatusChanged(result) { const { validator: validator } = result; const validationGroup = validator.option("validationGroup"); const { column: column } = validator.option("dataGetter")(); this.updateCellValidationResult({ rowKey: validationGroup.key, columnIndex: column.index, validationResult: result }) } validatorInitialized(arg) { arg.component.on("validating", this.validationStatusChanged.bind(this)); arg.component.on("validated", this.validationStatusChanged.bind(this)) } validatorDisposing(arg) { const validator = arg.component; const validationGroup = validator.option("validationGroup"); const { column: column } = validator.option("dataGetter")(); const result = this.getCellValidationResult({ rowKey: null === validationGroup || void 0 === validationGroup ? void 0 : validationGroup.key, columnIndex: column.index }); if (validationResultIsValid(result) && result.status === VALIDATION_STATUS_pending) { this.cancelCellValidationResult({ change: validationGroup, columnIndex: column.index }) } } applyValidationResult($container, result) { const { validator: validator } = result; const validationGroup = validator.option("validationGroup"); const { column: column } = validator.option("dataGetter")(); result.brokenRules && result.brokenRules.forEach((rule => { rule.columnIndex = column.index; rule.column = column })); if ($container) { const validationResult = this.getCellValidationResult({ rowKey: validationGroup.key, columnIndex: column.index }); const requestIsDisabled = validationResultIsValid(validationResult) && validationResult.disabledPendingId === result.id; if (this._disableApplyValidationResults || requestIsDisabled) { return } if (result.status === VALIDATION_STATUS_invalid) { const $focus = $container.find(":focus"); if (!(0, _selectors.focused)($focus)) { _events_engine.default.trigger($focus, "focus"); _events_engine.default.trigger($focus, _pointer.default.down) } } const editor = !column.editCellTemplate && this._editorFactoryController.getEditorInstance($container); if (result.status === VALIDATION_STATUS_pending) { if (editor) { editor.option("validationStatus", VALIDATION_STATUS_pending) } else { this.renderCellPendingIndicator($container) } } else if (editor) { editor.option("validationStatus", VALIDATION_STATUS_valid) } else { this.disposeCellPendingIndicator($container) } $container.toggleClass(this.addWidgetPrefix("invalid"), result.status === VALIDATION_STATUS_invalid) } } _syncInternalEditingData(parameters) { var _parameters$row; const editingController = this._editingController; const change = editingController.getChangeByKey(parameters.key); const oldDataFromState = editingController._getOldData(parameters.key); const oldData = null === (_parameters$row = parameters.row) || void 0 === _parameters$row ? void 0 : _parameters$row.oldData; if (change && oldData && !oldDataFromState) { editingController._addInternalData({ key: parameters.key, oldData: oldData }) } } createValidator(parameters, $container) { const editingController = this._editingController; const { column: column } = parameters; let { showEditorAlways: showEditorAlways } = column; if ((0, _type.isDefined)(column.command) || !column.validationRules || !Array.isArray(column.validationRules) || !column.validationRules.length) { return } const editIndex = editingController.getIndexByKey(parameters.key, editingController.getChanges()); let needCreateValidator = editIndex > -1; if (!needCreateValidator) { if (!showEditorAlways) { var _this$_columnsControl; const visibleColumns = (null === (_this$_columnsControl = this._columnsController) || void 0 === _this$_columnsControl ? void 0 : _this$_columnsControl.getVisibleColumns()) || []; showEditorAlways = visibleColumns.some((column => column.showEditorAlways)) } const isEditRow = (0, _common.equalByValue)(this.option("editing.editRowKey"), parameters.key); const isCellOrBatchEditingAllowed = editingController.isCellOrBatchEditMode() && editingController.allowUpdating({ row: parameters.row }); needCreateValidator = isEditRow || isCellOrBatchEditingAllowed && showEditorAlways; if (isCellOrBatchEditingAllowed && showEditorAlways) { var _parameters$row2; editingController._addInternalData({ key: parameters.key, oldData: (null === (_parameters$row2 = parameters.row) || void 0 === _parameters$row2 ? void 0 : _parameters$row2.oldData) ?? parameters.data }) } } if (needCreateValidator) { if ($container && !$container.length) { _ui2.default.log("E1050"); return } this._syncInternalEditingData(parameters); const validationData = this._getValidationData(parameters.key, true); const getValue = () => { const change = editingController.getChangeByKey(null === validationData || void 0 === validationData ? void 0 : validationData.key); const value = column.calculateCellValue((null === change || void 0 === change ? void 0 : change.data) || {}); return void 0 !== value ? value : parameters.value }; const useDefaultValidator = $container && $container.hasClass("dx-widget"); $container && $container.addClass(this.addWidgetPrefix("validator")); const validator = new _validator.default($container || (0, _renderer.default)("
"), { name: column.caption, validationRules: (0, _extend.extend)(true, [], column.validationRules), validationGroup: validationData, adapter: useDefaultValidator ? null : { getValue: getValue, applyValidationResults: result => { this.applyValidationResult($container, result) } }, dataGetter() { const key = null === validationData || void 0 === validationData ? void 0 : validationData.key; const change = editingController.getChangeByKey(key); const oldData = editingController._getOldData(key); return { data: (0, _array_utils.createObjectWithChanges)(oldData, null === change || void 0 === change ? void 0 : change.data), column: column } }, onInitialized: this.validatorInitialized.bind(this), onDisposing: this.validatorDisposing.bind(this) }); if (useDefaultValidator) { const adapter = validator.option("adapter"); if (adapter) { const originBypass = adapter.bypass; const defaultAdapterBypass = () => parameters.row.isNewRow && !this._isValidationInProgress && !editingController.isCellModified(parameters); adapter.getValue = getValue; adapter.validationRequestsCallbacks = []; adapter.bypass = () => originBypass.call(adapter) || defaultAdapterBypass() } } return validator } return } setDisableApplyValidationResults(flag) { this._disableApplyValidationResults = flag } getDisableApplyValidationResults() { return this._disableApplyValidationResults } isCurrentValidatorProcessing(_ref2) { let { rowKey: rowKey, columnIndex: columnIndex } = _ref2; return this._currentCellValidator && (0, _common.equalByValue)(this._currentCellValidator.option("validationGroup").key, rowKey) && this._currentCellValidator.option("dataGetter")().column.index === columnIndex } validateCell(validator) { const cellParams = { rowKey: validator.option("validationGroup").key, columnIndex: validator.option("dataGetter")().column.index, validationResult: null }; let validationResult = this.getCellValidationResult(cellParams); const stateRestored = validationResultIsValid(validationResult); const adapter = validator.option("adapter"); if (!stateRestored) { validationResult = validator.validate() } else { const currentCellValue = adapter.getValue(); if (!(0, _common.equalByValue)(currentCellValue, validationResult.value)) { validationResult = validator.validate() } } const deferred = new _deferred.Deferred; if (stateRestored && validationResult.status === VALIDATION_STATUS_pending) { this.updateCellValidationResult(cellParams); adapter.applyValidationResults(validationResult) }(0, _deferred.when)(validationResult.complete || validationResult).done((validationResult => { stateRestored && adapter.applyValidationResults(validationResult); deferred.resolve(validationResult) })); return deferred.promise() } updateCellValidationResult(_ref3) { let { rowKey: rowKey, columnIndex: columnIndex, validationResult: validationResult } = _ref3; const validationData = this._getValidationData(rowKey); if (!validationData) { return } if (!validationData.validationResults) { validationData.validationResults = {} } let result; if (validationResult) { result = (0, _extend.extend)({}, validationResult); validationData.validationResults[columnIndex] = result; if (validationResult.status === VALIDATION_STATUS_pending) { if (this._editingController.getEditMode() === EDIT_MODE_CELL) { result.deferred = new _deferred.Deferred; result.complete.always((() => { result.deferred.resolve() })); this._editingController.addDeferred(result.deferred) } if (this._disableApplyValidationResults) { result.disabledPendingId = validationResult.id; return } } } else { result = validationData.validationResults[columnIndex] } if (result && result.disabledPendingId) { delete result.disabledPendingId } } getCellValidationResult(_ref4) { var _validationData$valid; let { rowKey: rowKey, columnIndex: columnIndex } = _ref4; const validationData = this._getValidationData(rowKey, true); return null === validationData || void 0 === validationData || null === (_validationData$valid = validationData.validationResults) || void 0 === _validationData$valid ? void 0 : _validationData$valid[columnIndex] } removeCellValidationResult(_ref5) { let { change: change, columnIndex: columnIndex } = _ref5; const validationData = this._getValidationData(null === change || void 0 === change ? void 0 : change.key); if (validationData && validationData.validationResults) { this.cancelCellValidationResult({ change: change, columnIndex: columnIndex }); delete validationData.validationResults[columnIndex] } } cancelCellValidationResult(_ref6) { let { change: change, columnIndex: columnIndex } = _ref6; const validationData = this._getValidationData(change.key); if (change && validationData.validationResults) { const result = validationData.validationResults[columnIndex]; if (result) { result.deferred && result.deferred.reject("cancel"); validationData.validationResults[columnIndex] = "cancel" } } } resetRowValidationResults(validationData) { if (validationData) { validationData.validationResults && delete validationData.validationResults; delete validationData.validated } } isInvalidCell(_ref7) { let { rowKey: rowKey, columnIndex: columnIndex } = _ref7; const result = this.getCellValidationResult({ rowKey: rowKey, columnIndex: columnIndex }); return validationResultIsValid(result) && result.status === VALIDATION_STATUS_invalid } getCellValidator(_ref8) { let { rowKey: rowKey, columnIndex: columnIndex } = _ref8; const validationData = this._getValidationData(rowKey); const groupConfig = validationData && _validation_engine.default.getGroupConfig(validationData); const validators = groupConfig && groupConfig.validators; return validators && validators.filter((v => { const { column: column } = v.option("dataGetter")(); return column ? column.index === columnIndex : false }))[0] } setCellValidationStatus(cellOptions) { const validationResult = this.getCellValidationResult({ rowKey: cellOptions.key, columnIndex: cellOptions.column.index }); if ((0, _type.isDefined)(validationResult)) { cellOptions.validationStatus = "cancel" !== validationResult ? validationResult.status : "cancel" } else { delete cellOptions.validationStatus } } } exports.ValidatingController = ValidatingController; const validatingEditingExtender = Base => class extends Base { processDataItemTreeListHack(item) { super.processDataItem.apply(this, arguments) } processItemsTreeListHack(items, e) { return super.processItems.apply(this, arguments) } _addChange(changeParams) { const change = super._addChange.apply(this, arguments); if (change && "remove" !== changeParams.type) { this._validatingController.updateValidationState(change) } return change } _handleChangesChange(args) { super._handleChangesChange.apply(this, arguments); args.value.forEach((change => { if (void 0 === this._validatingController._getValidationData(change.key)) { this._validatingController.updateValidationState(change) } })) } _updateRowAndPageIndices() { const that = this; const startInsertIndex = that.getView("rowsView").getTopVisibleItemIndex(); let rowIndex = startInsertIndex; (0, _iterator.each)(that.getChanges(), ((_, _ref9) => { let { key: key, type: type } = _ref9; const validationData = this._validatingController._getValidationData(key); if (validationData && !validationData.isValid && validationData.pageIndex !== that._pageIndex) { validationData.pageIndex = that._pageIndex; if ("insert" === type) { validationData.rowIndex = startInsertIndex } else { validationData.rowIndex = rowIndex } rowIndex++ } })) } _getValidationGroupsInForm(detailOptions) { const validationData = this._validatingController._getValidationData(detailOptions.key, true); return { validationGroup: validationData } } _validateEditFormAfterUpdate(row, isCustomSetCellValue) { if (isCustomSetCellValue && this._editForm) { this._editForm.validate() } super._validateEditFormAfterUpdate.apply(this, arguments) } _prepareEditCell(params) { const isNotCanceled = super._prepareEditCell.apply(this, arguments); if (isNotCanceled && params.column.showEditorAlways) { this._validatingController.updateValidationState({ key: params.key }) } return isNotCanceled } processItems(items, changeType) { const changes = this.getChanges(); const getIndexByChange = (change, items) => { let index = -1; const isInsert = "insert" === change.type; const { key: key } = change; (0, _iterator.each)(items, ((i, item) => { if ((0, _common.equalByValue)(key, isInsert ? item.key : this._dataController.keyOf(item))) { index = i; return false } return })); return index }; items = super.processItems(items, changeType); const itemsCount = items.length; if (this.getEditMode() === EDIT_MODE_BATCH && "prepend" !== changeType && "append" !== changeType) { changes.forEach((change => { const { key: key } = change; const validationData = this._validatingController._getValidationData(key); if (validationData && change.type && validationData.pageIndex === this._pageIndex && (null === change || void 0 === change ? void 0 : change.pageIndex) !== this._pageIndex) { ! function(change, validationData) { const data = { key: change.key }; const index = getIndexByChange(change, items); if (index >= 0) { return } validationData.rowIndex = validationData.rowIndex > itemsCount ? validationData.rowIndex % itemsCount : validationData.rowIndex; const { rowIndex: rowIndex } = validationData; data.__DX_INSERT_INDEX__ = 1; items.splice(rowIndex, 0, data) }(change, validationData) } })) } return items } processDataItem(item) { const isInserted = item.data.__DX_INSERT_INDEX__; const key = isInserted ? item.data.key : item.key; const editMode = this.getEditMode(); if (editMode === EDIT_MODE_BATCH && isInserted && key) { const changes = this.getChanges(); const editIndex = _m_utils.default.getIndexByKey(key, changes); if (editIndex >= 0) { const change = changes[editIndex]; if ("insert" !== change.type) { const oldData = this._getOldData(change.key); item.data = (0, _extend.extend)(true, {}, oldData, change.data); item.key = key } } } super.processDataItem.apply(this, arguments) } _createInvisibleColumnValidators(changes) { const that = this; const columns = this._columnsController.getColumns(); const invisibleColumns = this._columnsController.getInvisibleColumns().filter((column => !column.isBand)); const groupColumns = this._columnsController.getGroupColumns().filter((column => !column.showWhenGrouped && -1 === invisibleColumns.indexOf(column))); const invisibleColumnValidators = []; const isCellVisible = (column, rowKey) => this._dataController.getRowIndexByKey(rowKey) >= 0 && invisibleColumns.indexOf(column) < 0; invisibleColumns.push(...groupColumns); if (!FORM_BASED_MODES.includes(this.getEditMode())) { (0, _iterator.each)(columns, ((_, column) => { changes.forEach((change => { let data; if (isCellVisible(column, change.key)) { return } if ("insert" === change.type) { data = change.data } else if ("update" === change.type) { const oldData = that._getOldData(change.key); if (!(0, _type.isDefined)(oldData)) { return } data = (0, _array_utils.createObjectWithChanges)(oldData, change.data) } if (data) { const validator = this._validatingController.createValidator({ column: column, key: change.key, value: column.calculateCellValue(data) }); if (validator) { invisibleColumnValidators.push(validator) } } })) })) } return function() { invisibleColumnValidators.forEach((validator => { validator.dispose() })) } } _beforeSaveEditData(change, editIndex) { let result = super._beforeSaveEditData.apply(this, arguments); const validationData = this._validatingController._getValidationData(null === change || void 0 === change ? void 0 : change.key); if (change) { const isValid = "remove" === change.type || validationData.isValid; result = result || !isValid } else { const disposeValidators = this._createInvisibleColumnValidators(this.getChanges()); result = new _deferred.Deferred; this.executeOperation(result, (() => { this._validatingController.validate(true).done((isFullValid => { disposeValidators(); this._updateRowAndPageIndices(); switch (this.getEditMode()) { case EDIT_MODE_CELL: if (!isFullValid) { this._focusEditingCell() } break; case EDIT_MODE_BATCH: if (!isFullValid) { this._resetEditRowKey(); this._resetEditColumnName(); this._dataController.updateItems() } } result.resolve(!isFullValid) })) })) } return result.promise ? result.promise() : result } _beforeEditCell(rowIndex, columnIndex, item) { const result = super._beforeEditCell(rowIndex, columnIndex, item); if (this.getEditMode() === EDIT_MODE_CELL) { const $cell = this._rowsView._getCellElement(rowIndex, columnIndex); const validator = $cell && $cell.data("dxValidator"); const rowOptions = $cell && $cell.closest(".dx-row").data("options"); const value = validator && validator.option("adapter").getValue(); if (validator && cellValueShouldBeValidated(value, rowOptions)) { const deferred = new _deferred.Deferred; (0, _deferred.when)(this._validatingController.validateCell(validator), result).done(((validationResult, result) => { deferred.resolve(validationResult.status === VALIDATION_STATUS_valid && result) })); return deferred.promise() } if (!validator) { return result } } return false } _afterSaveEditData(cancel) { let $firstErrorRow; const isCellEditMode = this.getEditMode() === EDIT_MODE_CELL; (0, _iterator.each)(this.getChanges(), ((_, change) => { const $errorRow = this._showErrorRow(change); $firstErrorRow = $firstErrorRow || $errorRow })); if ($firstErrorRow) { const scrollable = this._rowsView.getScrollable(); if (scrollable) { scrollable.update(); scrollable.scrollToElement($firstErrorRow) } } if (cancel && isCellEditMode && this._needUpdateRow()) { const editRowIndex = this.getEditRowIndex(); this._dataController.updateItems({ changeType: "update", rowIndices: [editRowIndex] }); this._focusEditingCell() } else if (!cancel) { let shouldResetValidationState = true; if (isCellEditMode) { const columns = this._columnsController.getColumns(); const columnsWithValidatingEditors = columns.filter((col => { var _col$validationRules; return col.showEditorAlways && (null === (_col$validationRules = col.validationRules) || void 0 === _col$validationRules ? void 0 : _col$validationRules.length) > 0 })).length > 0; shouldResetValidationState = !columnsWithValidatingEditors } if (shouldResetValidationState) { this._validatingController.initValidationState() } } } _handleDataChanged(args) { const validationState = this._validatingController._validationState; if ("standard" === this.option("scrolling.mode")) { this.resetRowAndPageIndices() } if ("prepend" === args.changeType) { (0, _iterator.each)(validationState, ((_, validationData) => { validationData.rowIndex += args.items.length })) } super._handleDataChanged(args) } resetRowAndPageIndices() { const validationState = this._validatingController._validationState; (0, _iterator.each)(validationState, ((_, validationData) => { if (validationData.pageIndex !== this._pageIndex) { delete validationData.pageIndex; delete validationData.rowIndex } })) } _beforeCancelEditData() { this._validatingController.initValidationState(); super._beforeCancelEditData() } _showErrorRow(change) { let $popupContent; const items = this._dataController.items(); const rowIndex = this.getIndexByKey(change.key, items); const validationData = this._validatingController._getValidationData(change.key); if (!(null !== validationData && void 0 !== validationData && validationData.isValid) && null !== validationData && void 0 !== validationData && validationData.errorText && rowIndex >= 0) { $popupContent = this.getPopupContent(); return this._errorHandlingController && this._errorHandlingController.renderErrorRow(null === validationData || void 0 === validationData ? void 0 : validationData.errorText, rowIndex, $popupContent) } } updateFieldValue(e) { const deferred = new _deferred.Deferred; this._validatingController.removeCellValidationResult({ change: this.getChangeByKey(e.key), columnIndex: e.column.index }); super.updateFieldValue.apply(this, arguments).done((() => { const currentValidator = this._validatingController.getCellValidator({ rowKey: e.key, columnIndex: e.column.index }); (0, _deferred.when)(currentValidator && this._validatingController.validateCell(currentValidator)).done((validationResult => { this._editorFactoryController.refocus(); deferred.resolve(validationResult) })) })); return deferred.promise() } highlightDataCell($cell, parameters) { super.highlightDataCell.apply(this, arguments); this._validatingController.setCellValidationStatus(parameters); const isEditableCell = !!parameters.setValue; const cellModified = this.isCellModified(parameters); const isValidated = (0, _type.isDefined)(parameters.validationStatus); const needValidation = cellModified && parameters.column.setCellValue || isEditableCell && !cellModified && !(parameters.row.isNewRow || !isValidated); if (needValidation) { const validator = $cell.data("dxValidator"); if (validator) { (0, _deferred.when)(this._validatingController.validateCell(validator)).done((() => { this._validatingController.setCellValidationStatus(parameters) })) } } } getChangeByKey(key) { const changes = this.getChanges(); return changes[_m_utils.default.getIndexByKey(key, changes)] } isCellModified(parameters) { const cellModified = super.isCellModified(parameters); const change = this.getChangeByKey(parameters.key); const isCellInvalid = !!parameters.row && this._validatingController.isInvalidCell({ rowKey: parameters.key, columnIndex: parameters.column.index }); return cellModified || this._validatingController._rowIsValidated(change) && isCellInvalid } }; exports.validatingEditingExtender = validatingEditingExtender; const validatingEditorFactoryExtender = Base => class extends Base { _showRevertButton($container) { var _this$_revertTooltip, _$tooltipElement2; let $tooltipElement = null === (_this$_revertTooltip = this._revertTooltip) || void 0 === _this$_revertTooltip ? void 0 : _this$_revertTooltip.$element(); if (!$container || !$container.length) { var _$tooltipElement; null === (_$tooltipElement = $tooltipElement) || void 0 === _$tooltipElement || _$tooltipElement.remove(); this._revertTooltip = void 0; return } if ($container.find($tooltipElement).length) { return } const $overlayContainer = $container.closest(`.${this.addWidgetPrefix("content")}`).parent(); const revertTooltipClass = this.addWidgetPrefix("revert-tooltip"); null === (_$tooltipElement2 = $tooltipElement) || void 0 === _$tooltipElement2 || _$tooltipElement2.remove(); $tooltipElement = (0, _renderer.default)("
").addClass(revertTooltipClass).appendTo($container); const tooltipOptions = { animation: null, visible: true, width: "auto", height: "auto", shading: false, container: $overlayContainer, propagateOutsideClick: true, hideOnOutsideClick: false, wrapperAttr: { class: revertTooltipClass }, contentTemplate: () => { const $buttonElement = (0, _renderer.default)("
").addClass("dx-revert-button"); const buttonOptions = { icon: "revert", hint: this.option("editing.texts.validationCancelChanges"), elementAttr: { id: "dxRevertButton", "aria-label": _message.default.format("dxDataGrid-ariaRevertButton") }, onClick: () => { this._editingController.cancelEditData() } }; return new _button.default($buttonElement, buttonOptions).$element() }, position: { my: "left top", at: "right top", offset: "1 0", collision: "flip", boundaryOffset: "0 0", boundary: this._rowsView.element(), of: $container }, onPositioned: this._positionedHandler.bind(this) }; this._revertTooltip = new _ui.default($tooltipElement, tooltipOptions) } _hideFixedGroupCell($cell, overlayOptions) { let $nextFixedRowElement; let $groupCellElement; const isFixedColumns = this._rowsView.isFixedColumns(); const isFormOrPopupEditMode = this._editingController.isFormOrPopupEditMode(); if (isFixedColumns && !isFormOrPopupEditMode) { const nextRowOptions = $cell.closest(".dx-row").next().data("options"); if (nextRowOptions && "group" === nextRowOptions.rowType) { $nextFixedRowElement = (0, _renderer.default)(this._rowsView.getRowElement(nextRowOptions.rowIndex)).last(); $groupCellElement = $nextFixedRowElement.find(".dx-group-cell"); if ($groupCellElement.length && "hidden" !== $groupCellElement.get(0).style.visibility) { $groupCellElement.css("visibility", "hidden"); overlayOptions.onDisposing = function() { $groupCellElement.css("visibility", "") } } } } } _positionedHandler(e, isOverlayVisible) { if (!e.component.__skipPositionProcessing) { const isRevertButton = (0, _renderer.default)(e.element).hasClass(this.addWidgetPrefix("revert-tooltip")); const needRepaint = !isRevertButton && this._rowsView.updateFreeSpaceRowHeight(); const normalizedPosition = this._normalizeValidationMessagePositionAndMaxWidth(e, isRevertButton, isOverlayVisible); e.component.__skipPositionProcessing = !!(needRepaint || normalizedPosition); if (normalizedPosition) { e.component.option(normalizedPosition) } else if (needRepaint) { e.component.repaint() } } } _showValidationMessage($cell, messages, alignment) { var _this$_columnsControl2; const editorPopup = $cell.find(".dx-dropdowneditor-overlay").data("dxPopup"); const isOverlayVisible = editorPopup && editorPopup.option("visible"); const myPosition = isOverlayVisible ? "top right" : `top ${alignment}`; const atPosition = isOverlayVisible ? "top left" : `bottom ${alignment}`; const hasFixedColumns = (null === (_this$_columnsControl2 = this._columnsController.getFixedColumns()) || void 0 === _this$_columnsControl2 ? void 0 : _this$_columnsControl2.length) > 0; const $overlayContainer = hasFixedColumns ? this.getView("rowsView").element() : $cell.closest(`.${this.addWidgetPrefix("content")}`); let errorMessageText = ""; messages && messages.forEach((message => { errorMessageText += (errorMessageText.length ? "
" : "") + (0, _string.encodeHtml)(message) })); const invalidMessageClass = this.addWidgetPrefix("invalid-message"); this._rowsView.element().find(`.${invalidMessageClass}`).remove(); const $overlayElement = (0, _renderer.default)("
").addClass("dx-invalid-message").addClass("dx-invalid-message-always").addClass(invalidMessageClass).html(errorMessageText).appendTo($cell); const overlayOptions = { container: $overlayContainer, shading: false, width: "auto", height: "auto", visible: true, animation: false, propagateOutsideClick: true, hideOnOutsideClick: false, wrapperAttr: { id: "dxInvalidMessage", class: `dx-invalid-message dx-invalid-message-always ${invalidMessageClass}` }, position: { collision: "flip", boundary: this._rowsView.element(), boundaryOffset: "0 0", offset: { x: 0, y: !isOverlayVisible && _browser.default.mozilla ? -1 : 0 }, my: myPosition, at: atPosition, of: $cell }, onPositioned: e => { this._positionedHandler(e, isOverlayVisible); this._shiftValidationMessageIfNeed(e.component.$content(), $cell) } }; this._hideFixedGroupCell($cell, overlayOptions); new _ui.default($overlayElement, overlayOptions) } _hideValidationMessage() { var _this$_rowsView$eleme; const validationMessages = null === (_this$_rowsView$eleme = this._rowsView.element()) || void 0 === _this$_rowsView$eleme ? void 0 : _this$_rowsView$eleme.find(this._getValidationMessagesSelector()); null === validationMessages || void 0 === validationMessages || validationMessages.remove() } _normalizeValidationMessagePositionAndMaxWidth(options, isRevertButton, isOverlayVisible) { const fixedColumns = this._columnsController.getFixedColumns(); if (!fixedColumns || !fixedColumns.length) { return } let position; const visibleTableWidth = !isRevertButton && function(that, element) { const rowIndex = (0, _renderer.default)(element).closest("tr").index(); const $cellElements = (0, _renderer.default)(that._rowsView.getRowElement(rowIndex)).first().children().filter(":not(.dx-hidden-cell)"); return that._rowsView._getWidths($cellElements).reduce(((w1, w2) => w1 + w2), 0) }(this, options.element); const $overlayContentElement = options.component.$content(); const validationMessageWidth = (0, _size.getOuterWidth)($overlayContentElement, true); const needMaxWidth = !isRevertButton && validationMessageWidth > visibleTableWidth; const columnIndex = this._rowsView.getCellIndex((0, _renderer.default)(options.element).closest("td")); const boundaryNonFixedColumnsInfo = function(fixedColumns) { let firstNonFixedColumnIndex; let lastNonFixedColumnIndex; fixedColumns.some(((column, index) => { if ("transparent" === column.command) { firstNonFixedColumnIndex = 0 === index ? -1 : index; lastNonFixedColumnIndex = index === fixedColumns.length - 1 ? -1 : index + column.colspan - 1; return true } return })); return { startColumnIndex: firstNonFixedColumnIndex, endColumnIndex: lastNonFixedColumnIndex } }(fixedColumns); if (!isRevertButton && (columnIndex === boundaryNonFixedColumnsInfo.startColumnIndex || needMaxWidth)) { position = { collision: "none flip", my: "top left", at: isOverlayVisible ? "top right" : "bottom left" } } else if (columnIndex === boundaryNonFixedColumnsInfo.endColumnIndex) { position = { collision: "none flip", my: "top right", at: isRevertButton || isOverlayVisible ? "top left" : "bottom right" }; if (isRevertButton) { position.offset = "-1 0" } } return position && { position: position, maxWidth: needMaxWidth ? visibleTableWidth - 2 : void 0 } } _shiftValidationMessageIfNeed($content, $cell) { const $revertContent = this._revertTooltip && this._revertTooltip.$content(); if (!$revertContent) { return } const contentOffset = $content.offset(); const revertContentOffset = $revertContent.offset(); if (contentOffset.top === revertContentOffset.top && contentOffset.left + (0, _size.getWidth)($content) > revertContentOffset.left) { const left = (0, _size.getWidth)($revertContent) + 2; $content.css("left", revertContentOffset.left < $cell.offset().left ? -left : left) } } _getRevertTooltipsSelector() { const revertTooltipClass = this.addWidgetPrefix("revert-tooltip"); return `.dx-editor-cell .${revertTooltipClass}` } _getValidationMessagesSelector() { const invalidMessageClass = this.addWidgetPrefix("invalid-message"); return `.dx-editor-cell .${invalidMessageClass}, .dx-cell-modified .${invalidMessageClass}` } loseFocus(skipValidator) { if (!skipValidator) { this._validatingController.setValidator(null) } super.loseFocus() } updateCellState($element, validationResult, isHideBorder) { var _change$data; const $focus = null === $element || void 0 === $element ? void 0 : $element.closest(this._getFocusCellSelector()); const $cell = null !== $focus && void 0 !== $focus && $focus.is("td") ? $focus : null; const rowOptions = null === $focus || void 0 === $focus ? void 0 : $focus.closest(".dx-row").data("options"); const change = rowOptions ? this._editingController.getChangeByKey(rowOptions.key) : null; const column = $cell && this._columnsController.getVisibleColumns()[$cell.index()]; const isCellModified = void 0 !== (null === change || void 0 === change || null === (_change$data = change.data) || void 0 === _change$data ? void 0 : _change$data[null === column || void 0 === column ? void 0 : column.name]) && !this._editingController.isSaving(); const validationDescriptionValues = []; if (this._editingController.getEditMode() === EDIT_MODE_CELL) { if ((null === validationResult || void 0 === validationResult ? void 0 : validationResult.status) === VALIDATION_STATUS_invalid || isCellModified) { this._showRevertButton($focus); validationDescriptionValues.push("dxRevertButton") } else { this._revertTooltip && this._revertTooltip.$element().remove() } } const showValidationMessage = validationResult && validationResult.status === VALIDATION_STATUS_invalid; if (showValidationMessage && $cell && column && validationResult && validationResult.brokenRules) { const errorMessages = []; validationResult.brokenRules.forEach((rule => { if (rule.message) { errorMessages.push(rule.message) } })); if (errorMessages.length) { this._showValidationMessage($focus, errorMessages, column.alignment || "left"); validationDescriptionValues.push("dxInvalidMessage") } } this._updateAriaValidationAttributes($focus, validationDescriptionValues); !isHideBorder && this._rowsView.element() && this._rowsView.updateFreeSpaceRowHeight() } _updateAriaValidationAttributes($focus, inputDescriptionValues) { if (0 === inputDescriptionValues.length) { return } const editMode = this._editingController.getEditMode(); const shouldSetValidationAriaAttributes = [EDIT_MODE_CELL, EDIT_MODE_BATCH, EDIT_MODE_ROW].includes(editMode); if (shouldSetValidationAriaAttributes) { const $focusElement = this._getCurrentFocusElement($focus); $focusElement.attr("aria-labelledby", inputDescriptionValues.join(" ")); $focusElement.attr("aria-invalid", true) } } _getCurrentFocusElement($focus) { if (this._editingController.isEditing()) { return $focus.find(_const.EDITORS_INPUT_SELECTOR).first() } return $focus } focus($element, isHideBorder) { if (!arguments.length) { return super.focus() } this._hideValidationMessage(); if (null !== $element && void 0 !== $element && $element.hasClass("dx-row") || null !== $element && void 0 !== $element && $element.hasClass("dx-master-detail-cell")) { return super.focus($element, isHideBorder) } const $focus = null === $element || void 0 === $element ? void 0 : $element.closest(this._getFocusCellSelector()); const validator = $focus && ($focus.data("dxValidator") || $element.find(`.${this.addWidgetPrefix("validator")}`).eq(0).data("dxValidator")); const rowOptions = $focus && $focus.closest(".dx-row").data("options"); const change = rowOptions ? this._editingController.getChangeByKey(rowOptions.key) : null; let validationResult; if (validator) { this._validatingController.setValidator(validator); const value = validator.option("adapter").getValue(); if (cellValueShouldBeValidated(value, rowOptions) || this._validatingController._rowIsValidated(change)) { this._editingController.waitForDeferredOperations().done((() => { const isDetached = !this._rowsView.isElementInside($element); if (isDetached) { return }(0, _deferred.when)(this._validatingController.validateCell(validator)).done((result => { validationResult = result; const { column: column } = validationResult.validator.option("dataGetter")(); if (change && column && !this._validatingController.isCurrentValidatorProcessing({ rowKey: change.key, columnIndex: column.index })) { return } if (!(0, _themes.isFluent)((0, _themes.current)()) && validationResult.status === VALIDATION_STATUS_invalid) { isHideBorder = true } this.updateCellState($element, validationResult, isHideBorder); super.focus.call(this, $element, isHideBorder) })) })); return super.focus($element, isHideBorder) } } this.updateCellState($element, validationResult, isHideBorder); return super.focus($element, isHideBorder) } getEditorInstance($container) { const $editor = $container.find(".dx-texteditor").eq(0); return _m_utils.default.getWidgetInstance($editor) } }; exports.validatingEditorFactoryExtender = validatingEditorFactoryExtender; const validatingDataControllerExtender = Base => class extends Base { _getValidationStatus(validationResult) { const validationStatus = validationResultIsValid(validationResult) ? validationResult.status : validationResult; return validationStatus || VALIDATION_STATUS_valid } _isCellChanged(oldRow, newRow, visibleRowIndex, columnIndex, isLiveUpdate) { var _oldRow$cells, _cell$column$validati; const cell = null === (_oldRow$cells = oldRow.cells) || void 0 === _oldRow$cells ? void 0 : _oldRow$cells[columnIndex]; const oldValidationStatus = this._getValidationStatus({ status: null === cell || void 0 === cell ? void 0 : cell.validationStatus }); const validationResult = this._validatingController.getCellValidationResult({ rowKey: oldRow.key, columnIndex: columnIndex }); const validationData = this._validatingController._getValidationData(oldRow.key); const newValidationStatus = this._getValidationStatus(validationResult); const rowIsModified = JSON.stringify(newRow.modifiedValues) !== JSON.stringify(oldRow.modifiedValues); const validationStatusChanged = oldValidationStatus !== newValidationStatus && rowIsModified; const cellIsMarkedAsInvalid = (0, _renderer.default)(null === cell || void 0 === cell ? void 0 : cell.cellElement).hasClass(this.addWidgetPrefix("invalid")); const hasValidationRules = null === cell || void 0 === cell || null === (_cell$column$validati = cell.column.validationRules) || void 0 === _cell$column$validati ? void 0 : _cell$column$validati.length; const rowEditStateChanged = oldRow.isEditing !== newRow.isEditing && hasValidationRules; const cellValidationStateChanged = validationStatusChanged || validationData.isValid && cellIsMarkedAsInvalid; if (rowEditStateChanged || cellValidationStateChanged) { return true } return super._isCellChanged.apply(this, arguments) } }; exports.validatingDataControllerExtender = validatingDataControllerExtender; const validatingRowsViewExtender = Base => class extends Base { updateFreeSpaceRowHeight($table) { const that = this; let $rowElements; let $freeSpaceRowElement; let $freeSpaceRowElements; const $element = that.element(); const $tooltipContent = $element && $element.find(`.${that.addWidgetPrefix("invalid-message")} .dx-overlay-content`); super.updateFreeSpaceRowHeight($table); if ($tooltipContent && $tooltipContent.length) { $rowElements = that._getRowElements(); $freeSpaceRowElements = that._getFreeSpaceRowElements($table); $freeSpaceRowElement = $freeSpaceRowElements.first(); if ($freeSpaceRowElement && 1 === $rowElements.length && (!$freeSpaceRowElement.is(":visible") || (0, _size.getOuterHeight)($tooltipContent) > (0, _size.getOuterHeight)($freeSpaceRowElement))) { $freeSpaceRowElements.show(); (0, _size.setHeight)($freeSpaceRowElements, (0, _size.getOuterHeight)($tooltipContent)); return true } } return } _formItemPrepared(cellOptions, $container) { super._formItemPrepared.apply(this, arguments); (0, _common.deferUpdate)((() => { const $editor = $container.find(".dx-widget").first(); const isEditorDisposed = $editor.length && !$editor.children().length; if (!isEditorDisposed) { this._validatingController.createValidator(cellOptions, $editor) } })) } _cellPrepared($cell, parameters) { if (!this._editingController.isFormOrPopupEditMode()) { this._validatingController.createValidator(parameters, $cell) } super._cellPrepared.apply(this, arguments) } _restoreErrorRow(contentTable) { this._editingController && this._editingController.hasChanges() && this._getRowElements(contentTable).each(((_, item) => { const rowOptions = (0, _renderer.default)(item).data("options"); if (rowOptions) { const change = this._editingController.getChangeByKey(rowOptions.key); change && this._editingController._showErrorRow(change) } })) } }; exports.validatingRowsViewExtender = validatingRowsViewExtender; exports.validatingModule = { defaultOptions: () => ({ editing: { texts: { validationCancelChanges: _message.default.format("dxDataGrid-validationCancelChanges") } } }), controllers: { validating: ValidatingController }, extenders: { controllers: { editing: validatingEditingExtender, editorFactory: validatingEditorFactoryExtender, data: validatingDataControllerExtender }, views: { rowsView: validatingRowsViewExtender } } } }, 79163: /*!*****************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/views/a11y_status_container_component.js ***! \*****************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.A11yStatusContainerComponent = void 0; var _renderer = (obj = __webpack_require__( /*! ../../../../core/renderer */ 68374), obj && obj.__esModule ? obj : { default: obj }); var obj; const CLASSES_container = "dx-gridbase-a11y-status-container"; exports.A11yStatusContainerComponent = _ref => { let { statusText: statusText } = _ref; return (0, _renderer.default)("
").text(statusText ?? "").addClass(CLASSES_container).attr("role", "status") } }, 57318: /*!************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/views/m_columns_view.js ***! \************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeWidth = exports.ColumnsView = void 0; var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../../core/dom_adapter */ 73349)); var _element = __webpack_require__( /*! ../../../../core/element */ 6415); var _element_data = __webpack_require__( /*! ../../../../core/element_data */ 97906); var _guid = _interopRequireDefault(__webpack_require__( /*! ../../../../core/guid */ 73176)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _browser = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/browser */ 47810)); var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var iteratorUtils = function(e, r) { if (!r && e && e.__esModule) { return e } if (null === e || "object" != typeof e && "function" != typeof e) { return { default: e } } var t = _getRequireWildcardCache(r); if (t && t.has(e)) { return t.get(e) } var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u] } } return n.default = e, t && t.set(e, n), n }(__webpack_require__( /*! ../../../../core/utils/iterator */ 95479)); var _position = __webpack_require__( /*! ../../../../core/utils/position */ 37518); var _size = __webpack_require__( /*! ../../../../core/utils/size */ 58664); var _style = __webpack_require__( /*! ../../../../core/utils/style */ 80968); var _support = __webpack_require__( /*! ../../../../core/utils/support */ 60137); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _window = __webpack_require__( /*! ../../../../core/utils/window */ 58201); var _click = __webpack_require__( /*! ../../../../events/click */ 95429); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../../events/core/events_engine */ 55994)); var _double_click = __webpack_require__( /*! ../../../../events/double_click */ 85272); var _pointer = _interopRequireDefault(__webpack_require__( /*! ../../../../events/pointer */ 93786)); var _remove = __webpack_require__( /*! ../../../../events/remove */ 29007); var _m_column_state_mixin = __webpack_require__( /*! ../../../grids/grid_core/column_state_mixin/m_column_state_mixin */ 51255); var _m_modules = _interopRequireDefault(__webpack_require__( /*! ../m_modules */ 15943)); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../m_utils */ 60082)); function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) { return null } var r = new WeakMap, t = new WeakMap; return (_getRequireWildcardCache = function(e) { return e ? t : r })(e) } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const appendElementTemplate = { render(options) { options.container.append(options.content) } }; const getWidthStyle = function(width) { if ("auto" === width) { return "" } return (0, _type.isNumeric)(width) ? `${width}px` : width }; const setCellWidth = function(cell, column, width) { cell.style.width = cell.style.maxWidth = "auto" === column.width ? "" : width }; const removeHandler = function(templateDeferred) { templateDeferred.resolve() }; const normalizeWidth = width => { if ("number" === typeof width) { return `${width.toFixed(3)}px` } if ("adaptiveHidden" === width) { return "0.0001px" } return width }; exports.normalizeWidth = normalizeWidth; class ColumnsView extends((0, _m_column_state_mixin.ColumnStateMixin)(_m_modules.default.View)) { init() { this._scrollLeft = -1; this._columnsController = this.getController("columns"); this._dataController = this.getController("data"); this._adaptiveColumnsController = this.getController("adaptiveColumns"); this._columnChooserController = this.getController("columnChooser"); this._editorFactoryController = this.getController("editorFactory"); this._selectionController = this.getController("selection"); this._columnChooserView = this.getView("columnChooserView"); this._delayedTemplates = []; this._templateDeferreds = new Set; this._templatesCache = {}; this._templateTimeouts = new Set; this.createAction("onCellClick"); this.createAction("onRowClick"); this.createAction("onCellDblClick"); this.createAction("onRowDblClick"); this.createAction("onCellHoverChanged", { excludeValidators: ["disabled", "readOnly"] }); this.createAction("onCellPrepared", { excludeValidators: ["disabled", "readOnly"], category: "rendering" }); this.createAction("onRowPrepared", { excludeValidators: ["disabled", "readOnly"], category: "rendering", afterExecute: e => { this._afterRowPrepared(e) } }); this._columnsController.columnsChanged.add(this._columnOptionChanged.bind(this)); this._dataController && this._dataController.changed.add(this._handleDataChanged.bind(this)) } dispose() { if ((0, _window.hasWindow)()) { var _this$_templateTimeou, _this$_templateTimeou2; const window = (0, _window.getWindow)(); null === (_this$_templateTimeou = this._templateTimeouts) || void 0 === _this$_templateTimeou || _this$_templateTimeou.forEach((templateTimeout => window.clearTimeout(templateTimeout))); null === (_this$_templateTimeou2 = this._templateTimeouts) || void 0 === _this$_templateTimeou2 || _this$_templateTimeou2.clear() } } optionChanged(args) { super.optionChanged(args); switch (args.name) { case "cellHintEnabled": case "onCellPrepared": case "onRowPrepared": case "onCellHoverChanged": this._invalidate(true, true); args.handled = true; break; case "keyboardNavigation": if ("keyboardNavigation.enabled" === args.fullName) { this._invalidate(true, true) } args.handled = true } } _createScrollableOptions() { const scrollingOptions = this.option("scrolling"); let useNativeScrolling = this.option("scrolling.useNative"); const options = (0, _extend.extend)({}, scrollingOptions, { direction: "both", bounceEnabled: false, useKeyboard: false }); if (void 0 === useNativeScrolling) { useNativeScrolling = true } if ("auto" === useNativeScrolling) { delete options.useNative; delete options.useSimulatedScrollbar } else { options.useNative = !!useNativeScrolling; options.useSimulatedScrollbar = !useNativeScrolling } return options } _updateCell($cell, parameters) { if (parameters.rowType) { this._cellPrepared($cell, parameters) } } _needToSetCellWidths() { return this.option("columnAutoWidth") } _createCell(options) { const { column: column } = options; const alignment = column.alignment || (0, _position.getDefaultAlignment)(this.option("rtlEnabled")); const needToSetCellWidths = this._needToSetCellWidths(); const cell = _dom_adapter.default.createElement("td"); cell.style.textAlign = alignment; const $cell = (0, _renderer.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 (Array.isArray(column.elementAttr)) { column.elementAttr.forEach((_ref => { let { name: name, value: value } = _ref; $cell.attr(name, value) })) } if ("expand" === column.command) { $cell.addClass(column.cssClass); $cell.addClass(this.addWidgetPrefix("group-space")) } if (column.colspan > 1) { $cell.attr("colSpan", column.colspan) } else if (!column.isBand && "auto" !== column.visibleWidth && needToSetCellWidths) { if (column.width || column.minWidth) { cell.style.minWidth = getWidthStyle(column.minWidth || column.width) } if (column.width) { setCellWidth(cell, column, getWidthStyle(column.width)) } } return $cell } _createRow(rowObject, tagName) { tagName = tagName || "tr"; const $element = (0, _renderer.default)(`<${tagName}>`).addClass("dx-row"); if ("tr" === tagName) { this.setAria("role", "row", $element) } return $element } _isAltRow(row) { return row && row.dataIndex % 2 === 1 } _createTable(columns, isAppend) { const $table = (0, _renderer.default)("").addClass(this.addWidgetPrefix("table")).addClass(this.addWidgetPrefix("table-fixed")); if (columns && !isAppend) { $table.attr("id", `dx-${new _guid.default}`).append(this._createColGroup(columns)); if (_browser.default.safari) { $table.append((0, _renderer.default)("").append("")) } this.setAria("role", "presentation", $table) } else { this.setAria("hidden", true, $table) } this.setAria("role", "presentation", (0, _renderer.default)("").appendTo($table)); if (isAppend) { return $table } if (_browser.default.mozilla) { _events_engine.default.on($table, "mousedown", "td", (e => { if (e.ctrlKey) { e.preventDefault() } })) } if (this.option("cellHintEnabled")) { _events_engine.default.on($table, "mousemove", ".dx-row > td", this.createAction((args => { const e = args.event; const $element = (0, _renderer.default)(e.target); const $cell = (0, _renderer.default)(e.currentTarget); const $row = $cell.parent(); const visibleColumns = this._columnsController.getVisibleColumns(); const rowOptions = $row.data("options"); const columnIndex = $cell.index(); const cellOptions = rowOptions && rowOptions.cells && rowOptions.cells[columnIndex]; const column = cellOptions ? cellOptions.column : visibleColumns[columnIndex]; const isHeaderRow = $row.hasClass("dx-header-row"); const isDataRow = $row.hasClass("dx-data-row"); const isMasterDetailRow = $row.hasClass("dx-master-detail-row"); const isGroupRow = $row.hasClass("dx-group-row"); const isFilterRow = $row.hasClass(this.addWidgetPrefix("filter-row")); const isDataRowWithTemplate = isDataRow && (!column || column.cellTemplate); const isEditorShown = isDataRow && cellOptions && (rowOptions.isEditing || cellOptions.isEditing || (null === column || void 0 === column ? void 0 : column.showEditorAlways)); const isHeaderRowWithTemplate = isHeaderRow && (!column || column.headerCellTemplate); const isGroupCellWithTemplate = isGroupRow && (!column || column.groupIndex && column.groupCellTemplate); const shouldShowHint = !isMasterDetailRow && !isFilterRow && !isEditorShown && !isDataRowWithTemplate && !isHeaderRowWithTemplate && !isGroupCellWithTemplate; if (shouldShowHint) { if ($element.data("dxCellHintVisible")) { $element.removeAttr("title"); $element.data("dxCellHintVisible", false) } const difference = $element[0].scrollWidth - $element[0].clientWidth; if (difference > 0 && !(0, _type.isDefined)($element.attr("title"))) { $element.attr("title", $element.text()); $element.data("dxCellHintVisible", true) } } }))) } const getOptions = event => { const $cell = (0, _renderer.default)(event.currentTarget); const $fieldItemContent = (0, _renderer.default)(event.target).closest(".dx-field-item-content"); const $row = $cell.parent(); const rowOptions = $row.data("options"); const options = rowOptions && rowOptions.cells && rowOptions.cells[$cell.index()]; if (!$cell.closest("table").is(event.delegateTarget)) { return } const resultOptions = (0, _extend.extend)({}, options, { cellElement: (0, _element.getPublicElement)($cell), event: event, eventType: event.type }); resultOptions.rowIndex = this.getRowIndex($row); if ($fieldItemContent.length) { const formItemOptions = $fieldItemContent.data("dx-form-item"); if (formItemOptions.column) { resultOptions.column = formItemOptions.column; resultOptions.columnIndex = this._columnsController.getVisibleIndex(resultOptions.column.index) } } return resultOptions }; _events_engine.default.on($table, "mouseover", ".dx-row > td", (e => { const options = getOptions(e); options && this.executeAction("onCellHoverChanged", options) })); _events_engine.default.on($table, "mouseout", ".dx-row > td", (e => { const options = getOptions(e); options && this.executeAction("onCellHoverChanged", options) })); _events_engine.default.on($table, _click.name, ".dx-row > td", (e => { const options = getOptions(e); options && this.executeAction("onCellClick", options) })); _events_engine.default.on($table, _double_click.name, ".dx-row > td", (e => { const options = getOptions(e); options && this.executeAction("onCellDblClick", options) })); ! function(that, $table) { let touchTarget; let touchCurrentTarget; let timeoutId; function clearTouchTargets(timeout) { return setTimeout((() => { touchTarget = touchCurrentTarget = null }), timeout) } _events_engine.default.on($table, "touchstart touchend", ".dx-row", (e => { clearTimeout(timeoutId); if ("touchstart" === e.type) { touchTarget = e.target; touchCurrentTarget = e.currentTarget; timeoutId = clearTouchTargets(1e3) } else { timeoutId = clearTouchTargets() } })); _events_engine.default.on($table, [_click.name, _double_click.name, _pointer.default.down].join(" "), ".dx-row", that.createAction((e => { const { event: event } = e; if (touchTarget) { event.target = touchTarget; event.currentTarget = touchCurrentTarget } if (!(0, _renderer.default)(event.target).closest("a").length) { e.rowIndex = that.getRowIndex(event.currentTarget); if (e.rowIndex >= 0) { e.rowElement = (0, _element.getPublicElement)((0, _renderer.default)(event.currentTarget)); e.columns = that.getColumns(); if (event.type === _pointer.default.down) { that._rowPointerDown(e) } else if (event.type === _click.name) { that._rowClick(e) } else { that._rowDblClick(e) } } } }))) }(this, $table); return $table } _rowPointerDown(e) {} _rowClick() {} _rowDblClick() {} _createColGroup(columns) { const colgroupElement = (0, _renderer.default)(""); for (let i = 0; i < columns.length; i++) { const colspan = columns[i].colspan || 1; for (let j = 0; j < colspan; j++) { colgroupElement.append(this._createCol(columns[i])) } } return colgroupElement } _createCol(column) { let width = column.visibleWidth || column.width; if ("adaptiveHidden" === width) { width = "0.0001px" } const col = (0, _renderer.default)(""); (0, _style.setWidth)(col, width); return col } renderDelayedTemplates(change) { const delayedTemplates = this._delayedTemplates; const syncTemplates = delayedTemplates.filter((template => !template.async)); const asyncTemplates = delayedTemplates.filter((template => template.async)); this._delayedTemplates = []; this._renderDelayedTemplatesCore(syncTemplates, false, change); this._renderDelayedTemplatesCoreAsync(asyncTemplates) } _renderDelayedTemplatesCoreAsync(templates) { if (templates.length) { const templateTimeout = (0, _window.getWindow)().setTimeout((() => { this._templateTimeouts.delete(templateTimeout); this._renderDelayedTemplatesCore(templates, true) })); this._templateTimeouts.add(templateTimeout) } } _renderDelayedTemplatesCore(templates, isAsync, change) { const date = new Date; while (templates.length) { const templateParameters = templates.shift(); const { options: options } = templateParameters; const doc = _dom_adapter.default.getRootNode((0, _renderer.default)(options.container).get(0)); const needWaitAsyncTemplates = this.needWaitAsyncTemplates(); if (!isAsync || (0, _renderer.default)(options.container).closest(doc).length || needWaitAsyncTemplates) { if (change) { options.change = change } templateParameters.template.render(options) } if (isAsync && new Date - date > 30) { this._renderDelayedTemplatesCoreAsync(templates); break } } if (!templates.length && this._delayedTemplates.length) { this.renderDelayedTemplates() } } _processTemplate(template, options) { const that = this; let renderingTemplate; if (template && template.render && !(0, _type.isRenderer)(template)) { renderingTemplate = { allowRenderToDetachedContainer: template.allowRenderToDetachedContainer, render(options) { template.render(options.container, options.model, options.change); options.deferred && options.deferred.resolve() } } } else if ((0, _type.isFunction)(template)) { renderingTemplate = { render(options) { const renderedTemplate = template((0, _element.getPublicElement)(options.container), options.model, options.change); if (renderedTemplate && (renderedTemplate.nodeType || (0, _type.isRenderer)(renderedTemplate))) { options.container.append(renderedTemplate) } options.deferred && options.deferred.resolve() } } } else { const templateID = (0, _type.isString)(template) ? template : (0, _renderer.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(container, template, options, allowRenderToDetachedContainer, change) { const renderingTemplate = this._processTemplate(template, options); const { column: column } = options; const isDataRow = "data" === options.rowType; const templateDeferred = new _deferred.Deferred; const templateOptions = { container: container, model: options, deferred: templateDeferred, onRendered: () => { if (this.isDisposed()) { templateDeferred.reject() } else { templateDeferred.resolve() } } }; if (renderingTemplate) { options.component = this.component; const columnAsync = column && (column.renderAsync && isDataRow || this.option("renderAsync") && (false !== column.renderAsync && (column.command || column.showEditorAlways) && isDataRow || "filter" === options.rowType)); const async = options.renderAsync ?? columnAsync; if ((renderingTemplate.allowRenderToDetachedContainer || allowRenderToDetachedContainer) && !async) { renderingTemplate.render(templateOptions) } else { this._delayedTemplates.push({ template: renderingTemplate, options: templateOptions, async: async }) } this._templateDeferreds.add(templateDeferred); _events_engine.default.on(container, _remove.removeEvent, removeHandler.bind(null, templateDeferred)) } else { templateDeferred.reject() } return templateDeferred.promise().always((() => { this._templateDeferreds.delete(templateDeferred) })) } _getBodies(tableElement) { return (0, _renderer.default)(tableElement).children("tbody").not(".dx-header").not(".dx-footer") } _needWrapRow($tableElement) { var _this$_getBodies; const hasRowTemplate = !!this.option().rowTemplate; return hasRowTemplate && !!(null !== (_this$_getBodies = this._getBodies($tableElement)) && void 0 !== _this$_getBodies && _this$_getBodies.filter(".dx-row").length) } _wrapRowIfNeed($table, $row, isRefreshing) { const $tableElement = isRefreshing ? $table || this._tableElement : this._tableElement || $table; const needWrapRow = this._needWrapRow($tableElement); if (needWrapRow) { const $tbody = (0, _renderer.default)("").addClass($row.attr("class")); this.setAria("role", "presentation", $tbody); return $tbody.append($row) } return $row } _appendRow($table, $row, appendTemplate) { appendTemplate = appendTemplate || appendElementTemplate; appendTemplate.render({ content: $row, container: $table }) } _resizeCore() { const scrollLeft = this._scrollLeft; if (scrollLeft >= 0) { this._scrollLeft = 0; this.scrollTo({ left: scrollLeft }) } } _renderCore(e) { const $root = this.element().parent(); if (!$root || $root.parent().length) { this.renderDelayedTemplates(e) } } _renderTable(options) { options = options || {}; options.columns = this._columnsController.getVisibleColumns(); const changeType = options.change && options.change.changeType; const $table = this._createTable(options.columns, "append" === changeType || "prepend" === changeType || "update" === changeType); this._renderRows($table, options); return $table } _renderRows($table, options) { const that = this; const rows = that._getRows(options.change); const columnIndices = options.change && options.change.columnIndices || []; const changeTypes = options.change && options.change.changeTypes || []; for (let i = 0; i < rows.length; i++) { that._renderRow($table, (0, _extend.extend)({ row: rows[i], columnIndices: columnIndices[i], changeType: changeTypes[i] }, options)) } } _renderRow($table, options) { if (!options.columnIndices) { options.row.cells = [] } const $row = this._createRow(options.row); const $wrappedRow = this._wrapRowIfNeed($table, $row); if ("remove" !== options.changeType) { this._renderCells($row, options) } this._appendRow($table, $wrappedRow); const rowOptions = (0, _extend.extend)({ columns: options.columns }, options.row); this._addWatchMethod(rowOptions, options.row); this._rowPrepared($wrappedRow, rowOptions, options.row) } _needRenderCell(columnIndex, columnIndices) { return !columnIndices || columnIndices.indexOf(columnIndex) >= 0 } _renderCells($row, options) { const that = this; let columnIndex = 0; const { row: row } = options; const { columns: columns } = options; for (let 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($rowElement, $newRowElement, columnIndices) { const $cells = $rowElement.children(); const $newCells = $newRowElement.children(); const highlightChanges = this.option("highlightChanges"); const cellUpdatedClass = this.addWidgetPrefix("cell-updated-animation"); columnIndices.forEach(((columnIndex, index) => { const $cell = $cells.eq(columnIndex); const $newCell = $newCells.eq(index); $cell.replaceWith($newCell); if (highlightChanges && !$newCell.hasClass("dx-command-expand")) { $newCell.addClass(cellUpdatedClass) } })); ! function(element, newElement) { if (!element || !newElement) { return } const oldAttributes = element.attributes; const newAttributes = newElement.attributes; let i; for (i = 0; i < oldAttributes.length; i++) { const 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) } }($rowElement.get(0), $newRowElement.get(0)) } _setCellAriaAttributes($cell, cellOptions) { if ("freeSpace" !== cellOptions.rowType) { this.setAria("role", "gridcell", $cell); const columnIndexOffset = this._columnsController.getColumnIndexOffset(); const ariaColIndex = cellOptions.columnIndex + columnIndexOffset + 1; this.setAria("colindex", ariaColIndex, $cell) } } _renderCell($row, options) { const cellOptions = this._getCellOptions(options); if (options.columnIndices) { if (options.row.cells) { const cellIndex = options.row.cells.findIndex((cell => cell.columnIndex === cellOptions.columnIndex)); options.row.cells[cellIndex] = cellOptions } } else { options.row.cells.push(cellOptions) } const $cell = this._createCell(cellOptions); this._setCellAriaAttributes($cell, cellOptions); this._renderCellContent($cell, cellOptions, options); $row.get(0).appendChild($cell.get(0)); return $cell } _renderCellContent($cell, options, renderOptions) { const template = this._getCellTemplate(options); (0, _deferred.when)(!template || this.renderTemplate($cell, template, options, void 0, renderOptions.change)).done((() => { this._updateCell($cell, options) })) } _getCellTemplate(options) {} _getRows(change) { return [] } _getCellOptions(options) { const cellOptions = { column: options.column, columnIndex: options.columnIndex, rowType: options.row.rowType, isAltRow: this._isAltRow(options.row) }; this._addWatchMethod(cellOptions); return cellOptions } _addWatchMethod(options, source) { if (!this.option("repaintChangesOnly")) { return } const watchers = []; source = source || options; source.watch = source.watch || function(getter, updateValueFunc, updateRowFunc) { let oldValue = getter(source.data); const watcher = function(row) { if (row && updateRowFunc) { updateRowFunc(row) } const newValue = getter(source.data); if (JSON.stringify(oldValue) !== JSON.stringify(newValue)) { if (row) { updateValueFunc(newValue) } oldValue = newValue } }; watchers.push(watcher); return function() { const index = watchers.indexOf(watcher); if (index >= 0) { watchers.splice(index, 1) } } }; source.update = source.update || function(row, keepRow) { if (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 && !keepRow) { options.row = row } } watchers.forEach((watcher => { watcher(row) })) }; if (source !== options) { options.watch = source.watch.bind(source) } return options } _cellPrepared(cell, options) { options.cellElement = (0, _element.getPublicElement)((0, _renderer.default)(cell)); this.executeAction("onCellPrepared", options) } _rowPrepared($row, options, row) { (0, _element_data.data)($row.get(0), "options", options); options.rowElement = (0, _element.getPublicElement)($row); this.executeAction("onRowPrepared", options) } _columnOptionChanged(e) { const { optionNames: optionNames } = e; if (_m_utils.default.checkChanges(optionNames, ["width", "visibleWidth"])) { const visibleColumns = this._columnsController.getVisibleColumns(); const widths = visibleColumns.map((column => column.visibleWidth || column.width)); this.setColumnWidths({ widths: widths, optionNames: optionNames }); return } if (!this._requireReady) { this.render() } } getCellIndex($cell, rowIndex) { const cellIndex = $cell.length ? $cell[0].cellIndex : -1; return cellIndex } getTableElements() { return this._tableElement || (0, _renderer.default)() } getTableElement(isFixedTableRendering) { return this._tableElement } setTableElement(tableElement, isFixedTableRendering) { this._tableElement = tableElement } _afterRowPrepared(e) {} _handleDataChanged(e) {} callbackNames() { return ["scrollChanged"] } _updateScrollLeftPosition() { const scrollLeft = this._scrollLeft; if (scrollLeft >= 0) { this._scrollLeft = 0; this.scrollTo({ left: scrollLeft }) } } scrollTo(pos) { const $element = this.element(); const $scrollContainer = $element && $element.children(`.${this.addWidgetPrefix("scroll-container")}`).not(`.${this.addWidgetPrefix("content-fixed")}`); if ((0, _type.isDefined)(pos) && (0, _type.isDefined)(pos.left) && this._scrollLeft !== pos.left) { this._scrollLeft = pos.left; $scrollContainer && $scrollContainer.scrollLeft(pos.left) } } _getContent(isFixedTableRendering) { var _this$_tableElement; return null === (_this$_tableElement = this._tableElement) || void 0 === _this$_tableElement ? void 0 : _this$_tableElement.parent() } _removeContent(isFixedTableRendering) { const $scrollContainer = this._getContent(isFixedTableRendering); if (null !== $scrollContainer && void 0 !== $scrollContainer && $scrollContainer.length) { $scrollContainer.remove() } } _wrapTableInScrollContainer($table, isFixedTableRendering) { const $scrollContainer = (0, _renderer.default)("
"); const useNative = this.option("scrolling.useNative"); if (false === useNative || "auto" === useNative && !_support.nativeScrolling) { $scrollContainer.addClass(this.addWidgetPrefix("scrollable-simulated")) } _events_engine.default.on($scrollContainer, "scroll", (() => { const scrollLeft = $scrollContainer.scrollLeft(); if (scrollLeft !== this._scrollLeft) { this.scrollChanged.fire({ left: scrollLeft }, this.name) } })); $scrollContainer.addClass(this.addWidgetPrefix("content")).addClass(this.addWidgetPrefix("scroll-container")).append($table).appendTo(this.element()); this.setAria("role", "presentation", $scrollContainer); return $scrollContainer } needWaitAsyncTemplates() { return this.option("templatesRenderAsynchronously") && false === this.option("renderAsync") } waitAsyncTemplates() { let forceWaiting = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : false; const result = new _deferred.Deferred; const needWaitAsyncTemplates = forceWaiting || this.needWaitAsyncTemplates(); if (!needWaitAsyncTemplates) { return result.resolve() } const waitTemplatesRecursion = () => _deferred.when.apply(this, Array.from(this._templateDeferreds)).done((() => { if (this.isDisposed()) { result.reject() } else if (this._templateDeferreds.size > 0) { waitTemplatesRecursion() } else { result.resolve() } })).fail(result.reject); waitTemplatesRecursion(); return result.promise() } _updateContent($newTableElement, change, isFixedTableRendering) { return this.waitAsyncTemplates().done((() => { this._removeContent(isFixedTableRendering); this.setTableElement($newTableElement, isFixedTableRendering); this._wrapTableInScrollContainer($newTableElement, isFixedTableRendering) })) } _findContentElement(isFixedTableRendering) {} _getWidths($cellElements) { if (!$cellElements) { return [] } const result = []; const cellElements = $cellElements.toArray(); cellElements.forEach((cell => { let width = cell.offsetWidth; if (cell.getBoundingClientRect) { const rect = (0, _position.getBoundingRect)(cell); if (rect.width > cell.offsetWidth - 1) { width = rect.width } } result.push(width) })); return result } getColumnWidths($tableElement) { (this.option("forceApplyBindings") || _common.noop)(); $tableElement = $tableElement ?? this.getTableElement(); if ($tableElement) { const $rows = $tableElement.children("tbody:not(.dx-header)").children(); for (let i = 0; i < $rows.length; i++) { const $row = $rows.eq(i); const isGroupRow = $row.hasClass("dx-group-row"); const isDetailRow = $row.hasClass("dx-master-detail-row"); const isErrorRow = $row.hasClass("dx-error-row"); const isRowVisible = "none" !== $row.get(0).style.display && !$row.hasClass("dx-state-invisible"); const isRelevantRow = !isGroupRow && !isDetailRow && !isErrorRow; if (isRowVisible && isRelevantRow) { const $cells = $row.children("td"); const result = this._getWidths($cells); return result } } } return [] } getVisibleColumnIndex(columnIndex, rowIndex) { return columnIndex } setColumnWidths(_ref2) { let { widths: widths, optionNames: optionNames } = _ref2; const $tableElement = this.getTableElement(); if (!(null !== $tableElement && void 0 !== $tableElement && $tableElement.length) || !widths) { return } const columns = this.getColumns(); const needToSetCellWidths = this._needToSetCellWidths(); const $cols = $tableElement.children("colgroup").children("col"); $cols.toArray().forEach((col => col.removeAttribute("style"))); columns.forEach(((column, columnIndex) => { if (needToSetCellWidths && column.width && !column.command) { const width = getWidthStyle(column.visibleWidth || column.width); const minWidth = getWidthStyle(column.minWidth || width); const $rows = $tableElement.children().children(".dx-row").not(".dx-master-detail-row"); for (let rowIndex = 0; rowIndex < $rows.length; rowIndex++) { const visibleIndex = this.getVisibleColumnIndex(columnIndex, rowIndex); if (visibleIndex >= 0) { const $row = $rows.eq(rowIndex); const $cell = $row.hasClass("dx-group-row") ? $row.find(`td[aria-colindex='${visibleIndex+1}']:not(.dx-group-cell)`) : $row.find("td").eq(visibleIndex); if ($cell.length) { const cell = $cell.get(0); setCellWidth(cell, column, width); cell.style.minWidth = minWidth } } } } const colWidth = normalizeWidth(widths[columnIndex]); if ((0, _type.isDefined)(colWidth)) { (0, _style.setWidth)($cols.eq(columnIndex), colWidth) } })) } getCellElements(rowIndex) { return this._getCellElementsCore(rowIndex) } _getCellElementsCore(rowIndex) { if (rowIndex < 0) { return } const $row = this._getRowElements().eq(rowIndex); return $row.children() } _getCellElement(rowIndex, columnIdentifier) { const $cells = this.getCellElements(rowIndex); const columnVisibleIndex = this._getVisibleColumnIndex($cells, rowIndex, columnIdentifier); if (!(null !== $cells && void 0 !== $cells && $cells.length) || columnVisibleIndex < 0) { return } const $cell = $cells.eq(columnVisibleIndex); return $cell.length > 0 ? $cell : void 0 } _getRowElement(rowIndex) { const that = this; let $rowElement = (0, _renderer.default)(); const $tableElements = that.getTableElements(); iteratorUtils.each($tableElements, ((_, tableElement) => { $rowElement = $rowElement.add(that._getRowElements((0, _renderer.default)(tableElement)).eq(rowIndex)) })); if ($rowElement.length) { return $rowElement } return } getCellElement(rowIndex, columnIdentifier) { const $cell = this._getCellElement(rowIndex, columnIdentifier); if ($cell) { return (0, _element.getPublicElement)($cell) } return } getRowElement(rowIndex) { const $rows = this._getRowElement(rowIndex); let elements = []; if ($rows && !(0, _element.getPublicElement)($rows).get) { for (let i = 0; i < $rows.length; i++) { elements.push($rows[i]) } } else { elements = $rows } return elements } _getVisibleColumnIndex($cells, rowIndex, columnIdentifier) { if ((0, _type.isString)(columnIdentifier)) { const columnIndex = this._columnsController.columnOption(columnIdentifier, "index"); return this._columnsController.getVisibleIndex(columnIndex) } return columnIdentifier } getColumnElements() {} getColumns(rowIndex, $tableElement) { return this._columnsController.getVisibleColumns(rowIndex) } getCell(cellPosition, rows, cells) { const $rows = rows || this._getRowElements(); let $cells; if ($rows.length > 0 && cellPosition.rowIndex >= 0) { var _$cells; if ("virtual" !== this.option("scrolling.mode") && "virtual" !== this.option("scrolling.rowRenderingMode")) { cellPosition.rowIndex = cellPosition.rowIndex < $rows.length ? cellPosition.rowIndex : $rows.length - 1 } $cells = cells || this.getCellElements(cellPosition.rowIndex); if ((null === (_$cells = $cells) || void 0 === _$cells ? void 0 : _$cells.length) > 0) { return $cells.eq($cells.length > cellPosition.columnIndex ? cellPosition.columnIndex : $cells.length - 1) } } } getRowsCount() { const tableElement = this.getTableElement(); if (tableElement && 1 === tableElement.length) { return tableElement[0].rows.length } return 0 } _getRowElementsCore(tableElement) { tableElement = tableElement || this.getTableElement(); if (tableElement) { const hasRowTemplate = this.option().rowTemplate || this.option("dataRowTemplate"); const tBodies = hasRowTemplate && tableElement.find("> tbody.dx-row"); return tBodies && tBodies.length ? tBodies : tableElement.find("> tbody > .dx-row, > .dx-row") } return (0, _renderer.default)() } _getRowElements(tableElement) { return this._getRowElementsCore(tableElement) } getRowIndex($row) { return this._getRowElements().index($row) } getBoundingRect() {} getName() {} setScrollerSpacing(width) { const $element = this.element(); const rtlEnabled = this.option("rtlEnabled"); $element && $element.css({ paddingLeft: rtlEnabled ? width : "", paddingRight: !rtlEnabled ? width : "" }) } isScrollbarVisible(isHorizontal) { const $element = this.element(); const $tableElement = this._tableElement; if ($element && $tableElement) { return isHorizontal ? (0, _size.getOuterWidth)($tableElement) - (0, _size.getWidth)($element) > 0 : (0, _size.getOuterHeight)($tableElement) - (0, _size.getHeight)($element) > 0 } return false } isDisposed() { var _this$component; return null === (_this$component = this.component) || void 0 === _this$component ? void 0 : _this$component._disposed } } exports.ColumnsView = ColumnsView }, 28016: /*!*********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/views/m_grid_view.js ***! \*********************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.gridViewModule = exports.SynchronizeScrollingController = exports.ResizingController = exports.GridView = void 0; var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../../core/dom_adapter */ 73349)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _browser = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/browser */ 47810)); var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _position = __webpack_require__( /*! ../../../../core/utils/position */ 37518); var _size = __webpack_require__( /*! ../../../../core/utils/size */ 58664); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _window = __webpack_require__( /*! ../../../../core/utils/window */ 58201); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109)); var accessibility = function(e, r) { if (!r && e && e.__esModule) { return e } if (null === e || "object" != typeof e && "function" != typeof e) { return { default: e } } var t = _getRequireWildcardCache(r); if (t && t.has(e)) { return t.get(e) } var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u] } } return n.default = e, t && t.set(e, n), n }(__webpack_require__( /*! ../../../../ui/shared/accessibility */ 56756)); var _a11y_status_container_component = __webpack_require__( /*! ../../../grids/grid_core/views/a11y_status_container_component */ 79163); var _m_modules = _interopRequireDefault(__webpack_require__( /*! ../m_modules */ 15943)); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../m_utils */ 60082)); function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) { return null } var r = new WeakMap, t = new WeakMap; return (_getRequireWildcardCache = function(e) { return e ? t : r })(e) } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const VIEW_NAMES = ["columnsSeparatorView", "blockSeparatorView", "trackerView", "headerPanel", "columnHeadersView", "rowsView", "footerView", "columnChooserView", "filterPanelView", "pagerView", "draggingHeaderView", "contextMenuView", "errorView", "headerFilterView", "filterBuilderView"]; const E2E_ATTRIBUTES_a11yStatusContainer = "e2e-a11y-general-status-container"; const isPercentWidth = function(width) { return (0, _type.isString)(width) && width.endsWith("%") }; const calculateFreeWidth = function(that, widths) { const contentWidth = that._rowsView.contentWidth(); const totalWidth = that._getTotalWidth(widths, contentWidth); return contentWidth - totalWidth }; const calculateFreeWidthWithCurrentMinWidth = function(that, columnIndex, currentMinWidth, widths) { return calculateFreeWidth(that, widths.map(((width, index) => index === columnIndex ? currentMinWidth : width))) }; class ResizingController extends _m_modules.default.ViewController { init() { this._prevContentMinHeight = null; this._dataController = this.getController("data"); this._columnsController = this.getController("columns"); this._columnHeadersView = this.getView("columnHeadersView"); this._adaptiveColumnsController = this.getController("adaptiveColumns"); this._editorFactoryController = this.getController("editorFactory"); this._footerView = this.getView("footerView"); this._rowsView = this.getView("rowsView"); this._gridView = this.getView("gridView") } _initPostRenderHandlers() { if (!this._refreshSizesHandler) { this._refreshSizesHandler = e => { let resizeDeferred = (new _deferred.Deferred).resolve(null); const changeType = null === e || void 0 === e ? void 0 : e.changeType; const isDelayed = null === e || void 0 === e ? void 0 : e.isDelayed; const needFireContentReady = changeType && "updateSelection" !== changeType && "updateFocusedRow" !== changeType && "pageIndex" !== changeType && !isDelayed; this._dataController.changed.remove(this._refreshSizesHandler); if (this._checkSize()) { resizeDeferred = this._refreshSizes(e) } if (needFireContentReady) { (0, _deferred.when)(resizeDeferred).done((() => { this._setAriaLabel(); this.fireContentReadyAction() })) } }; this._dataController.changed.add((() => { this._dataController.changed.add(this._refreshSizesHandler) })) } } _refreshSizes(e) { let resizeDeferred = (new _deferred.Deferred).resolve(null); const changeType = null === e || void 0 === e ? void 0 : e.changeType; const isDelayed = null === e || void 0 === e ? void 0 : e.isDelayed; const items = this._dataController.items(); if (!e || "refresh" === changeType || "prepend" === changeType || "append" === changeType) { if (!isDelayed) { resizeDeferred = this.resize() } } else if ("update" === changeType) { var _e$changeTypes; if (0 === (null === (_e$changeTypes = e.changeTypes) || void 0 === _e$changeTypes ? void 0 : _e$changeTypes.length)) { return resizeDeferred } if ((items.length > 1 || "insert" !== e.changeTypes[0]) && !(0 === items.length && "remove" === e.changeTypes[0]) && !e.needUpdateDimensions) { resizeDeferred = new _deferred.Deferred; this._waitAsyncTemplates().done((() => { (0, _common.deferUpdate)((() => (0, _common.deferRender)((() => (0, _common.deferUpdate)((() => { this._setScrollerSpacing(); this._rowsView.resize(); resizeDeferred.resolve() })))))) })).fail(resizeDeferred.reject) } else { resizeDeferred = this.resize() } } return resizeDeferred } fireContentReadyAction() { this.component._fireContentReadyAction() } _getWidgetAriaLabel() { return "dxDataGrid-ariaDataGrid" } _setAriaLabel() { var _this$_columnsControl; const columnCount = (null === (_this$_columnsControl = this._columnsController) || void 0 === _this$_columnsControl || null === (_this$_columnsControl = _this$_columnsControl._columns) || void 0 === _this$_columnsControl ? void 0 : _this$_columnsControl.filter((_ref => { let { visible: visible } = _ref; return !!visible })).length) ?? 0; const totalItemsCount = Math.max(0, this._dataController.totalItemsCount()); const widgetAriaLabel = this._getWidgetAriaLabel(); const widgetStatusText = _message.default.format(widgetAriaLabel, totalItemsCount, columnCount); const $ariaLabelElement = this.component.$element().children(".dx-gridbase-container"); this.component.setAria("label", widgetStatusText, $ariaLabelElement); this._gridView.setWidgetA11yStatusText(widgetStatusText) } _getBestFitWidths() { var _widths; const rowsView = this._rowsView; const columnHeadersView = this._columnHeadersView; let widths = rowsView.getColumnWidths(); if (!(null !== (_widths = widths) && void 0 !== _widths && _widths.length)) { var _rowsView$getTableEle; const headersTableElement = columnHeadersView.getTableElement(); columnHeadersView.setTableElement(null === (_rowsView$getTableEle = rowsView.getTableElement()) || void 0 === _rowsView$getTableEle ? void 0 : _rowsView$getTableEle.children(".dx-header")); widths = columnHeadersView.getColumnWidths(); columnHeadersView.setTableElement(headersTableElement) } return widths } _setVisibleWidths(visibleColumns, widths) { const columnsController = this._columnsController; columnsController.beginUpdate(); (0, _iterator.each)(visibleColumns, ((index, column) => { const columnId = columnsController.getColumnId(column); columnsController.columnOption(columnId, "visibleWidth", widths[index]) })); columnsController.endUpdate() } _toggleBestFitModeForView(view, className, isBestFit) { if (!view || !view.isVisible()) { return } const $rowsTables = this._rowsView.getTableElements(); const $viewTables = view.getTableElements(); (0, _iterator.each)($rowsTables, ((index, tableElement) => { let $tableBody; const $rowsTable = (0, _renderer.default)(tableElement); const $viewTable = $viewTables.eq(index); if ($viewTable && $viewTable.length) { if (isBestFit) { $tableBody = $viewTable.children("tbody").appendTo($rowsTable) } else { $tableBody = $rowsTable.children(`.${className}`).appendTo($viewTable) } $tableBody.toggleClass(className, isBestFit); $tableBody.toggleClass(this.addWidgetPrefix("best-fit"), isBestFit) } })) } _toggleBestFitMode(isBestFit) { const $rowsTable = this._rowsView.getTableElement(); const $rowsFixedTable = this._rowsView.getTableElements().eq(1); if (!$rowsTable) { return } $rowsTable.css("tableLayout", isBestFit ? "auto" : "fixed"); $rowsTable.children("colgroup").css("display", isBestFit ? "none" : ""); (0, _iterator.each)($rowsFixedTable.find("tr.dx-group-row"), ((idx, item) => { (0, _renderer.default)(item).css("display", isBestFit ? "none" : "") })); $rowsFixedTable.toggleClass(this.addWidgetPrefix("table-fixed"), !isBestFit); this._toggleBestFitModeForView(this._columnHeadersView, "dx-header", isBestFit); this._toggleBestFitModeForView(this._footerView, "dx-footer", isBestFit); if (this._needStretch()) { $rowsTable.get(0).style.width = isBestFit ? "auto" : "" } } _toggleContentMinHeight(value) { const scrollable = this._rowsView.getScrollable(); const $contentElement = this._rowsView._findContentElement(); if (false === (null === scrollable || void 0 === scrollable ? void 0 : scrollable.option("useNative"))) { if (true === value) { this._prevContentMinHeight = $contentElement.get(0).style.minHeight } if ((0, _type.isDefined)(this._prevContentMinHeight)) { $contentElement.css({ minHeight: value ? _m_utils.default.getContentHeightLimit(_browser.default) : this._prevContentMinHeight }) } } } _synchronizeColumns() { const columnsController = this._columnsController; const visibleColumns = columnsController.getVisibleColumns(); const columnAutoWidth = this.option("columnAutoWidth"); const wordWrapEnabled = this.option("wordWrapEnabled"); const hasUndefinedColumnWidth = visibleColumns.some((column => !(0, _type.isDefined)(column.width))); let needBestFit = this._needBestFit(); let hasMinWidth = false; let resetBestFitMode; let isColumnWidthsCorrected = false; let resultWidths = []; let focusedElement; let selectionRange; !needBestFit && (0, _iterator.each)(visibleColumns, ((index, column) => { if ("auto" === column.width) { needBestFit = true; return false } return })); (0, _iterator.each)(visibleColumns, ((index, column) => { if (column.minWidth) { hasMinWidth = true; return false } return })); this._setVisibleWidths(visibleColumns, []); const $element = this.component.$element(); if (needBestFit) { focusedElement = _dom_adapter.default.getActiveElement($element.get(0)); selectionRange = _m_utils.default.getSelectionRange(focusedElement); this._toggleBestFitMode(true); resetBestFitMode = true } this._toggleContentMinHeight(wordWrapEnabled); if ($element && $element.get(0) && this._maxWidth) { delete this._maxWidth; $element[0].style.maxWidth = "" }(0, _common.deferUpdate)((() => { if (needBestFit) { resultWidths = this._getBestFitWidths(); (0, _iterator.each)(visibleColumns, ((index, column) => { const columnId = columnsController.getColumnId(column); columnsController.columnOption(columnId, "bestFitWidth", resultWidths[index], true) })) } else if (hasMinWidth) { resultWidths = this._getBestFitWidths() }(0, _iterator.each)(visibleColumns, (function(index) { const { width: width } = this; if ("auto" !== width) { if ((0, _type.isDefined)(width)) { resultWidths[index] = (0, _type.isNumeric)(width) || function(width) { return (0, _type.isString)(width) && width.endsWith("px") }(width) ? parseFloat(width) : width } else if (!columnAutoWidth) { resultWidths[index] = void 0 } } })); if (resetBestFitMode) { this._toggleBestFitMode(false); resetBestFitMode = false; if (focusedElement && focusedElement !== _dom_adapter.default.getActiveElement()) { const isFocusOutsideWindow = (0, _position.getBoundingRect)(focusedElement).bottom < 0; if (!isFocusOutsideWindow) { ! function(focusedElement, selectionRange) { accessibility.hiddenFocus(focusedElement, true); _m_utils.default.setSelectionRange(focusedElement, selectionRange) }(focusedElement, selectionRange) } } } isColumnWidthsCorrected = this._correctColumnWidths(resultWidths, visibleColumns); if (columnAutoWidth) { ! function() { let expandColumnWidth; (0, _iterator.each)(visibleColumns, ((index, column) => { if ("groupExpand" === column.type) { expandColumnWidth = resultWidths[index] } })); (0, _iterator.each)(visibleColumns, ((index, column) => { if ("groupExpand" === column.type && expandColumnWidth) { resultWidths[index] = expandColumnWidth } })) }(); if (this._needStretch()) { this._processStretch(resultWidths, visibleColumns) } }(0, _common.deferRender)((() => { if (needBestFit || isColumnWidthsCorrected || hasUndefinedColumnWidth) { this._setVisibleWidths(visibleColumns, resultWidths) } if (wordWrapEnabled) { this._toggleContentMinHeight(false) } })) })) } _needBestFit() { return this.option("columnAutoWidth") } _needStretch() { return this._columnsController.getVisibleColumns().some((c => "auto" === c.width && !c.command)) } _getAverageColumnsWidth(resultWidths) { const freeWidth = calculateFreeWidth(this, resultWidths); const columnCountWithoutWidth = resultWidths.filter((width => void 0 === width)).length; return freeWidth / columnCountWithoutWidth } _correctColumnWidths(resultWidths, visibleColumns) { const that = this; let i; let hasPercentWidth = false; let hasAutoWidth = false; let isColumnWidthsCorrected = false; const $element = that.component.$element(); const hasWidth = that._hasWidth; for (i = 0; i < visibleColumns.length; i++) { const index = i; const column = visibleColumns[index]; const isHiddenColumn = "adaptiveHidden" === resultWidths[index]; let width = resultWidths[index]; const { minWidth: minWidth } = column; if (minWidth) { if (void 0 === width) { const averageColumnsWidth = that._getAverageColumnsWidth(resultWidths); width = averageColumnsWidth } else if (isPercentWidth(width)) { const freeWidth = calculateFreeWidthWithCurrentMinWidth(that, index, minWidth, resultWidths); if (freeWidth < 0) { width = -1 } } } const realColumnWidth = that._getRealColumnWidth(index, resultWidths.map(((columnWidth, columnIndex) => index === columnIndex ? width : columnWidth))); if (minWidth && !isHiddenColumn && realColumnWidth < minWidth) { resultWidths[index] = minWidth; isColumnWidthsCorrected = true; i = -1 } if (!(0, _type.isDefined)(column.width)) { hasAutoWidth = true } if (isPercentWidth(column.width)) { hasPercentWidth = true } } if (!hasAutoWidth && resultWidths.length) { const $rowsViewElement = that._rowsView.element(); const contentWidth = that._rowsView.contentWidth(); const scrollbarWidth = that._rowsView.getScrollbarWidth(); const totalWidth = that._getTotalWidth(resultWidths, contentWidth); if (totalWidth < contentWidth) { const lastColumnIndex = _m_utils.default.getLastResizableColumnIndex(visibleColumns, resultWidths); if (lastColumnIndex >= 0) { resultWidths[lastColumnIndex] = "auto"; isColumnWidthsCorrected = true; if (false === hasWidth && !hasPercentWidth) { const borderWidth = that.option("showBorders") ? Math.ceil((0, _size.getOuterWidth)($rowsViewElement) - (0, _size.getInnerWidth)($rowsViewElement)) : 0; that._maxWidth = totalWidth + scrollbarWidth + borderWidth; $element.css("maxWidth", that._maxWidth) } } } } return isColumnWidthsCorrected } _processStretch(resultSizes, visibleColumns) { const groupSize = this._rowsView.contentWidth(); const tableSize = this._getTotalWidth(resultSizes, groupSize); const unusedIndexes = { length: 0 }; if (!resultSizes.length) { return }(0, _iterator.each)(visibleColumns, (function(index) { if (this.width || "adaptiveHidden" === resultSizes[index]) { unusedIndexes[index] = true; unusedIndexes.length++ } })); const diff = groupSize - tableSize; const diffElement = Math.floor(diff / (resultSizes.length - unusedIndexes.length)); let onePixelElementsCount = diff - diffElement * (resultSizes.length - unusedIndexes.length); if (diff >= 0) { for (let i = 0; i < resultSizes.length; i++) { if (unusedIndexes[i]) { continue } resultSizes[i] += diffElement; if (onePixelElementsCount > 0) { if (onePixelElementsCount < 1) { resultSizes[i] += onePixelElementsCount; onePixelElementsCount = 0 } else { resultSizes[i]++; onePixelElementsCount-- } } } } } _getRealColumnWidth(columnIndex, columnWidths, groupWidth) { let ratio = 1; const width = columnWidths[columnIndex]; if (!isPercentWidth(width)) { return parseFloat(width) } const percentTotalWidth = columnWidths.reduce(((sum, width, index) => { if (!isPercentWidth(width)) { return sum } return sum + parseFloat(width) }), 0); const pixelTotalWidth = columnWidths.reduce(((sum, width) => { if (!width || "adaptiveHidden" === width || isPercentWidth(width)) { return sum } return sum + parseFloat(width) }), 0); groupWidth = groupWidth || this._rowsView.contentWidth(); const freeSpace = groupWidth - pixelTotalWidth; const percentTotalWidthInPixel = percentTotalWidth * groupWidth / 100; if (pixelTotalWidth > 0 && percentTotalWidthInPixel + pixelTotalWidth >= groupWidth) { ratio = percentTotalWidthInPixel > freeSpace ? freeSpace / percentTotalWidthInPixel : 1 } return parseFloat(width) * groupWidth * ratio / 100 } _getTotalWidth(widths, groupWidth) { let result = 0; for (let i = 0; i < widths.length; i++) { const width = widths[i]; if (width && "adaptiveHidden" !== width) { result += this._getRealColumnWidth(i, widths, groupWidth) } } return Math.ceil(result) } _getGroupElement() { return this.component.$element().children().get(0) } updateSize(rootElement) { const that = this; const $rootElement = (0, _renderer.default)(rootElement); const importantMarginClass = that.addWidgetPrefix("important-margin"); if (void 0 === that._hasHeight && $rootElement && $rootElement.is(":visible") && (0, _size.getWidth)($rootElement)) { const $groupElement = $rootElement.children(`.${that.getWidgetContainerClass()}`); if ($groupElement.length) { $groupElement.detach() } that._hasHeight = !!(0, _size.getHeight)($rootElement); const width = (0, _size.getWidth)($rootElement); $rootElement.addClass(importantMarginClass); that._hasWidth = (0, _size.getWidth)($rootElement) === width; $rootElement.removeClass(importantMarginClass); if ($groupElement.length) { $groupElement.appendTo($rootElement) } } } publicMethods() { return ["resize", "updateDimensions"] } _waitAsyncTemplates() { var _this$_columnHeadersV, _this$_rowsView, _this$_footerView; return (0, _deferred.when)(null === (_this$_columnHeadersV = this._columnHeadersView) || void 0 === _this$_columnHeadersV ? void 0 : _this$_columnHeadersV.waitAsyncTemplates(true), null === (_this$_rowsView = this._rowsView) || void 0 === _this$_rowsView ? void 0 : _this$_rowsView.waitAsyncTemplates(true), null === (_this$_footerView = this._footerView) || void 0 === _this$_footerView ? void 0 : _this$_footerView.waitAsyncTemplates(true)) } resize() { if (this.component._requireResize) { return (new _deferred.Deferred).resolve() } const d = new _deferred.Deferred; this._waitAsyncTemplates().done((() => { (0, _deferred.when)(this.updateDimensions()).done(d.resolve).fail(d.reject) })).fail(d.reject); return d.promise() } updateDimensions(checkSize) { const that = this; that._initPostRenderHandlers(); if (!that._checkSize(checkSize)) { return } const prevResult = that._resizeDeferred; const result = that._resizeDeferred = new _deferred.Deferred; (0, _deferred.when)(prevResult).always((() => { (0, _common.deferRender)((() => { if (that._dataController.isLoaded()) { that._synchronizeColumns() } that._resetGroupElementHeight(); (0, _common.deferUpdate)((() => { (0, _common.deferRender)((() => { (0, _common.deferUpdate)((() => { that._updateDimensionsCore() })) })) })) })).done(result.resolve).fail(result.reject) })); return result.promise() } _resetGroupElementHeight() { const groupElement = this._getGroupElement(); const scrollable = this._rowsView.getScrollable(); if (groupElement && groupElement.style.height && (!scrollable || !scrollable.scrollTop())) { groupElement.style.height = "" } } _checkSize(checkSize) { const $rootElement = this.component.$element(); const isWidgetVisible = $rootElement.is(":visible"); const isGridSizeChanged = this._lastWidth !== (0, _size.getWidth)($rootElement) || this._lastHeight !== (0, _size.getHeight)($rootElement) || this._devicePixelRatio !== (0, _window.getWindow)().devicePixelRatio; return isWidgetVisible && (!checkSize || isGridSizeChanged) } _setScrollerSpacingCore() { const that = this; const vScrollbarWidth = that._rowsView.getScrollbarWidth(); const hScrollbarWidth = that._rowsView.getScrollbarWidth(true); (0, _common.deferRender)((() => { that._columnHeadersView && that._columnHeadersView.setScrollerSpacing(vScrollbarWidth); that._footerView && that._footerView.setScrollerSpacing(vScrollbarWidth); that._rowsView.setScrollerSpacing(vScrollbarWidth, hScrollbarWidth) })) } _setScrollerSpacing() { const scrollable = this._rowsView.getScrollable(); const isNativeScrolling = true === this.option("scrolling.useNative"); if (!scrollable || isNativeScrolling) { (0, _common.deferRender)((() => { (0, _common.deferUpdate)((() => { this._setScrollerSpacingCore() })) })) } else { this._setScrollerSpacingCore() } } _setAriaOwns() { var _this$_columnHeadersV2, _this$_footerView2, _this$_rowsView2; const headerTable = null === (_this$_columnHeadersV2 = this._columnHeadersView) || void 0 === _this$_columnHeadersV2 ? void 0 : _this$_columnHeadersV2.getTableElement(); const footerTable = null === (_this$_footerView2 = this._footerView) || void 0 === _this$_footerView2 ? void 0 : _this$_footerView2.getTableElement(); null === (_this$_rowsView2 = this._rowsView) || void 0 === _this$_rowsView2 || _this$_rowsView2.setAriaOwns(null === headerTable || void 0 === headerTable ? void 0 : headerTable.attr("id"), null === footerTable || void 0 === footerTable ? void 0 : footerTable.attr("id")) } _updateDimensionsCore() { const that = this; const dataController = that._dataController; const rowsView = that._rowsView; const $rootElement = that.component.$element(); const groupElement = this._getGroupElement(); const rootElementHeight = (0, _size.getHeight)($rootElement); const height = that.option("height") ?? $rootElement.get(0).style.height; const isHeightSpecified = !!height && "auto" !== height; const maxHeight = parseInt($rootElement.css("maxHeight")); const maxHeightHappened = maxHeight && rootElementHeight >= maxHeight; const isMaxHeightApplied = groupElement && groupElement.scrollHeight === groupElement.offsetHeight; that.updateSize($rootElement); (0, _common.deferRender)((() => { const hasHeight = that._hasHeight || !!maxHeight || isHeightSpecified; rowsView.hasHeight(hasHeight); this._setAriaOwns(); if (maxHeightHappened && !isMaxHeightApplied) { (0, _renderer.default)(groupElement).css("height", maxHeight) } if (!dataController.isLoaded()) { rowsView.setLoading(dataController.isLoading()); return }(0, _common.deferUpdate)((() => { that._updateLastSizes($rootElement); that._setScrollerSpacing(); (0, _iterator.each)(VIEW_NAMES, ((index, viewName) => { const view = that.getView(viewName); if (view) { view.resize() } })); this._editorFactoryController && this._editorFactoryController.resize() })) })) } _updateLastSizes($rootElement) { this._lastWidth = (0, _size.getWidth)($rootElement); this._lastHeight = (0, _size.getHeight)($rootElement); this._devicePixelRatio = (0, _window.getWindow)().devicePixelRatio } optionChanged(args) { switch (args.name) { case "width": case "height": this.component._renderDimensions(); this.resize(); case "renderAsync": args.handled = true; return; default: super.optionChanged(args) } } } exports.ResizingController = ResizingController; class SynchronizeScrollingController extends _m_modules.default.ViewController { _scrollChangedHandler(views, pos, viewName) { for (let j = 0; j < views.length; j++) { if (views[j] && views[j].name !== viewName) { views[j].scrollTo({ left: pos.left, top: pos.top }) } } } init() { const views = [this.getView("columnHeadersView"), this.getView("footerView"), this.getView("rowsView")]; for (let i = 0; i < views.length; i++) { const view = views[i]; if (view) { view.scrollChanged.add(this._scrollChangedHandler.bind(this, views)) } } } } exports.SynchronizeScrollingController = SynchronizeScrollingController; class GridView extends _m_modules.default.View { init() { this._resizingController = this.getController("resizing"); this._dataController = this.getController("data") } _endUpdateCore() { if (this.component._requireResize) { this.component._requireResize = false; this._resizingController.resize() } } getView(name) { return this.component._views[name] } element() { return this._groupElement } optionChanged(args) { const that = this; if ((0, _type.isDefined)(that._groupElement) && "showBorders" === args.name) { that._groupElement.toggleClass(that.addWidgetPrefix("borders"), !!args.value); args.handled = true } else { super.optionChanged(args) } } _renderViews($groupElement) { const that = this; (0, _iterator.each)(VIEW_NAMES, ((index, viewName) => { const view = that.getView(viewName); if (view) { view.render($groupElement) } })) } _getTableRoleName() { return "group" } render($rootElement) { const isFirstRender = !this._groupElement; const $groupElement = this._groupElement || (0, _renderer.default)("
").addClass(this.getWidgetContainerClass()); $groupElement.addClass("dx-gridbase-container"); $groupElement.toggleClass(this.addWidgetPrefix("borders"), !!this.option("showBorders")); this.setAria("role", "presentation", $rootElement); this.component.setAria("role", this._getTableRoleName(), $groupElement); this._rootElement = $rootElement || this._rootElement; if (isFirstRender) { this._groupElement = $groupElement; (0, _window.hasWindow)() && this._resizingController.updateSize($rootElement); $groupElement.appendTo($rootElement) } if (!this._a11yGeneralStatusElement) { this._a11yGeneralStatusElement = (0, _a11y_status_container_component.A11yStatusContainerComponent)({}); this._a11yGeneralStatusElement.attr(E2E_ATTRIBUTES_a11yStatusContainer, "true"); $groupElement.append(this._a11yGeneralStatusElement) } this._renderViews($groupElement) } update() { const that = this; const $rootElement = that._rootElement; const $groupElement = that._groupElement; if ($rootElement && $groupElement) { this._resizingController.resize(); if (that._dataController.isLoaded()) { that._resizingController.fireContentReadyAction() } } } setWidgetA11yStatusText(statusText) { var _this$_a11yGeneralSta; null === (_this$_a11yGeneralSta = this._a11yGeneralStatusElement) || void 0 === _this$_a11yGeneralSta || _this$_a11yGeneralSta.text(statusText) } } exports.GridView = GridView; exports.gridViewModule = { defaultOptions: () => ({ showBorders: false, renderAsync: false }), controllers: { resizing: ResizingController, synchronizeScrolling: SynchronizeScrollingController }, views: { gridView: GridView }, VIEW_NAMES: VIEW_NAMES } }, 35095: /*!*********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/views/m_rows_view.js ***! \*********************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.rowsModule = exports.RowsView = void 0; var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _browser = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/browser */ 47810)); var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _data = __webpack_require__( /*! ../../../../core/utils/data */ 47617); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _position = __webpack_require__( /*! ../../../../core/utils/position */ 37518); var _size = __webpack_require__( /*! ../../../../core/utils/size */ 58664); var _string = __webpack_require__( /*! ../../../../core/utils/string */ 68752); var _style = __webpack_require__( /*! ../../../../core/utils/style */ 80968); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _window = __webpack_require__( /*! ../../../../core/utils/window */ 58201); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../../events/core/events_engine */ 55994)); var _remove = __webpack_require__( /*! ../../../../events/remove */ 29007); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109)); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/scroll_view/ui.scrollable */ 41183)); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../m_utils */ 60082)); var _m_columns_view = __webpack_require__( /*! ./m_columns_view */ 57318); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } function getMaxHorizontalScrollOffset(scrollable) { return scrollable ? Math.round(scrollable.scrollWidth() - scrollable.clientWidth()) : 0 } function isGroupRow(_ref) { let { rowType: rowType, column: column } = _ref; return "group" === rowType && (0, _type.isDefined)(column.groupIndex) && !column.showWhenGrouped && !column.command } function setWatcher(_ref2) { let { element: element, watch: watch, getter: getter, callBack: callBack } = _ref2; if (watch) { const dispose = watch(getter, callBack); _events_engine.default.on(element, _remove.removeEvent, dispose) } } const defaultCellTemplate = function($container, options) { const isDataTextEmpty = (0, _string.isEmpty)(options.text) && "data" === options.rowType; const { text: text } = options; const container = $container.get(0); if (isDataTextEmpty) { _m_utils.default.setEmptyText($container) } else if (options.column.encodeHtml) { container.textContent = text } else { container.innerHTML = text } }; class RowsView extends _m_columns_view.ColumnsView { init() { super.init(); this._editingController = this.getController("editing"); this._resizingController = this.getController("resizing"); this._columnsResizerController = this.getController("columnsResizer"); this._focusController = this.getController("focus"); this._keyboardNavigationController = this.getController("keyboardNavigation"); this._validatingController = this.getController("validating"); this._errorHandlingController = this.getController("errorHandling"); this._columnHeadersView = this.getView("columnHeadersView"); this._rowHeight = 0; this._scrollTop = 0; this._scrollLeft = -1; this._scrollRight = 0; this._hasHeight = void 0; this._contentChanges = []; this._dataController.loadingChanged.add(((isLoading, messageText) => { this.setLoading(isLoading, messageText) })); this._dataController.dataSourceChanged.add((() => { if (this._scrollLeft >= 0 && !this._dataController.isLoading()) { this._handleScroll({ component: this.getScrollable(), forceUpdateScrollPosition: true, scrollOffset: { top: this._scrollTop, left: this._scrollLeft } }) } })) } _getDefaultTemplate(column) { if ("empty" === column.command) { return function(container) { container.html(" ") } } else { return defaultCellTemplate } } renderFocusState(params) {} _getDefaultGroupTemplate(column) { const summaryTexts = this.option("summary.texts"); return function($container, options) { const { data: data } = options; let text = `${options.column.caption}: ${options.text}`; const container = $container.get(0); if (options.summaryItems && options.summaryItems.length) { text += ` ${_m_utils.default.getGroupRowSummaryText(options.summaryItems,summaryTexts)}` } if (data) { if (options.groupContinuedMessage && options.groupContinuesMessage) { text += ` (${options.groupContinuedMessage}. ${options.groupContinuesMessage})` } else if (options.groupContinuesMessage) { text += ` (${options.groupContinuesMessage})` } else if (options.groupContinuedMessage) { text += ` (${options.groupContinuedMessage})` } } if (column.encodeHtml) { container.textContent = text } else { container.innerHTML = text } } } _update(change) {} _updateCell($cell, options) { if (isGroupRow(options)) { $cell.addClass("dx-group-cell") } super._updateCell.apply(this, arguments) } _getCellTemplate(options) { const that = this; const { column: column } = options; let template; if (isGroupRow(options)) { template = column.groupCellTemplate || { allowRenderToDetachedContainer: true, render: that._getDefaultGroupTemplate(column) } } else if (("data" === options.rowType || column.command) && column.cellTemplate) { template = column.cellTemplate } else { template = { allowRenderToDetachedContainer: true, render: that._getDefaultTemplate(column) } } return template } _createRow(row, tag) { const $row = super._createRow.apply(this, arguments); if (row) { const isGroup = "group" === row.rowType; const isDataRow = "data" === row.rowType; isDataRow && $row.addClass("dx-data-row"); isDataRow && this.option("showRowLines") && $row.addClass("dx-row-lines"); this.option("showColumnLines") && $row.addClass("dx-column-lines"); if (false === row.visible) { $row.hide() } if (isGroup) { $row.addClass("dx-group-row"); this.setAriaExpandedAttribute($row, row) } } return $row } _rowPrepared($row, rowOptions, row) { if ("data" === rowOptions.rowType) { if (this.option("rowAlternationEnabled")) { this._isAltRow(row) && $row.addClass("dx-row-alt"); setWatcher({ element: $row.get(0), watch: rowOptions.watch, getter: () => this._isAltRow(row), callBack: value => { $row.toggleClass("dx-row-alt", value) } }) } this._setAriaRowIndex(rowOptions, $row); setWatcher({ element: $row.get(0), watch: rowOptions.watch, getter: () => rowOptions.rowIndex, callBack: () => this._setAriaRowIndex(rowOptions, $row) }) } super._rowPrepared.apply(this, arguments) } _setAriaRowIndex(row, $row) { if (!$row.is("tr")) { return } const { component: component } = this; const isPagerMode = "standard" === component.option("scrolling.mode") && !_m_utils.default.isVirtualRowRendering(component); let rowIndex = row.rowIndex + 1; if (isPagerMode) { rowIndex = component.pageIndex() * component.pageSize() + rowIndex } else { rowIndex += this._dataController.getRowIndexOffset() } this.setAria("rowindex", rowIndex, $row) } setAriaExpandedAttribute($row, row) { const description = row.isExpanded ? this.localize("dxDataGrid-ariaExpandedRow") : this.localize("dxDataGrid-ariaCollapsedRow"); this.setAria("roledescription", description, $row) } _afterRowPrepared(e) { const arg = e.args[0]; const dataController = this._dataController; const row = dataController.getVisibleRows()[arg.rowIndex]; const watch = this.option("integrationOptions.watchMethod"); if (!arg.data || "data" !== arg.rowType || arg.isNewRow || !this.option("twoWayBindingEnabled") || !watch || !row) { return } const dispose = watch((() => dataController.generateDataValues(arg.data, arg.columns)), (() => { dataController.repaintRows([row.rowIndex], this.option("repaintChangesOnly")) }), { deep: true, skipImmediate: true }); _events_engine.default.on(arg.rowElement, _remove.removeEvent, dispose) } _renderScrollable(force) { const that = this; const $element = that.element(); if (!$element.children().length) { $element.append("
") } if (force || !that._loadPanel) { that._renderLoadPanel($element, $element.parent(), that._dataController.isLocalStore()) } if ((force || !that.getScrollable()) && that._dataController.isLoaded()) { const columns = that.getColumns(); let allColumnsHasWidth = true; for (let i = 0; i < columns.length; i++) { if (!columns[i].width && !columns[i].minWidth) { allColumnsHasWidth = false; break } } if (that.option("columnAutoWidth") || that._hasHeight || allColumnsHasWidth || that._columnsController._isColumnFixing()) { that._renderScrollableCore($element) } } } _handleScroll(e) { const rtlEnabled = this.option("rtlEnabled"); const isNativeScrolling = e.component.option("useNative"); this._scrollTop = e.scrollOffset.top; this._scrollLeft = e.scrollOffset.left; let scrollLeft = e.scrollOffset.left; if (rtlEnabled) { this._scrollRight = getMaxHorizontalScrollOffset(e.component) - this._scrollLeft; if (isNativeScrolling) { scrollLeft = -this._scrollRight } if (!this.isScrollbarVisible(true)) { this._scrollLeft = -1 } } this.scrollChanged.fire(_extends({}, e.scrollOffset, { left: scrollLeft }), this.name) } _renderScrollableCore($element) { const dxScrollableOptions = this._createScrollableOptions(); const scrollHandler = this._handleScroll.bind(this); dxScrollableOptions.onScroll = scrollHandler; this._scrollable = this._createComponent($element, _ui.default, dxScrollableOptions); this._scrollableContainer = this._scrollable && (0, _renderer.default)(this._scrollable.container()) } _renderLoadPanel() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key] } return _m_utils.default.renderLoadPanel.apply(this, arguments) } _renderContent(contentElement, tableElement, isFixedTableRendering) { contentElement.empty().append(tableElement); return this._findContentElement() } _updateContent(newTableElement, change, isFixedTableRendering) { this._contentChanges.push({ newTableElement: newTableElement, change: change, isFixedTableRendering: isFixedTableRendering }); return this.waitAsyncTemplates().done((() => { const contentChanges = this._contentChanges; this._contentChanges = []; contentChanges.forEach((_ref3 => { let { newTableElement: newTableElement, change: change, isFixedTableRendering: isFixedTableRendering } = _ref3; const tableElement = this.getTableElement(isFixedTableRendering); const contentElement = this._findContentElement(isFixedTableRendering); const changeType = null === change || void 0 === change ? void 0 : change.changeType; const executors = []; const highlightChanges = this.option("highlightChanges"); const rowInsertedClass = this.addWidgetPrefix("row-inserted-animation"); if ("update" === changeType) { (0, _iterator.each)(change.rowIndices, ((index, rowIndex) => { var _change$changeTypes; const $newRowElement = this._getRowElements(newTableElement).eq(index); const dataChangeType = null === (_change$changeTypes = change.changeTypes) || void 0 === _change$changeTypes ? void 0 : _change$changeTypes[index]; const item = change.items && change.items[index]; executors.push((() => { const $rowElements = this._getRowElements(tableElement); const $rowElement = $rowElements.eq(rowIndex); switch (dataChangeType) { case "update": if (item) { var _change$columnIndices; const columnIndices = null === (_change$columnIndices = change.columnIndices) || void 0 === _change$columnIndices ? void 0 : _change$columnIndices[index]; if ((0, _type.isDefined)(item.visible) && item.visible !== $rowElement.is(":visible")) { $rowElement.toggle(item.visible) } else if (columnIndices) { this._updateCells($rowElement, $newRowElement, columnIndices) } else { $rowElement.replaceWith($newRowElement) } } break; case "insert": if (!$rowElements.length) { if (tableElement) { const target = $newRowElement.is("tbody") ? tableElement : tableElement.children("tbody"); $newRowElement.prependTo(target) } } else if ($rowElement.length) { $newRowElement.insertBefore($rowElement) } else { $newRowElement.insertAfter($rowElements.last()) } if (highlightChanges && change.isLiveUpdate) { $newRowElement.addClass(rowInsertedClass) } break; case "remove": $rowElement.remove() } })) })); (0, _iterator.each)(executors, (function() { this() })); newTableElement.remove() } else { this.setTableElement(newTableElement, isFixedTableRendering); contentElement.addClass(this.addWidgetPrefix("content")); this._setGridRole(contentElement); this._renderContent(contentElement, newTableElement, isFixedTableRendering) } })) })).fail((() => { this._contentChanges = [] })) } _getGridRoleName() { return "grid" } _setGridRole($element) { var _this$_dataController; const hasData = !(null !== (_this$_dataController = this._dataController) && void 0 !== _this$_dataController && _this$_dataController.isEmpty()); const gridRoleName = this._getGridRoleName(); if (null !== $element && void 0 !== $element && $element.length && hasData) { this.setAria("role", gridRoleName, $element) } } _createEmptyRow(className, isFixed, height) { const that = this; let $cell; const $row = that._createRow(); const columns = isFixed ? this.getFixedColumns() : this.getColumns(); $row.addClass(className).toggleClass("dx-column-lines", that.option("showColumnLines")); for (let i = 0; i < columns.length; i++) { $cell = that._createCell({ column: columns[i], rowType: "freeSpace", columnIndex: i, columns: columns }); (0, _type.isNumeric)(height) && $cell.css("height", height); $row.append($cell) } that.setAria("role", "presentation", $row); return $row } getFixedColumns() { throw new Error("Method not implemented.") } _appendEmptyRow($table, $emptyRow, location) { const $tBodies = this._getBodies($table); const isTableContainer = !$tBodies.length || $emptyRow.is("tbody"); const $container = isTableContainer ? $table : $tBodies; if ("top" === location) { $container.first().prepend($emptyRow); if (isTableContainer) { const $colgroup = $container.children("colgroup"); $container.prepend($colgroup) } } else { $container.last().append($emptyRow) } } _renderFreeSpaceRow($tableElement, change) { let $freeSpaceRowElement = this._createEmptyRow("dx-freespace-row"); $freeSpaceRowElement = this._wrapRowIfNeed($tableElement, $freeSpaceRowElement, "refresh" === (null === change || void 0 === change ? void 0 : change.changeType)); this._appendEmptyRow($tableElement, $freeSpaceRowElement) } _checkRowKeys(options) { const that = this; const rows = that._getRows(options); const keyExpr = that._dataController.store() && that._dataController.store().key(); keyExpr && rows.some((row => { if ("data" === row.rowType && void 0 === row.key) { that._dataController.fireError("E1046", keyExpr); return true } return })) } _needUpdateRowHeight(itemsCount) { return itemsCount > 0 && !this._rowHeight } _getRowsHeight($tableElement) { $tableElement = $tableElement || this._tableElement; const $rowElements = $tableElement.children("tbody").children().not(".dx-virtual-row").not(".dx-freespace-row"); return $rowElements.toArray().reduce(((sum, row) => sum + (0, _position.getBoundingRect)(row).height), 0) } _updateRowHeight() { const that = this; const $tableElement = that.getTableElement(); const itemsCount = that._dataController.items().length; if ($tableElement && that._needUpdateRowHeight(itemsCount)) { const rowsHeight = that._getRowsHeight($tableElement); that._rowHeight = rowsHeight / itemsCount } } _findContentElement(isFixedTableRendering) { let $content = this.element(); const scrollable = this.getScrollable(); if ($content) { if (scrollable) { $content = (0, _renderer.default)(scrollable.content()) } return $content.children().first() } } _getRowElements(tableElement) { const $rows = super._getRowElements(tableElement); return $rows && $rows.not(".dx-freespace-row") } _getFreeSpaceRowElements($table) { const tableElements = $table || this.getTableElements(); return tableElements && tableElements.children("tbody").children(".dx-freespace-row") } _getNoDataText() { return this.option("noDataText") } _rowClick(e) { const item = this._dataController.items()[e.rowIndex] || {}; this.executeAction("onRowClick", (0, _extend.extend)({ evaluate(expr) { const getter = (0, _data.compileGetter)(expr); return getter(item.data) } }, e, item)) } _rowDblClick(e) { const item = this._dataController.items()[e.rowIndex] || {}; this.executeAction("onRowDblClick", (0, _extend.extend)({}, e, item)) } _getColumnsCountBeforeGroups(columns) { for (let i = 0; i < columns.length; i++) { if ("groupExpand" === columns[i].type) { return i } } return 0 } _getGroupCellOptions(options) { const columnsCountBeforeGroups = this._getColumnsCountBeforeGroups(options.columns); const columnIndex = (options.row.groupIndex || 0) + columnsCountBeforeGroups; return { columnIndex: columnIndex, colspan: options.columns.length - columnIndex - 1 } } _needWrapRow() { return super._needWrapRow.apply(this, arguments) || !!this.option("dataRowTemplate") } _renderCells($row, options) { if ("group" === options.row.rowType) { this._renderGroupedCells($row, options) } else if (options.row.values) { super._renderCells($row, options) } } _renderGroupedCells($row, options) { const { row: row } = options; let expandColumn; const { columns: columns } = options; const { rowIndex: rowIndex } = row; let isExpanded; const groupCellOptions = this._getGroupCellOptions(options); for (let i = 0; i <= groupCellOptions.columnIndex; i++) { if (i === groupCellOptions.columnIndex && columns[i].allowCollapsing && "infinite" !== options.scrollingMode) { isExpanded = !!row.isExpanded; expandColumn = columns[i] } else { isExpanded = null; expandColumn = { command: "expand", cssClass: columns[i].cssClass } } if (this._needRenderCell(i, options.columnIndices)) { this._renderCell($row, { value: isExpanded, row: row, rowIndex: rowIndex, column: expandColumn, columnIndex: i, columnIndices: options.columnIndices, change: options.change }) } } const groupColumnAlignment = (0, _position.getDefaultAlignment)(this.option("rtlEnabled")); const groupColumn = (0, _extend.extend)({}, columns[groupCellOptions.columnIndex], { command: null, type: null, cssClass: null, width: null, showWhenGrouped: false, alignment: groupColumnAlignment }); if (groupCellOptions.colspan > 1) { groupColumn.colspan = groupCellOptions.colspan } if (this._needRenderCell(groupCellOptions.columnIndex + 1, options.columnIndices)) { this._renderCell($row, { value: row.values[row.groupIndex], row: row, rowIndex: rowIndex, column: groupColumn, columnIndex: groupCellOptions.columnIndex + 1, columnIndices: options.columnIndices, change: options.change }) } } _renderRows($table, options) { const that = this; const scrollingMode = that.option("scrolling.mode"); super._renderRows($table, (0, _extend.extend)({ scrollingMode: scrollingMode }, options)); that._checkRowKeys(options.change); that._renderFreeSpaceRow($table, options.change); if (!that._hasHeight) { that.updateFreeSpaceRowHeight($table) } } _renderDataRowByTemplate($table, options, dataRowTemplate) { const { row: row } = options; const rowOptions = (0, _extend.extend)({ columns: options.columns }, row); const $tbody = this._createRow(row, "tbody"); $tbody.appendTo($table); this.renderTemplate($tbody, dataRowTemplate, rowOptions, true, options.change); this._rowPrepared($tbody, rowOptions, options.row) } _renderRow($table, options) { const { row: row } = options; const { rowTemplate: rowTemplate } = this.option(); const dataRowTemplate = this.option("dataRowTemplate"); if ("data" === row.rowType && dataRowTemplate) { this._renderDataRowByTemplate($table, options, dataRowTemplate) } else if (("data" === row.rowType || "group" === row.rowType) && !(0, _type.isDefined)(row.groupIndex) && rowTemplate) { this.renderTemplate($table, rowTemplate, (0, _extend.extend)({ columns: options.columns }, row), true) } else { super._renderRow($table, options) } } _renderTable(options) { const that = this; const $table = super._renderTable(options); const resizeCompletedHandler = function() { const scrollableInstance = that.getScrollable(); if (scrollableInstance && that.element().closest((0, _window.getWindow)().document).length) { that.resizeCompleted.remove(resizeCompletedHandler); scrollableInstance._visibilityChanged(true) } }; if (!(0, _type.isDefined)(that.getTableElement())) { that.setTableElement($table); that._renderScrollable(true); that.resizeCompleted.add(resizeCompletedHandler) } else { that._renderScrollable() } return $table } _createTable() { const $table = super._createTable.apply(this, arguments); if (this.option().rowTemplate || this.option().dataRowTemplate) { $table.appendTo(this.component.$element()) } return $table } _renderCore(change) { const $element = this.element(); $element.addClass(this.addWidgetPrefix("rowsview")).toggleClass(this.addWidgetPrefix("nowrap"), !this.option("wordWrapEnabled")); $element.toggleClass("dx-empty", this._dataController.isEmpty()); this.setAria("role", "presentation", $element); const $table = this._renderTable({ change: change }); const deferred = this._updateContent($table, change); super._renderCore(change); this._lastColumnWidths = null; return deferred } _getRows(change) { return change && change.items || this._dataController.items() } _getCellOptions(options) { const that = this; const { column: column } = options; const { row: row } = options; const { data: data } = row; const summaryCells = row && row.summaryCells; const { value: value } = options; const displayValue = _m_utils.default.getDisplayValue(column, value, data, row.rowType); const parameters = super._getCellOptions(options); parameters.value = value; parameters.oldValue = options.oldValue; parameters.displayValue = displayValue; parameters.row = row; parameters.key = row.key; parameters.data = data; parameters.rowType = row.rowType; parameters.values = row.values; parameters.text = !column.command ? _m_utils.default.formatValue(displayValue, column) : ""; parameters.rowIndex = row.rowIndex; parameters.summaryItems = summaryCells && summaryCells[options.columnIndex]; parameters.resized = column.resizedCallbacks; if ((0, _type.isDefined)(column.groupIndex) && !column.command) { const groupingTextsOptions = that.option("grouping.texts"); const scrollingMode = that.option("scrolling.mode"); if ("virtual" !== scrollingMode && "infinite" !== scrollingMode) { parameters.groupContinuesMessage = data && data.isContinuationOnNextPage && groupingTextsOptions && groupingTextsOptions.groupContinuesMessage; parameters.groupContinuedMessage = data && data.isContinuation && groupingTextsOptions && groupingTextsOptions.groupContinuedMessage } } return parameters } _setRowsOpacityCore($rows, visibleColumns, columnIndex, value) { const columnsController = this._columnsController; const columns = columnsController.getColumns(); const column = columns && columns[columnIndex]; const columnID = column && column.isBand && column.index; (0, _iterator.each)($rows, ((rowIndex, row) => { if (!(0, _renderer.default)(row).hasClass("dx-group-row")) { for (let i = 0; i < visibleColumns.length; i++) { if ((0, _type.isNumeric)(columnID) && columnsController.isParentBandColumn(visibleColumns[i].index, columnID) || visibleColumns[i].index === columnIndex) { $rows.eq(rowIndex).children().eq(i).css({ opacity: value }); if (!(0, _type.isNumeric)(columnID)) { break } } } } })) } _getDevicePixelRatio() { return (0, _window.getWindow)().devicePixelRatio } renderNoDataText() { return _m_utils.default.renderNoDataText.apply(this, arguments) } getCellOptions(rowIndex, columnIdentifier) { const rowOptions = this._dataController.items()[rowIndex]; let cellOptions; let column; if (rowOptions) { if ((0, _type.isString)(columnIdentifier)) { column = this._columnsController.columnOption(columnIdentifier) } else { column = this._columnsController.getVisibleColumns()[columnIdentifier] } if (column) { cellOptions = this._getCellOptions({ value: column.calculateCellValue(rowOptions.data), rowIndex: rowOptions.rowIndex, row: rowOptions, column: column }) } } return cellOptions } getRow(index) { if (index >= 0) { const rows = this._getRowElements(); if (rows.length > index) { return (0, _renderer.default)(rows[index]) } } return } updateFreeSpaceRowHeight($table) { const dataController = this._dataController; const itemCount = dataController.items(true).length; const contentElement = this._findContentElement(); const freeSpaceRowElements = this._getFreeSpaceRowElements($table); if (freeSpaceRowElements && contentElement && dataController.totalCount() >= 0) { let isFreeSpaceRowVisible = false; if (itemCount > 0) { if (!this._hasHeight) { const freeSpaceRowCount = dataController.pageSize() - itemCount; const scrollingMode = this.option("scrolling.mode"); if (freeSpaceRowCount > 0 && dataController.pageCount() > 1 && "virtual" !== scrollingMode && "infinite" !== scrollingMode) { (0, _style.setHeight)(freeSpaceRowElements, freeSpaceRowCount * this._rowHeight); isFreeSpaceRowVisible = true } if (!isFreeSpaceRowVisible && $table) { (0, _style.setHeight)(freeSpaceRowElements, 0) } else { freeSpaceRowElements.toggle(isFreeSpaceRowVisible) } this._updateLastRowBorder(isFreeSpaceRowVisible) } else { freeSpaceRowElements.hide(); (0, _common.deferUpdate)((() => { const scrollbarWidth = this.getScrollbarWidth(true); const elementHeightWithoutScrollbar = (0, _size.getHeight)(this.element()) - scrollbarWidth; const contentHeight = (0, _size.getOuterHeight)(contentElement); const showFreeSpaceRow = elementHeightWithoutScrollbar - contentHeight > 0; const rowsHeight = this._getRowsHeight(contentElement.children().first()); const $tableElement = $table || this.getTableElements(); const borderTopWidth = Math.ceil(parseFloat($tableElement.css("borderTopWidth"))); const heightCorrection = this._getHeightCorrection(); const resultHeight = elementHeightWithoutScrollbar - rowsHeight - borderTopWidth - heightCorrection; if (showFreeSpaceRow) { (0, _common.deferRender)((() => { freeSpaceRowElements.css("height", resultHeight); isFreeSpaceRowVisible = true; freeSpaceRowElements.show() })) }(0, _common.deferRender)((() => this._updateLastRowBorder(isFreeSpaceRowVisible))) })) } } else { freeSpaceRowElements.css("height", 0); freeSpaceRowElements.show(); this._updateLastRowBorder(true) } } } _getHeightCorrection() { const isZoomedWebkit = _browser.default.webkit && this._getDevicePixelRatio() >= 2; const isChromeLatest = _browser.default.chrome && _browser.default.version >= 91; const hasExtraBorderTop = _browser.default.mozilla && _browser.default.version >= 70 && !this.option("showRowLines"); return isZoomedWebkit || hasExtraBorderTop || isChromeLatest ? 1 : 0 } _columnOptionChanged(e) { const { optionNames: optionNames } = e; if (e.changeTypes.grouping) { return } if (optionNames.width || optionNames.visibleWidth) { super._columnOptionChanged(e); this._fireColumnResizedCallbacks() } } getScrollable() { return this._scrollable } _handleDataChanged(change) { const that = this; switch (change.changeType) { case "refresh": case "prepend": case "append": case "update": that.render(null, change); break; default: that._update(change) } } publicMethods() { return ["isScrollbarVisible", "getTopVisibleRowData", "getScrollbarWidth", "getCellElement", "getRowElement", "getScrollable"] } contentWidth() { return (0, _size.getWidth)(this.element()) - this.getScrollbarWidth() } getScrollbarWidth(isHorizontal) { const scrollableContainer = this._scrollableContainer && this._scrollableContainer.get(0); let scrollbarWidth = 0; if (scrollableContainer) { if (!isHorizontal) { scrollbarWidth = scrollableContainer.clientWidth ? scrollableContainer.offsetWidth - scrollableContainer.clientWidth : 0 } else { scrollbarWidth = scrollableContainer.clientHeight ? scrollableContainer.offsetHeight - scrollableContainer.clientHeight : 0; scrollbarWidth += function(that) { const scrollable = that.getScrollable(); return scrollable ? Math.ceil(parseFloat((0, _renderer.default)(scrollable.content()).css("paddingBottom"))) : 0 }(this) } } return scrollbarWidth > 0 ? scrollbarWidth : 0 } _fireColumnResizedCallbacks() { const lastColumnWidths = this._lastColumnWidths || []; const columnWidths = []; const columns = this.getColumns(); for (let i = 0; i < columns.length; i++) { columnWidths[i] = columns[i].visibleWidth; if (columns[i].resizedCallbacks && !(0, _type.isDefined)(columns[i].groupIndex) && lastColumnWidths[i] !== columnWidths[i]) { columns[i].resizedCallbacks.fire(columnWidths[i]) } } this._lastColumnWidths = columnWidths } _updateLastRowBorder(isFreeSpaceRowVisible) { if (this.option("showBorders") && !isFreeSpaceRowVisible) { this.element().addClass("dx-last-row-border") } else { this.element().removeClass("dx-last-row-border") } } _updateScrollable() { const scrollable = _ui.default.getInstance(this.element()); if (scrollable) { scrollable.update(); if (scrollable.option("useNative") || !(null !== scrollable && void 0 !== scrollable && scrollable.isRenovated())) { this._updateHorizontalScrollPosition() } } } _updateHorizontalScrollPosition() { const scrollable = this.getScrollable(); const scrollLeft = scrollable && scrollable.scrollOffset().left; const rtlEnabled = this.option("rtlEnabled"); if (rtlEnabled) { const maxHorizontalScrollOffset = getMaxHorizontalScrollOffset(scrollable); const scrollRight = maxHorizontalScrollOffset - scrollLeft; if (scrollRight !== this._scrollRight) { this._scrollLeft = maxHorizontalScrollOffset - this._scrollRight } } if (this._scrollLeft >= 0 && scrollLeft !== this._scrollLeft) { scrollable.scrollTo({ x: this._scrollLeft }) } } _resizeCore() { const that = this; that._fireColumnResizedCallbacks(); that._updateRowHeight(); (0, _common.deferRender)((() => { that._renderScrollable(); that.renderNoDataText(); that.updateFreeSpaceRowHeight(); (0, _common.deferUpdate)((() => { that._updateScrollable() })) })) } scrollTo(location) { const $element = this.element(); const dxScrollable = $element && _ui.default.getInstance($element); if (dxScrollable) { dxScrollable.scrollTo(location) } } height(height) { const that = this; const $element = this.element(); if (0 === arguments.length) { return $element ? (0, _size.getOuterHeight)($element, true) : 0 } if ((0, _type.isDefined)(height) && $element) { that.hasHeight("auto" !== height); (0, _style.setHeight)($element, height) } } hasHeight(hasHeight) { if (0 === arguments.length) { return !!this._hasHeight } this._hasHeight = hasHeight; return } setLoading(isLoading, messageText) { const that = this; let loadPanel = that._loadPanel; const dataController = that._dataController; const loadPanelOptions = that.option("loadPanel") || {}; const animation = dataController.isLoaded() ? loadPanelOptions.animation : null; const $element = that.element(); if (!(0, _window.hasWindow)()) { return } if (!loadPanel && void 0 !== messageText && dataController.isLocalStore() && "auto" === loadPanelOptions.enabled && $element) { that._renderLoadPanel($element, $element.parent()); loadPanel = that._loadPanel } if (loadPanel) { const visibilityOptions = { message: messageText || loadPanelOptions.text, animation: animation, visible: isLoading }; if (isLoading) { visibilityOptions.position = _m_utils.default.calculateLoadPanelPosition($element) } clearTimeout(that._hideLoadingTimeoutID); if (loadPanel.option("visible") && !isLoading) { that._hideLoadingTimeoutID = setTimeout((() => { loadPanel.option(visibilityOptions) }), 200) } else { loadPanel.option(visibilityOptions) } } } setRowsOpacity(columnIndex, value) { const $rows = this._getRowElements().not(".dx-group-row") || []; this._setRowsOpacityCore($rows, this.getColumns(), columnIndex, value) } _getCellElementsCore(rowIndex) { const $cells = super._getCellElementsCore.apply(this, arguments); if ($cells) { const groupCellIndex = $cells.filter(".dx-group-cell").index(); if (groupCellIndex >= 0 && $cells.length > groupCellIndex + 1) { return $cells.slice(0, groupCellIndex + 1) } } return $cells } _getBoundaryVisibleItemIndex(isTop, isFloor) { const that = this; let itemIndex = 0; let prevOffset = 0; let offset = 0; let viewportBoundary = that._scrollTop; const $contentElement = that._findContentElement(); const contentElementOffsetTop = $contentElement && $contentElement.offset().top; const items = this._dataController.items(); const tableElement = that.getTableElement(); if (items.length && tableElement) { const rowElements = that._getRowElements(tableElement).filter(":visible"); if (!isTop) { const height = (0, _size.getOuterHeight)(this._hasHeight ? this.element() : (0, _window.getWindow)()); viewportBoundary += height } for (itemIndex = 0; itemIndex < items.length; itemIndex++) { prevOffset = offset; const $rowElement = (0, _renderer.default)(rowElements).eq(itemIndex); if ($rowElement.length) { offset = $rowElement.offset(); offset = (isTop ? offset.top : offset.top + (0, _size.getOuterHeight)($rowElement)) - contentElementOffsetTop; if (offset > viewportBoundary) { if (itemIndex) { if (isFloor || 2 * viewportBoundary < Math.round(offset + prevOffset)) { itemIndex-- } } break } } } if (itemIndex && itemIndex === items.length) { itemIndex-- } } return itemIndex } getTopVisibleItemIndex(isFloor) { return this._getBoundaryVisibleItemIndex(true, isFloor) } getBottomVisibleItemIndex(isFloor) { return this._getBoundaryVisibleItemIndex(false, isFloor) } getTopVisibleRowData() { const itemIndex = this.getTopVisibleItemIndex(); const items = this._dataController.items(); if (items[itemIndex]) { return items[itemIndex].data } return } _scrollToElement($element, offset) { const scrollable = this.getScrollable(); scrollable && scrollable.scrollToElement($element, offset) } optionChanged(args) { const that = this; super.optionChanged(args); switch (args.name) { case "wordWrapEnabled": case "showColumnLines": case "showRowLines": case "rowAlternationEnabled": case "rowTemplate": case "dataRowTemplate": case "twoWayBindingEnabled": that._invalidate(true, true); args.handled = true; break; case "scrolling": that._rowHeight = null; that._tableElement = null; args.handled = true; break; case "rtlEnabled": that._rowHeight = null; that._tableElement = null; break; case "loadPanel": that._tableElement = null; that._invalidate(true, "loadPanel.enabled" !== args.fullName); args.handled = true; break; case "noDataText": that.renderNoDataText(); args.handled = true } } setAriaOwns(headerTableId, footerTableId, isFixed) { const $contentElement = this._findContentElement(); const $tableElement = this.getTableElement(); if (null !== $tableElement && void 0 !== $tableElement && $tableElement.length) { this.setAria("owns", `${headerTableId??""} ${$tableElement.attr("id")??""} ${footerTableId??""}`.trim(), $contentElement) } } dispose() { super.dispose(); clearTimeout(this._hideLoadingTimeoutID); this._scrollable && this._scrollable.dispose() } setScrollerSpacing(vScrollbarWidth, hScrollbarWidth) {} getFixedContentElement() { var _this$element; const fixedContentClass = this.addWidgetPrefix("content-fixed"); return null === (_this$element = this.element()) || void 0 === _this$element ? void 0 : _this$element.children(`.${fixedContentClass}`) } _restoreErrorRow(contentTable) {} isElementInside($element) { const $rowsViewElement = $element.closest(`.${this.addWidgetPrefix("rowsview")}`); return $rowsViewElement.is(this.element()) } } exports.RowsView = RowsView; exports.rowsModule = { defaultOptions: () => ({ hoverStateEnabled: false, scrolling: { useNative: "auto" }, loadPanel: { enabled: "auto", text: _message.default.format("Loading"), width: 200, height: 90, showIndicator: true, indicatorSrc: "", showPane: true }, dataRowTemplate: null, columnAutoWidth: false, noDataText: _message.default.format("dxDataGrid-noDataText"), wordWrapEnabled: false, showColumnLines: true, showRowLines: false, rowAlternationEnabled: false, activeStateEnabled: false, twoWayBindingEnabled: true }), views: { rowsView: RowsView } } }, 46958: /*!************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/views/utils/update_views_borders.js ***! \************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.updateViewsBorders = void 0; var _type = __webpack_require__( /*! ../../../../../core/utils/type */ 35922); const _excluded = ["rowsView"]; const CLASSES_borderedTop = "dx-bordered-top-view", CLASSES_borderedBottom = "dx-bordered-bottom-view"; const getViewElementWithClass = (viewsWithBorder, className) => { const borderedView = Object.values(viewsWithBorder).find((view => { var _view$element; return null === view || void 0 === view || null === (_view$element = view.element()) || void 0 === _view$element ? void 0 : _view$element.hasClass(className) })); return (null === borderedView || void 0 === borderedView ? void 0 : borderedView.element()) ?? null }; const shouldUpdateBorders = (viewName, viewsWithBorder) => { var _rowsView$element; if (!Object.keys(viewsWithBorder).includes(viewName)) { return false } const { rowsView: rowsView } = viewsWithBorder, otherViews = function(source, excluded) { if (null == source) { return {} } var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) { continue } target[key] = source[key] } } return target }(viewsWithBorder, _excluded); if (!(0, _type.isDefined)(null === rowsView || void 0 === rowsView || null === (_rowsView$element = rowsView.element) || void 0 === _rowsView$element ? void 0 : _rowsView$element.call(rowsView))) { return false } return Object.values(otherViews).filter((view => { var _view$isVisible; return null === view || void 0 === view || null === (_view$isVisible = view.isVisible) || void 0 === _view$isVisible ? void 0 : _view$isVisible.call(view) })).every((view => (0, _type.isDefined)(null === view || void 0 === view ? void 0 : view.element()))) }; exports.updateViewsBorders = (viewName, viewsWithBorder) => { if (!shouldUpdateBorders(viewName, viewsWithBorder)) { return } const $oldFirst = getViewElementWithClass(viewsWithBorder, CLASSES_borderedTop); const $oldLast = getViewElementWithClass(viewsWithBorder, CLASSES_borderedBottom); const $newFirst = (_ref => { let { columnHeadersView: columnHeadersView, rowsView: rowsView } = _ref; if (null !== columnHeadersView && void 0 !== columnHeadersView && columnHeadersView.isVisible()) { return columnHeadersView.element() } return rowsView.element() })(viewsWithBorder); const $newLast = (_ref2 => { let { filterPanelView: filterPanelView, footerView: footerView, rowsView: rowsView } = _ref2; if (null !== filterPanelView && void 0 !== filterPanelView && filterPanelView.isVisible()) { return filterPanelView.element() } if (null !== footerView && void 0 !== footerView && footerView.isVisible()) { return footerView.element() } return rowsView.element() })(viewsWithBorder); if ($oldFirst && !$oldFirst.is($newFirst)) { $oldFirst.removeClass(CLASSES_borderedTop) } if ($oldLast && !$oldLast.is($newLast)) { $oldLast.removeClass(CLASSES_borderedBottom) } if (!$newFirst.hasClass(CLASSES_borderedTop)) { $newFirst.addClass(CLASSES_borderedTop) } if (!$newLast.hasClass(CLASSES_borderedBottom)) { $newLast.addClass(CLASSES_borderedBottom) } } }, 87482: /*!*************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/virtual_columns/m_virtual_columns.js ***! \*************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.virtualColumnsModule = void 0; var _browser = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/browser */ 47810)); var _size = __webpack_require__( /*! ../../../../core/utils/size */ 58664); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _window = __webpack_require__( /*! ../../../../core/utils/window */ 58201); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../m_utils */ 60082)); var _m_virtual_columns_core = __webpack_require__( /*! ./m_virtual_columns_core */ 67814); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const baseView = Base => class extends Base { _needToSetCellWidths() { let result = super._needToSetCellWidths(); if (!result && this._columnsController.isVirtualMode()) { const columns = this._columnsController.getColumns(); result = columns.some((column => "auto" === column.width)) } return result } }; const getWidths = function(columns) { return columns.map((column => column.visibleWidth || parseFloat(column.width) || 50)) }; exports.virtualColumnsModule = { defaultOptions: () => ({ scrolling: { columnRenderingMode: "standard", columnPageSize: 5, columnRenderingThreshold: 300 } }), extenders: { controllers: { columns: Base => class extends Base { init() { super.init.apply(this, arguments); this._resizingController = this.getController("resizing"); this._beginPageIndex = null; this._endPageIndex = null; this._position ?? (this._position = 0); this._virtualVisibleColumns = {} } dispose() { clearTimeout(this._changedTimeout); super.dispose.apply(this, arguments) } resetColumnsCache() { super.resetColumnsCache(); this._virtualVisibleColumns = {} } getBeginPageIndex(position) { const visibleColumns = this.getVisibleColumns(void 0, true); const widths = getWidths(visibleColumns); let currentPosition = 0; for (let index = 0; index < widths.length; index++) { if (currentPosition >= position) { return Math.floor(index / this.getColumnPageSize()) } currentPosition += widths[index] } return 0 } getTotalWidth() { const width = this.option("width"); if ("number" === typeof width) { return width } return this._resizingController._lastWidth || (0, _size.getOuterWidth)(this.component.$element()) } getEndPageIndex(position) { const visibleColumns = this.getVisibleColumns(void 0, true); const widths = getWidths(visibleColumns); let currentPosition = 0; position += this.getTotalWidth(); for (let index = 0; index < widths.length; index++) { if (currentPosition >= position) { return Math.ceil(index / this.getColumnPageSize()) } currentPosition += widths[index] } return Math.ceil(widths.length / this.getColumnPageSize()) } getColumnPageSize() { return this.option("scrolling.columnPageSize") } _fireColumnsChanged() { const date = new Date; this.columnsChanged.fire({ optionNames: { all: true, length: 1 }, changeTypes: { columns: true, virtualColumnsScrolling: true, length: 2 } }); this._renderTime = new Date - date } getScrollingTimeout() { const renderingThreshold = this.option("scrolling.columnRenderingThreshold"); const renderAsync = this.option("scrolling.renderAsync"); let scrollingTimeout = 0; if (!(0, _type.isDefined)(renderAsync) && this._renderTime > renderingThreshold || renderAsync) { scrollingTimeout = this.option("scrolling.timeout") } return scrollingTimeout } setScrollPosition(position) { const scrollingTimeout = this.getScrollingTimeout(); if (scrollingTimeout > 0) { clearTimeout(this._changedTimeout); this._changedTimeout = setTimeout((() => { this._setScrollPositionCore(position) }), scrollingTimeout) } else { this._setScrollPositionCore(position) } } isVirtualMode() { return (0, _window.hasWindow)() && "virtual" === this.option("scrolling.columnRenderingMode") } resize() { this._setScrollPositionCore(this._position) } _setScrollPositionCore(position) { const that = this; if (that.isVirtualMode()) { const beginPageIndex = that.getBeginPageIndex(position); const endPageIndex = that.getEndPageIndex(position); const needColumnsChanged = position < that._position ? that._beginPageIndex > beginPageIndex : that._endPageIndex < endPageIndex; that._position = position; if (needColumnsChanged) { that._beginPageIndex = beginPageIndex; that._endPageIndex = endPageIndex; that._fireColumnsChanged() } } } getFixedColumns(rowIndex, isBase) { const fixedColumns = super.getFixedColumns(rowIndex); if (this.isVirtualMode() && !isBase && fixedColumns.length) { const transparentColumnIndex = fixedColumns.map((c => c.command)).indexOf("transparent"); fixedColumns[transparentColumnIndex].colspan = this.getVisibleColumns().length - super.getFixedColumns().length + 1; return fixedColumns } return fixedColumns } _compileVisibleColumns(rowIndex, isBase) { var _this$_columns; if (isBase || !this.isVirtualMode() || !this._shouldReturnVisibleColumns()) { return super._compileVisibleColumns(rowIndex) } if (null !== (_this$_columns = this._columns) && void 0 !== _this$_columns && _this$_columns.length && !(0, _type.isDefined)(this._beginPageIndex) && !(0, _type.isDefined)(this._endPageIndex)) { this._beginPageIndex = this.getBeginPageIndex(this._position); this._endPageIndex = this.getEndPageIndex(this._position) } const beginPageIndex = this._beginPageIndex; const endPageIndex = this._endPageIndex; const visibleColumnsHash = `${rowIndex}-${beginPageIndex}-${endPageIndex}`; if (this._virtualVisibleColumns[visibleColumnsHash]) { return this._virtualVisibleColumns[visibleColumnsHash] } let visibleColumns = super._compileVisibleColumns(); const rowCount = this.getRowCount(); const pageSize = this.getColumnPageSize(); let startIndex = beginPageIndex * pageSize; let endIndex = endPageIndex * pageSize; const fixedColumns = this.getFixedColumns(void 0, true); const transparentColumnIndex = fixedColumns.map((c => c.command)).indexOf("transparent"); const beginFixedColumnCount = fixedColumns.length ? transparentColumnIndex : 0; let beginFixedColumns = visibleColumns.slice(0, beginFixedColumnCount); const beginColumns = visibleColumns.slice(beginFixedColumnCount, startIndex); const beginWidth = getWidths(beginColumns).reduce(((a, b) => a + b), 0); if (!beginWidth) { startIndex = 0 } const endFixedColumnCount = fixedColumns.length ? fixedColumns.length - transparentColumnIndex - 1 : 0; let endFixedColumns = visibleColumns.slice(visibleColumns.length - endFixedColumnCount); const endColumns = visibleColumns.slice(endIndex, visibleColumns.length - endFixedColumnCount); const endWidth = getWidths(endColumns).reduce(((a, b) => a + b), 0); if (!endWidth) { endIndex = visibleColumns.length } if (rowCount > 1 && "number" === typeof rowIndex) { const columnsInfo = []; for (let i = 0; i <= rowCount; i++) { columnsInfo.push(super._compileVisibleColumns(i)) } beginFixedColumns = (0, _m_virtual_columns_core.createColumnsInfo)(columnsInfo, 0, beginFixedColumns.length)[rowIndex] || []; endFixedColumns = (0, _m_virtual_columns_core.createColumnsInfo)(columnsInfo, visibleColumns.length - endFixedColumns.length, visibleColumns.length)[rowIndex] || []; visibleColumns = (0, _m_virtual_columns_core.createColumnsInfo)(columnsInfo, startIndex, endIndex)[rowIndex] || [] } else { visibleColumns = visibleColumns.slice(startIndex, endIndex) } if (beginWidth) { visibleColumns.unshift({ command: "virtual", type: "virtual", width: beginWidth }); visibleColumns = beginFixedColumns.concat(visibleColumns) } if (endWidth) { visibleColumns.push({ command: "virtual", type: "virtual", width: endWidth }); visibleColumns = visibleColumns.concat(endFixedColumns) } this._virtualVisibleColumns[visibleColumnsHash] = visibleColumns; return visibleColumns } getColumnIndexOffset() { let offset = 0; if (this._beginPageIndex > 0) { const fixedColumns = this.getFixedColumns(); const transparentColumnIndex = fixedColumns.map((c => c.command)).indexOf("transparent"); const leftFixedColumnCount = transparentColumnIndex >= 0 ? transparentColumnIndex : 0; offset = this._beginPageIndex * this.getColumnPageSize() - leftFixedColumnCount - 1 } return offset > 0 ? offset : 0 } } }, views: { columnHeadersView: Base => class extends(baseView(Base)) { _renderCore() { const deferred = super._renderCore.apply(this, arguments); if (this._columnsController.isVirtualMode()) { this._updateScrollLeftPosition() } return deferred } }, rowsView: Base => class extends(baseView(Base)) { _resizeCore() { super._resizeCore.apply(this, arguments); this._columnsController.resize() } _handleScroll(e) { const scrollable = this.getScrollable(); let { left: left } = e.scrollOffset; super._handleScroll.apply(this, arguments); if (this.option("rtlEnabled") && scrollable) { left = (0, _size.getWidth)(scrollable.$content()) - (0, _size.getWidth)(scrollable.$element()) - left } this._columnsController.setScrollPosition(left) } _renderCore(e) { if (null !== e && void 0 !== e && e.virtualColumnsScrolling) { var _this$_columnsControl, _this$_scrollable; const $contentElement = this._findContentElement(); const fixedColumns = null === (_this$_columnsControl = this._columnsController) || void 0 === _this$_columnsControl ? void 0 : _this$_columnsControl.getFixedColumns(); const useNativeScrolling = null === (_this$_scrollable = this._scrollable) || void 0 === _this$_scrollable ? void 0 : _this$_scrollable.option("useNative"); if (null !== fixedColumns && void 0 !== fixedColumns && fixedColumns.length) { $contentElement.css({ minHeight: useNativeScrolling ? (0, _size.getHeight)($contentElement) : _m_utils.default.getContentHeightLimit(_browser.default) }); const resizeCompletedHandler = () => { this.resizeCompleted.remove(resizeCompletedHandler); $contentElement.css({ minHeight: "" }) }; this.resizeCompleted.add(resizeCompletedHandler) } } return super._renderCore.apply(this, arguments) } } } } } }, 67814: /*!******************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/virtual_columns/m_virtual_columns_core.js ***! \******************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.createColumnsInfo = function(info, startIndex, endIndex) { const newInfo = []; foreachColumnInfo(info, ((columnInfo, visibleIndex, rowIndex) => { let cell = columnInfo; let colspan; const cellColspan = cell.colspan || 1; const isVisible = visibleIndex + cellColspan - 1 >= startIndex && visibleIndex < endIndex; newInfo[rowIndex] = newInfo[rowIndex] || []; if (isVisible) { if (visibleIndex < startIndex) { colspan = cellColspan - (startIndex - visibleIndex); visibleIndex = startIndex } else { colspan = cellColspan } if (visibleIndex + colspan > endIndex) { colspan = endIndex - visibleIndex } if (colspan !== cellColspan) { cell = (0, _extend.extend)({}, cell, { colspan: colspan }) } newInfo[rowIndex].push(cell) } else if (visibleIndex > endIndex) { return false } return })); for (let i = 0; i < newInfo.length; i++) { newInfo[i] = newInfo[i] || [] } return newInfo }; exports.foreachColumnInfo = foreachColumnInfo; var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); function foreachColumnInfo(info, callback, rowIndex, offsets, columnCount, lastProcessedIndexes) { rowIndex = rowIndex || 0; offsets = offsets || []; lastProcessedIndexes = lastProcessedIndexes || []; offsets[rowIndex] = offsets[rowIndex] || 0; const row = info[rowIndex]; const startIndex = lastProcessedIndexes[rowIndex] + 1 || 0; let processedColumnCount = 0; let colIndex; if (!row) { return } for (colIndex = startIndex; colIndex < row.length; colIndex++) { const cell = row[colIndex]; const visibleIndex = colIndex + offsets[rowIndex]; const colspan = cell.colspan || 1; foreachColumnInfo(info, callback, rowIndex + (cell.rowspan || 1), offsets, colspan, lastProcessedIndexes); offsets[rowIndex] += colspan - 1; processedColumnCount += colspan; if (cell.rowspan) { for (let i = rowIndex + 1; i < rowIndex + cell.rowspan; i++) { offsets[i] = offsets[i] || 0; offsets[i] += cell.colspan || 1 } } if (false === callback(cell, visibleIndex, rowIndex, colIndex)) { break } if (void 0 !== columnCount && processedColumnCount >= columnCount) { break } } lastProcessedIndexes[rowIndex] = colIndex } }, 20488: /*!*********************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/virtual_data_loader/m_virtual_data_loader.js ***! \*********************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.VirtualDataLoader = void 0; var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); const needTwoPagesLoading = that => that.option("scrolling.loadTwoPagesOnStart") || that._controller.isVirtual() || that._controller.getViewportItemIndex() > 0; const getBeginPageIndex = that => that._cache.length ? that._cache[0].pageIndex : -1; const getEndPageIndex = that => that._cache.length ? that._cache[that._cache.length - 1].pageIndex : -1; const fireChanged = (that, changed, args) => { that._isChangedFiring = true; changed(args); that._isChangedFiring = false }; const processDelayChanged = (that, changed, args) => { if (that._isDelayChanged) { that._isDelayChanged = false; fireChanged(that, changed, args); return true } }; const getPreloadPageCount = (that, previous) => { const preloadEnabled = that.option("scrolling.preloadEnabled"); let pageCount = (that => { const pageSize = that._dataOptions.pageSize(); const preventPreload = that.option("scrolling.preventPreload"); if (preventPreload) { return 0 } let realViewportSize = that._controller.viewportSize(); if (that._controller.isVirtualMode() && that.option("scrolling.removeInvisiblePages")) { realViewportSize = 0; const viewportSize = that._controller.viewportSize() * that._controller.viewportItemSize(); let offset = that._controller.getContentOffset(); const position = that._controller.getViewportPosition(); const virtualItemsCount = that._controller.virtualItemsCount(); const totalItemsCount = that._dataOptions.totalItemsCount(); for (let itemIndex = virtualItemsCount.begin; itemIndex < totalItemsCount; itemIndex++) { if (offset >= position + viewportSize) { break } const itemSize = that._controller.getItemSizes()[itemIndex] || that._controller.viewportItemSize(); offset += itemSize; if (offset >= position) { realViewportSize++ } } } return pageSize && realViewportSize > 0 ? Math.ceil(realViewportSize / pageSize) : 1 })(that); const isAppendMode = that._controller.isAppendMode(); if (pageCount) { if (previous) { pageCount = preloadEnabled ? 1 : 0 } else { if (preloadEnabled) { pageCount++ } if (isAppendMode || !needTwoPagesLoading(that)) { pageCount-- } } } return pageCount }; const processChanged = (that, changed, changeType, isDelayChanged, removeCacheItem) => { const dataOptions = that._dataOptions; const items = dataOptions.items().slice(); let change = (0, _type.isObject)(changeType) ? changeType : void 0; const isPrepend = "prepend" === changeType; const viewportItems = dataOptions.viewportItems(); if (changeType && (0, _type.isString)(changeType) && !that._isDelayChanged) { change = { changeType: changeType, items: items }; if (removeCacheItem) { change.removeCount = removeCacheItem.itemsCount; if (change.removeCount && dataOptions.correctCount) { change.removeCount = dataOptions.correctCount(viewportItems, change.removeCount, isPrepend) } } } let removeItemCount = removeCacheItem ? removeCacheItem.itemsLength : 0; if (removeItemCount && dataOptions.correctCount) { removeItemCount = dataOptions.correctCount(viewportItems, removeItemCount, isPrepend) } if ("append" === changeType) { viewportItems.push.apply(viewportItems, items); if (removeCacheItem) { viewportItems.splice(0, removeItemCount) } } else if (isPrepend) { viewportItems.unshift.apply(viewportItems, items); if (removeCacheItem) { viewportItems.splice(-removeItemCount) } } else { that._dataOptions.viewportItems(items) } dataOptions.updateLoading(); that._lastPageIndex = that.pageIndex(); that._isDelayChanged = isDelayChanged; if (!isDelayChanged) { fireChanged(that, changed, change) } }; exports.VirtualDataLoader = class { constructor(controller, dataOptions) { this._dataOptions = dataOptions; this._controller = controller; this._pageIndex = this._lastPageIndex = dataOptions.pageIndex(); this._cache = []; this._loadingPageIndexes = {} } option() { return this._controller.option.apply(this._controller, arguments) } viewportItemIndexChanged(itemIndex) { const pageSize = this._dataOptions.pageSize(); const pageCount = this._dataOptions.pageCount(); const virtualMode = this._controller.isVirtualMode(); const appendMode = this._controller.isAppendMode(); const totalItemsCount = this._dataOptions.totalItemsCount(); let newPageIndex; if (pageSize && (virtualMode || appendMode) && totalItemsCount >= 0) { const viewportSize = this._controller.viewportSize(); if (viewportSize && itemIndex + viewportSize >= totalItemsCount && !this._controller.isVirtual()) { if (this._dataOptions.hasKnownLastPage()) { newPageIndex = pageCount - 1; const lastPageSize = totalItemsCount % pageSize; if (newPageIndex > 0 && lastPageSize > 0 && lastPageSize < viewportSize) { newPageIndex-- } } else { newPageIndex = pageCount } } else { newPageIndex = Math.floor(itemIndex / pageSize); const maxPageIndex = pageCount - 1; newPageIndex = Math.max(newPageIndex, 0); newPageIndex = Math.min(newPageIndex, maxPageIndex) } this.pageIndex(newPageIndex); return this.load() } } pageIndex(pageIndex) { const isVirtualMode = this._controller.isVirtualMode(); const isAppendMode = this._controller.isAppendMode(); if (false !== this.option("scrolling.legacyMode") && (isVirtualMode || isAppendMode)) { if (void 0 !== pageIndex) { this._pageIndex = pageIndex } return this._pageIndex } return this._dataOptions.pageIndex(pageIndex) } beginPageIndex(defaultPageIndex) { let index = getBeginPageIndex(this); if (index < 0) { index = void 0 !== defaultPageIndex ? defaultPageIndex : this.pageIndex() } return index } endPageIndex() { const endPageIndex = getEndPageIndex(this); return endPageIndex > 0 ? endPageIndex : this._lastPageIndex } pageSize() { return this._dataOptions.pageSize() } load() { const dataOptions = this._dataOptions; let result; const isVirtualMode = this._controller.isVirtualMode(); const isAppendMode = this._controller.isAppendMode(); if (false !== this.option("scrolling.legacyMode") && (isVirtualMode || isAppendMode)) { const pageIndexForLoad = (that => { let result = -1; const beginPageIndex = getBeginPageIndex(that); const dataOptions = that._dataOptions; if (beginPageIndex < 0) { result = that._pageIndex } else if (!that._cache[that._pageIndex - beginPageIndex]) { result = that._pageIndex } else if (beginPageIndex >= 0 && that._controller.viewportSize() >= 0) { if (beginPageIndex > 0) { const needToLoadPageBeforeLast = getEndPageIndex(that) + 1 === dataOptions.pageCount() && that._cache.length < getPreloadPageCount(that) + 1; const needToLoadPrevPage = needToLoadPageBeforeLast || that._pageIndex === beginPageIndex && getPreloadPageCount(that, true); if (needToLoadPrevPage) { result = beginPageIndex - 1 } } if (result < 0) { const needToLoadNextPage = beginPageIndex + that._cache.length <= that._pageIndex + getPreloadPageCount(that); if (needToLoadNextPage) { result = beginPageIndex + that._cache.length } } } if (that._loadingPageIndexes[result]) { result = -1 } return result })(this); if (pageIndexForLoad >= 0) { const loadResult = ((that, pageIndex) => { const dataOptions = that._dataOptions; if (pageIndex === that.pageIndex() || !dataOptions.isLoading() && pageIndex < dataOptions.pageCount() || !dataOptions.hasKnownLastPage() && pageIndex === dataOptions.pageCount()) { dataOptions.pageIndex(pageIndex); that._loadingPageIndexes[pageIndex] = true; return (0, _deferred.when)(dataOptions.load()).always((() => { that._loadingPageIndexes[pageIndex] = false })) } })(this, pageIndexForLoad); if (loadResult) { result = new _deferred.Deferred; loadResult.done((() => { const delayDeferred = this._delayDeferred; if (delayDeferred) { delayDeferred.done(result.resolve).fail(result.reject) } else { result.resolve() } })).fail(result.reject); dataOptions.updateLoading() } } } else { result = dataOptions.load() } if (!result && this._lastPageIndex !== this.pageIndex()) { this._dataOptions.onChanged({ changeType: "pageIndex" }) } return result || (new _deferred.Deferred).resolve() } loadIfNeed() { const isVirtualMode = this._controller.isVirtualMode(); const isAppendMode = this._controller.isAppendMode(); if ((isVirtualMode || isAppendMode) && !this._dataOptions.isLoading() && (!this._isChangedFiring || this._controller.isVirtual())) { const position = this._controller.getViewportPosition(); if (position > 0) { this._controller._setViewportPositionCore(position) } else { this.load() } } } handleDataChanged(callBase, e) { const dataOptions = this._dataOptions; let lastCacheLength = this._cache.length; let changeType; let removeInvisiblePages; const isVirtualMode = this._controller.isVirtualMode(); const isAppendMode = this._controller.isAppendMode(); if (e && e.changes) { fireChanged(this, callBase, e) } else if (false !== this.option("scrolling.legacyMode") && (isVirtualMode || isAppendMode)) { const beginPageIndex = getBeginPageIndex(this); if (beginPageIndex >= 0) { if (isVirtualMode && beginPageIndex + this._cache.length !== dataOptions.pageIndex() && beginPageIndex - 1 !== dataOptions.pageIndex()) { lastCacheLength = 0; this._cache = [] } if (isAppendMode) { if (0 === dataOptions.pageIndex()) { this._cache = [] } else if (dataOptions.pageIndex() < getEndPageIndex(this)) { fireChanged(this, callBase, { changeType: "append", items: [] }); return } } } const cacheItem = { pageIndex: dataOptions.pageIndex(), itemsLength: dataOptions.items(true).length, itemsCount: this.itemsCount(true) }; if (this.option("scrolling.removeInvisiblePages") && isVirtualMode) { removeInvisiblePages = this._cache.length > Math.max(getPreloadPageCount(this) + (this.option("scrolling.preloadEnabled") ? 1 : 0), 2) } else { processDelayChanged(this, callBase, { isDelayed: true }) } let removeCacheItem; if (beginPageIndex === dataOptions.pageIndex() + 1) { if (removeInvisiblePages) { removeCacheItem = this._cache.pop() } changeType = "prepend"; this._cache.unshift(cacheItem) } else { if (removeInvisiblePages) { removeCacheItem = this._cache.shift() } changeType = "append"; this._cache.push(cacheItem) } const isDelayChanged = isVirtualMode && 0 === lastCacheLength && needTwoPagesLoading(this); processChanged(this, callBase, this._cache.length > 1 ? changeType : void 0, isDelayChanged, removeCacheItem); this._delayDeferred = this.load().done((() => { if (processDelayChanged(this, callBase)) { this.load() } })) } else { processChanged(this, callBase, e) } } getDelayDeferred() { return this._delayDeferred } itemsCount(isBase) { let count = 0; const isVirtualMode = this._controller.isVirtualMode(); if (!isBase && isVirtualMode) { this._cache.forEach((cacheItem => { count += cacheItem.itemsCount })) } else { count = this._dataOptions.itemsCount() } return count } virtualItemsCount() { let pageIndex = getBeginPageIndex(this); if (pageIndex < 0) { pageIndex = this._dataOptions.pageIndex() } const beginItemsCount = pageIndex * this._dataOptions.pageSize(); const itemsCount = this._cache.length * this._dataOptions.pageSize(); const endItemsCount = Math.max(0, this._dataOptions.totalItemsCount() - itemsCount - beginItemsCount); return { begin: beginItemsCount, end: endItemsCount } } reset() { this._loadingPageIndexes = {}; this._cache = [] } } }, 92018: /*!*****************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/virtual_scrolling/m_virtual_scrolling.js ***! \*****************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.virtualScrollingModule = exports.rowsView = exports.resizing = exports.dataSourceAdapterExtender = exports.data = void 0; var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _browser = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/browser */ 47810)); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _dom = __webpack_require__( /*! ../../../../core/utils/dom */ 3532); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _position = __webpack_require__( /*! ../../../../core/utils/position */ 37518); var _size = __webpack_require__( /*! ../../../../core/utils/size */ 58664); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _window = __webpack_require__( /*! ../../../../core/utils/window */ 58201); var _load_indicator = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/load_indicator */ 2492)); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/widget/ui.errors */ 96688)); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../m_utils */ 60082)); var _m_virtual_scrolling_core = __webpack_require__( /*! ./m_virtual_scrolling_core */ 86770); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const LEGACY_SCROLLING_MODE = "scrolling.legacyMode"; const PAGING_METHOD_NAMES = ["beginPageIndex", "endPageIndex", "pageIndex"]; const isVirtualMode = function(that) { return "virtual" === that.option("scrolling.mode") }; const isAppendMode = function(that) { return "infinite" === that.option("scrolling.mode") }; const isVirtualPaging = function(that) { return isVirtualMode(that) || isAppendMode(that) }; const correctCount = function(items, count, fromEnd, isItemCountableFunc) { for (let i = 0; i < count + 1; i++) { const item = items[fromEnd ? items.length - 1 - i : i]; if (item && !isItemCountableFunc(item, i === count, fromEnd)) { count++ } } return count }; const isItemCountableByDataSource = function(item, dataSource) { return "data" === item.rowType && !item.isNewRow || "group" === item.rowType && dataSource.isGroupItemCountable(item.data) }; const updateLoading = function(that) { const beginPageIndex = that._virtualScrollController.beginPageIndex(-1); if (isVirtualMode(that)) { if (beginPageIndex < 0 || that.viewportSize() >= 0 && that.getViewportItemIndex() >= 0 && (beginPageIndex * that.pageSize() > that.getViewportItemIndex() || beginPageIndex * that.pageSize() + that.itemsCount() < that.getViewportItemIndex() + that.viewportSize()) && that._dataSource.isLoading()) { if (!that._isLoading) { that._isLoading = true; that.loadingChanged.fire(true) } } else if (that._isLoading) { that._isLoading = false; that.loadingChanged.fire(false) } } }; const proxyDataSourceAdapterMethod = function(that, methodName, args) { if (false === that.option(LEGACY_SCROLLING_MODE) && PAGING_METHOD_NAMES.includes(methodName)) { const dataSource = that._dataSource; return dataSource.pageIndex.apply(dataSource, args) } const virtualScrollController = that._virtualScrollController; return virtualScrollController[methodName].apply(virtualScrollController, args) }; const removeEmptyRows = function($emptyRows, className) { const tBodies = $emptyRows.toArray().map((row => (0, _renderer.default)(row).parent(`.${className}`).get(0))).filter((row => row)); if (tBodies.length) { $emptyRows = (0, _renderer.default)(tBodies) } const rowCount = "dx-freespace-row" === className ? $emptyRows.length - 1 : $emptyRows.length; for (let i = 0; i < rowCount; i++) { $emptyRows.eq(i).remove() } }; exports.dataSourceAdapterExtender = Base => class extends Base { init() { super.init.apply(this, arguments); this._items = []; this._totalCount = -1; this._isLoaded = true; this._loadPageCount = 1; this._virtualScrollController = new _m_virtual_scrolling_core.VirtualScrollController(this.component, this._getVirtualScrollDataOptions()) } dispose() { this._virtualScrollController.dispose(); super.dispose.apply(this, arguments) } _getVirtualScrollDataOptions() { const that = this; return { pageSize: () => that.pageSize(), totalItemsCount: () => that.totalItemsCount(), hasKnownLastPage: () => that.hasKnownLastPage(), pageIndex: index => that._dataSource.pageIndex(index), isLoading: () => that._dataSource.isLoading() && !that.isCustomLoading(), pageCount: () => that.pageCount(), load: () => that._dataSource.load(), updateLoading() { updateLoading(that) }, itemsCount: () => that.itemsCount(true), items: () => that._dataSource.items(), viewportItems(items) { if (items) { that._items = items } return that._items }, onChanged(e) { that.changed.fire(e) }, changingDuration() { if (that.isLoading()) { return 300 } return that._renderTime || 0 } } } _handleLoadingChanged(isLoading) { if (false === this.option(LEGACY_SCROLLING_MODE)) { super._handleLoadingChanged.apply(this, arguments); return } if (!isVirtualMode(this) || this._isLoadingAll) { this._isLoading = isLoading; super._handleLoadingChanged.apply(this, arguments) } if (isLoading) { this._startLoadTime = new Date } else { this._startLoadTime = void 0 } } _handleLoadError() { if (false !== this.option(LEGACY_SCROLLING_MODE)) { this._isLoading = false; this.loadingChanged.fire(false) } super._handleLoadError.apply(this, arguments) } _handleDataChanged(e) { if (false === this.option(LEGACY_SCROLLING_MODE)) { this._items = this._dataSource.items().slice(); this._totalCount = this._dataSourceTotalCount(true); super._handleDataChanged.apply(this, arguments); return } const callBase = super._handleDataChanged.bind(this); this._virtualScrollController.handleDataChanged(callBase, e) } _customizeRemoteOperations(options, operationTypes) { const newMode = false === this.option(LEGACY_SCROLLING_MODE); let renderAsync = this.option("scrolling.renderAsync"); if (!(0, _type.isDefined)(renderAsync)) { renderAsync = this._renderTime >= this.option("scrolling.renderingThreshold") } if ((isVirtualMode(this) || isAppendMode(this) && newMode) && !operationTypes.reload && (operationTypes.skip || newMode) && !renderAsync) { options.delay = void 0 } super._customizeRemoteOperations.apply(this, arguments) } items() { return this._items } _dataSourceTotalCount(isBase) { return false === this.option(LEGACY_SCROLLING_MODE) && isVirtualMode(this) && !isBase ? this._totalCount : super._dataSourceTotalCount() } itemsCount(isBase) { if (isBase || false === this.option(LEGACY_SCROLLING_MODE)) { return super.itemsCount() } return this._virtualScrollController.itemsCount() } load(loadOptions) { if (false === this.option(LEGACY_SCROLLING_MODE) || loadOptions) { return super.load(loadOptions) } return this._virtualScrollController.load() } isLoading() { return false === this.option(LEGACY_SCROLLING_MODE) ? this._dataSource.isLoading() : this._isLoading } isLoaded() { return this._dataSource.isLoaded() && this._isLoaded } resetPagesCache(isLiveUpdate) { if (!isLiveUpdate) { this._virtualScrollController.reset(true) } super.resetPagesCache.apply(this, arguments) } _changeRowExpandCore() { const result = super._changeRowExpandCore.apply(this, arguments); if (false === this.option(LEGACY_SCROLLING_MODE)) { return result } this.resetPagesCache(); updateLoading(this); return result } reload() { this._dataSource.pageIndex(this.pageIndex()); const virtualScrollController = this._virtualScrollController; if (false !== this.option(LEGACY_SCROLLING_MODE) && virtualScrollController) { const d = new _deferred.Deferred; super.reload.apply(this, arguments).done((r => { const delayDeferred = virtualScrollController.getDelayDeferred(); if (delayDeferred) { delayDeferred.done(d.resolve).fail(d.reject) } else { d.resolve(r) } })).fail(d.reject); return d } return super.reload.apply(this, arguments) } refresh(options, operationTypes) { if (false !== this.option(LEGACY_SCROLLING_MODE)) { const { storeLoadOptions: storeLoadOptions } = options; const dataSource = this._dataSource; if (operationTypes.reload) { this._virtualScrollController.reset(); dataSource.items().length = 0; this._isLoaded = false; updateLoading(this); this._isLoaded = true; if (isAppendMode(this)) { this.pageIndex(0); dataSource.pageIndex(0); storeLoadOptions.pageIndex = 0; options.pageIndex = 0; storeLoadOptions.skip = 0 } else { dataSource.pageIndex(this.pageIndex()); if (dataSource.paginate()) { options.pageIndex = this.pageIndex(); storeLoadOptions.skip = this.pageIndex() * this.pageSize() } } } else if (isAppendMode(this) && storeLoadOptions.skip && this._totalCountCorrection < 0) { storeLoadOptions.skip += this._totalCountCorrection } } return super.refresh.apply(this, arguments) } loadPageCount(count) { if (!(0, _type.isDefined)(count)) { return this._loadPageCount } this._loadPageCount = count } _handleDataLoading(options) { const loadPageCount = this.loadPageCount(); const pageSize = this.pageSize(); const newMode = false === this.option(LEGACY_SCROLLING_MODE); const { storeLoadOptions: storeLoadOptions } = options; const takeIsDefined = (0, _type.isDefined)(storeLoadOptions.take); options.loadPageCount = loadPageCount; if (!options.isCustomLoading && newMode && takeIsDefined && loadPageCount > 1 && pageSize > 0) { storeLoadOptions.take = loadPageCount * pageSize } super._handleDataLoading.apply(this, arguments) } _loadPageSize() { return super._loadPageSize.apply(this, arguments) * this.loadPageCount() } beginPageIndex() { return proxyDataSourceAdapterMethod(this, "beginPageIndex", [...arguments]) } endPageIndex() { return proxyDataSourceAdapterMethod(this, "endPageIndex", [...arguments]) } pageIndex(pageIndex) { return proxyDataSourceAdapterMethod(this, "pageIndex", [...arguments]) } virtualItemsCount() { return proxyDataSourceAdapterMethod(this, "virtualItemsCount", [...arguments]) } getContentOffset() { return proxyDataSourceAdapterMethod(this, "getContentOffset", [...arguments]) } getVirtualContentSize() { return proxyDataSourceAdapterMethod(this, "getVirtualContentSize", [...arguments]) } setContentItemSizes() { return proxyDataSourceAdapterMethod(this, "setContentItemSizes", [...arguments]) } setViewportPosition() { return proxyDataSourceAdapterMethod(this, "setViewportPosition", [...arguments]) } getViewportItemIndex() { return proxyDataSourceAdapterMethod(this, "getViewportItemIndex", [...arguments]) } setViewportItemIndex(viewportItemIndex) { return proxyDataSourceAdapterMethod(this, "setViewportItemIndex", [...arguments]) } getItemIndexByPosition() { return proxyDataSourceAdapterMethod(this, "getItemIndexByPosition", [...arguments]) } viewportSize() { return proxyDataSourceAdapterMethod(this, "viewportSize", [...arguments]) } viewportItemSize() { return proxyDataSourceAdapterMethod(this, "viewportItemSize", [...arguments]) } getItemSize() { return proxyDataSourceAdapterMethod(this, "getItemSize", [...arguments]) } getItemSizes() { return proxyDataSourceAdapterMethod(this, "getItemSizes", [...arguments]) } loadIfNeed() { return proxyDataSourceAdapterMethod(this, "loadIfNeed", [...arguments]) } }; const data = Base => class extends Base { dispose() { const rowsScrollController = this._rowsScrollController; rowsScrollController && rowsScrollController.dispose(); super.dispose.apply(this, arguments) } _refreshDataSource() { const baseResult = super._refreshDataSource.apply(this, arguments) || (new _deferred.Deferred).resolve().promise(); baseResult.done(this.initVirtualRows.bind(this)); return baseResult } _loadDataSource() { if (this._rowsScrollController && isVirtualPaging(this)) { var _this$_dataSource; const { loadPageCount: loadPageCount } = (0, _type.isDefined)(this._loadViewportParams) ? this.getLoadPageParams(): { loadPageCount: 0 }; loadPageCount >= 1 && (null === (_this$_dataSource = this._dataSource) || void 0 === _this$_dataSource ? void 0 : _this$_dataSource.loadPageCount(loadPageCount)) } return super._loadDataSource.apply(this, arguments) } getRowPageSize() { const rowPageSize = this.option("scrolling.rowPageSize"); const pageSize = this.pageSize(); return pageSize && pageSize < rowPageSize ? pageSize : rowPageSize } reload() { const rowsScrollController = this._rowsScrollController || this._dataSource; const itemIndex = rowsScrollController && rowsScrollController.getItemIndexByPosition(); const result = super.reload.apply(this, arguments); return result && result.done((() => { if (isVirtualMode(this) || _m_utils.default.isVirtualRowRendering(this)) { const rowIndexOffset = this.getRowIndexOffset(); const rowIndex = Math.floor(itemIndex) - rowIndexOffset; const { component: component } = this; const scrollable = component.getScrollable && component.getScrollable(); const isSortingOperation = this.dataSource().operationTypes().sorting; if (scrollable && !isSortingOperation && rowIndex >= 0) { var _$rowElement$position; const rowElement = component.getRowElement(rowIndex); const $rowElement = rowElement && rowElement[0] && (0, _renderer.default)(rowElement[0]); let top = $rowElement && (null === (_$rowElement$position = $rowElement.position()) || void 0 === _$rowElement$position ? void 0 : _$rowElement$position.top); const isChromeLatest = _browser.default.chrome && Number(_browser.default.version ?? 0) >= 91; const allowedTopOffset = _browser.default.mozilla || isChromeLatest ? 1 : 0; if (top && top > allowedTopOffset) { top = Math.round(top + (0, _size.getOuterHeight)($rowElement) * (itemIndex % 1)); scrollable.scrollTo({ y: top }) } } } })) } initVirtualRows() { const virtualRowsRendering = _m_utils.default.isVirtualRowRendering(this); this._allItems = null; this._loadViewportParams = null; if ("virtual" !== this.option("scrolling.mode") && !virtualRowsRendering || !virtualRowsRendering || false !== this.option(LEGACY_SCROLLING_MODE) && !this.option("scrolling.rowPageSize")) { this._visibleItems = null; this._rowsScrollController = null; return } const pageIndex = !isVirtualMode(this) && this.pageIndex() >= this.pageCount() ? this.pageCount() - 1 : this.pageIndex(); this._rowPageIndex = Math.ceil(pageIndex * this.pageSize() / this.getRowPageSize()); this._visibleItems = false === this.option(LEGACY_SCROLLING_MODE) ? null : []; this._viewportChanging = false; this._needUpdateViewportAfterLoading = false; if (!this._rowsScrollController) { this._rowsScrollController = new _m_virtual_scrolling_core.VirtualScrollController(this.component, this._getRowsScrollDataOptions(), true); this._rowsScrollController.positionChanged.add((() => { var _this$_dataSource2; if (false === this.option(LEGACY_SCROLLING_MODE)) { this._viewportChanging = true; this.loadViewport(); this._viewportChanging = false; return } null === (_this$_dataSource2 = this._dataSource) || void 0 === _this$_dataSource2 || _this$_dataSource2.setViewportItemIndex(this._rowsScrollController.getViewportItemIndex()) })) } if (false === this.option(LEGACY_SCROLLING_MODE)) { this._updateLoadViewportParams() } if (this.isLoaded() && false !== this.option(LEGACY_SCROLLING_MODE)) { this._rowsScrollController.load() } } isViewportChanging() { return this._viewportChanging } _getRowsScrollDataOptions() { const that = this; const isItemCountable = function(item) { return isItemCountableByDataSource(item, that._dataSource) }; return { pageSize: () => that.getRowPageSize(), loadedOffset() { var _that$_dataSource; return isVirtualMode(that) && (null === (_that$_dataSource = that._dataSource) || void 0 === _that$_dataSource ? void 0 : _that$_dataSource.lastLoadOptions().skip) || 0 }, loadedItemCount: () => that._itemCount, totalItemsCount() { if (isVirtualPaging(that)) { return that.totalItemsCount() } return false === that.option(LEGACY_SCROLLING_MODE) ? that._itemCount : that._items.filter(isItemCountable).length }, hasKnownLastPage: () => false === that.option(LEGACY_SCROLLING_MODE) ? that.hasKnownLastPage() : true, pageIndex(index) { if (void 0 !== index) { that._rowPageIndex = index } return that._rowPageIndex }, isLoading: () => that.isLoading(), pageCount() { const pageCount = Math.ceil(this.totalItemsCount() / this.pageSize()); return pageCount || 1 }, load() { if (that._rowsScrollController.pageIndex() >= this.pageCount()) { that._rowPageIndex = this.pageCount() - 1; that._rowsScrollController.pageIndex(that._rowPageIndex) } if (!this.items().length && this.totalItemsCount()) { return } that._rowsScrollController.handleDataChanged((change => { change = change || {}; change.changeType = change.changeType || "refresh"; change.items = change.items || that._visibleItems; that._visibleItems.forEach(((item, index) => { item.rowIndex = index })); that._fireChanged(change) })) }, updateLoading() {}, itemsCount() { return this.items(true).length }, correctCount: (items, count, fromEnd) => correctCount(items, count, fromEnd, ((item, isNextAfterLast, fromEnd) => { if (item.isNewRow) { return isNextAfterLast && !fromEnd } if (isNextAfterLast && fromEnd) { return !item.isNewRow } return isItemCountable(item) })), items(countableOnly) { let result = that._items; if (that.option(LEGACY_SCROLLING_MODE)) { const dataSource = that.dataSource(); const virtualItemsCount = null === dataSource || void 0 === dataSource ? void 0 : dataSource.virtualItemsCount(); const begin = virtualItemsCount ? virtualItemsCount.begin : 0; const rowPageSize = that.getRowPageSize(); let skip = that._rowPageIndex * rowPageSize - begin; let take = rowPageSize; if (skip < 0) { return [] } if (skip) { skip = this.correctCount(result, skip); result = result.slice(skip) } if (take) { take = this.correctCount(result, take); result = result.slice(0, take) } } return countableOnly ? result.filter(isItemCountable) : result }, viewportItems(items) { if (items && false !== that.option(LEGACY_SCROLLING_MODE)) { that._visibleItems = items } return that._visibleItems }, onChanged() {}, changingDuration() { const dataSource = that.dataSource(); if (null !== dataSource && void 0 !== dataSource && dataSource.isLoading() && false !== that.option(LEGACY_SCROLLING_MODE)) { return 300 } return (null === dataSource || void 0 === dataSource ? void 0 : dataSource._renderTime) || 0 } } } _updateItemsCore(change) { const delta = this.getRowIndexDelta(); super._updateItemsCore.apply(this, arguments); if (false === this.option(LEGACY_SCROLLING_MODE) && _m_utils.default.isVirtualRowRendering(this)) { if ("update" === change.changeType && 0 === change.rowIndices.length && change.cancelEmptyChanges) { change.cancel = true } return } const rowsScrollController = this._rowsScrollController; if (rowsScrollController) { const visibleItems = this._visibleItems; const isRefresh = "refresh" === change.changeType || change.isLiveUpdate; if ("append" === change.changeType && change.items && !change.items.length) { return } if (isRefresh || "append" === change.changeType || "prepend" === change.changeType) { change.cancel = true; isRefresh && rowsScrollController.reset(true); rowsScrollController.load() } else { if ("update" === change.changeType) { change.rowIndices.forEach(((rowIndex, index) => { const changeType = change.changeTypes[index]; const newItem = change.items[index]; if ("update" === changeType) { visibleItems[rowIndex] = newItem } else if ("insert" === changeType) { visibleItems.splice(rowIndex, 0, newItem) } else if ("remove" === changeType) { visibleItems.splice(rowIndex, 1) } })) } else { visibleItems.forEach(((item, index) => { visibleItems[index] = this._items[index + delta] || visibleItems[index] })); change.items = visibleItems }! function(items) { items.forEach(((item, index) => { item.rowIndex = index })); return items }(visibleItems) } } } _updateLoadViewportParams() { const viewportParams = this._rowsScrollController.getViewportParams(); const pageSize = this.pageSize(); if (viewportParams && !isVirtualPaging(this) && pageSize > 0) { const pageOffset = this.pageIndex() * pageSize; viewportParams.skip += pageOffset } this._loadViewportParams = viewportParams } _processItems() { const resultItems = super._processItems.apply(this, arguments); if (false === this.option(LEGACY_SCROLLING_MODE)) { const dataSource = this._dataSource; let currentIndex = (null === dataSource || void 0 === dataSource ? void 0 : dataSource.lastLoadOptions().skip) ?? 0; let prevCountable; let prevRowType; let isPrevRowNew; let wasCountableItem = false; let newRows = []; resultItems.forEach((item => { const { rowType: rowType } = item; const itemCountable = isItemCountableByDataSource(item, dataSource); const isNextGroupItem = "group" === rowType && (prevCountable || itemCountable || "group" !== prevRowType && currentIndex > 0); const isNextDataItem = "data" === rowType && itemCountable && (prevCountable || "group" !== prevRowType); if (!item.isNewRow && (0, _type.isDefined)(prevCountable)) { const isPrevNewRowFirst = isPrevRowNew && !wasCountableItem; if ((isNextGroupItem || isNextDataItem) && !isPrevNewRowFirst) { currentIndex++ } } if (isNextGroupItem || isNextDataItem) { wasCountableItem = true } if (item.isNewRow) { newRows.push(item) } else { newRows.forEach((it => { it.loadIndex = currentIndex })); newRows = [] } item.loadIndex = currentIndex; prevCountable = itemCountable; prevRowType = rowType; isPrevRowNew = item.isNewRow })); newRows.forEach((it => { it.loadIndex = currentIndex })) } return resultItems } _afterProcessItems(items) { this._itemCount = items.filter((item => isItemCountableByDataSource(item, this._dataSource))).length; if ((0, _type.isDefined)(this._loadViewportParams)) { this._updateLoadViewportParams(); let result = items; this._allItems = items; if (items.length) { const { skipForCurrentPage: skipForCurrentPage } = this.getLoadPageParams(true); const skip = items[0].loadIndex + skipForCurrentPage; const { take: take } = this._loadViewportParams; result = items.filter((it => { const isNewRowInEmptyData = it.isNewRow && it.loadIndex === skip && 0 === take; const isLoadIndexGreaterStart = it.loadIndex >= skip; const isLoadIndexLessEnd = it.loadIndex < skip + take || isNewRowInEmptyData; return isLoadIndexGreaterStart && isLoadIndexLessEnd })) } return result } return super._afterProcessItems.apply(this, arguments) } _applyChange(change) { const that = this; const { items: items } = change; const { changeType: changeType } = change; let { removeCount: removeCount } = change; if (removeCount) { const fromEnd = "prepend" === changeType; removeCount = correctCount(that._items, removeCount, fromEnd, ((item, isNextAfterLast) => "data" === item.rowType && !item.isNewRow || "group" === item.rowType && (that._dataSource.isGroupItemCountable(item.data) || isNextAfterLast))); change.removeCount = removeCount } switch (changeType) { case "prepend": that._items.unshift.apply(that._items, items); if (removeCount) { that._items.splice(-removeCount) } break; case "append": that._items.push.apply(that._items, items); if (removeCount) { that._items.splice(0, removeCount) } break; default: super._applyChange(change) } } items(allItems) { return allItems ? this._allItems || this._items : this._visibleItems || this._items } getRowIndexDelta() { let delta = 0; if (this.option(LEGACY_SCROLLING_MODE)) { const visibleItems = this._visibleItems; if (visibleItems && visibleItems[0]) { delta = this._items.indexOf(visibleItems[0]) } } return delta < 0 ? 0 : delta } getRowIndexOffset(byLoadedRows, needGroupOffset) { let offset = 0; const dataSource = this.dataSource(); const rowsScrollController = this._rowsScrollController; const newMode = false === this.option(LEGACY_SCROLLING_MODE); const virtualPaging = isVirtualPaging(this); if (rowsScrollController && !byLoadedRows) { if (newMode && (0, _type.isDefined)(this._loadViewportParams)) { const { skipForCurrentPage: skipForCurrentPage, pageIndex: pageIndex } = this.getLoadPageParams(true); const items = this.items(true); offset = virtualPaging ? pageIndex * this.pageSize() : 0; if (items.length) { const firstLoadIndex = items[0].loadIndex; offset += items.filter((item => item.loadIndex < firstLoadIndex + skipForCurrentPage)).length } } else { offset = rowsScrollController.beginPageIndex() * rowsScrollController.pageSize() } } else if (virtualPaging && newMode && dataSource) { var _lastLoadOptions$skip; const lastLoadOptions = dataSource.lastLoadOptions(); if (needGroupOffset && null !== (_lastLoadOptions$skip = lastLoadOptions.skips) && void 0 !== _lastLoadOptions$skip && _lastLoadOptions$skip.length) { offset = lastLoadOptions.skips.reduce(((res, skip) => res + skip), 0) } else { offset = lastLoadOptions.skip ?? 0 } } else if (isVirtualMode(this) && dataSource) { offset = dataSource.beginPageIndex() * dataSource.pageSize() } return offset } getDataIndex() { if (false === this.option(LEGACY_SCROLLING_MODE)) { return this.getRowIndexOffset(true, true) } return super.getDataIndex.apply(this, arguments) } viewportSize() { const rowsScrollController = this._rowsScrollController; const dataSource = this._dataSource; const result = null === rowsScrollController || void 0 === rowsScrollController ? void 0 : rowsScrollController.viewportSize.apply(rowsScrollController, arguments); if (false === this.option(LEGACY_SCROLLING_MODE)) { return result } return null === dataSource || void 0 === dataSource ? void 0 : dataSource.viewportSize.apply(dataSource, arguments) } viewportHeight(height, scrollTop) { var _this$_rowsScrollCont; null === (_this$_rowsScrollCont = this._rowsScrollController) || void 0 === _this$_rowsScrollCont || _this$_rowsScrollCont.viewportHeight(height, scrollTop) } viewportItemSize() { const rowsScrollController = this._rowsScrollController; const dataSource = this._dataSource; const result = null === rowsScrollController || void 0 === rowsScrollController ? void 0 : rowsScrollController.viewportItemSize.apply(rowsScrollController, arguments); if (false === this.option(LEGACY_SCROLLING_MODE)) { return result } return null === dataSource || void 0 === dataSource ? void 0 : dataSource.viewportItemSize.apply(dataSource, arguments) } setViewportPosition() { const rowsScrollController = this._rowsScrollController; const dataSource = this._dataSource; this._isPaging = false; if (rowsScrollController) { rowsScrollController.setViewportPosition.apply(rowsScrollController, arguments) } else { null === dataSource || void 0 === dataSource || dataSource.setViewportPosition.apply(dataSource, arguments) } } setContentItemSizes(sizes) { const rowsScrollController = this._rowsScrollController; const dataSource = this._dataSource; const result = null === rowsScrollController || void 0 === rowsScrollController ? void 0 : rowsScrollController.setContentItemSizes(sizes); if (false === this.option(LEGACY_SCROLLING_MODE)) { return result } return null === dataSource || void 0 === dataSource ? void 0 : dataSource.setContentItemSizes(sizes) } getPreloadedRowCount() { const preloadCount = this.option("scrolling.preloadedRowCount"); const preloadEnabled = this.option("scrolling.preloadEnabled"); if ((0, _type.isDefined)(preloadCount)) { return preloadCount } const viewportSize = this.viewportSize(); return preloadEnabled ? 2 * viewportSize : viewportSize } getLoadPageParams(byLoadedPage) { var _this$_dataSource3, _this$_dataSource4; const pageSize = this.pageSize(); const viewportParams = this._loadViewportParams; const lastLoadOptions = null === (_this$_dataSource3 = this._dataSource) || void 0 === _this$_dataSource3 ? void 0 : _this$_dataSource3.lastLoadOptions(); const loadedPageIndex = (null === lastLoadOptions || void 0 === lastLoadOptions ? void 0 : lastLoadOptions.pageIndex) || 0; const loadedTake = (null === lastLoadOptions || void 0 === lastLoadOptions ? void 0 : lastLoadOptions.take) || 0; const isScrollingBack = this._rowsScrollController.isScrollingBack(); const topPreloadCount = isScrollingBack ? this.getPreloadedRowCount() : 0; const bottomPreloadCount = isScrollingBack ? 0 : this.getPreloadedRowCount(); const totalCountCorrection = (null === (_this$_dataSource4 = this._dataSource) || void 0 === _this$_dataSource4 ? void 0 : _this$_dataSource4.totalCountCorrection()) || 0; const skipWithPreload = Math.max(0, viewportParams.skip - topPreloadCount); const pageIndex = byLoadedPage ? loadedPageIndex : Math.floor(pageSize ? skipWithPreload / pageSize : 0); const pageOffset = pageIndex * pageSize; const skipForCurrentPage = viewportParams.skip - pageOffset; const loadingTake = viewportParams.take + skipForCurrentPage + bottomPreloadCount - totalCountCorrection; const take = byLoadedPage ? loadedTake : loadingTake; const loadPageCount = Math.ceil(pageSize ? take / pageSize : 0); return { pageIndex: pageIndex, loadPageCount: Math.max(1, loadPageCount), skipForCurrentPage: Math.max(0, skipForCurrentPage) } } _updateVisiblePageIndex(currentPageIndex) { if (!this._rowsScrollController) { return } if ((0, _type.isDefined)(currentPageIndex)) { this._silentOption("paging.pageIndex", currentPageIndex); this.pageChanged.fire(); return } const viewPortItemIndex = this._rowsScrollController.getViewportItemIndex(); const newPageIndex = Math.floor(viewPortItemIndex / this.pageSize()); if (this.pageIndex() !== newPageIndex) { this._silentOption("paging.pageIndex", newPageIndex); this.updateItems({ changeType: "pageIndex" }) } } _getChangedLoadParams() { const loadedPageParams = this.getLoadPageParams(true); const { pageIndex: pageIndex, loadPageCount: loadPageCount } = this.getLoadPageParams(); const pageIndexIsValid = this._pageIndexIsValid(pageIndex); let result = null; if (!this._isLoading && pageIndexIsValid && (pageIndex !== loadedPageParams.pageIndex || loadPageCount !== loadedPageParams.loadPageCount)) { result = { pageIndex: pageIndex, loadPageCount: loadPageCount } } return result } _pageIndexIsValid(pageIndex) { let result = true; if (isAppendMode(this) && this.hasKnownLastPage() || isVirtualMode(this)) { result = pageIndex * this.pageSize() < this.totalItemsCount() } return result } _loadItems(checkLoading, viewportIsFilled) { const virtualPaging = isVirtualPaging(this); const dataSourceAdapter = this._dataSource; const changedParams = this._getChangedLoadParams(); const currentLoadPageCount = (null === dataSourceAdapter || void 0 === dataSourceAdapter ? void 0 : dataSourceAdapter.loadPageCount()) ?? 0; const lastRequiredItemCount = this.pageSize() * currentLoadPageCount; const currentPageIndex = (null === dataSourceAdapter || void 0 === dataSourceAdapter ? void 0 : dataSourceAdapter.pageIndex()) ?? 0; const pageIndexNotChanged = (null === changedParams || void 0 === changedParams ? void 0 : changedParams.pageIndex) === currentPageIndex; const allLoadedInAppendMode = isAppendMode(this) && this.totalItemsCount() < lastRequiredItemCount; const isRepaintMode = "repaint" === this.option("editing.refreshMode"); const pageIndexIncreased = (null === changedParams || void 0 === changedParams ? void 0 : changedParams.pageIndex) > currentPageIndex; let result = false; if (!dataSourceAdapter || virtualPaging && checkLoading && (isRepaintMode && viewportIsFilled || pageIndexIncreased || pageIndexNotChanged && allLoadedInAppendMode)) { return result } if (virtualPaging && this._isLoading) { this._needUpdateViewportAfterLoading = true } if (virtualPaging && changedParams) { result = true; dataSourceAdapter.pageIndex(changedParams.pageIndex); dataSourceAdapter.loadPageCount(changedParams.loadPageCount); this._repaintChangesOnly = true; this._needUpdateDimensions = true; const viewportChanging = this._viewportChanging; this.load().always((() => { this._repaintChangesOnly = void 0; this._needUpdateDimensions = void 0 })).done((() => { const isLastPage = this.pageCount() > 0 && this.pageIndex() === this.pageCount() - 1; (viewportChanging || isLastPage) && this._updateVisiblePageIndex(); if (this._needUpdateViewportAfterLoading) { this._needUpdateViewportAfterLoading = false; this.loadViewport({ checkLoadedParamsOnly: true }) } })) } return result } loadViewport(params) { const { checkLoadedParamsOnly: checkLoadedParamsOnly, checkLoading: checkLoading, viewportIsNotFilled: viewportIsNotFilled } = params ?? {}; const virtualPaging = isVirtualPaging(this); if (virtualPaging || _m_utils.default.isVirtualRowRendering(this)) { var _this$_dataSource5; this._updateLoadViewportParams(); const loadingItemsStarted = this._loadItems(checkLoading, !viewportIsNotFilled); const isCustomLoading = null === (_this$_dataSource5 = this._dataSource) || void 0 === _this$_dataSource5 ? void 0 : _this$_dataSource5.isCustomLoading(); const isLoading = checkLoading && !isCustomLoading && this._isLoading; const needToUpdateItems = !(loadingItemsStarted || isLoading || checkLoadedParamsOnly); if (needToUpdateItems) { var _this$_editingControl; const noPendingChangesInEditing = !(null !== (_this$_editingControl = this._editingController) && void 0 !== _this$_editingControl && null !== (_this$_editingControl = _this$_editingControl.getChanges()) && void 0 !== _this$_editingControl && _this$_editingControl.length); this.updateItems({ repaintChangesOnly: true, needUpdateDimensions: true, useProcessedItemsCache: noPendingChangesInEditing, cancelEmptyChanges: true }) } } } updateViewport() { var _this$_loadViewportPa; const viewportSize = this.viewportSize(); const itemCount = this.items().length; const viewportIsNotFilled = viewportSize > itemCount; const currentTake = (null === (_this$_loadViewportPa = this._loadViewportParams) || void 0 === _this$_loadViewportPa ? void 0 : _this$_loadViewportPa.take) ?? 0; const rowsScrollController = this._rowsScrollController; const newTake = null === rowsScrollController || void 0 === rowsScrollController ? void 0 : rowsScrollController.getViewportParams().take; (viewportIsNotFilled || currentTake < newTake) && !this._isPaging && itemCount && this.loadViewport({ checkLoading: true, viewportIsNotFilled: viewportIsNotFilled }) } loadIfNeed() { if (false === this.option(LEGACY_SCROLLING_MODE)) { return } const rowsScrollController = this._rowsScrollController; rowsScrollController && rowsScrollController.loadIfNeed(); const dataSource = this._dataSource; return dataSource && dataSource.loadIfNeed() } getItemSize() { const rowsScrollController = this._rowsScrollController; if (rowsScrollController) { return rowsScrollController.getItemSize.apply(rowsScrollController, arguments) } const dataSource = this._dataSource; return dataSource && dataSource.getItemSize.apply(dataSource, arguments) } getItemSizes() { const rowsScrollController = this._rowsScrollController; if (rowsScrollController) { return rowsScrollController.getItemSizes.apply(rowsScrollController, arguments) } const dataSource = this._dataSource; return dataSource && dataSource.getItemSizes.apply(dataSource, arguments) } getContentOffset() { const rowsScrollController = this._rowsScrollController; if (rowsScrollController) { return rowsScrollController.getContentOffset.apply(rowsScrollController, arguments) } const dataSource = this._dataSource; return dataSource && dataSource.getContentOffset.apply(dataSource, arguments) } refresh(options) { const dataSource = this._dataSource; if (dataSource && options && options.load && isAppendMode(this)) { dataSource.resetCurrentTotalCount() } return super.refresh.apply(this, arguments) } topItemIndex() { var _this$_loadViewportPa2; return null === (_this$_loadViewportPa2 = this._loadViewportParams) || void 0 === _this$_loadViewportPa2 ? void 0 : _this$_loadViewportPa2.skip } bottomItemIndex() { const viewportParams = this._loadViewportParams; return viewportParams && viewportParams.skip + viewportParams.take } virtualItemsCount() { const rowsScrollController = this._rowsScrollController; if (rowsScrollController) { return rowsScrollController.virtualItemsCount.apply(rowsScrollController, arguments) } const dataSource = this._dataSource; return null === dataSource || void 0 === dataSource ? void 0 : dataSource.virtualItemsCount.apply(dataSource, arguments) } pageIndex(pageIndex) { const virtualPaging = isVirtualPaging(this); const rowsScrollController = this._rowsScrollController; if (false === this.option(LEGACY_SCROLLING_MODE) && virtualPaging && rowsScrollController) { if (void 0 === pageIndex) { return this.option("paging.pageIndex") ?? 0 } } return super.pageIndex.apply(this, arguments) } _fireChanged(e) { super._fireChanged.apply(this, arguments); const { operationTypes: operationTypes } = e; if (false === this.option(LEGACY_SCROLLING_MODE) && isVirtualPaging(this) && operationTypes) { const { fullReload: fullReload, pageIndex: pageIndex } = operationTypes; if (e.isDataChanged && !fullReload && pageIndex) { this._updateVisiblePageIndex(this._dataSource.pageIndex()) } } } _getPagingOptionValue(optionName) { let result = super._getPagingOptionValue.apply(this, arguments); if (false === this.option(LEGACY_SCROLLING_MODE) && isVirtualPaging(this)) { result = this[optionName]() } return result } isEmpty() { return false === this.option(LEGACY_SCROLLING_MODE) ? !this.items(true).length : super.isEmpty.apply(this, arguments) } isLastPageLoaded() { let result = false; if (false === this.option(LEGACY_SCROLLING_MODE) && isVirtualPaging(this)) { const { pageIndex: pageIndex, loadPageCount: loadPageCount } = this.getLoadPageParams(true); const pageCount = this.pageCount(); result = pageIndex + loadPageCount >= pageCount } else { result = super.isLastPageLoaded.apply(this, arguments) } return result } reset() { this._itemCount = 0; this._allItems = null; super.reset.apply(this, arguments) } _applyFilter() { var _this$_dataSource6; null === (_this$_dataSource6 = this._dataSource) || void 0 === _this$_dataSource6 || _this$_dataSource6.loadPageCount(1); return super._applyFilter.apply(this, arguments) } getVirtualContentSize() { var _this$_dataSource7; return null === (_this$_dataSource7 = this._dataSource) || void 0 === _this$_dataSource7 ? void 0 : _this$_dataSource7.getVirtualContentSize.apply(this._dataSource, arguments) } setViewportItemIndex() { var _this$_dataSource8; return null === (_this$_dataSource8 = this._dataSource) || void 0 === _this$_dataSource8 ? void 0 : _this$_dataSource8.setViewportItemIndex.apply(this._dataSource, arguments) } }; exports.data = data; const resizing = Base => class extends Base { dispose() { super.dispose.apply(this, arguments); clearTimeout(this._resizeTimeout) } _updateMasterDataGridCore(masterDataGrid) { return (0, _deferred.when)(super._updateMasterDataGridCore.apply(this, arguments)).done((masterDataGridUpdated => { const isNewVirtualMode = isVirtualMode(masterDataGrid) && false === masterDataGrid.option(LEGACY_SCROLLING_MODE); if (!masterDataGridUpdated && isNewVirtualMode) { const scrollable = masterDataGrid.getScrollable(); if (scrollable) { masterDataGrid.updateDimensions() } } })) } hasResizeTimeout() { return !!this._resizeTimeout } resize() { let result; if (isVirtualMode(this) || _m_utils.default.isVirtualRowRendering(this)) { clearTimeout(this._resizeTimeout); this._resizeTimeout = null; const diff = new Date - this._lastTime; const updateTimeout = this.option("scrolling.updateTimeout"); if (this._lastTime && diff < updateTimeout) { result = new _deferred.Deferred; this._resizeTimeout = setTimeout((() => { this._resizeTimeout = null; super.resize.apply(this).done(result.resolve).fail(result.reject); this._lastTime = new Date }), updateTimeout); this._lastTime = new Date } else { result = super.resize.apply(this); if (this._dataController.isLoaded()) { this._lastTime = new Date } } } else { result = super.resize.apply(this) } return result } }; exports.resizing = resizing; const rowsView = Base => class extends Base { init() { var _this$_dataController; super.init(); this._dataController.pageChanged.add((pageIndex => { const scrollTop = this._scrollTop; this.scrollToPage(pageIndex ?? this._dataController.pageIndex()); if (false === this.option(LEGACY_SCROLLING_MODE) && this._scrollTop === scrollTop) { this._dataController.updateViewport() } })); this._dataController.dataSourceChanged.add((() => { !this._scrollTop && this._scrollToCurrentPageOnResize() })); null === (_this$_dataController = this._dataController.stateLoaded) || void 0 === _this$_dataController || _this$_dataController.add((() => { this._scrollToCurrentPageOnResize() })); this._scrollToCurrentPageOnResize() } dispose() { clearTimeout(this._scrollTimeoutID); super.dispose() } _scrollToCurrentPageOnResize() { if (this._dataController.pageIndex() > 0) { const resizeHandler = () => { this.resizeCompleted.remove(resizeHandler); this.scrollToPage(this._dataController.pageIndex()) }; this.resizeCompleted.add(resizeHandler) } } scrollToPage(pageIndex) { const pageSize = this._dataController ? this._dataController.pageSize() : 0; let scrollPosition; if (isVirtualMode(this) || isAppendMode(this)) { const itemSize = this._dataController.getItemSize(); const itemSizes = this._dataController.getItemSizes(); const itemIndex = pageIndex * pageSize; scrollPosition = itemIndex * itemSize; for (const index in itemSizes) { if (parseInt(index) < itemIndex) { scrollPosition += itemSizes[index] - itemSize } } } else { scrollPosition = 0 } this.scrollTo({ y: scrollPosition, x: this._scrollLeft }) } renderDelayedTemplates() { this.waitAsyncTemplates().done((() => { this._updateContentPosition(true) })); super.renderDelayedTemplates.apply(this, arguments) } _renderCore(e) { const startRenderTime = new Date; const deferred = super._renderCore.apply(this, arguments); const dataSource = this._dataController._dataSource; if (dataSource && e) { const itemCount = e.items ? e.items.length : 20; const viewportSize = this._dataController.viewportSize() || 20; if (_m_utils.default.isVirtualRowRendering(this) && itemCount > 0 && false !== this.option(LEGACY_SCROLLING_MODE)) { dataSource._renderTime = (new Date - startRenderTime) * viewportSize / itemCount } else { dataSource._renderTime = new Date - startRenderTime } } return deferred } _getRowElements(tableElement) { const $rows = super._getRowElements(tableElement); return $rows && $rows.not(".dx-virtual-row") } _removeRowsElements(contentTable, removeCount, changeType) { let rowElements = this._getRowElements(contentTable).toArray(); if ("append" === changeType) { rowElements = rowElements.slice(0, removeCount) } else { rowElements = rowElements.slice(-removeCount) } rowElements.map((rowElement => { const $rowElement = (0, _renderer.default)(rowElement); this._errorHandlingController && this._errorHandlingController.removeErrorRow($rowElement.next()); $rowElement.remove() })) } _updateContent(tableElement, change) { let $freeSpaceRowElements; const contentElement = this._findContentElement(); const changeType = change && change.changeType; const d = (0, _deferred.Deferred)(); const contentTable = contentElement.children().first(); if ("append" === changeType || "prepend" === changeType) { this.waitAsyncTemplates().done((() => { const $tBodies = this._getBodies(tableElement); if (1 === $tBodies.length) { this._getBodies(contentTable)["append" === changeType ? "append" : "prepend"]($tBodies.children()) } else { $tBodies["append" === changeType ? "appendTo" : "prependTo"](contentTable) } tableElement.remove(); $freeSpaceRowElements = this._getFreeSpaceRowElements(contentTable); removeEmptyRows($freeSpaceRowElements, "dx-freespace-row"); if (change.removeCount) { this._removeRowsElements(contentTable, change.removeCount, changeType) } this._restoreErrorRow(contentTable); d.resolve() })).fail(d.reject) } else { super._updateContent.apply(this, arguments).done((() => { if ("update" === changeType) { this._restoreErrorRow(contentTable) } d.resolve() })).fail(d.reject) } return d.promise().done((() => { this._updateBottomLoading() })) } _addVirtualRow($table, isFixed, location, position) { if (!position) { return } let $virtualRow = this._createEmptyRow("dx-virtual-row", isFixed, position); $virtualRow = this._wrapRowIfNeed($table, $virtualRow); this._appendEmptyRow($table, $virtualRow, location) } _updateContentItemSizes() { const rowHeights = this._getRowHeights(); const correctedRowHeights = this._correctRowHeights(rowHeights); this._dataController.setContentItemSizes(correctedRowHeights) } _updateViewportSize(viewportHeight, scrollTop) { if (!(0, _type.isDefined)(viewportHeight)) { viewportHeight = this._hasHeight ? (0, _size.getOuterHeight)(this.element()) : (0, _size.getOuterHeight)((0, _window.getWindow)()) } this._dataController.viewportHeight(viewportHeight, scrollTop) } _getRowHeights() { var _this$_editingControl2, _this$_editingControl3; const isPopupEditMode = null === (_this$_editingControl2 = this._editingController) || void 0 === _this$_editingControl2 || null === (_this$_editingControl3 = _this$_editingControl2.isPopupEditMode) || void 0 === _this$_editingControl3 ? void 0 : _this$_editingControl3.call(_this$_editingControl2); let rowElements = this._getRowElements(this._tableElement).toArray(); if (isPopupEditMode) { rowElements = rowElements.filter((row => !(0, _renderer.default)(row).hasClass("dx-row-inserted"))) } return rowElements.map((row => (0, _position.getBoundingRect)(row).height)) } _correctRowHeights(rowHeights) { const dataController = this._dataController; const dataSource = dataController._dataSource; const correctedRowHeights = []; const visibleRows = dataController.getVisibleRows(); let itemSize = 0; let firstCountableItem = true; let lastLoadIndex = -1; for (let i = 0; i < rowHeights.length; i++) { const currentItem = visibleRows[i]; if (!(0, _type.isDefined)(currentItem)) { continue } if (false === this.option(LEGACY_SCROLLING_MODE)) { if (lastLoadIndex >= 0 && lastLoadIndex !== currentItem.loadIndex) { correctedRowHeights.push(itemSize); itemSize = 0 } lastLoadIndex = currentItem.loadIndex } else if (isItemCountableByDataSource(currentItem, dataSource)) { if (firstCountableItem) { firstCountableItem = false } else { correctedRowHeights.push(itemSize); itemSize = 0 } } itemSize += rowHeights[i] } itemSize > 0 && correctedRowHeights.push(itemSize); return correctedRowHeights } _updateContentPosition(isRender) { const rowHeight = this._rowHeight || 20; this._dataController.viewportItemSize(rowHeight); if (isVirtualMode(this) || _m_utils.default.isVirtualRowRendering(this)) { if (!isRender) { this._updateContentItemSizes() } const top = this._dataController.getContentOffset("begin"); const bottom = this._dataController.getContentOffset("end"); const $tables = this.getTableElements(); const $virtualRows = $tables.children("tbody").children(".dx-virtual-row"); removeEmptyRows($virtualRows, "dx-virtual-row"); $tables.each(((index, element) => { const isFixed = index > 0; const prevFixed = this._isFixedTableRendering; this._isFixedTableRendering = isFixed; this._addVirtualRow((0, _renderer.default)(element), isFixed, "top", top); this._addVirtualRow((0, _renderer.default)(element), isFixed, "bottom", bottom); this._isFixedTableRendering = prevFixed })) } } _isTableLinesDisplaysCorrect(table) { const hasColumnLines = table.find(".dx-column-lines").length > 0; return hasColumnLines === this.option("showColumnLines") } _isColumnElementsEqual($columns, $virtualColumns) { let result = $columns.length === $virtualColumns.length; if (result) { (0, _iterator.each)($columns, ((index, element) => { if (element.style.width !== $virtualColumns[index].style.width) { result = false; return result } return })) } return result } _getCellClasses(column) { const classes = []; const { cssClass: cssClass } = column; const isExpandColumn = "expand" === column.command; cssClass && classes.push(cssClass); isExpandColumn && classes.push(this.addWidgetPrefix("group-space")); return classes } _findBottomLoadPanel($contentElement) { const $element = $contentElement || this.element(); const $bottomLoadPanel = $element && $element.find(`.${this.addWidgetPrefix("bottom-load-panel")}`); if ($bottomLoadPanel && $bottomLoadPanel.length) { return $bottomLoadPanel } } _updateBottomLoading() { const that = this; const virtualMode = isVirtualMode(this); const appendMode = isAppendMode(this); const showBottomLoading = !that._dataController.hasKnownLastPage() && that._dataController.isLoaded() && (virtualMode || appendMode); const $contentElement = that._findContentElement(); const bottomLoadPanelElement = that._findBottomLoadPanel($contentElement); if (showBottomLoading) { if (!bottomLoadPanelElement) { (0, _renderer.default)("
").addClass(that.addWidgetPrefix("bottom-load-panel")).append(that._createComponent((0, _renderer.default)("
"), _load_indicator.default, { elementAttr: { role: null, "aria-label": null } }).$element()).appendTo($contentElement) } } else if (bottomLoadPanelElement) { bottomLoadPanelElement.remove() } } _handleScroll(e) { const legacyScrollingMode = true === this.option(LEGACY_SCROLLING_MODE); const zeroTopPosition = 0 === e.scrollOffset.top; const isScrollTopChanged = this._scrollTop !== e.scrollOffset.top; const hasScrolled = isScrollTopChanged || e.forceUpdateScrollPosition; const isValidScrollTarget = this._hasHeight || !legacyScrollingMode && zeroTopPosition; if (hasScrolled && isValidScrollTarget && this._rowHeight) { this._scrollTop = e.scrollOffset.top; const isVirtualRowRendering = isVirtualMode(this) || "standard" !== this.option("scrolling.rowRenderingMode"); if (isVirtualRowRendering && false === this.option(LEGACY_SCROLLING_MODE)) { this._updateContentItemSizes(); this._updateViewportSize(null, this._scrollTop) } this._dataController.setViewportPosition(e.scrollOffset.top) } super._handleScroll.apply(this, arguments) } _needUpdateRowHeight(itemsCount) { return super._needUpdateRowHeight.apply(this, arguments) || itemsCount > 0 && isAppendMode(this) && !_m_utils.default.isVirtualRowRendering(this) } _updateRowHeight() { super._updateRowHeight.apply(this, arguments); if (this._rowHeight) { this._updateContentPosition(); const viewportHeight = this._hasHeight ? (0, _size.getOuterHeight)(this.element()) : (0, _size.getOuterHeight)((0, _window.getWindow)()); if (false === this.option(LEGACY_SCROLLING_MODE)) { this._updateViewportSize(viewportHeight); this._dataController.updateViewport() } else { this._dataController.viewportSize(Math.ceil(viewportHeight / this._rowHeight)) } } } updateFreeSpaceRowHeight() { const result = super.updateFreeSpaceRowHeight.apply(this, arguments); if (result) { this._updateContentPosition() } return result } setLoading(isLoading, messageText) { const dataController = this._dataController; const hasBottomLoadPanel = dataController.pageIndex() > 0 && dataController.isLoaded() && !!this._findBottomLoadPanel(); if (false === this.option(LEGACY_SCROLLING_MODE) && isLoading && dataController.isViewportChanging()) { return } if (hasBottomLoadPanel) { isLoading = false } super.setLoading.call(this, isLoading, messageText) } throwHeightWarningIfNeed() { if (void 0 === this._hasHeight) { return } const needToThrow = !this._hasHeight && isVirtualPaging(this); if (needToThrow && !this._heightWarningIsThrown) { this._heightWarningIsThrown = true; _ui.default.log("W1025") } } _resizeCore() { const that = this; const $element = that.element(); super._resizeCore(); this.throwHeightWarningIfNeed(); if (that.component.$element() && !that._windowScroll && (0, _dom.isElementInDom)($element)) { that._windowScroll = (0, _m_virtual_scrolling_core.subscribeToExternalScrollers)($element, (scrollPos => { if (!that._hasHeight && that._rowHeight) { that._dataController.setViewportPosition(scrollPos) } }), that.component.$element()); that.on("disposing", (() => { that._windowScroll.dispose() })) } if (false !== this.option(LEGACY_SCROLLING_MODE)) { that.loadIfNeed() } } loadIfNeed() { var _this$_dataController2, _this$_dataController3; null === (_this$_dataController2 = this._dataController) || void 0 === _this$_dataController2 || null === (_this$_dataController3 = _this$_dataController2.loadIfNeed) || void 0 === _this$_dataController3 || _this$_dataController3.call(_this$_dataController2) } _restoreErrorRow(contentTable) { if (false === this.option(LEGACY_SCROLLING_MODE)) { var _this$_errorHandlingC; null === (_this$_errorHandlingC = this._errorHandlingController) || void 0 === _this$_errorHandlingC || _this$_errorHandlingC.removeErrorRow() } super._restoreErrorRow.apply(this, arguments) } }; exports.rowsView = rowsView; exports.virtualScrollingModule = { defaultOptions: () => ({ scrolling: { timeout: 300, updateTimeout: 300, minTimeout: 0, renderingThreshold: 100, removeInvisiblePages: true, rowPageSize: 5, prerenderedRowChunkSize: 1, mode: "standard", preloadEnabled: false, rowRenderingMode: "standard", loadTwoPagesOnStart: false, legacyMode: false, prerenderedRowCount: 1 } }), extenders: { controllers: { data: data, resizing: resizing }, views: { rowsView: rowsView } } } }, 86770: /*!**********************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/grid_core/virtual_scrolling/m_virtual_scrolling_core.js ***! \**********************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.VirtualScrollController = void 0; exports.subscribeToExternalScrollers = subscribeToExternalScrollers; var _position = _interopRequireDefault(__webpack_require__( /*! ../../../../animation/position */ 49387)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _browser = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/browser */ 47810)); var _callbacks = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/callbacks */ 44504)); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _window = __webpack_require__( /*! ../../../../core/utils/window */ 58201); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../../events/core/events_engine */ 55994)); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../m_utils */ 60082)); var _m_virtual_data_loader = __webpack_require__( /*! ../virtual_data_loader/m_virtual_data_loader */ 20488); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const isVirtualMode = that => "virtual" === that.option("scrolling.mode") || that._isVirtual; function subscribeToExternalScrollers($element, scrollChangedHandler, $targetElement) { let $scrollElement; const scrollableArray = []; const scrollToArray = []; const disposeArray = []; $targetElement = $targetElement || $element; function getElementOffset(scrollable) { const $scrollableElement = scrollable.element ? scrollable.$element() : scrollable; const scrollableOffset = _position.default.offset($scrollableElement); if (!scrollableOffset) { return $element.offset().top } return scrollable.scrollTop() - (scrollableOffset.top - $element.offset().top) } const widgetScrollStrategy = { on(scrollable, eventName, handler) { scrollable.on("scroll", handler) }, off(scrollable, eventName, handler) { scrollable.off("scroll", handler) } }; function subscribeToScrollEvents($scrollElement) { const isDocument = "#document" === $scrollElement.get(0).nodeName; const isElement = $scrollElement.get(0).nodeType === (0, _window.getWindow)().Node.ELEMENT_NODE; let scrollable = $scrollElement.data("dxScrollable"); let eventsStrategy = widgetScrollStrategy; if (!scrollable) { scrollable = isDocument && (0, _renderer.default)((0, _window.getWindow)()) || isElement && "auto" === $scrollElement.css("overflowY") && $scrollElement; eventsStrategy = _events_engine.default; if (!scrollable) { return } } const handler = function(scrollable) { return function() { let scrollTop = scrollable.scrollTop() - getElementOffset(scrollable); scrollTop = scrollTop > 0 ? scrollTop : 0; scrollChangedHandler(scrollTop) } }(scrollable); eventsStrategy.on(scrollable, "scroll", handler); scrollToArray.push((pos => { const topOffset = getElementOffset(scrollable); const scrollMethod = scrollable.scrollTo ? "scrollTo" : "scrollTop"; if (pos - topOffset >= 0) { scrollable[scrollMethod](pos + topOffset) } })); scrollableArray.push(scrollable); disposeArray.push((() => { eventsStrategy.off(scrollable, "scroll", handler) })) } const getScrollElementParent = $element => (0, _renderer.default)($element.get(0).parentNode ?? $element.get(0).host); for ($scrollElement = $targetElement.parent(); $scrollElement.length; $scrollElement = getScrollElementParent($scrollElement)) { subscribeToScrollEvents($scrollElement) } return { scrollTo(pos) { (0, _iterator.each)(scrollToArray, ((_, scrollTo) => { scrollTo(pos) })) }, dispose() { (0, _iterator.each)(disposeArray, ((_, dispose) => { dispose() })) } } } class VirtualScrollController { constructor(component, dataOptions, isVirtual) { this._dataOptions = dataOptions; this.component = component; this._viewportSize = false === component.option("scrolling.legacyMode") ? 15 : 0; this._viewportItemSize = 20; this._viewportItemIndex = 0; this._position = 0; this._isScrollingBack = false; this._contentSize = 0; this._itemSizes = {}; this._sizeRatio = 1; this._isVirtual = isVirtual; this.positionChanged = (0, _callbacks.default)(); this._dataLoader = new _m_virtual_data_loader.VirtualDataLoader(this, this._dataOptions) } getItemSizes() { return this._itemSizes } option(name, value) { return this.component.option.apply(this.component, arguments) } isVirtual() { return this._isVirtual } virtualItemsCount() { if (isVirtualMode(this)) { const dataOptions = this._dataOptions; const totalItemsCount = dataOptions.totalItemsCount(); if (false === this.option("scrolling.legacyMode") && -1 !== totalItemsCount) { const viewportParams = this.getViewportParams(); const loadedOffset = dataOptions.loadedOffset(); const loadedItemCount = dataOptions.loadedItemCount(); const skip = Math.max(viewportParams.skip, loadedOffset); const take = Math.min(viewportParams.take, loadedItemCount); const endItemsCount = Math.max(totalItemsCount - (skip + take), 0); return { begin: skip, end: endItemsCount } } return this._dataLoader.virtualItemsCount.apply(this._dataLoader, arguments) } return } getScrollingTimeout() { const renderAsync = this.option("scrolling.renderAsync"); let scrollingTimeout = 0; if (!(0, _type.isDefined)(renderAsync)) { scrollingTimeout = Math.min(this.option("scrolling.timeout") || 0, this._dataOptions.changingDuration()); if (scrollingTimeout < this.option("scrolling.renderingThreshold")) { scrollingTimeout = this.option("scrolling.minTimeout") || 0 } } else if (renderAsync) { scrollingTimeout = this.option("scrolling.timeout") ?? 0 } return scrollingTimeout } setViewportPosition(position) { const result = new _deferred.Deferred; const scrollingTimeout = this.getScrollingTimeout(); clearTimeout(this._scrollTimeoutID); if (scrollingTimeout > 0) { this._scrollTimeoutID = setTimeout((() => { this._setViewportPositionCore(position); result.resolve() }), scrollingTimeout) } else { this._setViewportPositionCore(position); result.resolve() } return result.promise() } getViewportPosition() { return this._position } getItemIndexByPosition(position, viewportItemIndex, height) { position = position ?? this._position; const defaultItemSize = this.getItemSize(); let offset = 0; let itemOffset = 0; const itemOffsetsWithSize = Object.keys(this._itemSizes).concat(-1); for (let i = 0; i < itemOffsetsWithSize.length && offset < position; i++) { const itemOffsetWithSize = parseInt(itemOffsetsWithSize[i]); let itemOffsetDiff = (position - offset) / defaultItemSize; if (itemOffsetWithSize < 0 || itemOffset + itemOffsetDiff < itemOffsetWithSize) { itemOffset += itemOffsetDiff; if (this._sizeRatio < 1 && (0, _type.isDefined)(viewportItemIndex)) { itemOffset = viewportItemIndex + height / this._viewportItemSize } break } else { itemOffsetDiff = itemOffsetWithSize - itemOffset; offset += itemOffsetDiff * defaultItemSize; itemOffset += itemOffsetDiff } const itemSize = this._itemSizes[itemOffsetWithSize]; offset += itemSize; itemOffset += offset < position ? 1 : (position - offset + itemSize) / itemSize } return Math.round(50 * itemOffset) / 50 } isScrollingBack() { return this._isScrollingBack } _setViewportPositionCore(position) { const prevPosition = this._position || 0; this._position = position; if (prevPosition !== this._position) { this._isScrollingBack = this._position < prevPosition } const itemIndex = this.getItemIndexByPosition(); const result = this.setViewportItemIndex(itemIndex); this.positionChanged.fire(); return result } setContentItemSizes(sizes) { const virtualItemsCount = this.virtualItemsCount(); this._contentSize = sizes.reduce(((a, b) => a + b), 0); if (virtualItemsCount) { sizes.forEach(((size, index) => { this._itemSizes[virtualItemsCount.begin + index] = size })); const virtualContentSize = (virtualItemsCount.begin + virtualItemsCount.end + this.itemsCount()) * this._viewportItemSize; const contentHeightLimit = _m_utils.default.getContentHeightLimit(_browser.default); if (virtualContentSize > contentHeightLimit) { this._sizeRatio = contentHeightLimit / virtualContentSize } else { this._sizeRatio = 1 } } } getItemSize() { return this._viewportItemSize * this._sizeRatio } getItemOffset(itemIndex, isEnd) { const virtualItemsCount = this.virtualItemsCount(); let itemCount = itemIndex; if (!virtualItemsCount) { return 0 } let offset = 0; const totalItemsCount = this._dataOptions.totalItemsCount(); Object.keys(this._itemSizes).forEach((currentItemIndex => { if (!itemCount) { return } if (isEnd ? currentItemIndex >= totalItemsCount - itemIndex : currentItemIndex < itemIndex) { offset += this._itemSizes[currentItemIndex]; itemCount-- } })); return Math.floor(offset + itemCount * this._viewportItemSize * this._sizeRatio) } getContentOffset(type) { const isEnd = "end" === type; const virtualItemsCount = this.virtualItemsCount(); if (!virtualItemsCount) { return 0 } return this.getItemOffset(isEnd ? virtualItemsCount.end : virtualItemsCount.begin, isEnd) } getVirtualContentSize() { const virtualItemsCount = this.virtualItemsCount(); return virtualItemsCount ? this.getContentOffset("begin") + this.getContentOffset("end") + this._contentSize : 0 } getViewportItemIndex() { return this._viewportItemIndex } setViewportItemIndex(itemIndex) { this._viewportItemIndex = itemIndex; if (false === this.option("scrolling.legacyMode")) { return } return this._dataLoader.viewportItemIndexChanged.apply(this._dataLoader, arguments) } viewportItemSize(size) { if (void 0 !== size) { this._viewportItemSize = size } return this._viewportItemSize } viewportSize(size) { if (void 0 !== size) { this._viewportSize = size } return this._viewportSize } viewportHeight(height, scrollTop) { const position = scrollTop ?? this._position; const begin = this.getItemIndexByPosition(position); const end = this.getItemIndexByPosition(position + height, begin, height); this.viewportSize(Math.ceil(end - begin)); if (!(0, _type.isDefined)(scrollTop) && this._viewportItemIndex !== begin) { this._setViewportPositionCore(position) } } reset(isRefresh) { this._dataLoader.reset(); if (!isRefresh) { this._itemSizes = {} } } subscribeToWindowScrollEvents($element) { this._windowScroll = this._windowScroll || subscribeToExternalScrollers($element, (scrollTop => { if (this.viewportItemSize()) { this.setViewportPosition(scrollTop) } })) } dispose() { clearTimeout(this._scrollTimeoutID); this._windowScroll && this._windowScroll.dispose(); this._windowScroll = null } scrollTo(pos) { this._windowScroll && this._windowScroll.scrollTo(pos) } isVirtualMode() { return isVirtualMode(this) } isAppendMode() { return that = this, "infinite" === that.option("scrolling.mode") && !that._isVirtual; var that } getViewportParams() { const virtualMode = "virtual" === this.option("scrolling.mode"); const totalItemsCount = this._dataOptions.totalItemsCount(); const hasKnownLastPage = this._dataOptions.hasKnownLastPage(); const topIndex = hasKnownLastPage && this._viewportItemIndex > totalItemsCount ? totalItemsCount : this._viewportItemIndex; const bottomIndex = this._viewportSize + topIndex; const maxGap = this.option("scrolling.prerenderedRowChunkSize") || 1; const isScrollingBack = this.isScrollingBack(); const minGap = this.option("scrolling.prerenderedRowCount") ?? 1; const topMinGap = isScrollingBack ? minGap : 0; const bottomMinGap = isScrollingBack ? 0 : minGap; const skip = Math.floor(Math.max(0, topIndex - topMinGap) / maxGap) * maxGap; let take = Math.ceil((bottomIndex + bottomMinGap - skip) / maxGap) * maxGap; if (virtualMode) { const remainedItems = Math.max(0, totalItemsCount - skip); take = Math.min(take, remainedItems) } return { skip: skip, take: take } } itemsCount() { let result = 0; if (this.option("scrolling.legacyMode")) { result = this._dataLoader.itemsCount.apply(this._dataLoader, arguments) } else { result = this._dataOptions.itemsCount() } return result } pageIndex() { return this._dataLoader.pageIndex(...arguments) } beginPageIndex() { return this._dataLoader.beginPageIndex(...arguments) } endPageIndex() { return this._dataLoader.endPageIndex(...arguments) } pageSize() { return this._dataLoader.pageSize(...arguments) } load() { return this._dataLoader.load(...arguments) } loadIfNeed() { return this._dataLoader.loadIfNeed(...arguments) } handleDataChanged() { return this._dataLoader.handleDataChanged(...arguments) } getDelayDeferred() { return this._dataLoader.getDelayDeferred() } } exports.VirtualScrollController = VirtualScrollController; exports.default = { VirtualScrollController: VirtualScrollController } }, 74305: /*!**************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/area_item/m_area_item.js ***! \**************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.getRealElementWidth = exports.default = exports.AreaItem = void 0; var _class = _interopRequireDefault(__webpack_require__( /*! ../../../../core/class */ 38377)); var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../../core/dom_adapter */ 73349)); var _element = __webpack_require__( /*! ../../../../core/element */ 6415); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _position = __webpack_require__( /*! ../../../../core/utils/position */ 37518); var _size = __webpack_require__( /*! ../../../../core/utils/size */ 58664); var _style = __webpack_require__( /*! ../../../../core/utils/style */ 80968); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _scroll = __webpack_require__( /*! ../../../core/utils/scroll */ 97944); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const getRealElementWidth = function(element) { let width = 0; const { offsetWidth: offsetWidth } = element; if (element.getBoundingClientRect) { const clientRect = (0, _position.getBoundingRect)(element); width = clientRect.width; if (!width) { width = clientRect.right - clientRect.left } if (width <= offsetWidth - 1) { width = offsetWidth } } return width > 0 ? width : offsetWidth }; exports.getRealElementWidth = getRealElementWidth; function getFakeTableOffset(scrollPos, elementOffset, tableSize, viewPortSize) { let offset = 0; let halfTableCount = 0; const halfTableSize = tableSize / 2; if (scrollPos + viewPortSize - (elementOffset + tableSize) > 1) { if (scrollPos >= elementOffset + tableSize + halfTableSize) { halfTableCount = parseInt((scrollPos - (elementOffset + tableSize)) / halfTableSize, 10) } offset = elementOffset + tableSize + halfTableSize * halfTableCount } else if (scrollPos < elementOffset) { if (scrollPos <= elementOffset - halfTableSize) { halfTableCount = parseInt((scrollPos - (elementOffset - halfTableSize)) / halfTableSize, 10) } offset = elementOffset - (tableSize - halfTableSize * halfTableCount) } else { offset = elementOffset } return offset } const AreaItem = exports.AreaItem = _class.default.inherit({ ctor(component) { this.component = component }, option() { return this.component.option.apply(this.component, arguments) }, _getRowElement(index) { const that = this; if (that._tableElement && that._tableElement.length > 0) { return that._tableElement[0].rows[index] } return null }, _createGroupElement: () => (0, _renderer.default)("
"), _createTableElement: () => (0, _renderer.default)("
"), _getCellText(cell, encodeHtml) { let cellText = cell.isWhiteSpace ? " " : cell.text || " "; if (encodeHtml && (-1 !== cellText.indexOf("<") || -1 !== cellText.indexOf(">"))) { cellText = (0, _renderer.default)("
").text(cellText).html() } return cellText }, _getRowClassNames() {}, _applyCustomStyles(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: () => _dom_adapter.default.createElement("tbody"), _getCloseMainElementMarkup: () => "", _renderTableContent(tableElement, data) { const that = this; const rowsCount = data.length; let row; let cell; let i; let j; let cellText; const rtlEnabled = that.option("rtlEnabled"); const encodeHtml = that.option("encodeHtml"); let rowClassNames; tableElement.data("area", that._getAreaName()); tableElement.data("data", data); tableElement.css("width", ""); const tbody = this._getMainElementMarkup(); for (i = 0; i < rowsCount; i += 1) { row = data[i]; rowClassNames = []; const tr = _dom_adapter.default.createElement("tr"); for (j = 0; j < row.length; j += 1) { cell = row[j]; this._getRowClassNames(i, cell, rowClassNames); const td = _dom_adapter.default.createElement("td"); if (cell) { cell.rowspan && td.setAttribute("rowspan", cell.rowspan || 1); cell.colspan && td.setAttribute("colspan", cell.colspan || 1); const styleOptions = { cellElement: undefined, cell: cell, cellsCount: row.length, cellIndex: j, rowElement: undefined, rowIndex: i, rowsCount: rowsCount, rtlEnabled: rtlEnabled, classArray: [], cssArray: [] }; that._applyCustomStyles(styleOptions); if (styleOptions.cssArray.length) { (0, _style.setStyle)(td, styleOptions.cssArray.join(";")) } if (styleOptions.classArray.length) { td.setAttribute("class", styleOptions.classArray.join(" ")) } if ((0, _type.isDefined)(cell.expanded)) { const div = _dom_adapter.default.createElement("div"); div.classList.add("dx-expand-icon-container"); const span = _dom_adapter.default.createElement("span"); span.classList.add("dx-expand"); div.appendChild(span); td.appendChild(div) } cellText = this._getCellText(cell, encodeHtml) } else { cellText = "" } const span = _dom_adapter.default.createElement("span"); if ((0, _type.isDefined)(cell.wordWrapEnabled)) { span.style.whiteSpace = cell.wordWrapEnabled ? "normal" : "nowrap" } span.innerHTML = cellText; td.appendChild(span); if (cell.sorted) { const span = _dom_adapter.default.createElement("span"); span.classList.add("dx-icon-sorted"); td.appendChild(span) } tr.appendChild(td) } if (rowClassNames.length) { tr.setAttribute("class", rowClassNames.join(" ")) } tbody.appendChild(tr) } tableElement.append(tbody); this._triggerOnCellPrepared(tableElement, data) }, _triggerOnCellPrepared(tableElement, data) { const that = this; const rowElements = tableElement.find("tr"); const areaName = that._getAreaName(); const onCellPrepared = that.option("onCellPrepared"); const hasEvent = that.component._eventsStrategy.hasEvent("cellPrepared"); let rowElement; let $cellElement; let onCellPreparedArgs; const defaultActionArgs = this.component._defaultActionArgs(); let row; let cell; let rowIndex; let columnIndex; if (onCellPrepared || hasEvent) { for (rowIndex = 0; rowIndex < data.length; rowIndex += 1) { row = data[rowIndex]; rowElement = rowElements.eq(rowIndex); for (columnIndex = 0; columnIndex < row.length; columnIndex += 1) { cell = row[columnIndex]; $cellElement = rowElement.children().eq(columnIndex); onCellPreparedArgs = { area: areaName, rowIndex: rowIndex, columnIndex: columnIndex, cellElement: (0, _element.getPublicElement)($cellElement), cell: cell }; if (hasEvent) { that.component._trigger("onCellPrepared", onCellPreparedArgs) } else { onCellPrepared((0, _extend.extend)(onCellPreparedArgs, defaultActionArgs)) } } } } }, _getRowHeight(index) { const row = this._getRowElement(index); let height = 0; const { offsetHeight: offsetHeight } = row; if (row && row.lastChild) { if (row.getBoundingClientRect) { const clientRect = (0, _position.getBoundingRect)(row); height = clientRect.height; if (height <= offsetHeight - 1) { height = offsetHeight } } return height > 0 ? height : offsetHeight } return 0 }, _setRowHeight(index, value) { const row = this._getRowElement(index); if (row) { row.style.height = `${value}px` } }, getRowsLength() { const that = this; if (that._tableElement && that._tableElement.length > 0) { return that._tableElement[0].rows.length } return 0 }, getRowsHeight() { const that = this; const result = []; const rowsLength = that.getRowsLength(); for (let i = 0; i < rowsLength; i += 1) { result.push(that._getRowHeight(i)) } return result }, setRowsHeight(values) { const that = this; let totalHeight = 0; const valuesLength = values.length; for (let i = 0; i < valuesLength; i += 1) { totalHeight += values[i]; that._setRowHeight(i, values[i]) } this._tableHeight = totalHeight; this._tableElement[0].style.height = `${totalHeight}px` }, getColumnsWidth() { const rowsLength = this.getRowsLength(); let rowIndex; let row; let i; let columnIndex; const processedCells = []; const result = []; const fillCells = function(cells, rowIndex, columnIndex, rowSpan, colSpan) { let rowOffset; let columnOffset; for (rowOffset = 0; rowOffset < rowSpan; rowOffset += 1) { for (columnOffset = 0; columnOffset < colSpan; columnOffset += 1) { cells[rowIndex + rowOffset] = cells[rowIndex + rowOffset] || []; cells[rowIndex + rowOffset][columnIndex + columnOffset] = true } } }; if (rowsLength) { for (rowIndex = 0; rowIndex < rowsLength; rowIndex += 1) { processedCells[rowIndex] = processedCells[rowIndex] || []; row = this._getRowElement(rowIndex); for (i = 0; i < row.cells.length; i += 1) { for (columnIndex = 0; processedCells[rowIndex][columnIndex]; columnIndex += 1) {} 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(values) { let i; const tableElement = this._tableElement[0]; this._colgroupElement.html(""); const columnsCount = this.getColumnsCount(); const columnWidth = []; for (i = 0; i < columnsCount; i += 1) { columnWidth.push(values[i] || 0) } for (i = columnsCount; i < values.length && values; i += 1) { columnWidth[columnsCount - 1] += values[i] } for (i = 0; i < columnsCount; i += 1) { const col = _dom_adapter.default.createElement("col"); col.style.width = `${columnWidth[i]}px`; this._colgroupElement.append(col) } this._tableWidth = columnWidth.reduce(((sum, width) => sum + width), 0); tableElement.style.width = `${this._tableWidth}px`; tableElement.style.tableLayout = "fixed" }, resetColumnsWidth() { (0, _size.setWidth)(this._colgroupElement.find("col"), "auto"); this._tableElement.css({ width: "", tableLayout: "" }) }, setGroupWidth(value) { this._getScrollable().option("width", value) }, setGroupHeight(value) { this._getScrollable().option("height", value) }, getGroupHeight() { return this._getGroupElementSize("height") }, getGroupWidth() { return this._getGroupElementSize("width") }, _getGroupElementSize(dimension) { const size = this.groupElement()[0].style[dimension]; if (size.indexOf("px") > 0) { return parseFloat(size) } return null }, groupElement() { return this._groupElement }, tableElement() { return this._tableElement }, element() { return this._rootElement }, headElement() { return this._tableElement.find("thead") }, _setTableCss(styles) { if (this.option("rtlEnabled")) { styles.right = styles.left; delete styles.left } this.tableElement().css(styles) }, setVirtualContentParams(params) { this._virtualContent.css({ width: params.width, height: params.height }); const scrollable = this._getScrollable(); if (null !== scrollable && void 0 !== scrollable && scrollable.isRenovated()) { this._getScrollable().option("classes", "dx-virtual-mode") } else { this.groupElement().addClass("dx-virtual-mode") } }, disableVirtualMode() { const scrollable = this._getScrollable(); if (null !== scrollable && void 0 !== scrollable && scrollable.isRenovated()) { this._getScrollable().option("classes", "") } else { this.groupElement().removeClass("dx-virtual-mode") } }, _renderVirtualContent() { const that = this; if (!that._virtualContent && "virtual" === that.option("scrolling.mode")) { that._virtualContent = (0, _renderer.default)("
").addClass("dx-virtual-content").insertBefore(that._tableElement) } }, reset() { const tableElement = this._tableElement[0]; this._fakeTable && this._fakeTable.detach(); this._fakeTable = null; this.disableVirtualMode(); this.setGroupWidth("100%"); this.setGroupHeight("auto"); this.resetColumnsWidth(); if (tableElement) { for (let i = 0; i < tableElement.rows.length; i += 1) { tableElement.rows[i].style.height = "" } tableElement.style.height = ""; tableElement.style.width = "100%" } }, _updateFakeTableVisibility() { const that = this; const tableElement = that.tableElement()[0]; const horizontalOffsetName = that.option("rtlEnabled") ? "right" : "left"; const 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(scrollPos) { const that = this; const rtlEnabled = that.option("rtlEnabled"); const offsetStyleName = rtlEnabled ? "right" : "left"; const tableElementOffset = parseFloat(that.tableElement()[0].style[offsetStyleName]); const offset = getFakeTableOffset(scrollPos, tableElementOffset, that._tableWidth, that.getGroupWidth()); if (parseFloat(that._fakeTable[0].style[offsetStyleName]) !== offset) { that._fakeTable[0].style[offsetStyleName] = `${offset}px` } }, _moveFakeTableTop(scrollPos) { const that = this; const tableElementOffsetTop = parseFloat(that.tableElement()[0].style.top); const offsetTop = getFakeTableOffset(scrollPos, tableElementOffsetTop, that._tableHeight, that.getGroupHeight()); if (parseFloat(that._fakeTable[0].style.top) !== offsetTop) { that._fakeTable[0].style.top = `${offsetTop}px` } }, _moveFakeTable() { this._updateFakeTableVisibility() }, _createFakeTable() { const that = this; if (!that._fakeTable) { that._fakeTable = that.tableElement().clone().addClass("dx-pivot-grid-fake-table").appendTo(that._virtualContent) } }, render(rootElement, data) { const that = this; if (that._tableElement) { try { that._tableElement[0].innerHTML = "" } catch (e) { that._tableElement.empty() } that._tableElement.removeAttr("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, _renderer.default)("
").appendTo(that._tableElement); that._renderTableContent(that._tableElement, data); that._renderVirtualContent() }, _getScrollable() { return this.groupElement().data("dxScrollable") }, _getMemoizeScrollTo() { this._memoizeScrollTo = this._memoizeScrollTo ?? (0, _scroll.getMemoizeScrollTo)((() => this._getScrollable())); return this._memoizeScrollTo }, _getMaxLeftOffset(scrollable) { const containerElement = (0, _renderer.default)(scrollable.container()).get(0); return containerElement.scrollWidth - containerElement.clientWidth }, on(eventName, handler) { const that = this; const scrollable = that._getScrollable(); if (scrollable) { scrollable.on(eventName, (e => { if (that.option("rtlEnabled") && (0, _type.isDefined)(e.scrollOffset.left)) { e.scrollOffset.left = that._getMaxLeftOffset(scrollable) - e.scrollOffset.left } handler(e) })) } return this }, off(eventName) { const scrollable = this._getScrollable(); if (scrollable) { scrollable.off(eventName) } return this }, scrollTo(pos) { let force = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : false; const scrollable = this._getScrollable(); if (!scrollable) { return } const rtlEnabled = this.option("rtlEnabled"); const areaName = this._getAreaName(); const scrollablePos = _extends({}, pos, { left: rtlEnabled && ("column" === areaName || "data" === areaName) ? this._getMaxLeftOffset(scrollable) - pos.left : pos.left }); const memoizeScrollTo = this._getMemoizeScrollTo(); memoizeScrollTo(scrollablePos, force); if (this._virtualContent) { this._createFakeTable(); this._moveFakeTable(pos) } }, updateScrollable() { const scrollable = this._getScrollable(); if (scrollable) { return scrollable.update() } return }, getColumnsCount() { let columnCount = 0; const row = this._getRowElement(0); let cells; if (row) { cells = row.cells; for (let i = 0, len = cells.length; i < len; ++i) { columnCount += cells[i].colSpan } } return columnCount }, getData() { const tableElement = this._tableElement; return tableElement ? tableElement.data("data") : [] } }); exports.default = { AreaItem: AreaItem, getRealElementWidth: getRealElementWidth } }, 85654: /*!******************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/chart_integration/m_chart_integration.js ***! \******************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.ChartIntegrationMixin = void 0; var _renderer = (obj = __webpack_require__( /*! ../../../../core/renderer */ 68374), obj && obj.__esModule ? obj : { default: obj }); var obj; var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _m_widget_utils = __webpack_require__( /*! ../m_widget_utils */ 28580); const FORMAT_DICTIONARY = { number: "numeric", date: "datetime" }; const UNBIND_KEY = "dxPivotGridUnbinding"; function getFormattedValue(path, fields) { const value = []; const lastFieldIndex = fields.length - 1; (0, _iterator.each)(path, ((i, item) => { value.push(item.text || (0, _m_widget_utils.formatValue)(item.value, fields[lastFieldIndex - i])) })); return value.reverse() } function getExpandedLevel(node) { let level = 0; (0, _m_widget_utils.foreachTree)(node, (members => { level = Math.max(level, members.length - 1) })); return level } function createChartDataSource(pivotGridDataSource, mapOptions, axisDictionary) { const data = pivotGridDataSource.getData(); const dataSource = []; const dataFields = pivotGridDataSource.getAreaFields("data"); const rowFields = pivotGridDataSource.getAreaFields("row"); const columnFields = pivotGridDataSource.getAreaFields("column"); const columnElements = [{ index: data.grandTotalColumnIndex, children: data.columns }]; const rowElements = [{ index: data.grandTotalRowIndex, children: data.rows }]; const rowLevel = getExpandedLevel(rowElements); const columnLevel = getExpandedLevel(columnElements); let measureIndex; let dataField; let rowMemberIndex; let rowVisibility; let rowPathFormatted; let rowPath; let columnMemberIndex; let columnVisibility; let columnPath; let columnPathFormatted; function createDataItem() { const dataCell = (data.values[rowMemberIndex] || [])[columnMemberIndex] || []; const value = dataCell[measureIndex]; let axis; let processCellArgs = { rowPath: rowPath, maxRowLevel: rowLevel, rowPathFormatted: rowPathFormatted, rowFields: rowFields, columnPathFormatted: columnPathFormatted, maxColumnLevel: columnLevel, columnPath: columnPath, columnFields: columnFields, dataFields: dataFields, dataIndex: measureIndex, dataValues: dataCell, visible: columnVisibility && rowVisibility }; let seriesName = (mapOptions.inverted ? columnPathFormatted : rowPathFormatted).join(" - "); let argument = (mapOptions.inverted ? rowPathFormatted : columnPathFormatted).join("/"); if (dataFields.length > 1) { if ("args" === mapOptions.putDataFieldsInto || "both" === mapOptions.putDataFieldsInto) { argument += ` | ${dataField.caption}` } if ("args" !== mapOptions.putDataFieldsInto) { seriesName += ` | ${dataField.caption}`; if ("singleAxis" !== mapOptions.dataFieldsDisplayMode) { axis = dataField.caption } } } processCellArgs.chartDataItem = { val: void 0 === value ? null : value, series: seriesName, arg: argument }; processCellArgs = function(processCellArgs, processCell) { let { chartDataItem: chartDataItem } = processCellArgs; let processedCell = processCell && processCell(processCellArgs); if (processedCell) { chartDataItem = (0, _extend.extend)({}, chartDataItem, processedCell.chartDataItem); processedCell = (0, _extend.extend)({}, processCellArgs, processedCell, { chartDataItem: chartDataItem }); return processedCell } return processCellArgs }(processCellArgs, mapOptions.processCell); if (processCellArgs.visible) { axisDictionary[processCellArgs.chartDataItem.series] = axisDictionary[processCellArgs.chartDataItem.series] || axis; dataSource.push(processCellArgs.chartDataItem) } } function foreachRowColumn(callBack) { (0, _m_widget_utils.foreachTree)(rowElements, (rowMembers => { rowMemberIndex = rowMembers[0].index; rowMembers = rowMembers.slice(0, rowMembers.length - 1); rowVisibility = rowLevel === rowMembers.length; rowPath = (0, _m_widget_utils.createPath)(rowMembers); rowPathFormatted = getFormattedValue(rowMembers, rowFields); if (0 === rowPath.length) { rowPathFormatted = [mapOptions.grandTotalText] }(0, _m_widget_utils.foreachTree)(columnElements, (columnMembers => { columnMemberIndex = columnMembers[0].index; columnMembers = columnMembers.slice(0, columnMembers.length - 1); columnVisibility = columnLevel === columnMembers.length; columnPath = (0, _m_widget_utils.createPath)(columnMembers); columnPathFormatted = getFormattedValue(columnMembers, columnFields); if (0 === columnPath.length) { columnPathFormatted = [mapOptions.grandTotalText] } callBack() })) })) } function foreachDataField(callback) { (0, _iterator.each)(dataFields, ((index, field) => { dataField = field; measureIndex = index; callback() })) } if (false === mapOptions.alternateDataFields) { foreachDataField((() => { foreachRowColumn(createDataItem) })) } else { foreachRowColumn((() => { foreachDataField(createDataItem) })) } return dataSource } function createValueAxisOptions(dataSource, options) { const dataFields = dataSource.getAreaFields("data"); if ("args" !== options.putDataFieldsInto && "singleAxis" !== options.dataFieldsDisplayMode || 1 === dataFields.length) { const valueAxisSettings = []; (0, _iterator.each)(dataFields, ((_, dataField) => { const valueAxisOptions = { name: dataField.caption, title: dataField.caption, valueType: FORMAT_DICTIONARY[dataField.dataType] || dataField.dataType, label: { format: dataField.format } }; if (dataField.customizeText) { valueAxisOptions.label.customizeText = function(formatObject) { return dataField.customizeText.call(dataField, formatObject) } } if ("splitPanes" === options.dataFieldsDisplayMode) { valueAxisOptions.pane = dataField.caption } valueAxisSettings.push(valueAxisOptions) })); return valueAxisSettings } return [{}] } function createPanesOptions(dataSource, options) { const panes = []; const dataFields = dataSource.getAreaFields("data"); if (dataFields.length > 1 && "splitPanes" === options.dataFieldsDisplayMode && "args" !== options.putDataFieldsInto) { (0, _iterator.each)(dataFields, ((_, dataField) => { panes.push({ name: dataField.caption }) })) } if (!panes.length) { panes.push({}) } return panes } const ChartIntegrationMixin = exports.ChartIntegrationMixin = { bindChart(chart, integrationOptions) { integrationOptions = (0, _extend.extend)({}, integrationOptions); const that = this; const updateChart = function() { integrationOptions.grandTotalText = that.option("texts.grandTotal"); const chartOptions = function(dataSource, options) { const { customizeSeries: customizeSeries } = options; const { customizeChart: customizeChart } = options; let chartOptions = { valueAxis: createValueAxisOptions(dataSource, options), panes: createPanesOptions(dataSource, options) }; const axisDictionary = {}; if (customizeChart) { chartOptions = (0, _extend.extend)(true, {}, chartOptions, customizeChart(chartOptions)) } chartOptions.dataSource = createChartDataSource(dataSource, options, axisDictionary); chartOptions.seriesTemplate = { nameField: "series", customizeSeries(seriesName) { let seriesOptions = {}; if ("splitPanes" === options.dataFieldsDisplayMode) { seriesOptions.pane = axisDictionary[seriesName] } else if ("singleAxis" !== options.dataFieldsDisplayMode) { seriesOptions.axis = axisDictionary[seriesName] } if (customizeSeries) { seriesOptions = (0, _extend.extend)(seriesOptions, customizeSeries(seriesName, seriesOptions)) } return seriesOptions } }; return chartOptions }(that.getDataSource(), integrationOptions); chart.option(chartOptions) }; chart = function(chartElement) { if (!chartElement) { return false } if (chartElement.NAME) { return "dxChart" === chartElement.NAME && chartElement } const element = (0, _renderer.default)(chartElement); return element.data("dxChart") && element.dxChart("instance") }(chart); if (!chart) { return null }! function(chart) { const unbind = chart.$element().data(UNBIND_KEY); unbind && unbind() }(chart); that.on("changed", updateChart); updateChart(); const disposeBinding = function() { chart.$element().removeData(UNBIND_KEY); that.off("changed", updateChart) }; chart.on("disposing", disposeBinding); this.on("disposing", disposeBinding); chart.$element().data(UNBIND_KEY, disposeBinding); return disposeBinding } }; exports.default = { ChartIntegrationMixin: ChartIntegrationMixin } }, 18813: /*!**********************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/const.js ***! \**********************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.CLASSES = void 0; exports.CLASSES = { scrollBarMeasureElement: "dx-pivotgrid-scrollbar-measure-element" } }, 64318: /*!**************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/data_area/m_data_area.js ***! \**************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.DataArea = void 0; var _renderer = (obj = __webpack_require__( /*! ../../../../core/renderer */ 68374), obj && obj.__esModule ? obj : { default: obj }); var obj; var _support = __webpack_require__( /*! ../../../../core/utils/support */ 60137); var _m_area_item = __webpack_require__( /*! ../area_item/m_area_item */ 74305); var _m_widget_utils = __webpack_require__( /*! ../m_widget_utils */ 28580); const DataArea = exports.DataArea = _m_area_item.AreaItem.inherit({ _getAreaName: () => "data", _createGroupElement: () => (0, _renderer.default)("
").addClass("dx-pivotgrid-area").addClass("dx-pivotgrid-area-data").css("borderTopWidth", 0), _applyCustomStyles(options) { const { cell: cell } = options; const { classArray: classArray } = options; if ("T" === cell.rowType || "T" === cell.columnType) { classArray.push("dx-total") } if ("GT" === cell.rowType || "GT" === cell.columnType) { classArray.push("dx-grandtotal") } if ("T" === cell.rowType || "GT" === cell.rowType) { classArray.push("dx-row-total") } if (options.rowIndex === options.rowsCount - 1) { options.cssArray.push("border-bottom: 0px") } this.callBase(options) }, _moveFakeTable(scrollPos) { this._moveFakeTableHorizontally(scrollPos.x); this._moveFakeTableTop(scrollPos.y); this.callBase() }, renderScrollable() { this._groupElement.dxScrollable({ useNative: this.getUseNativeValue(), useSimulatedScrollbar: false, rtlEnabled: this.component.option("rtlEnabled"), bounceEnabled: false, updateManually: true }) }, getUseNativeValue() { const { useNative: useNative } = this.component.option("scrolling"); return "auto" === useNative ? !!_support.nativeScrolling : !!useNative }, getScrollbarWidth() { return this.getUseNativeValue() ? (0, _m_widget_utils.calculateScrollbarWidth)() : 0 }, updateScrollableOptions(_ref) { let { direction: direction, rtlEnabled: rtlEnabled } = _ref; const scrollable = this._getScrollable(); scrollable.option("useNative", this.getUseNativeValue()); scrollable.option({ direction: direction, rtlEnabled: rtlEnabled }) }, getScrollableDirection(horizontal, vertical) { if (horizontal && !vertical) { return "horizontal" } if (!horizontal && vertical) { return "vertical" } return "both" }, reset() { this.callBase(); if (this._virtualContent) { this._virtualContent.parent().css("height", "auto") } }, setVirtualContentParams(params) { this.callBase(params); this._virtualContent.parent().css("height", params.height); this._setTableCss({ top: params.top, left: params.left }) } }); exports.default = { DataArea: DataArea } }, 9517: /*!**************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/data_controller/m_data_controller.js ***! \**************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.DataController__internals = exports.DataController = void 0; var _class = _interopRequireDefault(__webpack_require__( /*! ../../../../core/class */ 38377)); var _callbacks = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/callbacks */ 44504)); var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _string = __webpack_require__( /*! ../../../../core/utils/string */ 68752); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _m_state_storing_core = _interopRequireDefault(__webpack_require__( /*! ../../../grids/grid_core/state_storing/m_state_storing_core */ 84651)); var _m_virtual_columns_core = __webpack_require__( /*! ../../../grids/grid_core/virtual_columns/m_virtual_columns_core */ 67814); var _m_virtual_scrolling_core = _interopRequireDefault(__webpack_require__( /*! ../../../grids/grid_core/virtual_scrolling/m_virtual_scrolling_core */ 86770)); var _m_data_source = __webpack_require__( /*! ../data_source/m_data_source */ 16710); var _m_widget_utils = __webpack_require__( /*! ../m_widget_utils */ 28580); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const math = Math; const proxyMethod = function(instance, methodName, defaultResult) { if (!instance[methodName]) { instance[methodName] = function() { const dataSource = this._dataSource; return dataSource ? dataSource[methodName].apply(dataSource, arguments) : defaultResult } } }; const DataController = exports.DataController = _class.default.inherit(function() { function formatCellValue(value, dataField, errorText) { return "#N/A" === value ? errorText : (0, _m_widget_utils.formatValue)(value, dataField) } const createHeaderInfo = function() { const addInfoItem = function(info, options) { const breadth = options.lastIndex - options.index || 1; const itemInfo = function(headerItem, breadth, isHorizontal, isTree) { const infoItem = { type: headerItem.type, text: headerItem.text }; if (headerItem.path) { infoItem.path = headerItem.path } if (headerItem.width) { infoItem.width = headerItem.width } if ((0, _type.isDefined)(headerItem.wordWrapEnabled)) { infoItem.wordWrapEnabled = headerItem.wordWrapEnabled } if (headerItem.isLast) { infoItem.isLast = true } if (headerItem.sorted) { infoItem.sorted = true } if (headerItem.isMetric) { infoItem.dataIndex = headerItem.dataIndex } if ((0, _type.isDefined)(headerItem.expanded)) { infoItem.expanded = headerItem.expanded } if (breadth > 1) { infoItem[isHorizontal ? "colspan" : "rowspan"] = breadth } if (headerItem.depthSize && headerItem.depthSize > 1) { infoItem[isHorizontal ? "rowspan" : "colspan"] = headerItem.depthSize } if (headerItem.index >= 0) { infoItem.dataSourceIndex = headerItem.index } if (isTree && headerItem.children && headerItem.children.length && !headerItem.children[0].isMetric) { infoItem.width = null; infoItem.isWhiteSpace = true } return infoItem }(options.headerItem, breadth, options.isHorizontal, options.isTree); ! function(info, infoItem, itemIndex, depthIndex, isHorizontal) { const index = isHorizontal ? depthIndex : itemIndex; while (!info[index]) { info.push([]) } if (isHorizontal) { info[index].push(infoItem) } else { info[index].unshift(infoItem) } }(info, itemInfo, options.index, options.depth, options.isHorizontal); if (!options.headerItem.children || 0 === options.headerItem.children.length) { return options.lastIndex + 1 } return options.lastIndex }; const getViewHeaderItems = function(headerItems, headerDescriptions, cellDescriptions, depthSize, options) { const cellDescriptionsCount = cellDescriptions.length; const viewHeaderItems = function(headerItems, headerDescriptions) { const headerDescriptionsCount = headerDescriptions && headerDescriptions.length || 0; const childrenStack = []; const d = new _deferred.Deferred; let headerItem; (0, _deferred.when)((0, _m_widget_utils.foreachTreeAsync)(headerItems, ((items, index) => { const item = items[0]; const path = (0, _m_widget_utils.createPath)(items); headerItem = createHeaderItem(childrenStack, path.length, index); headerItem.type = "D"; headerItem.value = item.value; headerItem.path = path; headerItem.text = item.text; headerItem.index = item.index; headerItem.displayText = item.displayText; headerItem.key = item.key; headerItem.isEmpty = item.isEmpty; if (path.length < headerDescriptionsCount && (!item.children || 0 !== item.children.length)) { headerItem.expanded = !!item.children } }))).done((() => { d.resolve(createHeaderItem(childrenStack, 0, 0).children || []) })); return d }(headerItems, headerDescriptions); const { dataFields: dataFields } = options; const d = new _deferred.Deferred; (0, _deferred.when)(viewHeaderItems).done((viewHeaderItems => { options.notifyProgress(.5); if (options.showGrandTotals) { viewHeaderItems[!options.showTotalsPrior ? "push" : "unshift"]({ type: "GT", isEmpty: options.isEmptyGrandTotal }) } const hideTotals = false === options.showTotals || dataFields.length > 0 && dataFields.length === options.hiddenTotals.length; const hideData = dataFields.length > 0 && options.hiddenValues.length === dataFields.length; if (hideData && hideTotals) { depthSize = 1 } if (!hideTotals || "tree" === options.layout) { ! function(headerItems, headerDescriptions, showTotalsPrior, isTree) { showTotalsPrior = showTotalsPrior || isTree; (0, _m_widget_utils.foreachTree)(headerItems, ((items, index) => { const item = items[0]; const parentChildren = (items[1] ? items[1].children : headerItems) || []; const dataField = headerDescriptions[items.length - 1]; if ("D" === item.type && item.expanded && (false !== dataField.showTotals || isTree)) { -1 !== index && parentChildren.splice(showTotalsPrior ? index : index + 1, 0, (0, _extend.extend)({}, item, { children: null, type: "T", expanded: showTotalsPrior ? true : null, isAdditionalTotal: true })); if (showTotalsPrior) { item.expanded = null } } })) }(viewHeaderItems, headerDescriptions, options.showTotalsPrior, "tree" === options.layout) }(0, _deferred.when)((0, _m_widget_utils.foreachTreeAsync)(viewHeaderItems, (items => { const item = items[0]; if (!item.children || 0 === item.children.length) { item.depthSize = depthSize - items.length + 1 } }))).done((() => { if (cellDescriptionsCount > 1) { ! function(headerItems, cellDescriptions, options) { (0, _m_widget_utils.foreachTree)(headerItems, (items => { const item = items[0]; let i; if (!item.children || 0 === item.children.length) { item.children = []; for (i = 0; i < cellDescriptions.length; i += 1) { const isGrandTotal = "GT" === item.type; const isTotal = "T" === item.type; const isValue = "D" === item.type; const columnIsHidden = false === cellDescriptions[i].visible || isGrandTotal && options.hiddenGrandTotals.includes(i) || isTotal && options.hiddenTotals.includes(i) || isValue && options.hiddenValues.includes(i); if (columnIsHidden) { continue } item.children.push({ caption: cellDescriptions[i].caption, path: item.path, type: item.type, value: i, index: item.index, dataIndex: i, isMetric: true, isEmpty: item.isEmpty && item.isEmpty[i] }) } } })) }(viewHeaderItems, cellDescriptions, options) }!options.showEmpty && function(headerItems) { (0, _m_widget_utils.foreachTree)([{ children: headerItems }], ((items, index) => { const item = items[0]; const parentChildren = (items[1] ? items[1].children : headerItems) || []; let { isEmpty: isEmpty } = item; if (isEmpty && isEmpty.length) { isEmpty = item.isEmpty.filter((isEmpty => isEmpty)).length === isEmpty.length } if (item && !item.children && isEmpty) { parentChildren.splice(index, 1); removeEmptyParent(items, 1) } })) }(viewHeaderItems); options.notifyProgress(.75); (0, _deferred.when)((0, _m_widget_utils.foreachTreeAsync)(viewHeaderItems, (items => { const item = items[0]; const { isMetric: isMetric } = item; const field = headerDescriptions[items.length - 1] || {}; if ("D" === item.type && !isMetric) { item.width = field.width } if (hideData && "D" === item.type) { const parentChildren = (items[1] ? items[1].children : viewHeaderItems) || []; parentChildren.splice(parentChildren.indexOf(item), 1); return } if (isMetric) { item.wordWrapEnabled = cellDescriptions[item.dataIndex].wordWrapEnabled } else { item.wordWrapEnabled = field.wordWrapEnabled } item.isLast = !item.children || !item.children.length; if (item.isLast) { (0, _iterator.each)(options.sortBySummaryPaths, ((_, sortBySummaryPath) => { if (!(0, _type.isDefined)(item.dataIndex)) { sortBySummaryPath = sortBySummaryPath.slice(0); sortBySummaryPath.pop() } if (function(items, sortBySummaryPath) { let path; const item = items[0]; const stringValuesUsed = (0, _type.isString)(sortBySummaryPath[0]); const headerItem = item.dataIndex >= 0 ? items[1] : item; if (stringValuesUsed && -1 !== sortBySummaryPath[0].indexOf("&[") && headerItem.key || !headerItem.key) { path = (0, _m_widget_utils.createPath)(items) } else { path = (0, _iterator.map)(items, (item => item.dataIndex >= 0 ? item.value : item.text)).reverse() } if ("GT" === item.type) { path = path.slice(1) } return path.join("/") === sortBySummaryPath.join("/") }(items, sortBySummaryPath)) { item.sorted = true; return false } return })) } item.text = function(item, description, options) { let { text: text } = item; if ((0, _type.isDefined)(item.displayText)) { text = item.displayText } else if ((0, _type.isDefined)(item.caption)) { text = item.caption } else if ("GT" === item.type) { text = options.texts.grandTotal } if (item.isAdditionalTotal) { text = (0, _string.format)(options.texts.total || "", text) } return text }(item, 0, options) }))).done((() => { if (!viewHeaderItems.length) { viewHeaderItems.push({}) } options.notifyProgress(1); d.resolve(viewHeaderItems) })) })) })); return d }; function createHeaderItem(childrenStack, depth, index) { const parent = childrenStack[depth] = childrenStack[depth] || []; const node = parent[index] = {}; if (childrenStack[depth + 1]) { node.children = childrenStack[depth + 1]; for (let i = depth + 1; i < childrenStack.length; i += 1) { childrenStack[i] = void 0 } childrenStack.length = depth + 1 } return node } const removeEmptyParent = function(items, index) { const parent = items[index + 1]; if (!items[index].children.length && parent && parent.children) { parent.children.splice(parent.children.indexOf(items[index]), 1); removeEmptyParent(items, index + 1) } }; return function(headerItems, headerDescriptions, cellDescriptions, isHorizontal, options) { const info = []; const depthSize = function(headerItems) { let depth = 0; (0, _m_widget_utils.foreachTree)(headerItems, (items => { depth = math.max(depth, items.length) })); return depth }(headerItems) || 1; const d = new _deferred.Deferred; getViewHeaderItems(headerItems, headerDescriptions, cellDescriptions, depthSize, options).done((viewHeaderItems => { ! function(info, viewHeaderItems, depthSize, isHorizontal, isTree) { let lastIndex = 0; let index; let depth; const indexesByDepth = [0]; (0, _m_widget_utils.foreachTree)(viewHeaderItems, (items => { const headerItem = items[0]; depth = headerItem.isMetric ? depthSize : items.length - 1; while (indexesByDepth.length - 1 < depth) { indexesByDepth.push(indexesByDepth[indexesByDepth.length - 1]) } index = indexesByDepth[depth] || 0; lastIndex = addInfoItem(info, { headerItem: headerItem, index: index, lastIndex: lastIndex, depth: depth, isHorizontal: isHorizontal, isTree: isTree }); indexesByDepth.length = depth; indexesByDepth.push(lastIndex) })) }(info, viewHeaderItems, depthSize, isHorizontal, "tree" === options.layout); options.notifyProgress(1); d.resolve(info) })); return d } }(); function createSortPaths(headerFields, dataFields) { const sortBySummaryPaths = []; (0, _iterator.each)(headerFields, ((_, headerField) => { const fieldIndex = (0, _m_widget_utils.findField)(dataFields, headerField.sortBySummaryField); if (fieldIndex >= 0) { sortBySummaryPaths.push((headerField.sortBySummaryPath || []).concat([fieldIndex])) } })); return sortBySummaryPaths } function foreachRowInfo(rowsInfo, callback) { let columnOffset = 0; const columnOffsetResetIndexes = []; for (let i = 0; i < rowsInfo.length; i += 1) { for (let j = 0; j < rowsInfo[i].length; j += 1) { const rowSpanOffset = (rowsInfo[i][j].rowspan || 1) - 1; const visibleIndex = i + rowSpanOffset; if (columnOffsetResetIndexes[i]) { columnOffset -= columnOffsetResetIndexes[i]; columnOffsetResetIndexes[i] = 0 } if (false === callback(rowsInfo[i][j], visibleIndex, i, j, columnOffset)) { break } columnOffsetResetIndexes[i + (rowsInfo[i][j].rowspan || 1)] = (columnOffsetResetIndexes[i + (rowsInfo[i][j].rowspan || 1)] || 0) + 1; columnOffset += 1 } } } function getHeaderIndexedItems(headerItems, options) { let visibleIndex = 0; const indexedItems = []; (0, _m_widget_utils.foreachTree)(headerItems, (items => { const headerItem = items[0]; const path = (0, _m_widget_utils.createPath)(items); if (headerItem.children && false === options.showTotals) { return } const indexedItem = (0, _extend.extend)(true, {}, headerItem, { visibleIndex: visibleIndex += 1, path: path }); if ((0, _type.isDefined)(indexedItem.index)) { indexedItems[indexedItem.index] = indexedItem } else { indexedItems.push(indexedItem) } })); return indexedItems } function createScrollController(dataController, component, dataAdapter) { return new _m_virtual_scrolling_core.default.VirtualScrollController(component, (0, _extend.extend)({ hasKnownLastPage: () => true, pageCount() { return math.ceil(this.totalItemsCount() / this.pageSize()) }, updateLoading() {}, itemsCount() { if (this.pageIndex() < this.pageCount() - 1) { return this.pageSize() } return this.totalItemsCount() % this.pageSize() }, items: () => [], viewportItems: () => [], onChanged() {}, isLoading: () => dataController.isLoading(), changingDuration() { const dataSource = dataController._dataSource; if (dataSource.paginate()) { return 300 } return dataController._changingDuration || 0 } }, dataAdapter)) } const members = { ctor(options) { const that = this; const virtualScrollControllerChanged = that._fireChanged.bind(that); options = that._options = options || {}; that.dataSourceChanged = (0, _callbacks.default)(); that._dataSource = that._createDataSource(options); if (options.component && "virtual" === options.component.option("scrolling.mode")) { that._rowsScrollController = createScrollController(that, options.component, { totalItemsCount: () => that.totalRowCount(), pageIndex: index => that.rowPageIndex(index), pageSize: () => that.rowPageSize(), load() { if (that._rowsScrollController.pageIndex() >= this.pageCount()) { that._rowsScrollController.pageIndex(this.pageCount() - 1) } return that._rowsScrollController.handleDataChanged((function() { if (that._dataSource.paginate()) { that._dataSource.load() } else { virtualScrollControllerChanged.apply(this, arguments) } })) } }); that._columnsScrollController = createScrollController(that, options.component, { totalItemsCount: () => that.totalColumnCount(), pageIndex: index => that.columnPageIndex(index), pageSize: () => that.columnPageSize(), load() { if (that._columnsScrollController.pageIndex() >= this.pageCount()) { that._columnsScrollController.pageIndex(this.pageCount() - 1) } return that._columnsScrollController.handleDataChanged((function() { if (that._dataSource.paginate()) { that._dataSource.load() } else { virtualScrollControllerChanged.apply(this, arguments) } })) } }) } that._stateStoringController = new _m_state_storing_core.default.StateStoringController(options.component).init(); that._columnsInfo = []; that._rowsInfo = []; that._cellsInfo = []; that.expandValueChanging = (0, _callbacks.default)(); that.loadingChanged = (0, _callbacks.default)(); that.progressChanged = (0, _callbacks.default)(); that.scrollChanged = (0, _callbacks.default)(); that.load(); that._update(); that.changed = (0, _callbacks.default)() }, _fireChanged() { const startChanging = new Date; this.changed && !this._lockChanged && this.changed.fire(); this._changingDuration = new Date - startChanging }, _correctSkipsTakes(rowIndex, rowSkip, rowSpan, levels, skips, takes) { const endIndex = rowSpan ? rowIndex + rowSpan - 1 : rowIndex; skips[levels.length] = skips[levels.length] || 0; takes[levels.length] = takes[levels.length] || 0; if (endIndex < rowSkip) { skips[levels.length] += 1 } else { takes[levels.length] += 1 } }, _calculatePagingForRowExpandedPaths(options, skips, takes, rowExpandedSkips, rowExpandedTakes) { const rows = this._rowsInfo; const rowCount = Math.min(options.rowSkip + options.rowTake, rows.length); const { rowExpandedPaths: rowExpandedPaths } = options; let levels = []; const expandedPathIndexes = {}; let i; let j; let path; rowExpandedPaths.forEach(((path, index) => { expandedPathIndexes[path] = index })); for (i = 0; i < rowCount; i += 1) { takes.length = skips.length = levels.length + 1; for (j = 0; j < rows[i].length; j += 1) { const cell = rows[i][j]; if ("D" === cell.type) { this._correctSkipsTakes(i, options.rowSkip, cell.rowspan, levels, skips, takes); path = cell.path || path; const expandIndex = path && path.length > 1 ? expandedPathIndexes[path.slice(0, -1)] : -1; if (expandIndex >= 0) { rowExpandedSkips[expandIndex] = skips[levels.length] || 0; rowExpandedTakes[expandIndex] = takes[levels.length] || 0 } if (cell.rowspan) { levels.push(cell.rowspan) } } } levels = levels.map((level => level - 1)).filter((level => level > 0)) } }, _calculatePagingForColumnExpandedPaths(options, skips, takes, expandedSkips, expandedTakes) { const skipByPath = {}; const takeByPath = {}; (0, _m_virtual_columns_core.foreachColumnInfo)(this._columnsInfo, ((columnInfo, columnIndex) => { if ("D" === columnInfo.type && columnInfo.path && void 0 === columnInfo.dataIndex) { const colspan = columnInfo.colspan || 1; const path = columnInfo.path.slice(0, -1).toString(); skipByPath[path] = skipByPath[path] || 0; takeByPath[path] = takeByPath[path] || 0; if (columnIndex + colspan <= options.columnSkip) { skipByPath[path] += 1 } else if (columnIndex < options.columnSkip + options.columnTake) { takeByPath[path] += 1 } } })); skips[0] = skipByPath[""]; takes[0] = takeByPath[""]; options.columnExpandedPaths.forEach(((path, index) => { const skip = skipByPath[path]; const take = takeByPath[path]; if (void 0 !== skip) { expandedSkips[index] = skip } if (void 0 !== take) { expandedTakes[index] = take } })) }, _processPagingForExpandedPaths(options, area, storeLoadOptions, reload) { const expandedPaths = options[`${area}ExpandedPaths`]; const expandedSkips = expandedPaths.map((() => 0)); const expandedTakes = expandedPaths.map((() => reload ? options.pageSize : 0)); const skips = []; const takes = []; if (!reload) { if ("row" === area) { this._calculatePagingForRowExpandedPaths(options, skips, takes, expandedSkips, expandedTakes) } else { this._calculatePagingForColumnExpandedPaths(options, skips, takes, expandedSkips, expandedTakes) } } this._savePagingForExpandedPaths(options, area, storeLoadOptions, skips[0], takes[0], expandedSkips, expandedTakes) }, _savePagingForExpandedPaths(options, area, storeLoadOptions, skip, take, expandedSkips, expandedTakes) { const expandedPaths = options[`${area}ExpandedPaths`]; options[`${area}ExpandedPaths`] = []; options[`${area}Skip`] = void 0 !== skip ? skip : options[`${area}Skip`]; options[`${area}Take`] = void 0 !== take ? take : options[`${area}Take`]; for (let i = 0; i < expandedPaths.length; i += 1) { if (expandedTakes[i]) { const isOppositeArea = options.area && options.area !== area; storeLoadOptions.push((0, _extend.extend)({ area: area, headerName: `${area}s` }, options, { [`${area}Skip`]: expandedSkips[i], [`${area}Take`]: expandedTakes[i], [isOppositeArea ? "oppositePath" : "path"]: expandedPaths[i] })) } } }, _handleCustomizeStoreLoadOptions(storeLoadOptions, reload) { const options = storeLoadOptions[0]; const rowsScrollController = this._rowsScrollController; if (this._dataSource.paginate() && rowsScrollController) { const rowPageSize = rowsScrollController.pageSize(); if ("rows" === options.headerName) { options.rowSkip = 0; options.rowTake = rowPageSize; options.rowExpandedPaths = [] } else { options.rowSkip = rowsScrollController.beginPageIndex() * rowPageSize; options.rowTake = (rowsScrollController.endPageIndex() - rowsScrollController.beginPageIndex() + 1) * rowPageSize; this._processPagingForExpandedPaths(options, "row", storeLoadOptions, reload) } } const columnsScrollController = this._columnsScrollController; if (this._dataSource.paginate() && columnsScrollController) { const columnPageSize = columnsScrollController.pageSize(); storeLoadOptions.forEach((options => { if ("columns" === options.headerName) { options.columnSkip = 0; options.columnTake = columnPageSize; options.columnExpandedPaths = [] } else { options.columnSkip = columnsScrollController.beginPageIndex() * columnPageSize; options.columnTake = (columnsScrollController.endPageIndex() - columnsScrollController.beginPageIndex() + 1) * columnPageSize; this._processPagingForExpandedPaths(options, "column", storeLoadOptions, reload) } })) } }, load() { const that = this; const stateStoringController = this._stateStoringController; if (stateStoringController.isEnabled() && !stateStoringController.isLoaded()) { stateStoringController.load().always((state => { if (state) { that._dataSource.state(state) } else { that._dataSource.load() } })) } else { that._dataSource.load() } }, calculateVirtualContentParams(contentParams) { const that = this; const rowsScrollController = that._rowsScrollController; const columnsScrollController = that._columnsScrollController; if (rowsScrollController && columnsScrollController) { rowsScrollController.viewportItemSize(contentParams.virtualRowHeight); rowsScrollController.viewportSize(contentParams.viewportHeight / rowsScrollController.viewportItemSize()); rowsScrollController.setContentItemSizes(contentParams.itemHeights); columnsScrollController.viewportItemSize(contentParams.virtualColumnWidth); columnsScrollController.viewportSize(contentParams.viewportWidth / columnsScrollController.viewportItemSize()); columnsScrollController.setContentItemSizes(contentParams.itemWidths); (0, _common.deferUpdate)((() => { columnsScrollController.loadIfNeed(); rowsScrollController.loadIfNeed() })); that.scrollChanged.fire({ left: columnsScrollController.getViewportPosition(), top: rowsScrollController.getViewportPosition() }); return { contentTop: rowsScrollController.getContentOffset(), contentLeft: columnsScrollController.getContentOffset(), width: columnsScrollController.getVirtualContentSize(), height: rowsScrollController.getVirtualContentSize() } } return }, setViewportPosition(left, top) { this._rowsScrollController.setViewportPosition(top || 0); this._columnsScrollController.setViewportPosition(left || 0) }, subscribeToWindowScrollEvents($element) { var _this$_rowsScrollCont; null === (_this$_rowsScrollCont = this._rowsScrollController) || void 0 === _this$_rowsScrollCont || _this$_rowsScrollCont.subscribeToWindowScrollEvents($element) }, updateWindowScrollPosition(position) { var _this$_rowsScrollCont2; null === (_this$_rowsScrollCont2 = this._rowsScrollController) || void 0 === _this$_rowsScrollCont2 || _this$_rowsScrollCont2.scrollTo(position) }, updateViewOptions(options) { (0, _extend.extend)(this._options, options); this._update() }, _handleExpandValueChanging(e) { this.expandValueChanging.fire(e) }, _handleLoadingChanged(isLoading) { this.loadingChanged.fire(isLoading) }, _handleProgressChanged(progress) { this.progressChanged.fire(progress) }, _handleFieldsPrepared(e) { this._options.onFieldsPrepared && this._options.onFieldsPrepared(e) }, _createDataSource(options) { const that = this; const dataSourceOptions = options.dataSource; let dataSource; that._isSharedDataSource = dataSourceOptions instanceof _m_data_source.PivotGridDataSource; if (that._isSharedDataSource) { dataSource = dataSourceOptions } else { dataSource = new _m_data_source.PivotGridDataSource(dataSourceOptions) } that._expandValueChangingHandler = that._handleExpandValueChanging.bind(that); that._loadingChangedHandler = that._handleLoadingChanged.bind(that); that._fieldsPreparedHandler = that._handleFieldsPrepared.bind(that); that._customizeStoreLoadOptionsHandler = that._handleCustomizeStoreLoadOptions.bind(that); that._changedHandler = function() { that._update(); that.dataSourceChanged.fire() }; that._progressChangedHandler = function(progress) { that._handleProgressChanged(.8 * progress) }; dataSource.on("changed", that._changedHandler); dataSource.on("expandValueChanging", that._expandValueChangingHandler); dataSource.on("loadingChanged", that._loadingChangedHandler); dataSource.on("progressChanged", that._progressChangedHandler); dataSource.on("fieldsPrepared", that._fieldsPreparedHandler); dataSource.on("customizeStoreLoadOptions", that._customizeStoreLoadOptionsHandler); return dataSource }, getDataSource() { return this._dataSource }, isLoading() { return this._dataSource.isLoading() }, beginLoading() { this._dataSource.beginLoading() }, endLoading() { this._dataSource.endLoading() }, _update() { const that = this; const dataSource = that._dataSource; const options = that._options; const columnFields = dataSource.getAreaFields("column"); const rowFields = dataSource.getAreaFields("row"); const dataFields = dataSource.getAreaFields("data"); const dataFieldsForRows = "row" === options.dataFieldArea ? dataFields : []; const dataFieldsForColumns = "row" !== options.dataFieldArea ? dataFields : []; const data = dataSource.getData(); const hiddenTotals = function(dataFields) { const result = []; (0, _iterator.each)(dataFields, ((index, field) => { if (false === field.showTotals) { result.push(index) } })); return result }(dataFields); const hiddenValues = function(dataFields) { const result = []; dataFields.forEach(((field, index) => { if (void 0 === field.showValues && false === field.showTotals || false === field.showValues) { result.push(index) } })); return result }(dataFields); const hiddenGrandTotals = function(dataFields, columnFields) { let result = []; (0, _iterator.each)(dataFields, ((index, field) => { if (false === field.showGrandTotals) { result.push(index) } })); if (0 === columnFields.length && result.length === dataFields.length) { result = [] } return result }(dataFields, columnFields); const grandTotalsAreHiddenForNotAllDataFields = dataFields.length > 0 ? hiddenGrandTotals.length !== dataFields.length : true; const rowOptions = { isEmptyGrandTotal: data.isEmptyGrandTotalRow, texts: options.texts || {}, hiddenTotals: hiddenTotals, hiddenValues: hiddenValues, hiddenGrandTotals: [], showTotals: options.showRowTotals, showGrandTotals: false !== options.showRowGrandTotals && grandTotalsAreHiddenForNotAllDataFields, sortBySummaryPaths: createSortPaths(columnFields, dataFields), showTotalsPrior: "rows" === options.showTotalsPrior || "both" === options.showTotalsPrior, showEmpty: !options.hideEmptySummaryCells, layout: options.rowHeaderLayout, fields: rowFields, dataFields: dataFields, progress: 0 }; const columnOptions = { isEmptyGrandTotal: data.isEmptyGrandTotalColumn, texts: options.texts || {}, hiddenTotals: hiddenTotals, hiddenValues: hiddenValues, hiddenGrandTotals: hiddenGrandTotals, showTotals: options.showColumnTotals, showTotalsPrior: "columns" === options.showTotalsPrior || "both" === options.showTotalsPrior, showGrandTotals: false !== options.showColumnGrandTotals && grandTotalsAreHiddenForNotAllDataFields, sortBySummaryPaths: createSortPaths(rowFields, dataFields), showEmpty: !options.hideEmptySummaryCells, fields: columnFields, dataFields: dataFields, progress: 0 }; const notifyProgress = function(progress) { this.progress = progress; that._handleProgressChanged(.8 + .1 * rowOptions.progress + .1 * columnOptions.progress) }; rowOptions.notifyProgress = notifyProgress; columnOptions.notifyProgress = notifyProgress; if (!(0, _type.isDefined)(data.grandTotalRowIndex)) { data.grandTotalRowIndex = getHeaderIndexedItems(data.rows, rowOptions).length } if (!(0, _type.isDefined)(data.grandTotalColumnIndex)) { data.grandTotalColumnIndex = getHeaderIndexedItems(data.columns, columnOptions).length } dataSource._changeLoadingCount(1); (0, _deferred.when)(createHeaderInfo(data.columns, columnFields, dataFieldsForColumns, true, columnOptions), createHeaderInfo(data.rows, rowFields, dataFieldsForRows, false, rowOptions)).always((() => { dataSource._changeLoadingCount(-1) })).done(((columnsInfo, rowsInfo) => { that._columnsInfo = columnsInfo; that._rowsInfo = rowsInfo; if (that._rowsScrollController && that._columnsScrollController && that.changed && !that._dataSource.paginate()) { that._rowsScrollController.reset(true); that._columnsScrollController.reset(true); that._lockChanged = true; that._rowsScrollController.load(); that._columnsScrollController.load(); that._lockChanged = false } })).done((() => { that._fireChanged(); if (that._stateStoringController.isEnabled() && !that._dataSource.isLoading()) { that._stateStoringController.state(that._dataSource.state()); that._stateStoringController.save() } })) }, getRowsInfo(getAllData) { const that = this; const rowsInfo = that._rowsInfo; const scrollController = that._rowsScrollController; let rowspan; if (scrollController && !getAllData) { const startIndex = scrollController.beginPageIndex() * that.rowPageSize(); const endIndex = scrollController.endPageIndex() * that.rowPageSize() + that.rowPageSize(); const summaryFields = that._dataSource.getSummaryFields(); const isRowDataFieldArea = "row" === this._options.dataFieldArea; const newRowsInfo = []; let maxDepth = 1; foreachRowInfo(rowsInfo, ((rowInfo, visibleIndex, rowIndex, _, columnIndex) => { const isVisible = visibleIndex >= startIndex && rowIndex < endIndex; const index = rowIndex < startIndex ? 0 : rowIndex - startIndex; let cell = rowInfo; if (isVisible) { newRowsInfo[index] = newRowsInfo[index] || []; rowspan = rowIndex < startIndex ? rowInfo.rowspan - (startIndex - rowIndex) || 1 : rowInfo.rowspan; if (startIndex + index + rowspan > endIndex) { rowspan = endIndex - (index + startIndex) || 1 } if (rowspan !== rowInfo.rowspan) { cell = (0, _extend.extend)({}, cell, { rowspan: rowspan }) } newRowsInfo[index].push(cell); const isSummaryCell = summaryFields.some((field => field.caption === cell.text)); if (!isRowDataFieldArea || !isSummaryCell) { maxDepth = math.max(maxDepth, columnIndex + 1) } } else { return false } return })); foreachRowInfo(newRowsInfo, ((rowInfo, visibleIndex, rowIndex, columnIndex, realColumnIndex) => { const colspan = rowInfo.colspan || 1; if (realColumnIndex + colspan > maxDepth) { newRowsInfo[rowIndex][columnIndex] = (0, _extend.extend)({}, rowInfo, { colspan: maxDepth - realColumnIndex || 1 }) } })); return newRowsInfo } return rowsInfo }, getColumnsInfo(getAllData) { const that = this; let info = that._columnsInfo; const scrollController = that._columnsScrollController; if (scrollController && !getAllData) { const startIndex = scrollController.beginPageIndex() * that.columnPageSize(); const endIndex = scrollController.endPageIndex() * that.columnPageSize() + that.columnPageSize(); info = (0, _m_virtual_columns_core.createColumnsInfo)(info, startIndex, endIndex) } return info }, totalRowCount() { return this._rowsInfo.length }, rowPageIndex(index) { if (void 0 !== index) { this._rowPageIndex = index } return this._rowPageIndex || 0 }, totalColumnCount() { let count = 0; if (this._columnsInfo && this._columnsInfo.length) { for (let i = 0; i < this._columnsInfo[0].length; i += 1) { count += this._columnsInfo[0][i].colspan || 1 } } return count }, rowPageSize(size) { if (void 0 !== size) { this._rowPageSize = size } return this._rowPageSize || 20 }, columnPageSize(size) { if (void 0 !== size) { this._columnPageSize = size } return this._columnPageSize || 20 }, columnPageIndex(index) { if (void 0 !== index) { this._columnPageIndex = index } return this._columnPageIndex || 0 }, getCellsInfo(getAllData) { const rowsInfo = this.getRowsInfo(getAllData); const columnsInfo = this.getColumnsInfo(getAllData); const data = this._dataSource.getData(); const texts = this._options.texts || {}; return function(rowsInfo, columnsInfo, data, dataFields, dataFieldArea, errorText) { const info = []; const dataFieldAreaInRows = "row" === dataFieldArea; const dataSourceCells = data.values; dataSourceCells.length && foreachRowInfo(rowsInfo, ((rowInfo, rowIndex) => { const row = info[rowIndex] = []; const dataRow = dataSourceCells[rowInfo.dataSourceIndex >= 0 ? rowInfo.dataSourceIndex : data.grandTotalRowIndex] || []; rowInfo.isLast && (0, _m_virtual_columns_core.foreachColumnInfo)(columnsInfo, ((columnInfo, columnIndex) => { const dataIndex = (dataFieldAreaInRows ? rowInfo.dataIndex : columnInfo.dataIndex) || 0; const dataField = dataFields[dataIndex]; if (columnInfo.isLast && dataField && false !== dataField.visible) { let cell = dataRow[columnInfo.dataSourceIndex >= 0 ? columnInfo.dataSourceIndex : data.grandTotalColumnIndex]; if (!Array.isArray(cell)) { cell = [cell] } const cellValue = cell[dataIndex]; row[columnIndex] = { text: formatCellValue(cellValue, dataField, errorText), value: cellValue, format: dataField.format, dataType: dataField.dataType, columnType: columnInfo.type, rowType: rowInfo.type, rowPath: rowInfo.path || [], columnPath: columnInfo.path || [], dataIndex: dataIndex }; if (dataField.width) { row[columnIndex].width = dataField.width } } })) })); return info }(rowsInfo, columnsInfo, data, this._dataSource.getAreaFields("data"), this._options.dataFieldArea, texts.dataNotAvailable) }, dispose() { const that = this; if (that._isSharedDataSource) { that._dataSource.off("changed", that._changedHandler); that._dataSource.off("expandValueChanging", that._expandValueChangingHandler); that._dataSource.off("loadingChanged", that._loadingChangedHandler); that._dataSource.off("progressChanged", that._progressChangedHandler); that._dataSource.off("fieldsPrepared", that._fieldsPreparedHandler); that._dataSource.off("customizeStoreLoadOptions", that._customizeStoreLoadOptionsHandler) } else { that._dataSource.dispose() } that._columnsScrollController && that._columnsScrollController.dispose(); that._rowsScrollController && that._rowsScrollController.dispose(); that._stateStoringController.dispose(); that.expandValueChanging.empty(); that.changed.empty(); that.loadingChanged.empty(); that.progressChanged.empty(); that.scrollChanged.empty(); that.dataSourceChanged.empty() } }; proxyMethod(members, "applyPartialDataSource"); proxyMethod(members, "collapseHeaderItem"); proxyMethod(members, "expandHeaderItem"); proxyMethod(members, "getData"); proxyMethod(members, "isEmpty"); return members }()); const DataController__internals = exports.DataController__internals = { NO_DATA_AVAILABLE_TEXT: "#N/A" }; exports.default = { DataController: DataController, DataController__internals: DataController__internals } }, 16710: /*!******************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/data_source/m_data_source.js ***! \******************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.PivotGridDataSource = void 0; var _class = _interopRequireDefault(__webpack_require__( /*! ../../../../core/class */ 38377)); var _events_strategy = __webpack_require__( /*! ../../../../core/events_strategy */ 80566); var _array = __webpack_require__( /*! ../../../../core/utils/array */ 89386); var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _inflector = __webpack_require__( /*! ../../../../core/utils/inflector */ 78008); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _abstract_store = _interopRequireDefault(__webpack_require__( /*! ../../../../data/abstract_store */ 67403)); var _utils = __webpack_require__( /*! ../../../../data/data_source/utils */ 9234); var _m_local_store = __webpack_require__( /*! ../local_store/m_local_store */ 16564); var _m_widget_utils = __webpack_require__( /*! ../m_widget_utils */ 28580); var _m_remote_store = __webpack_require__( /*! ../remote_store/m_remote_store */ 2166); var _m_summary_display_modes = _interopRequireDefault(__webpack_require__( /*! ../summary_display_modes/m_summary_display_modes */ 42717)); var _m_xmla_store = _interopRequireDefault(__webpack_require__( /*! ../xmla_store/m_xmla_store */ 79755)); var _m_data_source_utils = __webpack_require__( /*! ./m_data_source_utils */ 91629); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const DESCRIPTION_NAME_BY_AREA = { row: "rows", column: "columns", data: "values", filter: "filters" }; const STATE_PROPERTIES = ["area", "areaIndex", "sortOrder", "filterType", "filterValues", "sortBy", "sortBySummaryField", "sortBySummaryPath", "expanded", "summaryType", "summaryDisplayMode"]; const CALCULATED_PROPERTIES = ["format", "selector", "customizeText", "caption"]; const ALL_CALCULATED_PROPERTIES = CALCULATED_PROPERTIES.concat(["allowSorting", "allowSortingBySummary", "allowFiltering", "allowExpandAll"]); function resetFieldState(field, properties) { const initialProperties = field._initProperties || {}; (0, _iterator.each)(properties, ((_, prop) => { if (Object.prototype.hasOwnProperty.call(initialProperties, prop)) { field[prop] = initialProperties[prop] } })) } function updateCalculatedFieldProperties(field, calculatedProperties) { resetFieldState(field, calculatedProperties); if (!(0, _type.isDefined)(field.caption)) { (0, _m_widget_utils.setFieldProperty)(field, "caption", function(field) { let caption = field.dataField || field.groupName || ""; let summaryType = (field.summaryType || "").toLowerCase(); if ((0, _type.isString)(field.groupInterval)) { caption += `_${field.groupInterval}` } if (summaryType && "custom" !== summaryType) { summaryType = summaryType.replace(/^./, summaryType[0].toUpperCase()); if (caption.length) { summaryType = ` (${summaryType})` } } else { summaryType = "" } return (0, _inflector.titleize)(caption) + summaryType }(field)) } } function isDataExists(data) { return data.rows.length || data.columns.length || data.values.length } const PivotGridDataSource = exports.PivotGridDataSource = _class.default.inherit(function() { const findHeaderItem = function(headerItems, path) { if (headerItems._cacheByPath) { return headerItems._cacheByPath[path.join(".")] || null } return }; const getHeaderItemsLastIndex = function(headerItems, grandTotalIndex) { let i; let lastIndex = -1; let headerItem; if (headerItems) { for (i = 0; i < headerItems.length; i += 1) { headerItem = headerItems[i]; if (void 0 !== headerItem.index) { lastIndex = Math.max(lastIndex, headerItem.index) } if (headerItem.children) { lastIndex = Math.max(lastIndex, getHeaderItemsLastIndex(headerItem.children)) } else if (headerItem.collapsedChildren) { lastIndex = Math.max(lastIndex, getHeaderItemsLastIndex(headerItem.collapsedChildren)) } } } if ((0, _type.isDefined)(grandTotalIndex)) { lastIndex = Math.max(lastIndex, grandTotalIndex) } return lastIndex }; const updateHeaderItemChildren = function(headerItems, headerItem, children, grandTotalIndex) { const applyingHeaderItemsCount = getHeaderItemsLastIndex(children) + 1; let emptyIndex = getHeaderItemsLastIndex(headerItems, grandTotalIndex) + 1; let index; const applyingItemIndexesToCurrent = []; let needIndexUpdate = false; const d = new _deferred.Deferred; if (headerItem.children && headerItem.children.length === children.length) { for (let i = 0; i < children.length; i += 1) { const child = children[i]; if (void 0 !== child.index) { if (void 0 === headerItem.children[i].index) { child.index = applyingItemIndexesToCurrent[child.index] = emptyIndex++; headerItem.children[i] = child } else { applyingItemIndexesToCurrent[child.index] = headerItem.children[i].index } } } } else { needIndexUpdate = true; for (index = 0; index < applyingHeaderItemsCount; index += 1) { applyingItemIndexesToCurrent[index] = emptyIndex++ } headerItem.children = children }(0, _deferred.when)((0, _m_widget_utils.foreachTreeAsync)(headerItem.children, (items => { if (needIndexUpdate) { items[0].index = applyingItemIndexesToCurrent[items[0].index] } }))).done((() => { d.resolve(applyingItemIndexesToCurrent) })); return d }; const updateHeaderItems = function(headerItems, newHeaderItems, grandTotalIndex) { const d = new _deferred.Deferred; let emptyIndex = grandTotalIndex >= 0 && getHeaderItemsLastIndex(headerItems, grandTotalIndex) + 1; const applyingItemIndexesToCurrent = []; (0, _deferred.when)((0, _m_widget_utils.foreachTreeAsync)(headerItems, (items => { delete items[0].collapsedChildren }))).done((() => { (0, _deferred.when)((0, _m_widget_utils.foreachTreeAsync)(newHeaderItems, ((newItems, index) => { const newItem = newItems[0]; if (newItem.index >= 0) { let headerItem = findHeaderItem(headerItems, (0, _m_widget_utils.createPath)(newItems)); if (headerItem && headerItem.index >= 0) { applyingItemIndexesToCurrent[newItem.index] = headerItem.index } else if (emptyIndex) { const path = (0, _m_widget_utils.createPath)(newItems.slice(1)); headerItem = findHeaderItem(headerItems, path); const parentItems = path.length ? headerItem && headerItem.children : headerItems; if (parentItems) { parentItems[index] = newItem; newItem.index = applyingItemIndexesToCurrent[newItem.index] = emptyIndex++ } } } }))).done((() => { d.resolve(applyingItemIndexesToCurrent) })) })); return d }; const updateDataSourceCells = function(dataSource, newDataSourceCells, newRowItemIndexesToCurrent, newColumnItemIndexesToCurrent) { let newRowIndex; let newColumnIndex; let newRowCells; let newCell; let rowIndex; let columnIndex; const dataSourceCells = dataSource.values; if (newDataSourceCells) { for (newRowIndex = 0; newRowIndex < newDataSourceCells.length; newRowIndex += 1) { newRowCells = newDataSourceCells[newRowIndex]; rowIndex = newRowItemIndexesToCurrent[newRowIndex]; if (!(0, _type.isDefined)(rowIndex)) { rowIndex = dataSource.grandTotalRowIndex } if (newRowCells && (0, _type.isDefined)(rowIndex)) { if (!dataSourceCells[rowIndex]) { dataSourceCells[rowIndex] = [] } for (newColumnIndex = 0; newColumnIndex < newRowCells.length; newColumnIndex += 1) { newCell = newRowCells[newColumnIndex]; columnIndex = newColumnItemIndexesToCurrent[newColumnIndex]; if (!(0, _type.isDefined)(columnIndex)) { columnIndex = dataSource.grandTotalColumnIndex } if ((0, _type.isDefined)(newCell) && (0, _type.isDefined)(columnIndex)) { dataSourceCells[rowIndex][columnIndex] = newCell } } } } } }; function createLocalOrRemoteStore(dataSourceOptions, notifyProgress) { const StoreConstructor = dataSourceOptions.remoteOperations || dataSourceOptions.paginate ? _m_remote_store.RemoteStore : _m_local_store.LocalStore; return new StoreConstructor((0, _extend.extend)((0, _utils.normalizeDataSourceOptions)(dataSourceOptions), { onChanged: null, onLoadingChanged: null, onProgressChanged: notifyProgress })) } function getExpandedPaths(dataSource, loadOptions, dimensionName, prevLoadOptions) { const result = []; const fields = loadOptions && loadOptions[dimensionName] || []; const prevFields = prevLoadOptions && prevLoadOptions[dimensionName] || []; (0, _m_widget_utils.foreachTree)(dataSource[dimensionName], (items => { const item = items[0]; const path = (0, _m_widget_utils.createPath)(items); if (item.children && fields[path.length - 1] && !fields[path.length - 1].expanded) { if (path.length < fields.length && (!prevLoadOptions || function(fields, prevFields, count) { for (let i = 0; i < count; i += 1) { if (!fields[i] || !prevFields[i] || fields[i].index !== prevFields[i].index) { return false } } return true }(fields, prevFields, path.length))) { result.push(path.slice()) } } }), true); return result } function setFieldProperties(field, srcField, skipInitPropertySave, properties) { if (srcField) { (0, _iterator.each)(properties, ((_, name) => { if (skipInitPropertySave) { field[name] = srcField[name] } else { if (("summaryType" === name || "summaryDisplayMode" === name) && void 0 === srcField[name]) { return }(0, _m_widget_utils.setFieldProperty)(field, name, srcField[name]) } })) } else { resetFieldState(field, properties) } return field } function getFieldsState(fields, properties) { const result = []; (0, _iterator.each)(fields, ((_, field) => { result.push(setFieldProperties({ dataField: field.dataField, name: field.name }, field, true, properties)) })); return result } function getFieldStateId(field) { if (field.name) { return field.name } return `${field.dataField}` } function getFieldsById(fields, id) { const result = []; (0, _iterator.each)(fields || [], ((_, field) => { if (getFieldStateId(field) === id) { result.push(field) } })); return result } function setFieldsState(stateFields, fields) { stateFields = stateFields || []; const fieldsById = {}; let id; (0, _iterator.each)(fields, ((_, field) => { id = getFieldStateId(field); if (!fieldsById[id]) { fieldsById[id] = getFieldsById(fields, getFieldStateId(field)) } })); (0, _iterator.each)(fieldsById, ((id, fields) => { ! function(stateFields, fields) { stateFields = stateFields || []; (0, _iterator.each)(fields, ((index, field) => { setFieldProperties(field, stateFields[index], false, STATE_PROPERTIES); updateCalculatedFieldProperties(field, CALCULATED_PROPERTIES) })); return fields }(getFieldsById(stateFields, id), fields) })); return fields } function sortFieldsByAreaIndex(fields) { fields.sort(((field1, field2) => field1.areaIndex - field2.areaIndex || field1.groupIndex - field2.groupIndex)) } function getFieldId(field, retrieveFieldsOptionValue) { const groupName = field.groupName || ""; return (field.dataField || groupName) + (field.groupInterval ? groupName + field.groupInterval : "NOGROUP") + (retrieveFieldsOptionValue ? "" : groupName) } function mergeFields(fields, storeFields, retrieveFieldsOptionValue) { let result = []; const fieldsDictionary = {}; const removedFields = {}; const dataTypes = (0, _m_widget_utils.getFieldsDataType)(fields); if (storeFields) { (0, _iterator.each)(storeFields, ((_, field) => { fieldsDictionary[getFieldId(field, retrieveFieldsOptionValue)] = field })); (0, _iterator.each)(fields, ((_, field) => { const fieldKey = getFieldId(field, retrieveFieldsOptionValue); const storeField = fieldsDictionary[fieldKey] || removedFields[fieldKey]; let mergedField; if (storeField) { if (storeField._initProperties) { resetFieldState(storeField, ALL_CALCULATED_PROPERTIES) } mergedField = (0, _extend.extend)({}, storeField, field, { _initProperties: null }) } else { fieldsDictionary[fieldKey] = mergedField = field } if (!mergedField.dataType && dataTypes[field.dataField]) { mergedField.dataType = dataTypes[field.dataField] } delete fieldsDictionary[fieldKey]; removedFields[fieldKey] = storeField; result.push(mergedField) })); if (retrieveFieldsOptionValue) { (0, _iterator.each)(fieldsDictionary, ((_, field) => { result.push(field) })) } } else { result = fields } result.push.apply(result, []); ! function(fields) { fields.forEach((field => { if (field.groupName && field.groupInterval && void 0 === field.groupIndex) { const maxGroupIndex = fields.filter((f => f.groupName === field.groupName && (0, _type.isNumeric)(f.groupIndex))).map((f => f.groupIndex)).reduce(((prev, current) => Math.max(prev, current)), -1); field.groupIndex = maxGroupIndex + 1 } })) }(result); return result } function getFields(that) { const result = new _deferred.Deferred; const store = that._store; const storeFields = store && store.getFields(that._fields); let mergedFields; (0, _deferred.when)(storeFields).done((storeFields => { that._storeFields = storeFields; mergedFields = mergeFields(that._fields, storeFields, that._retrieveFields); result.resolve(mergedFields) })).fail(result.reject); return result } function formatHeaderItems(data, loadOptions, headerName) { return (0, _m_widget_utils.foreachTreeAsync)(data[headerName], (items => { const item = items[0]; item.text = item.text || (0, _m_widget_utils.formatValue)(item.value, loadOptions[headerName][(0, _m_widget_utils.createPath)(items).length - 1]) })) } function formatHeaders(loadOptions, data) { return (0, _deferred.when)(formatHeaderItems(data, loadOptions, "columns"), formatHeaderItems(data, loadOptions, "rows")) } function updateCache(headerItems) { const d = new _deferred.Deferred; const cacheByPath = {}; (0, _deferred.when)((0, _m_widget_utils.foreachTreeAsync)(headerItems, (items => { const path = (0, _m_widget_utils.createPath)(items).join("."); cacheByPath[path] = items[0] }))).done(d.resolve); headerItems._cacheByPath = cacheByPath; return d } function getAreaFields(fields, area) { const areaFields = []; (0, _iterator.each)(fields, (function() { if (function(field, area) { const canAddFieldInArea = "data" === area || false !== field.visible; return field.area === area && !(0, _type.isDefined)(field.groupIndex) && canAddFieldInArea }(this, area)) { areaFields.push(this) } })); return areaFields } return { ctor(options) { options = options || {}; this._eventsStrategy = new _events_strategy.EventsStrategy(this); const that = this; const store = function(dataSourceOptions, notifyProgress) { let store; let storeOptions; if ((0, _type.isPlainObject)(dataSourceOptions) && dataSourceOptions.load) { store = createLocalOrRemoteStore(dataSourceOptions, notifyProgress) } else { if (dataSourceOptions && !dataSourceOptions.store) { dataSourceOptions = { store: dataSourceOptions } } storeOptions = dataSourceOptions.store; if ("xmla" === storeOptions.type) { store = new _m_xmla_store.default.XmlaStore(storeOptions) } else if ((0, _type.isPlainObject)(storeOptions) && storeOptions.type || storeOptions instanceof _abstract_store.default || Array.isArray(storeOptions)) { store = createLocalOrRemoteStore(dataSourceOptions, notifyProgress) } else if (storeOptions instanceof _class.default) { store = storeOptions } } return store }(options, (progress => { that._eventsStrategy.fireEvent("progressChanged", [progress]) })); that._store = store; that._paginate = !!options.paginate; that._pageSize = options.pageSize || 40; that._data = { rows: [], columns: [], values: [] }; that._loadingCount = 0; that._isFieldsModified = false; (0, _iterator.each)(["changed", "loadError", "loadingChanged", "progressChanged", "fieldsPrepared", "expandValueChanging"], ((_, eventName) => { const optionName = `on${eventName[0].toUpperCase()}${eventName.slice(1)}`; if (Object.prototype.hasOwnProperty.call(options, optionName)) { this.on(eventName, options[optionName]) } })); that._retrieveFields = (0, _type.isDefined)(options.retrieveFields) ? options.retrieveFields : true; that._fields = options.fields || []; that._descriptions = options.descriptions ? (0, _extend.extend)(that._createDescriptions(), options.descriptions) : void 0; if (!store) { (0, _extend.extend)(true, that._data, options.store || options) } }, getData() { return this._data }, getAreaFields(area, collectGroups) { let areaFields = []; let descriptions; if (collectGroups || "data" === area) { areaFields = getAreaFields(this._fields, area); sortFieldsByAreaIndex(areaFields) } else { descriptions = this._descriptions || {}; areaFields = descriptions[DESCRIPTION_NAME_BY_AREA[area]] || [] } return areaFields }, getSummaryFields() { return this.getAreaFields("data").filter((field => (0, _type.isDefined)(field.summaryType))) }, fields(fields) { const that = this; if (fields) { that._fields = mergeFields(fields, that._storeFields, that._retrieveFields); that._fieldsPrepared(that._fields) } return that._fields }, field(id, options) { const that = this; const fields = that._fields; const field = fields && fields[(0, _type.isNumeric)(id) ? id : (0, _m_widget_utils.findField)(fields, id)]; let levels; if (field && options) { (0, _iterator.each)(options, ((optionName, optionValue) => { const isInitialization = !STATE_PROPERTIES.includes(optionName); (0, _m_widget_utils.setFieldProperty)(field, optionName, optionValue, isInitialization); if ("sortOrder" === optionName) { levels = field.levels || []; for (let i = 0; i < levels.length; i += 1) { levels[i][optionName] = optionValue } } })); updateCalculatedFieldProperties(field, CALCULATED_PROPERTIES); that._descriptions = that._createDescriptions(field); that._isFieldsModified = true; that._eventsStrategy.fireEvent("fieldChanged", [field]) } return field }, getFieldValues(index, applyFilters, options) { const that = this; const field = this._fields && this._fields[index]; const store = this.store(); const loadFields = []; const loadOptions = { columns: loadFields, rows: [], values: this.getAreaFields("data"), filters: applyFilters ? this._fields.filter((f => f !== field && f.area && f.filterValues && f.filterValues.length)) : [], skipValues: true }; let searchValue; const d = new _deferred.Deferred; if (options) { searchValue = options.searchValue; loadOptions.columnSkip = options.skip; loadOptions.columnTake = options.take } if (field && store) { (0, _iterator.each)(field.levels || [field], (function() { loadFields.push((0, _extend.extend)({}, this, { expanded: true, filterValues: null, sortOrder: "asc", sortBySummaryField: null, searchValue: searchValue })) })); store.load(loadOptions).done((data => { if (loadOptions.columnSkip) { data.columns = data.columns.slice(loadOptions.columnSkip) } if (loadOptions.columnTake) { data.columns = data.columns.slice(0, loadOptions.columnTake) } formatHeaders(loadOptions, data); if (!loadOptions.columnTake) { that._sort(loadOptions, data) } d.resolve(data.columns) })).fail(d) } else { d.reject() } return d }, reload() { return this.load({ reload: true }) }, filter() { const store = this._store; return store.filter.apply(store, arguments) }, load: function(options) { const that = this; const d = new _deferred.Deferred; options = options || {}; that.beginLoading(); d.fail((e => { that._eventsStrategy.fireEvent("loadError", [e]) })).always((() => { that.endLoading() })); function loadTask() { that._delayedLoadTask = void 0; if (!that._descriptions) { (0, _deferred.when)(getFields(that)).done((fields => { that._fieldsPrepared(fields); that._loadCore(options, d) })).fail(d.reject).fail(that._loadErrorHandler) } else { that._loadCore(options, d) } } if (that.store()) { that._delayedLoadTask = (0, _common.executeAsync)(loadTask) } else { loadTask() } return d }, createDrillDownDataSource(params) { return this._store.createDrillDownDataSource(this._descriptions, params) }, _createDescriptions(currentField) { const fields = this.fields(); const descriptions = { rows: [], columns: [], values: [], filters: [] }; (0, _iterator.each)(["row", "column", "data", "filter"], ((_, areaName) => { (0, _array.normalizeIndexes)(getAreaFields(fields, areaName), "areaIndex", currentField) })); (0, _iterator.each)(fields || [], ((_, field) => { const descriptionName = DESCRIPTION_NAME_BY_AREA[field.area]; const dimension = descriptions[descriptionName]; const { groupName: groupName } = field; if (groupName && !(0, _type.isNumeric)(field.groupIndex)) { field.levels = function(fields, groupingField) { return fields.filter((field => field.groupName === groupingField.groupName && (0, _type.isNumeric)(field.groupIndex) && false !== field.visible)).map((field => (0, _extend.extend)(field, { areaIndex: groupingField.areaIndex, area: groupingField.area, expanded: (0, _type.isDefined)(field.expanded) ? field.expanded : groupingField.expanded, dataField: field.dataField || groupingField.dataField, dataType: field.dataType || groupingField.dataType, sortBy: field.sortBy || groupingField.sortBy, sortOrder: field.sortOrder || groupingField.sortOrder, sortBySummaryField: field.sortBySummaryField || groupingField.sortBySummaryField, sortBySummaryPath: field.sortBySummaryPath || groupingField.sortBySummaryPath, visible: field.visible || groupingField.visible, showTotals: (0, _type.isDefined)(field.showTotals) ? field.showTotals : groupingField.showTotals, showGrandTotals: (0, _type.isDefined)(field.showGrandTotals) ? field.showGrandTotals : groupingField.showGrandTotals }))).sort(((a, b) => a.groupIndex - b.groupIndex)) }(fields, field) } if (!dimension || groupName && (0, _type.isNumeric)(field.groupIndex) || false === field.visible && "data" !== field.area && "filter" !== field.area) { return } if (field.levels && dimension !== descriptions.filters && dimension !== descriptions.values) { dimension.push.apply(dimension, field.levels); if (field.filterValues && field.filterValues.length) { descriptions.filters.push(field) } } else { dimension.push(field) } })); (0, _iterator.each)(descriptions, ((_, fields) => { sortFieldsByAreaIndex(fields) })); const indices = {}; (0, _iterator.each)(descriptions.values, ((_, field) => { const expression = field.calculateSummaryValue; if ((0, _type.isFunction)(expression)) { const summaryCell = _m_summary_display_modes.default.createMockSummaryCell(descriptions, fields, indices); expression(summaryCell) } })); return descriptions }, _fieldsPrepared(fields) { this._fields = fields; (0, _iterator.each)(fields, ((index, field) => { field.index = index; updateCalculatedFieldProperties(field, ALL_CALCULATED_PROPERTIES) })); const currentFieldState = getFieldsState(fields, ["caption"]); this._eventsStrategy.fireEvent("fieldsPrepared", [fields]); for (let i = 0; i < fields.length; i += 1) { if (fields[i].caption !== currentFieldState[i].caption) { (0, _m_widget_utils.setFieldProperty)(fields[i], "caption", fields[i].caption, true) } } this._descriptions = this._createDescriptions() }, isLoading() { return this._loadingCount > 0 }, state(state, skipLoading) { const that = this; if (arguments.length) { state = (0, _extend.extend)({ rowExpandedPaths: [], columnExpandedPaths: [] }, state); if (!that._descriptions) { that.beginLoading(); (0, _deferred.when)(getFields(that)).done((fields => { that._fields = setFieldsState(state.fields, fields); that._fieldsPrepared(fields); !skipLoading && that.load(state) })).always((() => { that.endLoading() })) } else { that._fields = setFieldsState(state.fields, that._fields); that._descriptions = that._createDescriptions(); !skipLoading && that.load(state) } return } return { fields: getFieldsState(that._fields, STATE_PROPERTIES), columnExpandedPaths: getExpandedPaths(that._data, that._descriptions, "columns", that._lastLoadOptions), rowExpandedPaths: getExpandedPaths(that._data, that._descriptions, "rows", that._lastLoadOptions) } }, beginLoading() { this._changeLoadingCount(1) }, endLoading() { this._changeLoadingCount(-1) }, _changeLoadingCount(increment) { const oldLoading = this.isLoading(); this._loadingCount += increment; const newLoading = this.isLoading(); if (oldLoading ^ newLoading) { this._eventsStrategy.fireEvent("loadingChanged", [newLoading]) } }, _hasPagingValues(options, area, oppositeIndex) { const takeField = `${area}Take`; const skipField = `${area}Skip`; const { values: values } = this._data; let items = this._data[`${area}s`]; const oppositeArea = "row" === area ? "column" : "row"; const indices = []; if (options.path && options.area === area) { const headerItem = findHeaderItem(items, options.path); items = headerItem && headerItem.children; if (!items) { return false } } if (options.oppositePath && options.area === oppositeArea) { const headerItem = findHeaderItem(items, options.oppositePath); items = headerItem && headerItem.children; if (!items) { return false } } for (let i = options[skipField]; i < options[skipField] + options[takeField]; i += 1) { if (items[i]) { indices.push(items[i].index) } } return indices.every((index => { if (void 0 !== index) { if ("row" === area) { return (values[index] || [])[oppositeIndex] } return (values[oppositeIndex] || [])[index] } return })) }, _processPagingCacheByArea(options, pageSize, area) { const takeField = `${area}Take`; const skipField = `${area}Skip`; let items = this._data[`${area}s`]; const oppositeArea = "row" === area ? "column" : "row"; let item; if (options[takeField]) { if (options.path && options.area === area) { const headerItem = findHeaderItem(items, options.path); items = headerItem && headerItem.children || [] } if (options.oppositePath && options.area === oppositeArea) { const headerItem = findHeaderItem(items, options.oppositePath); items = headerItem && headerItem.children || [] } do { item = items[options[skipField]]; if (item && void 0 !== item.index) { if (this._hasPagingValues(options, oppositeArea, item.index)) { options[skipField]++; options[takeField]-- } else { break } } } while (item && void 0 !== item.index && options[takeField]); if (options[takeField]) { const start = Math.floor(options[skipField] / pageSize) * pageSize; const end = Math.ceil((options[skipField] + options[takeField]) / pageSize) * pageSize; options[skipField] = start; options[takeField] = end - start } } }, _processPagingCache(storeLoadOptions) { const pageSize = this._pageSize; if (pageSize < 0) { return } for (let i = 0; i < storeLoadOptions.length; i += 1) { this._processPagingCacheByArea(storeLoadOptions[i], pageSize, "row"); this._processPagingCacheByArea(storeLoadOptions[i], pageSize, "column") } }, _loadCore(options, deferred) { const that = this; const store = this._store; const descriptions = this._descriptions; const reload = options.reload || this.paginate() && that._isFieldsModified; const paginate = this.paginate(); const headerName = DESCRIPTION_NAME_BY_AREA[options.area]; options = options || {}; if (store) { (0, _extend.extend)(options, descriptions); options.columnExpandedPaths = options.columnExpandedPaths || getExpandedPaths(this._data, options, "columns", that._lastLoadOptions); options.rowExpandedPaths = options.rowExpandedPaths || getExpandedPaths(this._data, options, "rows", that._lastLoadOptions); if (paginate) { options.pageSize = this._pageSize } if (headerName) { options.headerName = headerName } that.beginLoading(); deferred.always((() => { that.endLoading() })); let storeLoadOptions = [options]; that._eventsStrategy.fireEvent("customizeStoreLoadOptions", [storeLoadOptions, reload]); if (!reload) { that._processPagingCache(storeLoadOptions) } storeLoadOptions = storeLoadOptions.filter((options => !(options.rows.length && 0 === options.rowTake) && !(options.columns.length && 0 === options.columnTake))); if (!storeLoadOptions.length) { that._update(deferred); return } const results = storeLoadOptions.map((options => store.load(options))); _deferred.when.apply(null, results).done((function() { const results = arguments; for (let i = 0; i < results.length; i += 1) { const options = storeLoadOptions[i]; const data = results[i]; const isLast = i === results.length - 1; if (options.path) { that.applyPartialDataSource(options.area, options.path, data, isLast ? deferred : false, options.oppositePath) } else if (paginate && !reload && isDataExists(that._data)) { that.mergePartialDataSource(data, isLast ? deferred : false) } else { (0, _extend.extend)(that._data, data); that._lastLoadOptions = options; that._update(isLast ? deferred : false) } } })).fail(deferred.reject) } else { that._update(deferred) } }, _sort(descriptions, data, getAscOrder) { const store = this._store; if (store && !this._paginate) { (0, _m_data_source_utils.sort)(descriptions, data, getAscOrder) } }, sortLocal() { this._sort(this._descriptions, this._data); this._eventsStrategy.fireEvent("changed") }, paginate() { return this._paginate && this._store && this._store.supportPaging() }, isEmpty() { const dataFields = this.getAreaFields("data").filter((f => false !== f.visible)); const data = this.getData(); return !dataFields.length || !data.values.length }, _update(deferred) { const that = this; const descriptions = that._descriptions; const loadedData = that._data; const dataFields = descriptions.values; const expressionsUsed = function(dataFields) { return dataFields.some((field => field.summaryDisplayMode || field.calculateSummaryValue)) }(dataFields); (0, _deferred.when)(formatHeaders(descriptions, loadedData), updateCache(loadedData.rows), updateCache(loadedData.columns)).done((() => { if (expressionsUsed) { that._sort(descriptions, loadedData, expressionsUsed); !that.isEmpty() && _m_summary_display_modes.default.applyDisplaySummaryMode(descriptions, loadedData) } that._sort(descriptions, loadedData); !that.isEmpty() && function(dataFields) { return dataFields.some((field => !!field.runningTotal)) }(dataFields) && _m_summary_display_modes.default.applyRunningTotal(descriptions, loadedData); that._data = loadedData; false !== deferred && (0, _deferred.when)(deferred).done((() => { that._isFieldsModified = false; that._eventsStrategy.fireEvent("changed"); if ((0, _type.isDefined)(that._data.grandTotalRowIndex)) { loadedData.grandTotalRowIndex = that._data.grandTotalRowIndex } if ((0, _type.isDefined)(that._data.grandTotalColumnIndex)) { loadedData.grandTotalColumnIndex = that._data.grandTotalColumnIndex } })); deferred && deferred.resolve(that._data) })); return deferred }, store() { return this._store }, collapseHeaderItem(area, path) { const that = this; const headerItems = "column" === area ? that._data.columns : that._data.rows; const headerItem = findHeaderItem(headerItems, path); const field = that.getAreaFields(area)[path.length - 1]; if (headerItem && headerItem.children) { that._eventsStrategy.fireEvent("expandValueChanging", [{ area: area, path: path, expanded: false }]); if (field) { field.expanded = false } headerItem.collapsedChildren = headerItem.children; delete headerItem.children; that._update(); if (that.paginate()) { that.load() } return true } return false }, collapseAll(id) { let dataChanged = false; const field = this.field(id) || {}; let areaOffsets = [this.getAreaFields(field.area).indexOf(field)]; field.expanded = false; if (field && field.levels) { areaOffsets = []; field.levels.forEach((f => { areaOffsets.push(this.getAreaFields(field.area).indexOf(f)); f.expanded = false })) }(0, _m_widget_utils.foreachTree)(this._data[`${field.area}s`], (items => { const item = items[0]; const path = (0, _m_widget_utils.createPath)(items); if (item && item.children && areaOffsets.includes(path.length - 1)) { item.collapsedChildren = item.children; delete item.children; dataChanged = true } }), true); dataChanged && this._update() }, expandAll(id) { const field = this.field(id); if (field && field.area) { field.expanded = true; if (field && field.levels) { field.levels.forEach((f => { f.expanded = true })) } this.load() } }, expandHeaderItem(area, path) { const that = this; const headerItems = "column" === area ? that._data.columns : that._data.rows; const headerItem = findHeaderItem(headerItems, path); if (headerItem && !headerItem.children) { const hasCache = !!headerItem.collapsedChildren; const options = { area: area, path: path, expanded: true, needExpandData: !hasCache }; that._eventsStrategy.fireEvent("expandValueChanging", [options]); if (hasCache) { headerItem.children = headerItem.collapsedChildren; delete headerItem.collapsedChildren; that._update() } else if (this.store()) { that.load(options) } return hasCache } return false }, mergePartialDataSource(dataSource, deferred) { const that = this; const loadedData = that._data; let newRowItemIndexesToCurrent; let newColumnItemIndexesToCurrent; if (dataSource && dataSource.values) { dataSource.rows = dataSource.rows || []; dataSource.columns = dataSource.columns || []; newRowItemIndexesToCurrent = updateHeaderItems(loadedData.rows, dataSource.rows, loadedData.grandTotalColumnIndex); newColumnItemIndexesToCurrent = updateHeaderItems(loadedData.columns, dataSource.columns, loadedData.grandTotalColumnIndex); (0, _deferred.when)(newRowItemIndexesToCurrent, newColumnItemIndexesToCurrent).done(((newRowItemIndexesToCurrent, newColumnItemIndexesToCurrent) => { if (newRowItemIndexesToCurrent.length || newColumnItemIndexesToCurrent.length) { updateDataSourceCells(loadedData, dataSource.values, newRowItemIndexesToCurrent, newColumnItemIndexesToCurrent) } that._update(deferred) })) } }, applyPartialDataSource(area, path, dataSource, deferred, oppositePath) { const that = this; const loadedData = that._data; const headerItems = "column" === area ? loadedData.columns : loadedData.rows; let headerItem; const oppositeHeaderItems = "column" === area ? loadedData.rows : loadedData.columns; let oppositeHeaderItem; let newRowItemIndexesToCurrent; let newColumnItemIndexesToCurrent; if (dataSource && dataSource.values) { dataSource.rows = dataSource.rows || []; dataSource.columns = dataSource.columns || []; headerItem = findHeaderItem(headerItems, path); oppositeHeaderItem = oppositePath && findHeaderItem(oppositeHeaderItems, oppositePath); if (headerItem) { if ("column" === area) { newColumnItemIndexesToCurrent = updateHeaderItemChildren(headerItems, headerItem, dataSource.columns, loadedData.grandTotalColumnIndex); if (oppositeHeaderItem) { newRowItemIndexesToCurrent = updateHeaderItemChildren(oppositeHeaderItems, oppositeHeaderItem, dataSource.rows, loadedData.grandTotalRowIndex) } else { newRowItemIndexesToCurrent = updateHeaderItems(loadedData.rows, dataSource.rows, loadedData.grandTotalRowIndex) } } else { newRowItemIndexesToCurrent = updateHeaderItemChildren(headerItems, headerItem, dataSource.rows, loadedData.grandTotalRowIndex); if (oppositeHeaderItem) { newColumnItemIndexesToCurrent = updateHeaderItemChildren(oppositeHeaderItems, oppositeHeaderItem, dataSource.columns, loadedData.grandTotalColumnIndex) } else { newColumnItemIndexesToCurrent = updateHeaderItems(loadedData.columns, dataSource.columns, loadedData.grandTotalColumnIndex) } }(0, _deferred.when)(newRowItemIndexesToCurrent, newColumnItemIndexesToCurrent).done(((newRowItemIndexesToCurrent, newColumnItemIndexesToCurrent) => { if ("row" === area && newRowItemIndexesToCurrent.length || "column" === area && newColumnItemIndexesToCurrent.length) { updateDataSourceCells(loadedData, dataSource.values, newRowItemIndexesToCurrent, newColumnItemIndexesToCurrent) } that._update(deferred) })) } } }, on(eventName, eventHandler) { this._eventsStrategy.on(eventName, eventHandler); return this }, off(eventName, eventHandler) { this._eventsStrategy.off(eventName, eventHandler); return this }, dispose() { const delayedLoadTask = this._delayedLoadTask; this._eventsStrategy.dispose(); if (delayedLoadTask) { delayedLoadTask.abort() } this._isDisposed = true }, isDisposed() { return !!this._isDisposed } } }()); exports.default = { PivotGridDataSource: PivotGridDataSource } }, 91629: /*!************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/data_source/m_data_source_utils.js ***! \************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; exports.sort = sort; var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _m_widget_utils = __webpack_require__( /*! ../m_widget_utils */ 28580); function sort(loadOptions, dataSource, getAscOrder) { sortDimension(dataSource, loadOptions, "rows", getAscOrder); sortDimension(dataSource, loadOptions, "columns", getAscOrder) } function sortDimension(dataSource, loadOptions, dimensionName, getAscOrder) { const fields = loadOptions[dimensionName] || []; const baseIndex = loadOptions.headerName === dimensionName ? loadOptions.path.length : 0; const sortingMethodByLevel = []; (0, _m_widget_utils.foreachDataLevel)(dataSource[dimensionName], ((item, index) => { const field = fields[index] || {}; const sortingMethod = sortingMethodByLevel[index] = sortingMethodByLevel[index] || function(field, dataSource, loadOptions, dimensionName, getAscOrder) { const sortOrder = getAscOrder ? "asc" : field.sortOrder; const sortBy = function(sortBy, getAscOrder) { let member = "text"; if ("none" === sortBy) { member = "index" } else if (getAscOrder || "displayText" !== sortBy) { member = "value" } return member }(field.sortBy, getAscOrder); const defaultCompare = field.sortingMethod ? function(a, b) { return field.sortingMethod(a, b) } : (0, _m_widget_utils.getCompareFunction)((item => item[sortBy])); const summaryValueSelector = !getAscOrder && function(field, dataSource, loadOptions, dimensionName) { const { values: values } = dataSource; const sortBySummaryFieldIndex = (0, _m_widget_utils.findField)(loadOptions.values, field.sortBySummaryField); const areRows = "rows" === dimensionName; const sortByDimension = areRows ? dataSource.columns : dataSource.rows; const grandTotalIndex = areRows ? dataSource.grandTotalRowIndex : dataSource.grandTotalColumnIndex; const sortBySummaryPath = field.sortBySummaryPath || []; const sliceIndex = sortBySummaryPath.length ? function(items, path) { let index = null; const pathValue = (path || []).join("."); if (pathValue.length) { (0, _m_widget_utils.foreachTree)(items, (items => { const item = items[0]; const itemPath = (0, _m_widget_utils.createPath)(items).join("."); const textPath = (0, _iterator.map)(items, (item => item.text)).reverse().join("."); if (pathValue === itemPath || item.key && textPath === pathValue) { index = items[0].index; return false } return })) } return index }(sortByDimension, sortBySummaryPath) : grandTotalIndex; if (values && values.length && sortBySummaryFieldIndex >= 0 && (0, _type.isDefined)(sliceIndex)) { return function(field) { const rowIndex = areRows ? field.index : sliceIndex; const columnIndex = areRows ? sliceIndex : field.index; const value = ((values[rowIndex] || [ [] ])[columnIndex] || [])[sortBySummaryFieldIndex]; return (0, _type.isDefined)(value) ? value : null } } return }(field, dataSource, loadOptions, dimensionName); const summaryCompare = summaryValueSelector && (0, _m_widget_utils.getCompareFunction)(summaryValueSelector); const sortingMethod = function(a, b) { const result = summaryCompare && summaryCompare(a, b) || defaultCompare(a, b); return "desc" === sortOrder ? -result : result }; return sortingMethod }(field, dataSource, loadOptions, dimensionName, getAscOrder); item.sort(sortingMethod) }), baseIndex) } exports.default = { sort: sort } }, 75705: /*!********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/export/m_export.js ***! \********************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.PivotGridExport = exports.ExportController = exports.DataProvider = void 0; var _class = _interopRequireDefault(__webpack_require__( /*! ../../../../core/class */ 38377)); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _position = __webpack_require__( /*! ../../../../core/utils/position */ 37518); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _window = __webpack_require__( /*! ../../../../core/utils/window */ 58201); var _format_helper = _interopRequireDefault(__webpack_require__( /*! ../../../../format_helper */ 30343)); var _number = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/number */ 18016)); var _m_export = __webpack_require__( /*! ../../../grids/grid_core/m_export */ 1229); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const ExportController = exports.ExportController = { exportTo() { const onExporting = this._createActionByOption("onExporting"); const eventArgs = { rtlEnabled: this.option("rtlEnabled"), fileName: "PivotGrid", cancel: false }; (0, _type.isFunction)(onExporting) && onExporting(eventArgs) }, _getLength(items) { let i; const itemCount = items[0].length; let cellCount = 0; for (i = 0; i < itemCount; i += 1) { cellCount += items[0][i].colspan || 1 } return cellCount }, _correctCellsInfoItemLengths(cellsInfo, expectedLength) { for (let i = 0; i < cellsInfo.length; i += 1) { while (cellsInfo[i].length < expectedLength) { cellsInfo[i].push({}) } } return cellsInfo }, _calculateCellInfoItemLength(columnsRow) { let result = 0; for (let columnIndex = 0; columnIndex < columnsRow.length; columnIndex += 1) { result += (0, _type.isDefined)(columnsRow[columnIndex].colspan) ? columnsRow[columnIndex].colspan : 1 } return result }, _getEmptyCell: () => ({ text: "", value: void 0, colspan: 1, rowspan: 1 }), _getAllItems(columnsInfo, rowsInfoItems, cellsInfo) { let cellIndex; let rowIndex; let correctedCellsInfo = cellsInfo; const rowsLength = this._getLength(rowsInfoItems); const headerRowsCount = columnsInfo.length; if (columnsInfo.length > 0 && columnsInfo[0].length > 0 && cellsInfo.length > 0 && 0 === cellsInfo[0].length) { const cellInfoItemLength = this._calculateCellInfoItemLength(columnsInfo[0]); if (cellInfoItemLength > 0) { correctedCellsInfo = this._correctCellsInfoItemLengths(cellsInfo, cellInfoItemLength) } } if (0 === correctedCellsInfo.length) { const rowsCount = rowsInfoItems.length; const collapsedColumnCount = columnsInfo.map((headerRowWithColumns => headerRowWithColumns.filter((row => !row.expanded)).length)).reduce(((result, collapsedCount) => result + collapsedCount), 0); for (let rowIdx = 0; rowIdx < rowsCount; rowIdx += 1) { correctedCellsInfo[rowIdx] = []; for (let colIdx = 0; colIdx < collapsedColumnCount; colIdx += 1) { correctedCellsInfo[rowIdx][colIdx] = this._getEmptyCell() } } } const sourceItems = columnsInfo.concat(correctedCellsInfo); for (rowIndex = 0; rowIndex < rowsInfoItems.length; rowIndex += 1) { for (cellIndex = rowsInfoItems[rowIndex].length - 1; cellIndex >= 0; cellIndex -= 1) { if (!(0, _type.isDefined)(sourceItems[rowIndex + headerRowsCount])) { sourceItems[rowIndex + headerRowsCount] = [] } sourceItems[rowIndex + headerRowsCount].splice(0, 0, (0, _extend.extend)({}, rowsInfoItems[rowIndex][cellIndex])) } } sourceItems[0].splice(0, 0, (0, _extend.extend)({}, this._getEmptyCell(), { alignment: (0, _position.getDefaultAlignment)(this._options.rtlEnabled), colspan: rowsLength, rowspan: headerRowsCount })); return (0, _m_export.prepareItems)(sourceItems, this._getEmptyCell()) }, getDataProvider() { return new DataProvider(this) } }; const DataProvider = exports.DataProvider = _class.default.inherit({ ctor(exportController) { this._exportController = exportController }, ready() { this._initOptions(); const options = this._options; return (0, _deferred.when)(options.items).done((items => { const headerSize = items[0][0].rowspan; const columns = items[headerSize - 1]; (0, _iterator.each)(columns, ((_, column) => { column.width = 100 })); options.columns = columns; options.items = items })) }, _initOptions() { const exportController = this._exportController; const dataController = exportController._dataController; const items = new _deferred.Deferred; dataController.beginLoading(); setTimeout((() => { const columnsInfo = (0, _extend.extend)(true, [], dataController.getColumnsInfo(true)); const rowsInfoItems = (0, _extend.extend)(true, [], dataController.getRowsInfo(true)); const cellsInfo = dataController.getCellsInfo(true); items.resolve(exportController._getAllItems(columnsInfo, rowsInfoItems, cellsInfo)); dataController.endLoading() })); this._options = { items: items, rtlEnabled: exportController.option("rtlEnabled"), dataFields: exportController.getDataSource().getAreaFields("data"), rowsArea: exportController._rowsArea, columnsArea: exportController._columnsArea } }, getColumns() { return this._options.columns }, getColumnsWidths() { const colsArea = this._options.columnsArea; const { rowsArea: rowsArea } = this._options; const { columns: columns } = this._options; const useDefaultWidth = !(0, _window.hasWindow)() || "virtual" === colsArea.option("scrolling.mode") || colsArea.element().is(":hidden"); return useDefaultWidth ? columns.map((() => 100)) : rowsArea.getColumnsWidth().concat(colsArea.getColumnsWidth()) }, getRowsCount() { return this._options.items.length }, getGroupLevel: () => 0, getCellMerging(rowIndex, cellIndex) { const { items: items } = this._options; const item = items[rowIndex] && items[rowIndex][cellIndex]; return item ? { colspan: item.colspan - 1, rowspan: item.rowspan - 1 } : { colspan: 0, rowspan: 0 } }, getFrozenArea() { return { x: this.getRowAreaColCount(), y: this.getColumnAreaRowCount() } }, getCellType(rowIndex, cellIndex) { const style = this.getStyles()[this.getStyleId(rowIndex, cellIndex)]; return style && style.dataType || "string" }, getCellData(rowIndex, cellIndex, isExcelJS) { const result = {}; const { items: items } = this._options; const item = items[rowIndex] && items[rowIndex][cellIndex] || {}; if (isExcelJS) { result.cellSourceData = item; const areaName = this._tryGetAreaName(item, rowIndex, cellIndex); if (areaName) { result.cellSourceData.area = areaName } result.cellSourceData.rowIndex = rowIndex; result.cellSourceData.columnIndex = cellIndex } if ("string" === this.getCellType(rowIndex, cellIndex)) { result.value = item.text } else { result.value = item.value } if (result.cellSourceData && result.cellSourceData.isWhiteSpace) { result.value = "" } return result }, _tryGetAreaName(item, rowIndex, cellIndex) { if (this.isColumnAreaCell(rowIndex, cellIndex)) { return "column" } if (this.isRowAreaCell(rowIndex, cellIndex)) { return "row" } if ((0, _type.isDefined)(item.dataIndex)) { return "data" } return }, isRowAreaCell(rowIndex, cellIndex) { return rowIndex >= this.getColumnAreaRowCount() && cellIndex < this.getRowAreaColCount() }, isColumnAreaCell(rowIndex, cellIndex) { return cellIndex >= this.getRowAreaColCount() && rowIndex < this.getColumnAreaRowCount() }, getColumnAreaRowCount() { return this._options.items[0][0].rowspan }, getRowAreaColCount() { return this._options.items[0][0].colspan }, getHeaderStyles() { return [{ alignment: "center", dataType: "string" }, { alignment: (0, _position.getDefaultAlignment)(this._options.rtlEnabled), dataType: "string" }] }, getDataFieldStyles() { const { dataFields: dataFields } = this._options; const dataItemStyle = { alignment: this._options.rtlEnabled ? "left" : "right" }; const dataFieldStyles = []; if (dataFields.length) { dataFields.forEach((dataField => { dataFieldStyles.push(_extends({}, dataItemStyle, { format: dataField.format, dataType: this.getCellDataType(dataField) })) })); return dataFieldStyles } return [dataItemStyle] }, getStyles() { if (this._styles) { return this._styles } this._styles = [...this.getHeaderStyles(), ...this.getDataFieldStyles()]; return this._styles }, getCellDataType(field) { if (field && field.customizeText) { return "string" } if (field.dataType) { return field.dataType } if (field.format) { if (1 === _number.default.parse(_format_helper.default.format(1, field.format))) { return "number" } if (_format_helper.default.format(new Date, field.format)) { return "date" } } return "string" }, getStyleId(rowIndex, cellIndex) { const { items: items } = this._options; const item = items[rowIndex] && items[rowIndex][cellIndex] || {}; if (0 === cellIndex && 0 === rowIndex || this.isColumnAreaCell(rowIndex, cellIndex)) { return 0 } if (this.isRowAreaCell(rowIndex, cellIndex)) { return 1 } return this.getHeaderStyles().length + (item.dataIndex || 0) } }); const PivotGridExport = exports.PivotGridExport = { DEFAUL_COLUMN_WIDTH: 100 }; exports.default = { ExportController: ExportController, PivotGridExport: PivotGridExport, DataProvider: DataProvider } }, 98591: /*!************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/field_chooser/const.js ***! \************************************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.SORT_ORDER = exports.SORTABLE_CONST = exports.ICONS = exports.CLASSES = exports.ATTRIBUTES = void 0; exports.ATTRIBUTES = { treeViewItem: "tree-view-item", allowScrolling: "allow-scrolling", itemGroup: "item-group" }; exports.CLASSES = { area: { self: "dx-area", box: "dx-area-box", caption: "dx-area-caption", icon: "dx-area-icon", field: "dx-area-field", fieldContainer: "dx-area-field-container", fieldContent: "dx-area-field-content", fieldList: "dx-area-fields", fieldListHeader: "dx-area-fields-header" }, pivotGrid: { dragAction: "dx-pivotgrid-drag-action", fieldsContainer: "dx-pivotgrid-fields-container" }, fieldChooser: { self: "dx-pivotgridfieldchooser", container: "dx-pivotgridfieldchooser-container", contextMenu: "dx-pivotgridfieldchooser-context-menu" }, layout: { zero: "dx-layout-0", second: "dx-layout-2" }, treeView: { self: "dx-treeview", borderVisible: "dx-treeview-border-visible" }, scrollable: { self: "dx-scrollable" }, allFields: "dx-all-fields", col: "dx-col", headerFilter: "dx-header-filter", row: "dx-row", widget: "dx-widget" }; exports.ICONS = { all: "smalliconslayout", column: "columnfield", row: "rowfield", filter: "filter", data: "formula", measure: "formula", hierarchy: "hierarchy", dimension: "detailslayout" }; exports.SORTABLE_CONST = { targets: { drag: "drag" } }; exports.SORT_ORDER = { descending: "desc", ascending: "asc" } }, 72182: /*!**********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/field_chooser/dom.js ***! \**********************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.dragAndDropItemRender = function($sourceItem, target) { const $itemArray = function($sourceItem, target) { const isAreaBox = $sourceItem.hasClass(_const.CLASSES.area.box); const isTreeList = $sourceItem.attr(_const.ATTRIBUTES.treeViewItem); if (isAreaBox) { return function($sourceItem, target) { const $itemArray = $sourceItem.clone(); if (target === _const.SORTABLE_CONST.targets.drag) { $sourceItem.each(((idx, sourceItem) => { const width = parseFloat((0, _size.getOuterWidth)(sourceItem)); $itemArray.eq(idx).css("width", width); return true })) } return $itemArray }($sourceItem, target) } if (isTreeList) { return function($sourceItem) { return $sourceItem.clone().addClass(_const.CLASSES.area.box).css("width", parseFloat((0, _size.getOuterWidth)($sourceItem))) }($sourceItem) } return function($sourceItem) { return (0, _renderer.default)("
").addClass(_const.CLASSES.area.field).addClass(_const.CLASSES.area.box).text($sourceItem.text()) }($sourceItem) }($sourceItem, target); if (target === _const.SORTABLE_CONST.targets.drag) { return function($itemArray) { const $wrappedTmpContainer = (0, _renderer.default)("
"); $itemArray.each(((_, item) => { const $wrappedItem = (0, _renderer.default)("
").addClass(_const.CLASSES.pivotGrid.fieldsContainer).addClass(_const.CLASSES.widget).append((0, _renderer.default)(item)); $wrappedTmpContainer.append($wrappedItem); return true })); return $wrappedTmpContainer.children() }($itemArray) } return $itemArray }; var _renderer = (obj = __webpack_require__( /*! ../../../../core/renderer */ 68374), obj && obj.__esModule ? obj : { default: obj }); var obj; var _size = __webpack_require__( /*! ../../../../core/utils/size */ 58664); var _const = __webpack_require__( /*! ./const */ 98591) }, 12086: /*!**********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/field_chooser/m_field_chooser.js ***! \**********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.FieldChooser = void 0; __webpack_require__( /*! ../data_source/m_data_source */ 16710); var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../../core/component_registrator */ 99393)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _icon = __webpack_require__( /*! ../../../../core/utils/icon */ 44899); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _window = __webpack_require__( /*! ../../../../core/utils/window */ 58201); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109)); var _context_menu = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/context_menu */ 10042)); var _tree_view = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/tree_view */ 30254)); var _m_widget_utils = __webpack_require__( /*! ../m_widget_utils */ 28580); var _const = __webpack_require__( /*! ./const */ 98591); var _m_field_chooser_base = __webpack_require__( /*! ./m_field_chooser_base */ 16491); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const DIV = "
"; const hasWindow = (0, _window.hasWindow)(); function getDimensionFields(item, fields) { const result = []; if (item.items) { for (let i = 0; i < item.items.length; i += 1) { result.push.apply(result, getDimensionFields(item.items[i], fields)) } } else if ((0, _type.isDefined)(item.index)) { result.push(fields[item.index]) } return result } function getFirstItem(item, condition) { if (item.items) { for (let i = 0; i < item.items.length; i += 1) { const childrenItem = getFirstItem(item.items[i], condition); if (childrenItem) { return childrenItem } } } if (condition(item)) { return item } return } const compareOrder = [function(a, b) { const aValue = -!!a.isMeasure; const bValue = +!!b.isMeasure; return aValue + bValue }, function(a, b) { const aValue = -!!(a.items && a.items.length); const bValue = +!!(b.items && b.items.length); return aValue + bValue }, function(a, b) { const aValue = +!!(false === a.isMeasure && a.field && a.field.levels && a.field.levels.length); const bValue = -!!(false === b.isMeasure && b.field && b.field.levels && b.field.levels.length); return aValue + bValue }, (0, _m_widget_utils.getCompareFunction)((item => item.text))]; function compareItems(a, b) { let result = 0; let i = 0; while (!result && compareOrder[i]) { result = compareOrder[i++](a, b) } return result } function getScrollable(container) { return container.find(`.${_const.CLASSES.scrollable.self}`).dxScrollable("instance") } class FieldChooser extends _m_field_chooser_base.FieldChooserBase { _getDefaultOptions() { return _extends({}, super._getDefaultOptions(), { height: 400, layout: 0, dataSource: null, encodeHtml: true, onContextMenuPreparing: null, allowSearch: false, searchTimeout: 500, texts: { columnFields: _message.default.format("dxPivotGrid-columnFields"), rowFields: _message.default.format("dxPivotGrid-rowFields"), dataFields: _message.default.format("dxPivotGrid-dataFields"), filterFields: _message.default.format("dxPivotGrid-filterFields"), allFields: _message.default.format("dxPivotGrid-allFields") } }) } _refreshDataSource() { const that = this; that._expandedPaths = []; that._changedHandler = that._changedHandler || function() { (0, _iterator.each)(that._dataChangedHandlers, ((_, func) => { func() })); that._fireContentReadyAction(); that._skipStateChange = true; that.option("state", that._dataSource.state()); that._skipStateChange = false }; that._disposeDataSource(); super._refreshDataSource(); that._dataSource && that._dataSource.on("changed", that._changedHandler) } _disposeDataSource() { const that = this; const dataSource = that._dataSource; if (dataSource) { dataSource.off("changed", that._changedHandler); that._dataSource = void 0 } } _dispose() { this._disposeDataSource(); super._dispose.apply(this, arguments) } _init() { super._init(); this._refreshDataSource(); this._dataChangedHandlers = []; this._initActions() } _initActions() { this._actions = { onContextMenuPreparing: this._createActionByOption("onContextMenuPreparing") } } _trigger(eventName, eventArg) { this._actions[eventName](eventArg) } _setOptionsByReference() { super._setOptionsByReference(); (0, _extend.extend)(this._optionsByReference, { dataSource: true }) } _optionChanged(args) { const that = this; switch (args.name) { case "dataSource": that._refreshDataSource(); that._invalidate(); break; case "layout": case "texts": case "allowSearch": case "searchTimeout": case "encodeHtml": that._invalidate(); break; case "onContextMenuPreparing": that._actions[args.name] = that._createActionByOption(args.name); break; default: super._optionChanged(args) } } _clean(skipStateSetting) { !skipStateSetting && this._dataSource && this.option("state", this._dataSource.state()); this.$element().children(`.${_const.CLASSES.fieldChooser.container}`).remove() } _renderLayout0($container) { $container.addClass(_const.CLASSES.layout.zero); const $row1 = (0, _renderer.default)(DIV).addClass(_const.CLASSES.row).appendTo($container); const $row2 = (0, _renderer.default)(DIV).addClass(_const.CLASSES.row).appendTo($container); const $col1 = (0, _renderer.default)(DIV).addClass(_const.CLASSES.col).appendTo($row1); const $col2 = (0, _renderer.default)(DIV).addClass(_const.CLASSES.col).appendTo($row1); const $col3 = (0, _renderer.default)(DIV).addClass(_const.CLASSES.col).appendTo($row2); const $col4 = (0, _renderer.default)(DIV).addClass(_const.CLASSES.col).appendTo($row2); this._renderArea($col1, "all"); this._renderArea($col2, "row"); this._renderArea($col2, "column"); this._renderArea($col3, "filter"); this._renderArea($col4, "data") } _renderLayout1($container) { const $col1 = (0, _renderer.default)(DIV).addClass(_const.CLASSES.col).appendTo($container); const $col2 = (0, _renderer.default)(DIV).addClass(_const.CLASSES.col).appendTo($container); this._renderArea($col1, "all"); this._renderArea($col2, "filter"); this._renderArea($col2, "row"); this._renderArea($col2, "column"); this._renderArea($col2, "data") } _renderLayout2($container) { $container.addClass(_const.CLASSES.layout.second); const $row1 = (0, _renderer.default)(DIV).addClass(_const.CLASSES.row).appendTo($container); this._renderArea($row1, "all"); const $row2 = (0, _renderer.default)(DIV).addClass(_const.CLASSES.row).appendTo($container); const $col1 = (0, _renderer.default)(DIV).addClass(_const.CLASSES.col).appendTo($row2); const $col2 = (0, _renderer.default)(DIV).addClass(_const.CLASSES.col).appendTo($row2); this._renderArea($col1, "filter"); this._renderArea($col1, "row"); this._renderArea($col2, "column"); this._renderArea($col2, "data") } _initMarkup() { const that = this; const $element = this.$element(); const $container = (0, _renderer.default)(DIV).addClass(_const.CLASSES.fieldChooser.container).appendTo($element); const layout = that.option("layout"); super._initMarkup(); $element.addClass(_const.CLASSES.fieldChooser.self).addClass(_const.CLASSES.pivotGrid.fieldsContainer); that._dataChangedHandlers = []; const dataSource = this._dataSource; const currentState = "instantly" !== that.option("applyChangesMode") && dataSource && dataSource.state(); currentState && that.option("state") && dataSource.state(that.option("state"), true); if (0 === layout) { that._renderLayout0($container) } else if (1 === layout) { that._renderLayout1($container) } else { that._renderLayout2($container) } currentState && dataSource.state(currentState, true) } _renderContentImpl() { super._renderContentImpl(); this.renderSortable(); this._renderContextMenu(); this.updateDimensions() } _fireContentReadyAction() { if (!this._dataSource || !this._dataSource.isLoading()) { super._fireContentReadyAction() } } _getContextMenuArgs(dxEvent) { const targetFieldElement = (0, _renderer.default)(dxEvent.target).closest(`.${_const.CLASSES.area.field}`); const targetGroupElement = (0, _renderer.default)(dxEvent.target).closest(`.${_const.CLASSES.area.fieldList}`); let field; let area; if (targetFieldElement.length) { const fieldCopy = targetFieldElement.data("field"); if (fieldCopy) { field = this.getDataSource().field(fieldCopy.index) || fieldCopy } } if (targetGroupElement.length) { area = targetGroupElement.attr("group") } return { event: dxEvent, field: field, area: area, items: [] } } _renderContextMenu() { const that = this; const $container = that.$element(); if (that._contextMenu) { that._contextMenu.$element().remove() } that._contextMenu = that._createComponent((0, _renderer.default)(DIV).appendTo($container), _context_menu.default, { onPositioning(actionArgs) { const { event: event } = actionArgs; if (!event) { return } const args = that._getContextMenuArgs(event); that._trigger("onContextMenuPreparing", args); if (args.items && args.items.length) { actionArgs.component.option("items", args.items) } else { actionArgs.cancel = true } }, target: $container, onItemClick(params) { params.itemData.onItemClick && params.itemData.onItemClick(params) }, cssClass: _const.CLASSES.fieldChooser.contextMenu }) } _createTreeItems(fields, groupFieldNames, path) { const that = this; let isMeasure; let resultItems = []; const groupedItems = []; const groupFieldName = groupFieldNames[0]; const fieldsByGroup = {}; if (!groupFieldName) { (0, _iterator.each)(fields, ((_, field) => { let icon; if (true === field.isMeasure) { icon = _const.ICONS.measure } if (false === field.isMeasure) { icon = field.groupName ? _const.ICONS.hierarchy : _const.ICONS.dimension } resultItems.push({ index: field.index, field: field, key: field.dataField, selected: (0, _type.isDefined)(field.area), text: field.caption || field.dataField, icon: icon, isMeasure: field.isMeasure, isDefault: field.isDefault }) })) } else { (0, _iterator.each)(fields, ((_, field) => { const groupName = field[groupFieldName] || ""; fieldsByGroup[groupName] = fieldsByGroup[groupName] || []; fieldsByGroup[groupName].push(field); if (void 0 === isMeasure) { isMeasure = true } isMeasure = isMeasure && true === field.isMeasure })); (0, _iterator.each)(fieldsByGroup, ((groupName, fields) => { const currentPath = path ? `${path}.${groupName}` : groupName; const items = that._createTreeItems(fields, groupFieldNames.slice(1), currentPath); if (groupName) { groupedItems.push({ key: groupName, text: groupName, path: currentPath, isMeasure: items.isMeasure, expanded: that._expandedPaths.includes(currentPath), items: items }) } else { resultItems = items } })); resultItems = groupedItems.concat(resultItems); resultItems.isMeasure = isMeasure } return resultItems } _createFieldsDataSource(dataSource) { let fields = dataSource && dataSource.fields() || []; fields = fields.filter((field => false !== field.visible && !(0, _type.isDefined)(field.groupIndex))); const treeItems = this._createTreeItems(fields, ["dimension", "displayFolder"]); (0, _m_widget_utils.foreachDataLevel)(treeItems, (items => { items.sort(compareItems) }), 0, "items"); return treeItems } _renderFieldsTreeView(container) { const that = this; const dataSource = that._dataSource; const treeView = that._createComponent(container, _tree_view.default, { dataSource: that._createFieldsDataSource(dataSource), showCheckBoxesMode: "normal", expandNodesRecursive: false, searchEnabled: that.option("allowSearch"), searchTimeout: that.option("searchTimeout"), useNativeScrolling: false, itemTemplate(itemData, itemIndex, itemElement) { const $item = (0, _renderer.default)("
").toggleClass(_const.CLASSES.area.field, !itemData.items).attr(_const.ATTRIBUTES.treeViewItem, true).data("field", itemData.field).appendTo(itemElement); if (itemData.icon) { var _getImageContainer; null === (_getImageContainer = (0, _icon.getImageContainer)(itemData.icon)) || void 0 === _getImageContainer || _getImageContainer.appendTo($item) }(0, _renderer.default)("").text(itemData.text).appendTo($item) }, onItemCollapsed(e) { const index = that._expandedPaths.indexOf(e.itemData.path); if (index >= 0) { that._expandedPaths.splice(index, 1) } }, onItemExpanded(e) { const index = that._expandedPaths.indexOf(e.itemData.path); if (index < 0) { that._expandedPaths.push(e.itemData.path) } }, onItemSelectionChanged(e) { const data = e.itemData; let field; let fields; let needSelectDefaultItem = true; let area; if (data.items) { if (data.selected) { treeView.unselectItem(data); return } that._processDemandState((() => { fields = getDimensionFields(data, dataSource.fields()); for (let i = 0; i < fields.length; i += 1) { if (fields[i].area) { needSelectDefaultItem = false; break } } })); if (needSelectDefaultItem) { const item = getFirstItem(data, (item => item.isDefault)) || getFirstItem(data, (item => (0, _type.isDefined)(item.index))); item && treeView.selectItem(item); return } } else { field = dataSource.fields()[data.index]; if (data.selected) { area = field.isMeasure ? "data" : "column" } if (field) { fields = [field] } } that._applyChanges(fields, { area: area, areaIndex: void 0 }) } }); that._dataChangedHandlers.push((function() { let scrollable = getScrollable(container); const scrollTop = scrollable ? scrollable.scrollTop() : 0; treeView.option({ dataSource: that._createFieldsDataSource(dataSource) }); scrollable = getScrollable(container); if (scrollable) { scrollable.scrollTo({ y: scrollTop }); scrollable.update() } })) } _renderAreaFields($container, area) { const that = this; const dataSource = that._dataSource; const fields = dataSource ? (0, _extend.extend)(true, [], dataSource.getAreaFields(area, true)) : []; $container.empty(); (0, _iterator.each)(fields, ((_, field) => { if (false !== field.visible) { that.renderField(field, true).appendTo($container) } })) } _renderArea(container, area) { const that = this; const $areaContainer = (0, _renderer.default)(DIV).addClass(_const.CLASSES.area.self).appendTo(container); const $fieldsHeaderContainer = (0, _renderer.default)(DIV).addClass(_const.CLASSES.area.fieldListHeader).appendTo($areaContainer); const caption = that.option(`texts.${area}Fields`); let $fieldsContent; let render; (0, _renderer.default)("").addClass(_const.CLASSES.area.icon).addClass(`dx-icon-${_const.ICONS[area]}`).appendTo($fieldsHeaderContainer); (0, _renderer.default)("").html(" ").appendTo($fieldsHeaderContainer); (0, _renderer.default)("").addClass(_const.CLASSES.area.caption).text(caption).appendTo($fieldsHeaderContainer); const $fieldsContainer = (0, _renderer.default)(DIV).addClass(_const.CLASSES.area.fieldList).addClass(_const.CLASSES.pivotGrid.dragAction).appendTo($areaContainer); if ("all" !== area) { $fieldsContainer.attr("group", area).attr(_const.ATTRIBUTES.allowScrolling, true); $fieldsContent = (0, _renderer.default)(DIV).addClass(_const.CLASSES.area.fieldContainer).appendTo($fieldsContainer); render = function() { that._renderAreaFields($fieldsContent, area) }; that._dataChangedHandlers.push(render); render(); $fieldsContainer.dxScrollable({ useNative: false }) } else { $areaContainer.addClass(_const.CLASSES.allFields); $fieldsContainer.addClass(_const.CLASSES.treeView.borderVisible); that._renderFieldsTreeView($fieldsContainer) } } _getSortableOptions() { return { direction: "" } } _adjustSortableOnChangedArgs() {} resetTreeView() { const treeView = this.$element().find(`.${_const.CLASSES.treeView.self}`).dxTreeView("instance"); if (treeView) { treeView.option("searchValue", ""); treeView.collapseAll() } } applyChanges() { const state = this.option("state"); if ((0, _type.isDefined)(state)) { this._dataSource.state(state) } } cancelChanges() { const dataSource = this._dataSource; if (!dataSource.isLoading()) { this.option("state", dataSource.state()); return true } return false } getDataSource() { return this._dataSource } updateDimensions() { const $scrollableElements = this.$element().find(`.${_const.CLASSES.area.self} .${_const.CLASSES.scrollable.self}`); $scrollableElements.dxScrollable("update") } _visibilityChanged(visible) { if (visible && hasWindow) { this.updateDimensions() } } } exports.FieldChooser = FieldChooser; (0, _component_registrator.default)("dxPivotGridFieldChooser", FieldChooser); exports.default = { FieldChooser: FieldChooser } }, 16491: /*!***************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/field_chooser/m_field_chooser_base.js ***! \***************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.FieldChooserBase = void 0; var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../../core/component_registrator */ 99393)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _array_store = _interopRequireDefault(__webpack_require__( /*! ../../../../data/array_store */ 26562)); var _click = __webpack_require__( /*! ../../../../events/click */ 95429); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../../events/core/events_engine */ 55994)); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109)); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/widget/ui.widget */ 14390)); var _m_column_state_mixin = _interopRequireDefault(__webpack_require__( /*! ../../../grids/grid_core/column_state_mixin/m_column_state_mixin */ 51255)); var _m_header_filter_core = __webpack_require__( /*! ../../../grids/grid_core/header_filter/m_header_filter_core */ 37565); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../../../grids/grid_core/m_utils */ 60082)); var _m_sorting_mixin = _interopRequireDefault(__webpack_require__( /*! ../../../grids/grid_core/sorting/m_sorting_mixin */ 62930)); var _m_widget_utils = __webpack_require__( /*! ../m_widget_utils */ 28580); var _m_sortable = _interopRequireDefault(__webpack_require__( /*! ../sortable/m_sortable */ 71442)); var _const = __webpack_require__( /*! ./const */ 98591); var _dom = __webpack_require__( /*! ./dom */ 72182); var _utils = __webpack_require__( /*! ./utils */ 95670); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const { Sortable: Sortable } = _m_sortable.default; class HeaderFilterView extends _m_header_filter_core.HeaderFilterView { _getSearchExpr(options, headerFilterOptions) { options.useDefaultSearchExpr = true; return super._getSearchExpr(options, headerFilterOptions) } } function getMainGroupField(dataSource, sourceField) { let 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]) } const mixinWidget = (0, _m_header_filter_core.headerFilterMixin)((0, _m_sorting_mixin.default)((0, _m_column_state_mixin.default)(_ui.default))); class FieldChooserBase extends mixinWidget { _getDefaultOptions() { return _extends({}, super._getDefaultOptions(), { allowFieldDragging: true, applyChangesMode: "instantly", state: null, headerFilter: { width: 252, height: 325, allowSelectAll: true, showRelevantValues: false, search: { enabled: false, timeout: 500, editorOptions: {}, mode: "contains" }, texts: { emptyValue: _message.default.format("dxDataGrid-headerFilterEmptyValue"), ok: _message.default.format("dxDataGrid-headerFilterOK"), cancel: _message.default.format("dxDataGrid-headerFilterCancel") } }, remoteSort: false }) } _init() { super._init(); this._headerFilterView = new HeaderFilterView(this); this._refreshDataSource(); this.subscribeToEvents(); _m_utils.default.logHeaderFilterDeprecatedWarningIfNeed(this) } _refreshDataSource() { const dataSource = this.option("dataSource"); if (dataSource && dataSource.fields && dataSource.load) { this._dataSource = dataSource } } _optionChanged(args) { switch (args.name) { case "dataSource": this._refreshDataSource(); break; case "applyChangesMode": case "remoteSort": 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: super._optionChanged(args) } } renderField(field, showColumnLines) { const that = this; const $fieldContent = (0, _renderer.default)("
").addClass(_const.CLASSES.area.fieldContent).text(field.caption || field.dataField); const $fieldElement = (0, _renderer.default)("
").addClass(_const.CLASSES.area.field).addClass(_const.CLASSES.area.box).data("field", field).append($fieldContent); const 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", allowSorting: field.allowSorting }, showColumnLines: showColumnLines }) } that._applyColumnState({ name: "headerFilter", rootElement: $fieldElement, column: { alignment: that.option("rtlEnabled") ? "right" : "left", filterValues: mainGroupField.filterValues, allowFiltering: mainGroupField.allowFiltering && !field.groupIndex, allowSorting: field.allowSorting }, showColumnLines: showColumnLines }) } if (field.groupName) { $fieldElement.attr(_const.ATTRIBUTES.itemGroup, field.groupName) } return $fieldElement } _clean(value) {} _render() { super._render(); this._headerFilterView.render(this.$element()) } renderSortable() { const that = this; that._createComponent(that.$element(), Sortable, (0, _extend.extend)({ allowDragging: that.option("allowFieldDragging"), itemSelector: `.${_const.CLASSES.area.field}`, itemContainerSelector: `.${_const.CLASSES.area.fieldContainer}`, groupSelector: `.${_const.CLASSES.area.fieldList}`, groupFilter() { const dataSource = that._dataSource; const $sortable = (0, _renderer.default)(this).closest(".dx-sortable-old"); const pivotGrid = $sortable.data("dxPivotGrid"); const pivotGridFieldChooser = $sortable.data("dxPivotGridFieldChooser"); if (pivotGrid) { return pivotGrid.getDataSource() === dataSource } if (pivotGridFieldChooser) { return pivotGridFieldChooser.option("dataSource") === dataSource } return false }, itemRender: _dom.dragAndDropItemRender, onDragging(e) { const field = e.sourceElement.data("field"); const { targetGroup: targetGroup } = e; 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(e) { const field = e.sourceElement.data("field"); e.removeSourceElement = !!e.sourceGroup; that._adjustSortableOnChangedArgs(e); if (field) { const { targetIndex: targetIndex } = e; let mainGroupField; let invisibleFieldsIndexOffset = 0; that._processDemandState((dataSource => { const fields = dataSource.getAreaFields(field.area, true); mainGroupField = getMainGroupField(dataSource, field); const visibleFields = fields.filter((f => false !== f.visible)); const fieldBeforeTarget = visibleFields[targetIndex - 1]; if (fieldBeforeTarget) { invisibleFieldsIndexOffset = fields.filter((f => false === f.visible && f.areaIndex <= fieldBeforeTarget.areaIndex)).length } })); that._applyChanges([mainGroupField], { area: e.targetGroup, areaIndex: targetIndex + invisibleFieldsIndexOffset }) } } }, that._getSortableOptions())) } _processDemandState(func) { const that = this; const isInstantlyMode = "instantly" === that.option("applyChangesMode"); const dataSource = that._dataSource; if (isInstantlyMode) { func(dataSource, isInstantlyMode) } else { const currentState = dataSource.state(); const pivotGridState = that.option("state"); if (pivotGridState) { dataSource.state(pivotGridState, true) } func(dataSource, isInstantlyMode); dataSource.state(currentState, true) } } _applyChanges(fields, props) { const that = this; that._processDemandState(((dataSource, isInstantlyMode) => { fields.forEach((_ref => { let { index: index } = _ref; dataSource.field(index, props) })); if (isInstantlyMode) { dataSource.load() } else { that._changedHandler() } })) } _applyLocalSortChanges(fieldIdx, sortOrder) { this._processDemandState((dataSource => { dataSource.field(fieldIdx, { sortOrder: sortOrder }); dataSource.sortLocal() })) } _adjustSortableOnChangedArgs(e) { e.removeSourceElement = false; e.removeTargetElement = true; e.removeSourceClass = false } _getSortableOptions() { return { direction: "auto" } } subscribeToEvents(element) { const that = this; const func = function(e) { const field = (0, _renderer.default)(e.currentTarget).data("field"); const mainGroupField = (0, _extend.extend)(true, {}, getMainGroupField(that._dataSource, field)); const isHeaderFilter = (0, _renderer.default)(e.target).hasClass(_const.CLASSES.headerFilter); const dataSource = that._dataSource; const type = mainGroupField.groupName ? "tree" : "list"; const paginate = dataSource.paginate() && "list" === type; if (isHeaderFilter) { that._headerFilterView.showHeaderFilterMenu((0, _renderer.default)(e.currentTarget), (0, _extend.extend)(mainGroupField, { type: type, encodeHtml: that.option("encodeHtml"), dataSource: { useDefaultSearch: !paginate, load(options) { const { userData: userData } = options; if (userData.store) { return userData.store.load(options) } const d = new _deferred.Deferred; dataSource.getFieldValues(mainGroupField.index, that.option("headerFilter.showRelevantValues"), paginate ? options : void 0).done((data => { const emptyValue = that.option("headerFilter.texts.emptyValue"); data.forEach((element => { if (!element.text) { element.text = emptyValue } })); if (paginate) { d.resolve(data) } else { userData.store = new _array_store.default(data); userData.store.load(options).done(d.resolve).fail(d.reject) } })).fail(d.reject); return d }, postProcess(data) { ! function(groupItems, field) { const filterValues = []; const isTree = !!field.groupName; const isExcludeFilterType = "exclude" === field.filterType; if (field.filterValues) { (0, _iterator.each)(field.filterValues, ((_, filterValue) => { filterValues.push(Array.isArray(filterValue) ? filterValue.join("/") : filterValue && filterValue.valueOf()) })) }(0, _m_widget_utils.foreachTree)(groupItems, (items => { const item = items[0]; const path = (0, _m_widget_utils.createPath)(items); const preparedFilterValueByText = isTree ? (0, _iterator.map)(items, (item => item.text)).reverse().join("/") : item.text; item.value = isTree ? path.slice(0) : item.key || item.value; const preparedFilterValue = isTree ? path.join("/") : item.value && item.value.valueOf(); if (item.children) { item.items = item.children; item.children = null }(0, _m_header_filter_core.updateHeaderFilterItemSelectionState)(item, item.key && filterValues.includes(preparedFilterValueByText) || filterValues.includes(preparedFilterValue), isExcludeFilterType) })) }(data, mainGroupField); return data } }, apply() { that._applyChanges([mainGroupField], { filterValues: this.filterValues, filterType: this.filterType }) } })) } else if (field.allowSorting && "data" !== field.area) { const isRemoteSort = that.option("remoteSort"); const sortOrder = (0, _utils.reverseSortOrder)(field.sortOrder); if (isRemoteSort) { that._applyChanges([field], { sortOrder: sortOrder }) } else { that._applyLocalSortChanges(field.index, sortOrder) } } }; if (element) { _events_engine.default.on(element, _click.name, `.${_const.CLASSES.area.field}.${_const.CLASSES.area.box}`, func); return } _events_engine.default.on(that.$element(), _click.name, `.${_const.CLASSES.area.field}.${_const.CLASSES.area.box}`, func) } _initTemplates() {} addWidgetPrefix(className) { return `dx-pivotgrid-${className}` } } exports.FieldChooserBase = FieldChooserBase; (0, _component_registrator.default)("dxPivotGridFieldChooserBase", FieldChooserBase); exports.default = { FieldChooserBase: FieldChooserBase } }, 95670: /*!************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/field_chooser/utils.js ***! \************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.reverseSortOrder = void 0; var _const = __webpack_require__( /*! ./const */ 98591); exports.reverseSortOrder = sortOrder => sortOrder === _const.SORT_ORDER.descending ? _const.SORT_ORDER.ascending : _const.SORT_ORDER.descending }, 70513: /*!******************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/fields_area/m_fields_area.js ***! \******************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.FieldsArea = void 0; __webpack_require__( /*! ../field_chooser/m_field_chooser_base */ 16491); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _style = __webpack_require__( /*! ../../../../core/utils/style */ 80968); var _button = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/button */ 63008)); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/popup/ui.popup */ 51495)); var _m_area_item = __webpack_require__( /*! ../area_item/m_area_item */ 74305); var _m_widget_utils = __webpack_require__( /*! ../m_widget_utils */ 28580); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const DIV = "
"; const FieldsArea = exports.FieldsArea = _m_area_item.AreaItem.inherit({ ctor(component, area) { this.callBase(component); this._area = area }, _getAreaName: () => "fields", _createGroupElement() { return (0, _renderer.default)(DIV).addClass("dx-pivotgrid-fields-area").addClass("dx-area-fields").addClass("dx-pivotgrid-drag-action").attr("group", this._area) }, isVisible() { return !!this.option("fieldPanel.visible") && this.option(`fieldPanel.show${(0,_m_widget_utils.capitalizeFirstLetter)(this._area)}Fields`) }, _renderButton(element) { const that = this; const container = (0, _renderer.default)("
").appendTo(element)); const button = that.component._createComponent((0, _renderer.default)(DIV).appendTo(container), _button.default, { text: "Fields", icon: "menu", width: "auto", onClick() { const popup = that.tableElement().find(".dx-fields-area-popup").dxPopup("instance"); if (!popup.option("visible")) { popup.show() } } }); button.$element().addClass("dx-pivotgrid-fields-area-hamburger") }, _getPopupOptions: (row, button) => ({ contentTemplate: () => (0, _renderer.default)("
").appendTo((0, _renderer.default)("
").addClass("dx-area-field-container").append((0, _renderer.default)("").addClass("dx-pivotgrid-fields-area-head").append(row)), height: "auto", width: "auto", position: { at: "left", my: "left", of: button }, dragEnabled: false, animation: { show: { type: "pop", duration: 200 } }, shading: false, showTitle: false, hideOnOutsideClick: true, container: button.parent() }), _renderPopup(tableElement, row) { const that = this; const button = tableElement.find(".dx-button"); const popupOptions = that._getPopupOptions(row, button); const FieldChooserBase = that.component.$element().dxPivotGridFieldChooserBase("instance"); if (that._rowPopup) { that._rowPopup.$element().remove() } that._rowPopup = that.component._createComponent((0, _renderer.default)(DIV).appendTo(tableElement), _ui.default, popupOptions); that._rowPopup.$element().addClass("dx-fields-area-popup"); that._rowPopup.content().addClass("dx-pivotgrid-fields-container"); that._rowPopup.content().parent().attr("group", "row"); FieldChooserBase.subscribeToEvents(that._rowPopup.content()); FieldChooserBase.renderSortable(that._rowPopup.content()) }, _shouldCreateButton: () => false, _renderTableContent(tableElement, data) { const that = this; const groupElement = this.groupElement(); const isVisible = this.isVisible(); const fieldChooserBase = that.component.$element().dxPivotGridFieldChooserBase("instance"); const head = (0, _renderer.default)("").addClass("dx-pivotgrid-fields-area-head").appendTo(tableElement); const area = that._area; const row = (0, _renderer.default)(""); groupElement.toggleClass("dx-hidden", !isVisible); tableElement.addClass("dx-area-field-container"); if (!isVisible) { return }(0, _iterator.each)(data, ((index, field) => { if (field.area === area && false !== field.visible) { const td = (0, _renderer.default)("", setVirtualContentParams(params) { this.callBase(params); this._setTableCss({ left: params.left, top: 0 }); this._virtualContentWidth = params.width }, hasScroll() { const tableWidth = this._virtualContent ? this._virtualContentWidth : this._tableWidth; const groupWidth = this.getGroupWidth(); if (groupWidth && tableWidth) { return tableWidth - groupWidth >= 1 } return false }, renderScrollable() { this._groupElement.dxScrollable({ useNative: false, useSimulatedScrollbar: false, showScrollbar: "never", bounceEnabled: false, direction: "horizontal", rtlEnabled: isRenovatedScrollable ? this.component.option("rtlEnabled") : false, updateManually: true }) }, updateScrollableOptions(_ref) { let { rtlEnabled: rtlEnabled } = _ref; const scrollable = this._getScrollable(); isRenovatedScrollable && scrollable.option({ rtlEnabled: rtlEnabled }) }, processScrollBarSpacing(scrollBarWidth) { const groupAlignment = this.option("rtlEnabled") ? "right" : "left"; const groupWidth = this.getGroupWidth(); if (groupWidth) { this.setGroupWidth(groupWidth - scrollBarWidth) } if (this._scrollBarWidth) { this._groupElement.next().remove() } this._groupElement.toggleClass("dx-vertical-scroll", scrollBarWidth > 0); (0, _size.setWidth)(this._groupElement.css("float", groupAlignment), this.getGroupHeight()); this._scrollBarWidth = scrollBarWidth }, getScrollPath(offset) { const tableElement = this.tableElement(); let cell; offset -= parseInt(tableElement[0].style.left, 10) || 0; (0, _iterator.each)(tableElement.find("td"), ((_, td) => { if (1 === td.colSpan && td.offsetLeft <= offset && td.offsetWidth + td.offsetLeft > offset) { cell = td; return false } return })); return getCellPath(tableElement, cell) }, _moveFakeTable(scrollPos) { this._moveFakeTableHorizontally(scrollPos); this.callBase() } }); const VerticalHeadersArea = exports.VerticalHeadersArea = HorizontalHeadersArea.inherit({ _getAreaClassName: () => "dx-pivotgrid-vertical-headers", _applyCustomStyles(options) { this.callBase(options); if (options.cellIndex === options.cellsCount - 1) { options.classArray.push("dx-last-cell") } if (options.rowIndex === options.rowsCount - 1) { options.cssArray.push("border-bottom: 0px") } if (options.cell.isWhiteSpace) { options.classArray.push("dx-white-space-column") } }, _getAreaName: () => "row", setVirtualContentParams(params) { this.callBase(params); this._setTableCss({ top: params.top, left: 0 }); this._virtualContentHeight = params.height }, hasScroll() { const tableHeight = this._virtualContent ? this._virtualContentHeight : this._tableHeight; const groupHeight = this.getGroupHeight(); if (groupHeight && tableHeight) { return tableHeight - groupHeight >= 1 } return false }, renderScrollable() { this._groupElement.dxScrollable({ useNative: false, useSimulatedScrollbar: false, showScrollbar: "never", bounceEnabled: false, direction: "vertical", updateManually: true }) }, processScrollBarSpacing(scrollBarWidth) { const groupHeight = this.getGroupHeight(); if (groupHeight) { this.setGroupHeight(groupHeight - scrollBarWidth) } if (this._scrollBarWidth) { this._groupElement.next().remove() } if (scrollBarWidth) { const $div = (0, _renderer.default)("
"); (0, _size.setWidth)($div, "100%"); (0, _size.setHeight)($div, scrollBarWidth - 1); this._groupElement.after($div) } this._scrollBarWidth = scrollBarWidth }, getScrollPath(offset) { const tableElement = this.tableElement(); let cell; offset -= parseInt(tableElement[0].style.top, 10) || 0; (0, _iterator.each)(tableElement.find("tr"), ((_, tr) => { const td = tr.childNodes[tr.childNodes.length - 1]; if (td && 1 === td.rowSpan && td.offsetTop <= offset && td.offsetHeight + td.offsetTop > offset) { cell = td; return false } return })); return getCellPath(tableElement, cell) }, _moveFakeTable(scrollPos) { this._moveFakeTableTop(scrollPos); this.callBase() }, _getRowClassNames(rowIndex, cell, rowClassNames) { if (0 !== rowIndex & cell.expanded && !rowClassNames.includes("dx-expand-border")) { rowClassNames.push("dx-expand-border") } }, _getMainElementMarkup() { const tbody = _dom_adapter.default.createElement("tbody"); tbody.classList.add(this._getAreaClassName()); return tbody }, _getCloseMainElementMarkup: () => "", updateColspans(columnCount) { const { rows: rows } = this.tableElement()[0]; let columnOffset = 0; const columnOffsetResetIndexes = []; if (this.getColumnsCount() - columnCount > 0) { return } for (let i = 0; i < rows.length; i += 1) { for (let j = 0; j < rows[i].cells.length; j += 1) { const cell = rows[i].cells[j]; const { rowSpan: rowSpan } = cell; if (columnOffsetResetIndexes[i]) { columnOffset -= columnOffsetResetIndexes[i]; columnOffsetResetIndexes[i] = 0 } const diff = columnCount - (columnOffset + cell.colSpan); if (j === rows[i].cells.length - 1 && diff > 0) { cell.colSpan += diff } columnOffsetResetIndexes[i + rowSpan] = (columnOffsetResetIndexes[i + rowSpan] || 0) + cell.colSpan; columnOffset += cell.colSpan } } } }); exports.default = { HorizontalHeadersArea: HorizontalHeadersArea, VerticalHeadersArea: VerticalHeadersArea } }, 16564: /*!******************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/local_store/m_local_store.js ***! \******************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.LocalStore = void 0; var _class = _interopRequireDefault(__webpack_require__( /*! ../../../../core/class */ 38377)); var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _data = __webpack_require__( /*! ../../../../core/utils/data */ 47617); var _date_serialization = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date_serialization */ 69434)); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _array_store = _interopRequireDefault(__webpack_require__( /*! ../../../../data/array_store */ 26562)); var _custom_store = _interopRequireDefault(__webpack_require__( /*! ../../../../data/custom_store */ 88036)); var _data_source = __webpack_require__( /*! ../../../../data/data_source/data_source */ 85273); var _query = _interopRequireDefault(__webpack_require__( /*! ../../../../data/query */ 96687)); var _utils = __webpack_require__( /*! ../../../../data/utils */ 16454); var _m_widget_utils = __webpack_require__( /*! ../m_widget_utils */ 28580); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const LocalStore = exports.LocalStore = _class.default.inherit(function() { const DATE_INTERVAL_SELECTORS = { year: date => date && date.getFullYear(), quarter: date => date && Math.floor(date.getMonth() / 3) + 1, month: date => date && date.getMonth() + 1, day: date => date && date.getDate(), dayOfWeek: date => date && date.getDay() }; function getDataSelector(dataField) { return -1 !== dataField.indexOf(".") ? (0, _data.compileGetter)(dataField) : function(data) { return data[dataField] } } function getDateValue(dataSelector) { return function(data) { let value = dataSelector(data); if (value && !(value instanceof Date)) { value = _date_serialization.default.deserializeDate(value) } return value } } function prepareFields(fields) { (0, _iterator.each)(fields || [], ((_, field) => { let fieldSelector; let intervalSelector; const { dataField: dataField } = field; let groupInterval; const { levels: levels } = field; let dataSelector; if (!field.selector) { if (!dataField) { dataSelector = function(data) { return data } } else { dataSelector = getDataSelector(dataField) } if (levels) { prepareFields(levels) } if ("date" === field.dataType) { intervalSelector = DATE_INTERVAL_SELECTORS[field.groupInterval]; const valueSelector = getDateValue(dataSelector); fieldSelector = function(data) { const value = valueSelector(data); return intervalSelector ? intervalSelector(value) : value } } else if ("number" === field.dataType) { groupInterval = (0, _type.isNumeric)(field.groupInterval) && field.groupInterval > 0 && field.groupInterval; fieldSelector = function(data) { let value = dataSelector(data); if ((0, _type.isString)(value)) { value = Number(value) } return groupInterval ? Math.floor(value / groupInterval) * groupInterval : value } } else { fieldSelector = dataSelector }(0, _m_widget_utils.setDefaultFieldValueFormatting)(field); (0, _m_widget_utils.setFieldProperty)(field, "selector", fieldSelector) } })) } const addHierarchyItem = function(value, hierarchyItems, pathHash, childrenHash) { let hierarchyItem = childrenHash[pathHash]; if (!hierarchyItem) { hierarchyItem = { value: value, index: childrenHash.length++ }; childrenHash[pathHash] = hierarchyItem; hierarchyItems.push(hierarchyItem) } return hierarchyItem }; function fillHierarchyItemIndexesCore(indexes, options, children, expandIndex, pathHash) { const dimension = options.dimensions[expandIndex]; const { expandedPathsHash: expandedPathsHash } = options; let dimensionValue; let hierarchyItem; if (dimension) { dimensionValue = dimension.selector(options.data); pathHash = void 0 !== pathHash ? pathHash + "/./" + dimensionValue : `${dimensionValue}`; hierarchyItem = addHierarchyItem(dimensionValue, children, pathHash, options.childrenHash); indexes.push(hierarchyItem.index); if (expandedPathsHash && expandedPathsHash[pathHash] || dimension.expanded) { if (!hierarchyItem.children) { hierarchyItem.children = [] } fillHierarchyItemIndexesCore(indexes, options, hierarchyItem.children, expandIndex + 1, pathHash) } } } function generateHierarchyItems(data, loadOptions, headers, headerName) { const result = [0]; const expandIndex = loadOptions.headerName === headerName ? loadOptions.path.length : 0; const expandedPaths = "rows" === headerName ? loadOptions.rowExpandedPaths : loadOptions.columnExpandedPaths; const options = { data: data, childrenHash: headers[`${headerName}Hash`], dimensions: loadOptions[headerName], expandedPathsHash: loadOptions.headerName !== headerName && expandedPaths && expandedPaths.hash }; fillHierarchyItemIndexesCore(result, options, headers[headerName], expandIndex); return result } function generateAggregationCells(data, cells, headers, options) { const cellSet = []; let x; let y; let rowIndex; let columnIndex; const rowIndexes = generateHierarchyItems(data, options, headers, "rows"); const columnIndexes = generateHierarchyItems(data, options, headers, "columns"); for (y = 0; y < rowIndexes.length; y += 1) { rowIndex = rowIndexes[y]; cells[rowIndex] = cells[rowIndex] || []; for (x = 0; x < columnIndexes.length; x += 1) { columnIndex = columnIndexes[x]; cellSet.push(cells[rowIndex][columnIndex] = cells[rowIndex][columnIndex] || []) } } return cellSet } function fillHashExpandedPath(expandedPaths) { if (expandedPaths) { const hash = expandedPaths.hash = {}; expandedPaths.forEach((path => { const pathValue = path.map((value => `${value}`)).join("/./"); hash[pathValue] = true })) } } function prepareLoadOption(options) { options.rows = options.rows || []; options.columns = options.columns || []; options.filters = options.filters || []; fillHashExpandedPath(options.columnExpandedPaths); fillHashExpandedPath(options.rowExpandedPaths); prepareFields(options.columns); prepareFields(options.rows); prepareFields(options.values); prepareFields(options.filters) } function getAggregator(field) { if ("custom" === field.summaryType) { field.calculateCustomSummary = field.calculateCustomSummary || _common.noop; return { seed() { const options = { summaryProcess: "start", totalValue: void 0 }; field.calculateCustomSummary(options); return options }, step(options, value) { options.summaryProcess = "calculate"; options.value = value; field.calculateCustomSummary(options); return options }, finalize(options) { options.summaryProcess = "finalize"; delete options.value; field.calculateCustomSummary(options); return options.totalValue } } } return _utils.aggregators[field.summaryType] || _utils.aggregators.count } function aggregationStep(measures, aggregationCells, data) { for (let aggregatorIndex = 0; aggregatorIndex < measures.length; aggregatorIndex += 1) { const cellField = measures[aggregatorIndex]; const cellValue = cellField.selector(data); const aggregator = getAggregator(cellField); const isAggregatorSeedFunction = "function" === typeof aggregator.seed; for (let cellSetIndex = 0; cellSetIndex < aggregationCells.length; cellSetIndex += 1) { const cell = aggregationCells[cellSetIndex]; if (cell.length <= aggregatorIndex) { cell[aggregatorIndex] = isAggregatorSeedFunction ? aggregator.seed() : aggregator.seed } if (void 0 === cell[aggregatorIndex]) { cell[aggregatorIndex] = cellValue } else if ((0, _type.isDefined)(cellValue)) { cell[aggregatorIndex] = aggregator.step(cell[aggregatorIndex], cellValue) } } } } function areValuesEqual(filterValue, fieldValue) { let valueOfFilter = filterValue && filterValue.valueOf(); let valueOfField = fieldValue && fieldValue.valueOf(); if (Array.isArray(filterValue)) { fieldValue = fieldValue || []; for (let i = 0; i < filterValue.length; i += 1) { valueOfFilter = filterValue[i] && filterValue[i].valueOf(); valueOfField = fieldValue[i] && fieldValue[i].valueOf(); if (valueOfFilter !== valueOfField) { return false } } return true } return valueOfFilter === valueOfField } function createDimensionFilters(dimension) { const filters = []; (0, _iterator.each)(dimension, ((_, field) => { const filterValues = field.filterValues || []; const { groupName: groupName } = field; if (groupName && (0, _type.isNumeric)(field.groupIndex)) { return } filterValues.length && filters.push((function(dataItem) { const value = field.levels ? function(levels, data) { const value = []; (0, _iterator.each)(levels, ((_, field) => { value.push(field.selector(data)) })); return value }(field.levels, dataItem) : field.selector(dataItem); let result = false; for (let i = 0; i < filterValues.length; i += 1) { if (areValuesEqual(filterValues[i], value)) { result = true; break } } return "exclude" === field.filterType ? !result : result })) })); return filters } function createFilter(options) { const filters = createDimensionFilters(options.rows).concat(createDimensionFilters(options.columns)).concat(createDimensionFilters(options.filters)); const expandedDimensions = options[options.headerName]; const { path: path } = options; if (expandedDimensions) { filters.push((dataItem => { let expandValue; for (let i = 0; i < path.length; i += 1) { expandValue = expandedDimensions[i].selector(dataItem); if ((0, _data.toComparable)(expandValue, true) !== (0, _data.toComparable)(path[i], true)) { return false } } return true })) } return function(dataItem) { for (let i = 0; i < filters.length; i += 1) { if (!filters[i](dataItem)) { return false } } return true } } function loadCore(items, options, notifyProgress) { const headers = { columns: [], rows: [], columnsHash: { length: 1 }, rowsHash: { length: 1 } }; const values = []; let aggregationCells; let data; const d = new _deferred.Deferred; let i = 0; const filter = createFilter(options); ! function processData() { const t = new Date; const startIndex = i; for (; i < items.length; i += 1) { if (i > startIndex && i % 1e4 === 0) { if (new Date - t >= 300) { notifyProgress(i / items.length); setTimeout(processData, 0); return } } data = items[i]; if (filter(data)) { aggregationCells = generateAggregationCells(data, values, headers, options); aggregationStep(options.values, aggregationCells, data) } } measures = options.values, cells = values, void(0, _iterator.each)(measures, ((aggregatorIndex, cellField) => { const aggregator = getAggregator(cellField); if (aggregator.finalize) { (0, _iterator.each)(cells, ((_, row) => { (0, _iterator.each)(row, ((_, cell) => { if (cell && void 0 !== cell[aggregatorIndex]) { cell[aggregatorIndex] = aggregator.finalize(cell[aggregatorIndex]) } })) })) } })); var measures, cells; notifyProgress(1); d.resolve({ rows: headers.rows, columns: headers.columns, values: values, grandTotalRowIndex: 0, grandTotalColumnIndex: 0 }) }(); return d } function filterDataSource(dataSource, fieldSelectors) { let filter = dataSource.filter(); if (dataSource.store() instanceof _custom_store.default && filter) { filter = processFilter(filter, fieldSelectors); return (0, _query.default)(dataSource.items()).filter(filter).toArray() } return dataSource.items() } function loadDataSource(dataSource, fieldSelectors, reload) { const d = new _deferred.Deferred; const customizeStoreLoadOptionsHandler = function(options) { if (dataSource.store() instanceof _array_store.default) { options.storeLoadOptions.filter = processFilter(options.storeLoadOptions.filter, fieldSelectors) } }; dataSource.on("customizeStoreLoadOptions", customizeStoreLoadOptionsHandler); if (!dataSource.isLoaded() || reload) { const loadDeferred = reload ? dataSource.load() : dataSource.reload(); (0, _deferred.when)(loadDeferred).done((() => { loadDataSource(dataSource, fieldSelectors).done((() => { d.resolve(filterDataSource(dataSource, fieldSelectors)) })).fail(d.reject) })).fail(d.reject) } else { d.resolve(filterDataSource(dataSource, fieldSelectors)) } return d.always((() => { dataSource.off("customizeStoreLoadOptions", customizeStoreLoadOptionsHandler) })) } function fillSelectorsByFields(selectors, fields) { fields.forEach((field => { if (field.dataField && "date" === field.dataType) { const valueSelector = getDateValue(getDataSelector(field.dataField)); selectors[field.dataField] = function(data) { return valueSelector(data) } } })) } function getFieldSelectors(options) { const selectors = {}; if (Array.isArray(options)) { fillSelectorsByFields(selectors, options) } else if (options) { ["rows", "columns", "filters"].forEach((area => { options[area] && fillSelectorsByFields(selectors, options[area]) })) } return selectors } function processFilter(filter, fieldSelectors) { if (!Array.isArray(filter)) { return filter } filter = filter.slice(0); if ((0, _type.isString)(filter[0]) && (filter[1] instanceof Date || filter[2] instanceof Date)) { filter[0] = fieldSelectors[filter[0]] } for (let i = 0; i < filter.length; i += 1) { filter[i] = processFilter(filter[i], fieldSelectors) } return filter } return { ctor(options) { this._progressChanged = options.onProgressChanged || _common.noop; this._dataSource = new _data_source.DataSource(options); this._dataSource.paginate(false) }, getFields(fields) { const dataSource = this._dataSource; const d = new _deferred.Deferred; loadDataSource(dataSource, getFieldSelectors(fields)).done((data => { d.resolve((0, _m_widget_utils.discoverObjectFields)(data, fields)) })).fail(d.reject); return d }, key() { return this._dataSource.key() }, load(options) { const that = this; const dataSource = that._dataSource; const d = new _deferred.Deferred; prepareLoadOption(options); loadDataSource(dataSource, getFieldSelectors(options), options.reload).done((data => { (0, _deferred.when)(loadCore(data, options, that._progressChanged)).done(d.resolve) })).fail(d.reject); return d }, filter() { const dataSource = this._dataSource; return dataSource.filter.apply(dataSource, arguments) }, supportPaging: () => false, getDrillDownItems(loadOptions, params) { loadOptions = loadOptions || {}; params = params || {}; prepareLoadOption(loadOptions); const drillDownItems = []; const items = this._dataSource.items(); let item; const { maxRowCount: maxRowCount } = params; const { customColumns: customColumns } = params; const filter = createFilter(loadOptions); const pathFilter = createFilter({ rows: (0, _m_widget_utils.getFiltersByPath)(loadOptions.rows, params.rowPath), columns: (0, _m_widget_utils.getFiltersByPath)(loadOptions.columns, params.columnPath), filters: [] }); for (let i = 0; i < items.length; i += 1) { if (pathFilter(items[i]) && filter(items[i])) { if (customColumns) { item = {}; for (let j = 0; j < customColumns.length; j += 1) { item[customColumns[j]] = items[i][customColumns[j]] } } else { item = items[i] } drillDownItems.push(item) } if (maxRowCount > 0 && drillDownItems.length === maxRowCount) { break } } return drillDownItems } } }()).include(_m_widget_utils.storeDrillDownMixin); exports.default = { LocalStore: LocalStore } }, 61550: /*!*************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/m_widget.js ***! \*************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.PivotGrid = void 0; var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 99393)); var _element = __webpack_require__( /*! ../../../core/element */ 6415); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374)); var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576); var _deferred = __webpack_require__( /*! ../../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 95479); var _size = __webpack_require__( /*! ../../../core/utils/size */ 58664); var _string = __webpack_require__( /*! ../../../core/utils/string */ 68752); var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922); var _window = __webpack_require__( /*! ../../../core/utils/window */ 58201); var _click = __webpack_require__( /*! ../../../events/click */ 95429); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../events/core/events_engine */ 55994)); var _index = __webpack_require__( /*! ../../../events/utils/index */ 39611); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../localization/message */ 28109)); var _button = _interopRequireDefault(__webpack_require__( /*! ../../../ui/button */ 63008)); var _context_menu = _interopRequireDefault(__webpack_require__( /*! ../../../ui/context_menu */ 10042)); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../ui/popup/ui.popup */ 51495)); var _themes = __webpack_require__( /*! ../../../ui/themes */ 75811); var _ui2 = _interopRequireDefault(__webpack_require__( /*! ../../../ui/widget/ui.widget */ 14390)); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../../grids/grid_core/m_utils */ 60082)); var _m_chart_integration = __webpack_require__( /*! ./chart_integration/m_chart_integration */ 85654); var _m_data_area = _interopRequireDefault(__webpack_require__( /*! ./data_area/m_data_area */ 64318)); var _m_data_controller = _interopRequireDefault(__webpack_require__( /*! ./data_controller/m_data_controller */ 9517)); var _m_export = __webpack_require__( /*! ./export/m_export */ 75705); var _m_field_chooser = __webpack_require__( /*! ./field_chooser/m_field_chooser */ 12086); var _m_field_chooser_base = __webpack_require__( /*! ./field_chooser/m_field_chooser_base */ 16491); var _m_fields_area = __webpack_require__( /*! ./fields_area/m_fields_area */ 70513); var _m_headers_area = _interopRequireDefault(__webpack_require__( /*! ./headers_area/m_headers_area */ 95578)); var _m_widget_utils = __webpack_require__( /*! ./m_widget_utils */ 28580); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const window = (0, _window.getWindow)(); const TR = "
"; const TD = "
").append(fieldChooserBase.renderField(field, "row" === field.area)); const indicators = td.find(".dx-column-indicators"); if (indicators.length && that._shouldCreateButton()) { indicators.insertAfter(indicators.next()) } td.appendTo(row); ! function(field, nextField, prevField, $container) { if (prevField && prevField.groupName && prevField.groupName === field.groupName) { (0, _renderer.default)(DIV).addClass("dx-group-connector").addClass("dx-group-connector-prev").appendTo($container) } if (nextField && nextField.groupName && nextField.groupName === field.groupName) { (0, _renderer.default)(DIV).addClass("dx-group-connector").addClass("dx-group-connector-next").appendTo($container) } }(field, data[index + 1], data[index - 1], td) } })); if (!row.children().length) { (0, _renderer.default)("").append((0, _renderer.default)(DIV).addClass("dx-empty-area-text").text(this.option(`fieldPanel.texts.${area}FieldArea`))).appendTo(row) } if (that._shouldCreateButton()) { that._renderButton(head); that._renderPopup(tableElement, row) } else { head.append(row) } }, setGroupWidth(value) { (0, _style.setWidth)(this.groupElement(), value) }, setGroupHeight(value) { (0, _style.setHeight)(this.groupElement(), value) }, reset() { this.callBase(); this.groupElement().css("marginTop", 0) }, _renderVirtualContent: _common.noop }); exports.default = { FieldsArea: FieldsArea } }, 95578: /*!********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/headers_area/m_headers_area.js ***! \********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.VerticalHeadersArea = exports.HorizontalHeadersArea = void 0; var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../../core/dom_adapter */ 73349)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _size = __webpack_require__( /*! ../../../../core/utils/size */ 58664); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/scroll_view/ui.scrollable */ 41183)); var _m_area_item = __webpack_require__( /*! ../area_item/m_area_item */ 74305); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const isRenovatedScrollable = !!_ui.default.IS_RENOVATED_WIDGET; function getCellPath(tableElement, cell) { if (cell) { const { data: data } = tableElement.data(); const { rowIndex: rowIndex } = cell.parentNode; const { cellIndex: cellIndex } = cell; return data[rowIndex] && data[rowIndex][cellIndex] && data[rowIndex][cellIndex].path } return } const HorizontalHeadersArea = exports.HorizontalHeadersArea = _m_area_item.AreaItem.inherit({ ctor(component) { this.callBase(component); this._scrollBarWidth = 0 }, _getAreaName: () => "column", _getAreaClassName: () => "dx-pivotgrid-horizontal-headers", _createGroupElement() { return (0, _renderer.default)("
").addClass(this._getAreaClassName()).addClass("dx-pivotgrid-area") }, _applyCustomStyles(options) { const { cssArray: cssArray } = options; const { cell: cell } = options; const { rowsCount: rowsCount } = options; const { classArray: classArray } = options; if (options.cellIndex === options.cellsCount - 1) { cssArray.push((options.rtlEnabled ? "border-left:" : "border-right:") + "0px") } if (cell.rowspan === rowsCount - options.rowIndex || options.rowIndex + 1 === rowsCount) { cssArray.push("border-bottom-width:0px") } if ("T" === cell.type || "GT" === cell.type) { classArray.push("dx-row-total") } if ("T" === options.cell.type) { classArray.push("dx-total") } if ("GT" === options.cell.type) { classArray.push("dx-grandtotal") } if ((0, _type.isDefined)(cell.expanded)) { classArray.push(cell.expanded ? "dx-pivotgrid-expanded" : "dx-pivotgrid-collapsed") } this.callBase(options) }, _getMainElementMarkup() { const thead = _dom_adapter.default.createElement("thead"); thead.setAttribute("class", this._getAreaClassName()); return thead }, _getCloseMainElementMarkup: () => "
"; const DIV = "
"; const FIELD_CALCULATED_OPTIONS = ["allowSorting", "allowSortingBySummary", "allowFiltering", "allowExpandAll"]; function getArraySum(array) { let sum = 0; (0, _iterator.each)(array, ((_, value) => { sum += value || 0 })); return sum } function adjustSizeArray(sizeArray, space) { const delta = space / sizeArray.length; for (let i = 0; i < sizeArray.length; i += 1) { sizeArray[i] -= delta } } function unsubscribeScrollEvents(area) { area.off("scroll").off("stop") } function getCommonBorderWidth(elements, direction) { const borderStyleNames = "width" === direction ? ["borderLeftWidth", "borderRightWidth"] : ["borderTopWidth", "borderBottomWidth"]; let width = 0; (0, _iterator.each)(elements, ((_, elem) => { const computedStyle = window.getComputedStyle(elem.get(0)); borderStyleNames.forEach((borderStyleName => { width += parseFloat(computedStyle[borderStyleName]) || 0 })) })); return width } const PivotGrid = exports.PivotGrid = _ui2.default.inherit({ _getDefaultOptions() { return (0, _extend.extend)(this.callBase(), { scrolling: { timeout: 300, renderingThreshold: 150, minTimeout: 10, mode: "standard", useNative: "auto", removeInvisiblePages: true, virtualRowHeight: 50, virtualColumnWidth: 100, loadTwoPagesOnStart: true }, encodeHtml: true, dataSource: null, activeStateEnabled: false, fieldChooser: { minWidth: 250, minHeight: 250, enabled: true, allowSearch: false, searchTimeout: 500, layout: 0, title: _message.default.format("dxPivotGrid-fieldChooserTitle"), width: 600, height: 600, applyChangesMode: "instantly" }, onContextMenuPreparing: null, allowSorting: false, allowSortingBySummary: false, allowFiltering: false, allowExpandAll: false, wordWrapEnabled: true, fieldPanel: { showColumnFields: true, showFilterFields: true, showDataFields: true, showRowFields: true, allowFieldDragging: true, visible: false, texts: { columnFieldArea: _message.default.format("dxPivotGrid-columnFieldArea"), rowFieldArea: _message.default.format("dxPivotGrid-rowFieldArea"), filterFieldArea: _message.default.format("dxPivotGrid-filterFieldArea"), dataFieldArea: _message.default.format("dxPivotGrid-dataFieldArea") } }, dataFieldArea: "column", export: { enabled: false, fileName: "PivotGrid" }, showRowTotals: true, showRowGrandTotals: true, showColumnTotals: true, showColumnGrandTotals: true, hideEmptySummaryCells: true, showTotalsPrior: "none", rowHeaderLayout: "standard", loadPanel: { enabled: true, text: _message.default.format("Loading"), width: 200, height: 70, showIndicator: true, indicatorSrc: "", showPane: true }, texts: { grandTotal: _message.default.format("dxPivotGrid-grandTotal"), total: _message.default.getFormatter("dxPivotGrid-total"), noData: _message.default.format("dxDataGrid-noDataText"), showFieldChooser: _message.default.format("dxPivotGrid-showFieldChooser"), expandAll: _message.default.format("dxPivotGrid-expandAll"), collapseAll: _message.default.format("dxPivotGrid-collapseAll"), sortColumnBySummary: _message.default.getFormatter("dxPivotGrid-sortColumnBySummary"), sortRowBySummary: _message.default.getFormatter("dxPivotGrid-sortRowBySummary"), removeAllSorting: _message.default.format("dxPivotGrid-removeAllSorting"), exportToExcel: _message.default.format("dxDataGrid-exportToExcel"), dataNotAvailable: _message.default.format("dxPivotGrid-dataNotAvailable") }, onCellClick: null, onCellPrepared: null, showBorders: false, stateStoring: { enabled: false, storageKey: null, type: "localStorage", customLoad: null, customSave: null, savingTimeout: 2e3 }, onExpandValueChanging: null, renderCellCountLimit: 2e4, onExporting: null, headerFilter: { width: 252, height: 325, allowSelectAll: true, showRelevantValues: false, search: { enabled: false, timeout: 500, editorOptions: {}, mode: "contains" }, texts: { emptyValue: _message.default.format("dxDataGrid-headerFilterEmptyValue"), ok: _message.default.format("dxDataGrid-headerFilterOK"), cancel: _message.default.format("dxDataGrid-headerFilterCancel") } } }) }, _updateCalculatedOptions(fields) { const that = this; (0, _iterator.each)(fields, ((_, field) => { (0, _iterator.each)(FIELD_CALCULATED_OPTIONS, ((_, optionName) => { const isCalculated = field._initProperties && optionName in field._initProperties && void 0 === field._initProperties[optionName]; const needUpdate = void 0 === field[optionName] || isCalculated; if (needUpdate) { (0, _m_widget_utils.setFieldProperty)(field, optionName, that.option(optionName)) } })) })) }, _getDataControllerOptions() { const that = this; return { component: that, dataSource: that.option("dataSource"), texts: that.option("texts"), showRowTotals: that.option("showRowTotals"), showRowGrandTotals: that.option("showRowGrandTotals"), showColumnTotals: that.option("showColumnTotals"), showTotalsPrior: that.option("showTotalsPrior"), showColumnGrandTotals: that.option("showColumnGrandTotals"), dataFieldArea: that.option("dataFieldArea"), rowHeaderLayout: that.option("rowHeaderLayout"), hideEmptySummaryCells: that.option("hideEmptySummaryCells"), onFieldsPrepared(fields) { that._updateCalculatedOptions(fields) } } }, _initDataController() { const that = this; that._dataController && that._dataController.dispose(); that._dataController = new _m_data_controller.default.DataController(that._getDataControllerOptions()); if ((0, _window.hasWindow)()) { that._dataController.changed.add((() => { that._render() })) } that._dataController.scrollChanged.add((options => { that._scrollLeft = options.left; that._scrollTop = options.top })); that._dataController.loadingChanged.add((() => { that._updateLoading() })); that._dataController.progressChanged.add(that._updateLoading.bind(that)); that._dataController.dataSourceChanged.add((() => { that._trigger("onChanged") })); const expandValueChanging = that.option("onExpandValueChanging"); if (expandValueChanging) { that._dataController.expandValueChanging.add((e => { expandValueChanging(e) })) } }, _init() { this.callBase(); this._initDataController(); _m_utils.default.logHeaderFilterDeprecatedWarningIfNeed(this); this._scrollLeft = this._scrollTop = null; this._initActions() }, _initActions() { this._actions = { onChanged: this._createActionByOption("onChanged"), onContextMenuPreparing: this._createActionByOption("onContextMenuPreparing"), onCellClick: this._createActionByOption("onCellClick"), onExporting: this._createActionByOption("onExporting"), onCellPrepared: this._createActionByOption("onCellPrepared") } }, _trigger(eventName, eventArg) { this._actions[eventName](eventArg) }, _optionChanged(args) { const that = this; if (FIELD_CALCULATED_OPTIONS.includes(args.name)) { const fields = this.getDataSource().fields(); this._updateCalculatedOptions(fields) } switch (args.name) { case "dataSource": case "allowSorting": case "allowFiltering": case "allowExpandAll": case "allowSortingBySummary": case "scrolling": case "stateStoring": that._initDataController(); that._fieldChooserPopup.hide(); that._renderFieldChooser(); that._invalidate(); break; case "texts": case "showTotalsPrior": case "showRowTotals": case "showRowGrandTotals": case "showColumnTotals": case "showColumnGrandTotals": case "hideEmptySummaryCells": case "dataFieldArea": that._dataController.updateViewOptions(that._getDataControllerOptions()); break; case "useNativeScrolling": case "encodeHtml": case "renderCellCountLimit": case "onExpandValueChanging": break; case "rtlEnabled": that.callBase(args); that._renderFieldChooser(); that._renderContextMenu(); (0, _window.hasWindow)() && that._renderLoadPanel(that._dataArea.groupElement(), that.$element()); that._invalidate(); break; case "export": that._renderDescriptionArea(); break; case "onCellClick": case "onContextMenuPreparing": case "onExporting": case "onExported": case "onFileSaving": case "onCellPrepared": that._actions[args.name] = that._createActionByOption(args.name); break; case "fieldChooser": that._renderFieldChooser(); that._renderDescriptionArea(); break; case "loadPanel": if ((0, _window.hasWindow)()) { if ("loadPanel.enabled" === args.fullName) { clearTimeout(this._hideLoadingTimeoutID); that._renderLoadPanel(that._dataArea.groupElement(), that.$element()) } else { that._renderLoadPanel(that._dataArea.groupElement(), that.$element()); that._invalidate() } } break; case "fieldPanel": that._renderDescriptionArea(); that._invalidate(); break; case "headerFilter": that._renderFieldChooser(); that._invalidate(); break; case "showBorders": that._tableElement().toggleClass("dx-pivotgrid-border", !!args.value); that.updateDimensions(); break; case "wordWrapEnabled": that._tableElement().toggleClass("dx-word-wrap", !!args.value); that.updateDimensions(); break; case "rowHeaderLayout": that._tableElement().find(".dx-area-row-cell").toggleClass("dx-area-tree-view", "tree" === args.value); that._dataController.updateViewOptions(that._getDataControllerOptions()); break; case "height": case "width": that._hasHeight = null; that.callBase(args); that.resize(); break; default: that.callBase(args) } }, _updateScrollPosition(columnsArea, rowsArea, dataArea) { let force = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : false; const that = this; let scrollTop; let scrollLeft; const scrolled = that._scrollTop || that._scrollLeft; if (that._scrollUpdating) { return } that._scrollUpdating = true; if (rowsArea && !rowsArea.hasScroll() && that._hasHeight) { that._scrollTop = null } if (columnsArea && !columnsArea.hasScroll()) { that._scrollLeft = null } if (null !== that._scrollTop || null !== that._scrollLeft || scrolled || that.option("rtlEnabled")) { scrollTop = that._scrollTop || 0; scrollLeft = that._scrollLeft || 0; dataArea.scrollTo({ left: scrollLeft, top: scrollTop }, force); columnsArea.scrollTo({ left: scrollLeft }, force); rowsArea.scrollTo({ top: scrollTop }, force); that._dataController.updateWindowScrollPosition(that._scrollTop) } that._scrollUpdating = false }, _subscribeToEvents(columnsArea, rowsArea, dataArea) { const that = this; (0, _iterator.each)([columnsArea, rowsArea, dataArea], ((_, area) => { ! function(area, handler) { unsubscribeScrollEvents(area); area.on("scroll", handler).on("stop", handler) }(area, (e => function(e, area) { const { scrollOffset: scrollOffset } = e; const scrollable = area._getScrollable(); const leftOffset = "vertical" !== scrollable.option("direction") ? scrollOffset.left : that._scrollLeft; const topOffset = "horizontal" !== scrollable.option("direction") && that._hasHeight ? scrollOffset.top : that._scrollTop; if ((that._scrollLeft || 0) !== (leftOffset || 0) || (that._scrollTop || 0) !== (topOffset || 0)) { that._scrollLeft = leftOffset; that._scrollTop = topOffset; that._updateScrollPosition(columnsArea, rowsArea, dataArea); if ("virtual" === that.option("scrolling.mode")) { that._dataController.setViewportPosition(that._scrollLeft, that._scrollTop) } } }(e, area))) })); !that._hasHeight && that._dataController.subscribeToWindowScrollEvents(dataArea.groupElement()) }, _clean: _common.noop, _needDelayResizing(cellsInfo) { const cellsCount = cellsInfo.length * (cellsInfo.length ? cellsInfo[0].length : 0); return cellsCount > this.option("renderCellCountLimit") }, _renderFieldChooser() { const that = this; const container = that._pivotGridContainer; const fieldChooserOptions = that.option("fieldChooser") || {}; const toolbarItems = "onDemand" === fieldChooserOptions.applyChangesMode ? [{ toolbar: "bottom", location: "after", widget: "dxButton", options: { text: _message.default.format("OK"), onClick() { that._fieldChooserPopup.$content().dxPivotGridFieldChooser("applyChanges"); that._fieldChooserPopup.hide() } } }, { toolbar: "bottom", location: "after", widget: "dxButton", options: { text: _message.default.format("Cancel"), onClick() { that._fieldChooserPopup.hide() } } }] : []; const fieldChooserComponentOptions = { layout: fieldChooserOptions.layout, texts: fieldChooserOptions.texts || {}, dataSource: that.getDataSource(), allowSearch: fieldChooserOptions.allowSearch, searchTimeout: fieldChooserOptions.searchTimeout, width: void 0, height: void 0, headerFilter: that.option("headerFilter"), encodeHtml: that.option("fieldChooser.encodeHtml") ?? that.option("encodeHtml"), applyChangesMode: fieldChooserOptions.applyChangesMode, onContextMenuPreparing(e) { that._trigger("onContextMenuPreparing", e) } }; const popupOptions = { shading: false, title: fieldChooserOptions.title, width: fieldChooserOptions.width, height: fieldChooserOptions.height, showCloseButton: true, resizeEnabled: true, minWidth: fieldChooserOptions.minWidth, minHeight: fieldChooserOptions.minHeight, toolbarItems: toolbarItems, onResize(e) { e.component.$content().dxPivotGridFieldChooser("updateDimensions") }, onShown(e) { that._createComponent(e.component.content(), _m_field_chooser.FieldChooser, fieldChooserComponentOptions) }, onHidden(e) { const fieldChooser = e.component.$content().dxPivotGridFieldChooser("instance"); fieldChooser.resetTreeView(); fieldChooser.cancelChanges() } }; if (that._fieldChooserPopup) { that._fieldChooserPopup.option(popupOptions); that._fieldChooserPopup.$content().dxPivotGridFieldChooser(fieldChooserComponentOptions) } else { that._fieldChooserPopup = that._createComponent((0, _renderer.default)(DIV).addClass("dx-fieldchooser-popup").appendTo(container), _ui.default, popupOptions) } }, _renderContextMenu() { const that = this; const $container = that._pivotGridContainer; if (that._contextMenu) { that._contextMenu.$element().remove() } that._contextMenu = that._createComponent((0, _renderer.default)(DIV).appendTo($container), _context_menu.default, { onPositioning(actionArgs) { const { event: event } = actionArgs; actionArgs.cancel = true; if (!event) { return } const targetElement = event.target.cellIndex >= 0 ? event.target : (0, _renderer.default)(event.target).closest("td").get(0); if (!targetElement) { return } const args = that._createEventArgs(targetElement, event); const items = that._getContextMenuItems(args); if (items) { actionArgs.component.option("items", items); actionArgs.cancel = false } }, onItemClick(params) { params.itemData.onItemClick && params.itemData.onItemClick(params) }, cssClass: "dx-pivotgrid", target: that.$element() }) }, _getContextMenuItems(e) { const that = this; let items = []; const texts = that.option("texts"); if ("row" === e.area || "column" === e.area) { const areaFields = e[`${e.area}Fields`]; const oppositeAreaFields = e["column" === e.area ? "rowFields" : "columnFields"]; const field = e.cell.path && areaFields[e.cell.path.length - 1]; const dataSource = that.getDataSource(); if (field && field.allowExpandAll && e.cell.path.length < e[`${e.area}Fields`].length && !dataSource.paginate()) { items.push({ beginGroup: true, icon: "none", text: texts.expandAll, onItemClick() { dataSource.expandAll(field.index) } }); items.push({ text: texts.collapseAll, icon: "none", onItemClick() { dataSource.collapseAll(field.index) } }) } if (e.cell.isLast && !dataSource.paginate()) { let sortingBySummaryItemCount = 0; (0, _iterator.each)(oppositeAreaFields, ((_, field) => { if (!field.allowSortingBySummary) { return }(0, _iterator.each)(e.dataFields, ((dataIndex, dataField) => { if ((0, _type.isDefined)(e.cell.dataIndex) && e.cell.dataIndex !== dataIndex) { return } const showDataFieldCaption = !(0, _type.isDefined)(e.cell.dataIndex) && e.dataFields.length > 1; const textFormat = "column" === e.area ? texts.sortColumnBySummary : texts.sortRowBySummary; const checked = (0, _m_widget_utils.findField)(e.dataFields, field.sortBySummaryField) === dataIndex && (e.cell.path || []).join("/") === (field.sortBySummaryPath || []).join("/"); const text = (0, _string.format)(textFormat, showDataFieldCaption ? `${field.caption} - ${dataField.caption}` : field.caption); items.push({ beginGroup: 0 === sortingBySummaryItemCount, icon: checked ? "desc" === field.sortOrder ? "sortdowntext" : "sortuptext" : "none", text: text, onItemClick() { dataSource.field(field.index, { sortBySummaryField: dataField.name || dataField.caption || dataField.dataField, sortBySummaryPath: e.cell.path, sortOrder: "desc" === field.sortOrder ? "asc" : "desc" }); dataSource.load() } }); sortingBySummaryItemCount += 1 })) })); (0, _iterator.each)(oppositeAreaFields, ((_, field) => { if (!field.allowSortingBySummary || !(0, _type.isDefined)(field.sortBySummaryField)) { return } items.push({ beginGroup: 0 === sortingBySummaryItemCount, icon: "none", text: texts.removeAllSorting, onItemClick() { (0, _iterator.each)(oppositeAreaFields, ((_, field) => { dataSource.field(field.index, { sortBySummaryField: void 0, sortBySummaryPath: void 0, sortOrder: void 0 }) })); dataSource.load() } }); return false })) } } if (that.option("fieldChooser.enabled")) { items.push({ beginGroup: true, icon: "columnchooser", text: texts.showFieldChooser, onItemClick() { that._fieldChooserPopup.show() } }) } if (that.option("export.enabled")) { items.push({ beginGroup: true, icon: "xlsxfile", text: texts.exportToExcel, onItemClick() { that.exportTo() } }) } e.items = items; that._trigger("onContextMenuPreparing", e); items = e.items; if (items && items.length) { return items } return }, _createEventArgs(targetElement, dxEvent) { const that = this; const dataSource = that.getDataSource(); const args = { rowFields: dataSource.getAreaFields("row"), columnFields: dataSource.getAreaFields("column"), dataFields: dataSource.getAreaFields("data"), event: dxEvent }; if ($targetElement = (0, _renderer.default)(targetElement), $targetElement.closest(".dx-area-fields").length || $targetElement.find(".dx-area-fields").length) { return (0, _extend.extend)(that._createFieldArgs(targetElement), args) } var $targetElement; return (0, _extend.extend)(that._createCellArgs(targetElement), args) }, _createFieldArgs(targetElement) { const field = (0, _renderer.default)(targetElement).children().data("field"); const args = { field: field }; return (0, _type.isDefined)(field) ? args : {} }, _createCellArgs(cellElement) { const $cellElement = (0, _renderer.default)(cellElement); const columnIndex = cellElement.cellIndex; const { rowIndex: rowIndex } = cellElement.parentElement; const $table = $cellElement.closest("table"); const data = $table.data("data"); const cell = data && data[rowIndex] && data[rowIndex][columnIndex]; const args = { area: $table.data("area"), rowIndex: rowIndex, columnIndex: columnIndex, cellElement: (0, _element.getPublicElement)($cellElement), cell: cell }; return args }, _handleCellClick(e) { const that = this; const args = that._createEventArgs(e.currentTarget, e); const { cell: cell } = args; if (!cell || !args.area && (args.rowIndex || args.columnIndex)) { return } that._trigger("onCellClick", args); cell && !args.cancel && (0, _type.isDefined)(cell.expanded) && setTimeout((() => { that._dataController[cell.expanded ? "collapseHeaderItem" : "expandHeaderItem"](args.area, cell.path) })) }, _getNoDataText() { return this.option("texts.noData") }, _renderNoDataText: _m_utils.default.renderNoDataText, _renderLoadPanel: _m_utils.default.renderLoadPanel, _updateLoading(progress) { const that = this; const isLoading = that._dataController.isLoading(); if (!that._loadPanel) { return } const loadPanelVisible = that._loadPanel.option("visible"); if (!loadPanelVisible) { that._startLoadingTime = new Date } if (isLoading) { if (progress) { if (new Date - that._startLoadingTime >= 1e3) { that._loadPanel.option("message", `${Math.floor(100*progress)}%`) } } else { that._loadPanel.option("message", that.option("loadPanel.text")) } } clearTimeout(that._hideLoadingTimeoutID); if (loadPanelVisible && !isLoading) { that._hideLoadingTimeoutID = setTimeout((() => { that._loadPanel.option("visible", false); that.$element().removeClass("dx-overflow-hidden") })) } else { const visibilityOptions = { visible: isLoading }; if (isLoading) { visibilityOptions.position = _m_utils.default.calculateLoadPanelPosition(that._dataArea.groupElement()) } that._loadPanel.option(visibilityOptions); that.$element().toggleClass("dx-overflow-hidden", !isLoading) } }, _renderDescriptionArea() { const $element = this.$element(); const $descriptionCell = $element.find(".dx-area-description-cell"); const $toolbarContainer = (0, _renderer.default)(DIV).addClass("dx-pivotgrid-toolbar"); const fieldPanel = this.option("fieldPanel"); const $filterHeader = $element.find(".dx-filter-header"); const $columnHeader = $element.find(".dx-column-header"); let $targetContainer; if (fieldPanel.visible && fieldPanel.showFilterFields) { $targetContainer = $filterHeader } else if (fieldPanel.visible && (fieldPanel.showDataFields || fieldPanel.showColumnFields)) { $targetContainer = $columnHeader } else { $targetContainer = $descriptionCell } $columnHeader.toggleClass("dx-bottom-border", !!(fieldPanel.visible && (fieldPanel.showDataFields || fieldPanel.showColumnFields))); $filterHeader.toggleClass("dx-bottom-border", !!(fieldPanel.visible && fieldPanel.showFilterFields)); $descriptionCell.toggleClass("dx-pivotgrid-background", fieldPanel.visible && (fieldPanel.showDataFields || fieldPanel.showColumnFields || fieldPanel.showRowFields)); this.$element().find(".dx-pivotgrid-toolbar").remove(); $toolbarContainer.prependTo($targetContainer); const stylingMode = (0, _themes.isFluent)((0, _themes.current)()) ? "text" : "contained"; if (this.option("fieldChooser.enabled")) { const $buttonElement = (0, _renderer.default)(DIV).appendTo($toolbarContainer).addClass("dx-pivotgrid-field-chooser-button"); const buttonOptions = { icon: "columnchooser", hint: this.option("texts.showFieldChooser"), stylingMode: stylingMode, onClick: () => { this.getFieldChooserPopup().show() } }; this._createComponent($buttonElement, _button.default, buttonOptions) } if (this.option("export.enabled")) { const $buttonElement = (0, _renderer.default)(DIV).appendTo($toolbarContainer).addClass("dx-pivotgrid-export-button"); const buttonOptions = { icon: "xlsxfile", hint: this.option("texts.exportToExcel"), stylingMode: stylingMode, onClick: () => { this.exportTo() } }; this._createComponent($buttonElement, _button.default, buttonOptions) } }, _detectHasContainerHeight() { const that = this; const element = that.$element(); if ((0, _type.isDefined)(that._hasHeight)) { const height = that.option("height") || that.$element().get(0).style.height; if (height && that._hasHeight ^ "auto" !== height) { that._hasHeight = null } } if ((0, _type.isDefined)(that._hasHeight) || element.is(":hidden")) { return } that._pivotGridContainer.addClass("dx-hidden"); const testElement = (0, _renderer.default)(DIV); (0, _size.setHeight)(testElement, 66666); element.append(testElement); that._hasHeight = 66666 !== (0, _size.getHeight)(element); that._pivotGridContainer.removeClass("dx-hidden"); testElement.remove() }, _renderHeaders(rowHeaderContainer, columnHeaderContainer, filterHeaderContainer, dataHeaderContainer) { const dataSource = this.getDataSource(); this._rowFields = this._rowFields || new _m_fields_area.FieldsArea(this, "row"); this._rowFields.render(rowHeaderContainer, dataSource.getAreaFields("row")); this._columnFields = this._columnFields || new _m_fields_area.FieldsArea(this, "column"); this._columnFields.render(columnHeaderContainer, dataSource.getAreaFields("column")); this._filterFields = this._filterFields || new _m_fields_area.FieldsArea(this, "filter"); this._filterFields.render(filterHeaderContainer, dataSource.getAreaFields("filter")); this._dataFields = this._dataFields || new _m_fields_area.FieldsArea(this, "data"); this._dataFields.render(dataHeaderContainer, dataSource.getAreaFields("data")); this.$element().dxPivotGridFieldChooserBase("instance").renderSortable() }, _createTableElement() { const $table = (0, _renderer.default)("").css({ width: "100%" }).toggleClass("dx-pivotgrid-border", !!this.option("showBorders")).toggleClass("dx-word-wrap", !!this.option("wordWrapEnabled")); _events_engine.default.on($table, (0, _index.addNamespace)(_click.name, "dxPivotGrid"), "td", this._handleCellClick.bind(this)); return $table }, _renderDataArea(dataAreaElement) { const dataArea = this._dataArea || new _m_data_area.default.DataArea(this); this._dataArea = dataArea; dataArea.render(dataAreaElement, this._dataController.getCellsInfo()); return dataArea }, _renderRowsArea(rowsAreaElement) { const rowsArea = this._rowsArea || new _m_headers_area.default.VerticalHeadersArea(this); this._rowsArea = rowsArea; rowsArea.render(rowsAreaElement, this._dataController.getRowsInfo()); return rowsArea }, _renderColumnsArea(columnsAreaElement) { const columnsArea = this._columnsArea || new _m_headers_area.default.HorizontalHeadersArea(this); this._columnsArea = columnsArea; columnsArea.render(columnsAreaElement, this._dataController.getColumnsInfo()); return columnsArea }, _initMarkup() { this.callBase.apply(this, arguments); this.$element().addClass("dx-pivotgrid") }, _renderContentImpl() { const that = this; let columnsAreaElement; let rowsAreaElement; let dataAreaElement; let tableElement; const isFirstDrawing = !that._pivotGridContainer; let rowHeaderContainer; let columnHeaderContainer; let filterHeaderContainer; let dataHeaderContainer; tableElement = !isFirstDrawing && that._tableElement(); if (!tableElement) { that.$element().addClass("dx-row-lines").addClass("dx-pivotgrid-fields-container"); that._pivotGridContainer = (0, _renderer.default)(DIV).addClass("dx-pivotgrid-container"); that._renderFieldChooser(); that._renderContextMenu(); columnsAreaElement = (0, _renderer.default)(TD).addClass("dx-area-column-cell"); rowsAreaElement = (0, _renderer.default)(TD).addClass("dx-area-row-cell"); dataAreaElement = (0, _renderer.default)(TD).addClass("dx-area-data-cell"); tableElement = that._createTableElement(); dataHeaderContainer = (0, _renderer.default)(TD).addClass("dx-data-header"); filterHeaderContainer = (0, _renderer.default)("").addClass(cssClasses.groupRowClass).append(cells.map(cellIterator))) } const maxCellCount = rows[groupCount - 1].find("th").length; for (let j = 0; j < groupCount; j++) { const $cell = rows[j].find("th"); let 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(group, repeatCount, cssClasses, cellTemplate, repeatByDate) { repeatByDate = repeatByDate || 1; repeatCount *= repeatByDate; const cells = []; const { items: items } = group; const itemCount = items.length; for (let i = 0; i < repeatCount; i++) { for (let j = 0; j < itemCount; j++) { let $container = (0, _renderer.default)("
"); const cell = {}; if (cellTemplate && cellTemplate.render) { const templateOptions = { model: items[j], container: (0, _element.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, _renderer.default)("
").append($container) } $container.addClass(cssClasses.groupHeaderContentClass); let cssClass; if ((0, _type.isFunction)(cssClasses.groupHeaderClass)) { cssClass = cssClasses.groupHeaderClass(j) } else { cssClass = cssClasses.groupHeaderClass } cell.element = (0, _renderer.default)("
").attr("colspan", "2").addClass("dx-filter-header"); columnHeaderContainer = (0, _renderer.default)(TD).addClass("dx-column-header"); rowHeaderContainer = (0, _renderer.default)(TD).addClass("dx-area-description-cell"); (0, _renderer.default)(TR).append(filterHeaderContainer).appendTo(tableElement); (0, _renderer.default)(TR).append(dataHeaderContainer).append(columnHeaderContainer).appendTo(tableElement); (0, _renderer.default)(TR).append(rowHeaderContainer).append(columnsAreaElement).appendTo(tableElement); (0, _renderer.default)(TR).addClass("dx-bottom-row").append(rowsAreaElement).append(dataAreaElement).appendTo(tableElement); that._pivotGridContainer.append(tableElement); that.$element().append(that._pivotGridContainer); if ("tree" === that.option("rowHeaderLayout")) { rowsAreaElement.addClass("dx-area-tree-view") } } that.$element().addClass("dx-overflow-hidden"); that._createComponent(that.$element(), _m_field_chooser_base.FieldChooserBase, { dataSource: that.getDataSource(), encodeHtml: that.option("encodeHtml"), allowFieldDragging: that.option("fieldPanel.allowFieldDragging"), headerFilter: that.option("headerFilter"), visible: that.option("visible"), remoteSort: "virtual" === that.option("scrolling.mode") }); const dataArea = that._renderDataArea(dataAreaElement); const rowsArea = that._renderRowsArea(rowsAreaElement); const columnsArea = that._renderColumnsArea(columnsAreaElement); dataArea.tableElement().prepend(columnsArea.headElement()); if (isFirstDrawing) { that._renderLoadPanel(dataArea.groupElement().parent(), that.$element()); that._renderDescriptionArea(); rowsArea.renderScrollable(); columnsArea.renderScrollable(); dataArea.renderScrollable() } [dataArea, rowsArea, columnsArea].forEach((area => { unsubscribeScrollEvents(area) })); that._renderHeaders(rowHeaderContainer, columnHeaderContainer, filterHeaderContainer, dataHeaderContainer); that._update(isFirstDrawing) }, _update(isFirstDrawing) { const that = this; const updateHandler = function() { that.updateDimensions() }; if (that._needDelayResizing(that._dataArea.getData()) && isFirstDrawing) { setTimeout(updateHandler) } else { updateHandler() } }, _fireContentReadyAction() { if (!this._dataController.isLoading()) { this.callBase() } }, getScrollPath(area) { const that = this; if ("column" === area) { return that._columnsArea.getScrollPath(that._scrollLeft) } return that._rowsArea.getScrollPath(that._scrollTop) }, getDataSource() { return this._dataController.getDataSource() }, getFieldChooserPopup() { return this._fieldChooserPopup }, hasScroll(area) { return "column" === area ? this._columnsArea.hasScroll() : this._rowsArea.hasScroll() }, _dimensionChanged() { this.updateDimensions() }, _visibilityChanged(visible) { if (visible) { this.updateDimensions() } }, _dispose() { const that = this; clearTimeout(that._hideLoadingTimeoutID); that.callBase.apply(that, arguments); if (that._dataController) { that._dataController.dispose() } }, _tableElement() { return this.$element().find("table").first() }, addWidgetPrefix: className => `dx-pivotgrid-${className}`, resize() { this.updateDimensions() }, isReady() { return this.callBase() && !this._dataController.isLoading() }, updateDimensions() { const that = this; let groupWidth; const tableElement = that._tableElement(); let bordersWidth; let totalWidth = 0; let totalHeight = 0; let rowsAreaWidth = 0; let hasRowsScroll; let hasColumnsScroll; const dataAreaCell = tableElement.find(".dx-area-data-cell"); const rowAreaCell = tableElement.find(".dx-area-row-cell"); const columnAreaCell = tableElement.find(".dx-area-column-cell"); const descriptionCell = tableElement.find(".dx-area-description-cell"); const filterHeaderCell = tableElement.find(".dx-filter-header"); const columnHeaderCell = tableElement.find(".dx-column-header"); const rowFieldsHeader = that._rowFields; const d = new _deferred.Deferred; if (!(0, _window.hasWindow)()) { return } const needSynchronizeFieldPanel = rowFieldsHeader.isVisible() && "tree" !== that.option("rowHeaderLayout"); that._detectHasContainerHeight(); if (!that._dataArea.headElement().length) { that._dataArea.tableElement().prepend(that._columnsArea.headElement()) } if (needSynchronizeFieldPanel) { that._rowsArea.updateColspans(rowFieldsHeader.getColumnsCount()); that._rowsArea.tableElement().prepend(rowFieldsHeader.headElement()) } tableElement.addClass("dx-incompressible-fields"); that._dataArea.reset(); that._rowsArea.reset(); that._columnsArea.reset(); rowFieldsHeader.reset(); const calculateHasScroll = (areaSize, totalSize) => totalSize - areaSize >= 1; const calculateGroupHeight = (dataAreaHeight, totalHeight, hasRowsScroll, hasColumnsScroll, scrollBarWidth) => hasRowsScroll ? dataAreaHeight : totalHeight + (hasColumnsScroll ? scrollBarWidth : 0); (0, _common.deferUpdate)((() => { const rowHeights = that._rowsArea.getRowsHeight(); const descriptionCellHeight = (0, _size.getOuterHeight)(descriptionCell[0], true) + (needSynchronizeFieldPanel ? rowHeights[0] : 0); let filterAreaHeight = 0; let dataAreaHeight = 0; if (that._hasHeight) { filterAreaHeight = (0, _size.getHeight)(filterHeaderCell); const $dataHeader = tableElement.find(".dx-data-header"); const dataHeaderHeight = (0, _size.getHeight)($dataHeader); bordersWidth = getCommonBorderWidth([columnAreaCell, dataAreaCell, tableElement, columnHeaderCell, filterHeaderCell], "height"); dataAreaHeight = (0, _size.getHeight)(that.$element()) - filterAreaHeight - dataHeaderHeight - (Math.max((0, _size.getHeight)(that._dataArea.headElement()), (0, _size.getHeight)(columnAreaCell), descriptionCellHeight) + bordersWidth) } const scrollBarWidth = that._dataArea.getScrollbarWidth(); const correctDataTableHeight = (0, _size.getHeight)(that._dataArea.tableElement()) - (0, _size.getHeight)(that._dataArea.headElement()); const hasVerticalScrollbar = calculateHasScroll(dataAreaHeight, correctDataTableHeight); that._dataArea.tableElement().css({ width: that._hasHeight && hasVerticalScrollbar && scrollBarWidth ? `calc(100% - ${scrollBarWidth}px)` : "100%" }); const resultWidths = that._dataArea.getColumnsWidth(); const rowsAreaHeights = needSynchronizeFieldPanel ? rowHeights.slice(1) : rowHeights; const dataAreaHeights = that._dataArea.getRowsHeight(); const columnsAreaRowCount = that._dataController.getColumnsInfo().length; const resultHeights = (0, _m_widget_utils.mergeArraysByMaxValue)(rowsAreaHeights, dataAreaHeights.slice(columnsAreaRowCount)); const columnsAreaRowHeights = dataAreaHeights.slice(0, columnsAreaRowCount); const columnsAreaHeight = getArraySum(columnsAreaRowHeights); const rowsAreaColumnWidths = that._rowsArea.getColumnsWidth(); totalWidth = (0, _size.getWidth)(that._dataArea.tableElement()); totalHeight = getArraySum(resultHeights); if (!totalWidth || !totalHeight) { d.resolve(); return } rowsAreaWidth = getArraySum(rowsAreaColumnWidths); const elementWidth = (0, _size.getWidth)(that.$element()); bordersWidth = getCommonBorderWidth([rowAreaCell, dataAreaCell, tableElement], "width"); groupWidth = elementWidth - rowsAreaWidth - bordersWidth; groupWidth = groupWidth > 0 ? groupWidth : totalWidth; const diff = totalWidth - groupWidth; const needAdjustWidthOnZoom = diff >= 0 && diff <= 2; if (needAdjustWidthOnZoom) { adjustSizeArray(resultWidths, diff); totalWidth = groupWidth } hasRowsScroll = that._hasHeight && calculateHasScroll(dataAreaHeight, totalHeight); hasColumnsScroll = calculateHasScroll(groupWidth, totalWidth); const groupHeight = calculateGroupHeight(dataAreaHeight, totalHeight, hasRowsScroll, hasColumnsScroll, scrollBarWidth); (0, _common.deferRender)((() => { that._columnsArea.tableElement().append(that._dataArea.headElement()); rowFieldsHeader.tableElement().append(that._rowsArea.headElement()); if (descriptionCellHeight > columnsAreaHeight) { adjustSizeArray(columnsAreaRowHeights, columnsAreaHeight - descriptionCellHeight); that._columnsArea.setRowsHeight(columnsAreaRowHeights) } tableElement.removeClass("dx-incompressible-fields"); columnHeaderCell.children().css("maxWidth", groupWidth); that._columnsArea.setGroupWidth(groupWidth); that._columnsArea.processScrollBarSpacing(hasRowsScroll ? scrollBarWidth : 0); that._columnsArea.setColumnsWidth(resultWidths); that._rowsArea.setGroupHeight(that._hasHeight ? groupHeight : "auto"); that._rowsArea.processScrollBarSpacing(hasColumnsScroll ? scrollBarWidth : 0); that._rowsArea.setColumnsWidth(rowsAreaColumnWidths); that._rowsArea.setRowsHeight(resultHeights); that._dataArea.setColumnsWidth(resultWidths); that._dataArea.setRowsHeight(resultHeights); that._dataArea.setGroupWidth(groupWidth); that._dataArea.setGroupHeight(that._hasHeight ? groupHeight : "auto"); needSynchronizeFieldPanel && rowFieldsHeader.setColumnsWidth(rowsAreaColumnWidths); dataAreaCell.toggleClass("dx-bottom-border", !hasRowsScroll); rowAreaCell.toggleClass("dx-bottom-border", !hasRowsScroll); if (!that._hasHeight && elementWidth !== (0, _size.getWidth)(that.$element())) { const diff = elementWidth - (0, _size.getWidth)(that.$element()); if (!hasColumnsScroll) { adjustSizeArray(resultWidths, diff); that._columnsArea.setColumnsWidth(resultWidths); that._dataArea.setColumnsWidth(resultWidths) } that._dataArea.setGroupWidth(groupWidth - diff); that._columnsArea.setGroupWidth(groupWidth - diff) } if (that._hasHeight && that._filterFields.isVisible() && (0, _size.getHeight)(filterHeaderCell) !== filterAreaHeight) { const diff = (0, _size.getHeight)(filterHeaderCell) - filterAreaHeight; if (diff > 0) { hasRowsScroll = calculateHasScroll(dataAreaHeight - diff, totalHeight); const groupHeight = calculateGroupHeight(dataAreaHeight - diff, totalHeight, hasRowsScroll, hasColumnsScroll, scrollBarWidth); that._dataArea.setGroupHeight(groupHeight); that._rowsArea.setGroupHeight(groupHeight) } } const scrollingOptions = that.option("scrolling"); if ("virtual" === scrollingOptions.mode) { that._setVirtualContentParams(scrollingOptions, resultWidths, resultHeights, groupWidth, groupHeight, that._hasHeight, rowsAreaWidth) } const updateScrollableResults = []; that._dataArea.updateScrollableOptions({ direction: that._dataArea.getScrollableDirection(hasColumnsScroll, hasRowsScroll), rtlEnabled: that.option("rtlEnabled") }); that._columnsArea.updateScrollableOptions({ rtlEnabled: that.option("rtlEnabled") }); (0, _iterator.each)([that._columnsArea, that._rowsArea, that._dataArea], ((_, area) => { updateScrollableResults.push(area && area.updateScrollable()) })); that._updateLoading(); that._renderNoDataText(dataAreaCell); _deferred.when.apply(_renderer.default, updateScrollableResults).done((() => { that._updateScrollPosition(that._columnsArea, that._rowsArea, that._dataArea, true); that._subscribeToEvents(that._columnsArea, that._rowsArea, that._dataArea); d.resolve() })) })) })); return d }, _setVirtualContentParams(scrollingOptions, resultWidths, resultHeights, groupWidth, groupHeight, hasHeight, rowsAreaWidth) { const virtualContentParams = this._dataController.calculateVirtualContentParams({ virtualRowHeight: scrollingOptions.virtualRowHeight, virtualColumnWidth: scrollingOptions.virtualColumnWidth, itemWidths: resultWidths, itemHeights: resultHeights, rowCount: resultHeights.length, columnCount: resultWidths.length, viewportWidth: groupWidth, viewportHeight: hasHeight ? groupHeight : (0, _size.getOuterHeight)(window) }); this._dataArea.setVirtualContentParams({ top: virtualContentParams.contentTop, left: virtualContentParams.contentLeft, width: virtualContentParams.width, height: virtualContentParams.height }); this._rowsArea.setVirtualContentParams({ top: virtualContentParams.contentTop, width: rowsAreaWidth, height: virtualContentParams.height }); this._columnsArea.setVirtualContentParams({ left: virtualContentParams.contentLeft, width: virtualContentParams.width, height: (0, _size.getHeight)(this._columnsArea.groupElement()) }) }, applyPartialDataSource(area, path, dataSource) { this._dataController.applyPartialDataSource(area, path, dataSource) } }).inherit(_m_export.ExportController).include(_m_chart_integration.ChartIntegrationMixin); (0, _component_registrator.default)("dxPivotGrid", PivotGrid); exports.default = { PivotGrid: PivotGrid } }, 28580: /*!*******************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/m_widget_utils.js ***! \*******************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.calculateScrollbarWidth = void 0; exports.capitalizeFirstLetter = capitalizeFirstLetter; exports.createPath = createPath; exports.default = void 0; exports.discoverObjectFields = discoverObjectFields; exports.findField = findField; exports.foreachDataLevel = foreachDataLevel; exports.foreachTreeAsync = exports.foreachTree = void 0; exports.formatValue = formatValue; exports.getCompareFunction = getCompareFunction; exports.getExpandedLevel = getExpandedLevel; exports.getFieldsDataType = getFieldsDataType; exports.getFiltersByPath = getFiltersByPath; exports.getScrollbarWidth = void 0; exports.mergeArraysByMaxValue = mergeArraysByMaxValue; exports.sendRequest = sendRequest; exports.setDefaultFieldValueFormatting = setDefaultFieldValueFormatting; exports.storeDrillDownMixin = exports.setFieldProperty = void 0; var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../core/dom_adapter */ 73349)); var _ajax = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/ajax */ 37208)); var _call_once = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/call_once */ 39618)); var _data = __webpack_require__( /*! ../../../core/utils/data */ 47617); var _deferred = __webpack_require__( /*! ../../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 95479); var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922); var _array_store = _interopRequireDefault(__webpack_require__( /*! ../../../data/array_store */ 26562)); var _data_source = __webpack_require__( /*! ../../../data/data_source/data_source */ 85273); var _format_helper = _interopRequireDefault(__webpack_require__( /*! ../../../format_helper */ 30343)); var _date = _interopRequireDefault(__webpack_require__( /*! ../../../localization/date */ 91500)); var _const = __webpack_require__( /*! ./const */ 18813); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const setFieldProperty = function(field, property, value, isInitialization) { const initProperties = field._initProperties = field._initProperties || {}; const initValue = isInitialization ? value : field[property]; const needInitProperty = !Object.prototype.hasOwnProperty.call(initProperties, property) || isInitialization; if (needInitProperty && "_initProperties" !== property) { initProperties[property] = initValue } field[property] = value }; exports.setFieldProperty = setFieldProperty; function sendRequest(options) { return _ajax.default.sendRequest(options) } let foreachTreeAsyncDate = new Date; function createForeachTreeFunc(isAsync) { const foreachTreeFunc = function(items, callback, parentAtFirst, members, index, isChildrenProcessing) { members = members || []; items = items || []; let i; let deferred; index = index || 0; function createForeachTreeAsyncHandler(deferred, i, isChildrenProcessing) { (0, _deferred.when)(foreachTreeFunc(items, callback, parentAtFirst, members, i, isChildrenProcessing)).done(deferred.resolve) } for (i = index; i < items.length; i += 1) { if (isAsync && i > index && i % 1e4 === 0 && new Date - foreachTreeAsyncDate >= 300) { foreachTreeAsyncDate = new Date; deferred = new _deferred.Deferred; createForeachTreeAsyncHandler(deferred, i, false); return deferred } const item = items[i]; if (!isChildrenProcessing) { members.unshift(item); if (parentAtFirst && false === callback(members, i)) { return } if (item.children) { const 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 -= 1 } } return }; return foreachTreeFunc } const foreachTree = exports.foreachTree = createForeachTreeFunc(false); const foreachTreeAsync = exports.foreachTreeAsync = createForeachTreeFunc(true); function findField(fields, id) { if (fields && (0, _type.isDefined)(id)) { for (let i = 0; i < fields.length; i += 1) { const field = fields[i]; if (field.name === id || field.caption === id || field.dataField === id || field.index === id) { return i } } } return -1 } function formatValue(value, options) { const valueText = value === value && _format_helper.default.format(value, options.format); const formatObject = { value: value, valueText: valueText || "" }; return options.customizeText ? options.customizeText.call(options, formatObject) : formatObject.valueText } function getCompareFunction(valueSelector) { return function(a, b) { let result = 0; const valueA = valueSelector(a); const valueB = valueSelector(b); const aIsDefined = (0, _type.isDefined)(valueA); const 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 } } function createPath(items) { const result = []; for (let i = items.length - 1; i >= 0; i -= 1) { result.push(items[i].key || items[i].value) } return result } function foreachDataLevel(data, callback, index, childrenField) { index = index || 0; childrenField = childrenField || "children"; if (data.length) { callback(data, index) } for (let i = 0; i < data.length; i += 1) { const item = data[i]; if (item[childrenField] && item[childrenField].length) { foreachDataLevel(item[childrenField], callback, index + 1, childrenField) } } } function mergeArraysByMaxValue(values1, values2) { const result = []; for (let i = 0; i < values1.length; i += 1) { result.push(Math.max(values1[i] || 0, values2[i] || 0)) } return result } function getExpandedLevel(options, axisName) { const dimensions = options[axisName]; let expandLevel = 0; const 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, ((_, path) => { expandLevel = Math.max(expandLevel, path.length) })) } while (dimensions[expandLevel + 1] && dimensions[expandLevel].expanded) { expandLevel += 1 } return expandLevel } function parseFields(dataSource, fieldsList, path, fieldsDataType) { const result = []; Object.keys(fieldsList || []).forEach((field => { if (field && field.startsWith("__")) { return } let dataIndex = 1; const currentPath = path.length ? `${path}.${field}` : field; let dataType = fieldsDataType[currentPath]; const getter = (0, _data.compileGetter)(currentPath); let value = fieldsList[field]; let items; while (!(0, _type.isDefined)(value) && dataSource[dataIndex]) { value = getter(dataSource[dataIndex]); dataIndex += 1 } 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((item = items[0], (0, _iterator.map)(["year", "quarter", "month"], ((value, index) => (0, _extend.extend)({}, item, { groupInterval: value, groupIndex: index }))))) } else if ("object" === dataType) { items = parseFields(dataSource, value, currentPath, fieldsDataType) } var item; result.push.apply(result, items) })); return result } function discoverObjectFields(items, fields) { const fieldsDataType = getFieldsDataType(fields); return parseFields(items, items[0], "", fieldsDataType) } function getFieldsDataType(fields) { const result = {}; (0, _iterator.each)(fields, ((_, field) => { result[field.dataField] = result[field.dataField] || field.dataType })); return result } const DATE_INTERVAL_FORMATS = { month: value => _date.default.getMonthNames()[value - 1], quarter: value => _date.default.format(new Date(2e3, 3 * value - 1), "quarter"), dayOfWeek: value => _date.default.getDayNames()[value] }; function setDefaultFieldValueFormatting(field) { if ("date" === field.dataType) { if (!field.format) { setFieldProperty(field, "format", DATE_INTERVAL_FORMATS[field.groupInterval]) } } else if ("number" === field.dataType) { const groupInterval = (0, _type.isNumeric)(field.groupInterval) && field.groupInterval > 0 && field.groupInterval; if (groupInterval && !field.customizeText) { setFieldProperty(field, "customizeText", (formatObject => { const secondValue = formatObject.value + groupInterval; const secondValueText = _format_helper.default.format(secondValue, field.format); return formatObject.valueText && secondValueText ? `${formatObject.valueText} - ${secondValueText}` : "" })) } } } function getFiltersByPath(fields, path) { const result = []; path = path || []; for (let i = 0; i < path.length; i += 1) { result.push((0, _extend.extend)({}, fields[i], { groupIndex: null, groupName: null, filterType: "include", filterValues: [path[i]] })) } return result } const storeDrillDownMixin = exports.storeDrillDownMixin = { createDrillDownDataSource(descriptions, params) { const items = this.getDrillDownItems(descriptions, params); function createCustomStoreMethod(methodName) { return function(options) { let d; if (undefined) { d = undefined[methodName](options) } else { d = new _deferred.Deferred; (0, _deferred.when)(items).done((data => { const arrayStore = new _array_store.default(data); arrayStore[methodName](options).done(d.resolve).fail(d.reject) })).fail(d.reject) } return d } } const dataSource = new _data_source.DataSource({ load: createCustomStoreMethod("load"), totalCount: createCustomStoreMethod("totalCount"), key: this.key() }); return dataSource } }; function capitalizeFirstLetter(string) { return string.charAt(0).toUpperCase() + string.slice(1) } const getScrollbarWidth = containerElement => containerElement.offsetWidth - containerElement.clientWidth; exports.getScrollbarWidth = getScrollbarWidth; const calculateScrollbarWidth = exports.calculateScrollbarWidth = (0, _call_once.default)((() => { const document = _dom_adapter.default.getDocument(); document.body.insertAdjacentHTML("beforeend", `
`); const scrollbar = document.body.lastElementChild; const scrollbarWidth = getScrollbarWidth(scrollbar); if (scrollbar) { document.body.removeChild(scrollbar) } return scrollbarWidth })); exports.default = { setFieldProperty: setFieldProperty, sendRequest: sendRequest, foreachTree: foreachTree, foreachTreeAsync: foreachTreeAsync, findField: findField, formatValue: formatValue, getCompareFunction: getCompareFunction, createPath: createPath, foreachDataLevel: foreachDataLevel, mergeArraysByMaxValue: mergeArraysByMaxValue, getExpandedLevel: getExpandedLevel, discoverObjectFields: discoverObjectFields, getFieldsDataType: getFieldsDataType, setDefaultFieldValueFormatting: setDefaultFieldValueFormatting, getFiltersByPath: getFiltersByPath, storeDrillDownMixin: storeDrillDownMixin, capitalizeFirstLetter: capitalizeFirstLetter, getScrollbarWidth: getScrollbarWidth, calculateScrollbarWidth: calculateScrollbarWidth } }, 2166: /*!********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/remote_store/m_remote_store.js ***! \********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.RemoteStore = void 0; var _class = _interopRequireDefault(__webpack_require__( /*! ../../../../core/class */ 38377)); var _date_serialization = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date_serialization */ 69434)); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _data_source = __webpack_require__( /*! ../../../../data/data_source/data_source */ 85273); var _utils = __webpack_require__( /*! ../../../../data/data_source/utils */ 9234); var _m_widget_utils = function(e, r) { if (!r && e && e.__esModule) { return e } if (null === e || "object" != typeof e && "function" != typeof e) { return { default: e } } var t = _getRequireWildcardCache(r); if (t && t.has(e)) { return t.get(e) } var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u] } } return n.default = e, t && t.set(e, n), n }(__webpack_require__( /*! ../m_widget_utils */ 28580)); var _m_remote_store_utils = __webpack_require__( /*! ./m_remote_store_utils */ 98413); function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) { return null } var r = new WeakMap, t = new WeakMap; return (_getRequireWildcardCache = function(e) { return e ? t : r })(e) } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function createGroupingOptions(dimensionOptions, useSortOrder) { const groupingOptions = []; (0, _iterator.each)(dimensionOptions, ((index, dimensionOption) => { groupingOptions.push({ selector: dimensionOption.dataField, groupInterval: dimensionOption.groupInterval, desc: useSortOrder && "desc" === dimensionOption.sortOrder, isExpanded: index < dimensionOptions.length - 1 }) })); return groupingOptions } function getIntervalFilterExpression(selector, numericInterval, numericValue, isExcludedFilterType) { const startFilterValue = [selector, isExcludedFilterType ? "<" : ">=", numericValue]; const endFilterValue = [selector, isExcludedFilterType ? ">=" : "<", numericValue + numericInterval]; return [startFilterValue, isExcludedFilterType ? "or" : "and", endFilterValue] } function getFilterExpressionForFilterValue(field, filterValue) { const selector = function(field) { let selector = field.dataField; let { groupInterval: groupInterval } = field; if ("date" === field.dataType && "string" === typeof groupInterval) { if ("quarter" === groupInterval.toLowerCase()) { groupInterval = "Month" } selector = `${selector}.${(0,_m_widget_utils.capitalizeFirstLetter)(groupInterval)}` } return selector }(field); const isExcludedFilterType = "exclude" === field.filterType; let expression = [selector, isExcludedFilterType ? "<>" : "=", filterValue]; if ((0, _type.isDefined)(field.groupInterval)) { if ("string" === typeof field.groupInterval && "quarter" === field.groupInterval.toLowerCase()) { expression = getIntervalFilterExpression(selector, 3, 3 * (filterValue - 1) + 1, isExcludedFilterType) } else if ("number" === typeof field.groupInterval && "date" !== field.dataType) { expression = getIntervalFilterExpression(selector, field.groupInterval, filterValue, isExcludedFilterType) } } return expression } function createFieldFilterExpressions(field, operation) { const fieldFilterExpressions = []; if (field.searchValue) { return [field.dataField, "contains", field.searchValue] } if ("exclude" === field.filterType) { operation = operation || "and" } else { operation = operation || "or" }(0, _iterator.each)(field.filterValues, ((index, filterValue) => { let currentExpression = []; if (Array.isArray(filterValue)) { const parseLevelsRecursive = field.levels && field.levels.length; if (parseLevelsRecursive) { currentExpression = createFieldFilterExpressions({ filterValues: filterValue, filterType: field.filterType, levels: field.levels }, "and") } } else { const currentField = field.levels ? field.levels[index] : field; currentExpression = getFilterExpressionForFilterValue(currentField, filterValue) } if (!currentExpression.length) { return } if (fieldFilterExpressions.length) { fieldFilterExpressions.push(operation) } fieldFilterExpressions.push(currentExpression) })); return fieldFilterExpressions } function createFilterExpressions(fields) { let filterExpressions = []; (0, _iterator.each)(fields, ((_, field) => { const fieldExpressions = createFieldFilterExpressions(field); if (!fieldExpressions.length) { return [] } if (filterExpressions.length) { filterExpressions.push("and") } filterExpressions.push(fieldExpressions); return })); if (1 === filterExpressions.length) { filterExpressions = filterExpressions[0] } return filterExpressions } function mergeFilters(filter1, filter2) { let mergedFilter; const notEmpty = function(filter) { return filter && filter.length }; if (notEmpty(filter1) && notEmpty(filter2)) { mergedFilter = [filter1, "and", filter2] } else { mergedFilter = notEmpty(filter1) ? filter1 : filter2 } return mergedFilter } function setValue(valuesArray, value, rowIndex, columnIndex, dataIndex) { valuesArray[rowIndex] = valuesArray[rowIndex] || []; valuesArray[rowIndex][columnIndex] = valuesArray[rowIndex][columnIndex] || []; if (!(0, _type.isDefined)(valuesArray[rowIndex][columnIndex][dataIndex])) { valuesArray[rowIndex][columnIndex][dataIndex] = value } } function parseValue(value, field) { if (field && "number" === field.dataType && (0, _type.isString)(value)) { return Number(value) } if (field && "date" === field.dataType && !field.groupInterval && !(value instanceof Date)) { return _date_serialization.default.deserializeDate(value) } return value } function getFiltersForDimension(fields) { return (fields || []).filter((f => f.filterValues && f.filterValues.length || f.searchValue)) } function getExpandedIndex(options, axis) { if (options.headerName) { if (axis === options.headerName) { return options.path.length } if (options.oppositePath) { return options.oppositePath.length } } return 0 } function getExpandedPathSliceFilter(options, dimensionName, level, firstCollapsedFieldIndex) { const result = []; const startSliceIndex = level > firstCollapsedFieldIndex ? 0 : firstCollapsedFieldIndex; const fields = options.headerName !== dimensionName ? options[dimensionName].slice(startSliceIndex, level) : []; const paths = "rows" === dimensionName ? options.rowExpandedPaths : options.columnExpandedPaths; (0, _iterator.each)(fields, ((index, field) => { const filterValues = []; (0, _iterator.each)(paths, ((_, path) => { path = path.slice(startSliceIndex, level); if (index < path.length) { const filterValue = path[index]; if (!filterValues.includes(filterValue)) { filterValues.push(filterValue) } } })); if (filterValues.length) { result.push((0, _extend.extend)({}, field, { filterType: "include", filterValues: filterValues })) } })); return result } function getGrandTotalRequest(options, dimensionName, expandedIndex, expandedLevel, commonFilters, firstCollapsedFieldIndex) { const expandedPaths = ("columns" === dimensionName ? options.columnExpandedPaths : options.rowExpandedPaths) || []; const oppositeDimensionName = "columns" === dimensionName ? "rows" : "columns"; const fields = options[dimensionName]; const result = []; let newOptions; if (expandedPaths.length) { for (let i = expandedIndex; i < expandedLevel + 1; i += 1) { newOptions = { filters: commonFilters.concat(getExpandedPathSliceFilter(options, dimensionName, i, firstCollapsedFieldIndex)) }; newOptions[dimensionName] = fields.slice(expandedIndex, i + 1); newOptions[oppositeDimensionName] = []; result.push((0, _extend.extend)({}, options, newOptions)) } } else { newOptions = { filters: commonFilters }; newOptions[dimensionName] = fields.slice(expandedIndex, expandedLevel + 1); newOptions[oppositeDimensionName] = []; result.push((0, _extend.extend)({}, options, newOptions)) } result[0].includeTotalSummary = true; return result } function getFirstCollapsedIndex(fields) { let firstCollapsedIndex = 0; (0, _iterator.each)(fields, ((index, field) => { if (!field.expanded) { firstCollapsedIndex = index; return false } return })); return firstCollapsedIndex } function getRequestsData(options) { const rowExpandedLevel = (0, _m_widget_utils.getExpandedLevel)(options, "rows"); const columnExpandedLevel = (0, _m_widget_utils.getExpandedLevel)(options, "columns"); let filters = options.filters || []; const columnExpandedIndex = getExpandedIndex(options, "columns"); const firstCollapsedColumnIndex = getFirstCollapsedIndex(options.columns); const firstCollapsedRowIndex = getFirstCollapsedIndex(options.rows); const rowExpandedIndex = getExpandedIndex(options, "rows"); let data = []; filters = filters.concat(getFiltersForDimension(options.rows)).concat(getFiltersForDimension(options.columns)).concat(function(options) { return (0, _m_widget_utils.getFiltersByPath)(options[options.headerName], options.path).concat((0, _m_widget_utils.getFiltersByPath)(options["rows" === options.headerName ? "columns" : "rows"], options.oppositePath || [])) }(options)); const columnTotalsOptions = getGrandTotalRequest(options, "columns", columnExpandedIndex, columnExpandedLevel, filters, firstCollapsedColumnIndex); if (options.rows.length && options.columns.length) { if ("rows" !== options.headerName) { data = data.concat(columnTotalsOptions) } for (let i = rowExpandedIndex; i < rowExpandedLevel + 1; i += 1) { const rows = options.rows.slice(rowExpandedIndex, i + 1); const rowFilterByExpandedPaths = getExpandedPathSliceFilter(options, "rows", i, firstCollapsedRowIndex); for (let j = columnExpandedIndex; j < columnExpandedLevel + 1; j += 1) { const preparedOptions = (0, _extend.extend)({}, options, { columns: options.columns.slice(columnExpandedIndex, j + 1), rows: rows, filters: filters.concat(getExpandedPathSliceFilter(options, "columns", j, firstCollapsedColumnIndex)).concat(rowFilterByExpandedPaths) }); data.push(preparedOptions) } } } else { data = options.columns.length ? columnTotalsOptions : getGrandTotalRequest(options, "rows", rowExpandedIndex, rowExpandedLevel, filters, firstCollapsedRowIndex) } return data } function prepareFields(fields) { (0, _iterator.each)(fields || [], ((_, field) => { const { levels: levels } = field; if (levels) { prepareFields(levels) }(0, _m_widget_utils.setDefaultFieldValueFormatting)(field) })) } const RemoteStore = exports.RemoteStore = _class.default.inherit({ ctor(options) { this._dataSource = new _data_source.DataSource(options); this._store = this._dataSource.store() }, getFields(fields) { const d = new _deferred.Deferred; this._store.load({ skip: 0, take: 20 }).done((data => { const normalizedArguments = (0, _utils.normalizeLoadResult)(data); d.resolve(_m_widget_utils.default.discoverObjectFields(normalizedArguments.data, fields)) })).fail(d.reject); return d }, key() { return this._store.key() }, load(options) { const that = this; const d = new _deferred.Deferred; const result = { rows: [], columns: [], values: [], grandTotalRowIndex: 0, grandTotalColumnIndex: 0, rowHash: {}, columnHash: {}, rowIndex: 1, columnIndex: 1 }; const requestsData = getRequestsData(options); const deferreds = []; prepareFields(options.rows); prepareFields(options.columns); prepareFields(options.filters); (0, _iterator.each)(requestsData, ((_, dataItem) => { deferreds.push(that._store.load(function(options, externalFilterExpr, hasRows) { let filterExpressions = createFilterExpressions(options.filters); const groupingOptions = createGroupingOptions(options.rows, options.rowTake).concat(createGroupingOptions(options.columns, options.columnTake)); const loadOptions = { groupSummary: [], totalSummary: [], group: groupingOptions.length ? groupingOptions : void 0, take: groupingOptions.length ? void 0 : 1 }; if (options.rows.length && options.rowTake) { loadOptions.skip = options.rowSkip; loadOptions.take = options.rowTake; loadOptions.requireGroupCount = true } else if (options.columns.length && options.columnTake && !hasRows) { loadOptions.skip = options.columnSkip; loadOptions.take = options.columnTake; loadOptions.requireGroupCount = true } if (externalFilterExpr) { filterExpressions = mergeFilters(filterExpressions, externalFilterExpr) } if (filterExpressions.length) { loadOptions.filter = filterExpressions }(0, _iterator.each)(options.values, ((_, value) => { const summaryOption = { selector: value.dataField, summaryType: value.summaryType || "count" }; loadOptions.groupSummary.push(summaryOption); options.includeTotalSummary && loadOptions.totalSummary.push(summaryOption) })); return loadOptions }(dataItem, that.filter(), options.rows.length))) })); _deferred.when.apply(null, deferreds).done((function() { const args = deferreds.length > 1 ? arguments : [arguments]; (0, _iterator.each)(args, ((index, argument) => { const normalizedArguments = (0, _utils.normalizeLoadResult)(argument[0], argument[1]); ! function(data, total, descriptions, result) { const rowPath = []; let columnPath = []; const { rowHash: rowHash } = result; const { columnHash: columnHash } = result; if (total && total.summary) { (0, _iterator.each)(total.summary, ((index, summary) => { setValue(result.values, summary, result.grandTotalRowIndex, result.grandTotalColumnIndex, index) })) } if (total && total.groupCount >= 0) { const skip = descriptions.rows.length ? descriptions.rowSkip : descriptions.columnSkip; data = [...Array(skip)].concat(data); data.length = total.groupCount } function getItem(dataItem, dimensionName, path, level, field) { const dimensionHash = result[`${dimensionName}Hash`]; let parentItem; let parentItemChildren; let item; const pathValue = path.slice(0, level + 1).join("/"); let parentPathValue; if (void 0 !== dimensionHash[pathValue]) { item = dimensionHash[pathValue] } else { item = { value: parseValue(dataItem.key, field), index: result[`${dimensionName}Index`]++, displayText: dataItem.displayText }; parentPathValue = path.slice(0, level).join("/"); if (level > 0 && void 0 !== dimensionHash[parentPathValue]) { parentItem = dimensionHash[parentPathValue]; parentItemChildren = parentItem.children = parentItem.children || [] } else { parentItemChildren = result[`${dimensionName}s`] } parentItemChildren.push(item); dimensionHash[pathValue] = item } return item }(0, _m_remote_store_utils.forEachGroup)(data, ((item, level) => { const rowLevel = level >= descriptions.rows.length ? descriptions.rows.length : level; const columnLevel = level >= descriptions.rows.length ? level - descriptions.rows.length : 0; let columnItem; let rowItem; if (level >= descriptions.rows.length && columnLevel >= descriptions.columns.length) { return } if (level < descriptions.rows.length) { columnPath = [] } if (level >= descriptions.rows.length) { if (item) { columnPath[columnLevel] = `${item.key}`; columnItem = getItem(item, "column", columnPath, columnLevel, descriptions.columns[columnLevel]); rowItem = rowHash[rowPath.slice(0, rowLevel + 1).join("/")] } else { result.columns.push({}) } } else if (item) { rowPath[rowLevel] = `${item.key}`; rowItem = getItem(item, "row", rowPath, rowLevel, descriptions.rows[rowLevel]); columnItem = columnHash[columnPath.slice(0, columnLevel + 1).join("/")] } else { result.rows.push({}) } const currentRowIndex = rowItem && rowItem.index || result.grandTotalRowIndex; const currentColumnIndex = columnItem && columnItem.index || result.grandTotalColumnIndex; (0, _iterator.each)(item && item.summary || [], ((i, summary) => { setValue(result.values, summary, currentRowIndex, currentColumnIndex, i) })) })); return result }(normalizedArguments.data, normalizedArguments.extra, requestsData[index], result) })); d.resolve({ rows: result.rows, columns: result.columns, values: result.values, grandTotalRowIndex: result.grandTotalRowIndex, grandTotalColumnIndex: result.grandTotalColumnIndex }) })).fail(d.reject); return d }, filter() { return this._dataSource.filter.apply(this._dataSource, arguments) }, supportPaging: () => false, createDrillDownDataSource(loadOptions, params) { loadOptions = loadOptions || {}; params = params || {}; const store = this._store; const filters = (0, _m_widget_utils.getFiltersByPath)(loadOptions.rows, params.rowPath).concat((0, _m_widget_utils.getFiltersByPath)(loadOptions.columns, params.columnPath)).concat(getFiltersForDimension(loadOptions.rows)).concat(loadOptions.filters || []).concat(getFiltersForDimension(loadOptions.columns)); const filterExp = createFilterExpressions(filters); return new _data_source.DataSource({ load: loadOptions => store.load((0, _extend.extend)({}, loadOptions, { filter: mergeFilters(filterExp, loadOptions.filter), select: params.customColumns })) }) } }); exports.default = { RemoteStore: RemoteStore } }, 98413: /*!**************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/remote_store/m_remote_store_utils.js ***! \**************************************************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.forEachGroup = exports.default = void 0; const forEachGroup = function(data, callback, level) { data = data || []; level = level || 0; for (let i = 0; i < data.length; i += 1) { const group = data[i]; callback(group, level); if (group && group.items && group.items.length) { forEachGroup(group.items, callback, level + 1) } } }; exports.forEachGroup = forEachGroup; exports.default = { forEachGroup: forEachGroup } }, 71442: /*!************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/sortable/m_sortable.js ***! \************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.Sortable = void 0; var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../../core/component_registrator */ 99393)); var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../../core/dom_adapter */ 73349)); var _dom_component = _interopRequireDefault(__webpack_require__( /*! ../../../../core/dom_component */ 13046)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _size = __webpack_require__( /*! ../../../../core/utils/size */ 58664); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../../events/core/events_engine */ 55994)); var _drag = __webpack_require__( /*! ../../../../events/drag */ 23174); var _index = __webpack_require__( /*! ../../../../events/utils/index */ 39611); var _swatch_container = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/widget/swatch_container */ 92591)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const { getSwatchContainer: getSwatchContainer } = _swatch_container.default; function checkHorizontalPosition(position, itemOffset, rtl) { if ((0, _type.isDefined)(itemOffset.posHorizontal)) { return rtl ? position > itemOffset.posHorizontal : position < itemOffset.posHorizontal } return true } function getTargetGroup(e, $groups) { let result; (0, _iterator.each)($groups, (function() { if (function(element, x, y) { const $item = (0, _renderer.default)(element); const offset = $item.offset(); if (x >= offset.left && x <= offset.left + (0, _size.getOuterWidth)($item, true)) { if (y >= offset.top && y <= offset.top + (0, _size.getOuterHeight)($item, true)) { return true } } return }(this, e.pageX, e.pageY)) { result = (0, _renderer.default)(this) } })); return result } const Sortable = exports.Sortable = _dom_component.default.inherit({ _getDefaultOptions() { return (0, _extend.extend)(this.callBase(), { onChanged: null, onDragging: null, itemRender: null, groupSelector: null, itemSelector: ".dx-sort-item", itemContainerSelector: ".dx-sortable-old", sourceClass: "dx-drag-source", dragClass: "dx-drag", targetClass: "dx-drag-target", direction: "vertical", allowDragging: true, groupFilter: null, useIndicator: false }) }, _renderItem($sourceItem, target) { const itemRender = this.option("itemRender"); let $item; if (itemRender) { $item = itemRender($sourceItem, target) } else { $item = $sourceItem.clone(); $item.css({ width: (0, _size.getWidth)($sourceItem), height: (0, _size.getHeight)($sourceItem) }) } return $item }, _renderIndicator($item, isVertical, $targetGroup, isLast) { const height = (0, _size.getOuterHeight)($item, true); const width = (0, _size.getOuterWidth)($item, true); const top = $item.offset().top - $targetGroup.offset().top; const left = $item.offset().left - $targetGroup.offset().left; this._indicator.css({ position: "absolute", top: isLast && isVertical ? top + height : top, left: isLast && !isVertical ? left + width : left }).toggleClass("dx-position-indicator-horizontal", !isVertical).toggleClass("dx-position-indicator-vertical", !!isVertical).toggleClass("dx-position-indicator-last", !!isLast).appendTo($targetGroup); (0, _size.setHeight)(this._indicator, ""); (0, _size.setWidth)(this._indicator, ""); if (isVertical) { (0, _size.setWidth)(this._indicator, width) } else { (0, _size.setHeight)(this._indicator, height) } }, _renderDraggable($sourceItem) { this._$draggable && this._$draggable.remove(); this._$draggable = this._renderItem($sourceItem, "drag").addClass(this.option("dragClass")).appendTo(getSwatchContainer($sourceItem)).css({ zIndex: 1e6, position: "absolute" }) }, _detachEventHandlers() { const dragEventsString = [_drag.move, _drag.start, _drag.end, _drag.enter, _drag.leave, _drag.drop].join(" "); _events_engine.default.off(this._getEventListener(), (0, _index.addNamespace)(dragEventsString, "dxSortable"), void 0) }, _getItemOffset(isVertical, itemsOffset, e) { for (let i = 0; i < itemsOffset.length; i += 1) { let shouldInsert; const sameLine = e.pageY < itemsOffset[i].posVertical; if (isVertical) { shouldInsert = sameLine } else if (sameLine) { shouldInsert = checkHorizontalPosition(e.pageX, itemsOffset[i], this.option("rtlEnabled")); if (!shouldInsert && itemsOffset[i + 1] && itemsOffset[i + 1].posVertical > itemsOffset[i].posVertical) { shouldInsert = true } } if (shouldInsert) { return itemsOffset[i] } } return }, _getEventListener() { const groupSelector = this.option("groupSelector"); const element = this.$element(); return groupSelector ? element.find(groupSelector) : element }, _attachEventHandlers() { const that = this; const itemSelector = that.option("itemSelector"); const itemContainerSelector = that.option("itemContainerSelector"); const groupSelector = that.option("groupSelector"); const sourceClass = that.option("sourceClass"); const targetClass = that.option("targetClass"); const onDragging = that.option("onDragging"); const groupFilter = that.option("groupFilter"); let $sourceItem; let sourceIndex; let $targetItem; let $targetGroup; let startPositions; let sourceGroup; const element = that.$element(); let $groups; let scrollWrapper = null; let targetIndex = -1; const disposeScrollWrapper = function() { var _scrollWrapper; null === (_scrollWrapper = scrollWrapper) || void 0 === _scrollWrapper || _scrollWrapper.dispose(); scrollWrapper = null }; that._detachEventHandlers(); if (that.option("allowDragging")) { const $eventListener = that._getEventListener(); _events_engine.default.on($eventListener, (0, _index.addNamespace)(_drag.start, "dxSortable"), itemSelector, (e => { $sourceItem = (0, _renderer.default)(e.currentTarget); const $sourceGroup = $sourceItem.closest(groupSelector); sourceGroup = $sourceGroup.attr("group"); sourceIndex = function($items, $item) { let index = -1; const itemElement = $item.get(0); (0, _iterator.each)($items, ((elementIndex, element) => { const $element = (0, _renderer.default)(element); if (!($element.attr("item-group") && $element.attr("item-group") === $items.eq(elementIndex - 1).attr("item-group"))) { index += 1 } if (element === itemElement) { return false } return })); return index === $items.length ? -1 : index }((groupSelector ? $sourceGroup : element).find(itemSelector), $sourceItem); if ($sourceItem.attr("item-group")) { $sourceItem = $sourceGroup.find(`[item-group='${$sourceItem.attr("item-group")}']`) } that._renderDraggable($sourceItem); $targetItem = that._renderItem($sourceItem, "target").addClass(targetClass); $sourceItem.addClass(sourceClass); ! function() { startPositions = []; (0, _iterator.each)($sourceItem, ((_, item) => { startPositions.push((0, _renderer.default)(item).offset()) })) }(); $groups = function() { const root = _dom_adapter.default.getRootNode(that.$element().get(0)); if (!groupSelector) { return element } return groupFilter ? (0, _renderer.default)(root).find(groupSelector).filter(groupFilter) : element.find(groupSelector) }(); that._indicator = (0, _renderer.default)("
").addClass("dx-position-indicator") })); _events_engine.default.on($eventListener, (0, _index.addNamespace)(_drag.move, "dxSortable"), (e => { let $item; let $lastItem; let $prevItem; if (!$sourceItem) { return } targetIndex = -1; that._indicator.detach(); (0, _iterator.each)(that._$draggable, ((index, draggableElement) => { (0, _renderer.default)(draggableElement).css({ top: startPositions[index].top + e.offset.y, left: startPositions[index].left + e.offset.x }) })); $targetGroup && $targetGroup.removeClass(targetClass); $targetGroup = getTargetGroup(e, $groups); $targetGroup && function() { const draggingArgs = { sourceGroup: sourceGroup, sourceIndex: sourceIndex, sourceElement: $sourceItem, targetGroup: $targetGroup.attr("group"), targetIndex: $targetGroup.find(itemSelector).index($targetItem) }; onDragging && onDragging(draggingArgs); if (draggingArgs.cancel) { $targetGroup = void 0 } }(); if ($targetGroup && scrollWrapper && $targetGroup.get(0) !== scrollWrapper.element().get(0)) { disposeScrollWrapper() } scrollWrapper && scrollWrapper.moveIfNeed(e); if (!$targetGroup) { $targetItem.detach(); return } if (!scrollWrapper && $targetGroup.attr("allow-scrolling")) { scrollWrapper = function(scrollable) { let timeout; let scrollTop = scrollable.scrollTop(); const $element = scrollable.$element(); const { top: top } = $element.offset(); const height = (0, _size.getHeight)($element); let delta = 0; function onScroll(e) { scrollTop = e.scrollOffset.top } scrollable.on("scroll", onScroll); function move() { stop(); scrollable.scrollTo(scrollTop += delta); timeout = setTimeout(move, 10) } function stop() { clearTimeout(timeout) } return { moveIfNeed: function(event) { if (event.pageY <= top + 20) { delta = -2 } else if (event.pageY >= top + height - 20) { delta = 2 } else { delta = 0; stop(); return } move() }, element: () => $element, dispose() { stop(); scrollable.off("scroll", onScroll) } } }($targetGroup.dxScrollable("instance")) } $targetGroup.addClass(targetClass); const $itemContainer = $targetGroup.find(itemContainerSelector); const $items = $itemContainer.find(itemSelector); const targetSortable = $targetGroup.closest(".dx-sortable-old").data("dxSortableOld"); const useIndicator = targetSortable.option("useIndicator"); const isVertical = "vertical" === (targetSortable || that).option("direction"); const itemsOffset = function($elements, isVertical, $itemsContainer) { const result = []; let $item = []; for (let i = 0; i < $elements.length; i += $item.length) { $item = $elements.eq(i); if ($item.attr("item-group")) { $item = $itemsContainer.find(`[item-group='${$item.attr("item-group")}']`) } if ($item.is(":visible")) { const offset = { item: $item, index: result.length, posVertical: isVertical ? ($item.last().offset().top + $item.offset().top + (0, _size.getOuterHeight)($item.last(), true)) / 2 : (0, _size.getOuterHeight)($item.last(), true) + $item.last().offset().top, posHorizontal: isVertical ? void 0 : ((0, _size.getOuterWidth)($item.last(), true) + $item.last().offset().left + $item.offset().left) / 2 }; result.push(offset) } } return result }($items, isVertical, $itemContainer); const itemOffset = that._getItemOffset(isVertical, itemsOffset, e); if (itemOffset) { $item = itemOffset.item; $prevItem = itemsOffset[itemOffset.index - 1] && itemsOffset[itemOffset.index - 1].item; if ($item.hasClass(sourceClass) || $prevItem && $prevItem.hasClass(sourceClass) && $prevItem.is(":visible")) { $targetItem.detach(); return } targetIndex = itemOffset.index; if (!useIndicator) { $targetItem.insertBefore($item); return } const isAnotherGroup = $targetGroup.attr("group") !== sourceGroup; const isSameIndex = targetIndex === sourceIndex; const isNextIndex = targetIndex === sourceIndex + 1; if (isAnotherGroup) { that._renderIndicator($item, isVertical, $targetGroup, that.option("rtlEnabled") && !isVertical); return } if (!isSameIndex && !isNextIndex) { that._renderIndicator($item, isVertical, $targetGroup, that.option("rtlEnabled") && !isVertical) } } else { $lastItem = $items.last(); if ($lastItem.is(":visible") && $lastItem.hasClass(sourceClass)) { return } if ($itemContainer.length) { targetIndex = itemsOffset.length ? itemsOffset[itemsOffset.length - 1].index + 1 : 0 } if (useIndicator) { $items.length && that._renderIndicator($lastItem, isVertical, $targetGroup, !that.option("rtlEnabled") || isVertical) } else { $targetItem.appendTo($itemContainer) } } })); _events_engine.default.on($eventListener, (0, _index.addNamespace)(_drag.end, "dxSortable"), (() => { disposeScrollWrapper(); if (!$sourceItem) { return } const onChanged = that.option("onChanged"); const changedArgs = { sourceIndex: sourceIndex, sourceElement: $sourceItem, sourceGroup: sourceGroup, targetIndex: targetIndex, removeSourceElement: true, removeTargetElement: false, removeSourceClass: true }; if ($targetGroup) { $targetGroup.removeClass(targetClass); changedArgs.targetGroup = $targetGroup.attr("group"); if (sourceGroup !== changedArgs.targetGroup || targetIndex > -1) { onChanged && onChanged(changedArgs); changedArgs.removeSourceElement && $sourceItem.remove() } } that._indicator.detach(); changedArgs.removeSourceClass && $sourceItem.removeClass(sourceClass); $sourceItem = null; that._$draggable.remove(); that._$draggable = null; changedArgs.removeTargetElement && $targetItem.remove(); $targetItem.removeClass(targetClass); $targetItem = null })) } }, _init() { this.callBase(); this._attachEventHandlers() }, _render() { this.callBase(); this.$element().addClass("dx-sortable-old") }, _dispose() { this.callBase.apply(this, arguments); this._$draggable && this._$draggable.detach(); this._indicator && this._indicator.detach() }, _optionChanged(args) { const that = this; switch (args.name) { case "onDragging": case "onChanged": case "itemRender": case "groupSelector": case "itemSelector": case "itemContainerSelector": case "sourceClass": case "targetClass": case "dragClass": case "allowDragging": case "groupFilter": case "useIndicator": that._attachEventHandlers(); break; case "direction": break; default: that.callBase(args) } }, _useTemplates: () => false }); (0, _component_registrator.default)("dxSortableOld", Sortable); exports.default = { Sortable: Sortable } }, 42717: /*!**************************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/summary_display_modes/m_summary_display_modes.js ***! \**************************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.Cell = void 0; exports.applyDisplaySummaryMode = applyDisplaySummaryMode; exports.applyRunningTotal = applyRunningTotal; exports.createMockSummaryCell = createMockSummaryCell; exports.default = void 0; exports.getExpression = getExpression; exports.summaryDictionary = void 0; var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _m_widget_utils = function(e, r) { if (!r && e && e.__esModule) { return e } if (null === e || "object" != typeof e && "function" != typeof e) { return { default: e } } var t = _getRequireWildcardCache(r); if (t && t.has(e)) { return t.get(e) } var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u] } } return n.default = e, t && t.set(e, n), n }(__webpack_require__( /*! ../m_widget_utils */ 28580)); function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) { return null } var r = new WeakMap, t = new WeakMap; return (_getRequireWildcardCache = function(e) { return e ? t : r })(e) } const ROW = "row"; const NULL = null; const calculatePercentValue = function(value, totalValue) { let result = value / totalValue; if (!(0, _type.isDefined)(value) || isNaN(result)) { result = NULL } return result }; const percentOfGrandTotal = function(e, dimension) { return calculatePercentValue(e.value(), e.grandTotal(dimension).value()) }; const percentOfParent = function(e, dimension) { const parent = e.parent(dimension); const parentValue = parent ? parent.value() : e.value(); return calculatePercentValue(e.value(), parentValue) }; const createAbsoluteVariationExp = function(allowCrossGroup) { return function(e) { const prevCell = e.prev("column", allowCrossGroup); const prevValue = prevCell && prevCell.value(); if ((0, _type.isDefined)(prevValue) && (0, _type.isDefined)(e.value())) { return e.value() - prevValue } return NULL } }; const createPercentVariationExp = function(allowCrossGroup) { const absoluteExp = createAbsoluteVariationExp(allowCrossGroup); return function(e) { const absVar = absoluteExp(e); const prevCell = e.prev("column", allowCrossGroup); const prevValue = prevCell && prevCell.value(); return absVar !== NULL && prevValue ? absVar / prevValue : NULL } }; const summaryDictionary = exports.summaryDictionary = { percentOfColumnTotal: e => percentOfParent(e, ROW), percentOfRowTotal: e => percentOfParent(e, "column"), percentOfColumnGrandTotal: e => percentOfGrandTotal(e, ROW), percentOfRowGrandTotal: e => percentOfGrandTotal(e, "column"), percentOfGrandTotal: e => percentOfGrandTotal(e) }; const getPrevCellCrossGroup = function(cell, direction) { if (!cell || !cell.parent(direction)) { return } let prevCell = cell.prev(direction); if (!prevCell) { prevCell = getPrevCellCrossGroup(cell.parent(direction), direction) } return prevCell }; const createRunningTotalExpr = field => { if (!field.runningTotal) { return } const direction = "column" === field.runningTotal ? ROW : "column"; return e => { const prevCell = field.allowCrossGroupCalculation ? getPrevCellCrossGroup(e, direction) : e.prev(direction, false); const calculatedValue = e.value(true); const originalValue = e.value(false); const prevCalculatedValue = null === prevCell || void 0 === prevCell ? void 0 : prevCell.value(true); switch (true) { case (0, _type.isDefined)(calculatedValue) && (0, _type.isDefined)(originalValue) && (0, _type.isDefined)(prevCalculatedValue): return prevCalculatedValue + calculatedValue; case (0, _type.isDefined)(prevCalculatedValue): return prevCalculatedValue; default: return calculatedValue } } }; function getFieldPos(descriptions, field, cache) { let fieldParams = { index: -1 }; if (!(0, _type.isObject)(field)) { if (cache.fields[field]) { field = cache[field] } else { const allFields = descriptions.columns.concat(descriptions.rows).concat(descriptions.values); const fieldIndex = (0, _m_widget_utils.findField)(allFields, field); field = cache[field] = allFields[fieldIndex] } } if (field) { const area = field.area || "data"; fieldParams = cache.positions[field.index] = cache.positions[field.index] || { area: area, index: descriptions["data" === area ? "values" : `${area}s`].indexOf(field) } } return fieldParams } function getPathFieldName(dimension) { return dimension === ROW ? "_rowPath" : "_columnPath" } const SummaryCell = function(columnPath, rowPath, data, descriptions, fieldIndex, fieldsCache) { this._columnPath = columnPath; this._rowPath = rowPath; this._fieldIndex = fieldIndex; this._fieldsCache = fieldsCache || { fields: {}, positions: {} }; this._data = data; this._descriptions = descriptions; const cell = data.values && data.values[rowPath[0].index] && data.values[rowPath[0].index][columnPath[0].index]; if (cell) { cell.originalCell = cell.originalCell || cell.slice(); cell.postProcessedFlags = cell.postProcessedFlags || []; this._cell = cell } }; exports.Cell = SummaryCell; SummaryCell.prototype = (0, _extend.extend)(SummaryCell.prototype, { _getPath(dimension) { return this[getPathFieldName(dimension)] }, _getDimension(dimension) { dimension = dimension === ROW ? "rows" : "columns"; return this._descriptions[dimension] }, _createCell(config) { return new SummaryCell(config._columnPath || this._columnPath, config._rowPath || this._rowPath, this._data, this._descriptions, this._fieldIndex) }, parent(direction) { const path = this._getPath(direction).slice(); const config = {}; path.shift(); if (path.length) { config[getPathFieldName(direction)] = path; return this._createCell(config) } return NULL }, children(direction) { const path = this._getPath(direction).slice(); const item = path[0]; const result = []; const cellConfig = {}; if (item.children) { for (let i = 0; i < item.children.length; i += 1) { cellConfig[getPathFieldName(direction)] = [item.children[i]].concat(path.slice()); result.push(this._createCell(cellConfig)) } } return result }, grandTotal(direction) { const config = {}; const rowPath = this._rowPath; const columnPath = this._columnPath; const dimensionPath = this._getPath(direction); const pathFieldName = getPathFieldName(direction); if (!direction) { config._rowPath = [rowPath[rowPath.length - 1]]; config._columnPath = [columnPath[columnPath.length - 1]] } else { config[pathFieldName] = [dimensionPath[dimensionPath.length - 1]] } return this._createCell(config) }, next(direction, allowCrossGroup) { const currentPath = this._getPath(direction); const item = currentPath[0]; let parent = this.parent(direction); let siblings; if (parent) { const index = currentPath[1].children.indexOf(item); siblings = parent.children(direction); if (siblings[index + 1]) { return siblings[index + 1] } } if (allowCrossGroup && parent) { do { parent = parent.next(direction, allowCrossGroup); siblings = parent ? parent.children(direction) : [] } while (parent && !siblings.length); return siblings[0] || NULL } return NULL }, prev(direction, allowCrossGroup) { const currentPath = this._getPath(direction); const item = currentPath[0]; let parent = this.parent(direction); let siblings; if (parent) { const index = currentPath[1].children.indexOf(item); siblings = parent.children(direction); if (siblings[index - 1]) { return siblings[index - 1] } } if (allowCrossGroup && parent) { do { parent = parent.prev(direction, allowCrossGroup); siblings = parent ? parent.children(direction) : [] } while (parent && !siblings.length); return siblings[siblings.length - 1] || NULL } return NULL }, cell() { return this._cell }, field(area) { if ("data" === area) { return this._descriptions.values[this._fieldIndex] } const path = this._getPath(area); const descriptions = this._getDimension(area); const field = descriptions[path.length - 2]; return field || NULL }, child(direction, fieldValue) { let childLevelField; const children = this.children(direction); for (let i = 0; i < children.length; i += 1) { childLevelField = childLevelField || children[i].field(direction); if (children[i].value(childLevelField) === fieldValue) { return children[i] } } return NULL }, slice(field, value) { const that = this; const config = {}; const fieldPos = getFieldPos(this._descriptions, field, this._fieldsCache); const { area: area } = fieldPos; const fieldIndex = fieldPos.index; let sliceCell = NULL; const newPath = []; if (area === ROW || "column" === area) { const path = this._getPath(area).slice(); const level = -1 !== fieldIndex && path.length - 2 - fieldIndex; if (path[level]) { newPath[path.length - 1] = path[path.length - 1]; for (let i = level; i >= 0; i -= 1) { if (path[i + 1]) { const childItems = path[i + 1].children || []; const currentValue = i === level ? value : path[i].value; path[i] = void 0; for (let childIndex = 0; childIndex < childItems.length; childIndex += 1) { if (childItems[childIndex].value === currentValue) { path[i] = childItems[childIndex]; break } } } if (void 0 === path[i]) { return sliceCell } } config[getPathFieldName(area)] = path; sliceCell = that._createCell(config) } } return sliceCell }, value(arg1, arg2) { const cell = this._cell; let fieldIndex = this._fieldIndex; const fistArgIsBoolean = true === arg1 || false === arg1; const field = !fistArgIsBoolean ? arg1 : NULL; const needCalculatedValue = fistArgIsBoolean && arg1 || arg2; if ((0, _type.isDefined)(field)) { const fieldPos = getFieldPos(this._descriptions, field, this._fieldsCache); fieldIndex = fieldPos.index; if ("data" !== fieldPos.area) { const path = this._getPath(fieldPos.area); const level = -1 !== fieldIndex && path.length - 2 - fieldIndex; return path[level] && path[level].value } } if (cell && cell.originalCell) { return needCalculatedValue ? cell[fieldIndex] : cell.originalCell[fieldIndex] } return NULL }, isPostProcessed(field) { let fieldIndex = this._fieldIndex; if ((0, _type.isDefined)(field)) { const fieldPos = getFieldPos(this._descriptions, field, this._fieldsCache); fieldIndex = fieldPos.index; if ("data" !== fieldPos.area) { return false } } return !!(this._cell && this._cell.postProcessedFlags[fieldIndex]) } }); function getExpression(field) { const { summaryDisplayMode: summaryDisplayMode } = field; const crossGroupCalculation = field.allowCrossGroupCalculation; let expression = NULL; if ((0, _type.isFunction)(field.calculateSummaryValue)) { expression = field.calculateSummaryValue } else if (summaryDisplayMode) { if ("absoluteVariation" === summaryDisplayMode) { expression = createAbsoluteVariationExp(crossGroupCalculation) } else if ("percentVariation" === summaryDisplayMode) { expression = createPercentVariationExp(crossGroupCalculation) } else { expression = summaryDictionary[summaryDisplayMode] } if (expression && !field.format && -1 !== summaryDisplayMode.indexOf("percent")) { _m_widget_utils.default.setFieldProperty(field, "format", "percent") } } return expression } function processDataCell(data, rowIndex, columnIndex, isRunningTotalCalculation) { const values = data.values[rowIndex][columnIndex] = data.values[rowIndex][columnIndex] || []; const { originalCell: originalCell } = values; if (!originalCell) { return } if (values.allowResetting || !isRunningTotalCalculation) { data.values[rowIndex][columnIndex] = originalCell.slice() } data.values[rowIndex][columnIndex].allowResetting = isRunningTotalCalculation } function applyDisplaySummaryMode(descriptions, data) { const expressions = []; const columnElements = [{ index: data.grandTotalColumnIndex, children: data.columns }]; const rowElements = [{ index: data.grandTotalRowIndex, children: data.rows }]; const valueFields = descriptions.values; const fieldsCache = { fields: {}, positions: {} }; data.values = data.values || []; (0, _m_widget_utils.foreachTree)(columnElements, (columnPath => { columnPath[0].isEmpty = [] }), false); (0, _m_widget_utils.foreachTree)(rowElements, (rowPath => { const rowItem = rowPath[0]; rowItem.isEmpty = []; data.values[rowItem.index] = data.values[rowItem.index] || []; (0, _m_widget_utils.foreachTree)(columnElements, (columnPath => { const columnItem = columnPath[0]; let isEmptyCell; processDataCell(data, rowItem.index, columnItem.index, false); for (let i = 0; i < valueFields.length; i += 1) { const field = valueFields[i]; const expression = expressions[i] = void 0 === expressions[i] ? getExpression(field) : expressions[i]; isEmptyCell = false; if (expression) { const expressionArg = new SummaryCell(columnPath, rowPath, data, descriptions, i, fieldsCache); const cell = expressionArg.cell(); const value = cell[i] = expression(expressionArg); cell.postProcessedFlags[i] = true; isEmptyCell = null === value || void 0 === value } if (void 0 === columnItem.isEmpty[i]) { columnItem.isEmpty[i] = true } if (void 0 === rowItem.isEmpty[i]) { rowItem.isEmpty[i] = true } if (!isEmptyCell) { rowItem.isEmpty[i] = columnItem.isEmpty[i] = false } } }), false) }), false); data.isEmptyGrandTotalRow = rowElements[0].isEmpty; data.isEmptyGrandTotalColumn = columnElements[0].isEmpty } function applyRunningTotal(descriptions, data) { const expressions = []; const columnElements = [{ index: data.grandTotalColumnIndex, children: data.columns }]; const rowElements = [{ index: data.grandTotalRowIndex, children: data.rows }]; const valueFields = descriptions.values; const fieldsCache = { fields: {}, positions: {} }; data.values = data.values || []; (0, _m_widget_utils.foreachTree)(rowElements, (rowPath => { const rowItem = rowPath[0]; data.values[rowItem.index] = data.values[rowItem.index] || []; (0, _m_widget_utils.foreachTree)(columnElements, (columnPath => { const columnItem = columnPath[0]; processDataCell(data, rowItem.index, columnItem.index, true); for (let i = 0; i < valueFields.length; i += 1) { const field = valueFields[i]; const expression = expressions[i] = void 0 === expressions[i] ? createRunningTotalExpr(field) : expressions[i]; if (expression) { const expressionArg = new SummaryCell(columnPath, rowPath, data, descriptions, i, fieldsCache); const cell = expressionArg.cell(); cell[i] = expression(expressionArg); cell.postProcessedFlags[i] = true } } }), false) }), false) } function createMockSummaryCell(descriptions, fields, indices) { const summaryCell = new SummaryCell([], [], {}, descriptions, 0); summaryCell.value = function(fieldId) { if ((0, _type.isDefined)(fieldId)) { const index = (0, _m_widget_utils.findField)(fields, fieldId); const field = fields[index]; if (!indices[index] && field && !(0, _type.isDefined)(field.area)) { descriptions.values.push(field); indices[index] = true } } }; summaryCell.grandTotal = function() { return this }; summaryCell.children = function() { return [] }; return summaryCell } exports.default = { Cell: SummaryCell, summaryDictionary: summaryDictionary, getExpression: getExpression, applyRunningTotal: applyRunningTotal, createMockSummaryCell: createMockSummaryCell, applyDisplaySummaryMode: applyDisplaySummaryMode } }, 79755: /*!****************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/pivot_grid/xmla_store/m_xmla_store.js ***! \****************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.XmlaStore = void 0; var _class = _interopRequireDefault(__webpack_require__( /*! ../../../../core/class */ 38377)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _string = __webpack_require__( /*! ../../../../core/utils/string */ 68752); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _window = __webpack_require__( /*! ../../../../core/utils/window */ 58201); var _errors = __webpack_require__( /*! ../../../../data/errors */ 18438); var _language_codes = __webpack_require__( /*! ../../../../localization/language_codes */ 9821); var _m_widget_utils = function(e, r) { if (!r && e && e.__esModule) { return e } if (null === e || "object" != typeof e && "function" != typeof e) { return { default: e } } var t = _getRequireWildcardCache(r); if (t && t.has(e)) { return t.get(e) } var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u] } } return n.default = e, t && t.set(e, n), n }(__webpack_require__( /*! ../m_widget_utils */ 28580)); function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) { return null } var r = new WeakMap, t = new WeakMap; return (_getRequireWildcardCache = function(e) { return e ? t : r })(e) } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const window = (0, _window.getWindow)(); const XmlaStore = exports.XmlaStore = _class.default.inherit(function() { const discover = '{2}{0}{1}{0}{3}'; const mdx = "SELECT {2} FROM {0} {1} CELL PROPERTIES VALUE, FORMAT_STRING, LANGUAGE, BACK_COLOR, FORE_COLOR, FONT_FLAGS"; const mdxFilterSelect = "(SELECT {0} FROM {1})"; const mdxSubset = "Subset({0}, {1}, {2})"; const mdxOrder = "Order({0}, {1}, {2})"; const mdxWith = "{0} {1} as {2}"; const mdxSlice = "WHERE ({0})"; const mdxNonEmpty = "NonEmpty({0}, {1})"; const mdxAxis = "{0} DIMENSION PROPERTIES PARENT_UNIQUE_NAME,HIERARCHY_UNIQUE_NAME, MEMBER_VALUE ON {1}"; const mdxCrossJoin = "CrossJoin({0})"; const mdxSet = "{{0}}"; function execXMLA(requestOptions, data) { const deferred = new _deferred.Deferred; const { beforeSend: beforeSend } = requestOptions; const ajaxSettings = { url: requestOptions.url, dataType: "text", data: data, headers: { "Content-Type": "text/xml" }, xhrFields: {}, method: "POST" }; if ((0, _type.isFunction)(beforeSend)) { beforeSend(ajaxSettings) } _m_widget_utils.default.sendRequest(ajaxSettings).fail((function() { deferred.reject(arguments) })).done((text => { const parser = new window.DOMParser; let xml; try { try { xml = parser.parseFromString(text, "text/xml") } catch (e) { xml = void 0 } if (!xml || xml.getElementsByTagName("parsererror").length || 0 === xml.childNodes.length) { throw new _errors.errors.Error("E4023", text) } } catch (e) { deferred.reject({ statusText: e.message, stack: e.stack, responseText: text }) } deferred.resolve(xml) })); return deferred } function getLocaleIdProperty() { const languageId = (0, _language_codes.getLanguageId)(); if (void 0 !== languageId) { return (0, _string.format)("{0}", languageId) } return "" } function mdxDescendants(level, levelMember, nextLevel) { const memberExpression = levelMember || level; return `Descendants({${memberExpression}}, ${nextLevel}, SELF_AND_BEFORE)` } function getAllMember(dimension) { return `${dimension.hierarchyName||dimension.dataField}.[All]` } function getAllMembers(field) { let result = `${field.dataField}.allMembers`; let { searchValue: searchValue } = field; if (searchValue) { searchValue = searchValue.replace(/'/g, "''"); result = `Filter(${result}, instr(${field.dataField}.currentmember.member_caption,'${searchValue}') > 0)` } return result } function crossJoinElements(elements) { const elementsString = elements.join(","); return elements.length > 1 ? (0, _string.format)(mdxCrossJoin, elementsString) : elementsString } function generateCrossJoin(path, expandLevel, expandAllCount, expandIndex, slicePath, options, axisName, take) { const crossJoinArgs = []; const dimensions = options[axisName]; const fields = []; let arg; let prevDimension; let member; for (let i = expandIndex; i <= expandLevel; i += 1) { const field = dimensions[i]; const { dataField: dataField } = field; const prevHierarchyName = dimensions[i - 1] && dimensions[i - 1].hierarchyName; const { hierarchyName: hierarchyName } = field; const isLastDimensionInGroup = !hierarchyName || !dimensions[i + 1] || dimensions[i + 1].hierarchyName !== hierarchyName; const expandAllIndex = path.length + expandAllCount + expandIndex; arg = null; fields.push(field); if (i < path.length) { if (isLastDimensionInGroup) { arg = `(${dataField}.${preparePathValue(path[i],dataField)})` } } else if (i <= expandAllIndex) { if (0 === i && 0 === expandAllCount) { const allMember = getAllMember(dimensions[expandIndex]); if (!hierarchyName) { arg = getAllMembers(dimensions[expandIndex]) } else { arg = `${allMember},${dimensions[expandIndex].dataField}` } } else if (hierarchyName) { member = preparePathValue(slicePath[slicePath.length - 1]); if (isLastDimensionInGroup || i === expandAllIndex) { if (prevHierarchyName === hierarchyName) { if (slicePath.length) { prevDimension = dimensions[slicePath.length - 1] } if (!prevDimension || prevDimension.hierarchyName !== hierarchyName) { prevDimension = dimensions[i - 1]; member = "" } arg = mdxDescendants(prevDimension.dataField, member, dataField) } else { arg = getAllMembers(field) } } } else { arg = getAllMembers(field) } } else { const isFirstDimensionInGroup = !hierarchyName || prevHierarchyName !== hierarchyName; if (isFirstDimensionInGroup) { arg = `(${getAllMember(field)})` } } if (arg) { arg = (0, _string.format)(mdxSet, arg); if (take) { const sortBy = (field.hierarchyName || field.dataField) + ("displayText" === field.sortBy ? ".MEMBER_CAPTION" : ".MEMBER_VALUE"); arg = (0, _string.format)(mdxOrder, arg, sortBy, "desc" === field.sortOrder ? "DESC" : "ASC") } crossJoinArgs.push(arg) } } return crossJoinElements(crossJoinArgs) } function fillCrossJoins(crossJoins, path, expandLevel, expandIndex, slicePath, options, axisName, cellsString, take, totalsOnly) { let expandAllCount = -1; const dimensions = options[axisName]; let dimensionIndex; do { expandAllCount += 1; dimensionIndex = path.length + expandAllCount + expandIndex; let crossJoin = generateCrossJoin(path, expandLevel, expandAllCount, expandIndex, slicePath, options, axisName, take); if (!take && !totalsOnly) { crossJoin = (0, _string.format)(mdxNonEmpty, crossJoin, cellsString) } crossJoins.push(crossJoin) } while (dimensions[dimensionIndex] && dimensions[dimensionIndex + 1] && dimensions[dimensionIndex].expanded) } function declare(expression, withArray, name, type) { name = name || `[DX_Set_${withArray.length}]`; type = type || "set"; withArray.push((0, _string.format)(mdxWith, type, name, expression)); return name } function generateAxisMdx(options, axisName, cells, withArray, parseOptions) { const dimensions = options[axisName]; const crossJoins = []; let path = []; let expandedPaths = []; let expandIndex = 0; let expandLevel = 0; const result = []; const cellsString = (0, _string.format)(mdxSet, cells.join(",")); if (dimensions && dimensions.length) { if (options.headerName === axisName) { path = options.path; expandIndex = path.length } else if (options.headerName && options.oppositePath) { path = options.oppositePath; expandIndex = path.length } else { expandedPaths = ("columns" === axisName ? options.columnExpandedPaths : options.rowExpandedPaths) || expandedPaths } expandLevel = (0, _m_widget_utils.getExpandedLevel)(options, axisName); fillCrossJoins(crossJoins, [], expandLevel, expandIndex, path, options, axisName, cellsString, "rows" === axisName ? options.rowTake : options.columnTake, options.totalsOnly); (0, _iterator.each)(expandedPaths, ((_, expandedPath) => { fillCrossJoins(crossJoins, expandedPath, expandLevel, expandIndex, expandedPath, options, axisName, cellsString) })); for (let i = expandLevel; i >= path.length; i -= 1) { if (dimensions[i].hierarchyName) { parseOptions.visibleLevels[dimensions[i].hierarchyName] = parseOptions.visibleLevels[dimensions[i].hierarchyName] || []; parseOptions.visibleLevels[dimensions[i].hierarchyName].push(dimensions[i].dataField) } } } if (crossJoins.length) { let expression = function(elements) { const elementsString = elements.join(","); return elements.length > 1 ? `Union(${elementsString})` : elementsString }(crossJoins); if ("rows" === axisName && options.rowTake) { expression = (0, _string.format)(mdxSubset, expression, options.rowSkip > 0 ? options.rowSkip + 1 : 0, options.rowSkip > 0 ? options.rowTake : options.rowTake + 1) } if ("columns" === axisName && options.columnTake) { expression = (0, _string.format)(mdxSubset, expression, options.columnSkip > 0 ? options.columnSkip + 1 : 0, options.columnSkip > 0 ? options.columnTake : options.columnTake + 1) } const axisSet = `[DX_${axisName}]`; result.push(declare(expression, withArray, axisSet)); if (options.totalsOnly) { result.push(declare(`COUNT(${axisSet})`, withArray, `[DX_${axisName}_count]`, "member")) } } if ("columns" === axisName && cells.length && !options.skipValues) { result.push(cellsString) } return (0, _string.format)(mdxAxis, crossJoinElements(result), axisName) } function generateAxisFieldsFilter(fields) { const filterMembers = []; (0, _iterator.each)(fields, ((_, field) => { const { dataField: dataField } = field; const filterExpression = []; const filterValues = field.filterValues || []; let filterStringExpression; if (field.hierarchyName && (0, _type.isNumeric)(field.groupIndex)) { return }(0, _iterator.each)(filterValues, ((_, filterValue) => { let filterMdx = `${dataField}.${preparePathValue(Array.isArray(filterValue)?filterValue[filterValue.length-1]:filterValue,dataField)}`; if ("exclude" === field.filterType) { filterExpression.push(`${filterMdx}.parent`); filterMdx = `Descendants(${filterMdx})` } filterExpression.push(filterMdx) })); if (filterValues.length) { filterStringExpression = (0, _string.format)(mdxSet, filterExpression.join(",")); if ("exclude" === field.filterType) { filterStringExpression = `Except(${getAllMembers(field)},${filterStringExpression})` } filterMembers.push(filterStringExpression) } })); return filterMembers.length ? crossJoinElements(filterMembers) : "" } function generateMdxCore(axisStrings, withArray, columns, rows, filters, slice, cubeName) { let options = arguments.length > 7 && void 0 !== arguments[7] ? arguments[7] : {}; let mdxString = ""; const withString = (withArray.length ? `with ${withArray.join(" ")}` : "") + " "; if (axisStrings.length) { let select; if (options.totalsOnly) { const countMembers = []; if (rows.length) { countMembers.push("[DX_rows_count]") } if (columns.length) { countMembers.push("[DX_columns_count]") } select = `{${countMembers.join(",")}} on columns` } else { select = axisStrings.join(",") } mdxString = withString + (0, _string.format)(mdx, function(columnsFilter, rowsFilter, filter, cubeName) { let from = `[${cubeName}]`; (0, _iterator.each)([columnsFilter, rowsFilter, filter], ((_, filter) => { if (filter) { from = (0, _string.format)(mdxFilterSelect, `${filter}on 0`, from) } })); return from }(generateAxisFieldsFilter(columns), generateAxisFieldsFilter(rows), generateAxisFieldsFilter(filters || []), cubeName), slice.length ? (0, _string.format)(mdxSlice, slice.join(",")) : "", select) } return mdxString } function prepareDataFields(withArray, valueFields) { return (0, _iterator.map)(valueFields, (cell => { if ((0, _type.isString)(cell.expression)) { declare(cell.expression, withArray, cell.dataField, "member") } return cell.dataField })) } function addSlices(slices, options, headerName, path) { (0, _iterator.each)(path, ((index, value) => { const dimension = options[headerName][index]; if (!dimension.hierarchyName || dimension.hierarchyName !== options[headerName][index + 1].hierarchyName) { slices.push(`${dimension.dataField}.${preparePathValue(value,dimension.dataField)}`) } })) } function generateMDX(options, cubeName, parseOptions) { const columns = options.columns || []; const rows = options.rows || []; const values = options.values && options.values.length ? options.values : [{ dataField: "[Measures]" }]; const slice = []; const withArray = []; const axisStrings = []; const dataFields = prepareDataFields(withArray, values); parseOptions.measureCount = options.skipValues ? 1 : values.length; parseOptions.visibleLevels = {}; if (options.headerName && options.path) { addSlices(slice, options, options.headerName, options.path) } if (options.headerName && options.oppositePath) { addSlices(slice, options, "rows" === options.headerName ? "columns" : "rows", options.oppositePath) } if (columns.length || dataFields.length) { axisStrings.push(generateAxisMdx(options, "columns", dataFields, withArray, parseOptions)) } if (rows.length) { axisStrings.push(generateAxisMdx(options, "rows", dataFields, withArray, parseOptions)) } return generateMdxCore(axisStrings, withArray, columns, rows, options.filters, slice, cubeName, options) } function createDrillDownAxisSlice(slice, fields, path) { (0, _iterator.each)(path, ((index, value) => { const field = fields[index]; if (field.hierarchyName && (fields[index + 1] || {}).hierarchyName === field.hierarchyName) { return } slice.push(`${field.dataField}.${preparePathValue(value,field.dataField)}`) })) } function getNumber(str) { return parseInt(str, 10) } function getFirstChildText(node, childTagName) { return getNodeText(function(node, tagName) { return (node.getElementsByTagName(tagName) || [])[0] }(node, childTagName)) } function getNodeText(node) { return node && (node.textContent || node.text || node.innerHTML) || "" } function parseCells(xml, axes, measureCount) { const cells = []; let cell = []; let index = 0; const cellsOriginal = []; const cellElements = xml.getElementsByTagName("Cell"); const errorDictionary = {}; for (let i = 0; i < cellElements.length; i += 1) { const xmlCell = cellElements[i]; const valueElement = xmlCell.getElementsByTagName("Value")[0]; const errorElements = valueElement && valueElement.getElementsByTagName("Error") || []; const text = 0 === errorElements.length ? getNodeText(valueElement) : "#N/A"; const value = parseFloat(text); const isNumeric = text - value + 1 > 0; const cellOrdinal = getNumber(xmlCell.getAttribute("CellOrdinal")); if (errorElements.length) { errorDictionary[getNodeText(errorElements[0].getElementsByTagName("ErrorCode")[0])] = getNodeText(errorElements[0].getElementsByTagName("Description")[0]) } cellsOriginal[cellOrdinal] = { value: isNumeric ? value : text || null } }(0, _iterator.each)(axes[1], (() => { const row = []; cells.push(row); (0, _iterator.each)(axes[0], (() => { const measureIndex = index % measureCount; if (0 === measureIndex) { cell = []; row.push(cell) } cell.push(cellsOriginal[index] ? cellsOriginal[index].value : null); index += 1 })) })); Object.keys(errorDictionary).forEach((key => { _errors.errors.log("W4002", errorDictionary[key]) })); return cells } function preparePathValue(pathValue, dataField) { if (pathValue) { const shouldSkipWrappingPathValue = (0, _type.isString)(pathValue) && (pathValue.includes("&") || pathValue.startsWith(`${dataField}.`)); pathValue = shouldSkipWrappingPathValue ? pathValue : `[${pathValue}]`; if (dataField && 0 === pathValue.indexOf(`${dataField}.`)) { pathValue = pathValue.slice(dataField.length + 1, pathValue.length) } } return pathValue } function getItem(hash, name, member, index) { let item = hash[name]; if (!item) { item = {}; hash[name] = item } if (!(0, _type.isDefined)(item.value) && member) { item.text = member.caption; item.value = member.value; item.key = name || ""; item.levelName = member.levelName; item.hierarchyName = member.hierarchyName; item.parentName = member.parentName; item.index = index; item.level = member.level } return item } function getVisibleChildren(item, visibleLevels) { const result = []; const children = item.children && (item.children.length ? item.children : Object.keys(item.children.grandTotalHash || {}).reduce(((result, name) => result.concat(item.children.grandTotalHash[name].children)), [])); const firstChild = children && children[0]; if (firstChild && (visibleLevels[firstChild.hierarchyName] && visibleLevels[firstChild.hierarchyName].includes(firstChild.levelName) || !visibleLevels[firstChild.hierarchyName] || 0 === firstChild.level)) { const newChildren = children.filter((child => child.hierarchyName === firstChild.hierarchyName)); newChildren.grandTotalHash = children.grandTotalHash; return newChildren } if (firstChild) { for (let i = 0; i < children.length; i += 1) { if (children[i].hierarchyName === firstChild.hierarchyName) { result.push.apply(result, getVisibleChildren(children[i], visibleLevels)) } } } return result } function fillDataSourceAxes(dataSourceAxis, axisTuples, measureCount, visibleLevels) { const result = []; (0, _iterator.each)(axisTuples, ((tupleIndex, members) => { let parentItem = { children: result }; const dataIndex = (0, _type.isDefined)(measureCount) ? Math.floor(tupleIndex / measureCount) : tupleIndex; (0, _iterator.each)(members, ((_, member) => { parentItem = function(dataIndex, member, parentItem) { let children = parentItem.children = parentItem.children || []; const hash = children.hash = children.hash || {}; const grandTotalHash = children.grandTotalHash = children.grandTotalHash || {}; if (member.parentName) { parentItem = getItem(hash, member.parentName); children = parentItem.children = parentItem.children || [] } const currentItem = getItem(hash, member.name, member, dataIndex); if (member.hasValue && !currentItem.added) { currentItem.index = dataIndex; currentItem.added = true; children.push(currentItem) } if ((!parentItem.value || !parentItem.parentName) && member.parentName) { grandTotalHash[member.parentName] = parentItem } else if (grandTotalHash[parentItem.name]) { delete grandTotalHash[member.parentName] } return currentItem }(dataIndex, member, parentItem) })) })); const parentItem = { children: result }; parentItem.children = getVisibleChildren(parentItem, visibleLevels); const grandTotalIndex = function(parentItem, visibleLevels) { let grandTotalIndex; if (1 === parentItem.children.length && "" === parentItem.children[0].parentName) { grandTotalIndex = parentItem.children[0].index; const { grandTotalHash: grandTotalHash } = parentItem.children; parentItem.children = parentItem.children[0].children || []; parentItem.children.grandTotalHash = grandTotalHash; parentItem.children = getVisibleChildren(parentItem, visibleLevels) } else if (0 === parentItem.children.length) { grandTotalIndex = 0 } return grandTotalIndex }(parentItem, visibleLevels); (0, _m_widget_utils.foreachTree)(parentItem.children, (items => { const item = items[0]; const children = getVisibleChildren(item, visibleLevels); if (children.length) { item.children = children } else { delete item.children } delete item.levelName; delete item.hierarchyName; delete item.added; delete item.parentName; delete item.level }), true); (0, _iterator.each)(parentItem.children || [], ((_, e) => { dataSourceAxis.push(e) })); return grandTotalIndex } function checkError(xml) { const faultElementNS = xml.getElementsByTagName("soap:Fault"); const faultElement = xml.getElementsByTagName("Fault"); const errorElement = (0, _renderer.default)([].slice.call(faultElement.length ? faultElement : faultElementNS)).find("Error"); if (errorElement.length) { const description = errorElement.attr("Description"); const error = new _errors.errors.Error("E4000", description); _errors.errors.log("E4000", description); return error } return null } function parseResult(xml, parseOptions) { const dataSource = { columns: [], rows: [] }; const { measureCount: measureCount } = parseOptions; const axes = function(xml, skipValues) { const axes = []; (0, _iterator.each)(xml.getElementsByTagName("Axis"), ((_, axisElement) => { const name = axisElement.getAttribute("name"); const axis = []; let index = 0; if (0 === name.indexOf("Axis") && (0, _type.isNumeric)(getNumber(name.substr(4)))) { axes.push(axis); (0, _iterator.each)(axisElement.getElementsByTagName("Tuple"), ((_, tupleElement) => { const tupleMembers = tupleElement.childNodes; let levelSum = 0; const members = []; let membersCount = skipValues ? tupleMembers.length : tupleMembers.length - 1; const isAxisWithMeasure = 1 === axes.length; if (isAxisWithMeasure) { membersCount -= 1 } axis.push(members); for (let i = membersCount; i >= 0; i -= 1) { const tuple = tupleMembers[i]; const level = getNumber(getFirstChildText(tuple, "LNum")); members[i] = { caption: getFirstChildText(tuple, "Caption"), value: (valueText = getFirstChildText(tuple, "MEMBER_VALUE"), (0, _type.isNumeric)(valueText) ? parseFloat(valueText) : valueText), level: level, index: index++, hasValue: !levelSum && (!!level || 0 === i), name: getFirstChildText(tuple, "UName"), hierarchyName: tupleMembers[i].getAttribute("Hierarchy"), parentName: getFirstChildText(tuple, "PARENT_UNIQUE_NAME"), levelName: getFirstChildText(tuple, "LName") }; levelSum += level } var valueText })) } })); while (axes.length < 2) { axes.push([ [{ level: 0 }] ]) } return axes }(xml, parseOptions.skipValues); dataSource.grandTotalColumnIndex = fillDataSourceAxes(dataSource.columns, axes[0], measureCount, parseOptions.visibleLevels); dataSource.grandTotalRowIndex = fillDataSourceAxes(dataSource.rows, axes[1], void 0, parseOptions.visibleLevels); dataSource.values = parseCells(xml, axes, measureCount); return dataSource } function parseDiscoverRowSet(xml, schema, dimensions, translatedDisplayFolders) { const result = []; const isMeasure = "MEASURE" === schema; const displayFolderField = isMeasure ? "MEASUREGROUP_NAME" : `${schema}_DISPLAY_FOLDER`; (0, _iterator.each)(xml.getElementsByTagName("row"), ((_, row) => { const hierarchyName = "LEVEL" === schema ? getFirstChildText(row, "HIERARCHY_UNIQUE_NAME") : void 0; const levelNumber = getFirstChildText(row, "LEVEL_NUMBER"); let displayFolder = getFirstChildText(row, displayFolderField); if (isMeasure) { displayFolder = translatedDisplayFolders[displayFolder] || displayFolder } if (("0" !== levelNumber || "true" !== getFirstChildText(row, `${schema}_IS_VISIBLE`)) && "2" !== getFirstChildText(row, "DIMENSION_TYPE")) { const dimension = isMeasure ? "DX_MEASURES" : getFirstChildText(row, "DIMENSION_UNIQUE_NAME"); const dataField = getFirstChildText(row, `${schema}_UNIQUE_NAME`); result.push({ dimension: dimensions.names[dimension] || dimension, groupIndex: levelNumber ? getNumber(levelNumber) - 1 : void 0, dataField: dataField, caption: getFirstChildText(row, `${schema}_CAPTION`), hierarchyName: hierarchyName, groupName: hierarchyName, displayFolder: displayFolder, isMeasure: isMeasure, isDefault: !!dimensions.defaultHierarchies[dataField] }) } })); return result } function parseStringWithUnicodeSymbols(str) { str = str.replace(/_x(....)_/g, ((_, group1) => String.fromCharCode(parseInt(group1, 16)))); const stringArray = str.match(/\[.+?\]/gi); if (stringArray && stringArray.length) { str = stringArray[stringArray.length - 1] } return str.replace(/\[/gi, "").replace(/\]/gi, "").replace(/\$/gi, "").replace(/\./gi, " ") } function sendQuery(storeOptions, mdxString) { mdxString = (0, _renderer.default)("
").text(mdxString).html(); return execXMLA(storeOptions, (0, _string.format)('{0}{1}TrueMicrosoft SQL Server Management Studio3600{2}', mdxString, storeOptions.catalog, getLocaleIdProperty())) } return { ctor(options) { this._options = options }, getFields() { const options = this._options; const { catalog: catalog } = options; const { cube: cube } = options; const localeIdProperty = getLocaleIdProperty(); const dimensionsRequest = execXMLA(options, (0, _string.format)(discover, catalog, cube, "MDSCHEMA_DIMENSIONS", localeIdProperty)); const measuresRequest = execXMLA(options, (0, _string.format)(discover, catalog, cube, "MDSCHEMA_MEASURES", localeIdProperty)); const hierarchiesRequest = execXMLA(options, (0, _string.format)(discover, catalog, cube, "MDSCHEMA_HIERARCHIES", localeIdProperty)); const levelsRequest = execXMLA(options, (0, _string.format)(discover, catalog, cube, "MDSCHEMA_LEVELS", localeIdProperty)); const result = new _deferred.Deferred; (0, _deferred.when)(dimensionsRequest, measuresRequest, hierarchiesRequest, levelsRequest).then(((dimensionsResponse, measuresResponse, hierarchiesResponse, levelsResponse) => { execXMLA(options, (0, _string.format)(discover, catalog, cube, "MDSCHEMA_MEASUREGROUPS", localeIdProperty)).done((measureGroupsResponse => { const dimensions = function(xml) { const result = { names: {}, defaultHierarchies: {} }; (0, _iterator.each)((0, _renderer.default)(xml).find("row"), (function() { const $row = (0, _renderer.default)(this); const type = $row.children("DIMENSION_TYPE").text(); const dimensionName = "2" === type ? "DX_MEASURES" : $row.children("DIMENSION_UNIQUE_NAME").text(); result.names[dimensionName] = $row.children("DIMENSION_CAPTION").text(); result.defaultHierarchies[$row.children("DEFAULT_HIERARCHY").text()] = true })); return result }(dimensionsResponse); const hierarchies = parseDiscoverRowSet(hierarchiesResponse, "HIERARCHY", dimensions); const levels = parseDiscoverRowSet(levelsResponse, "LEVEL", dimensions); const measureGroups = function(xml) { const measureGroups = {}; (0, _iterator.each)(xml.getElementsByTagName("row"), ((_, row) => { measureGroups[getFirstChildText(row, "MEASUREGROUP_NAME")] = getFirstChildText(row, "MEASUREGROUP_CAPTION") })); return measureGroups }(measureGroupsResponse); const fields = parseDiscoverRowSet(measuresResponse, "MEASURE", dimensions, measureGroups).concat(hierarchies); const levelsByHierarchy = {}; (0, _iterator.each)(levels, ((_, level) => { levelsByHierarchy[level.hierarchyName] = levelsByHierarchy[level.hierarchyName] || []; levelsByHierarchy[level.hierarchyName].push(level) })); (0, _iterator.each)(hierarchies, ((_, hierarchy) => { if (levelsByHierarchy[hierarchy.dataField] && levelsByHierarchy[hierarchy.dataField].length > 1) { hierarchy.groupName = hierarchy.hierarchyName = hierarchy.dataField; fields.push.apply(fields, levelsByHierarchy[hierarchy.hierarchyName]) } })); result.resolve(fields) })).fail(result.reject) })).fail(result.reject); return result }, load(options) { const result = new _deferred.Deferred; const storeOptions = this._options; const parseOptions = { skipValues: options.skipValues }; const mdxString = generateMDX(options, storeOptions.cube, parseOptions); let rowCountMdx; if (options.rowSkip || options.rowTake || options.columnTake || options.columnSkip) { rowCountMdx = generateMDX((0, _extend.extend)({}, options, { totalsOnly: true, rowSkip: null, rowTake: null, columnSkip: null, columnTake: null }), storeOptions.cube, {}) } const load = () => { if (mdxString) { (0, _deferred.when)(sendQuery(storeOptions, mdxString), rowCountMdx && sendQuery(storeOptions, rowCountMdx)).done(((executeXml, rowCountXml) => { const error = checkError(executeXml) || rowCountXml && checkError(rowCountXml); if (!error) { const response = parseResult(executeXml, parseOptions); if (rowCountXml) { ! function(data, options, totalCountXml) { const axes = []; const columnOptions = options.columns || []; const rowOptions = options.rows || []; if (columnOptions.length) { axes.push({}) } if (rowOptions.length) { axes.push({}) } const cells = parseCells(totalCountXml, [ [{}], [{}, {}] ], 1); if (!columnOptions.length && rowOptions.length) { data.rowCount = Math.max(cells[0][0][0] - 1, 0) } if (!rowOptions.length && columnOptions.length) { data.columnCount = Math.max(cells[0][0][0] - 1, 0) } if (rowOptions.length && columnOptions.length) { data.rowCount = Math.max(cells[0][0][0] - 1, 0); data.columnCount = Math.max(cells[1][0][0] - 1, 0) } if (void 0 !== data.rowCount && options.rowTake) { data.rows = [...Array(options.rowSkip)].concat(data.rows); data.rows.length = data.rowCount; for (let i = 0; i < data.rows.length; i += 1) { data.rows[i] = data.rows[i] || {} } } if (void 0 !== data.columnCount && options.columnTake) { data.columns = [...Array(options.columnSkip)].concat(data.columns); data.columns.length = data.columnCount; for (let i = 0; i < data.columns.length; i += 1) { data.columns[i] = data.columns[i] || {} } } }(response, options, rowCountXml) } result.resolve(response) } else { result.reject(error) } })).fail(result.reject) } else { result.resolve({ columns: [], rows: [], values: [], grandTotalColumnIndex: 0, grandTotalRowIndex: 0 }) } }; if (options.delay) { setTimeout(load, options.delay) } else { load() } return result }, supportPaging: () => true, getDrillDownItems(options, params) { const result = new _deferred.Deferred; const storeOptions = this._options; const mdxString = function(options, cubeName, params) { const columns = options.columns || []; const rows = options.rows || []; const values = options.values && options.values.length ? options.values : [{ dataField: "[Measures]" }]; const slice = []; const withArray = []; const axisStrings = []; const dataFields = prepareDataFields(withArray, values); const { maxRowCount: maxRowCount } = params; const customColumns = params.customColumns || []; const customColumnsString = customColumns.length > 0 ? ` return ${customColumns.join(",")}` : ""; createDrillDownAxisSlice(slice, columns, params.columnPath || []); createDrillDownAxisSlice(slice, rows, params.rowPath || []); if (columns.length || dataFields.length) { axisStrings.push([`${dataFields[params.dataIndex]||dataFields[0]} on 0`]) } const coreMDX = generateMdxCore(axisStrings, withArray, columns, rows, options.filters, slice, cubeName); return coreMDX ? `drillthrough${maxRowCount>0?` maxrows ${maxRowCount}`:""}${coreMDX}${customColumnsString}` : coreMDX }(options, storeOptions.cube, params); if (mdxString) { (0, _deferred.when)(sendQuery(storeOptions, mdxString)).done((executeXml => { const error = checkError(executeXml); if (!error) { result.resolve(function(xml) { const rows = xml.getElementsByTagName("row"); const result = []; const columnNames = {}; for (let i = 0; i < rows.length; i += 1) { const children = rows[i].childNodes; const item = {}; for (let j = 0; j < children.length; j += 1) { const { tagName: tagName } = children[j]; const name = columnNames[tagName] = columnNames[tagName] || parseStringWithUnicodeSymbols(tagName); item[name] = getNodeText(children[j]) } result.push(item) } return result }(executeXml)) } else { result.reject(error) } })).fail(result.reject) } else { result.resolve([]) } return result }, key: _common.noop, filter: _common.noop } }()).include(_m_widget_utils.storeDrillDownMixin); exports.default = { XmlaStore: XmlaStore } }, 26686: /*!*************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/data_controller/m_data_controller.js ***! \*************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.TreeListDataController = void 0; var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _m_data_controller = __webpack_require__( /*! ../../../grids/grid_core/data_controller/m_data_controller */ 72119); var _m_data_source_adapter = _interopRequireDefault(__webpack_require__( /*! ../data_source_adapter/m_data_source_adapter */ 22821)); var _m_core = _interopRequireDefault(__webpack_require__( /*! ../m_core */ 12500)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } class TreeListDataController extends _m_data_controller.DataController { _getDataSourceAdapter() { return _m_data_source_adapter.default } _getNodeLevel(node) { let level = -1; while (node.parent) { if (node.visible) { level++ } node = node.parent } return level } _generateDataItem(node, options) { return { rowType: "data", node: node, key: node.key, data: node.data, isExpanded: this.isRowExpanded(node.key, options), level: this._getNodeLevel(node) } } _loadOnOptionChange() { this._dataSource.load() } _isItemEquals(item1, item2) { if (item1.isSelected !== item2.isSelected) { return false } if (item1.node && item2.node && item1.node.hasChildren !== item2.node.hasChildren) { return false } if (item1.level !== item2.level || item1.isExpanded !== item2.isExpanded) { return false } return super._isItemEquals.apply(this, arguments) } _isCellChanged(oldRow, newRow, visibleRowIndex, columnIndex, isLiveUpdate) { const firstDataColumnIndex = this._columnsController.getFirstDataColumnIndex(); if (columnIndex === firstDataColumnIndex && oldRow.isSelected !== newRow.isSelected) { return true } return super._isCellChanged.apply(this, arguments) } init() { this.createAction("onRowExpanding"); this.createAction("onRowExpanded"); this.createAction("onRowCollapsing"); this.createAction("onRowCollapsed"); super.init.apply(this, arguments) } keyOf(data) { const dataSource = this._dataSource; if (dataSource) { return dataSource.keyOf(data) } } key() { const dataSource = this._dataSource; if (dataSource) { return dataSource.getKeyExpr() } } publicMethods() { return super.publicMethods().concat(["expandRow", "collapseRow", "isRowExpanded", "getRootNode", "getNodeByKey", "loadDescendants", "forEachNode"]) } changeRowExpand(key) { if (this._dataSource) { const args = { key: key }; const isExpanded = this.isRowExpanded(key); this.executeAction(isExpanded ? "onRowCollapsing" : "onRowExpanding", args); if (!args.cancel) { return this._dataSource.changeRowExpand(key).done((() => { this.executeAction(isExpanded ? "onRowCollapsed" : "onRowExpanded", args) })) } } return (new _deferred.Deferred).resolve() } isRowExpanded(key, cache) { return this._dataSource && this._dataSource.isRowExpanded(key, cache) } expandRow(key) { if (!this.isRowExpanded(key)) { return this.changeRowExpand(key) } return (new _deferred.Deferred).resolve() } collapseRow(key) { if (this.isRowExpanded(key)) { return this.changeRowExpand(key) } return (new _deferred.Deferred).resolve() } getRootNode() { return this._dataSource && this._dataSource.getRootNode() } optionChanged(args) { switch (args.name) { case "rootValue": case "parentIdExpr": case "itemsExpr": case "filterMode": case "expandNodesOnFiltering": case "autoExpandAll": case "hasItemsExpr": case "dataStructure": this._columnsController.reset(); this._items = []; this._refreshDataSource(); args.handled = true; break; case "expandedRowKeys": case "onNodesInitialized": if (this._dataSource && !this._dataSource._isNodesInitializing && !(0, _common.equalByValue)(args.value, args.previousValue)) { this._loadOnOptionChange() } args.handled = true; break; case "maxFilterLengthInRequest": args.handled = true; break; default: super.optionChanged(args) } } getNodeByKey(key) { if (!this._dataSource) { return } return this._dataSource.getNodeByKey(key) } getChildNodeKeys(parentKey) { if (!this._dataSource) { return } return this._dataSource.getChildNodeKeys(parentKey) } loadDescendants(keys, childrenOnly) { if (!this._dataSource) { return } return this._dataSource.loadDescendants(keys, childrenOnly) } forEachNode() { this._dataSource.forEachNode.apply(this, arguments) } } exports.TreeListDataController = TreeListDataController; _m_core.default.registerModule("data", { defaultOptions: () => (0, _extend.extend)({}, _m_data_controller.dataControllerModule.defaultOptions(), { itemsExpr: "items", parentIdExpr: "parentId", rootValue: 0, dataStructure: "plain", expandedRowKeys: [], filterMode: "withAncestors", expandNodesOnFiltering: true, autoExpandAll: false, onNodesInitialized: null, maxFilterLengthInRequest: 1500, paging: { enabled: false } }), controllers: { data: TreeListDataController } }) }, 22821: /*!*********************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/data_source_adapter/m_data_source_adapter.js ***! \*********************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _data = __webpack_require__( /*! ../../../../core/utils/data */ 47617); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _array_store = _interopRequireDefault(__webpack_require__( /*! ../../../../data/array_store */ 26562)); var _array_utils = __webpack_require__( /*! ../../../../data/array_utils */ 60637); var _query = _interopRequireDefault(__webpack_require__( /*! ../../../../data/query */ 96687)); var _store_helper = _interopRequireDefault(__webpack_require__( /*! ../../../../data/store_helper */ 99236)); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/widget/ui.errors */ 96688)); var _m_data_source_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../grids/grid_core/data_source_adapter/m_data_source_adapter */ 30945)); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../../../grids/grid_core/m_utils */ 60082)); var _m_core = _interopRequireDefault(__webpack_require__( /*! ../m_core */ 12500)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const { queryByOptions: queryByOptions } = _store_helper.default; const isFullBranchFilterMode = that => "fullBranch" === that.option("filterMode"); const applySorting = (data, sort) => queryByOptions((0, _query.default)(data), { sort: sort }).toArray(); class DataSourceAdapterTreeList extends _m_data_source_adapter.default { _createKeyGetter() { const keyExpr = this.getKeyExpr(); return (0, _data.compileGetter)(keyExpr) } _createKeySetter() { const keyExpr = this.getKeyExpr(); if ((0, _type.isFunction)(keyExpr)) { return keyExpr } return (0, _data.compileSetter)(keyExpr) } createParentIdGetter() { return (0, _data.compileGetter)(this.option("parentIdExpr")) } createParentIdSetter() { const parentIdExpr = this.option("parentIdExpr"); if ((0, _type.isFunction)(parentIdExpr)) { return parentIdExpr } return (0, _data.compileSetter)(parentIdExpr) } _createItemsGetter() { return (0, _data.compileGetter)(this.option("itemsExpr")) } _createHasItemsGetter() { const hasItemsExpr = this.option("hasItemsExpr"); return hasItemsExpr && (0, _data.compileGetter)(hasItemsExpr) } _createHasItemsSetter() { const hasItemsExpr = this.option("hasItemsExpr"); if ((0, _type.isFunction)(hasItemsExpr)) { return hasItemsExpr } return hasItemsExpr && (0, _data.compileSetter)(hasItemsExpr) } _updateIndexByKeyObject(items) { const that = this; that._indexByKey = {}; (0, _iterator.each)(items, ((index, item) => { that._indexByKey[item.key] = index })) } _calculateHasItems(node, options) { const that = this; const { parentIds: parentIds } = options.storeLoadOptions; let hasItems; const isFullBranch = isFullBranchFilterMode(that); if (that._hasItemsGetter && (parentIds || !options.storeLoadOptions.filter || isFullBranch)) { hasItems = that._hasItemsGetter(node.data) } if (void 0 === hasItems) { if (!that._isChildrenLoaded[node.key] && options.remoteOperations.filtering && (parentIds || isFullBranch)) { hasItems = true } else if (options.loadOptions.filter && !options.remoteOperations.filtering && isFullBranch) { hasItems = node.children.length } else { hasItems = node.hasChildren } } return !!hasItems } _fillVisibleItemsByNodes(nodes, options, result) { for (let i = 0; i < nodes.length; i++) { if (nodes[i].visible) { result.push(nodes[i]) } if ((this.isRowExpanded(nodes[i].key, options) || !nodes[i].visible) && nodes[i].hasChildren && nodes[i].children.length) { this._fillVisibleItemsByNodes(nodes[i].children, options, result) } } } _convertItemToNode(item, rootValue, nodeByKey) { const key = this._keyGetter(item); let parentId = this._parentIdGetter(item); parentId = (0, _type.isDefined)(parentId) ? parentId : rootValue; const parentNode = nodeByKey[parentId] = nodeByKey[parentId] || { key: parentId, children: [] }; const node = nodeByKey[key] = nodeByKey[key] || { key: key, children: [] }; node.data = item; node.parent = parentNode; return node } _createNodesByItems(items, visibleItems) { const that = this; const rootValue = that.option("rootValue"); const visibleByKey = {}; const nodeByKey = that._nodeByKey = {}; let i; if (visibleItems) { for (i = 0; i < visibleItems.length; i++) { visibleByKey[this._keyGetter(visibleItems[i])] = true } } for (i = 0; i < items.length; i++) { const node = that._convertItemToNode(items[i], rootValue, nodeByKey); if (void 0 === node.key) { return } node.visible = !visibleItems || !!visibleByKey[node.key]; if (node.parent) { node.parent.children.push(node) } } const rootNode = nodeByKey[rootValue] || { key: rootValue, children: [] }; rootNode.level = -1; return rootNode } _convertDataToPlainStructure(data, parentId, result) { let key; if (this._itemsGetter && !data.isConverted) { result = result || []; for (let i = 0; i < data.length; i++) { const item = (0, _array_utils.createObjectWithChanges)(data[i]); key = this._keyGetter(item); if (void 0 === key) { key = result.length + 1; this._keySetter(item, key) } this._parentIdSetter(item, void 0 === parentId ? this.option("rootValue") : parentId); result.push(item); const childItems = this._itemsGetter(item); if (childItems && childItems.length) { this._convertDataToPlainStructure(childItems, key, result); const itemsExpr = this.option("itemsExpr"); if (!(0, _type.isFunction)(itemsExpr)) { delete item[itemsExpr] } } } result.isConverted = true; return result } return data } _createIdFilter(field, keys) { const parentIdFilters = []; for (let i = 0; i < keys.length; i++) { parentIdFilters.push([field, "=", keys[i]]) } return _m_utils.default.combineFilters(parentIdFilters, "or") } _customizeRemoteOperations(options, operationTypes) { super._customizeRemoteOperations.apply(this, arguments); options.remoteOperations.paging = false; let expandVisibleNodes = false; if (this.option("autoExpandAll")) { options.remoteOperations.sorting = false; options.remoteOperations.filtering = false; if ((!this._lastLoadOptions || operationTypes.filtering && !options.storeLoadOptions.filter) && !options.isCustomLoading) { expandVisibleNodes = true } } if (!options.isCustomLoading) { this._isReload = this._isReload || operationTypes.reload; if (!options.cachedStoreData) { this._isChildrenLoaded = {}; if (this._isReload) { this._nodeByKey = {} } } if (this.option("expandNodesOnFiltering") && (operationTypes.filtering || this._isReload && options.storeLoadOptions.filter)) { if (options.storeLoadOptions.filter) { expandVisibleNodes = true } else { options.collapseVisibleNodes = true } } } options.expandVisibleNodes = expandVisibleNodes } _getParentIdsToLoad(parentIds) { const parentIdsToLoad = []; for (let i = 0; i < parentIds.length; i++) { const node = this.getNodeByKey(parentIds[i]); if (!node || node.hasChildren && !node.children.length) { parentIdsToLoad.push(parentIds[i]) } } return parentIdsToLoad } _handleCustomizeStoreLoadOptions(options) { const rootValue = this.option("rootValue"); const parentIdExpr = this.option("parentIdExpr"); let { parentIds: parentIds } = options.storeLoadOptions; if (parentIds) { options.isCustomLoading = false } super._handleCustomizeStoreLoadOptions.apply(this, arguments); if (options.remoteOperations.filtering && !options.isCustomLoading) { if (isFullBranchFilterMode(this) && options.cachedStoreData || !options.storeLoadOptions.filter) { const expandedRowKeys = options.collapseVisibleNodes ? [] : this.option("expandedRowKeys"); parentIds = [rootValue].concat(expandedRowKeys).concat(parentIds || []); const parentIdsToLoad = options.data ? this._getParentIdsToLoad(parentIds) : parentIds; if (parentIdsToLoad.length) { options.cachedPagingData = void 0; options.data = void 0; options.mergeStoreLoadData = true; options.delay = this.option("loadingTimeout") } options.storeLoadOptions.parentIds = parentIdsToLoad; options.storeLoadOptions.filter = this._createIdFilter(parentIdExpr, parentIdsToLoad) } } } _generateInfoToLoad(data, needChildren) { const that = this; let key; const keyMap = {}; const resultKeyMap = {}; const resultKeys = []; const rootValue = that.option("rootValue"); let i; for (i = 0; i < data.length; i++) { key = needChildren ? that._parentIdGetter(data[i]) : that._keyGetter(data[i]); keyMap[key] = true } for (i = 0; i < data.length; i++) { key = needChildren ? that._keyGetter(data[i]) : that._parentIdGetter(data[i]); const needToLoad = needChildren ? that.isRowExpanded(key) : key !== rootValue; if (!keyMap[key] && !resultKeyMap[key] && needToLoad) { resultKeyMap[key] = true; resultKeys.push(key) } } return { keyMap: resultKeyMap, keys: resultKeys } } _loadParentsOrChildren(data, options, needChildren) { var _options$storeLoadOpt, _options$loadOptions; let filter; let needLocalFiltering; const { keys: keys, keyMap: keyMap } = this._generateInfoToLoad(data, needChildren); const d = new _deferred.Deferred; const isRemoteFiltering = options.remoteOperations.filtering; const maxFilterLengthInRequest = this.option("maxFilterLengthInRequest"); const sort = (null === (_options$storeLoadOpt = options.storeLoadOptions) || void 0 === _options$storeLoadOpt ? void 0 : _options$storeLoadOpt.sort) ?? (null === (_options$loadOptions = options.loadOptions) || void 0 === _options$loadOptions ? void 0 : _options$loadOptions.sort); let loadOptions = isRemoteFiltering ? options.storeLoadOptions : options.loadOptions; const concatLoadedData = loadedData => { if (isRemoteFiltering) { this._cachedStoreData = applySorting(this._cachedStoreData.concat(loadedData), sort) } return applySorting(data.concat(loadedData), sort) }; if (!keys.length) { return d.resolve(data) } let cachedNodes = keys.map((id => this.getNodeByKey(id))).filter((node => node && node.data)); if (cachedNodes.length === keys.length) { if (needChildren) { cachedNodes = cachedNodes.reduce(((result, node) => result.concat(node.children)), []) } if (cachedNodes.length) { return this._loadParentsOrChildren(concatLoadedData(cachedNodes.map((node => node.data))), options, needChildren) } } const keyExpr = needChildren ? this.option("parentIdExpr") : this.getKeyExpr(); filter = this._createIdFilter(keyExpr, keys); const filterLength = encodeURI(JSON.stringify(filter)).length; if (filterLength > maxFilterLengthInRequest) { filter = itemData => keyMap[needChildren ? this._parentIdGetter(itemData) : this._keyGetter(itemData)]; needLocalFiltering = isRemoteFiltering } loadOptions = (0, _extend.extend)({}, loadOptions, { filter: !needLocalFiltering ? filter : null }); const store = options.fullData ? new _array_store.default(options.fullData) : this._dataSource.store(); this.loadFromStore(loadOptions, store).done((loadedData => { if (loadedData.length) { if (needLocalFiltering) { loadedData = (0, _query.default)(loadedData).filter(filter).toArray() } this._loadParentsOrChildren(concatLoadedData(loadedData), options, needChildren).done(d.resolve).fail(d.reject) } else { d.resolve(data) } })).fail(d.reject); return d } _loadParents(data, options) { return this._loadParentsOrChildren(data, options) } _loadChildrenIfNeed(data, options) { if (isFullBranchFilterMode(this)) { return this._loadParentsOrChildren(data, options, true) } return (0, _deferred.when)(data) } _updateHasItemsMap(options) { const { parentIds: parentIds } = options.storeLoadOptions; if (parentIds) { for (let i = 0; i < parentIds.length; i++) { this._isChildrenLoaded[parentIds[i]] = true } } } _getKeyInfo() { return { key: () => "key", keyOf: data => data.key } } _processChanges(changes) { let processedChanges = []; changes.forEach((change => { if ("insert" === change.type) { processedChanges = processedChanges.concat(this._applyInsert(change)) } else if ("remove" === change.type) { processedChanges = processedChanges.concat(this._applyRemove(change)) } else if ("update" === change.type) { processedChanges.push({ type: change.type, key: change.key, data: { data: change.data } }) } })); return processedChanges } _handleChanging(e) { super._handleChanging.apply(this, arguments); e.postProcessChanges = changes => { const changesToProcess = changes.filter((item => "update" === item.type)); return this._processChanges(changesToProcess) } } _applyBatch(changes) { const processedChanges = this._processChanges(changes); super._applyBatch(processedChanges) } _setHasItems(node, value) { const hasItemsSetter = this._hasItemsSetter; node.hasChildren = value; if (hasItemsSetter && node.data) { hasItemsSetter(node.data, value) } } _applyInsert(change) { const that = this; const baseChanges = []; const parentId = that.parentKeyOf(change.data); const parentNode = that.getNodeByKey(parentId); if (parentNode) { const rootValue = that.option("rootValue"); const node = that._convertItemToNode(change.data, rootValue, that._nodeByKey); node.hasChildren = false; node.level = parentNode.level + 1; node.visible = true; parentNode.children.push(node); that._isChildrenLoaded[node.key] = true; that._setHasItems(parentNode, true); if ((!parentNode.parent || that.isRowExpanded(parentNode.key)) && void 0 !== change.index) { let index = that.items().indexOf(parentNode) + 1; index += change.index >= 0 ? Math.min(change.index, parentNode.children.length) : parentNode.children.length; baseChanges.push({ type: change.type, data: node, index: index }) } } return baseChanges } _needToCopyDataObject() { return false } _applyRemove(change) { let baseChanges = []; const node = this.getNodeByKey(change.key); const parentNode = node && node.parent; if (parentNode) { const index = parentNode.children.indexOf(node); if (index >= 0) { parentNode.children.splice(index, 1); if (!parentNode.children.length) { this._setHasItems(parentNode, false) } baseChanges.push(change); baseChanges = baseChanges.concat(this.getChildNodeKeys(change.key).map((key => ({ type: change.type, key: key })))) } } return baseChanges } _handleDataLoaded(options) { const data = options.data = this._convertDataToPlainStructure(options.data); if (!options.remoteOperations.filtering && options.loadOptions.filter) { options.fullData = queryByOptions((0, _query.default)(options.data), { sort: options.loadOptions && options.loadOptions.sort }).toArray() } this._updateHasItemsMap(options); super._handleDataLoaded(options); if (data.isConverted && this._cachedStoreData) { this._cachedStoreData.isConverted = true } } _fillNodes(nodes, options, expandedRowKeys, level) { const isFullBranch = isFullBranchFilterMode(this); level = level || 0; for (let i = 0; i < nodes.length; i++) { const node = nodes[i]; let needToExpand = false; this._fillNodes(nodes[i].children, options, expandedRowKeys, level + 1); node.level = level; node.hasChildren = this._calculateHasItems(node, options); if (node.visible && node.hasChildren) { if (isFullBranch) { if (node.children.filter((node => node.visible)).length) { needToExpand = true } else if (node.children.length) { _m_core.default.foreachNodes(node.children, (node => { node.visible = true })) } } else { needToExpand = true } if (options.expandVisibleNodes && needToExpand) { expandedRowKeys.push(node.key) } } if (node.visible || node.hasChildren) { node.parent.hasChildren = true } } } _processTreeStructure(options, visibleItems) { let { data: data } = options; const { parentIds: parentIds } = options.storeLoadOptions; const expandedRowKeys = []; if (parentIds && parentIds.length || this._isReload) { if (options.fullData && options.fullData.length > options.data.length) { data = options.fullData; visibleItems = visibleItems || options.data } this._rootNode = this._createNodesByItems(data, visibleItems); if (!this._rootNode) { options.data = (new _deferred.Deferred).reject(_ui.default.Error("E1046", this.getKeyExpr())); return } this._fillNodes(this._rootNode.children, options, expandedRowKeys); this._isNodesInitializing = true; if (options.collapseVisibleNodes || expandedRowKeys.length) { this.option("expandedRowKeys", expandedRowKeys) } this._isReload = false; this.executeAction("onNodesInitialized", { root: this._rootNode }); this._isNodesInitializing = false } const resultData = []; this._fillVisibleItemsByNodes(this._rootNode.children, options, resultData); options.data = resultData; this._totalItemsCount = resultData.length } _handleDataLoadedCore(options) { const that = this; const { data: data } = options; const filter = options.storeLoadOptions.filter || options.loadOptions.filter; const filterMode = that.option("filterMode"); let visibleItems; const { parentIds: parentIds } = options.storeLoadOptions; const needLoadParents = filter && (!parentIds || !parentIds.length) && "standard" !== filterMode; if (!options.isCustomLoading) { if (needLoadParents) { const d = options.data = new _deferred.Deferred; if ("matchOnly" === filterMode) { visibleItems = data } return that._loadParents(data, options).done((data => { that._loadChildrenIfNeed(data, options).done((data => { options.data = data; that._processTreeStructure(options, visibleItems); super._handleDataLoadedCore.call(that, options); d.resolve(options.data) })) })).fail(d.reject) } that._processTreeStructure(options) } super._handleDataLoadedCore(options) } _handlePush(_ref) { let { changes: changes } = _ref; const reshapeOnPush = this._dataSource._reshapeOnPush; const isNeedReshape = reshapeOnPush && !!changes.length; if (isNeedReshape) { this._isReload = true } changes.forEach((change => { change.index ?? (change.index = -1) })); super._handlePush.apply(this, arguments) } init(dataSource, remoteOperations) { super.init.apply(this, arguments); const dataStructure = this.option("dataStructure"); this._keyGetter = this._createKeyGetter(); this._parentIdGetter = this.createParentIdGetter(); this._hasItemsGetter = this._createHasItemsGetter(); this._hasItemsSetter = this._createHasItemsSetter(); if ("tree" === dataStructure) { this._itemsGetter = this._createItemsGetter(); this._keySetter = this._createKeySetter(); this._parentIdSetter = this.createParentIdSetter() } this._nodeByKey = {}; this._isChildrenLoaded = {}; this._totalItemsCount = 0; this.createAction("onNodesInitialized") } getKeyExpr() { const store = this.store(); const key = store && store.key(); const keyExpr = this.option("keyExpr"); if ((0, _type.isDefined)(key) && (0, _type.isDefined)(keyExpr)) { if (!(0, _common.equalByValue)(key, keyExpr)) { throw _ui.default.Error("E1044") } } return key || keyExpr || "id" } keyOf(data) { return this._keyGetter && this._keyGetter(data) } parentKeyOf(data) { return this._parentIdGetter && this._parentIdGetter(data) } getRootNode() { return this._rootNode } totalItemsCount() { return this._totalItemsCount + this._totalCountCorrection } isRowExpanded(key, cache) { if (cache) { let { isExpandedByKey: isExpandedByKey } = cache; if (!isExpandedByKey) { const expandedRowKeys = this.option("expandedRowKeys") ?? []; isExpandedByKey = cache.isExpandedByKey = {}; expandedRowKeys.forEach((key => { isExpandedByKey[key] = true })) } return !!isExpandedByKey[key] } const indexExpandedNodeKey = _m_utils.default.getIndexByKey(key, this.option("expandedRowKeys"), null); return indexExpandedNodeKey >= 0 } _changeRowExpandCore(key) { const expandedRowKeys = this.option("expandedRowKeys").slice(); const indexExpandedNodeKey = _m_utils.default.getIndexByKey(key, expandedRowKeys, null); if (indexExpandedNodeKey < 0) { expandedRowKeys.push(key) } else { expandedRowKeys.splice(indexExpandedNodeKey, 1) } this.option("expandedRowKeys", expandedRowKeys) } changeRowExpand(key) { this._changeRowExpandCore(key); return this._isNodesInitializing ? (new _deferred.Deferred).resolve() : this.load() } getNodeByKey(key) { if (this._nodeByKey) { return this._nodeByKey[key] } } getNodeLeafKeys() { const that = this; const result = []; const keys = that._rootNode ? [that._rootNode.key] : []; keys.forEach((key => { const node = that.getNodeByKey(key); node && _m_core.default.foreachNodes([node], (childNode => { !childNode.children.length && result.push(childNode.key) })) })); return result } getChildNodeKeys(parentKey) { const node = this.getNodeByKey(parentKey); const childrenKeys = []; node && _m_core.default.foreachNodes(node.children, (childNode => { childrenKeys.push(childNode.key) })); return childrenKeys } loadDescendants(keys, childrenOnly) { const that = this; const d = new _deferred.Deferred; const remoteOperations = that.remoteOperations(); if ((0, _type.isDefined)(keys)) { keys = Array.isArray(keys) ? keys : [keys] } else { keys = that.getNodeLeafKeys() } if (!remoteOperations.filtering || !keys.length) { return d.resolve() } const loadOptions = that._dataSource._createStoreLoadOptions(); loadOptions.parentIds = keys; that.load(loadOptions).done((() => { if (!childrenOnly) { const childKeys = function(that, keys) { const childKeys = []; keys.forEach((key => { const node = that.getNodeByKey(key); node && node.children.forEach((child => { childKeys.push(child.key) })) })); return childKeys }(that, keys); if (childKeys.length) { that.loadDescendants(childKeys, childrenOnly).done(d.resolve).fail(d.reject); return } } d.resolve() })).fail(d.reject); return d.promise() } forEachNode() { let nodes = []; let callback; if (1 === arguments.length) { callback = arguments[0]; const rootNode = this.getRootNode(); nodes = rootNode && rootNode.children || [] } else if (2 === arguments.length) { callback = arguments[1]; nodes = arguments[0]; nodes = Array.isArray(nodes) ? nodes : [nodes] } _m_core.default.foreachNodes(nodes, callback) } } let DataSourceAdapterTreeListType = DataSourceAdapterTreeList; exports.default = { extend(extender) { DataSourceAdapterTreeListType = extender(DataSourceAdapterTreeListType) }, create: component => new DataSourceAdapterTreeListType(component) } }, 17629: /*!*********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/editing/m_editing.js ***! \*********************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { __webpack_require__( /*! ../module_not_extended/editor_factory */ 29900); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109)); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/widget/ui.errors */ 96688)); var _m_editing = __webpack_require__( /*! ../../../grids/grid_core/editing/m_editing */ 22324); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../../../grids/grid_core/m_utils */ 60082)); var _m_core = _interopRequireDefault(__webpack_require__( /*! ../m_core */ 12500)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } class EditingController extends _m_editing.editingModule.controllers.editing { _generateNewItem(key) { const item = super._generateNewItem(key); item.data = { key: key }; item.children = []; item.level = 0; item.parentKey = this.option("rootValue"); return item } _isProcessedItem() { return true } _setInsertAfterOrBeforeKey(change, parentKey) { if (void 0 !== parentKey && parentKey !== this.option("rootValue")) { change.insertAfterKey = parentKey } else { super._setInsertAfterOrBeforeKey.apply(this, arguments) } } _getLoadedRowIndex(items, change) { const dataSourceAdapter = this._dataController.dataSource(); const parentKey = null === dataSourceAdapter || void 0 === dataSourceAdapter ? void 0 : dataSourceAdapter.parentKeyOf(change.data); if (void 0 !== parentKey && parentKey !== this.option("rootValue")) { const rowIndex = _m_utils.default.getIndexByKey(parentKey, items); if (rowIndex >= 0 && this._dataController.isRowExpanded(parentKey)) { return rowIndex + 1 } return -1 } return super._getLoadedRowIndex.apply(this, arguments) } _isEditColumnVisible() { const result = super._isEditColumnVisible.apply(this, arguments); const editingOptions = this.option("editing"); return result || editingOptions.allowAdding } _isDefaultButtonVisible(button, options) { const result = super._isDefaultButtonVisible.apply(this, arguments); const { row: row } = options; if ("add" === button.name) { return this.allowAdding(options) && row.rowIndex !== this._getVisibleEditRowIndex() && !(row.removed || row.isNewRow) } return result } _getEditingButtons(options) { const buttons = super._getEditingButtons.apply(this, arguments); if (!options.column.buttons) { buttons.unshift(this._getButtonConfig("add", options)) } return buttons } _beforeSaveEditData(change) { const result = super._beforeSaveEditData.apply(this, arguments); if (change && "insert" !== change.type) { var _this$_dataController; const store = null === (_this$_dataController = this._dataController) || void 0 === _this$_dataController ? void 0 : _this$_dataController.store(); const key = null === store || void 0 === store ? void 0 : store.key(); if (!(0, _type.isDefined)(key)) { throw _ui.default.Error("E1045") } } return result } addRowByRowIndex(rowIndex) { const row = this._dataController.getVisibleRows()[rowIndex]; return this.addRow(row ? row.key : void 0) } addRow(key) { if (void 0 === key) { key = this.option("rootValue") } return super.addRow.call(this, key) } _addRowCore(data, parentKey, oldEditRowIndex) { const rootValue = this.option("rootValue"); const dataSourceAdapter = this._dataController.dataSource(); const parentKeyGetter = dataSourceAdapter.createParentIdGetter(); parentKey = parentKeyGetter(data); if (void 0 !== parentKey && parentKey !== rootValue && !this._dataController.isRowExpanded(parentKey)) { const deferred = new _deferred.Deferred; this._dataController.expandRow(parentKey).done((() => { setTimeout((() => { super._addRowCore.call(this, data, parentKey, oldEditRowIndex).done(deferred.resolve).fail(deferred.reject) })) })).fail(deferred.reject); return deferred.promise() } return super._addRowCore.call(this, data, parentKey, oldEditRowIndex) } _initNewRow(options, parentKey) { const dataSourceAdapter = this._dataController.dataSource(); const parentIdSetter = dataSourceAdapter.createParentIdSetter(); parentIdSetter(options.data, parentKey); return super._initNewRow.apply(this, arguments) } allowAdding(options) { return this._allowEditAction("allowAdding", options) } _needToCloseEditableCell($targetElement) { return super._needToCloseEditableCell.apply(this, arguments) || $targetElement.closest(".dx-treelist-icon-container").length && this.isEditing() } getButtonLocalizationNames() { const names = super.getButtonLocalizationNames.apply(this); names.add = "dxTreeList-editingAddRowToNode"; return names } } _m_core.default.registerModule("editing", { defaultOptions: () => (0, _extend.extend)(true, _m_editing.editingModule.defaultOptions(), { editing: { texts: { addRowToNode: _message.default.format("dxTreeList-editingAddRowToNode") } } }), controllers: { editing: EditingController }, extenders: { controllers: { data: Base => class extends((0, _m_editing.dataControllerEditingExtenderMixin)(Base)) { changeRowExpand() { this._editingController.refresh(); return super.changeRowExpand.apply(this, arguments) } } }, views: { rowsView: Base => class extends(_m_editing.editingModule.extenders.views.rowsView(Base)) { _renderCellCommandContent($container, options) { const editingController = this._editingController; const isEditRow = options.row && editingController.isEditRow(options.row.rowIndex); const isEditing = options.isEditing || isEditRow; if (!options.isOnForm && !isEditing) { return super._renderCellCommandContent.apply(this, arguments) } return false } validateClick(e) { const $targetElement = (0, _renderer.default)(e.event.target); const originalClickHandler = "dxdblclick" === e.event.type ? super._rowDblClick : super._rowClick; if ($targetElement.closest(".dx-select-checkbox").length) { return false } return !this.needToCallOriginalClickHandler(e, originalClickHandler) } needToCallOriginalClickHandler(e, originalClickHandler) { const $targetElement = (0, _renderer.default)(e.event.target); if (!$targetElement.closest(".dx-treelist-icon-container").length) { originalClickHandler.call(this, e); return true } return false } _rowClick(e) { if (this.validateClick(e)) { super._rowClickTreeListHack.apply(this, arguments) } } _rowDblClick(e) { if (this.validateClick(e)) { super._rowDblClickTreeListHack.apply(this, arguments) } } }, headerPanel: _m_editing.editingModule.extenders.views.headerPanel } } }) }, 79873: /*!************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/m_columns_controller.js ***! \************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922); var _m_columns_controller = __webpack_require__( /*! ../../grids/grid_core/columns_controller/m_columns_controller */ 10279); var _m_core = (obj = __webpack_require__( /*! ./m_core */ 12500), obj && obj.__esModule ? obj : { default: obj }); var obj; class TreeListColumnsController extends _m_columns_controller.ColumnsController { _getFirstItems(dataSourceAdapter) { return super._getFirstItems(dataSourceAdapter).map((node => node.data)) } getFirstDataColumnIndex() { const visibleColumns = this.getVisibleColumns(); const visibleColumnsLength = visibleColumns.length; let firstDataColumnIndex = 0; for (let i = 0; i <= visibleColumnsLength - 1; i++) { if (!(0, _type.isDefined)(visibleColumns[i].command)) { firstDataColumnIndex = visibleColumns[i].index; break } } return firstDataColumnIndex } } _m_core.default.registerModule("columns", { defaultOptions: _m_columns_controller.columnsControllerModule.defaultOptions, controllers: { columns: TreeListColumnsController } }) }, 12500: /*!**********************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/m_core.js ***! \**********************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306); var _m_modules = (obj = __webpack_require__( /*! ../../grids/grid_core/m_modules */ 15943), obj && obj.__esModule ? obj : { default: obj }); var obj; exports.default = (0, _extend.extend)({}, _m_modules.default, { modules: [], foreachNodes(nodes, callBack, ignoreHasChildren) { for (let i = 0; i < nodes.length; i++) { if (false !== callBack(nodes[i]) && (ignoreHasChildren || nodes[i].hasChildren) && nodes[i].children.length) { this.foreachNodes(nodes[i].children, callBack, ignoreHasChildren) } } } }) }, 50226: /*!***********************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/m_focus.js ***! \***********************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _deferred = __webpack_require__( /*! ../../../core/utils/deferred */ 62754); var _m_focus = __webpack_require__( /*! ../../grids/grid_core/focus/m_focus */ 5325); var _m_core = (obj = __webpack_require__( /*! ./m_core */ 12500), obj && obj.__esModule ? obj : { default: obj }); var obj; function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } _m_core.default.registerModule("focus", _extends({}, _m_focus.focusModule, { extenders: _extends({}, _m_focus.focusModule.extenders, { controllers: _extends({}, _m_focus.focusModule.extenders.controllers, { data: Base => class extends(_m_focus.focusModule.extenders.controllers.data(Base)) { changeRowExpand(key) { if (this.option("focusedRowEnabled") && this.isRowExpanded(key)) { if (this._isFocusedRowInside(key)) { this.option("focusedRowKey", key) } } return super.changeRowExpand.apply(this, arguments) } _isFocusedRowInside(parentKey) { const focusedRowKey = this.option("focusedRowKey"); const rowIndex = this.getRowIndexByKey(focusedRowKey); const focusedRow = rowIndex >= 0 && this.getVisibleRows()[rowIndex]; let parent = focusedRow && focusedRow.node.parent; while (parent) { if (parent.key === parentKey) { return true } parent = parent.parent } return false } getParentKey(key) { const dataSource = this._dataSource; const node = this.getNodeByKey(key); const d = new _deferred.Deferred; if (node) { d.resolve(node.parent ? node.parent.key : void 0) } else { dataSource.load({ filter: [dataSource.getKeyExpr(), "=", key] }).done((items => { const parentData = items[0]; if (parentData) { d.resolve(dataSource.parentKeyOf(parentData)) } else { d.resolve() } })).fail(d.reject) } return d.promise() } expandAscendants(key) { const that = this; const dataSource = that._dataSource; const d = new _deferred.Deferred; that.getParentKey(key).done((parentKey => { if (dataSource && void 0 !== parentKey && parentKey !== that.option("rootValue")) { dataSource._isNodesInitializing = true; that.expandRow(parentKey); dataSource._isNodesInitializing = false; that.expandAscendants(parentKey).done(d.resolve).fail(d.reject) } else { d.resolve() } })).fail(d.reject); return d.promise() } getPageIndexByKey(key) { const that = this; const dataSource = that._dataSource; const d = new _deferred.Deferred; that.expandAscendants(key).done((() => { dataSource.load({ parentIds: [] }).done((nodes => { const offset = function(items, callback) { let result = -1; items.forEach(((node, index) => { if (callback(node)) { result = index } })); return result }(nodes, (node => that.keyOf(node.data) === key)); let pageIndex = -1; if (offset >= 0) { pageIndex = Math.floor(offset / that.pageSize()) } d.resolve(pageIndex) })).fail(d.reject) })).fail(d.reject); return d.promise() } } }) }) })) }, 94907: /*!***************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/m_grid_view.js ***! \***************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_grid_view = __webpack_require__( /*! ../../grids/grid_core/views/m_grid_view */ 28016); var _m_core = (obj = __webpack_require__( /*! ./m_core */ 12500), obj && obj.__esModule ? obj : { default: obj }); var obj; function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } class TreeListResizingController extends _m_grid_view.ResizingController { _getWidgetAriaLabel() { return "dxTreeList-ariaTreeList" } _toggleBestFitMode(isBestFit) { super._toggleBestFitMode(isBestFit); const $rowsTable = this._rowsView.getTableElement(); $rowsTable.find(".dx-treelist-cell-expandable").toggleClass(this.addWidgetPrefix("best-fit"), isBestFit) } } _m_core.default.registerModule("gridView", { defaultOptions: _m_grid_view.gridViewModule.defaultOptions, controllers: _extends({}, _m_grid_view.gridViewModule.controllers, { resizing: TreeListResizingController }), views: _m_grid_view.gridViewModule.views }) }, 38886: /*!*************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/m_keyboard_navigation.js ***! \*************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306); var _m_keyboard_navigation = __webpack_require__( /*! ../../grids/grid_core/keyboard_navigation/m_keyboard_navigation */ 31822); var _scrollable_a11y = __webpack_require__( /*! ../../grids/grid_core/keyboard_navigation/scrollable_a11y */ 91355); var _m_core = (obj = __webpack_require__( /*! ./m_core */ 12500), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("keyboardNavigation", (0, _extend.extend)(true, {}, _m_keyboard_navigation.keyboardNavigationModule, { extenders: { controllers: { keyboardNavigation: Base => class extends((0, _scrollable_a11y.keyboardNavigationScrollableA11yExtender)(Base)) { _leftRightKeysHandler(eventArgs, _isEditing) { const rowIndex = this.getVisibleRowIndex(); const dataController = this._dataController; if (eventArgs.ctrl) { const directionCode = this._getDirectionCodeByKey(eventArgs.keyName); const key = dataController.getKeyByRowIndex(rowIndex); if ("nextInRow" === directionCode) { dataController.expandRow(key) } else { dataController.collapseRow(key) } } else { return super._leftRightKeysHandler.apply(this, arguments) } } } } } })) }, 31580: /*!*******************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/m_master_detail.js ***! \*******************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306); var _m_master_detail = __webpack_require__( /*! ../../grids/grid_core/master_detail/m_master_detail */ 82802); var _m_core = (obj = __webpack_require__( /*! ./m_core */ 12500), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("masterDetail", (0, _extend.extend)(true, {}, _m_master_detail.masterDetailModule, { extenders: { controllers: { data: Base => class extends((0, _m_master_detail.dataMasterDetailExtenderMixin)(Base)) { isRowExpanded() { return this.isRowExpandedHack.apply(this, arguments) } _processItems() { return this._processItemsHack.apply(this, arguments) } _processDataItem() { return this._processDataItemHack.apply(this, arguments) } } } } })) }, 13477: /*!*******************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/m_state_storing.js ***! \*******************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_state_storing = __webpack_require__( /*! ../../grids/grid_core/state_storing/m_state_storing */ 12440); var _m_core = (obj = __webpack_require__( /*! ./m_core */ 12500), obj && obj.__esModule ? obj : { default: obj }); var obj; function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } _m_core.default.registerModule("stateStoring", _extends({}, _m_state_storing.stateStoringModule, { extenders: _extends({}, _m_state_storing.stateStoringModule.extenders, { controllers: _extends({}, _m_state_storing.stateStoringModule.extenders.controllers, { stateStoring: Base => class extends(_m_state_storing.stateStoringModule.extenders.controllers.stateStoring(Base)) { applyState(state) { super.applyState(state); this.option("expandedRowKeys", state.expandedRowKeys ? state.expandedRowKeys.slice() : []) } }, data: Base => class extends(_m_state_storing.stateStoringModule.extenders.controllers.data(Base)) { getUserState() { const state = super.getUserState(); if (!this.option("autoExpandAll")) { state.expandedRowKeys = this.option("expandedRowKeys") } return state } } }) }) })) }, 99751: /*!****************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/m_validating.js ***! \****************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_validating = __webpack_require__( /*! ../../grids/grid_core/validating/m_validating */ 39830); var _m_core = (obj = __webpack_require__( /*! ./m_core */ 12500), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("validating", { defaultOptions: _m_validating.validatingModule.defaultOptions, controllers: _m_validating.validatingModule.controllers, extenders: { controllers: { editing: Base => class extends(_m_validating.validatingModule.extenders.controllers.editing(Base)) { processDataItem(item) { super.processDataItemTreeListHack.apply(this, arguments) } processItems(items, e) { return super.processItemsTreeListHack.apply(this, arguments) } }, editorFactory: _m_validating.validatingModule.extenders.controllers.editorFactory }, views: _m_validating.validatingModule.extenders.views } }) }, 26058: /*!***********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/m_virtual_scrolling.js ***! \***********************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306); var _m_virtual_scrolling = __webpack_require__( /*! ../../grids/grid_core/virtual_scrolling/m_virtual_scrolling */ 92018); var _m_data_source_adapter = _interopRequireDefault(__webpack_require__( /*! ./data_source_adapter/m_data_source_adapter */ 22821)); var _m_core = _interopRequireDefault(__webpack_require__( /*! ./m_core */ 12500)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const oldDefaultOptions = _m_virtual_scrolling.virtualScrollingModule.defaultOptions; _m_virtual_scrolling.virtualScrollingModule.extenders.controllers.data = Base => class extends((0, _m_virtual_scrolling.data)(Base)) { _loadOnOptionChange() { var _this$_dataSource; const virtualScrollController = null === (_this$_dataSource = this._dataSource) || void 0 === _this$_dataSource ? void 0 : _this$_dataSource._virtualScrollController; null === virtualScrollController || void 0 === virtualScrollController || virtualScrollController.reset(); super._loadOnOptionChange() } }; _m_core.default.registerModule("virtualScrolling", _extends({}, _m_virtual_scrolling.virtualScrollingModule, { defaultOptions: () => (0, _extend.extend)(true, oldDefaultOptions(), { scrolling: { mode: "virtual" } }) })); _m_data_source_adapter.default.extend((Base => class extends((0, _m_virtual_scrolling.dataSourceAdapterExtender)(Base)) { changeRowExpand() { return super.changeRowExpand.apply(this, arguments).done((() => { const viewportItemIndex = this.getViewportItemIndex(); viewportItemIndex >= 0 && this.setViewportItemIndex(viewportItemIndex) })) } })) }, 1977: /*!************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/m_widget.js ***! \************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _m_widget_base = (obj = __webpack_require__( /*! ./m_widget_base */ 14126), obj && obj.__esModule ? obj : { default: obj }); var obj; __webpack_require__( /*! ./m_state_storing */ 13477); __webpack_require__( /*! ./module_not_extended/column_chooser */ 92026); __webpack_require__( /*! ./m_master_detail */ 31580); __webpack_require__( /*! ./editing/m_editing */ 17629); __webpack_require__( /*! ./module_not_extended/editing_row_based */ 64757); __webpack_require__( /*! ./module_not_extended/editing_form_based */ 45998); __webpack_require__( /*! ./module_not_extended/editing_cell_based */ 7446); __webpack_require__( /*! ./m_validating */ 99751); __webpack_require__( /*! ./m_virtual_scrolling */ 26058); __webpack_require__( /*! ./module_not_extended/filter_row */ 98439); __webpack_require__( /*! ./module_not_extended/header_filter */ 26763); __webpack_require__( /*! ./module_not_extended/filter_sync */ 1440); __webpack_require__( /*! ./module_not_extended/filter_builder */ 49248); __webpack_require__( /*! ./module_not_extended/filter_panel */ 86737); __webpack_require__( /*! ./module_not_extended/pager */ 84214); __webpack_require__( /*! ./module_not_extended/columns_resizing_reordering */ 43468); __webpack_require__( /*! ./module_not_extended/column_fixing */ 50776); __webpack_require__( /*! ./module_not_extended/adaptivity */ 43301); __webpack_require__( /*! ./selection/m_selection */ 91445); __webpack_require__( /*! ./module_not_extended/search */ 1272); __webpack_require__( /*! ./m_keyboard_navigation */ 38886); __webpack_require__( /*! ./module_not_extended/virtual_columns */ 75188); __webpack_require__( /*! ./m_focus */ 50226); __webpack_require__( /*! ./module_not_extended/row_dragging */ 31937); exports.default = _m_widget_base.default }, 14126: /*!*****************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/m_widget_base.js ***! \*****************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; __webpack_require__( /*! ./module_not_extended/column_headers */ 25052); __webpack_require__( /*! ./m_columns_controller */ 79873); __webpack_require__( /*! ./data_controller/m_data_controller */ 26686); __webpack_require__( /*! ./module_not_extended/sorting */ 7138); __webpack_require__( /*! ./rows/m_rows */ 31397); __webpack_require__( /*! ./module_not_extended/context_menu */ 87454); __webpack_require__( /*! ./module_not_extended/error_handling */ 84973); __webpack_require__( /*! ./m_grid_view */ 94907); __webpack_require__( /*! ./module_not_extended/header_panel */ 37980); var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 99393)); var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922); var _themes = __webpack_require__( /*! ../../../ui/themes */ 75811); var _m_utils = _interopRequireDefault(__webpack_require__( /*! ../../grids/grid_core/m_utils */ 60082)); var _m_widget_base = _interopRequireDefault(__webpack_require__( /*! ../../grids/grid_core/m_widget_base */ 67880)); var _m_core = _interopRequireDefault(__webpack_require__( /*! ./m_core */ 12500)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } _m_core.default.registerModulesOrder(["stateStoring", "columns", "selection", "editorFactory", "columnChooser", "editingRowBased", "editingFormBased", "editingCellBased", "editing", "grouping", "masterDetail", "validating", "adaptivity", "data", "virtualScrolling", "columnHeaders", "filterRow", "headerPanel", "headerFilter", "sorting", "search", "rows", "pager", "columnsResizingReordering", "contextMenu", "keyboardNavigation", "errorHandling", "summary", "columnFixing", "export", "gridView"]); class TreeList extends _m_widget_base.default { _initMarkup() { super._initMarkup.apply(this, arguments); this.$element().addClass("dx-treelist"); this.getView("gridView").render(this.$element()) } static registerModule() { _m_core.default.registerModule.apply(_m_core.default, arguments) } _defaultOptionsRules() { return super._defaultOptionsRules().concat([{ device: () => (0, _themes.isMaterialBased)(), options: { showRowLines: true, showColumnLines: false, headerFilter: { height: 315 }, editing: { useIcons: true } } }]) } _init() { super._init(); if (!this.option("_disableDeprecationWarnings")) { _m_utils.default.logHeaderFilterDeprecatedWarningIfNeed(this) } _m_core.default.processModules(this, _m_core.default); _m_core.default.callModuleItemsMethod(this, "init") } getGridCoreHelper() { return _m_core.default } focus(element) { super.focus(); if ((0, _type.isDefined)(element)) { this.getController("keyboardNavigation").focus(element) } } }(0, _component_registrator.default)("dxTreeList", TreeList); exports.default = TreeList }, 43301: /*!**********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/adaptivity.js ***! \**********************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_adaptivity = __webpack_require__( /*! ../../../grids/grid_core/adaptivity/m_adaptivity */ 18107); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("adaptivity", _m_adaptivity.adaptivityModule) }, 92026: /*!**************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/column_chooser.js ***! \**************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_column_chooser = __webpack_require__( /*! ../../../grids/grid_core/column_chooser/m_column_chooser */ 71184); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("columnChooser", _m_column_chooser.columnChooserModule) }, 50776: /*!*************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/column_fixing.js ***! \*************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_column_fixing = __webpack_require__( /*! ../../../grids/grid_core/column_fixing/m_column_fixing */ 53424); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("columnFixing", _m_column_fixing.columnFixingModule) }, 25052: /*!**************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/column_headers.js ***! \**************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_column_headers = __webpack_require__( /*! ../../../grids/grid_core/column_headers/m_column_headers */ 14509); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("columnHeaders", _m_column_headers.columnHeadersModule) }, 43468: /*!***************************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/columns_resizing_reordering.js ***! \***************************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_columns_resizing_reordering = __webpack_require__( /*! ../../../grids/grid_core/columns_resizing_reordering/m_columns_resizing_reordering */ 49505); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("columnsResizingReordering", _m_columns_resizing_reordering.columnsResizingReorderingModule) }, 87454: /*!************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/context_menu.js ***! \************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_context_menu = __webpack_require__( /*! ../../../grids/grid_core/context_menu/m_context_menu */ 69823); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("contextMenu", _m_context_menu.contextMenuModule) }, 7446: /*!******************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/editing_cell_based.js ***! \******************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_editing_cell_based = __webpack_require__( /*! ../../../grids/grid_core/editing/m_editing_cell_based */ 68802); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("editingCellBased", _m_editing_cell_based.editingCellBasedModule) }, 45998: /*!******************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/editing_form_based.js ***! \******************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_editing_form_based = __webpack_require__( /*! ../../../grids/grid_core/editing/m_editing_form_based */ 99211); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("editingFormBased", _m_editing_form_based.editingFormBasedModule) }, 64757: /*!*****************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/editing_row_based.js ***! \*****************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_editing_row_based = __webpack_require__( /*! ../../../grids/grid_core/editing/m_editing_row_based */ 55597); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("editingRowBased", _m_editing_row_based.editingRowBasedModule) }, 29900: /*!**************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/editor_factory.js ***! \**************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_editor_factory = __webpack_require__( /*! ../../../grids/grid_core/editor_factory/m_editor_factory */ 80070); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("editorFactory", _m_editor_factory.editorFactoryModule) }, 84973: /*!**************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/error_handling.js ***! \**************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_error_handling = __webpack_require__( /*! ../../../grids/grid_core/error_handling/m_error_handling */ 31152); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("errorHandling", _m_error_handling.errorHandlingModule) }, 49248: /*!**************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/filter_builder.js ***! \**************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_filter_builder = __webpack_require__( /*! ../../../grids/grid_core/filter/m_filter_builder */ 62690); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("filterBuilder", _m_filter_builder.filterBuilderModule) }, 86737: /*!************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/filter_panel.js ***! \************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_filter_panel = __webpack_require__( /*! ../../../grids/grid_core/filter/m_filter_panel */ 4062); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("filterPanel", _m_filter_panel.filterPanelModule) }, 98439: /*!**********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/filter_row.js ***! \**********************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_filter_row = __webpack_require__( /*! ../../../grids/grid_core/filter/m_filter_row */ 12302); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("filterRow", _m_filter_row.filterRowModule) }, 1440: /*!***********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/filter_sync.js ***! \***********************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_filter_sync = __webpack_require__( /*! ../../../grids/grid_core/filter/m_filter_sync */ 14407); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("filterSync", _m_filter_sync.filterSyncModule) }, 26763: /*!*************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/header_filter.js ***! \*************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_header_filter = __webpack_require__( /*! ../../../grids/grid_core/header_filter/m_header_filter */ 68796); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("headerFilter", _m_header_filter.headerFilterModule) }, 37980: /*!************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/header_panel.js ***! \************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_header_panel = __webpack_require__( /*! ../../../grids/grid_core/header_panel/m_header_panel */ 92468); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("headerPanel", _m_header_panel.headerPanelModule) }, 84214: /*!*****************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/pager.js ***! \*****************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_pager = __webpack_require__( /*! ../../../grids/grid_core/pager/m_pager */ 3990); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("pager", _m_pager.pagerModule) }, 31937: /*!************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/row_dragging.js ***! \************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_row_dragging = __webpack_require__( /*! ../../../grids/grid_core/row_dragging/m_row_dragging */ 88351); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("rowDragging", _m_row_dragging.rowDraggingModule) }, 1272: /*!******************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/search.js ***! \******************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_search = __webpack_require__( /*! ../../../grids/grid_core/search/m_search */ 92021); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("search", _m_search.searchModule) }, 7138: /*!*******************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/sorting.js ***! \*******************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_sorting = __webpack_require__( /*! ../../../grids/grid_core/sorting/m_sorting */ 11590); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("sorting", _m_sorting.sortingModule) }, 75188: /*!***************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/module_not_extended/virtual_columns.js ***! \***************************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _m_virtual_columns = __webpack_require__( /*! ../../../grids/grid_core/virtual_columns/m_virtual_columns */ 87482); var _m_core = (obj = __webpack_require__( /*! ../m_core */ 12500), obj && obj.__esModule ? obj : { default: obj }); var obj; _m_core.default.registerModule("virtualColumns", _m_virtual_columns.virtualColumnsModule) }, 31397: /*!***************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/rows/m_rows.js ***! \***************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../../events/core/events_engine */ 55994)); var _remove = __webpack_require__( /*! ../../../../events/remove */ 29007); var _m_rows_view = __webpack_require__( /*! ../../../grids/grid_core/views/m_rows_view */ 35095); var _m_core = _interopRequireDefault(__webpack_require__( /*! ../m_core */ 12500)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const createIcon = function(hasIcon, isExpanded) { const $iconElement = (0, _renderer.default)("
").addClass("dx-treelist-empty-space"); if (hasIcon) { $iconElement.toggleClass("dx-treelist-expanded", isExpanded).toggleClass("dx-treelist-collapsed", !isExpanded).append((0, _renderer.default)("")) } return $iconElement }; class TreeListRowsView extends _m_rows_view.RowsView { _renderIconContainer($container, options) { const $iconContainer = (0, _renderer.default)("
").addClass("dx-treelist-icon-container").appendTo($container); if (options.watch) { const dispose = options.watch((() => [options.row.level, options.row.isExpanded, options.row.node.hasChildren]), (() => { $iconContainer.empty(); this._renderIcons($iconContainer, options) })); _events_engine.default.on($iconContainer, _remove.removeEvent, dispose) } $container.addClass("dx-treelist-cell-expandable"); return this._renderIcons($iconContainer, options) } _renderIcons($iconContainer, options) { const { row: row } = options; const { level: level } = row; for (let i = 0; i <= level; i++) { $iconContainer.append(createIcon(i === level && row.node.hasChildren, row.isExpanded)) } return $iconContainer } _renderCellCommandContent(container, model) { this._renderIconContainer(container, model); return true } _processTemplate(template, options) { var _options$column; const that = this; let resultTemplate; const renderingTemplate = super._processTemplate(template); const firstDataColumnIndex = that._columnsController.getFirstDataColumnIndex(); if (renderingTemplate && (null === (_options$column = options.column) || void 0 === _options$column ? void 0 : _options$column.index) === firstDataColumnIndex) { resultTemplate = { render(options) { const $container = options.container; if (that._renderCellCommandContent($container, options.model)) { options.container = function($container) { return (0, _renderer.default)("
").addClass("dx-treelist-text-content").appendTo($container) }($container) } renderingTemplate.render(options) } } } else { resultTemplate = renderingTemplate } return resultTemplate } _updateCell($cell, options) { $cell = $cell.hasClass("dx-treelist-text-content") ? $cell.parent() : $cell; super._updateCell($cell, options) } _rowClick(e) { const dataController = this._dataController; const $targetElement = (0, _renderer.default)(e.event.target); const isExpandIcon = this.isExpandIcon($targetElement); const item = null === dataController || void 0 === dataController ? void 0 : dataController.items()[e.rowIndex]; if (isExpandIcon && item) { dataController.changeRowExpand(item.key) } super._rowClick(e) } _createRow(row) { const node = row && row.node; const $rowElement = super._createRow.apply(this, arguments); if (node) { this.setAria("level", row.level + 1, $rowElement); if (node.hasChildren) { this.setAria("expanded", row.isExpanded, $rowElement) } } return $rowElement } _getGridRoleName() { return "treegrid" } isExpandIcon($targetElement) { return !!$targetElement.closest(".dx-treelist-expanded, .dx-treelist-collapsed").length } setAriaExpandedAttribute($row, row) { const isRowExpanded = row.isExpanded; this.setAria("expanded", (0, _type.isDefined)(isRowExpanded) && isRowExpanded.toString(), $row) } } _m_core.default.registerModule("rows", { defaultOptions: _m_rows_view.rowsModule.defaultOptions, views: { rowsView: TreeListRowsView } }) }, 91445: /*!*************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/grids/tree_list/selection/m_selection.js ***! \*************************************************************************************************/ function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../../core/renderer */ 68374)); var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _m_selection = __webpack_require__( /*! ../../../grids/grid_core/selection/m_selection */ 17969); var _m_core = _interopRequireDefault(__webpack_require__( /*! ../m_core */ 12500)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const nodeExists = function(array, currentKey) { return !!array.filter((key => key === currentKey)).length }; _m_core.default.registerModule("selection", (0, _extend.extend)(true, {}, _m_selection.selectionModule, { defaultOptions: () => (0, _extend.extend)(true, _m_selection.selectionModule.defaultOptions(), { selection: { showCheckBoxesMode: "always", recursive: false } }), extenders: { controllers: { data: Base => class extends((0, _m_selection.dataSelectionExtenderMixin)(Base)) { _handleDataChanged(e) { const isRecursiveSelection = this._selectionController.isRecursiveSelection(); if (isRecursiveSelection && (!e || "updateSelectionState" !== e.changeType)) { this._selectionController.updateSelectionState({ selectedItemKeys: this.option("selectedRowKeys") }) } super._handleDataChanged.apply(this, arguments) } loadDescendants() { const that = this; const d = super.loadDescendants.apply(that, arguments); const isRecursiveSelection = this._selectionController.isRecursiveSelection(); if (isRecursiveSelection) { d.done((() => { this._selectionController.updateSelectionState({ selectedItemKeys: that.option("selectedRowKeys") }) })) } return d } }, selection: Base => class extends Base { constructor() { super(...arguments); this._updateSelectColumn = _common.noop } init() { super.init.apply(this, arguments); this._selectionStateByKey = {} } _getSelectionConfig() { const config = super._getSelectionConfig.apply(this, arguments); const { plainItems: plainItems } = config; config.plainItems = cached => { let result; if (cached) { result = this._dataController.getCachedStoreData() } result || (result = plainItems.apply(this, arguments).map((item => item.data))); return result || [] }; config.isItemSelected = item => { const key = this._dataController.keyOf(item); return this.isRowSelected(key) }; config.isSelectableItem = item => !!item; config.getItemData = item => item; config.allowLoadByRange = void 0; return config } renderSelectCheckBoxContainer($container, model) { const rowsView = this.component.getView("rowsView"); const $checkbox = rowsView._renderSelectCheckBox($container, { value: model.row.isSelected, row: model.row, column: model.column }); rowsView._attachCheckBoxClickEvent($checkbox) } _getSelectAllNodeKeys() { const { component: component } = this; const root = component.getRootNode(); const cache = {}; const keys = []; const isRecursiveSelection = this.isRecursiveSelection(); root && _m_core.default.foreachNodes(root.children, (node => { if (void 0 !== node.key && (node.visible || isRecursiveSelection)) { keys.push(node.key) } if (!node.visible) { return true } return isRecursiveSelection ? false : component.isRowExpanded(node.key, cache) })); return keys } isSelectAll() { const selectedRowKeys = this.option("selectedRowKeys") || []; if (0 === selectedRowKeys.length) { return false } const { component: component } = this; const visibleKeys = this._getSelectAllNodeKeys(); const isRecursiveSelection = this.isRecursiveSelection(); let hasIndeterminateState = false; const selectedVisibleKeys = visibleKeys.filter((key => { const isRowSelected = component.isRowSelected(key, isRecursiveSelection); if (void 0 === isRowSelected) { hasIndeterminateState = true } return isRowSelected })); if (!selectedVisibleKeys.length) { return hasIndeterminateState ? void 0 : false } if (selectedVisibleKeys.length === visibleKeys.length) { return true } return } selectAll() { const visibleKeys = this._getSelectAllNodeKeys().filter((key => !this.isRowSelected(key))); this.focusedItemIndex(-1); return this.selectRows(visibleKeys, true) } deselectAll() { const visibleKeys = this._getSelectAllNodeKeys(); this.focusedItemIndex(-1); return this.deselectRows(visibleKeys) } selectedItemKeys(value, preserve, isDeselect, isSelectAll) { const that = this; const selectedRowKeys = that.option("selectedRowKeys"); const isRecursiveSelection = this.isRecursiveSelection(); const normalizedArgs = isRecursiveSelection && that._normalizeSelectionArgs({ keys: (0, _type.isDefined)(value) ? value : [] }, preserve, !isDeselect); if (normalizedArgs && !(0, _common.equalByValue)(normalizedArgs.selectedRowKeys, selectedRowKeys)) { that._isSelectionNormalizing = true; return super.selectedItemKeys(normalizedArgs.selectedRowKeys, false, false, false).always((() => { that._isSelectionNormalizing = false })).done((items => { normalizedArgs.selectedRowsData = items; that._fireSelectionChanged(normalizedArgs) })) } return super.selectedItemKeys(value, preserve, isDeselect, isSelectAll) } changeItemSelection(itemIndex, keyboardKeys, setFocusOnly) { const isRecursiveSelection = this.isRecursiveSelection(); const callBase = super.changeItemSelection.bind(this); if (isRecursiveSelection && !keyboardKeys.shift) { const key = this._dataController.getKeyByRowIndex(itemIndex); return this.selectedItemKeys(key, true, this.isRowSelected(key)).done((() => { this.isRowSelected(key) && callBase(itemIndex, keyboardKeys, true) })) } return super.changeItemSelection.apply(this, arguments) } _updateParentSelectionState(node, isSelected) { const that = this; let state = isSelected; const parentNode = node.parent; if (parentNode) { if (parentNode.children.length > 1) { if (false === isSelected) { const hasSelectedState = parentNode.children.some((childNode => that._selectionStateByKey[childNode.key])); state = hasSelectedState ? void 0 : false } else if (true === isSelected) { const hasNonSelectedState = parentNode.children.some((childNode => !that._selectionStateByKey[childNode.key])); state = hasNonSelectedState ? void 0 : true } } this._selectionStateByKey[parentNode.key] = state; if (parentNode.parent && parentNode.parent.level >= 0) { this._updateParentSelectionState(parentNode, state) } } } _updateChildrenSelectionState(node, isSelected) { const that = this; const { children: children } = node; children && children.forEach((childNode => { that._selectionStateByKey[childNode.key] = isSelected; if (childNode.children.length > 0) { that._updateChildrenSelectionState(childNode, isSelected) } })) } _updateSelectionStateCore(keys, isSelected) { const dataController = this._dataController; for (let i = 0; i < keys.length; i++) { this._selectionStateByKey[keys[i]] = isSelected; const node = dataController.getNodeByKey(keys[i]); if (node) { this._updateParentSelectionState(node, isSelected); this._updateChildrenSelectionState(node, isSelected) } } } _getSelectedParentKeys(key, selectedItemKeys, useCash) { let selectedParentNode; const node = this._dataController.getNodeByKey(key); let parentNode = node && node.parent; let result = []; while (parentNode && parentNode.level >= 0) { result.unshift(parentNode.key); const isSelected = useCash ? !nodeExists(selectedItemKeys, parentNode.key) && this.isRowSelected(parentNode.key) : selectedItemKeys.indexOf(parentNode.key) >= 0; if (isSelected) { selectedParentNode = parentNode; result = this._getSelectedParentKeys(selectedParentNode.key, selectedItemKeys, useCash).concat(result); break } else if (useCash) { break } parentNode = parentNode.parent } return selectedParentNode && result || [] } _getSelectedChildKeys(key, keysToIgnore) { const childKeys = []; const node = this._dataController.getNodeByKey(key); node && _m_core.default.foreachNodes(node.children, (childNode => { const ignoreKeyIndex = keysToIgnore.indexOf(childNode.key); if (ignoreKeyIndex < 0) { childKeys.push(childNode.key) } return ignoreKeyIndex > 0 || ignoreKeyIndex < 0 && void 0 === this._selectionStateByKey[childNode.key] })); return childKeys } _normalizeParentKeys(key, args) { const that = this; let keysToIgnore = [key]; const parentNodeKeys = that._getSelectedParentKeys(key, args.selectedRowKeys); if (parentNodeKeys.length) { keysToIgnore = keysToIgnore.concat(parentNodeKeys); keysToIgnore.forEach((key => { const index = args.selectedRowKeys.indexOf(key); if (index >= 0) { args.selectedRowKeys.splice(index, 1) } })); const childKeys = that._getSelectedChildKeys(parentNodeKeys[0], keysToIgnore); args.selectedRowKeys = args.selectedRowKeys.concat(childKeys) } } _normalizeChildrenKeys(key, args) { const node = this._dataController.getNodeByKey(key); node && node.children.forEach((childNode => { const index = args.selectedRowKeys.indexOf(childNode.key); if (index >= 0) { args.selectedRowKeys.splice(index, 1) } this._normalizeChildrenKeys(childNode.key, args) })) } _normalizeSelectedRowKeysCore(keys, args, preserve, isSelect) { const that = this; keys.forEach((key => { if (preserve && that.isRowSelected(key) === isSelect) { return } that._normalizeChildrenKeys(key, args); const index = args.selectedRowKeys.indexOf(key); if (isSelect) { if (index < 0) { args.selectedRowKeys.push(key) } args.currentSelectedRowKeys.push(key) } else { if (index >= 0) { args.selectedRowKeys.splice(index, 1) } args.currentDeselectedRowKeys.push(key); that._normalizeParentKeys(key, args) } })) } _normalizeSelectionArgs(args, preserve, isSelect) { let result; const keys = Array.isArray(args.keys) ? args.keys : [args.keys]; const selectedRowKeys = this.option("selectedRowKeys") || []; if (keys.length) { result = { currentSelectedRowKeys: [], currentDeselectedRowKeys: [], selectedRowKeys: preserve ? selectedRowKeys.slice(0) : [] }; this._normalizeSelectedRowKeysCore(keys, result, preserve, isSelect) } return result } _updateSelectedItems(args) { this.updateSelectionState(args); super._updateSelectedItems(args) } _fireSelectionChanged() { if (!this._isSelectionNormalizing) { super._fireSelectionChanged.apply(this, arguments) } } _isModeLeavesOnly(mode) { return "leavesOnly" === mode } _removeDuplicatedKeys(keys) { const result = []; const processedKeys = {}; keys.forEach((key => { if (!processedKeys[key]) { processedKeys[key] = true; result.push(key) } })); return result } _getAllChildKeys(key) { const childKeys = []; const node = this._dataController.getNodeByKey(key); node && _m_core.default.foreachNodes(node.children, (childNode => { childKeys.push(childNode.key) }), true); return childKeys } _getAllSelectedRowKeys(keys) { let result = []; keys.forEach((key => { const parentKeys = this._getSelectedParentKeys(key, [], true); const childKeys = this._getAllChildKeys(key); result.push.apply(result, parentKeys.concat([key], childKeys)) })); result = this._removeDuplicatedKeys(result); return result } _getParentSelectedRowKeys(keys) { const that = this; const result = []; keys.forEach((key => { const parentKeys = that._getSelectedParentKeys(key, keys); !parentKeys.length && result.push(key) })); return result } _getLeafSelectedRowKeys(keys) { const result = []; const dataController = this._dataController; keys.forEach((key => { const node = dataController.getNodeByKey(key); node && !node.hasChildren && result.push(key) })); return result } isRecursiveSelection() { const selectionMode = this.option("selection.mode"); const isRecursive = this.option("selection.recursive"); return "multiple" === selectionMode && isRecursive } updateSelectionState(options) { const removedItemKeys = options.removedItemKeys || []; const selectedItemKeys = options.selectedItemKeys || []; if (this.isRecursiveSelection()) { this._updateSelectionStateCore(removedItemKeys, false); this._updateSelectionStateCore(selectedItemKeys, true) } } isRowSelected(key, isRecursiveSelection) { const result = super.isRowSelected.apply(this, arguments); isRecursiveSelection = isRecursiveSelection ?? this.isRecursiveSelection(); if (!result && isRecursiveSelection) { if (key in this._selectionStateByKey) { return this._selectionStateByKey[key] } return false } return result } getSelectedRowKeys(mode) { const that = this; if (!that._dataController) { return [] } let selectedRowKeys = super.getSelectedRowKeys.apply(that, arguments); if (mode) { if (this.isRecursiveSelection()) { selectedRowKeys = this._getAllSelectedRowKeys(selectedRowKeys) } if ("all" !== mode) { if ("excludeRecursive" === mode) { selectedRowKeys = that._getParentSelectedRowKeys(selectedRowKeys) } else if (that._isModeLeavesOnly(mode)) { selectedRowKeys = that._getLeafSelectedRowKeys(selectedRowKeys) } } } return selectedRowKeys } getSelectedRowsData(mode) { const dataController = this._dataController; const selectedKeys = this.getSelectedRowKeys(mode) || []; const selectedRowsData = []; selectedKeys.forEach((key => { const node = dataController.getNodeByKey(key); node && selectedRowsData.push(node.data) })); return selectedRowsData } refresh() { this._selectionStateByKey = {}; return super.refresh.apply(this, arguments) } } }, views: { columnHeadersView: Base => class extends((0, _m_selection.columnHeadersSelectionExtenderMixin)(Base)) { _processTemplate(template, options) { const that = this; let resultTemplate; const renderingTemplate = super._processTemplate(template, options); const firstDataColumnIndex = that._columnsController.getFirstDataColumnIndex(); if (renderingTemplate && "header" === options.rowType && options.column.index === firstDataColumnIndex) { resultTemplate = { render(options) { if ("multiple" === that.option("selection.mode")) { that.renderSelectAll(options.container, options.model) } renderingTemplate.render(options) } } } else { resultTemplate = renderingTemplate } return resultTemplate } renderSelectAll($cell, options) { $cell.addClass("dx-treelist-select-all"); this._renderSelectAllCheckBox($cell) } _isSortableElement($target) { return super._isSortableElement($target) && !$target.closest(".dx-select-checkbox").length } }, rowsView: Base => class extends((0, _m_selection.rowsViewSelectionExtenderMixin)(Base)) { _renderIcons($iconContainer, options) { super._renderIcons.apply(this, arguments); if (!options.row.isNewRow && "multiple" === this.option("selection.mode")) { this._selectionController.renderSelectCheckBoxContainer($iconContainer, options) } return $iconContainer } _rowClick(e) { const $targetElement = (0, _renderer.default)(e.event.target); if (this.isExpandIcon($targetElement)) { super._rowClickForTreeList.apply(this, arguments) } else { super._rowClick.apply(this, arguments) } } } } } })) }, 86988: /*!***********************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/m_draggable.js ***! \***********************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _position = _interopRequireDefault(__webpack_require__( /*! ../animation/position */ 49387)); var _translator = __webpack_require__( /*! ../animation/translator */ 31648); var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../core/component_registrator */ 99393)); var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../core/dom_adapter */ 73349)); var _dom_component = _interopRequireDefault(__webpack_require__( /*! ../core/dom_component */ 13046)); var _element = __webpack_require__( /*! ../core/element */ 6415); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../core/renderer */ 68374)); var _empty_template = __webpack_require__( /*! ../core/templates/empty_template */ 10688); var _common = __webpack_require__( /*! ../core/utils/common */ 20576); var _deferred = __webpack_require__( /*! ../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../core/utils/extend */ 13306); var _inflector = __webpack_require__( /*! ../core/utils/inflector */ 78008); var _position2 = __webpack_require__( /*! ../core/utils/position */ 37518); var _size = __webpack_require__( /*! ../core/utils/size */ 58664); var _string = __webpack_require__( /*! ../core/utils/string */ 68752); var _type = __webpack_require__( /*! ../core/utils/type */ 35922); var _view_port = __webpack_require__( /*! ../core/utils/view_port */ 77695); var _window = __webpack_require__( /*! ../core/utils/window */ 58201); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../events/core/events_engine */ 55994)); var _drag = __webpack_require__( /*! ../events/drag */ 23174); var _pointer = _interopRequireDefault(__webpack_require__( /*! ../events/pointer */ 93786)); var _index = __webpack_require__( /*! ../events/utils/index */ 39611); var _m_animator = _interopRequireDefault(__webpack_require__( /*! ./ui/scroll_view/m_animator */ 13707)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const window = (0, _window.getWindow)(); const DRAGGABLE = "dxDraggable"; const DRAGSTART_EVENT_NAME = (0, _index.addNamespace)(_drag.start, DRAGGABLE); const DRAG_EVENT_NAME = (0, _index.addNamespace)(_drag.move, DRAGGABLE); const DRAGEND_EVENT_NAME = (0, _index.addNamespace)(_drag.end, DRAGGABLE); const DRAG_ENTER_EVENT_NAME = (0, _index.addNamespace)(_drag.enter, DRAGGABLE); const DRAGEND_LEAVE_EVENT_NAME = (0, _index.addNamespace)(_drag.leave, DRAGGABLE); const POINTERDOWN_EVENT_NAME = (0, _index.addNamespace)(_pointer.default.down, DRAGGABLE); const KEYDOWN_EVENT_NAME = (0, _index.addNamespace)("keydown", DRAGGABLE); let targetDraggable; let sourceDraggable; const getMousePosition = event => ({ x: event.pageX - (0, _renderer.default)(window).scrollLeft(), y: event.pageY - (0, _renderer.default)(window).scrollTop() }); class ScrollHelper { constructor(orientation, component) { this._$scrollableAtPointer = null; this._preventScroll = true; this._component = component; if ("vertical" === orientation) { this._scrollValue = "scrollTop"; this._overFlowAttr = "overflowY"; this._sizeAttr = "height"; this._scrollSizeProp = "scrollHeight"; this._clientSizeProp = "clientHeight"; this._limitProps = { start: "top", end: "bottom" } } else { this._scrollValue = "scrollLeft"; this._overFlowAttr = "overflowX"; this._sizeAttr = "width"; this._scrollSizeProp = "scrollWidth"; this._clientSizeProp = "clientWidth"; this._limitProps = { start: "left", end: "right" } } } updateScrollable(elements, mousePosition) { let isScrollableFound = false; elements.some((element => { const $element = (0, _renderer.default)(element); const isTargetOverOverlayWrapper = $element.hasClass("dx-overlay-wrapper"); const isTargetOverOverlayContent = $element.hasClass("dx-overlay-content"); if (isTargetOverOverlayWrapper || isTargetOverOverlayContent) { return true } isScrollableFound = this._trySetScrollable(element, mousePosition); return isScrollableFound })); if (!isScrollableFound) { this._$scrollableAtPointer = null; this._scrollSpeed = 0 } } isScrolling() { return !!this._scrollSpeed } isScrollable($element) { return ("auto" === $element.css(this._overFlowAttr) || $element.hasClass("dx-scrollable-container")) && $element.prop(this._scrollSizeProp) > Math.ceil("width" === this._sizeAttr ? (0, _size.getWidth)($element) : (0, _size.getHeight)($element)) } _trySetScrollable(element, mousePosition) { const that = this; const $element = (0, _renderer.default)(element); let distanceToBorders; const sensitivity = that._component.option("scrollSensitivity"); let 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._$scrollableAtPointer = $element } } else if (sensitivity > distanceToBorders[that._limitProps.end]) { if (!that._preventScroll) { that._scrollSpeed = that._calculateScrollSpeed(distanceToBorders[that._limitProps.end]); that._$scrollableAtPointer = $element } } else { isScrollable = false; that._preventScroll = false } } return isScrollable } _calculateDistanceToBorders($area, mousePosition) { const area = $area.get(0); let areaBoundingRect; if (area) { areaBoundingRect = (0, _position2.getBoundingRect)(area); return { left: mousePosition.x - areaBoundingRect.left, top: mousePosition.y - areaBoundingRect.top, right: areaBoundingRect.right - mousePosition.x, bottom: areaBoundingRect.bottom - mousePosition.y } } return {} } _calculateScrollSpeed(distance) { const component = this._component; const sensitivity = component.option("scrollSensitivity"); const maxSpeed = component.option("scrollSpeed"); return Math.ceil(((sensitivity - distance) / sensitivity) ** 2 * maxSpeed) } scrollByStep() { const that = this; if (that._$scrollableAtPointer && that._scrollSpeed) { if (that._$scrollableAtPointer.hasClass("dx-scrollable-container")) { const $scrollable = that._$scrollableAtPointer.closest(".dx-scrollable"); const scrollableInstance = $scrollable.data("dxScrollable") || $scrollable.data("dxScrollView"); if (scrollableInstance) { const nextScrollPosition = scrollableInstance.scrollOffset()[that._limitProps.start] + that._scrollSpeed; scrollableInstance.scrollTo({ [that._limitProps.start]: nextScrollPosition }) } } else { const nextScrollPosition = that._$scrollableAtPointer[that._scrollValue]() + that._scrollSpeed; that._$scrollableAtPointer[that._scrollValue](nextScrollPosition) } const dragMoveArgs = that._component._dragMoveArgs; if (dragMoveArgs) { that._component._dragMoveHandler(dragMoveArgs) } } } reset() { this._$scrollableAtPointer = null; this._scrollSpeed = 0; this._preventScroll = true } isOutsideScrollable($scrollable, event) { if (!$scrollable) { return false } const scrollableSize = (0, _position2.getBoundingRect)($scrollable.get(0)); const start = scrollableSize[this._limitProps.start]; const size = scrollableSize[this._sizeAttr]; const mousePosition = getMousePosition(event); const location = "width" === this._sizeAttr ? mousePosition.x : mousePosition.y; return location < start || location > start + size } } const ScrollAnimator = _m_animator.default.inherit({ ctor(strategy) { this.callBase(); this._strategy = strategy }, _step() { const horizontalScrollHelper = this._strategy._horizontalScrollHelper; const verticalScrollHelper = this._strategy._verticalScrollHelper; horizontalScrollHelper && horizontalScrollHelper.scrollByStep(); verticalScrollHelper && verticalScrollHelper.scrollByStep() } }); const Draggable = _dom_component.default.inherit({ reset: _common.noop, dragMove: _common.noop, dragEnter: _common.noop, dragLeave: _common.noop, dragEnd(sourceEvent) { const sourceDraggable = this._getSourceDraggable(); sourceDraggable._fireRemoveEvent(sourceEvent); return (0, _deferred.Deferred)().resolve() }, _fireRemoveEvent: _common.noop, _getDefaultOptions() { return (0, _extend.extend)(this.callBase(), { onDragStart: null, onDragMove: null, onDragEnd: null, onDragEnter: null, onDragLeave: null, onDragCancel: null, onCancelByEsc: false, 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() { this.callBase.apply(this, arguments); (0, _extend.extend)(this._optionsByReference, { component: true, group: true, itemData: true, data: true }) }, _init() { this.callBase(); this._attachEventHandlers(); this._scrollAnimator = new ScrollAnimator(this); this._horizontalScrollHelper = new ScrollHelper("horizontal", this); this._verticalScrollHelper = new ScrollHelper("vertical", this); this._initScrollTop = 0; this._initScrollLeft = 0 }, _normalizeCursorOffset(offset) { if ((0, _type.isObject)(offset)) { offset = { h: offset.x, v: offset.y } } offset = (0, _common.splitPair)(offset).map((value => parseFloat(value))); return { left: offset[0], top: 1 === offset.length ? offset[0] : offset[1] } }, _getNormalizedCursorOffset(offset, options) { if ((0, _type.isFunction)(offset)) { offset = offset.call(this, options) } return this._normalizeCursorOffset(offset) }, _calculateElementOffset(options) { let elementOffset; let dragElementOffset; const { event: event } = options; const $element = (0, _renderer.default)(options.itemElement); const $dragElement = (0, _renderer.default)(options.dragElement); const isCloned = this._dragElementIsCloned(); const cursorOffset = this.option("cursorOffset"); let normalizedCursorOffset = { left: 0, top: 0 }; const currentLocate = this._initialLocate = (0, _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(options) { const $dragElement = (0, _renderer.default)(options.dragElement); const elementOffset = this._calculateElementOffset(options); if (elementOffset) { this._move(elementOffset, $dragElement) } this._startPosition = (0, _translator.locate)($dragElement) }, _startAnimator() { if (!this._scrollAnimator.inProgress()) { this._scrollAnimator.start() } }, _stopAnimator() { this._scrollAnimator.stop() }, _addWidgetPrefix(className) { const componentName = this.NAME; return (0, _inflector.dasherize)(componentName) + (className ? `-${className}` : "") }, _getItemsSelector() { return this.option("filter") || "" }, _$content() { const $element = this.$element(); const $wrapper = $element.children(".dx-template-wrapper"); return $wrapper.length ? $wrapper : $element }, _attachEventHandlers() { if (this.option("disabled")) { return } let $element = this._$content(); let itemsSelector = this._getItemsSelector(); const allowMoveByClick = this.option("allowMoveByClick"); const data = { direction: this.option("dragDirection"), immediate: this.option("immediate"), checkDropTarget: ($target, event) => { const targetGroup = this.option("group"); const sourceGroup = this._getSourceDraggable().option("group"); const $scrollable = this._getScrollable($target); if (this._verticalScrollHelper.isOutsideScrollable($scrollable, event) || this._horizontalScrollHelper.isOutsideScrollable($scrollable, event)) { return false } return sourceGroup && sourceGroup === targetGroup } }; if (allowMoveByClick) { $element = this._getArea(); _events_engine.default.on($element, POINTERDOWN_EVENT_NAME, data, this._pointerDownHandler.bind(this)) } if (">" === itemsSelector[0]) { itemsSelector = itemsSelector.slice(1) } _events_engine.default.on($element, DRAGSTART_EVENT_NAME, itemsSelector, data, this._dragStartHandler.bind(this)); _events_engine.default.on($element, DRAG_EVENT_NAME, data, this._dragMoveHandler.bind(this)); _events_engine.default.on($element, DRAGEND_EVENT_NAME, data, this._dragEndHandler.bind(this)); _events_engine.default.on($element, DRAG_ENTER_EVENT_NAME, data, this._dragEnterHandler.bind(this)); _events_engine.default.on($element, DRAGEND_LEAVE_EVENT_NAME, data, this._dragLeaveHandler.bind(this)); if (this.option("onCancelByEsc")) { _events_engine.default.on($element, KEYDOWN_EVENT_NAME, this._keydownHandler.bind(this)) } }, _dragElementIsCloned() { return this._$dragElement && this._$dragElement.hasClass(this._addWidgetPrefix("clone")) }, _getDragTemplateArgs($element, $container) { return { container: (0, _element.getPublicElement)($container), model: { itemData: this.option("itemData"), itemElement: (0, _element.getPublicElement)($element) } } }, _createDragElement($element) { let result = $element; const clone = this.option("clone"); const $container = this._getContainer(); let template = this.option("dragTemplate"); if (template) { template = this._getTemplate(template); result = (0, _renderer.default)("
").appendTo($container); template.render(this._getDragTemplateArgs($element, result)) } else if (clone) { result = (0, _renderer.default)("
").appendTo($container); $element.clone().css({ width: $element.css("width"), height: $element.css("height") }).appendTo(result) } return result.toggleClass(this._addWidgetPrefix("clone"), result.get(0) !== $element.get(0)).toggleClass("dx-rtl", this.option("rtlEnabled")) }, _resetDragElement() { if (this._dragElementIsCloned()) { this._$dragElement.remove() } else { this._toggleDraggingClass(false) } this._$dragElement = null }, _resetSourceElement() { this._toggleDragSourceClass(false); this._$sourceElement = null }, _detachEventHandlers() { _events_engine.default.off(this._$content(), `.${DRAGGABLE}`); _events_engine.default.off(this._getArea(), `.${DRAGGABLE}`) }, _move(position, $element) { (0, _translator.move)($element || this._$dragElement, position) }, _getDraggableElement(e) { const $sourceElement = this._getSourceElement(); if ($sourceElement) { return $sourceElement } const allowMoveByClick = this.option("allowMoveByClick"); if (allowMoveByClick) { return this.$element() } let $target = (0, _renderer.default)(e && e.target); const itemsSelector = this._getItemsSelector(); if (">" === itemsSelector[0]) { const $items = this._$content().find(itemsSelector); if (!$items.is($target)) { $target = $target.closest($items) } } return $target }, _getSourceElement() { const draggable = this._getSourceDraggable(); return draggable._$sourceElement }, _pointerDownHandler(e) { if ((0, _index.needSkipEvent)(e)) { return } const position = {}; const $element = this.$element(); const dragDirection = this.option("dragDirection"); if ("horizontal" === dragDirection || "both" === dragDirection) { position.left = e.pageX - $element.offset().left + (0, _translator.locate)($element).left - (0, _size.getWidth)($element) / 2 } if ("vertical" === dragDirection || "both" === dragDirection) { position.top = e.pageY - $element.offset().top + (0, _translator.locate)($element).top - (0, _size.getHeight)($element) / 2 } this._move(position, $element); this._getAction("onDragMove")(this._getEventArgs(e)) }, _isValidElement(event, $element) { const handle = this.option("handle"); const $target = (0, _renderer.default)(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(e) { const $element = this._getDraggableElement(e); this.dragInProgress = true; if (!this._isValidElement(e, $element)) { e.cancel = true; return } if (this._$sourceElement) { return } const 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; let initialOffset = $element.offset(); if (!this._hasClonedDraggable() && this.option("autoScroll")) { this._initScrollTop = this._getScrollableScrollTop(); this._initScrollLeft = this._getScrollableScrollLeft(); initialOffset = this._getDraggableElementOffset(initialOffset.left, initialOffset.top) } const $dragElement = this._$dragElement = this._createDragElement($element); this._toggleDraggingClass(true); this._toggleDragSourceClass(true); this._setGestureCoverCursor($dragElement.children()); const isFixedPosition = "fixed" === $dragElement.css("position"); this._initPosition((0, _extend.extend)({}, dragStartArgs, { dragElement: $dragElement.get(0), initialOffset: isFixedPosition && initialOffset })); this._getAction("onDraggableElementShown")(_extends({}, dragStartArgs, { dragElement: $dragElement })); const $area = this._getArea(); const areaOffset = this._getAreaOffset($area); const boundOffset = this._getBoundOffset(); const areaWidth = (0, _size.getOuterWidth)($area); const areaHeight = (0, _size.getOuterHeight)($area); const elementWidth = (0, _size.getWidth)($dragElement); const elementHeight = (0, _size.getHeight)($dragElement); const startOffset_left = $dragElement.offset().left - areaOffset.left, startOffset_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($area) { const offset = $area && _position.default.offset($area); return offset || { left: 0, top: 0 } }, _toggleDraggingClass(value) { this._$dragElement && this._$dragElement.toggleClass(this._addWidgetPrefix("dragging"), value) }, _toggleDragSourceClass(value, $element) { const $sourceElement = $element || this._$sourceElement; $sourceElement && $sourceElement.toggleClass(this._addWidgetPrefix("source"), value) }, _setGestureCoverCursor($element) { (0, _renderer.default)(".dx-gesture-cover").css("cursor", $element.css("cursor")) }, _getBoundOffset() { let boundOffset = this.option("boundOffset"); if ((0, _type.isFunction)(boundOffset)) { boundOffset = boundOffset.call(this) } return (0, _string.quadToObject)(boundOffset) }, _getArea() { let area = this.option("boundary"); if ((0, _type.isFunction)(area)) { area = area.call(this) } return (0, _renderer.default)(area) }, _getContainer() { let container = this.option("container"); if (void 0 === container) { container = (0, _view_port.value)() } return (0, _renderer.default)(container) }, _getDraggableElementOffset(initialOffsetX, initialOffsetY) { var _this$_startPosition, _this$_startPosition2; const initScrollTop = this._initScrollTop; const initScrollLeft = this._initScrollLeft; const scrollTop = this._getScrollableScrollTop(); const scrollLeft = this._getScrollableScrollLeft(); const elementPosition = (0, _renderer.default)(this.element()).css("position"); const isFixedPosition = "fixed" === elementPosition; const result = { left: ((null === (_this$_startPosition = this._startPosition) || void 0 === _this$_startPosition ? void 0 : _this$_startPosition.left) ?? 0) + initialOffsetX, top: ((null === (_this$_startPosition2 = this._startPosition) || void 0 === _this$_startPosition2 ? void 0 : _this$_startPosition2.top) ?? 0) + initialOffsetY }; if (isFixedPosition || this._hasClonedDraggable()) { return result } return { left: (0, _type.isNumeric)(scrollLeft) ? result.left + scrollLeft - initScrollLeft : result.left, top: (0, _type.isNumeric)(scrollTop) ? result.top + scrollTop - initScrollTop : result.top } }, _hasClonedDraggable() { return this.option("clone") || this.option("dragTemplate") }, _dragMoveHandler(e) { this._dragMoveArgs = e; if (!this._$dragElement) { e.cancel = true; return } const offset = this._getDraggableElementOffset(e.offset.x, e.offset.y); this._move(offset); this._updateScrollable(e); const eventArgs = this._getEventArgs(e); this._getAction("onDragMove")(eventArgs); if (true === eventArgs.cancel) { return } const targetDraggable = this._getTargetDraggable(); targetDraggable.dragMove(e, scrollBy) }, _updateScrollable(e) { const that = this; if (that.option("autoScroll")) { const mousePosition = getMousePosition(e); const allObjects = _dom_adapter.default.elementsFromPoint(mousePosition.x, mousePosition.y, this.$element().get(0)); that._verticalScrollHelper.updateScrollable(allObjects, mousePosition); that._horizontalScrollHelper.updateScrollable(allObjects, mousePosition) } }, _getScrollable($element) { let $scrollable; $element.parents().toArray().some((parent => { const $parent = (0, _renderer.default)(parent); if (this._horizontalScrollHelper.isScrollable($parent) || this._verticalScrollHelper.isScrollable($parent)) { $scrollable = $parent; return true } return false })); return $scrollable }, _getScrollableScrollTop() { var _this$_getScrollable; return (null === (_this$_getScrollable = this._getScrollable((0, _renderer.default)(this.element()))) || void 0 === _this$_getScrollable ? void 0 : _this$_getScrollable.scrollTop()) ?? 0 }, _getScrollableScrollLeft() { var _this$_getScrollable2; return (null === (_this$_getScrollable2 = this._getScrollable((0, _renderer.default)(this.element()))) || void 0 === _this$_getScrollable2 ? void 0 : _this$_getScrollable2.scrollLeft()) ?? 0 }, _defaultActionArgs() { const args = this.callBase.apply(this, arguments); const component = this.option("component"); if (component) { args.component = component; args.element = component.element() } return args }, _getEventArgs(e) { const sourceDraggable = this._getSourceDraggable(); const targetDraggable = this._getTargetDraggable(); return { event: e, itemData: sourceDraggable.option("itemData"), itemElement: (0, _element.getPublicElement)(sourceDraggable._$sourceElement), fromComponent: sourceDraggable.option("component") || sourceDraggable, toComponent: targetDraggable.option("component") || targetDraggable, fromData: sourceDraggable.option("data"), toData: targetDraggable.option("data") } }, _getDragStartArgs(e, $itemElement) { const args = this._getEventArgs(e); return { event: args.event, itemData: args.itemData, itemElement: $itemElement, fromData: args.fromData } }, _revertItemToInitialPosition() { !this._dragElementIsCloned() && this._move(this._initialLocate, this._$sourceElement) }, _dragEndHandler(e) { const d = (0, _deferred.Deferred)(); const dragEndEventArgs = this._getEventArgs(e); const dropEventArgs = this._getEventArgs(e); const targetDraggable = this._getTargetDraggable(); let needRevertPosition = true; this.dragInProgress = false; try { this._getAction("onDragEnd")(dragEndEventArgs) } finally { (0, _deferred.when)((0, _deferred.fromPromise)(dragEndEventArgs.cancel)).done((cancel => { if (!cancel) { if (targetDraggable !== this) { targetDraggable._getAction("onDrop")(dropEventArgs) } if (!dropEventArgs.cancel) { needRevertPosition = false; (0, _deferred.when)((0, _deferred.fromPromise)(targetDraggable.dragEnd(dragEndEventArgs))).always(d.resolve); return } } d.resolve() })).fail(d.resolve); d.done((() => { if (needRevertPosition) { this._revertItemToInitialPosition() } this._resetDragOptions(targetDraggable) })) } }, _isTargetOverAnotherDraggable(e) { const sourceDraggable = this._getSourceDraggable(); if (this === sourceDraggable) { return false } const $dragElement = sourceDraggable._$dragElement; const $sourceDraggableElement = sourceDraggable.$element(); const $targetDraggableElement = this.$element(); const mousePosition = getMousePosition(e); const elements = _dom_adapter.default.elementsFromPoint(mousePosition.x, mousePosition.y, this.element()); const firstWidgetElement = elements.filter((element => { const $element = (0, _renderer.default)(element); if ($element.hasClass(this._addWidgetPrefix())) { return !$element.closest($dragElement).length } return false }))[0]; const $sourceElement = this._getSourceElement(); const isTargetOverItself = firstWidgetElement === $sourceDraggableElement.get(0); const isTargetOverNestedDraggable = (0, _renderer.default)(firstWidgetElement).closest($sourceElement).length; return !firstWidgetElement || firstWidgetElement === $targetDraggableElement.get(0) && !isTargetOverItself && !isTargetOverNestedDraggable }, _dragEnterHandler(e) { this._fireDragEnterEvent(e); if (this._isTargetOverAnotherDraggable(e)) { this._setTargetDraggable() } const sourceDraggable = this._getSourceDraggable(); sourceDraggable.dragEnter(e) }, _dragLeaveHandler(e) { this._fireDragLeaveEvent(e); this._resetTargetDraggable(); if (this !== this._getSourceDraggable()) { this.reset() } const sourceDraggable = this._getSourceDraggable(); sourceDraggable.dragLeave(e) }, _keydownHandler(e) { if (this.dragInProgress && "Escape" === e.key) { this._keydownEscapeHandler(e) } }, _keydownEscapeHandler(e) { var _sourceDraggable; const $sourceElement = this._getSourceElement(); if (!$sourceElement) { return } const dragCancelEventArgs = this._getEventArgs(e); this._getAction("onDragCancel")(dragCancelEventArgs); if (dragCancelEventArgs.cancel) { return } this.dragInProgress = false; null === (_sourceDraggable = sourceDraggable) || void 0 === _sourceDraggable || _sourceDraggable._toggleDraggingClass(false); this._detachEventHandlers(); this._revertItemToInitialPosition(); const targetDraggable = this._getTargetDraggable(); this._resetDragOptions(targetDraggable); this._attachEventHandlers() }, _getAction(name) { return this[`_${name}Action`] || this._createActionByOption(name) }, _getAnonymousTemplateName: () => "content", _initTemplates() { if (!this.option("contentTemplate")) { return } this._templateManager.addDefaultTemplates({ content: new _empty_template.EmptyTemplate }); this.callBase.apply(this, arguments) }, _render() { this.callBase(); this.$element().addClass(this._addWidgetPrefix()); const transclude = this._templateManager.anonymousTemplateName === this.option("contentTemplate"); const template = this._getTemplateByOption("contentTemplate"); if (template) { (0, _renderer.default)(template.render({ container: this.element(), transclude: transclude })) } }, _optionChanged(args) { const { name: name } = args; switch (name) { case "onDragStart": case "onDragMove": case "onDragEnd": case "onDrop": case "onDragEnter": case "onDragLeave": case "onDragCancel": case "onDraggableElementShown": this[`_${name}Action`] = this._createActionByOption(name); break; case "dragTemplate": case "contentTemplate": case "container": case "clone": case "scrollSensitivity": case "scrollSpeed": case "boundOffset": case "handle": case "group": case "data": case "itemData": break; case "allowMoveByClick": case "dragDirection": case "disabled": case "boundary": case "filter": case "immediate": this._resetDragElement(); this._detachEventHandlers(); this._attachEventHandlers(); break; case "onCancelByEsc": this._keydownHandler(); break; case "autoScroll": this._verticalScrollHelper.reset(); this._horizontalScrollHelper.reset(); break; default: this.callBase(args) } }, _getTargetDraggable() { return targetDraggable || this }, _getSourceDraggable() { return sourceDraggable || this }, _setTargetDraggable() { const currentGroup = this.option("group"); const sourceDraggable = this._getSourceDraggable(); if (currentGroup && currentGroup === sourceDraggable.option("group")) { targetDraggable = this } }, _setSourceDraggable() { sourceDraggable = this }, _resetSourceDraggable() { sourceDraggable = null }, _resetTargetDraggable() { targetDraggable = null }, _resetDragOptions(targetDraggable) { this.reset(); targetDraggable.reset(); this._stopAnimator(); this._horizontalScrollHelper.reset(); this._verticalScrollHelper.reset(); this._resetDragElement(); this._resetSourceElement(); this._resetTargetDraggable(); this._resetSourceDraggable() }, _dispose() { this.callBase(); this._detachEventHandlers(); this._resetDragElement(); this._resetTargetDraggable(); this._resetSourceDraggable(); this._$sourceElement = null; this._stopAnimator() }, _fireDragEnterEvent(sourceEvent) { const args = this._getEventArgs(sourceEvent); this._getAction("onDragEnter")(args) }, _fireDragLeaveEvent(sourceEvent) { const args = this._getEventArgs(sourceEvent); this._getAction("onDragLeave")(args) } }); (0, _component_registrator.default)(DRAGGABLE, Draggable); exports.default = Draggable }, 75500: /*!**********************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/m_sortable.js ***! \**********************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _fx = _interopRequireDefault(__webpack_require__( /*! ../animation/fx */ 87209)); var _translator = __webpack_require__( /*! ../animation/translator */ 31648); var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../core/component_registrator */ 99393)); var _element = __webpack_require__( /*! ../core/element */ 6415); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../core/renderer */ 68374)); var _deferred = __webpack_require__( /*! ../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../core/utils/extend */ 13306); var _position = __webpack_require__( /*! ../core/utils/position */ 37518); var _size = __webpack_require__( /*! ../core/utils/size */ 58664); var _window = __webpack_require__( /*! ../core/utils/window */ 58201); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../events/core/events_engine */ 55994)); var _m_draggable = _interopRequireDefault(__webpack_require__( /*! ./m_draggable */ 86988)); var _type = __webpack_require__( /*! ../core/utils/type */ 35922); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const window = (0, _window.getWindow)(); const isElementVisible = itemElement => (0, _renderer.default)(itemElement).is(":visible"); const animate = (element, config) => { var _config$to, _config$to2; if (!element) { return } const left = (null === (_config$to = config.to) || void 0 === _config$to ? void 0 : _config$to.left) || 0; const top = (null === (_config$to2 = config.to) || void 0 === _config$to2 ? void 0 : _config$to2.top) || 0; element.style.transform = `translate(${left}px,${top}px)`; element.style.transition = _fx.default.off ? "" : `transform ${config.duration}ms ${config.easing}` }; const stopAnimation = element => { if (!element) { return } element.style.transform = ""; element.style.transition = "" }; const Sortable = _m_draggable.default.inherit({ _init() { this.callBase(); this._sourceScrollHandler = this._handleSourceScroll.bind(this); this._sourceScrollableInfo = null }, _getDefaultOptions() { 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, easing: "ease" }, fromIndex: null, toIndex: null, dropInsideItem: false, itemPoints: null, fromIndexOffset: 0, offset: 0, autoUpdate: false, draggableElementSize: 0 }) }, reset() { this.option({ dropInsideItem: false, toIndex: null, fromIndex: null, itemPoints: null, fromIndexOffset: 0, draggableElementSize: 0 }); if (this._$placeholderElement) { this._$placeholderElement.remove() } this._$placeholderElement = null; if (!this._isIndicateMode() && this._$modifiedItem) { this._$modifiedItem.css("marginBottom", this._modifiedItemMargin); this._$modifiedItem = null } }, _getPrevVisibleItem: (items, index) => items.slice(0, index).reverse().filter(isElementVisible)[0], _dragStartHandler(e) { this.callBase.apply(this, arguments); if (true === e.cancel) { return } const $sourceElement = this._getSourceElement(); this._updateItemPoints(); this._subscribeToSourceScroll(e); this.option("fromIndex", this._getElementIndex($sourceElement)); this.option("fromIndexOffset", this.option("offset")) }, _subscribeToSourceScroll(e) { const $scrollable = this._getScrollable((0, _renderer.default)(e.target)); if ($scrollable) { this._sourceScrollableInfo = { element: $scrollable, scrollLeft: $scrollable.scrollLeft(), scrollTop: $scrollable.scrollTop() }; _events_engine.default.off($scrollable, "scroll", this._sourceScrollHandler); _events_engine.default.on($scrollable, "scroll", this._sourceScrollHandler) } }, _unsubscribeFromSourceScroll() { if (this._sourceScrollableInfo) { _events_engine.default.off(this._sourceScrollableInfo.element, "scroll", this._sourceScrollHandler); this._sourceScrollableInfo = null } }, _handleSourceScroll(e) { const sourceScrollableInfo = this._sourceScrollableInfo; if (sourceScrollableInfo) { ["scrollLeft", "scrollTop"].forEach((scrollProp => { if (e.target[scrollProp] !== sourceScrollableInfo[scrollProp]) { const scrollBy = e.target[scrollProp] - sourceScrollableInfo[scrollProp]; this._correctItemPoints(scrollBy); this._movePlaceholder(); sourceScrollableInfo[scrollProp] = e.target[scrollProp] } })) } }, _dragEnterHandler(e) { this.callBase.apply(this, arguments); if (this === this._getSourceDraggable()) { return } this._subscribeToSourceScroll(e); this._updateItemPoints(); this.option("fromIndex", -1); if (!this._isIndicateMode()) { const itemPoints = this.option("itemPoints"); const lastItemPoint = itemPoints[itemPoints.length - 1]; if (lastItemPoint) { const $element = this.$element(); const $sourceElement = this._getSourceElement(); const isVertical = this._isVerticalOrientation(); const sourceElementSize = isVertical ? (0, _size.getOuterHeight)($sourceElement, true) : (0, _size.getOuterWidth)($sourceElement, true); const scrollSize = $element.get(0)[isVertical ? "scrollHeight" : "scrollWidth"]; const scrollPosition = $element.get(0)[isVertical ? "scrollTop" : "scrollLeft"]; const positionProp = isVertical ? "top" : "left"; const lastPointPosition = lastItemPoint[positionProp]; const elementPosition = $element.offset()[positionProp]; const freeSize = elementPosition + scrollSize - scrollPosition - lastPointPosition; if (freeSize < sourceElementSize) { if (isVertical) { const items = this._getItems(); const $lastItem = (0, _renderer.default)(this._getPrevVisibleItem(items)); this._$modifiedItem = $lastItem; this._modifiedItemMargin = $lastItem.get(0).style.marginBottom; $lastItem.css("marginBottom", sourceElementSize - freeSize); const $sortable = $lastItem.closest(".dx-sortable"); const sortable = $sortable.data("dxScrollable") || $sortable.data("dxScrollView"); sortable && sortable.update() } } } } }, _dragLeaveHandler() { this.callBase.apply(this, arguments); if (this !== this._getSourceDraggable()) { this._unsubscribeFromSourceScroll() } }, dragEnter() { if (this !== this._getTargetDraggable()) { this.option("toIndex", -1) } }, dragLeave() { if (this !== this._getTargetDraggable()) { this.option("toIndex", this.option("fromIndex")) } }, _allowDrop(event) { const targetDraggable = this._getTargetDraggable(); const $targetDraggable = targetDraggable.$element(); const $scrollable = this._getScrollable($targetDraggable); if ($scrollable) { const { left: left, right: right, top: top, bottom: bottom } = function($scrollable) { const offset = $scrollable.offset(); const { style: style } = $scrollable[0]; const paddingLeft = parseFloat(style.paddingLeft) || 0; const paddingRight = parseFloat(style.paddingRight) || 0; const paddingTop = parseFloat(style.paddingTop) || 0; const width = $scrollable[0].clientWidth - (paddingLeft + paddingRight); const height = (0, _size.getHeight)($scrollable); const left = offset.left + paddingLeft; const top = offset.top + paddingTop; return { left: left, right: left + width, top: top, bottom: top + height } }($scrollable); const toIndex = this.option("toIndex"); const itemPoints = this.option("itemPoints"); const itemPoint = null === itemPoints || void 0 === itemPoints ? void 0 : itemPoints.filter((item => item.index === toIndex))[0]; if (itemPoint && void 0 !== itemPoint.top) { const isVertical = this._isVerticalOrientation(); if (isVertical) { return top <= Math.ceil(itemPoint.top) && Math.floor(itemPoint.top) <= bottom } return left <= Math.ceil(itemPoint.left) && Math.floor(itemPoint.left) <= right } } return true }, dragEnd(sourceEvent) { this._unsubscribeFromSourceScroll(); const $sourceElement = this._getSourceElement(); const sourceDraggable = this._getSourceDraggable(); const isSourceDraggable = sourceDraggable.NAME !== this.NAME; const toIndex = this.option("toIndex"); const { event: event } = sourceEvent; const allowDrop = this._allowDrop(event); if (null !== toIndex && toIndex >= 0 && allowDrop) { let cancelAdd; let cancelRemove; if (sourceDraggable !== this) { cancelAdd = this._fireAddEvent(event); if (!cancelAdd) { cancelRemove = this._fireRemoveEvent(event) } } if (isSourceDraggable) { (0, _translator.resetPosition)($sourceElement) } if (this.option("moveItemOnDrop")) { !cancelAdd && this._moveItem($sourceElement, toIndex, cancelRemove) } if (sourceDraggable === this) { return this._fireReorderEvent(event) } } return (0, _deferred.Deferred)().resolve() }, dragMove(e) { const itemPoints = this.option("itemPoints"); if (!itemPoints) { return } const isVertical = this._isVerticalOrientation(); const axisName = isVertical ? "top" : "left"; const cursorPosition = isVertical ? e.pageY : e.pageX; const rtlEnabled = this.option("rtlEnabled"); let itemPoint; for (let i = itemPoints.length - 1; i >= 0; i--) { const centerPosition = itemPoints[i + 1] && (itemPoints[i][axisName] + itemPoints[i + 1][axisName]) / 2; if ((!isVertical && rtlEnabled ? cursorPosition > centerPosition : 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() { return "indicate" === this.option("dropFeedbackMode") || this.option("allowDropInsideItem") }, _createPlaceholder() { let $placeholderContainer; if (this._isIndicateMode()) { $placeholderContainer = (0, _renderer.default)("
").addClass(this._addWidgetPrefix("placeholder")).insertBefore(this._getSourceDraggable()._$dragElement) } this._$placeholderElement = $placeholderContainer; return $placeholderContainer }, _getItems() { const itemsSelector = this._getItemsSelector(); return this._$content().find(itemsSelector).not(`.${this._addWidgetPrefix("placeholder")}`).not(`.${this._addWidgetPrefix("clone")}`).toArray() }, _allowReordering() { const sourceDraggable = this._getSourceDraggable(); const targetDraggable = this._getTargetDraggable(); return sourceDraggable !== targetDraggable || this.option("allowReordering") }, _isValidPoint(visibleIndex, draggableVisibleIndex, dropInsideItem) { const allowDropInsideItem = this.option("allowDropInsideItem"); const allowReordering = dropInsideItem || this._allowReordering(); if (!allowReordering && (0 !== visibleIndex || !allowDropInsideItem)) { return false } if (!this._isIndicateMode()) { return true } return -1 === draggableVisibleIndex || visibleIndex !== draggableVisibleIndex && (dropInsideItem || visibleIndex !== draggableVisibleIndex + 1) }, _getItemPoints() { const that = this; let result = []; let $item; let offset; let itemWidth; const rtlEnabled = that.option("rtlEnabled"); const isVertical = that._isVerticalOrientation(); const itemElements = that._getItems(); const visibleItemElements = itemElements.filter(isElementVisible); const visibleItemCount = visibleItemElements.length; const $draggableItem = this._getDraggableElement(); const draggableVisibleIndex = visibleItemElements.indexOf($draggableItem.get(0)); if (visibleItemCount) { for (let i = 0; i <= visibleItemCount; i++) { const needCorrectLeftPosition = !isVertical && rtlEnabled ^ i === visibleItemCount; const needCorrectTopPosition = isVertical && i === visibleItemCount; if (i < visibleItemCount) { $item = (0, _renderer.default)(visibleItemElements[i]); offset = $item.offset(); itemWidth = (0, _size.getOuterWidth)($item) } result.push({ dropInsideItem: false, left: offset.left + (needCorrectLeftPosition ? itemWidth : 0), top: offset.top + (needCorrectTopPosition ? result[i - 1].height : 0), index: i === visibleItemCount ? itemElements.length : itemElements.indexOf($item.get(0)), $item: $item, width: (0, _size.getOuterWidth)($item), height: (0, _size.getOuterHeight)($item), isValid: that._isValidPoint(i, draggableVisibleIndex) }) } if (this.option("allowDropInsideItem")) { const points = result; result = []; for (let 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(i, draggableVisibleIndex, true) })) } } } } else { result.push({ dropInsideItem: false, index: 0, isValid: true }) } return result }, _updateItemPoints(forceUpdate) { if (forceUpdate || this.option("autoUpdate") || !this.option("itemPoints")) { this.option("itemPoints", this._getItemPoints()) } }, _correctItemPoints(scrollBy) { const itemPoints = this.option("itemPoints"); if (scrollBy && itemPoints && !this.option("autoUpdate")) { const isVertical = this._isVerticalOrientation(); const positionPropName = isVertical ? "top" : "left"; itemPoints.forEach((itemPoint => { itemPoint[positionPropName] -= scrollBy })) } }, _getElementIndex($itemElement) { return this._getItems().indexOf($itemElement.get(0)) }, _getDragTemplateArgs($element) { const args = this.callBase.apply(this, arguments); args.model.fromIndex = this._getElementIndex($element); return args }, _togglePlaceholder(value) { this._$placeholderElement && this._$placeholderElement.toggle(value) }, _isVerticalOrientation() { return "vertical" === this.option("itemOrientation") }, _normalizeToIndex(toIndex, skipOffsetting) { const isAnotherDraggable = this._getSourceDraggable() !== this._getTargetDraggable(); const fromIndex = this._getActualFromIndex(); if (null === toIndex) { return fromIndex } return Math.max(isAnotherDraggable || fromIndex >= toIndex || skipOffsetting ? toIndex : toIndex - 1, 0) }, _updatePlaceholderPosition(e, itemPoint) { const sourceDraggable = this._getSourceDraggable(); const toIndex = this._normalizeToIndex(itemPoint.index, itemPoint.dropInsideItem); const 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, _element.getPublicElement)(this._$placeholderElement), dragElement: (0, _element.getPublicElement)(sourceDraggable._$dragElement) })); this._updateItemPoints() }, _makeWidthCorrection($item, width) { this._$scrollable = this._getScrollable($item); if (this._$scrollable) { const scrollableWidth = (0, _size.getWidth)(this._$scrollable); const overflowLeft = this._$scrollable.offset().left - $item.offset().left; const overflowRight = (0, _size.getOuterWidth)($item) - overflowLeft - scrollableWidth; if (overflowLeft > 0) { width -= overflowLeft } if (overflowRight > 0) { width -= overflowRight } } return width }, _updatePlaceholderSizes($placeholderElement, itemElement) { const dropInsideItem = this.option("dropInsideItem"); const $item = (0, _renderer.default)(itemElement); const isVertical = this._isVerticalOrientation(); let width = ""; let height = ""; $placeholderElement.toggleClass(this._addWidgetPrefix("placeholder-inside"), dropInsideItem); if (isVertical || dropInsideItem) { width = (0, _size.getOuterWidth)($item) } if (!isVertical || dropInsideItem) { height = (0, _size.getOuterHeight)($item) } width = this._makeWidthCorrection($item, width); $placeholderElement.css({ width: width, height: height }) }, _moveItem($itemElement, index, cancelRemove) { let $prevTargetItemElement; const $itemElements = this._getItems(); const $targetItemElement = $itemElements[index]; const sourceDraggable = this._getSourceDraggable(); if (cancelRemove) { $itemElement = $itemElement.clone(); sourceDraggable._toggleDragSourceClass(false, $itemElement) } if (!$targetItemElement) { $prevTargetItemElement = $itemElements[index - 1] } this._moveItemCore($itemElement, $targetItemElement, $prevTargetItemElement) }, _moveItemCore($targetItem, item, prevItem) { if (!item && !prevItem) { $targetItem.appendTo(this.$element()) } else if (prevItem) { $targetItem.insertAfter((0, _renderer.default)(prevItem)) } else { $targetItem.insertBefore((0, _renderer.default)(item)) } }, _getDragStartArgs(e, $itemElement) { return (0, _extend.extend)(this.callBase.apply(this, arguments), { fromIndex: this._getElementIndex($itemElement) }) }, _getEventArgs(e) { const sourceDraggable = this._getSourceDraggable(); const targetDraggable = this._getTargetDraggable(); const 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(args) { const { name: name } = args; 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 "animation": case "allowReordering": case "fromIndexOffset": case "offset": case "draggableElementSize": case "autoUpdate": break; case "fromIndex": [false, true].forEach((isDragSource => { const fromIndex = isDragSource ? args.value : args.previousValue; if (null !== fromIndex) { const $fromElement = (0, _renderer.default)(this._getItems()[fromIndex]); this._toggleDragSourceClass(isDragSource, $fromElement) } })); break; case "dropInsideItem": this._optionChangedDropInsideItem(args); break; case "toIndex": this._optionChangedToIndex(args); break; default: this.callBase(args) } }, _optionChangedDropInsideItem() { if (this._isIndicateMode() && this._$placeholderElement) { this._movePlaceholder() } }, _isPositionVisible(position) { const $element = this.$element(); let scrollContainer; if ("hidden" !== $element.css("overflow")) { scrollContainer = $element.get(0) } else { $element.parents().each((function() { if ("visible" !== (0, _renderer.default)(this).css("overflow")) { scrollContainer = this; return false } return })) } if (scrollContainer) { const clientRect = (0, _position.getBoundingRect)(scrollContainer); const isVerticalOrientation = this._isVerticalOrientation(); const start = isVerticalOrientation ? "top" : "left"; const end = isVerticalOrientation ? "bottom" : "right"; const pageOffset = isVerticalOrientation ? window.pageYOffset : window.pageXOffset; if (position[start] < clientRect[start] + pageOffset || position[start] > clientRect[end] + pageOffset) { return false } } return true }, _optionChangedToIndex(args) { const toIndex = args.value; if (this._isIndicateMode()) { const showPlaceholder = null !== toIndex && toIndex >= 0; this._togglePlaceholder(showPlaceholder); if (showPlaceholder) { this._movePlaceholder() } } else { this._moveItems(args.previousValue, args.value, args.fullUpdate) } }, update() { if (null === this.option("fromIndex") && null === this.option("toIndex")) { return } this._updateItemPoints(true); this._updateDragSourceClass(); const toIndex = this.option("toIndex"); this._optionChangedToIndex({ value: toIndex, fullUpdate: true }) }, _updateDragSourceClass() { const fromIndex = this._getActualFromIndex(); const $fromElement = (0, _renderer.default)(this._getItems()[fromIndex]); if ($fromElement.length) { this._$sourceElement = $fromElement; this._toggleDragSourceClass(true, $fromElement) } }, _makeLeftCorrection(left) { const $scrollable = this._$scrollable; if ($scrollable && this._isVerticalOrientation()) { const overflowLeft = $scrollable.offset().left - left; if (overflowLeft > 0) { left += overflowLeft } } return left }, _movePlaceholder() { const that = this; const $placeholderElement = that._$placeholderElement || that._createPlaceholder(); if (!$placeholderElement) { return } const items = that._getItems(); const toIndex = that.option("toIndex"); const isVerticalOrientation = that._isVerticalOrientation(); const rtlEnabled = this.option("rtlEnabled"); const dropInsideItem = that.option("dropInsideItem"); let position = null; let itemElement = items[toIndex]; if (itemElement) { const $itemElement = (0, _renderer.default)(itemElement); position = $itemElement.offset(); if (!isVerticalOrientation && rtlEnabled && !dropInsideItem) { position.left += (0, _size.getOuterWidth)($itemElement, true) } } else { const prevVisibleItemElement = itemElement = this._getPrevVisibleItem(items, toIndex); if (prevVisibleItemElement) { position = (0, _renderer.default)(prevVisibleItemElement).offset(); if (isVerticalOrientation) { position.top += (0, _size.getOuterHeight)(prevVisibleItemElement, true) } else if (!rtlEnabled) { position.left += (0, _size.getOuterWidth)(prevVisibleItemElement, true) } } } that._updatePlaceholderSizes($placeholderElement, itemElement); if (position && !that._isPositionVisible(position)) { position = null } if (position) { const isLastVerticalPosition = isVerticalOrientation && toIndex === items.length; const outerPlaceholderHeight = (0, _size.getOuterHeight)($placeholderElement); position.left = that._makeLeftCorrection(position.left); position.top = isLastVerticalPosition && position.top >= outerPlaceholderHeight ? position.top - outerPlaceholderHeight : position.top; that._move(position, $placeholderElement) } $placeholderElement.toggle(!!position) }, _getPositions(items, elementSize, fromIndex, toIndex) { const positions = []; for (let i = 0; i < items.length; i++) { let position = 0; if (null === toIndex || null === fromIndex) { positions.push(position); continue } if (-1 === fromIndex) { if (i >= toIndex) { position = elementSize } } else if (-1 === toIndex) { 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 }, _getDraggableElementSize(isVerticalOrientation) { const $draggableItem = this._getDraggableElement(); let size = this.option("draggableElementSize"); if (!size) { size = isVerticalOrientation ? ((0, _size.getOuterHeight)($draggableItem) + (0, _size.getOuterHeight)($draggableItem, true)) / 2 : ((0, _size.getOuterWidth)($draggableItem) + (0, _size.getOuterWidth)($draggableItem, true)) / 2; if (!this.option("autoUpdate")) { this.option("draggableElementSize", size) } } return size }, _getActualFromIndex() { const { fromIndex: fromIndex, fromIndexOffset: fromIndexOffset, offset: offset } = this.option(); return null == fromIndex ? null : fromIndex + fromIndexOffset - offset }, _moveItems(prevToIndex, toIndex, fullUpdate) { const fromIndex = this._getActualFromIndex(); const isVerticalOrientation = this._isVerticalOrientation(); const positionPropName = isVerticalOrientation ? "top" : "left"; const elementSize = this._getDraggableElementSize(isVerticalOrientation); const items = this._getItems(); const prevPositions = this._getPositions(items, elementSize, fromIndex, prevToIndex); const positions = this._getPositions(items, elementSize, fromIndex, toIndex); const animationConfig = this.option("animation"); const rtlEnabled = this.option("rtlEnabled"); for (let i = 0; i < items.length; i++) { const itemElement = items[i]; const prevPosition = prevPositions[i]; const position = positions[i]; if (null === toIndex || null === fromIndex) { stopAnimation(itemElement) } else if (prevPosition !== position || fullUpdate && (0, _type.isDefined)(position)) { animate(itemElement, (0, _extend.extend)({}, animationConfig, { to: { [positionPropName]: !isVerticalOrientation && rtlEnabled ? -position : position } })) } } }, _toggleDragSourceClass(value, $element) { const $sourceElement = $element || this._$sourceElement; this.callBase.apply(this, arguments); if (!this._isIndicateMode()) { $sourceElement && $sourceElement.toggleClass(this._addWidgetPrefix("source-hidden"), value) } }, _dispose() { this.reset(); this.callBase() }, _fireAddEvent(sourceEvent) { const args = this._getEventArgs(sourceEvent); this._getAction("onAdd")(args); return args.cancel }, _fireRemoveEvent(sourceEvent) { const sourceDraggable = this._getSourceDraggable(); const args = this._getEventArgs(sourceEvent); sourceDraggable._getAction("onRemove")(args); return args.cancel }, _fireReorderEvent(sourceEvent) { const args = this._getEventArgs(sourceEvent); this._getAction("onReorder")(args); return args.promise || (0, _deferred.Deferred)().resolve() } }); (0, _component_registrator.default)("dxSortable", Sortable); exports.default = Sortable }, 25387: /*!**********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointment_popup/m_form.js ***! \**********************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.AppointmentForm = exports.APPOINTMENT_FORM_GROUP_NAMES = void 0; __webpack_require__( /*! ../m_recurrence_editor */ 70184); __webpack_require__( /*! ../../../ui/text_area */ 51237); __webpack_require__( /*! ../../../ui/tag_box */ 31362); __webpack_require__( /*! ../../../ui/switch */ 31609); __webpack_require__( /*! ../../../ui/select_box */ 78665); var _devices = _interopRequireDefault(__webpack_require__( /*! ../../../core/devices */ 20530)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374)); var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198)); var _date_serialization = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date_serialization */ 69434)); var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306); var _data_source = _interopRequireDefault(__webpack_require__( /*! ../../../data/data_source */ 33546)); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../localization/message */ 28109)); var _form = _interopRequireDefault(__webpack_require__( /*! ../../../ui/form */ 17737)); var _themes = __webpack_require__( /*! ../../../ui/themes */ 75811); var _m_expression_utils = __webpack_require__( /*! ../../scheduler/m_expression_utils */ 30906); var _index = __webpack_require__( /*! ../../scheduler/r1/semaphore/index */ 66803); var _m_appointment_adapter = __webpack_require__( /*! ../m_appointment_adapter */ 72734); var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../m_utils_time_zone */ 57880)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const APPOINTMENT_FORM_GROUP_NAMES = exports.APPOINTMENT_FORM_GROUP_NAMES = { Main: "mainGroup", Recurrence: "recurrenceGroup" }; const E2E_TEST_CLASSES_form = "e2e-dx-scheduler-form", E2E_TEST_CLASSES_textEditor = "e2e-dx-scheduler-form-text", E2E_TEST_CLASSES_descriptionEditor = "e2e-dx-scheduler-form-description", E2E_TEST_CLASSES_startDateEditor = "e2e-dx-scheduler-form-start-date", E2E_TEST_CLASSES_endDateEditor = "e2e-dx-scheduler-form-end-date", E2E_TEST_CLASSES_startDateTimeZoneEditor = "e2e-dx-scheduler-form-start-date-timezone", E2E_TEST_CLASSES_endDateTimeZoneEditor = "e2e-dx-scheduler-form-end-date-timezone", E2E_TEST_CLASSES_allDaySwitch = "e2e-dx-scheduler-form-all-day-switch", E2E_TEST_CLASSES_recurrenceSwitch = "e2e-dx-scheduler-form-recurrence-switch"; const getStylingModeFunc = () => (0, _themes.isFluent)((0, _themes.current)()) ? "filled" : void 0; exports.AppointmentForm = class { constructor(scheduler) { this.scheduler = scheduler; this.form = null; this.semaphore = new _index.Semaphore } get dxForm() { return this.form } set readOnly(value) { this.form.option("readOnly", value); const { recurrenceRuleExpr: recurrenceRuleExpr } = this.scheduler.getDataAccessors().expr; const recurrenceEditor = this.form.getEditor(recurrenceRuleExpr); null === recurrenceEditor || void 0 === recurrenceEditor || recurrenceEditor.option("readOnly", value) } get formData() { return this.form.option("formData") } set formData(value) { this.form.option("formData", value) } create(triggerResize, changeSize, formData) { const { allowTimeZoneEditing: allowTimeZoneEditing } = this.scheduler.getEditingConfig(); const dataAccessors = this.scheduler.getDataAccessors(); const { expr: expr } = dataAccessors; const isRecurrence = !!_m_expression_utils.ExpressionUtils.getField(dataAccessors, "recurrenceRule", formData); const colSpan = isRecurrence ? 1 : 2; const mainItems = [...this._createMainItems(expr, triggerResize, changeSize, allowTimeZoneEditing), ...this.scheduler.createResourceEditorModel()]; changeSize(isRecurrence); const items = [{ itemType: "group", name: APPOINTMENT_FORM_GROUP_NAMES.Main, colCountByScreen: { lg: 2, xs: 1 }, colSpan: colSpan, items: mainItems }, { itemType: "group", name: APPOINTMENT_FORM_GROUP_NAMES.Recurrence, visible: isRecurrence, colSpan: colSpan, items: this._createRecurrenceEditor(expr) }]; const element = (0, _renderer.default)("
"); this.scheduler.createComponent(element, _form.default, { items: items, showValidationSummary: true, scrollingEnabled: true, colCount: "auto", colCountByScreen: { lg: 2, xs: 1 }, formData: formData, showColonAfterLabel: false, labelLocation: "top", onInitialized: e => { this.form = e.component }, customizeItem: e => { if (this.form && "group" === e.itemType) { const dataExprs = this.scheduler.getDataAccessors().expr; const startDate = new Date(this.formData[dataExprs.startDateExpr]); const endDate = new Date(this.formData[dataExprs.endDateExpr]); const startTimeZoneEditor = e.items.find((i => i.dataField === dataExprs.startDateTimeZoneExpr)); const endTimeZoneEditor = e.items.find((i => i.dataField === dataExprs.endDateTimeZoneExpr)); if (startTimeZoneEditor) { startTimeZoneEditor.editorOptions.dataSource = this.createTimeZoneDataSource(startDate) } if (endTimeZoneEditor) { endTimeZoneEditor.editorOptions.dataSource = this.createTimeZoneDataSource(endDate) } } }, screenByWidth: width => width < 600 || "desktop" !== _devices.default.current().deviceType ? "xs" : "lg", elementAttr: { class: E2E_TEST_CLASSES_form } }) } createTimeZoneDataSource(date) { return new _data_source.default({ store: _m_utils_time_zone.default.getTimeZones(date), paginate: true, pageSize: 10 }) } _createAppointmentAdapter(rawAppointment) { return (0, _m_appointment_adapter.createAppointmentAdapter)(rawAppointment, this.scheduler.getDataAccessors()) } _dateBoxValueChanged(args, dateExpr, isNeedCorrect) { ((editor, value, previousValue) => { const isCurrentDateCorrect = null === value || !!value; const isPreviousDateCorrect = null === previousValue || !!previousValue; if (!isCurrentDateCorrect && isPreviousDateCorrect) { editor.option("value", previousValue) } })(args.component, args.value, args.previousValue); const value = _date_serialization.default.deserializeDate(args.value); const previousValue = _date_serialization.default.deserializeDate(args.previousValue); const dateEditor = this.form.getEditor(dateExpr); const dateValue = _date_serialization.default.deserializeDate(dateEditor.option("value")); if (this.semaphore.isFree() && dateValue && value && isNeedCorrect(dateValue, value)) { const duration = previousValue ? dateValue.getTime() - previousValue.getTime() : 0; dateEditor.option("value", new Date(value.getTime() + duration)) } } _createTimezoneEditor(timeZoneExpr, secondTimeZoneExpr, visibleIndex, colSpan, isMainTimeZone, cssClass) { let visible = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : false; const noTzTitle = _message.default.format("dxScheduler-noTimezoneTitle"); return { name: this.normalizeEditorName(timeZoneExpr), dataField: timeZoneExpr, editorType: "dxSelectBox", visibleIndex: visibleIndex, colSpan: colSpan, cssClass: cssClass, label: { text: " " }, editorOptions: { displayExpr: "title", valueExpr: "id", placeholder: noTzTitle, searchEnabled: true, onValueChanged: args => { const { form: form } = this; const secondTimezoneEditor = form.getEditor(secondTimeZoneExpr); if (isMainTimeZone) { secondTimezoneEditor.option("value", args.value) } } }, visible: visible } } _createDateBoxItems(dataExprs, allowTimeZoneEditing) { const colSpan = allowTimeZoneEditing ? 2 : 1; const firstDayOfWeek = this.scheduler.getFirstDayOfWeek(); return [this.createDateBoxEditor(dataExprs.startDateExpr, colSpan, firstDayOfWeek, "dxScheduler-editorLabelStartDate", E2E_TEST_CLASSES_startDateEditor, (args => { this._dateBoxValueChanged(args, dataExprs.endDateExpr, ((endValue, startValue) => endValue < startValue)) })), this._createTimezoneEditor(dataExprs.startDateTimeZoneExpr, dataExprs.endDateTimeZoneExpr, 1, colSpan, true, E2E_TEST_CLASSES_startDateTimeZoneEditor, allowTimeZoneEditing), this.createDateBoxEditor(dataExprs.endDateExpr, colSpan, firstDayOfWeek, "dxScheduler-editorLabelEndDate", E2E_TEST_CLASSES_endDateEditor, (args => { this._dateBoxValueChanged(args, dataExprs.startDateExpr, ((startValue, endValue) => endValue < startValue)) })), this._createTimezoneEditor(dataExprs.endDateTimeZoneExpr, dataExprs.startDateTimeZoneExpr, 3, colSpan, false, E2E_TEST_CLASSES_endDateTimeZoneEditor, allowTimeZoneEditing)] } _changeFormItemDateType(name, groupName, isAllDay) { const editorPath = this.getEditorPath(name, groupName); const itemEditorOptions = this.form.itemOption(editorPath).editorOptions; const type = isAllDay ? "date" : "datetime"; const newEditorOption = _extends({}, itemEditorOptions, { type: type }); this.form.itemOption(editorPath, "editorOptions", newEditorOption) } _createMainItems(dataExprs, triggerResize, changeSize, allowTimeZoneEditing) { return [{ name: this.normalizeEditorName(dataExprs.textExpr), dataField: dataExprs.textExpr, cssClass: E2E_TEST_CLASSES_textEditor, editorType: "dxTextBox", colSpan: 2, label: { text: _message.default.format("dxScheduler-editorLabelTitle") }, editorOptions: { stylingMode: getStylingModeFunc() } }, { itemType: "group", colSpan: 2, colCountByScreen: { lg: 2, xs: 1 }, items: this._createDateBoxItems(dataExprs, allowTimeZoneEditing) }, { itemType: "group", colSpan: 2, colCountByScreen: { lg: 2, xs: 2 }, items: [{ name: this.normalizeEditorName(dataExprs.allDayExpr), dataField: dataExprs.allDayExpr, cssClass: `dx-appointment-form-switch ${E2E_TEST_CLASSES_allDaySwitch}`, editorType: "dxSwitch", label: { text: _message.default.format("dxScheduler-allDay"), location: "right" }, editorOptions: { onValueChanged: args => { const { value: value } = args; const startDateEditor = this.form.getEditor(dataExprs.startDateExpr); const endDateEditor = this.form.getEditor(dataExprs.endDateExpr); const startDate = _date_serialization.default.deserializeDate(startDateEditor.option("value")); if (this.semaphore.isFree() && startDate) { if (value) { const allDayStartDate = _date.default.trimTime(startDate); startDateEditor.option("value", new Date(allDayStartDate)); endDateEditor.option("value", new Date(allDayStartDate)) } else { const startDateWithStartHour = ((startDate, startDayHour) => new Date(new Date(startDate).setHours(startDayHour)))(startDate, this.scheduler.getStartDayHour()); const endDate = this.scheduler.getCalculatedEndDate(startDateWithStartHour); startDateEditor.option("value", startDateWithStartHour); endDateEditor.option("value", endDate) } } this._changeFormItemDateType(dataExprs.startDateExpr, "Main", value); this._changeFormItemDateType(dataExprs.endDateExpr, "Main", value) } } }, { editorType: "dxSwitch", dataField: "repeat", cssClass: `dx-appointment-form-switch ${E2E_TEST_CLASSES_recurrenceSwitch}`, name: "visibilityChanged", label: { text: _message.default.format("dxScheduler-editorLabelRecurrence"), location: "right" }, editorOptions: { onValueChanged: args => { const { form: form } = this; const colSpan = args.value ? 1 : 2; form.itemOption(APPOINTMENT_FORM_GROUP_NAMES.Main, "colSpan", colSpan); form.itemOption(APPOINTMENT_FORM_GROUP_NAMES.Recurrence, "colSpan", colSpan); ((recurrenceRuleExpr, value, form) => { var _form$getEditor; form.itemOption(APPOINTMENT_FORM_GROUP_NAMES.Recurrence, "visible", value); null === (_form$getEditor = form.getEditor(recurrenceRuleExpr)) || void 0 === _form$getEditor || _form$getEditor.changeValueByVisibility(value) })(dataExprs.recurrenceRuleExpr, args.value, form); changeSize(args.value); triggerResize() } } }] }, { itemType: "empty", colSpan: 2 }, { name: this.normalizeEditorName(dataExprs.descriptionExpr), dataField: dataExprs.descriptionExpr, cssClass: E2E_TEST_CLASSES_descriptionEditor, editorType: "dxTextArea", colSpan: 2, label: { text: _message.default.format("dxScheduler-editorLabelDescription") }, editorOptions: { stylingMode: getStylingModeFunc() } }, { itemType: "empty", colSpan: 2 }] } _createRecurrenceEditor(dataExprs) { return [{ name: this.normalizeEditorName(dataExprs.recurrenceRuleExpr), dataField: dataExprs.recurrenceRuleExpr, editorType: "dxRecurrenceEditor", editorOptions: { firstDayOfWeek: this.scheduler.getFirstDayOfWeek(), timeZoneCalculator: this.scheduler.getTimeZoneCalculator(), getStartDateTimeZone: () => this._createAppointmentAdapter(this.formData).startDateTimeZone }, label: { text: " ", visible: false } }] } setEditorsType(allDay) { const { startDateExpr: startDateExpr, endDateExpr: endDateExpr } = this.scheduler.getDataAccessors().expr; const startDateItemPath = this.getEditorPath(startDateExpr, "Main"); const endDateItemPath = this.getEditorPath(endDateExpr, "Main"); const startDateFormItem = this.form.itemOption(startDateItemPath); const endDateFormItem = this.form.itemOption(endDateItemPath); if (startDateFormItem && endDateFormItem) { const startDateEditorOptions = startDateFormItem.editorOptions; const endDateEditorOptions = endDateFormItem.editorOptions; startDateEditorOptions.type = endDateEditorOptions.type = allDay ? "date" : "datetime"; this.form.itemOption(startDateItemPath, "editorOptions", startDateEditorOptions); this.form.itemOption(endDateItemPath, "editorOptions", endDateEditorOptions) } } updateRecurrenceEditorStartDate(date, expression) { const options = { startDate: date }; this.setEditorOptions(expression, "Recurrence", options) } setEditorOptions(name, groupName, options) { const editorPath = this.getEditorPath(name, groupName); const editor = this.form.itemOption(editorPath); editor && this.form.itemOption(editorPath, "editorOptions", (0, _extend.extend)({}, editor.editorOptions, options)) } setTimeZoneEditorDataSource(date, name) { const dataSource = this.createTimeZoneDataSource(date); this.setEditorOptions(name, "Main", { dataSource: dataSource }) } updateFormData(formData) { this.semaphore.take(); this.form.option("formData", formData); const dataAccessors = this.scheduler.getDataAccessors(); const { expr: expr } = dataAccessors; const rawStartDate = _m_expression_utils.ExpressionUtils.getField(dataAccessors, "startDate", formData); const rawEndDate = _m_expression_utils.ExpressionUtils.getField(dataAccessors, "endDate", formData); const allDay = _m_expression_utils.ExpressionUtils.getField(dataAccessors, "allDay", formData); const startDate = new Date(rawStartDate); const endDate = new Date(rawEndDate); this.setTimeZoneEditorDataSource(startDate, expr.startDateTimeZoneExpr); this.setTimeZoneEditorDataSource(endDate, expr.endDateTimeZoneExpr); this.updateRecurrenceEditorStartDate(startDate, expr.recurrenceRuleExpr); this.setEditorsType(allDay); this.semaphore.release() } createDateBoxEditor(dataField, colSpan, firstDayOfWeek, label, cssClass, onValueChanged) { return { editorType: "dxDateBox", name: this.normalizeEditorName(dataField), dataField: dataField, colSpan: colSpan, cssClass: cssClass, label: { text: _message.default.format(label) }, validationRules: [{ type: "required" }], editorOptions: { stylingMode: getStylingModeFunc(), width: "100%", calendarOptions: { firstDayOfWeek: firstDayOfWeek }, onValueChanged: onValueChanged, useMaskBehavior: true } } } getEditorPath(name, groupName) { const normalizedName = this.normalizeEditorName(name); return `${APPOINTMENT_FORM_GROUP_NAMES[groupName]}.${normalizedName}` } normalizeEditorName(name) { return name ? name.replace(/\./g, "_") : name } } }, 77135: /*!***********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointment_popup/m_popup.js ***! \***********************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.AppointmentPopup = exports.ACTION_TO_APPOINTMENT = void 0; var _devices = _interopRequireDefault(__webpack_require__( /*! ../../../core/devices */ 20530)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374)); var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198)); var _deferred = __webpack_require__( /*! ../../../core/utils/deferred */ 62754); var _visibility_change = __webpack_require__( /*! ../../../events/visibility_change */ 80506); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../ui/popup/ui.popup */ 51495)); var _m_expression_utils = __webpack_require__( /*! ../../scheduler/m_expression_utils */ 30906); var _index = __webpack_require__( /*! ../../scheduler/r1/appointment_popup/index */ 30695); var _m_appointment_adapter = __webpack_require__( /*! ../m_appointment_adapter */ 72734); var _m_loading = __webpack_require__( /*! ../m_loading */ 28066); var _m_utils = __webpack_require__( /*! ../resources/m_utils */ 31359); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const toMs = _date.default.dateToMilliseconds; const DAY_IN_MS = toMs("day"); const POPUP_CONFIG = { height: "auto", maxHeight: "100%", showCloseButton: false, showTitle: false, preventScrollEvents: false, enableBodyScroll: false, defaultOptionsRules: [{ device: () => _devices.default.current().android, options: { showTitle: false } }], _ignorePreventScrollEventsDeprecation: true }; const ACTION_TO_APPOINTMENT = exports.ACTION_TO_APPOINTMENT = { CREATE: 0, UPDATE: 1, EXCLUDE_FROM_SERIES: 2 }; exports.AppointmentPopup = class { constructor(scheduler, form) { this.scheduler = scheduler; this.form = form; this.popup = null; this.state = { action: null, lastEditData: null, saveChangesLocker: false, appointment: { data: null } } } get visible() { return this.popup ? this.popup.option("visible") : false } show(appointment, config) { this.state.appointment.data = appointment; this.state.action = config.action; this.state.excludeInfo = config.excludeInfo; if (!this.popup) { const popupConfig = this._createPopupConfig(); this.popup = this._createPopup(popupConfig) } this.popup.option("toolbarItems", (0, _index.getPopupToolbarItems)(config.isToolbarVisible, (e => this._doneButtonClickHandler(e)))); this.popup.show() } hide() { this.popup.hide() } dispose() { var _this$popup; null === (_this$popup = this.popup) || void 0 === _this$popup || _this$popup.$element().remove() } _createPopup(options) { const popupElement = (0, _renderer.default)("
").addClass("dx-scheduler-appointment-popup").appendTo(this.scheduler.getElement()); return this.scheduler.createComponent(popupElement, _ui.default, options) } _createPopupConfig() { return _extends({}, POPUP_CONFIG, { onHiding: () => this.scheduler.focus(), contentTemplate: () => this._createPopupContent(), onShowing: e => this._onShowing(e), wrapperAttr: { class: "dx-scheduler-appointment-popup" } }) } _onShowing(e) { this._updateForm(); const arg = { form: this.form.dxForm, popup: this.popup, appointmentData: this.state.appointment.data, cancel: false }; this.scheduler.getAppointmentFormOpening()(arg); this.scheduler.processActionResult(arg, (canceled => { if (canceled) { e.cancel = true } else { this.updatePopupFullScreenMode() } })) } _createPopupContent() { this._createForm(); return this.form.dxForm.$element() } _createFormData(rawAppointment) { const appointment = this._createAppointmentAdapter(rawAppointment); const dataAccessors = this.scheduler.getDataAccessors(); const resources = this.scheduler.getResources(); const normalizedResources = (0, _m_utils.getNormalizedResources)(rawAppointment, dataAccessors, resources); return _extends({}, rawAppointment, normalizedResources, { repeat: !!appointment.recurrenceRule }) } _createForm() { const rawAppointment = this.state.appointment.data; const formData = this._createFormData(rawAppointment); this.form.create(this.triggerResize.bind(this), this.changeSize.bind(this), formData) } _isReadOnly(rawAppointment) { const appointment = this._createAppointmentAdapter(rawAppointment); if (rawAppointment && appointment.disabled) { return true } if (this.state.action === ACTION_TO_APPOINTMENT.CREATE) { return false } return !this.scheduler.getEditingConfig().allowUpdating } _createAppointmentAdapter(rawAppointment) { return (0, _m_appointment_adapter.createAppointmentAdapter)(rawAppointment, this.scheduler.getDataAccessors(), this.scheduler.getTimeZoneCalculator()) } _updateForm() { const { data: data } = this.state.appointment; const appointment = this._createAppointmentAdapter(this._createFormData(data)); if (appointment.startDate) { appointment.startDate = appointment.calculateStartDate("toAppointment") } if (appointment.endDate) { appointment.endDate = appointment.calculateEndDate("toAppointment") } const formData = appointment.clone().source(); this.form.readOnly = this._isReadOnly(formData); this.form.updateFormData(formData) } triggerResize() { if (this.popup) { (0, _visibility_change.triggerResizeEvent)(this.popup.$element()) } } changeSize(isRecurrence) { if (this.popup) { const isFullScreen = (0, _index.isPopupFullScreenNeeded)(); const maxWidth = isFullScreen ? "100%" : (0, _index.getMaxWidth)(isRecurrence); this.popup.option("fullScreen", isFullScreen); this.popup.option("maxWidth", maxWidth) } } updatePopupFullScreenMode() { if (this.form.dxForm && this.visible) { const { formData: formData } = this.form; const dataAccessors = this.scheduler.getDataAccessors(); const isRecurrence = _m_expression_utils.ExpressionUtils.getField(dataAccessors, "recurrenceRule", formData); this.changeSize(isRecurrence) } } saveChangesAsync(isShowLoadPanel) { const deferred = new _deferred.Deferred; const validation = this.form.dxForm.validate(); isShowLoadPanel && this._showLoadPanel(); (0, _deferred.when)(validation && validation.complete || validation).done((validation => { if (validation && !validation.isValid) { (0, _m_loading.hide)(); deferred.resolve(false); return } const { repeat: repeat } = this.form.formData; const adapter = this._createAppointmentAdapter(this.form.formData); const clonedAdapter = adapter.clone({ pathTimeZone: "fromAppointment" }); const shouldClearRecurrenceRule = !repeat && !!clonedAdapter.recurrenceRule; this._addMissingDSTTime(adapter, clonedAdapter); if (shouldClearRecurrenceRule) { clonedAdapter.recurrenceRule = "" } const appointment = clonedAdapter.source(); delete appointment.repeat; switch (this.state.action) { case ACTION_TO_APPOINTMENT.CREATE: this.scheduler.addAppointment(appointment).done(deferred.resolve); break; case ACTION_TO_APPOINTMENT.UPDATE: this.scheduler.updateAppointment(this.state.appointment.data, appointment).done(deferred.resolve); break; case ACTION_TO_APPOINTMENT.EXCLUDE_FROM_SERIES: this.scheduler.updateAppointment(this.state.excludeInfo.sourceAppointment, this.state.excludeInfo.updatedAppointment); this.scheduler.addAppointment(appointment).done(deferred.resolve) } deferred.done((() => { (0, _m_loading.hide)(); this.state.lastEditData = appointment })) })); return deferred.promise() } _doneButtonClickHandler(e) { e.cancel = true; this.saveEditDataAsync() } saveEditDataAsync() { const deferred = new _deferred.Deferred; if (this._tryLockSaveChanges()) { (0, _deferred.when)(this.saveChangesAsync(true)).done((() => { if (this.state.lastEditData) { const adapter = this._createAppointmentAdapter(this.state.lastEditData); const { startDate: startDate, endDate: endDate, allDay: allDay } = adapter; const startTime = startDate.getTime(); const endTime = endDate.getTime(); const inAllDayRow = allDay || endTime - startTime >= DAY_IN_MS; const dataAccessors = this.scheduler.getDataAccessors(); const resourceList = this.scheduler.getResources(); const normalizedResources = (0, _m_utils.getNormalizedResources)(this.state.lastEditData, dataAccessors, resourceList); this.scheduler.updateScrollPosition(startDate, normalizedResources, inAllDayRow); this.state.lastEditData = null } this._unlockSaveChanges(); deferred.resolve() })) } return deferred.promise() } _showLoadPanel() { const container = this.popup.$overlayContent(); (0, _m_loading.show)({ container: container, position: { of: container } }) } _tryLockSaveChanges() { if (false === this.state.saveChangesLocker) { this.state.saveChangesLocker = true; return true } return false } _unlockSaveChanges() { this.state.saveChangesLocker = false } _addMissingDSTTime(formAppointmentAdapter, clonedAppointmentAdapter) { const timeZoneCalculator = this.scheduler.getTimeZoneCalculator(); clonedAppointmentAdapter.startDate = this._addMissingDSTShiftToDate(timeZoneCalculator, formAppointmentAdapter.startDate, clonedAppointmentAdapter.startDate); if (clonedAppointmentAdapter.endDate) { clonedAppointmentAdapter.endDate = this._addMissingDSTShiftToDate(timeZoneCalculator, formAppointmentAdapter.endDate, clonedAppointmentAdapter.endDate) } } _addMissingDSTShiftToDate(timeZoneCalculator, originFormDate, clonedDate) { var _timeZoneCalculator$g, _timeZoneCalculator$g2; const originTimezoneShift = null === (_timeZoneCalculator$g = timeZoneCalculator.getOffsets(originFormDate)) || void 0 === _timeZoneCalculator$g ? void 0 : _timeZoneCalculator$g.common; const clonedTimezoneShift = null === (_timeZoneCalculator$g2 = timeZoneCalculator.getOffsets(clonedDate)) || void 0 === _timeZoneCalculator$g2 ? void 0 : _timeZoneCalculator$g2.common; const shiftDifference = originTimezoneShift - clonedTimezoneShift; return shiftDifference ? new Date(clonedDate.getTime() + shiftDifference * toMs("hour")) : clonedDate } } }, 92823: /*!****************************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/data_provider/m_appointment_data_provider.js ***! \****************************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.AppointmentDataProvider = void 0; var _config = (obj = __webpack_require__( /*! ../../../../core/config */ 80209), obj && obj.__esModule ? obj : { default: obj }); var obj; var _index = __webpack_require__( /*! ../../../scheduler/r1/filterting/index */ 7884); var _m_appointment_data_source = __webpack_require__( /*! ./m_appointment_data_source */ 93074); var _m_appointment_filter = __webpack_require__( /*! ./m_appointment_filter */ 30256); const FilterStrategies_virtual = "virtual", FilterStrategies_standard = "standard"; exports.AppointmentDataProvider = class { constructor(options) { this.options = options; this.dataSource = this.options.dataSource; this.dataAccessors = this.options.dataAccessors; this.timeZoneCalculator = this.options.timeZoneCalculator; this.appointmentDataSource = new _m_appointment_data_source.AppointmentDataSource(this.dataSource); this.initFilterStrategy() } get keyName() { return this.appointmentDataSource.keyName } get isDataSourceInit() { return !!this.dataSource } get filterStrategyName() { return this.options.getIsVirtualScrolling() ? FilterStrategies_virtual : FilterStrategies_standard } getFilterStrategy() { if (!this.filterStrategy || this.filterStrategy.strategyName !== this.filterStrategyName) { this.initFilterStrategy() } return this.filterStrategy } initFilterStrategy() { const filterOptions = { resources: this.options.resources, dataAccessors: this.dataAccessors, startDayHour: this.options.startDayHour, endDayHour: this.options.endDayHour, viewOffset: this.options.viewOffset, showAllDayPanel: this.options.showAllDayPanel, timeZoneCalculator: this.options.timeZoneCalculator, loadedResources: this.options.getLoadedResources, supportAllDayRow: this.options.getSupportAllDayRow, viewType: this.options.getViewType, viewDirection: this.options.getViewDirection, dateRange: this.options.getDateRange, groupCount: this.options.getGroupCount, viewDataProvider: this.options.getViewDataProvider, allDayPanelMode: this.options.allDayPanelMode }; this.filterStrategy = this.filterStrategyName === FilterStrategies_virtual ? new _m_appointment_filter.AppointmentFilterVirtualStrategy(filterOptions) : new _m_appointment_filter.AppointmentFilterBaseStrategy(filterOptions) } setDataSource(dataSource) { this.dataSource = dataSource; this.initFilterStrategy(); this.appointmentDataSource.setDataSource(this.dataSource) } updateDataAccessors(dataAccessors) { this.dataAccessors = dataAccessors; this.initFilterStrategy() } filter(preparedItems) { return this.getFilterStrategy().filter(preparedItems) } filterByDate(min, max, remoteFiltering, dateSerializationFormat) { if (!this.dataSource || !remoteFiltering) { return } const dataSourceFilter = this.dataSource.filter(); const filter = (0, _index.combineRemoteFilter)({ dataSourceFilter: dataSourceFilter, dataAccessors: this.dataAccessors, min: min, max: max, dateSerializationFormat: dateSerializationFormat, forceIsoDateParsing: (0, _config.default)().forceIsoDateParsing }); this.dataSource.filter(filter) } hasAllDayAppointments(filteredItems, preparedItems) { return this.getFilterStrategy().hasAllDayAppointments(filteredItems, preparedItems) } filterLoadedAppointments(filterOption, preparedItems) { return this.getFilterStrategy().filterLoadedAppointments(filterOption, preparedItems) } calculateAppointmentEndDate(isAllDay, startDate) { return this.getFilterStrategy().calculateAppointmentEndDate(isAllDay, startDate) } cleanState() { this.appointmentDataSource.cleanState() } getUpdatedAppointment() { return this.appointmentDataSource._updatedAppointment } getUpdatedAppointmentKeys() { return this.appointmentDataSource._updatedAppointmentKeys } add(rawAppointment) { return this.appointmentDataSource.add(rawAppointment) } update(target, rawAppointment) { return this.appointmentDataSource.update(target, rawAppointment) } remove(rawAppointment) { return this.appointmentDataSource.remove(rawAppointment) } destroy() { this.appointmentDataSource.destroy() } } }, 93074: /*!**************************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/data_provider/m_appointment_data_source.js ***! \**************************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.AppointmentDataSource = void 0; var _deferred = __webpack_require__( /*! ../../../../core/utils/deferred */ 62754); const STORE_EVENTS_updating = "updating", STORE_EVENTS_push = "push"; exports.AppointmentDataSource = class { constructor(dataSource) { this.setDataSource(dataSource); this._updatedAppointmentKeys = [] } get keyName() { const store = this._dataSource.store(); return store.key() } get isDataSourceInit() { return !!this._dataSource } _getStoreKey(target) { const store = this._dataSource.store(); return store.keyOf(target) } setDataSource(dataSource) { this._dataSource = dataSource; this.cleanState(); this._initStoreChangeHandlers() } _initStoreChangeHandlers() { const dataSource = this._dataSource; const store = null === dataSource || void 0 === dataSource ? void 0 : dataSource.store(); if (store) { store.on(STORE_EVENTS_updating, (key => { const keyName = store.key(); if (keyName) { this._updatedAppointmentKeys.push({ key: keyName, value: key }) } else { this._updatedAppointment = key } })); store.on(STORE_EVENTS_push, (pushItems => { const items = dataSource.items(); const keyName = store.key(); pushItems.forEach((pushItem => { const itemExists = 0 !== items.filter((item => item[keyName] === pushItem.key)).length; if (itemExists) { this._updatedAppointmentKeys.push({ key: keyName, value: pushItem.key }) } else { const { data: data } = pushItem; data && items.push(data) } })); dataSource.load() })) } } getUpdatedAppointment() { return this._updatedAppointment } getUpdatedAppointmentKeys() { return this._updatedAppointmentKeys } cleanState() { this._updatedAppointment = null; this._updatedAppointmentKeys = [] } add(rawAppointment) { return this._dataSource.store().insert(rawAppointment).done((() => this._dataSource.load())) } update(target, data) { const key = this._getStoreKey(target); const d = new _deferred.Deferred; this._dataSource.store().update(key, data).done((result => this._dataSource.load().done((() => d.resolve(result))).fail(d.reject))).fail(d.reject); return d.promise() } remove(rawAppointment) { const key = this._getStoreKey(rawAppointment); return this._dataSource.store().remove(key).done((() => this._dataSource.load())) } destroy() { var _this$_dataSource; const store = null === (_this$_dataSource = this._dataSource) || void 0 === _this$_dataSource ? void 0 : _this$_dataSource.store(); if (store) { store.off(STORE_EVENTS_updating); store.off(STORE_EVENTS_push) } } } }, 30256: /*!*********************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/data_provider/m_appointment_filter.js ***! \*********************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.AppointmentFilterVirtualStrategy = exports.AppointmentFilterBaseStrategy = void 0; var _array = __webpack_require__( /*! ../../../../core/utils/array */ 89386); var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198)); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _query = _interopRequireDefault(__webpack_require__( /*! ../../../../data/query */ 96687)); var _date2 = __webpack_require__( /*! ../../../core/utils/date */ 24321); var _index = __webpack_require__( /*! ../../../scheduler/r1/utils/index */ 94084); var _m_appointment_adapter = __webpack_require__( /*! ../../m_appointment_adapter */ 72734); var _m_recurrence = __webpack_require__( /*! ../../m_recurrence */ 38227); var _m_utils = __webpack_require__( /*! ../../resources/m_utils */ 31359); var _m_utils2 = __webpack_require__( /*! ./m_utils */ 55523); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const toMs = _date.default.dateToMilliseconds; const FilterStrategies_virtual = "virtual", FilterStrategies_standard = "standard"; class AppointmentFilterBaseStrategy { constructor(options) { this.options = options; this.dataAccessors = this.options.dataAccessors; this._init() } get strategyName() { return FilterStrategies_standard } get timeZoneCalculator() { return this.options.timeZoneCalculator } get viewStartDayHour() { return this.options.startDayHour } get viewEndDayHour() { return this.options.endDayHour } get timezone() { return this.options.timezone } get firstDayOfWeek() { return this.options.firstDayOfWeek } get showAllDayPanel() { return this.options.showAllDayPanel } get loadedResources() { return this._resolveOption("loadedResources") } get supportAllDayRow() { return this._resolveOption("supportAllDayRow") } get viewType() { return this._resolveOption("viewType") } get viewDirection() { return this._resolveOption("viewDirection") } get dateRange() { return this._resolveOption("dateRange") } get groupCount() { return this._resolveOption("groupCount") } get viewDataProvider() { return this._resolveOption("viewDataProvider") } get allDayPanelMode() { return this._resolveOption("allDayPanelMode") } _resolveOption(name) { const result = this.options[name]; return "function" === typeof result ? result() : result } _init() { this.setDataAccessors(this.dataAccessors) } filter(preparedItems) { const [min, max] = this.dateRange; const { viewOffset: viewOffset } = this.options; const allDay = !this.showAllDayPanel && this.supportAllDayRow ? false : void 0; return this.filterLoadedAppointments({ startDayHour: this.viewStartDayHour, endDayHour: this.viewEndDayHour, viewOffset: viewOffset, viewStartDayHour: this.viewStartDayHour, viewEndDayHour: this.viewEndDayHour, min: min, max: max, resources: this.loadedResources, allDay: allDay, supportMultiDayAppointments: (0, _index.isTimelineView)(this.viewType), firstDayOfWeek: this.firstDayOfWeek }, preparedItems) } hasAllDayAppointments(filteredItems, preparedItems) { const adapters = filteredItems.map((item => (0, _m_appointment_adapter.createAppointmentAdapter)(item, this.dataAccessors, this.timeZoneCalculator))); let result = false; (0, _iterator.each)(adapters, ((_, item) => { if ((0, _index.getAppointmentTakesAllDay)(item, this.allDayPanelMode)) { result = true; return false } })); return result } setDataAccessors(dataAccessors) { this.dataAccessors = dataAccessors } _createAllDayAppointmentFilter() { return [ [appointment => (0, _index.getAppointmentTakesAllDay)(appointment, this.allDayPanelMode)] ] } _createCombinedFilter(filterOptions) { const min = new Date(filterOptions.min); const max = new Date(filterOptions.max); const { startDayHour: startDayHour, endDayHour: endDayHour, viewOffset: viewOffset, viewStartDayHour: viewStartDayHour, viewEndDayHour: viewEndDayHour, resources: resources, firstDayOfWeek: firstDayOfWeek, checkIntersectViewport: checkIntersectViewport, supportMultiDayAppointments: supportMultiDayAppointments } = filterOptions; const [trimMin, trimMax] = (0, _index.getDatesWithoutTime)(min, max); const useRecurrence = (0, _type.isDefined)(this.dataAccessors.getter.recurrenceRule); return [ [appointment => { const appointmentVisible = appointment.visible ?? true; if (!appointmentVisible) { return false } const { allDay: isAllDay, hasRecurrenceRule: hasRecurrenceRule } = appointment; const startDate = _date2.dateUtilsTs.addOffsets(appointment.startDate, [-viewOffset]); const endDate = _date2.dateUtilsTs.addOffsets(appointment.endDate, [-viewOffset]); const appointmentTakesAllDay = (0, _index.getAppointmentTakesAllDay)(appointment, this.allDayPanelMode); if (!hasRecurrenceRule) { if (!(endDate >= trimMin && startDate < trimMax || _date.default.sameDate(endDate, trimMin) && _date.default.sameDate(startDate, trimMin))) { return false } } const appointmentTakesSeveralDays = (0, _m_utils2.getAppointmentTakesSeveralDays)(appointment); const isLongAppointment = appointmentTakesSeveralDays || appointmentTakesAllDay; if (null !== resources && void 0 !== resources && resources.length && !this._filterAppointmentByResources(appointment.rawAppointment, resources)) { return false } if (appointmentTakesAllDay && false === filterOptions.allDay) { return false } if (hasRecurrenceRule) { const recurrenceException = (0, _m_utils2.getRecurrenceException)(appointment, this.timeZoneCalculator, this.timezone); if (!this._filterAppointmentByRRule(_extends({}, appointment, { recurrenceException: recurrenceException, allDay: appointmentTakesAllDay }), min, max, startDayHour, endDayHour, firstDayOfWeek)) { return false } } if (!isAllDay && supportMultiDayAppointments && isLongAppointment) { if (endDate < min && (!useRecurrence || useRecurrence && !hasRecurrenceRule)) { return false } } if (!isAllDay && (0, _type.isDefined)(startDayHour) && (!useRecurrence || !filterOptions.isVirtualScrolling)) { if (!(0, _m_utils2.compareDateWithStartDayHour)(startDate, endDate, startDayHour, appointmentTakesAllDay, appointmentTakesSeveralDays)) { return false } } if (!isAllDay && (0, _type.isDefined)(endDayHour)) { if (!(0, _m_utils2.compareDateWithEndDayHour)({ startDate: startDate, endDate: endDate, startDayHour: startDayHour, endDayHour: endDayHour, viewOffset: viewOffset, viewStartDayHour: viewStartDayHour, viewEndDayHour: viewEndDayHour, allDay: appointmentTakesAllDay, severalDays: appointmentTakesSeveralDays, min: min, max: max, checkIntersectViewport: checkIntersectViewport })) { return false } } if (!isAllDay && (!isLongAppointment || supportMultiDayAppointments)) { if (endDate < min && useRecurrence && !hasRecurrenceRule) { return false } } return true }] ] } _createAppointmentFilter(filterOptions) { return this._createCombinedFilter(filterOptions) } _filterAppointmentByResources(appointment, resources) { const checkAppointmentResourceValues = (resourceName, resourceIndex) => { const resourceGetter = this.dataAccessors.resources.getter[resourceName]; let resource; if ((0, _type.isFunction)(resourceGetter)) { resource = resourceGetter(appointment) } const appointmentResourceValues = (0, _array.wrapToArray)(resource); const resourceData = (0, _iterator.map)(resources[resourceIndex].items, (_ref => { let { id: id } = _ref; return id })); for (let i = 0; i < appointmentResourceValues.length; i++) { if ((0, _index.hasResourceValue)(resourceData, appointmentResourceValues[i])) { return true } } return false }; let result = false; for (let i = 0; i < resources.length; i++) { const resourceName = resources[i].name; result = checkAppointmentResourceValues(resourceName, i); if (!result) { return false } } return result } _filterAppointmentByRRule(appointment, min, max, startDayHour, endDayHour, firstDayOfWeek) { const { recurrenceRule: recurrenceRule } = appointment; const { recurrenceException: recurrenceException } = appointment; const { allDay: allDay } = appointment; let result = true; const appointmentStartDate = appointment.startDate; const appointmentEndDate = appointment.endDate; const recurrenceProcessor = (0, _m_recurrence.getRecurrenceProcessor)(); if (allDay || (0, _m_utils2._appointmentPartInInterval)(appointmentStartDate, appointmentEndDate, startDayHour, endDayHour)) { const [trimMin, trimMax] = (0, _index.getDatesWithoutTime)(min, max); min = trimMin; max = new Date(trimMax.getTime() - toMs("minute")) } if (recurrenceRule && !recurrenceProcessor.isValidRecurrenceRule(recurrenceRule)) { result = appointmentEndDate > min && appointmentStartDate <= max } if (result && recurrenceProcessor.isValidRecurrenceRule(recurrenceRule)) { const { viewOffset: viewOffset } = this.options; result = recurrenceProcessor.hasRecurrence({ rule: recurrenceRule, exception: recurrenceException, start: appointmentStartDate, end: appointmentEndDate, min: _date2.dateUtilsTs.addOffsets(min, [viewOffset]), max: _date2.dateUtilsTs.addOffsets(max, [viewOffset]), firstDayOfWeek: firstDayOfWeek, appointmentTimezoneOffset: this.timeZoneCalculator.getOriginStartDateOffsetInMs(appointmentStartDate, appointment.startDateTimeZone, false) }) } return result } filterLoadedAppointments(filterOptions, preparedItems) { const filteredItems = this.filterPreparedItems(filterOptions, preparedItems); return filteredItems.map((_ref2 => { let { rawAppointment: rawAppointment } = _ref2; return rawAppointment })) } filterPreparedItems(filterOptions, preparedItems) { const combinedFilter = this._createAppointmentFilter(filterOptions); return (0, _query.default)(preparedItems).filter(combinedFilter).toArray() } filterAllDayAppointments(preparedItems) { const combinedFilter = this._createAllDayAppointmentFilter(); return (0, _query.default)(preparedItems).filter(combinedFilter).toArray().map((_ref3 => { let { rawAppointment: rawAppointment } = _ref3; return rawAppointment })) } } exports.AppointmentFilterBaseStrategy = AppointmentFilterBaseStrategy; exports.AppointmentFilterVirtualStrategy = class extends AppointmentFilterBaseStrategy { get strategyName() { return FilterStrategies_virtual } get resources() { return this.options.resources } filter(preparedItems) { const { viewOffset: viewOffset } = this.options; const hourMs = toMs("hour"); const isCalculateStartAndEndDayHour = (0, _index.isDateAndTimeView)(this.viewType); const checkIntersectViewport = isCalculateStartAndEndDayHour && "horizontal" === this.viewDirection; const isAllDayWorkspace = !this.supportAllDayRow; const showAllDayAppointments = this.showAllDayPanel || isAllDayWorkspace; const endViewDate = this.viewDataProvider.getLastViewDateByEndDayHour(this.viewEndDayHour); const shiftedEndViewDate = _date2.dateUtilsTs.addOffsets(endViewDate, [viewOffset]); const filterOptions = []; const groupsInfo = this.viewDataProvider.getCompletedGroupsInfo(); groupsInfo.forEach((item => { const { groupIndex: groupIndex } = item; const groupStartDate = item.startDate; const groupEndDate = new Date(Math.min(item.endDate.getTime(), shiftedEndViewDate.getTime())); const startDayHour = isCalculateStartAndEndDayHour ? groupStartDate.getHours() : this.viewStartDayHour; const endDayHour = isCalculateStartAndEndDayHour ? startDayHour + groupStartDate.getMinutes() / 60 + (groupEndDate.getTime() - groupStartDate.getTime()) / hourMs : this.viewEndDayHour; const resources = this._getPrerenderFilterResources(groupIndex); const hasAllDayPanel = this.viewDataProvider.hasGroupAllDayPanel(groupIndex); const supportAllDayAppointment = isAllDayWorkspace || !!showAllDayAppointments && hasAllDayPanel; filterOptions.push({ isVirtualScrolling: true, startDayHour: startDayHour, endDayHour: endDayHour, viewOffset: viewOffset, viewStartDayHour: this.viewStartDayHour, viewEndDayHour: this.viewEndDayHour, min: _date2.dateUtilsTs.addOffsets(groupStartDate, [-viewOffset]), max: _date2.dateUtilsTs.addOffsets(groupEndDate, [-viewOffset]), supportMultiDayAppointments: (0, _index.isTimelineView)(this.viewType), allDay: supportAllDayAppointment, resources: resources, firstDayOfWeek: this.firstDayOfWeek, checkIntersectViewport: checkIntersectViewport }) })); return this.filterLoadedAppointments({ filterOptions: filterOptions, groupCount: this.groupCount }, preparedItems) } filterPreparedItems(_ref4, preparedItems) { let { filterOptions: filterOptions, groupCount: groupCount } = _ref4; const combinedFilters = []; let itemsToFilter = preparedItems; const needPreFilter = groupCount > 0; if (needPreFilter) { itemsToFilter = itemsToFilter.filter((_ref5 => { let { rawAppointment: rawAppointment } = _ref5; for (let i = 0; i < filterOptions.length; ++i) { const { resources: resources } = filterOptions[i]; if (this._filterAppointmentByResources(rawAppointment, resources)) { return true } } })) } filterOptions.forEach((option => { combinedFilters.length && combinedFilters.push("or"); const filter = this._createAppointmentFilter(option); combinedFilters.push(filter) })); return (0, _query.default)(itemsToFilter).filter(combinedFilters).toArray() } hasAllDayAppointments(filteredItems, preparedItems) { return this.filterAllDayAppointments(preparedItems).length > 0 } _getPrerenderFilterResources(groupIndex) { const cellGroup = this.viewDataProvider.getCellsGroup(groupIndex); return (0, _m_utils.getResourcesDataByGroups)(this.loadedResources, this.resources, [cellGroup]) } } }, 55523: /*!********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/data_provider/m_utils.js ***! \********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.sortAppointmentsByStartDate = exports.replaceWrongEndDate = exports.getRecurrenceException = exports.getAppointmentTakesSeveralDays = exports.compareDateWithStartDayHour = exports.compareDateWithEndDayHour = exports._isEndDateWrong = exports._convertRecurrenceException = exports._appointmentPartInInterval = void 0; var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198)); var _date_serialization = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date_serialization */ 69434)); var _m_expression_utils = __webpack_require__( /*! ../../m_expression_utils */ 30906); var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../../m_utils_time_zone */ 57880)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const toMs = _date.default.dateToMilliseconds; exports.compareDateWithStartDayHour = (startDate, endDate, startDayHour, allDay, severalDays) => { const startTime = _date.default.dateTimeFromDecimal(startDayHour); const result = startDate.getHours() >= startTime.hours && startDate.getMinutes() >= startTime.minutes || endDate.getHours() === startTime.hours && endDate.getMinutes() > startTime.minutes || endDate.getHours() > startTime.hours || severalDays || allDay; return result }; exports.compareDateWithEndDayHour = options => { const { startDate: startDate, endDate: endDate, startDayHour: startDayHour, endDayHour: endDayHour, viewStartDayHour: viewStartDayHour, viewEndDayHour: viewEndDayHour, allDay: allDay, severalDays: severalDays, min: min, max: max, checkIntersectViewport: checkIntersectViewport } = options; const hiddenInterval = (24 - viewEndDayHour + viewStartDayHour) * toMs("hour"); const apptDuration = endDate.getTime() - startDate.getTime(); const delta = (hiddenInterval - apptDuration) / toMs("hour"); const apptStartHour = startDate.getHours(); const apptStartMinutes = startDate.getMinutes(); let result; const endTime = _date.default.dateTimeFromDecimal(endDayHour); const startTime = _date.default.dateTimeFromDecimal(startDayHour); const apptIntersectViewport = startDate < max && endDate > min; result = checkIntersectViewport && apptIntersectViewport || apptStartHour < endTime.hours || apptStartHour === endTime.hours && apptStartMinutes < endTime.minutes || allDay && startDate <= max || severalDays && apptIntersectViewport && (apptStartHour < endTime.hours || 60 * endDate.getHours() + endDate.getMinutes() > 60 * startTime.hours); if (apptDuration < hiddenInterval) { if (apptStartHour > endTime.hours && apptStartMinutes > endTime.minutes && delta <= apptStartHour - endDayHour) { result = false } } return result }; exports.getAppointmentTakesSeveralDays = adapter => !_date.default.sameDate(adapter.startDate, adapter.endDate); const _isEndDateWrong = (startDate, endDate) => !endDate || isNaN(endDate.getTime()) || startDate.getTime() > endDate.getTime(); exports._isEndDateWrong = _isEndDateWrong; exports._appointmentPartInInterval = (startDate, endDate, startDayHour, endDayHour) => { const apptStartDayHour = startDate.getHours(); const apptEndDayHour = endDate.getHours(); return apptStartDayHour <= startDayHour && apptEndDayHour <= endDayHour && apptEndDayHour >= startDayHour || apptEndDayHour >= endDayHour && apptStartDayHour <= endDayHour && apptStartDayHour >= startDayHour }; exports.getRecurrenceException = (appointmentAdapter, timeZoneCalculator, timeZone) => { const { recurrenceException: recurrenceException } = appointmentAdapter; if (recurrenceException) { const exceptions = recurrenceException.split(","); for (let i = 0; i < exceptions.length; i++) { exceptions[i] = _convertRecurrenceException(exceptions[i], appointmentAdapter.startDate, timeZoneCalculator, timeZone) } return exceptions.join() } return recurrenceException }; const _convertRecurrenceException = (exceptionString, startDate, timeZoneCalculator, timeZone) => { exceptionString = exceptionString.replace(/\s/g, ""); const getConvertedToTimeZone = date => timeZoneCalculator.createDate(date, { path: "toGrid" }); const exceptionDate = _date_serialization.default.deserializeDate(exceptionString); const convertedStartDate = getConvertedToTimeZone(startDate); let convertedExceptionDate = getConvertedToTimeZone(exceptionDate); convertedExceptionDate = _m_utils_time_zone.default.correctRecurrenceExceptionByTimezone(convertedExceptionDate, convertedStartDate, timeZone); exceptionString = _date_serialization.default.serializeDate(convertedExceptionDate, "yyyyMMddTHHmmss"); return exceptionString }; exports._convertRecurrenceException = _convertRecurrenceException; exports.replaceWrongEndDate = (rawAppointment, startDate, endDate, appointmentDuration, dataAccessors) => { if (_isEndDateWrong(startDate, endDate)) { const isAllDay = _m_expression_utils.ExpressionUtils.getField(dataAccessors, "allDay", rawAppointment); const calculatedEndDate = ((isAllDay, startDate) => { if (isAllDay) { return _date.default.setToDayEnd(new Date(startDate)) } return new Date(startDate.getTime() + appointmentDuration * toMs("minute")) })(isAllDay, startDate); dataAccessors.setter.endDate(rawAppointment, calculatedEndDate) } }; exports.sortAppointmentsByStartDate = (appointments, dataAccessors) => { appointments.sort(((a, b) => { const firstDate = new Date(_m_expression_utils.ExpressionUtils.getField(dataAccessors, "startDate", a.settings || a)); const secondDate = new Date(_m_expression_utils.ExpressionUtils.getField(dataAccessors, "startDate", b.settings || b)); return Math.sign(firstDate.getTime() - secondDate.getTime()) })) } }, 99423: /*!************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/m_appointment.js ***! \************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.Appointment = exports.AgendaAppointment = void 0; var _translator = __webpack_require__( /*! ../../../animation/translator */ 31648); var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 99393)); var _dom_component = _interopRequireDefault(__webpack_require__( /*! ../../../core/dom_component */ 13046)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374)); var _deferred = __webpack_require__( /*! ../../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../events/core/events_engine */ 55994)); var _pointer = _interopRequireDefault(__webpack_require__( /*! ../../../events/pointer */ 93786)); var _index = __webpack_require__( /*! ../../../events/utils/index */ 39611); var _date = _interopRequireDefault(__webpack_require__( /*! ../../../localization/date */ 91500)); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../localization/message */ 28109)); var _resizable = _interopRequireDefault(__webpack_require__( /*! ../../../ui/resizable */ 46743)); var _m_tooltip = __webpack_require__( /*! ../../ui/tooltip/m_tooltip */ 63508); var _m_classes = __webpack_require__( /*! ../m_classes */ 43600); var _m_expression_utils = __webpack_require__( /*! ../m_expression_utils */ 30906); var _m_recurrence = __webpack_require__( /*! ../m_recurrence */ 38227); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const REDUCED_APPOINTMENT_POINTERENTER_EVENT_NAME = (0, _index.addNamespace)(_pointer.default.enter, "dxSchedulerAppointment"); const REDUCED_APPOINTMENT_POINTERLEAVE_EVENT_NAME = (0, _index.addNamespace)(_pointer.default.leave, "dxSchedulerAppointment"); class Appointment extends _dom_component.default { get coloredElement() { return this.$element() } get rawAppointment() { return this.option("data") } _getDefaultOptions() { return (0, _extend.extend)(super._getDefaultOptions(), { data: {}, groupIndex: -1, groups: [], geometry: { top: 0, left: 0, width: 0, height: 0 }, allowDrag: true, allowResize: true, reduced: null, isCompact: false, direction: "vertical", resizableConfig: { keepAspectRatio: false }, cellHeight: 0, cellWidth: 0, isDragSource: false }) } notifyObserver(subject, args) { const observer = this.option("observer"); if (observer) { observer.fire(subject, args) } } invoke(funcName) { const observer = this.option("observer"); if (observer) { return observer.fire.apply(observer, arguments) } } _optionChanged(args) { switch (args.name) { case "data": case "groupIndex": case "geometry": case "allowDrag": case "allowResize": case "reduced": case "sortedIndex": case "isCompact": case "direction": case "resizableConfig": case "cellHeight": case "cellWidth": this._invalidate(); break; case "isDragSource": this._renderDragSourceClass(); break; default: super._optionChanged(args) } } _getHorizontalResizingRule() { const reducedHandles = { head: this.option("rtlEnabled") ? "right" : "left", body: "", tail: this.option("rtlEnabled") ? "left" : "right" }; const getResizableStep = this.option("getResizableStep"); const step = getResizableStep ? getResizableStep() : 0; return { handles: this.option("reduced") ? reducedHandles[this.option("reduced")] : "left right", minHeight: 0, minWidth: this.invoke("getCellWidth"), step: step, roundStepValue: false } } _getVerticalResizingRule() { const height = Math.round(this.invoke("getCellHeight")); return { handles: "top bottom", minWidth: 0, minHeight: height, step: height, roundStepValue: true } } _render() { super._render(); this._renderAppointmentGeometry(); this._renderEmptyClass(); this._renderReducedAppointment(); this._renderAllDayClass(); this._renderDragSourceClass(); this._renderDirection(); this.$element().data("dxAppointmentStartDate", this.option("startDate")); const text = _m_expression_utils.ExpressionUtils.getField(this.option("dataAccessors"), "text", this.rawAppointment); this.$element().attr("title", text); this.$element().attr("role", "button"); this._renderRecurrenceClass(); this._renderResizable(); this._setResourceColor() } _setResourceColor() { const appointmentConfig = { itemData: this.rawAppointment, groupIndex: this.option("groupIndex"), groups: this.option("groups") }; const deferredColor = this.option("getAppointmentColor")(appointmentConfig); deferredColor.done((color => { if (color) { this.coloredElement.css("backgroundColor", color); this.coloredElement.addClass(_m_classes.APPOINTMENT_HAS_RESOURCE_COLOR_CLASS) } })) } _renderAppointmentGeometry() { const geometry = this.option("geometry"); const $element = this.$element(); (0, _translator.move)($element, { top: geometry.top, left: geometry.left }); $element.css({ width: geometry.width < 0 ? 0 : geometry.width, height: geometry.height < 0 ? 0 : geometry.height }) } _renderEmptyClass() { const geometry = this.option("geometry"); if (geometry.empty || this.option("isCompact")) { this.$element().addClass(_m_classes.EMPTY_APPOINTMENT_CLASS) } } _renderReducedAppointment() { const reducedPart = this.option("reduced"); if (!reducedPart) { return } this.$element().toggleClass(_m_classes.REDUCED_APPOINTMENT_CLASS, true).toggleClass(_m_classes.REDUCED_APPOINTMENT_PARTS_CLASSES[reducedPart], true); this._renderAppointmentReducedIcon() } _renderAppointmentReducedIcon() { const $icon = (0, _renderer.default)("
").addClass(_m_classes.REDUCED_APPOINTMENT_ICON).appendTo(this.$element()); const endDate = this._getEndDate(); const tooltipLabel = _message.default.format("dxScheduler-editorLabelEndDate"); const tooltipText = [tooltipLabel, ": ", _date.default.format(endDate, "monthAndDay"), ", ", _date.default.format(endDate, "year")].join(""); _events_engine.default.off($icon, REDUCED_APPOINTMENT_POINTERENTER_EVENT_NAME); _events_engine.default.on($icon, REDUCED_APPOINTMENT_POINTERENTER_EVENT_NAME, (() => { (0, _m_tooltip.show)({ target: $icon, content: tooltipText }) })); _events_engine.default.off($icon, REDUCED_APPOINTMENT_POINTERLEAVE_EVENT_NAME); _events_engine.default.on($icon, REDUCED_APPOINTMENT_POINTERLEAVE_EVENT_NAME, (() => { (0, _m_tooltip.hide)() })) } _getEndDate() { const result = _m_expression_utils.ExpressionUtils.getField(this.option("dataAccessors"), "endDate", this.rawAppointment); if (result) { return new Date(result) } return result } _renderAllDayClass() { this.$element().toggleClass(_m_classes.ALL_DAY_APPOINTMENT_CLASS, !!this.option("allDay")) } _renderDragSourceClass() { this.$element().toggleClass(_m_classes.APPOINTMENT_DRAG_SOURCE_CLASS, !!this.option("isDragSource")) } _renderRecurrenceClass() { const rule = _m_expression_utils.ExpressionUtils.getField(this.option("dataAccessors"), "recurrenceRule", this.rawAppointment); if ((0, _m_recurrence.getRecurrenceProcessor)().isValidRecurrenceRule(rule)) { this.$element().addClass(_m_classes.RECURRENCE_APPOINTMENT_CLASS) } } _renderDirection() { this.$element().addClass(_m_classes.DIRECTION_APPOINTMENT_CLASSES[this.option("direction")]) } _createResizingConfig() { const config = "vertical" === this.option("direction") ? this._getVerticalResizingRule() : this._getHorizontalResizingRule(); if (!this.invoke("isGroupedByDate")) { config.stepPrecision = "strict" } return config } _renderResizable() { if (this.option("allowResize")) { this._createComponent(this.$element(), _resizable.default, (0, _extend.extend)(this._createResizingConfig(), this.option("resizableConfig"))) } } _useTemplates() { return false } } exports.Appointment = Appointment; (0, _component_registrator.default)("dxSchedulerAppointment", Appointment); exports.AgendaAppointment = class extends Appointment { get coloredElement() { return this.$element().find(`.${_m_classes.APPOINTMENT_CONTENT_CLASSES.AGENDA_MARKER}`) } _getDefaultOptions() { return (0, _extend.extend)(super._getDefaultOptions(), { createPlainResourceListAsync: new _deferred.Deferred }) } _renderResourceList(container, list) { list.forEach((item => { const itemContainer = (0, _renderer.default)("
").addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.AGENDA_RESOURCE_LIST_ITEM).appendTo(container); (0, _renderer.default)("
").text(`${item.label}:`).appendTo(itemContainer); (0, _renderer.default)("
").addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.AGENDA_RESOURCE_LIST_ITEM_VALUE).text(item.values.join(", ")).appendTo(itemContainer) })) } _render() { super._render(); const createPlainResourceListAsync = this.option("createPlainResourceListAsync"); createPlainResourceListAsync(this.rawAppointment).done((list => { const parent = this.$element().find(`.${_m_classes.APPOINTMENT_CONTENT_CLASSES.APPOINTMENT_CONTENT_DETAILS}`); const container = (0, _renderer.default)("
").addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.AGENDA_RESOURCE_LIST).appendTo(parent); this._renderResourceList(container, list) })) } } }, 16993: /*!***********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/m_appointment_collection.js ***! \***********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _translator = __webpack_require__( /*! ../../../animation/translator */ 31648); var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 99393)); var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../core/dom_adapter */ 73349)); var _element = __webpack_require__( /*! ../../../core/element */ 6415); var _element_data = __webpack_require__( /*! ../../../core/element_data */ 97906); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374)); var _array = __webpack_require__( /*! ../../../core/utils/array */ 89386); var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576); var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198)); var _dom = __webpack_require__( /*! ../../../core/utils/dom */ 3532); var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 95479); var _object = __webpack_require__( /*! ../../../core/utils/object */ 48013); var _position = __webpack_require__( /*! ../../../core/utils/position */ 37518); var _size = __webpack_require__( /*! ../../../core/utils/size */ 58664); var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../events/core/events_engine */ 55994)); var _double_click = __webpack_require__( /*! ../../../events/double_click */ 85272); var _index = __webpack_require__( /*! ../../../events/utils/index */ 39611); var _uiCollection_widget = _interopRequireDefault(__webpack_require__( /*! ../../../ui/collection/ui.collection_widget.edit */ 11050)); var _date2 = __webpack_require__( /*! ../../core/utils/date */ 24321); var _m_appointment_adapter = __webpack_require__( /*! ../m_appointment_adapter */ 72734); var _m_classes = __webpack_require__( /*! ../m_classes */ 43600); var _m_constants = __webpack_require__( /*! ../m_constants */ 6324); var _m_expression_utils = __webpack_require__( /*! ../m_expression_utils */ 30906); var _m_recurrence = __webpack_require__( /*! ../m_recurrence */ 38227); var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../m_utils_time_zone */ 57880)); var _m_utils = __webpack_require__( /*! ./data_provider/m_utils */ 55523); var _m_appointment = __webpack_require__( /*! ./m_appointment */ 99423); var _m_appointment_layout = __webpack_require__( /*! ./m_appointment_layout */ 72417); var _m_core = __webpack_require__( /*! ./resizing/m_core */ 71687); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const DBLCLICK_EVENT_NAME = (0, _index.addNamespace)(_double_click.name, "dxSchedulerAppointment"); const toMs = _date.default.dateToMilliseconds; class SchedulerAppointments extends _uiCollection_widget.default { get isAgendaView() { return this.invoke("isCurrentViewAgenda") } get isVirtualScrolling() { return this.invoke("isVirtualScrolling") } get appointmentDataProvider() { return this.option("getAppointmentDataProvider")() } constructor(element, options) { super(element, options); this._virtualAppointments = {} } option(optionName, value) { return super.option(...arguments) } notifyObserver(subject, args) { const observer = this.option("observer"); if (observer) { observer.fire(subject, args) } } invoke(funcName) { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key] } const observer = this.option("observer"); if (observer) { return observer.fire.apply(observer, arguments) } } _dispose() { clearTimeout(this._appointmentClickTimeout); super._dispose() } _supportedKeys() { const parent = super._supportedKeys(); const currentAppointment = this._$currentAppointment; return (0, _extend.extend)(parent, { escape: function() { if (this.resizeOccur) { var _currentAppointment$d, _currentAppointment$d2, _currentAppointment$d3; this.moveAppointmentBack(); this.resizeOccur = false; null === (_currentAppointment$d = currentAppointment.dxResizable("instance")) || void 0 === _currentAppointment$d || _currentAppointment$d._detachEventHandlers(); null === (_currentAppointment$d2 = currentAppointment.dxResizable("instance")) || void 0 === _currentAppointment$d2 || _currentAppointment$d2._attachEventHandlers(); null === (_currentAppointment$d3 = currentAppointment.dxResizable("instance")) || void 0 === _currentAppointment$d3 || _currentAppointment$d3._toggleResizingClass(false) } }.bind(this), del: function(e) { if (this.option("allowDelete")) { e.preventDefault(); const data = this._getItemData(e.target); this.notifyObserver("onDeleteButtonPress", { data: data, target: e.target }) } }.bind(this), tab: function(e) { const appointments = this._getAccessAppointments(); const focusedAppointment = appointments.filter(".dx-state-focused"); let index = focusedAppointment.data(_m_constants.APPOINTMENT_SETTINGS_KEY).sortedIndex; const lastIndex = appointments.length - 1; if (index > 0 && e.shiftKey || index < lastIndex && !e.shiftKey) { e.preventDefault(); e.shiftKey ? index-- : index++; const $nextAppointment = this._getAppointmentByIndex(index); this._resetTabIndex($nextAppointment); _events_engine.default.trigger($nextAppointment, "focus") } } }) } _getAppointmentByIndex(sortedIndex) { const appointments = this._getAccessAppointments(); return appointments.filter(((_, $item) => (0, _element_data.data)($item, _m_constants.APPOINTMENT_SETTINGS_KEY).sortedIndex === sortedIndex)).eq(0) } _getAccessAppointments() { return this._itemElements().filter(":visible").not(".dx-state-disabled") } _resetTabIndex($appointment) { this._focusTarget().attr("tabIndex", -1); $appointment.attr("tabIndex", this.option("tabIndex")) } _moveFocus() {} _focusTarget() { return this._itemElements() } _renderFocusTarget() { const $appointment = this._getAppointmentByIndex(0); this._resetTabIndex($appointment) } _focusInHandler(e) { super._focusInHandler(e); this._$currentAppointment = (0, _renderer.default)(e.target); this.option("focusedElement", (0, _element.getPublicElement)((0, _renderer.default)(e.target))) } _focusOutHandler(e) { const $appointment = this._getAppointmentByIndex(0); this.option("focusedElement", (0, _element.getPublicElement)($appointment)); super._focusOutHandler(e) } _eventBindingTarget() { return this._itemContainer() } _getDefaultOptions() { return (0, _extend.extend)(super._getDefaultOptions(), { noDataText: null, activeStateEnabled: true, hoverStateEnabled: true, tabIndex: 0, fixedContainer: null, allDayContainer: null, allowDrag: true, allowResize: true, allowAllDayResize: true, onAppointmentDblClick: null, _collectorOffset: 0, groups: [], resources: [] }) } _optionChanged(args) { switch (args.name) { case "items": this._cleanFocusState(); this._clearDropDownItems(); this._clearDropDownItemsElements(); this._repaintAppointments(args.value); this._renderDropDownAppointments(); this._attachAppointmentsEvents(); break; case "fixedContainer": case "allDayContainer": case "onAppointmentDblClick": case "allowDelete": break; case "allowDrag": case "allowResize": case "allowAllDayResize": this._invalidate(); break; case "focusedElement": this._resetTabIndex((0, _renderer.default)(args.value)); super._optionChanged(args); break; case "focusStateEnabled": this._clearDropDownItemsElements(); this._renderDropDownAppointments(); super._optionChanged(args); break; default: super._optionChanged(args) } } _isAllDayAppointment(appointment) { return appointment.settings.length && appointment.settings[0].allDay || false } _isRepaintAppointment(appointment) { return !(0, _type.isDefined)(appointment.needRepaint) || true === appointment.needRepaint } _isRepaintAll(appointments) { if (this.isAgendaView) { return true } for (let i = 0; i < appointments.length; i++) { if (!this._isRepaintAppointment(appointments[i])) { return false } } return true } _applyFragment(fragment, allDay) { if (fragment.children().length > 0) { this._getAppointmentContainer(allDay).append(fragment) } } _onEachAppointment(appointment, index, container, isRepaintAll) { const repaintAppointment = () => { appointment.needRepaint = false; this._clearItem(appointment); this._renderItem(index, appointment, container) }; if (true === (null === appointment || void 0 === appointment ? void 0 : appointment.needRemove)) { this._clearItem(appointment) } else if (isRepaintAll || this._isRepaintAppointment(appointment)) { repaintAppointment() } } _repaintAppointments(appointments) { this._renderByFragments((($commonFragment, $allDayFragment) => { const isRepaintAll = this._isRepaintAll(appointments); if (isRepaintAll) { this._getAppointmentContainer(true).html(""); this._getAppointmentContainer(false).html("") }!appointments.length && this._cleanItemContainer(); appointments.forEach(((appointment, index) => { const container = this._isAllDayAppointment(appointment) ? $allDayFragment : $commonFragment; this._onEachAppointment(appointment, index, container, isRepaintAll) })) })) } _renderByFragments(renderFunction) { if (this.isVirtualScrolling) { const $commonFragment = (0, _renderer.default)(_dom_adapter.default.createDocumentFragment()); const $allDayFragment = (0, _renderer.default)(_dom_adapter.default.createDocumentFragment()); renderFunction($commonFragment, $allDayFragment); this._applyFragment($commonFragment, false); this._applyFragment($allDayFragment, true) } else { renderFunction(this._getAppointmentContainer(false), this._getAppointmentContainer(true)) } } _attachAppointmentsEvents() { this._attachClickEvent(); this._attachHoldEvent(); this._attachContextMenuEvent(); this._attachAppointmentDblClick(); this._renderFocusState(); this._attachFeedbackEvents(); this._attachHoverEvents() } _clearItem(item) { const $items = this._findItemElementByItem(item.itemData); if (!$items.length) { return }(0, _iterator.each)($items, ((_, $item) => { $item.detach(); $item.remove() })) } _clearDropDownItems() { this._virtualAppointments = {} } _clearDropDownItemsElements() { this.invoke("clearCompactAppointments") } _findItemElementByItem(item) { const result = []; const that = this; this.itemElements().each((function() { const $item = (0, _renderer.default)(this); if ($item.data(that._itemDataKey()) === item) { result.push($item) } })); return result } _itemClass() { return _m_classes.APPOINTMENT_ITEM_CLASS } _itemContainer() { const $container = super._itemContainer(); let $result = $container; const $allDayContainer = this.option("allDayContainer"); if ($allDayContainer) { $result = $container.add($allDayContainer) } return $result } _cleanItemContainer() { super._cleanItemContainer(); const $allDayContainer = this.option("allDayContainer"); if ($allDayContainer) { $allDayContainer.empty() } this._virtualAppointments = {} } _clean() { super._clean(); delete this._$currentAppointment; delete this._initialSize; delete this._initialCoordinates } _init() { super._init(); this.$element().addClass("dx-scheduler-scrollable-appointments"); this._preventSingleAppointmentClick = false } _renderAppointmentTemplate($container, appointment, model) { var _this$_currentAppoint; const config = { isAllDay: appointment.allDay, isRecurrence: appointment.recurrenceRule, html: (0, _type.isPlainObject)(appointment) && appointment.html ? appointment.html : void 0 }; const formatText = this.invoke("getTextAndFormatDate", model.appointmentData, (null === (_this$_currentAppoint = this._currentAppointmentSettings) || void 0 === _this$_currentAppoint ? void 0 : _this$_currentAppoint.agendaSettings) || model.targetedAppointmentData, "TIME"); $container.append(this.isAgendaView ? (0, _m_appointment_layout.createAgendaAppointmentLayout)(formatText, config) : (0, _m_appointment_layout.createAppointmentLayout)(formatText, config)); if (!this.isAgendaView) { $container.parent().prepend((0, _renderer.default)("
").addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.STRIP)) } } _executeItemRenderAction(index, itemData, itemElement) { const action = this._getItemRenderAction(); if (action) { action(this.invoke("mapAppointmentFields", { itemData: itemData, itemElement: itemElement })) } delete this._currentAppointmentSettings } _itemClickHandler(e) { super._itemClickHandler(e, {}, { afterExecute: function(e) { this._processItemClick(e.args[0].event) }.bind(this) }) } _processItemClick(e) { const $target = (0, _renderer.default)(e.currentTarget); const data = this._getItemData($target); if ("keydown" === e.type || (0, _index.isFakeClickEvent)(e)) { this.notifyObserver("showEditAppointmentPopup", { data: data, target: $target }); return } this._appointmentClickTimeout = setTimeout((() => { if (!this._preventSingleAppointmentClick && (0, _dom.isElementInDom)($target)) { this.notifyObserver("showAppointmentTooltip", { data: data, target: $target }) } this._preventSingleAppointmentClick = false }), 300) } _extendActionArgs($itemElement) { const args = super._extendActionArgs($itemElement); return this.invoke("mapAppointmentFields", args) } _render() { super._render(); this._attachAppointmentDblClick() } _attachAppointmentDblClick() { const that = this; const itemSelector = that._itemSelector(); const itemContainer = this._itemContainer(); _events_engine.default.off(itemContainer, DBLCLICK_EVENT_NAME, itemSelector); _events_engine.default.on(itemContainer, DBLCLICK_EVENT_NAME, itemSelector, (e => { that._itemDXEventHandler(e, "onAppointmentDblClick", {}, { afterExecute(e) { that._dblClickHandler(e.args[0].event) } }) })) } _dblClickHandler(e) { const $targetAppointment = (0, _renderer.default)(e.currentTarget); const appointmentData = this._getItemData($targetAppointment); clearTimeout(this._appointmentClickTimeout); this._preventSingleAppointmentClick = true; this.notifyObserver("showEditAppointmentPopup", { data: appointmentData, target: $targetAppointment }) } _renderItem(index, item, container) { const { itemData: itemData } = item; const $items = []; for (let i = 0; i < item.settings.length; i++) { const setting = item.settings[i]; this._currentAppointmentSettings = setting; const $item = super._renderItem(index, itemData, container); $item.data(_m_constants.APPOINTMENT_SETTINGS_KEY, setting); $items.push($item) } return $items } _getItemContent($itemFrame) { $itemFrame.data(_m_constants.APPOINTMENT_SETTINGS_KEY, this._currentAppointmentSettings); const $itemContent = super._getItemContent($itemFrame); return $itemContent } _createItemByTemplate(itemTemplate, renderArgs) { const { itemData: itemData, container: container, index: index } = renderArgs; return itemTemplate.render({ model: { appointmentData: itemData, targetedAppointmentData: this.invoke("getTargetedAppointmentData", itemData, (0, _renderer.default)(container).parent()) }, container: container, index: index }) } _getAppointmentContainer(allDay) { const $allDayContainer = this.option("allDayContainer"); let $container = this.itemsContainer().not($allDayContainer); if (allDay && $allDayContainer) { $container = $allDayContainer } return $container } _postprocessRenderItem(args) { this._renderAppointment(args.itemElement, this._currentAppointmentSettings) } _renderAppointment(element, settings) { element.data(_m_constants.APPOINTMENT_SETTINGS_KEY, settings); this._applyResourceDataAttr(element); const rawAppointment = this._getItemData(element); const geometry = this.invoke("getAppointmentGeometry", settings); const allowResize = this.option("allowResize") && (!(0, _type.isDefined)(settings.skipResizing) || (0, _type.isString)(settings.skipResizing)); const allowDrag = this.option("allowDrag"); const { allDay: allDay } = settings; this.invoke("setCellDataCacheAlias", this._currentAppointmentSettings, geometry); if (settings.virtual) { const appointmentConfig = { itemData: rawAppointment, groupIndex: settings.groupIndex, groups: this.option("groups") }; const deferredColor = this.option("getAppointmentColor")(appointmentConfig); this._processVirtualAppointment(settings, element, rawAppointment, deferredColor) } else { var _settings$info; const config = { data: rawAppointment, groupIndex: settings.groupIndex, observer: this.option("observer"), geometry: geometry, direction: settings.direction || "vertical", allowResize: allowResize, allowDrag: allowDrag, allDay: allDay, reduced: settings.appointmentReduced, isCompact: settings.isCompact, startDate: new Date(null === (_settings$info = settings.info) || void 0 === _settings$info ? void 0 : _settings$info.appointment.startDate), cellWidth: this.invoke("getCellWidth"), cellHeight: this.invoke("getCellHeight"), resizableConfig: this._resizableConfig(rawAppointment, settings), groups: this.option("groups"), getAppointmentColor: this.option("getAppointmentColor"), getResourceDataAccessors: this.option("getResourceDataAccessors") }; if (this.isAgendaView) { const agendaResourceProcessor = this.option("getAgendaResourceProcessor")(); config.createPlainResourceListAsync = rawAppointment => agendaResourceProcessor.createListAsync(rawAppointment) } this._createComponent(element, this.isAgendaView ? _m_appointment.AgendaAppointment : _m_appointment.Appointment, _extends({}, config, { dataAccessors: this.option("dataAccessors"), getResizableStep: this.option("getResizableStep") })) } } _applyResourceDataAttr($appointment) { const dataAccessors = this.option("getResourceDataAccessors")(); const rawAppointment = this._getItemData($appointment); (0, _iterator.each)(dataAccessors.getter, (key => { const value = dataAccessors.getter[key](rawAppointment); if ((0, _type.isDefined)(value)) { const prefix = `data-${(0,_common.normalizeKey)(key.toLowerCase())}-`; (0, _array.wrapToArray)(value).forEach((value => $appointment.attr(prefix + (0, _common.normalizeKey)(value), true))) } })) } _resizableConfig(appointmentData, itemSetting) { return { area: this._calculateResizableArea(itemSetting, appointmentData), onResizeStart: function(e) { this.resizeOccur = true; this._$currentAppointment = (0, _renderer.default)(e.element); if (this.invoke("needRecalculateResizableArea")) { const updatedArea = this._calculateResizableArea(this._$currentAppointment.data(_m_constants.APPOINTMENT_SETTINGS_KEY), this._$currentAppointment.data("dxItemData")); e.component.option("area", updatedArea); e.component._renderDragOffsets(e.event) } this._initialSize = { width: e.width, height: e.height }; this._initialCoordinates = (0, _translator.locate)(this._$currentAppointment) }.bind(this), onResizeEnd: function(e) { this.resizeOccur = false; this._resizeEndHandler(e) }.bind(this) } } _calculateResizableArea(itemSetting, appointmentData) { const area = this.$element().closest(".dx-scrollable-content"); return this.invoke("getResizableAppointmentArea", { coordinates: { left: itemSetting.left, top: 0, groupIndex: itemSetting.groupIndex }, allDay: itemSetting.allDay }) || area } _resizeEndHandler(e) { const $element = (0, _renderer.default)(e.element); const { allDay: allDay, info: info } = $element.data("dxAppointmentSettings"); const sourceAppointment = this._getItemData($element); const viewOffset = this.invoke("getViewOffsetMs"); let dateRange; if (allDay) { dateRange = this.resizeAllDay(e) } else { const startDate = this._getEndResizeAppointmentStartDate(e, sourceAppointment, info.appointment); const { endDate: endDate } = info.appointment; const shiftedStartDate = _date2.dateUtilsTs.addOffsets(startDate, [-viewOffset]); const shiftedEndDate = _date2.dateUtilsTs.addOffsets(endDate, [-viewOffset]); dateRange = this._getDateRange(e, shiftedStartDate, shiftedEndDate); dateRange.startDate = _date2.dateUtilsTs.addOffsets(dateRange.startDate, [viewOffset]); dateRange.endDate = _date2.dateUtilsTs.addOffsets(dateRange.endDate, [viewOffset]) } this.updateResizedAppointment($element, dateRange, this.option("dataAccessors"), this.option("timeZoneCalculator")) } resizeAllDay(e) { const $element = (0, _renderer.default)(e.element); const timeZoneCalculator = this.option("timeZoneCalculator"); const dataAccessors = this.option("dataAccessors"); return (0, _m_core.getAppointmentDateRange)({ handles: e.handles, appointmentSettings: $element.data("dxAppointmentSettings"), isVerticalViewDirection: this.option("isVerticalViewDirection")(), isVerticalGroupedWorkSpace: this.option("isVerticalGroupedWorkSpace")(), appointmentRect: (0, _position.getBoundingRect)($element[0]), parentAppointmentRect: (0, _position.getBoundingRect)($element.parent()[0]), viewDataProvider: this.option("getViewDataProvider")(), isDateAndTimeView: this.option("isDateAndTimeView")(), startDayHour: this.invoke("getStartDayHour"), endDayHour: this.invoke("getEndDayHour"), timeZoneCalculator: timeZoneCalculator, dataAccessors: dataAccessors, rtlEnabled: this.option("rtlEnabled"), DOMMetaData: this.option("getDOMElementsMetaData")(), viewOffset: this.invoke("getViewOffsetMs") }) } updateResizedAppointment($element, dateRange, dataAccessors, timeZoneCalculator) { const sourceAppointment = this._getItemData($element); const modifiedAppointmentAdapter = (0, _m_appointment_adapter.createAppointmentAdapter)(sourceAppointment, dataAccessors, timeZoneCalculator).clone(); modifiedAppointmentAdapter.startDate = new Date(dateRange.startDate); modifiedAppointmentAdapter.endDate = new Date(dateRange.endDate); this.notifyObserver("updateAppointmentAfterResize", { target: sourceAppointment, data: modifiedAppointmentAdapter.clone({ pathTimeZone: "fromGrid" }).source(), $appointment: $element }) } _getEndResizeAppointmentStartDate(e, rawAppointment, appointmentInfo) { const timeZoneCalculator = this.option("timeZoneCalculator"); const appointmentAdapter = (0, _m_appointment_adapter.createAppointmentAdapter)(rawAppointment, this.option("dataAccessors"), timeZoneCalculator); let { startDate: startDate } = appointmentInfo; const recurrenceProcessor = (0, _m_recurrence.getRecurrenceProcessor)(); const { recurrenceRule: recurrenceRule, startDateTimeZone: startDateTimeZone } = appointmentAdapter; const isAllDay = this.invoke("isAllDay", rawAppointment); const isRecurrent = recurrenceProcessor.isValidRecurrenceRule(recurrenceRule); if (!e.handles.top && !isRecurrent && !isAllDay) { startDate = timeZoneCalculator.createDate(appointmentAdapter.startDate, { appointmentTimeZone: startDateTimeZone, path: "toGrid" }) } return startDate } _getDateRange(e, startDate, endDate) { const itemData = this._getItemData(e.element); const deltaTime = this.invoke("getDeltaTime", e, this._initialSize, itemData); const renderingStrategyDirection = this.invoke("getRenderingStrategyDirection"); let isStartDateChanged = false; const isAllDay = this.invoke("isAllDay", itemData); const needCorrectDates = this.invoke("needCorrectAppointmentDates") && !isAllDay; let startTime; let endTime; if ("vertical" !== renderingStrategyDirection || isAllDay) { isStartDateChanged = this.option("rtlEnabled") ? e.handles.right : e.handles.left } else { isStartDateChanged = e.handles.top } if (isStartDateChanged) { startTime = needCorrectDates ? this._correctStartDateByDelta(startDate, deltaTime) : startDate.getTime() - deltaTime; startTime += _m_utils_time_zone.default.getTimezoneOffsetChangeInMs(startDate, endDate, startTime, endDate); endTime = endDate.getTime() } else { startTime = startDate.getTime(); endTime = needCorrectDates ? this._correctEndDateByDelta(endDate, deltaTime) : endDate.getTime() + deltaTime; endTime -= _m_utils_time_zone.default.getTimezoneOffsetChangeInMs(startDate, endDate, startDate, endTime) } return { startDate: new Date(startTime), endDate: new Date(endTime) } } _correctEndDateByDelta(endDate, deltaTime) { const endDayHour = this.invoke("getEndDayHour"); const startDayHour = this.invoke("getStartDayHour"); const maxDate = new Date(endDate); const minDate = new Date(endDate); const correctEndDate = new Date(endDate); minDate.setHours(startDayHour, 0, 0, 0); maxDate.setHours(endDayHour, 0, 0, 0); if (correctEndDate > maxDate) { correctEndDate.setHours(endDayHour, 0, 0, 0) } let result = correctEndDate.getTime() + deltaTime; const visibleDayDuration = (endDayHour - startDayHour) * toMs("hour"); const daysCount = deltaTime > 0 ? Math.ceil(deltaTime / visibleDayDuration) : Math.floor(deltaTime / visibleDayDuration); if (result > maxDate.getTime() || result <= minDate.getTime()) { const tailOfCurrentDay = maxDate.getTime() - correctEndDate.getTime(); const tailOfPrevDays = deltaTime - tailOfCurrentDay; const correctedEndDate = new Date(correctEndDate).setDate(correctEndDate.getDate() + daysCount); const lastDay = new Date(correctedEndDate); lastDay.setHours(startDayHour, 0, 0, 0); result = lastDay.getTime() + tailOfPrevDays - visibleDayDuration * (daysCount - 1) } return result } _correctStartDateByDelta(startDate, deltaTime) { const endDayHour = this.invoke("getEndDayHour"); const startDayHour = this.invoke("getStartDayHour"); const maxDate = new Date(startDate); const minDate = new Date(startDate); const correctStartDate = new Date(startDate); minDate.setHours(startDayHour, 0, 0, 0); maxDate.setHours(endDayHour, 0, 0, 0); if (correctStartDate < minDate) { correctStartDate.setHours(startDayHour, 0, 0, 0) } let result = correctStartDate.getTime() - deltaTime; const visibleDayDuration = (endDayHour - startDayHour) * toMs("hour"); const daysCount = deltaTime > 0 ? Math.ceil(deltaTime / visibleDayDuration) : Math.floor(deltaTime / visibleDayDuration); if (result < minDate.getTime() || result >= maxDate.getTime()) { const tailOfCurrentDay = correctStartDate.getTime() - minDate.getTime(); const tailOfPrevDays = deltaTime - tailOfCurrentDay; const firstDay = new Date(correctStartDate.setDate(correctStartDate.getDate() - daysCount)); firstDay.setHours(endDayHour, 0, 0, 0); result = firstDay.getTime() - tailOfPrevDays + visibleDayDuration * (daysCount - 1) } return result } _processVirtualAppointment(appointmentSetting, $appointment, appointmentData, color) { const virtualAppointment = appointmentSetting.virtual; const virtualGroupIndex = virtualAppointment.index; if (!(0, _type.isDefined)(this._virtualAppointments[virtualGroupIndex])) { this._virtualAppointments[virtualGroupIndex] = { coordinates: { top: virtualAppointment.top, left: virtualAppointment.left }, items: { data: [], colors: [], settings: [] }, isAllDay: !!virtualAppointment.isAllDay, buttonColor: color } } appointmentSetting.targetedAppointmentData = this.invoke("getTargetedAppointmentData", appointmentData, $appointment); this._virtualAppointments[virtualGroupIndex].items.settings.push(appointmentSetting); this._virtualAppointments[virtualGroupIndex].items.data.push(appointmentData); this._virtualAppointments[virtualGroupIndex].items.colors.push(color); $appointment.remove() } _renderContentImpl() { super._renderContentImpl(); this._renderDropDownAppointments() } _renderDropDownAppointments() { this._renderByFragments((($commonFragment, $allDayFragment) => { (0, _iterator.each)(this._virtualAppointments, (groupIndex => { const virtualGroup = this._virtualAppointments[groupIndex]; const virtualItems = virtualGroup.items; const virtualCoordinates = virtualGroup.coordinates; const $fragment = virtualGroup.isAllDay ? $allDayFragment : $commonFragment; const { left: left } = virtualCoordinates; const buttonWidth = this.invoke("getDropDownAppointmentWidth", virtualGroup.isAllDay); const buttonHeight = this.invoke("getDropDownAppointmentHeight"); const rtlOffset = this.option("rtlEnabled") ? buttonWidth : 0; this.notifyObserver("renderCompactAppointments", { $container: $fragment, coordinates: { top: virtualCoordinates.top, left: left + rtlOffset }, items: virtualItems, buttonColor: virtualGroup.buttonColor, width: buttonWidth - this.option("_collectorOffset"), height: buttonHeight, onAppointmentClick: this.option("onItemClick"), allowDrag: this.option("allowDrag"), cellWidth: this.invoke("getCellWidth"), isCompact: this.invoke("isAdaptive") || this._isGroupCompact(virtualGroup) }) })) })) } _isGroupCompact(virtualGroup) { return !virtualGroup.isAllDay && this.invoke("supportCompactDropDownAppointments") } _sortAppointmentsByStartDate(appointments) { return (0, _m_utils.sortAppointmentsByStartDate)(appointments, this.option("dataAccessors")) } _processRecurrenceAppointment(appointment, index, skipLongAppointments) { const recurrenceRule = _m_expression_utils.ExpressionUtils.getField(this.option("dataAccessors"), "recurrenceRule", appointment); const result = { parts: [], indexes: [] }; if (recurrenceRule) { const dates = appointment.settings || appointment; const startDate = new Date(_m_expression_utils.ExpressionUtils.getField(this.option("dataAccessors"), "startDate", dates)); const startDateTimeZone = _m_expression_utils.ExpressionUtils.getField(this.option("dataAccessors"), "startDateTimeZone", appointment); const endDate = new Date(_m_expression_utils.ExpressionUtils.getField(this.option("dataAccessors"), "endDate", dates)); const appointmentDuration = endDate.getTime() - startDate.getTime(); const recurrenceException = _m_expression_utils.ExpressionUtils.getField(this.option("dataAccessors"), "recurrenceException", appointment); const startViewDate = this.invoke("getStartViewDate"); const endViewDate = this.invoke("getEndViewDate"); const timezoneCalculator = this.option("timeZoneCalculator"); const recurrentDates = (0, _m_recurrence.getRecurrenceProcessor)().generateDates({ rule: recurrenceRule, exception: recurrenceException, start: startDate, end: endDate, min: startViewDate, max: endViewDate, appointmentTimezoneOffset: timezoneCalculator.getOriginStartDateOffsetInMs(startDate, startDateTimeZone, false) }); const recurrentDateCount = appointment.settings ? 1 : recurrentDates.length; for (let i = 0; i < recurrentDateCount; i++) { const appointmentPart = (0, _extend.extend)({}, appointment, true); if (recurrentDates[i]) { const appointmentSettings = this._applyStartDateToObj(recurrentDates[i], {}); this._applyEndDateToObj(new Date(recurrentDates[i].getTime() + appointmentDuration), appointmentSettings); appointmentPart.settings = appointmentSettings } else { appointmentPart.settings = dates } result.parts.push(appointmentPart); if (!skipLongAppointments) { this._processLongAppointment(appointmentPart, result) } } result.indexes.push(index) } return result } _processLongAppointment(appointment, result) { const parts = this.splitAppointmentByDay(appointment); const partCount = parts.length; const endViewDate = this.invoke("getEndViewDate").getTime(); const startViewDate = this.invoke("getStartViewDate").getTime(); const timeZoneCalculator = this.option("timeZoneCalculator"); result = result || { parts: [] }; if (partCount > 1) { (0, _extend.extend)(appointment, parts[0]); for (let i = 1; i < partCount; i++) { let startDate = _m_expression_utils.ExpressionUtils.getField(this.option("dataAccessors"), "startDate", parts[i].settings).getTime(); startDate = timeZoneCalculator.createDate(startDate, { path: "toGrid" }); if (startDate < endViewDate && startDate > startViewDate) { result.parts.push(parts[i]) } } } return result } _reduceRecurrenceAppointments(recurrenceIndexes, appointments) { (0, _iterator.each)(recurrenceIndexes, ((i, index) => { appointments.splice(index - i, 1) })) } _combineAppointments(appointments, additionalAppointments) { if (additionalAppointments.length) { appointments.push(...additionalAppointments) } this._sortAppointmentsByStartDate(appointments) } _applyStartDateToObj(startDate, obj) { _m_expression_utils.ExpressionUtils.setField(this.option("dataAccessors"), "startDate", obj, startDate); return obj } _applyEndDateToObj(endDate, obj) { _m_expression_utils.ExpressionUtils.setField(this.option("dataAccessors"), "endDate", obj, endDate); return obj } moveAppointmentBack(dragEvent) { const $appointment = this._$currentAppointment; const size = this._initialSize; const coords = this._initialCoordinates; if (dragEvent) { this._removeDragSourceClassFromDraggedAppointment(); if ((0, _type.isDeferred)(dragEvent.cancel)) { dragEvent.cancel.resolve(true) } else { dragEvent.cancel = true } } if ($appointment && !dragEvent) { if (coords) { (0, _translator.move)($appointment, coords); delete this._initialSize } if (size) { (0, _size.setOuterWidth)($appointment, size.width); (0, _size.setOuterHeight)($appointment, size.height); delete this._initialCoordinates } } } focus() { if (this._$currentAppointment) { const focusedElement = (0, _element.getPublicElement)(this._$currentAppointment); this.option("focusedElement", focusedElement); _events_engine.default.trigger(focusedElement, "focus") } } splitAppointmentByDay(appointment) { const dates = appointment.settings || appointment; const dataAccessors = this.option("dataAccessors"); const originalStartDate = new Date(_m_expression_utils.ExpressionUtils.getField(dataAccessors, "startDate", dates)); let startDate = _date.default.makeDate(originalStartDate); let endDate = _date.default.makeDate(_m_expression_utils.ExpressionUtils.getField(dataAccessors, "endDate", dates)); const maxAllowedDate = this.invoke("getEndViewDate"); const startDayHour = this.invoke("getStartDayHour"); const endDayHour = this.invoke("getEndDayHour"); const timeZoneCalculator = this.option("timeZoneCalculator"); const adapter = (0, _m_appointment_adapter.createAppointmentAdapter)(appointment, dataAccessors, timeZoneCalculator); const appointmentIsLong = (0, _m_utils.getAppointmentTakesSeveralDays)(adapter); const result = []; startDate = timeZoneCalculator.createDate(startDate, { path: "toGrid" }); endDate = timeZoneCalculator.createDate(endDate, { path: "toGrid" }); if (startDate.getHours() <= endDayHour && startDate.getHours() >= startDayHour && !appointmentIsLong) { result.push(this._applyStartDateToObj(new Date(startDate), { appointmentData: appointment })); startDate.setDate(startDate.getDate() + 1) } while (appointmentIsLong && startDate.getTime() < endDate.getTime() && startDate < maxAllowedDate) { const currentStartDate = new Date(startDate); const currentEndDate = new Date(startDate); this._checkStartDate(currentStartDate, originalStartDate, startDayHour); this._checkEndDate(currentEndDate, endDate, endDayHour); const appointmentData = (0, _object.deepExtendArraySafe)({}, appointment, true); const appointmentSettings = {}; this._applyStartDateToObj(currentStartDate, appointmentSettings); this._applyEndDateToObj(currentEndDate, appointmentSettings); appointmentData.settings = appointmentSettings; result.push(appointmentData); startDate = _date.default.trimTime(startDate); startDate.setDate(startDate.getDate() + 1); startDate.setHours(startDayHour) } return result } _checkStartDate(currentDate, originalDate, startDayHour) { if (!_date.default.sameDate(currentDate, originalDate) || currentDate.getHours() <= startDayHour) { currentDate.setHours(startDayHour, 0, 0, 0) } else { currentDate.setHours(originalDate.getHours(), originalDate.getMinutes(), originalDate.getSeconds(), originalDate.getMilliseconds()) } } _checkEndDate(currentDate, originalDate, endDayHour) { if (!_date.default.sameDate(currentDate, originalDate) || currentDate.getHours() > endDayHour) { currentDate.setHours(endDayHour, 0, 0, 0) } else { currentDate.setHours(originalDate.getHours(), originalDate.getMinutes(), originalDate.getSeconds(), originalDate.getMilliseconds()) } } _removeDragSourceClassFromDraggedAppointment() { const $appointments = this._itemElements().filter(`.${_m_classes.APPOINTMENT_DRAG_SOURCE_CLASS}`); $appointments.each(((_, element) => { const appointmentInstance = (0, _renderer.default)(element).dxSchedulerAppointment("instance"); appointmentInstance.option("isDragSource", false) })) } _setDragSourceAppointment(appointment, settings) { const $appointments = this._findItemElementByItem(appointment); const { startDate: startDate, endDate: endDate } = settings.info.sourceAppointment; const { groupIndex: groupIndex } = settings; $appointments.forEach(($item => { const { info: itemInfo, groupIndex: itemGroupIndex } = $item.data(_m_constants.APPOINTMENT_SETTINGS_KEY); const { startDate: itemStartDate, endDate: itemEndDate } = itemInfo.sourceAppointment; const appointmentInstance = $item.dxSchedulerAppointment("instance"); const isDragSource = startDate.getTime() === itemStartDate.getTime() && endDate.getTime() === itemEndDate.getTime() && groupIndex === itemGroupIndex; appointmentInstance.option("isDragSource", isDragSource) })) } updateResizableArea() { const $allResizableElements = this.$element().find(".dx-scheduler-appointment.dx-resizable"); const horizontalResizables = (0, _common.grep)($allResizableElements, (el => { const $el = (0, _renderer.default)(el); const resizableInst = $el.dxResizable("instance"); const { area: area, handles: handles } = resizableInst.option(); return ("right left" === handles || "left right" === handles) && (0, _type.isPlainObject)(area) })); (0, _iterator.each)(horizontalResizables, ((_, el) => { const $el = (0, _renderer.default)(el); const position = (0, _translator.locate)($el); const appointmentData = this._getItemData($el); const area = this._calculateResizableArea({ left: position.left }, appointmentData); $el.dxResizable("instance").option("area", area) })) } }(0, _component_registrator.default)("dxSchedulerAppointments", SchedulerAppointments); exports.default = SchedulerAppointments }, 72417: /*!*******************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/m_appointment_layout.js ***! \*******************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.createAppointmentLayout = exports.createAgendaAppointmentLayout = void 0; var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../core/dom_adapter */ 73349)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374)); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../localization/message */ 28109)); var _m_classes = __webpack_require__( /*! ../m_classes */ 43600); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const allDayText = ` ${_message.default.format("dxScheduler-allDay")}: `; exports.createAppointmentLayout = (formatText, config) => { const result = (0, _renderer.default)(_dom_adapter.default.createDocumentFragment()); (0, _renderer.default)("
").text(formatText.text).addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.APPOINTMENT_TITLE).appendTo(result); if (config.html) { result.html(config.html) } const $contentDetails = (0, _renderer.default)("
").addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.APPOINTMENT_CONTENT_DETAILS).appendTo(result); (0, _renderer.default)("
").addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.APPOINTMENT_DATE).text(formatText.formatDate).appendTo($contentDetails); config.isRecurrence && (0, _renderer.default)("").addClass(`${_m_classes.APPOINTMENT_CONTENT_CLASSES.RECURRING_ICON} dx-icon-repeat`).appendTo(result); config.isAllDay && (0, _renderer.default)("
").text(allDayText).addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.ALL_DAY_CONTENT).prependTo($contentDetails); return result }; exports.createAgendaAppointmentLayout = (formatText, config) => { const result = (0, _renderer.default)(_dom_adapter.default.createDocumentFragment()); const leftLayoutContainer = (0, _renderer.default)("
").addClass("dx-scheduler-agenda-appointment-left-layout").appendTo(result); const rightLayoutContainer = (0, _renderer.default)("
").addClass("dx-scheduler-agenda-appointment-right-layout").appendTo(result); const marker = (0, _renderer.default)("
").addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.AGENDA_MARKER).appendTo(leftLayoutContainer); config.isRecurrence && (0, _renderer.default)("").addClass(`${_m_classes.APPOINTMENT_CONTENT_CLASSES.RECURRING_ICON} dx-icon-repeat`).appendTo(marker); (0, _renderer.default)("
").addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.APPOINTMENT_TITLE).text(formatText.text).appendTo(rightLayoutContainer); const additionalContainer = (0, _renderer.default)("
").addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.APPOINTMENT_CONTENT_DETAILS).appendTo(rightLayoutContainer); (0, _renderer.default)("
").addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.APPOINTMENT_DATE).text(formatText.formatDate).appendTo(additionalContainer); if (config.isAllDay) { (0, _renderer.default)("
").text(allDayText).addClass(_m_classes.APPOINTMENT_CONTENT_CLASSES.ALL_DAY_CONTENT).prependTo(additionalContainer) } return result } }, 70325: /*!*************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/m_cell_position_calculator.js ***! \*************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.CellPositionCalculator = void 0; var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922); var _date = __webpack_require__( /*! ../../core/utils/date */ 24321); function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } class BaseStrategy { constructor(options) { this.isVirtualScrolling = false; this.options = options } get DOMMetaData() { return this.options.DOMMetaData } get appointments() { return this.options.dateSettings } get viewDataProvider() { return this.options.viewDataProvider } get positionHelper() { return this.options.positionHelper } get startViewDate() { return this.options.startViewDate } get viewStartDayHour() { return this.options.viewStartDayHour } get viewEndDayHour() { return this.options.viewEndDayHour } get cellDuration() { return this.options.cellDuration } get getPositionShift() { return this.options.getPositionShiftCallback } get groupCount() { return this.options.groupCount } get rtlEnabled() { return this.options.rtlEnabled } get isVerticalGrouping() { return this.options.isVerticalGroupOrientation } get showAllDayPanel() { return this.options.showAllDayPanel } get supportAllDayRow() { return this.options.supportAllDayRow } get isGroupedAllDayPanel() { return this.options.isGroupedAllDayPanel } calculateCellPositions(groupIndices, isAllDayRowAppointment, isRecurrentAppointment) { const result = []; this.appointments.forEach(((dateSetting, index) => { const coordinates = this.getCoordinateInfos({ appointment: dateSetting, groupIndices: groupIndices, isAllDayRowAppointment: isAllDayRowAppointment, isRecurrentAppointment: isRecurrentAppointment }); coordinates.forEach((item => { !!item && result.push(this._prepareObject(item, index)) })) })); return result } getCoordinateInfos(options) { const { appointment: appointment, isAllDayRowAppointment: isAllDayRowAppointment, groupIndices: groupIndices, recurrent: recurrent } = options; const { startDate: startDate } = appointment; const groupIndex = !recurrent ? appointment.source.groupIndex : void 0; return this.getCoordinatesByDateInGroup(startDate, groupIndices, isAllDayRowAppointment, groupIndex) } _prepareObject(position, dateSettingIndex) { position.dateSettingIndex = dateSettingIndex; return { coordinates: position, dateSettingIndex: dateSettingIndex } } getCoordinatesByDate(date, groupIndex, inAllDayRow) { const validGroupIndex = groupIndex || 0; const cellInfo = { groupIndex: validGroupIndex, startDate: date, isAllDay: inAllDayRow }; const positionByMap = this.viewDataProvider.findCellPositionInMap(cellInfo, true); if (!positionByMap) { return } const position = this.getCellPosition(positionByMap, inAllDayRow && !this.isVerticalGrouping); const groupEdgeIndices = this.viewDataProvider.getGroupEdgeIndices(validGroupIndex); const { top: vMin } = this.getCellPosition({ columnIndex: positionByMap.columnIndex, rowIndex: groupEdgeIndices.firstRowIndex }, inAllDayRow && !this.isVerticalGrouping); const timeShift = inAllDayRow ? 0 : this.getTimeShiftRatio(positionByMap, date); const shift = this.getPositionShift(timeShift, inAllDayRow); const horizontalHMax = this.positionHelper.getHorizontalMax(validGroupIndex, date); const verticalMax = this.positionHelper.getVerticalMax({ groupIndex: validGroupIndex, isVirtualScrolling: this.isVirtualScrolling, showAllDayPanel: this.showAllDayPanel, supportAllDayRow: this.supportAllDayRow, isGroupedAllDayPanel: this.isGroupedAllDayPanel, isVerticalGrouping: this.isVerticalGrouping }); return { positionByMap: positionByMap, cellPosition: position.left + shift.cellPosition, top: position.top + shift.top, left: position.left + shift.left, rowIndex: position.rowIndex, columnIndex: position.columnIndex, hMax: horizontalHMax, vMax: verticalMax, vMin: vMin, groupIndex: validGroupIndex } } getCoordinatesByDateInGroup(startDate, groupIndices, inAllDayRow, groupIndex) { const result = []; if (this.viewDataProvider.isSkippedDate(startDate)) { return result } let validGroupIndices = [groupIndex]; if (!(0, _type.isDefined)(groupIndex)) { validGroupIndices = this.groupCount ? groupIndices : [0] } validGroupIndices.forEach((groupIndex => { const coordinates = this.getCoordinatesByDate(startDate, groupIndex, inAllDayRow); if (coordinates) { result.push(coordinates) } })); return result } getCellPosition(cellCoordinates, isAllDayPanel) { const { dateTableCellsMeta: dateTableCellsMeta, allDayPanelCellsMeta: allDayPanelCellsMeta } = this.DOMMetaData; const { columnIndex: columnIndex, rowIndex: rowIndex } = cellCoordinates; const position = isAllDayPanel ? allDayPanelCellsMeta[columnIndex] : dateTableCellsMeta[rowIndex][columnIndex]; const validPosition = _extends({}, position); if (this.rtlEnabled) { validPosition.left += position.width } if (validPosition) { validPosition.rowIndex = cellCoordinates.rowIndex; validPosition.columnIndex = cellCoordinates.columnIndex } return validPosition } getTimeShiftRatio(positionByMap, appointmentDate) { const { cellDuration: cellDuration, viewOffset: viewOffset } = this.options; const { rowIndex: rowIndex, columnIndex: columnIndex } = positionByMap; const matchedCell = this.viewDataProvider.viewDataMap.dateTableMap[rowIndex][columnIndex]; const matchedCellStartDate = _date.dateUtilsTs.addOffsets(matchedCell.cellData.startDate, [-viewOffset]); const result = (appointmentDate.getTime() - matchedCellStartDate.getTime()) / cellDuration; return result % 1 } } class VirtualStrategy extends BaseStrategy { constructor() { super(...arguments); this.isVirtualScrolling = true } calculateCellPositions(groupIndices, isAllDayRowAppointment, isRecurrentAppointment) { const appointments = isAllDayRowAppointment ? this.appointments : this.appointments.filter((_ref => { let { source: source, startDate: startDate, endDate: endDate } = _ref; return this.viewDataProvider.isGroupIntersectDateInterval(source.groupIndex, startDate, endDate) })); if (isRecurrentAppointment) { return this.createRecurrentAppointmentInfos(appointments, isAllDayRowAppointment) } return super.calculateCellPositions(groupIndices, isAllDayRowAppointment, isRecurrentAppointment) } createRecurrentAppointmentInfos(dateSettings, isAllDayRowAppointment) { const result = []; dateSettings.forEach(((_ref2, index) => { let { source: source, startDate: startDate } = _ref2; const coordinate = this.getCoordinatesByDate(startDate, source.groupIndex, isAllDayRowAppointment); if (coordinate) { result.push(this._prepareObject(coordinate, index)) } })); return result } } exports.CellPositionCalculator = class { constructor(options) { this.options = options } calculateCellPositions(groupIndices, isAllDayRowAppointment, isRecurrentAppointment) { const strategy = this.options.isVirtualScrolling ? new VirtualStrategy(this.options) : new BaseStrategy(this.options); return strategy.calculateCellPositions(groupIndices, isAllDayRowAppointment, isRecurrentAppointment) } } }, 24099: /*!*******************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/m_settings_generator.js ***! \*******************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.DateGeneratorVirtualStrategy = exports.DateGeneratorBaseStrategy = exports.AppointmentSettingsGenerator = void 0; var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198)); var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306); var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922); var _date2 = __webpack_require__( /*! ../../core/utils/date */ 24321); var _index = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084); var _m_appointment_adapter = __webpack_require__( /*! ../m_appointment_adapter */ 72734); var _m_expression_utils = __webpack_require__( /*! ../m_expression_utils */ 30906); var _m_recurrence = __webpack_require__( /*! ../m_recurrence */ 38227); var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../m_utils_time_zone */ 57880)); var _m_utils = __webpack_require__( /*! ../resources/m_utils */ 31359); var _m_cell_position_calculator = __webpack_require__( /*! ./m_cell_position_calculator */ 70325); var _m_text_utils = __webpack_require__( /*! ./m_text_utils */ 18775); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const toMs = _date.default.dateToMilliseconds; class DateGeneratorBaseStrategy { constructor(options) { this.options = options } get rawAppointment() { return this.options.rawAppointment } get timeZoneCalculator() { return this.options.timeZoneCalculator } get viewDataProvider() { return this.options.viewDataProvider } get appointmentTakesAllDay() { return this.options.appointmentTakesAllDay } get supportAllDayRow() { return this.options.supportAllDayRow } get isAllDayRowAppointment() { return this.options.isAllDayRowAppointment } get timeZone() { return this.options.timeZone } get dateRange() { return this.options.dateRange } get firstDayOfWeek() { return this.options.firstDayOfWeek } get viewStartDayHour() { return this.options.viewStartDayHour } get viewEndDayHour() { return this.options.viewEndDayHour } get endViewDate() { return this.options.endViewDate } get viewType() { return this.options.viewType } get isGroupedByDate() { return this.options.isGroupedByDate } get isVerticalOrientation() { return this.options.isVerticalGroupOrientation } get dataAccessors() { return this.options.dataAccessors } get loadedResources() { return this.options.loadedResources } get isDateAppointment() { return !(0, _index.isDateAndTimeView)(this.viewType) && this.appointmentTakesAllDay } getIntervalDuration() { return this.appointmentTakesAllDay ? this.options.allDayIntervalDuration : this.options.intervalDuration } generate(appointmentAdapter) { const { isRecurrent: isRecurrent } = appointmentAdapter; const itemGroupIndices = this._getGroupIndices(this.rawAppointment); let appointmentList = this._createAppointments(appointmentAdapter, itemGroupIndices); appointmentList = this._getProcessedByAppointmentTimeZone(appointmentList, appointmentAdapter); if (this._canProcessNotNativeTimezoneDates(appointmentAdapter)) { appointmentList = this._getProcessedNotNativeTimezoneDates(appointmentList, appointmentAdapter) } let dateSettings = this._createGridAppointmentList(appointmentList, appointmentAdapter); const firstViewDates = this._getAppointmentsFirstViewDate(dateSettings); dateSettings = this._fillNormalizedStartDate(dateSettings, firstViewDates); dateSettings = this._cropAppointmentsByStartDayHour(dateSettings, firstViewDates); dateSettings = this._fillNormalizedEndDate(dateSettings, this.rawAppointment); if (this._needSeparateLongParts()) { dateSettings = this._separateLongParts(dateSettings, appointmentAdapter) } dateSettings = this.shiftSourceAppointmentDates(dateSettings); return { dateSettings: dateSettings, itemGroupIndices: itemGroupIndices, isRecurrent: isRecurrent } } shiftSourceAppointmentDates(dateSettings) { const { viewOffset: viewOffset } = this.options; return dateSettings.map((item => _extends({}, item, { source: _extends({}, item.source, { startDate: _date2.dateUtilsTs.addOffsets(item.source.startDate, [viewOffset]), endDate: _date2.dateUtilsTs.addOffsets(item.source.endDate, [viewOffset]) }) }))) } _getProcessedByAppointmentTimeZone(appointmentList, appointment) { const hasAppointmentTimeZone = !(0, _type.isEmptyObject)(appointment.startDateTimeZone) || !(0, _type.isEmptyObject)(appointment.endDateTimeZone); if (hasAppointmentTimeZone) { const appointmentOffsets = { startDate: this.timeZoneCalculator.getOffsets(appointment.startDate, appointment.startDateTimeZone), endDate: this.timeZoneCalculator.getOffsets(appointment.endDate, appointment.endDateTimeZone) }; appointmentList.forEach((a => { const sourceOffsets_startDate = this.timeZoneCalculator.getOffsets(a.startDate, appointment.startDateTimeZone), sourceOffsets_endDate = this.timeZoneCalculator.getOffsets(a.endDate, appointment.endDateTimeZone); const startDateOffsetDiff = appointmentOffsets.startDate.appointment - sourceOffsets_startDate.appointment; const endDateOffsetDiff = appointmentOffsets.endDate.appointment - sourceOffsets_endDate.appointment; if (sourceOffsets_startDate.appointment !== sourceOffsets_startDate.common) { a.startDate = new Date(a.startDate.getTime() + startDateOffsetDiff * toMs("hour")) } if (sourceOffsets_endDate.appointment !== sourceOffsets_endDate.common) { a.endDate = new Date(a.endDate.getTime() + endDateOffsetDiff * toMs("hour")) } })) } return appointmentList } _createAppointments(appointment, groupIndices) { let appointments = this._createRecurrenceAppointments(appointment, groupIndices); if (!appointment.isRecurrent && 0 === appointments.length) { appointments.push({ startDate: appointment.startDate, endDate: appointment.endDate }) } appointments = appointments.map((item => { var _item$endDate; const resultEndTime = null === (_item$endDate = item.endDate) || void 0 === _item$endDate ? void 0 : _item$endDate.getTime(); if (item.startDate.getTime() === resultEndTime) { item.endDate.setTime(resultEndTime + toMs("minute")) } return _extends({}, item, { exceptionDate: new Date(item.startDate) }) })); return appointments } _canProcessNotNativeTimezoneDates(appointment) { const isTimeZoneSet = !(0, _type.isEmptyObject)(this.timeZone); if (!isTimeZoneSet) { return false } if (!appointment.isRecurrent) { return false } return !_m_utils_time_zone.default.isEqualLocalTimeZone(this.timeZone, appointment.startDate) } _getProcessedNotNativeDateIfCrossDST(date, offset) { if (offset < 0) { const newDate = new Date(date); const newDateMinusOneHour = new Date(newDate); newDateMinusOneHour.setHours(newDateMinusOneHour.getHours() - 1); const newDateOffset = this.timeZoneCalculator.getOffsets(newDate).common; const newDateMinusOneHourOffset = this.timeZoneCalculator.getOffsets(newDateMinusOneHour).common; if (newDateOffset !== newDateMinusOneHourOffset) { return 0 } } return offset } _getCommonOffset(date) { return this.timeZoneCalculator.getOffsets(date).common } _getProcessedNotNativeTimezoneDates(appointmentList, appointment) { return appointmentList.map((item => { let diffStartDateOffset = this._getCommonOffset(appointment.startDate) - this._getCommonOffset(item.startDate); let diffEndDateOffset = this._getCommonOffset(appointment.endDate) - this._getCommonOffset(item.endDate); if (0 === diffStartDateOffset && 0 === diffEndDateOffset) { return item } diffStartDateOffset = this._getProcessedNotNativeDateIfCrossDST(item.startDate, diffStartDateOffset); diffEndDateOffset = this._getProcessedNotNativeDateIfCrossDST(item.endDate, diffEndDateOffset); const newStartDate = new Date(item.startDate.getTime() + diffStartDateOffset * toMs("hour")); let newEndDate = new Date(item.endDate.getTime() + diffEndDateOffset * toMs("hour")); const testNewStartDate = this.timeZoneCalculator.createDate(newStartDate, { path: "toGrid" }); const testNewEndDate = this.timeZoneCalculator.createDate(newEndDate, { path: "toGrid" }); if (appointment.duration > testNewEndDate.getTime() - testNewStartDate.getTime()) { newEndDate = new Date(newStartDate.getTime() + appointment.duration) } return _extends({}, item, { startDate: newStartDate, endDate: newEndDate, exceptionDate: new Date(newStartDate) }) })) } _needSeparateLongParts() { return this.isVerticalOrientation ? this.isGroupedByDate : this.isGroupedByDate && this.appointmentTakesAllDay } normalizeEndDateByViewEnd(rawAppointment, endDate) { let result = new Date(endDate.getTime()); const isAllDay = (0, _index.isDateAndTimeView)(this.viewType) && this.appointmentTakesAllDay; if (!isAllDay) { const roundedEndViewDate = _date.default.roundToHour(this.endViewDate); if (result > roundedEndViewDate) { result = roundedEndViewDate } } const endDayHour = this.viewEndDayHour; const allDay = _m_expression_utils.ExpressionUtils.getField(this.dataAccessors, "allDay", rawAppointment); const currentViewEndTime = new Date(new Date(endDate.getTime()).setHours(endDayHour, 0, 0, 0)); if (result.getTime() > currentViewEndTime.getTime() || allDay && result.getHours() < endDayHour) { result = currentViewEndTime } return result } _fillNormalizedEndDate(dateSettings, rawAppointment) { return dateSettings.map((item => _extends({}, item, { normalizedEndDate: this.normalizeEndDateByViewEnd(rawAppointment, item.endDate) }))) } _separateLongParts(gridAppointmentList, appointmentAdapter) { let result = []; gridAppointmentList.forEach((gridAppointment => { const maxDate = new Date(this.dateRange[1]); const { startDate: startDate, normalizedEndDate: endDateOfPart } = gridAppointment; const longStartDateParts = _date.default.getDatesOfInterval(startDate, endDateOfPart, { milliseconds: this.getIntervalDuration() }); const list = longStartDateParts.filter((startDatePart => new Date(startDatePart) < maxDate)).map((date => { const endDate = new Date(new Date(date).setMilliseconds(appointmentAdapter.duration)); const normalizedEndDate = this.normalizeEndDateByViewEnd(this.rawAppointment, endDate); return { startDate: date, endDate: endDate, normalizedEndDate: normalizedEndDate, source: gridAppointment.source } })); result = result.concat(list) })); return result } _createGridAppointmentList(appointmentList, appointmentAdapter) { return appointmentList.map((source => { const offsetDifference = appointmentAdapter.startDate.getTimezoneOffset() - source.startDate.getTimezoneOffset(); if (0 !== offsetDifference && this._canProcessNotNativeTimezoneDates(appointmentAdapter)) { source.startDate = _date2.dateUtilsTs.addOffsets(source.startDate, [offsetDifference * toMs("minute")]); source.endDate = _date2.dateUtilsTs.addOffsets(source.endDate, [offsetDifference * toMs("minute")]); source.exceptionDate = new Date(source.startDate) } const duration = source.endDate.getTime() - source.startDate.getTime(); const startDate = this.timeZoneCalculator.createDate(source.startDate, { path: "toGrid" }); const endDate = _date2.dateUtilsTs.addOffsets(startDate, [duration]); return { startDate: startDate, endDate: endDate, allDay: appointmentAdapter.allDay || false, source: source } })) } _createExtremeRecurrenceDates(groupIndex) { let startViewDate = this.appointmentTakesAllDay ? _date.default.trimTime(this.dateRange[0]) : this.dateRange[0]; let endViewDateByEndDayHour = this.dateRange[1]; if (this.timeZone) { startViewDate = this.timeZoneCalculator.createDate(startViewDate, { path: "fromGrid" }); endViewDateByEndDayHour = this.timeZoneCalculator.createDate(endViewDateByEndDayHour, { path: "fromGrid" }); const daylightOffset = _m_utils_time_zone.default.getDaylightOffsetInMs(startViewDate, endViewDateByEndDayHour); if (daylightOffset) { endViewDateByEndDayHour = new Date(endViewDateByEndDayHour.getTime() + daylightOffset) } } return [startViewDate, endViewDateByEndDayHour] } _createRecurrenceOptions(appointment, groupIndex) { const { viewOffset: viewOffset } = this.options; const originalAppointmentStartDate = _date2.dateUtilsTs.addOffsets(appointment.startDate, [viewOffset]); const originalAppointmentEndDate = _date2.dateUtilsTs.addOffsets(appointment.endDate, [viewOffset]); const [minRecurrenceDate, maxRecurrenceDate] = this._createExtremeRecurrenceDates(groupIndex); const shiftedMinRecurrenceDate = _date2.dateUtilsTs.addOffsets(minRecurrenceDate, [viewOffset]); const shiftedMaxRecurrenceDate = _date2.dateUtilsTs.addOffsets(maxRecurrenceDate, [viewOffset]); return { rule: appointment.recurrenceRule, exception: appointment.recurrenceException, min: shiftedMinRecurrenceDate, max: shiftedMaxRecurrenceDate, firstDayOfWeek: this.firstDayOfWeek, start: originalAppointmentStartDate, end: originalAppointmentEndDate, appointmentTimezoneOffset: this.timeZoneCalculator.getOriginStartDateOffsetInMs(originalAppointmentStartDate, appointment.rawAppointment.startDateTimeZone, true), getPostProcessedException: date => { if ((0, _type.isEmptyObject)(this.timeZone) || _m_utils_time_zone.default.isEqualLocalTimeZone(this.timeZone, date)) { return date } const appointmentOffset = this.timeZoneCalculator.getOffsets(originalAppointmentStartDate).common; const exceptionAppointmentOffset = this.timeZoneCalculator.getOffsets(date).common; let diff = appointmentOffset - exceptionAppointmentOffset; diff = this._getProcessedNotNativeDateIfCrossDST(date, diff); return new Date(date.getTime() - diff * _date.default.dateToMilliseconds("hour")) } } } _createRecurrenceAppointments(appointment, groupIndices) { const { duration: duration } = appointment; const { viewOffset: viewOffset } = this.options; const option = this._createRecurrenceOptions(appointment); const generatedStartDates = (0, _m_recurrence.getRecurrenceProcessor)().generateDates(option); return generatedStartDates.map((date => { const utcDate = _m_utils_time_zone.default.createUTCDateWithLocalOffset(date); utcDate.setTime(utcDate.getTime() + duration); const endDate = _m_utils_time_zone.default.createDateFromUTCWithLocalOffset(utcDate); return { startDate: new Date(date), endDate: endDate } })).map((_ref => { let { startDate: startDate, endDate: endDate } = _ref; return { startDate: _date2.dateUtilsTs.addOffsets(startDate, [-viewOffset]), endDate: _date2.dateUtilsTs.addOffsets(endDate, [-viewOffset]) } })) } _getAppointmentsFirstViewDate(appointments) { const { viewOffset: viewOffset } = this.options; return appointments.map((appointment => { const tableFirstDate = this._getAppointmentFirstViewDate(_extends({}, appointment, { startDate: _date2.dateUtilsTs.addOffsets(appointment.startDate, [viewOffset]), endDate: _date2.dateUtilsTs.addOffsets(appointment.endDate, [viewOffset]) })); if (!tableFirstDate) { return appointment.startDate } const firstDate = _date2.dateUtilsTs.addOffsets(tableFirstDate, [-viewOffset]); return firstDate > appointment.startDate ? firstDate : appointment.startDate })) } _fillNormalizedStartDate(appointments, firstViewDates, rawAppointment) { return appointments.map(((item, idx) => _extends({}, item, { startDate: this._getAppointmentResultDate({ appointment: item, rawAppointment: rawAppointment, startDate: new Date(item.startDate), startDayHour: this.viewStartDayHour, firstViewDate: firstViewDates[idx] }) }))) } _cropAppointmentsByStartDayHour(appointments, firstViewDates) { return appointments.filter(((appointment, idx) => { if (!firstViewDates[idx]) { return false } if (this.appointmentTakesAllDay) { return true } return appointment.endDate > appointment.startDate })) } _getAppointmentResultDate(options) { const { appointment: appointment, startDayHour: startDayHour, firstViewDate: firstViewDate } = options; let { startDate: startDate } = options; let resultDate; if (this.appointmentTakesAllDay) { resultDate = _date.default.normalizeDate(startDate, firstViewDate) } else { if (startDate < firstViewDate) { startDate = firstViewDate } resultDate = _date.default.normalizeDate(appointment.startDate, startDate) } return !this.isDateAppointment ? _date.default.roundDateByStartDayHour(resultDate, startDayHour) : resultDate } _getAppointmentFirstViewDate(appointment) { const groupIndex = appointment.source.groupIndex || 0; const { startDate: startDate, endDate: endDate } = appointment; if (this.isAllDayRowAppointment || appointment.allDay) { return this.viewDataProvider.findAllDayGroupCellStartDate(groupIndex) } return this.viewDataProvider.findGroupCellStartDate(groupIndex, startDate, endDate, this.isDateAppointment) } _getGroupIndices(rawAppointment) { let result = []; if (rawAppointment && this.loadedResources.length) { const tree = (0, _m_utils.createResourcesTree)(this.loadedResources); result = (0, _m_utils.getResourceTreeLeaves)(((field, action) => (0, _m_utils.getDataAccessors)(this.options.dataAccessors.resources, field, action)), tree, rawAppointment) } return result } } exports.DateGeneratorBaseStrategy = DateGeneratorBaseStrategy; class DateGeneratorVirtualStrategy extends DateGeneratorBaseStrategy { get groupCount() { return (0, _index.getGroupCount)(this.loadedResources) } _createRecurrenceAppointments(appointment, groupIndices) { const { duration: duration } = appointment; const result = []; const validGroupIndices = this.groupCount ? groupIndices : [0]; validGroupIndices.forEach((groupIndex => { const option = this._createRecurrenceOptions(appointment, groupIndex); const generatedStartDates = (0, _m_recurrence.getRecurrenceProcessor)().generateDates(option); const recurrentInfo = generatedStartDates.map((date => { const startDate = new Date(date); const utcDate = _m_utils_time_zone.default.createUTCDateWithLocalOffset(date); utcDate.setTime(utcDate.getTime() + duration); const endDate = _m_utils_time_zone.default.createDateFromUTCWithLocalOffset(utcDate); return { startDate: startDate, endDate: endDate, groupIndex: groupIndex } })); result.push(...recurrentInfo) })); return result } _updateGroupIndices(appointments, groupIndices) { const result = []; groupIndices.forEach((groupIndex => { const groupStartDate = this.viewDataProvider.getGroupStartDate(groupIndex); if (groupStartDate) { appointments.forEach((appointment => { const appointmentCopy = (0, _extend.extend)({}, appointment); appointmentCopy.groupIndex = groupIndex; result.push(appointmentCopy) })) } })); return result } _getGroupIndices(resources) { var _groupIndices; let groupIndices = super._getGroupIndices(resources); const viewDataGroupIndices = this.viewDataProvider.getGroupIndices(); if (!(null !== (_groupIndices = groupIndices) && void 0 !== _groupIndices && _groupIndices.length)) { groupIndices = [0] } return groupIndices.filter((groupIndex => -1 !== viewDataGroupIndices.indexOf(groupIndex))) } _createAppointments(appointment, groupIndices) { const appointments = super._createAppointments(appointment, groupIndices); return !appointment.isRecurrent ? this._updateGroupIndices(appointments, groupIndices) : appointments } } exports.DateGeneratorVirtualStrategy = DateGeneratorVirtualStrategy; exports.AppointmentSettingsGenerator = class { constructor(options) { this.options = options; this.appointmentAdapter = (0, _m_appointment_adapter.createAppointmentAdapter)(this.rawAppointment, this.dataAccessors, this.timeZoneCalculator) } get rawAppointment() { return this.options.rawAppointment } get dataAccessors() { return this.options.dataAccessors } get timeZoneCalculator() { return this.options.timeZoneCalculator } get isAllDayRowAppointment() { return this.options.appointmentTakesAllDay && this.options.supportAllDayRow } get groups() { return this.options.groups } get dateSettingsStrategy() { const options = _extends({}, this.options, { isAllDayRowAppointment: this.isAllDayRowAppointment }); return this.options.isVirtualScrolling ? new DateGeneratorVirtualStrategy(options) : new DateGeneratorBaseStrategy(options) } create() { const { dateSettings: dateSettings, itemGroupIndices: itemGroupIndices, isRecurrent: isRecurrent } = this._generateDateSettings(); const cellPositions = this._calculateCellPositions(dateSettings, itemGroupIndices); const result = this._prepareAppointmentInfos(dateSettings, cellPositions, isRecurrent); return result } _generateDateSettings() { return this.dateSettingsStrategy.generate(this.appointmentAdapter) } _calculateCellPositions(dateSettings, itemGroupIndices) { const cellPositionCalculator = new _m_cell_position_calculator.CellPositionCalculator(_extends({}, this.options, { dateSettings: dateSettings })); return cellPositionCalculator.calculateCellPositions(itemGroupIndices, this.isAllDayRowAppointment, this.appointmentAdapter.isRecurrent) } _prepareAppointmentInfos(dateSettings, cellPositions, isRecurrent) { const infos = []; cellPositions.forEach((_ref2 => { let { coordinates: coordinates, dateSettingIndex: dateSettingIndex } = _ref2; const dateSetting = dateSettings[dateSettingIndex]; const dateText = this._getAppointmentDateText(dateSetting); const info = { appointment: dateSetting, sourceAppointment: dateSetting.source, dateText: dateText, isRecurrent: isRecurrent }; infos.push(_extends({}, coordinates, { info: info })) })); return infos } _getAppointmentDateText(sourceAppointment) { const { startDate: startDate, endDate: endDate, allDay: allDay } = sourceAppointment; return (0, _m_text_utils.createFormattedDateText)({ startDate: startDate, endDate: endDate, allDay: allDay, format: "TIME" }) } } }, 18775: /*!***********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/m_text_utils.js ***! \***********************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.getFormatType = exports.formatDates = exports.createFormattedDateText = void 0; var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198)); var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../../localization/date */ 91500)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } exports.createFormattedDateText = options => { const { startDate: startDate, endDate: endDate, allDay: allDay, format: format } = options; const formatType = format || getFormatType(startDate, endDate, allDay); return formatDates(startDate, endDate, formatType) }; const getFormatType = (startDate, endDate, isAllDay, isDateAndTimeView) => { if (isAllDay) { return "DATE" } if (isDateAndTimeView && _date.default.sameDate(startDate, endDate)) { return "TIME" } return "DATETIME" }; exports.getFormatType = getFormatType; const formatDates = (startDate, endDate, formatType) => { const isSameDate = startDate.getDate() === endDate.getDate(); switch (formatType) { case "DATETIME": return [_date2.default.format(startDate, "monthandday"), " ", _date2.default.format(startDate, "shorttime"), " - ", isSameDate ? "" : `${_date2.default.format(endDate,"monthandday")} `, _date2.default.format(endDate, "shorttime")].join(""); case "TIME": return `${_date2.default.format(startDate,"shorttime")} - ${_date2.default.format(endDate,"shorttime")}`; case "DATE": return `${_date2.default.format(startDate,"monthandday")}${isSameDate?"":` - ${_date2.default.format(endDate,"monthandday")}`}` } }; exports.formatDates = formatDates }, 62386: /*!*********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/m_view_model_generator.js ***! \*********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.AppointmentViewModelGenerator = void 0; var _date = __webpack_require__( /*! ../../core/utils/date */ 24321); var _index = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084); var _m_strategy_agenda = _interopRequireDefault(__webpack_require__( /*! ./rendering_strategies/m_strategy_agenda */ 87241)); var _m_strategy_horizontal = _interopRequireDefault(__webpack_require__( /*! ./rendering_strategies/m_strategy_horizontal */ 50323)); var _m_strategy_horizontal_month = _interopRequireDefault(__webpack_require__( /*! ./rendering_strategies/m_strategy_horizontal_month */ 92888)); var _m_strategy_horizontal_month_line = _interopRequireDefault(__webpack_require__( /*! ./rendering_strategies/m_strategy_horizontal_month_line */ 24049)); var _m_strategy_vertical = _interopRequireDefault(__webpack_require__( /*! ./rendering_strategies/m_strategy_vertical */ 20523)); var _m_strategy_week = _interopRequireDefault(__webpack_require__( /*! ./rendering_strategies/m_strategy_week */ 25410)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const RENDERING_STRATEGIES = { horizontal: _m_strategy_horizontal.default, horizontalMonth: _m_strategy_horizontal_month.default, horizontalMonthLine: _m_strategy_horizontal_month_line.default, vertical: _m_strategy_vertical.default, week: _m_strategy_week.default, agenda: _m_strategy_agenda.default }; exports.AppointmentViewModelGenerator = class { initRenderingStrategy(options) { const RenderingStrategy = RENDERING_STRATEGIES[options.appointmentRenderingStrategyName]; this.renderingStrategy = new RenderingStrategy(options) } generate(filteredItems, options) { const { viewOffset: viewOffset } = options; const appointments = filteredItems ? filteredItems.slice() : []; this.initRenderingStrategy(options); const renderingStrategy = this.getRenderingStrategy(); const positionMap = renderingStrategy.createTaskPositionMap(appointments); const shiftedViewModel = this.postProcess(appointments, positionMap); const viewModel = this.unshiftViewModelAppointmentsByViewOffset(shiftedViewModel, viewOffset); return { positionMap: positionMap, viewModel: viewModel } } postProcess(filteredItems, positionMap) { const renderingStrategy = this.getRenderingStrategy(); return filteredItems.map(((data, index) => { if (!renderingStrategy.keepAppointmentSettings()) { delete data.settings } const appointmentSettings = positionMap[index]; appointmentSettings.forEach((item => { item.direction = "vertical" === renderingStrategy.getDirection() && !item.allDay ? "vertical" : "horizontal" })); const item = { itemData: data, settings: appointmentSettings }; item.needRepaint = true; item.needRemove = false; return item })) } makeRenovatedViewModels(viewModel, supportAllDayRow, isVerticalGrouping) { const strategy = this.getRenderingStrategy(); const regularViewModels = []; const allDayViewModels = []; const compactOptions = []; const isAllDayPanel = supportAllDayRow && !isVerticalGrouping; viewModel.forEach((_ref => { let { itemData: itemData, settings: settings } = _ref; settings.forEach((options => { const item = this.prepareViewModel(options, strategy, itemData); if (options.isCompact) { compactOptions.push({ compactViewModel: options.virtual, appointmentViewModel: item }) } else if (options.allDay && isAllDayPanel) { allDayViewModels.push(item) } else { regularViewModels.push(item) } })) })); const compactViewModels = this.prepareCompactViewModels(compactOptions, supportAllDayRow); const result = _extends({ allDay: allDayViewModels, regular: regularViewModels }, compactViewModels); return result } prepareViewModel(options, strategy, itemData) { const geometry = strategy.getAppointmentGeometry(options); const viewModel = { key: (0, _index.getAppointmentKey)(geometry), appointment: itemData, geometry: _extends({}, geometry, { leftVirtualWidth: options.leftVirtualWidth, topVirtualHeight: options.topVirtualHeight }), info: _extends({}, options.info, { allDay: options.allDay, direction: options.direction, appointmentReduced: options.appointmentReduced, groupIndex: options.groupIndex }) }; return viewModel } getCompactViewModelFrame(compactViewModel) { return { isAllDay: !!compactViewModel.isAllDay, isCompact: compactViewModel.isCompact, groupIndex: compactViewModel.groupIndex, geometry: { left: compactViewModel.left, top: compactViewModel.top, width: compactViewModel.width, height: compactViewModel.height }, items: { colors: [], data: [], settings: [] } } } prepareCompactViewModels(compactOptions, supportAllDayRow) { const regularCompact = {}; const allDayCompact = {}; compactOptions.forEach((_ref2 => { let { compactViewModel: compactViewModel, appointmentViewModel: appointmentViewModel } = _ref2; const { index: index, isAllDay: isAllDay } = compactViewModel; const viewModel = isAllDay && supportAllDayRow ? allDayCompact : regularCompact; if (!viewModel[index]) { viewModel[index] = this.getCompactViewModelFrame(compactViewModel) } const { settings: settings, data: data, colors: colors } = viewModel[index].items; settings.push(appointmentViewModel); data.push(appointmentViewModel.appointment); colors.push(appointmentViewModel.info.resourceColor) })); const toArray = items => Object.keys(items).map((key => _extends({ key: key }, items[key]))); const allDayViewModels = toArray(allDayCompact); const regularViewModels = toArray(regularCompact); return { allDayCompact: allDayViewModels, regularCompact: regularViewModels } } getRenderingStrategy() { return this.renderingStrategy } unshiftViewModelAppointmentsByViewOffset(viewModel, viewOffset) { const processedAppointments = new Set; for (const model of viewModel) { for (const setting of model.settings ?? []) { var _setting$info; const appointment = null === setting || void 0 === setting || null === (_setting$info = setting.info) || void 0 === _setting$info ? void 0 : _setting$info.appointment; if (appointment && !processedAppointments.has(appointment)) { appointment.startDate = _date.dateUtilsTs.addOffsets(appointment.startDate, [viewOffset]); appointment.endDate = _date.dateUtilsTs.addOffsets(appointment.endDate, [viewOffset]); appointment.normalizedEndDate = _date.dateUtilsTs.addOffsets(appointment.normalizedEndDate, [viewOffset]); processedAppointments.add(appointment) } } } return viewModel } } }, 66040: /*!****************************************************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/rendering_strategies/m_appointments_positioning_strategy_adaptive.js ***! \****************************************************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _m_appointments_positioning_strategy_base = (obj = __webpack_require__( /*! ./m_appointments_positioning_strategy_base */ 72115), obj && obj.__esModule ? obj : { default: obj }); var obj; class AdaptivePositioningStrategy extends _m_appointments_positioning_strategy_base.default { getDropDownAppointmentWidth(intervalCount, isAllDay) { return this.getDropDownButtonAdaptiveSize() } getDropDownButtonAdaptiveSize() { return 28 } getCollectorTopOffset(allDay) { const renderingStrategy = this._renderingStrategy; if (renderingStrategy.allDaySupported() && allDay) { return (renderingStrategy.allDayHeight - renderingStrategy.getDropDownButtonAdaptiveSize()) / 2 } return this._renderingStrategy.cellHeight - 40 } getCollectorLeftOffset() { const collectorWidth = this._renderingStrategy.getDropDownAppointmentWidth(); return (this._renderingStrategy.cellWidth - collectorWidth) / 2 } getAppointmentDefaultOffset() { return 35 } getDynamicAppointmentCountPerCell() { const renderingStrategy = this._renderingStrategy; if (renderingStrategy.allDaySupported()) { return { allDay: 0, simple: this._calculateDynamicAppointmentCountPerCell() || this._getAppointmentMinCount() } } return 0 } getDropDownAppointmentHeight() { return 28 } _getAppointmentMinCount() { return 0 } _getAppointmentDefaultWidth() { const renderingStrategy = this._renderingStrategy; if (renderingStrategy.allDaySupported()) { return 30 } return super._getAppointmentDefaultWidth() } _calculateDynamicAppointmentCountPerCell() { return Math.floor(this._renderingStrategy._getAppointmentMaxWidth() / this._renderingStrategy._getAppointmentDefaultWidth()) } } exports.default = AdaptivePositioningStrategy }, 72115: /*!************************************************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/rendering_strategies/m_appointments_positioning_strategy_base.js ***! \************************************************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); exports.default = class { constructor(renderingStrategy) { this._renderingStrategy = renderingStrategy } getDropDownAppointmentWidth(intervalCount, isAllDay) { if (isAllDay || !(0, _type.isDefined)(isAllDay)) { return 75 * this._renderingStrategy.cellWidth / 100 } return 24 } getCollectorTopOffset(allDay) { return 3 } getCollectorLeftOffset() { return 3 } getAppointmentDefaultOffset() { if (this._renderingStrategy._isCompactTheme()) { return 22 } return this._renderingStrategy.appointmentOffset } getDynamicAppointmentCountPerCell() { const renderingStrategy = this._renderingStrategy; const { cellHeight: cellHeight } = renderingStrategy; const allDayCount = Math.floor((cellHeight - renderingStrategy._getAppointmentDefaultOffset()) / renderingStrategy._getAppointmentDefaultHeight()) || this._getAppointmentMinCount(); if (renderingStrategy.allDaySupported()) { return { allDay: "vertical" === renderingStrategy.groupOrientation ? allDayCount : this._renderingStrategy.appointmentCountPerCell, simple: this._calculateDynamicAppointmentCountPerCell() || this._getAppointmentMinCount() } } return allDayCount } getDropDownAppointmentHeight() { return } _getAppointmentMinCount() { return 1 } _calculateDynamicAppointmentCountPerCell() { return Math.floor(this._renderingStrategy._getAppointmentMaxWidth() / 50) } _getAppointmentDefaultWidth() { return 40 } } }, 87241: /*!*************************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/rendering_strategies/m_strategy_agenda.js ***! \*************************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198)); var _iterator = __webpack_require__( /*! ../../../../core/utils/iterator */ 95479); var _m_appointment_adapter = __webpack_require__( /*! ../../m_appointment_adapter */ 72734); var _m_expression_utils = __webpack_require__( /*! ../../m_expression_utils */ 30906); var _m_utils = __webpack_require__( /*! ../../resources/m_utils */ 31359); var _m_utils2 = __webpack_require__( /*! ../data_provider/m_utils */ 55523); var _m_strategy_base = _interopRequireDefault(__webpack_require__( /*! ./m_strategy_base */ 64173)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } class AgendaRenderingStrategy extends _m_strategy_base.default { get instance() { return this.options.instance } get agendaDuration() { return this.options.agendaDuration } getAppointmentMinSize() {} getDeltaTime() {} keepAppointmentSettings() { return true } getAppointmentGeometry(geometry) { return geometry } groupAppointmentByResources(appointments) { const groups = this.instance._getCurrentViewOption("groups"); const config = { loadedResources: this.options.loadedResources, resources: this.options.resources, dataAccessors: this.dataAccessors.resources }; return (0, _m_utils.groupAppointmentsByResources)(config, appointments, groups) } createTaskPositionMap(appointments) { let height; let appointmentsByResources; this.calculateRows(appointments, this.agendaDuration, this.currentDate); if (appointments.length) { height = this.instance.fire("getAgendaVerticalStepHeight"); appointmentsByResources = this.groupAppointmentByResources(appointments); let groupedAppts = []; (0, _iterator.each)(appointmentsByResources, ((i, appts) => { let additionalAppointments = []; let recurrentIndexes = []; (0, _iterator.each)(appts, ((index, appointment) => { const recurrenceBatch = this.instance.getAppointmentsInstance()._processRecurrenceAppointment(appointment, index); let appointmentBatch = null; if (!recurrenceBatch.indexes.length) { appointmentBatch = this.instance.getAppointmentsInstance()._processLongAppointment(appointment); additionalAppointments = additionalAppointments.concat(appointmentBatch.parts) } additionalAppointments = additionalAppointments.concat(recurrenceBatch.parts); recurrentIndexes = recurrentIndexes.concat(recurrenceBatch.indexes) })); this.instance.getAppointmentsInstance()._reduceRecurrenceAppointments(recurrentIndexes, appts); this.instance.getAppointmentsInstance()._combineAppointments(appts, additionalAppointments); groupedAppts = groupedAppts.concat(appts) })); Array.prototype.splice.apply(appointments, [0, appointments.length].concat(groupedAppts)) } const result = []; let sortedIndex = 0; appointments.forEach(((appt, index) => { result.push([{ height: height, width: "100%", sortedIndex: sortedIndex++, groupIndex: this._calculateGroupIndex(index, appointmentsByResources), agendaSettings: appt.settings }]); delete appt.settings })); return result } _calculateGroupIndex(apptIndex, appointmentsByResources) { let resultInd; let counter = 0; for (const i in appointmentsByResources) { const countApptInGroup = appointmentsByResources[i].length; if (apptIndex >= counter && apptIndex < counter + countApptInGroup) { resultInd = Number(i); break } counter += countApptInGroup } return resultInd } _getDeltaWidth(args, initialSize) {} _getAppointmentMaxWidth() { return this.cellWidth } _needVerifyItemSize() { return false } _getAppointmentParts(geometry, settings) {} _reduceMultiWeekAppointment() {} calculateAppointmentHeight() { return 0 } calculateAppointmentWidth() { return 0 } isAppointmentGreaterThan(etalon, comparisonParameters) {} isAllDay() { return false } _sortCondition() {} _rowCondition(a, b) {} _columnCondition(a, b) {} _findIndexByKey(arr, iKey, jKey, iValue, jValue) {} _markAppointmentAsVirtual() {} getDropDownAppointmentWidth() {} getCollectorLeftOffset() {} getCollectorTopOffset() {} replaceWrongAppointmentEndDate(rawAppointment, startDate, endDate) { const adapter = (0, _m_appointment_adapter.createAppointmentAdapter)(rawAppointment, this.dataAccessors, this.timeZoneCalculator); (0, _m_utils2.replaceWrongEndDate)(adapter, startDate, endDate, this.cellDuration, this.dataAccessors) } calculateRows(appointments, agendaDuration, currentDate, needClearSettings) { this._rows = []; currentDate = _date.default.trimTime(new Date(currentDate)); const groupedAppointments = this.groupAppointmentByResources(appointments); (0, _iterator.each)(groupedAppointments, ((_, currentAppointments) => { const groupResult = []; const appts = { indexes: [], parts: [] }; if (!currentAppointments.length) { this._rows.push([]); return true }(0, _iterator.each)(currentAppointments, ((index, appointment) => { const startDate = _m_expression_utils.ExpressionUtils.getField(this.dataAccessors, "startDate", appointment); const endDate = _m_expression_utils.ExpressionUtils.getField(this.dataAccessors, "endDate", appointment); this.replaceWrongAppointmentEndDate(appointment, startDate, endDate); needClearSettings && delete appointment.settings; const result = this.instance.getAppointmentsInstance()._processRecurrenceAppointment(appointment, index, false); appts.parts = appts.parts.concat(result.parts); appts.indexes = appts.indexes.concat(result.indexes) })); this.instance.getAppointmentsInstance()._reduceRecurrenceAppointments(appts.indexes, currentAppointments); currentAppointments.push(...appts.parts); const appointmentCount = currentAppointments.length; for (let i = 0; i < agendaDuration; i++) { const day = new Date(currentDate); day.setMilliseconds(day.getMilliseconds() + 864e5 * i); if (void 0 === groupResult[i]) { groupResult[i] = 0 } for (let j = 0; j < appointmentCount; j++) { const appointmentData = currentAppointments[j].settings || currentAppointments[j]; const adapter = (0, _m_appointment_adapter.createAppointmentAdapter)(currentAppointments[j], this.dataAccessors, this.timeZoneCalculator); const appointmentIsLong = (0, _m_utils2.getAppointmentTakesSeveralDays)(adapter); const appointmentIsRecurrence = _m_expression_utils.ExpressionUtils.getField(this.dataAccessors, "recurrenceRule", currentAppointments[j]); if (this.instance.fire("dayHasAppointment", day, appointmentData, true) || !appointmentIsRecurrence && appointmentIsLong && this.instance.fire("dayHasAppointment", day, currentAppointments[j], true)) { groupResult[i] += 1 } } } this._rows.push(groupResult) })); return this._rows } _iterateRow(row, obj, index) { for (let i = 0; i < row.length; i++) { obj.counter += row[i]; if (obj.counter >= index) { obj.indexInRow = i; break } } } getDateByIndex(index, rows, startViewDate) { const obj = { counter: 0, indexInRow: 0 }; index++; for (let i = 0; i < rows.length; i++) { this._iterateRow(rows[i], obj, index); if (obj.indexInRow) { break } } return new Date(new Date(startViewDate).setDate(startViewDate.getDate() + obj.indexInRow)) } getAppointmentDataCalculator() { return ($appointment, originalStartDate) => { const apptIndex = $appointment.index(); const startViewDate = this.instance.getStartViewDate(); const calculatedStartDate = this.getDateByIndex(apptIndex, this._rows, startViewDate); const wrappedOriginalStartDate = new Date(originalStartDate); return { startDate: new Date(calculatedStartDate.setHours(wrappedOriginalStartDate.getHours(), wrappedOriginalStartDate.getMinutes(), wrappedOriginalStartDate.getSeconds(), wrappedOriginalStartDate.getMilliseconds())) } } } } exports.default = AgendaRenderingStrategy }, 64173: /*!***********************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/rendering_strategies/m_strategy_base.js ***! \***********************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198)); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _themes = __webpack_require__( /*! ../../../../ui/themes */ 75811); var _date2 = __webpack_require__( /*! ../../../core/utils/date */ 24321); var _m_expression_utils = __webpack_require__( /*! ../../../scheduler/m_expression_utils */ 30906); var _index = __webpack_require__( /*! ../../../scheduler/r1/utils/index */ 94084); var _m_appointment_adapter = __webpack_require__( /*! ../../m_appointment_adapter */ 72734); var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../../m_utils_time_zone */ 57880)); var _m_settings_generator = __webpack_require__( /*! ../m_settings_generator */ 24099); var _m_appointments_positioning_strategy_adaptive = _interopRequireDefault(__webpack_require__( /*! ./m_appointments_positioning_strategy_adaptive */ 66040)); var _m_appointments_positioning_strategy_base = _interopRequireDefault(__webpack_require__( /*! ./m_appointments_positioning_strategy_base */ 72115)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const toMs = _date.default.dateToMilliseconds; exports.default = class { constructor(options) { this.options = options; this._initPositioningStrategy() } get isAdaptive() { return this.options.adaptivityEnabled } get rtlEnabled() { return this.options.rtlEnabled } get startDayHour() { return this.options.startDayHour } get endDayHour() { return this.options.endDayHour } get maxAppointmentsPerCell() { return this.options.maxAppointmentsPerCell } get cellWidth() { return this.options.cellWidth } get cellHeight() { return this.options.cellHeight } get allDayHeight() { return this.options.allDayHeight } get resizableStep() { return this.options.resizableStep } get isGroupedByDate() { return this.options.isGroupedByDate } get visibleDayDuration() { return this.options.visibleDayDuration } get viewStartDayHour() { return this.options.viewStartDayHour } get viewEndDayHour() { return this.options.viewEndDayHour } get cellDuration() { return this.options.cellDuration } get cellDurationInMinutes() { return this.options.cellDurationInMinutes } get leftVirtualCellCount() { return this.options.leftVirtualCellCount } get topVirtualCellCount() { return this.options.topVirtualCellCount } get positionHelper() { return this.options.positionHelper } get showAllDayPanel() { return this.options.showAllDayPanel } get isGroupedAllDayPanel() { return this.options.isGroupedAllDayPanel } get groupOrientation() { return this.options.groupOrientation } get rowCount() { return this.options.rowCount } get groupCount() { return this.options.groupCount } get currentDate() { return this.options.currentDate } get appointmentCountPerCell() { return this.options.appointmentCountPerCell } get appointmentOffset() { return this.options.appointmentOffset } get allowResizing() { return this.options.allowResizing } get allowAllDayResizing() { return this.options.allowAllDayResizing } get viewDataProvider() { return this.options.viewDataProvider } get dataAccessors() { return this.options.dataAccessors } get timeZoneCalculator() { return this.options.timeZoneCalculator } get intervalCount() { return this.options.intervalCount } get allDayPanelMode() { return this.options.allDayPanelMode } get isVirtualScrolling() { return this.options.isVirtualScrolling } _correctCollectorCoordinatesInAdaptive(coordinates, isAllDay) { coordinates.top += this.getCollectorTopOffset(isAllDay); coordinates.left += this.getCollectorLeftOffset() } _initPositioningStrategy() { this._positioningStrategy = this.isAdaptive ? new _m_appointments_positioning_strategy_adaptive.default(this) : new _m_appointments_positioning_strategy_base.default(this) } getPositioningStrategy() { return this._positioningStrategy } getAppointmentMinSize() { return 2 } keepAppointmentSettings() { return false } getDeltaTime(args, initialSize, appointment) {} getAppointmentGeometry(coordinates) { return coordinates } needCorrectAppointmentDates() { return true } getDirection() { return "horizontal" } createTaskPositionMap(items, skipSorting) { delete this._maxAppointmentCountPerCell; const length = null === items || void 0 === items ? void 0 : items.length; if (!length) { return } const map = []; for (let i = 0; i < length; i++) { let coordinates = this._getItemPosition(items[i]); if (coordinates.length && this.rtlEnabled) { coordinates = this._correctRtlCoordinates(coordinates) } coordinates.forEach((item => { item.leftVirtualCellCount = this.leftVirtualCellCount; item.topVirtualCellCount = this.topVirtualCellCount; item.leftVirtualWidth = this.leftVirtualCellCount * this.cellWidth; item.topVirtualHeight = this.topVirtualCellCount * this.cellHeight })); map.push(coordinates) } const positionArray = this._getSortedPositions(map); const resultPositions = this._getResultPositions(positionArray); return this._getExtendedPositionMap(map, resultPositions) } _getDeltaWidth(args, initialSize) { const intervalWidth = this.resizableStep || this.getAppointmentMinSize(); const initialWidth = initialSize.width; return Math.round((args.width - initialWidth) / intervalWidth) } _correctRtlCoordinates(coordinates) { const width = coordinates[0].width || this._getAppointmentMaxWidth(); coordinates.forEach((coordinate => { if (!coordinate.appointmentReduced) { coordinate.left -= width } })); return coordinates } _getAppointmentMaxWidth() { return this.cellWidth } _getItemPosition(initialAppointment) { const appointment = this.shiftAppointmentByViewOffset(initialAppointment); const position = this.generateAppointmentSettings(appointment); const allDay = this.isAllDay(appointment); let result = []; for (let j = 0; j < position.length; j++) { const height = this.calculateAppointmentHeight(appointment, position[j]); const width = this.calculateAppointmentWidth(appointment, position[j]); let resultWidth = width; let appointmentReduced = null; let multiWeekAppointmentParts = []; let initialRowIndex = position[j].rowIndex; let initialColumnIndex = position[j].columnIndex; if (this._needVerifyItemSize() || allDay) { const currentMaxAllowedPosition = position[j].hMax; if (this.isAppointmentGreaterThan(currentMaxAllowedPosition, { left: position[j].left, width: width })) { appointmentReduced = "head"; initialRowIndex = position[j].rowIndex; initialColumnIndex = position[j].columnIndex; resultWidth = this._reduceMultiWeekAppointment(width, { left: position[j].left, right: currentMaxAllowedPosition }); multiWeekAppointmentParts = this._getAppointmentParts({ sourceAppointmentWidth: width, reducedWidth: resultWidth, height: height }, position[j]); if (this.rtlEnabled) { position[j].left = currentMaxAllowedPosition } } }(0, _extend.extend)(position[j], { height: height, width: resultWidth, allDay: allDay, rowIndex: initialRowIndex, columnIndex: initialColumnIndex, appointmentReduced: appointmentReduced }); result = this._getAppointmentPartsPosition(multiWeekAppointmentParts, position[j], result) } return result } _getAppointmentPartsPosition(appointmentParts, position, result) { if (appointmentParts.length) { appointmentParts.unshift(position); result = result.concat(appointmentParts) } else { result.push(position) } return result } getAppointmentSettingsGenerator(rawAppointment) { return new _m_settings_generator.AppointmentSettingsGenerator(_extends({ rawAppointment: rawAppointment, appointmentTakesAllDay: this.isAppointmentTakesAllDay(rawAppointment), getPositionShiftCallback: this.getPositionShift.bind(this) }, this.options)) } generateAppointmentSettings(rawAppointment) { return this.getAppointmentSettingsGenerator(rawAppointment).create() } isAppointmentTakesAllDay(rawAppointment) { const adapter = (0, _m_appointment_adapter.createAppointmentAdapter)(rawAppointment, this.dataAccessors, this.timeZoneCalculator); return (0, _index.getAppointmentTakesAllDay)(adapter, this.allDayPanelMode) } _getAppointmentParts(geometry, settings) { return [] } _getCompactAppointmentParts(appointmentWidth) { const cellWidth = this.cellWidth || this.getAppointmentMinSize(); return Math.round(appointmentWidth / cellWidth) } _reduceMultiWeekAppointment(sourceAppointmentWidth, bound) { if (this.rtlEnabled) { sourceAppointmentWidth = Math.floor(bound.left - bound.right) } else { sourceAppointmentWidth = bound.right - Math.floor(bound.left) } return sourceAppointmentWidth } calculateAppointmentHeight(appointment, position) { return 0 } calculateAppointmentWidth(appointment, position) { return 0 } isAppointmentGreaterThan(etalon, comparisonParameters) { let result = comparisonParameters.left + comparisonParameters.width - etalon; if (this.rtlEnabled) { result = etalon + comparisonParameters.width - comparisonParameters.left } return result > this.cellWidth / 2 } isAllDay(appointment) { return false } cropAppointmentWidth(width, cellWidth) { return this.isGroupedByDate ? cellWidth : width } _getSortedPositions(positionList, skipSorting) { const result = []; const round = value => Math.round(100 * value) / 100; const createItem = (rowIndex, columnIndex, top, left, bottom, right, position, allDay) => ({ i: rowIndex, j: columnIndex, top: round(top), left: round(left), bottom: round(bottom), right: round(right), cellPosition: position, allDay: allDay }); for (let rowIndex = 0, rowCount = positionList.length; rowIndex < rowCount; rowIndex++) { for (let columnIndex = 0, cellCount = positionList[rowIndex].length; columnIndex < cellCount; columnIndex++) { const { top: top, left: left, height: height, width: width, cellPosition: cellPosition, allDay: allDay } = positionList[rowIndex][columnIndex]; result.push(createItem(rowIndex, columnIndex, top, left, top + height, left + width, cellPosition, allDay)) } } return result.sort(((a, b) => this._sortCondition(a, b))) } _sortCondition(a, b) {} _getConditions(a, b) { const isSomeEdge = this._isSomeEdge(a, b); return { columnCondition: isSomeEdge || this._normalizeCondition(a.left, b.left), rowCondition: isSomeEdge || this._normalizeCondition(a.top, b.top), cellPositionCondition: isSomeEdge || this._normalizeCondition(a.cellPosition, b.cellPosition) } } _rowCondition(a, b) { const conditions = this._getConditions(a, b); return conditions.columnCondition || conditions.rowCondition } _columnCondition(a, b) { const conditions = this._getConditions(a, b); return conditions.rowCondition || conditions.columnCondition } _isSomeEdge(a, b) { return a.i === b.i && a.j === b.j } _normalizeCondition(first, second) { const result = first - second; return Math.abs(result) > 1 ? result : 0 } _isItemsCross(firstItem, secondItem) { const areItemsInTheSameTable = !!firstItem.allDay === !!secondItem.allDay; const areItemsAllDay = firstItem.allDay && secondItem.allDay; if (areItemsInTheSameTable) { const orientation = this._getOrientation(areItemsAllDay); return this._checkItemsCrossing(firstItem, secondItem, orientation) } return false } _checkItemsCrossing(firstItem, secondItem, orientation) { const firstItemSide1 = Math.floor(firstItem[orientation[0]]); const firstItemSide2 = Math.floor(firstItem[orientation[1]]); const secondItemSide1 = Math.ceil(secondItem[orientation[0]]); const secondItemSide2 = Math.ceil(secondItem[orientation[1]]); const isItemCross = Math.abs(firstItem[orientation[2]] - secondItem[orientation[2]]) <= 1; return isItemCross && (firstItemSide1 <= secondItemSide1 && firstItemSide2 > secondItemSide1 || firstItemSide1 < secondItemSide2 && firstItemSide2 >= secondItemSide2 || firstItemSide1 === secondItemSide1 && firstItemSide2 === secondItemSide2) } _getOrientation(isAllDay) { return isAllDay ? ["left", "right", "top"] : ["top", "bottom", "left"] } _getResultPositions(sortedArray) { const result = []; let i; let sortedIndex = 0; let currentItem; let indexes; let itemIndex; let maxIndexInStack = 0; let stack = {}; const findFreeIndex = (indexes, index) => { const isFind = indexes.some((item => item === index)); if (isFind) { return findFreeIndex(indexes, ++index) } return index }; const createItem = (currentItem, index) => { const currentIndex = index || 0; return { index: currentIndex, i: currentItem.i, j: currentItem.j, left: currentItem.left, right: currentItem.right, top: currentItem.top, bottom: currentItem.bottom, allDay: currentItem.allDay, sortedIndex: this._skipSortedIndex(currentIndex) ? null : sortedIndex++ } }; const startNewStack = currentItem => { stack.items = [createItem(currentItem)]; stack.left = currentItem.left; stack.right = currentItem.right; stack.top = currentItem.top; stack.bottom = currentItem.bottom; stack.allDay = currentItem.allDay }; const pushItemsInResult = items => { items.forEach((item => { result.push({ index: item.index, count: maxIndexInStack + 1, i: item.i, j: item.j, sortedIndex: item.sortedIndex }) })) }; for (i = 0; i < sortedArray.length; i++) { currentItem = sortedArray[i]; indexes = []; if (!stack.items) { startNewStack(currentItem) } else if (this._isItemsCross(stack, currentItem)) { stack.items.forEach((item => { if (this._isItemsCross(item, currentItem)) { indexes.push(item.index) } })); itemIndex = indexes.length ? findFreeIndex(indexes, 0) : 0; stack.items.push(createItem(currentItem, itemIndex)); maxIndexInStack = Math.max(itemIndex, maxIndexInStack); stack.left = Math.min(stack.left, currentItem.left); stack.right = Math.max(stack.right, currentItem.right); stack.top = Math.min(stack.top, currentItem.top); stack.bottom = Math.max(stack.bottom, currentItem.bottom); stack.allDay = currentItem.allDay } else { pushItemsInResult(stack.items); stack = {}; startNewStack(currentItem); maxIndexInStack = 0 } } if (stack.items) { pushItemsInResult(stack.items) } return result.sort(((a, b) => { const columnCondition = a.j - b.j; const rowCondition = a.i - b.i; return rowCondition || columnCondition })) } _skipSortedIndex(index) { return index > this._getMaxAppointmentCountPerCell() - 1 } _findIndexByKey(arr, iKey, jKey, iValue, jValue) { let result = 0; for (let i = 0, len = arr.length; i < len; i++) { if (arr[i][iKey] === iValue && arr[i][jKey] === jValue) { result = i; break } } return result } _getExtendedPositionMap(map, positions) { let positionCounter = 0; const result = []; for (let i = 0, mapLength = map.length; i < mapLength; i++) { const resultString = []; for (let 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 } _checkLongCompactAppointment(item, result) { this._splitLongCompactAppointment(item, result); return result } _splitLongCompactAppointment(item, result) { const appointmentCountPerCell = this._getMaxAppointmentCountPerCellByType(item.allDay); let compactCount = 0; if (void 0 !== appointmentCountPerCell && item.index > appointmentCountPerCell - 1) { item.isCompact = true; compactCount = this._getCompactAppointmentParts(item.width); for (let k = 1; k < compactCount; k++) { const compactPart = (0, _extend.extend)(true, {}, item); compactPart.left = this._getCompactLeftCoordinate(item.left, k); compactPart.columnIndex += k; compactPart.sortedIndex = null; result.push(compactPart) } } return result } _adjustDurationByDaylightDiff(duration, startDate, endDate) { const { viewOffset: viewOffset } = this.options; const originalStartDate = _date2.dateUtilsTs.addOffsets(startDate, [viewOffset]); const originalEndDate = _date2.dateUtilsTs.addOffsets(endDate, [viewOffset]); const daylightDiff = _m_utils_time_zone.default.getDaylightOffset(originalStartDate, originalEndDate); const correctedDuration = this._needAdjustDuration(daylightDiff) ? this._calculateDurationByDaylightDiff(duration, daylightDiff) : duration; return correctedDuration <= Math.abs(daylightDiff) ? duration : correctedDuration } _needAdjustDuration(diff) { return 0 !== diff } _calculateDurationByDaylightDiff(duration, diff) { return duration + diff * toMs("minute") } _getCollectorLeftOffset(isAllDay) { if (isAllDay || !this.isApplyCompactAppointmentOffset()) { return 0 } const dropDownButtonWidth = this.getDropDownAppointmentWidth(this.intervalCount, isAllDay); const rightOffset = this._isCompactTheme() ? 1 : 5; return this.cellWidth - dropDownButtonWidth - rightOffset } _markAppointmentAsVirtual(coordinates) { let isAllDay = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : false; const countFullWidthAppointmentInCell = this._getMaxAppointmentCountPerCellByType(isAllDay); if (coordinates.count - countFullWidthAppointmentInCell > 0) { const { top: top, left: left } = coordinates; const compactRender = this.isAdaptive || !isAllDay && this.supportCompactDropDownAppointments(); coordinates.virtual = { left: left + this._getCollectorLeftOffset(isAllDay), top: top, width: this.getDropDownAppointmentWidth(this.intervalCount, isAllDay), height: this.getDropDownAppointmentHeight(), index: this._generateAppointmentCollectorIndex(coordinates, isAllDay), isAllDay: isAllDay, groupIndex: coordinates.groupIndex, isCompact: compactRender } } } isApplyCompactAppointmentOffset() { return this.supportCompactDropDownAppointments() } supportCompactDropDownAppointments() { return true } _generateAppointmentCollectorIndex(_ref, isAllDay) { let { groupIndex: groupIndex, rowIndex: rowIndex, columnIndex: columnIndex } = _ref; return `${groupIndex}-${rowIndex}-${columnIndex}-${isAllDay}` } _getMaxAppointmentCountPerCellByType(isAllDay) { const appointmentCountPerCell = this._getMaxAppointmentCountPerCell(); if ((0, _type.isObject)(appointmentCountPerCell)) { return isAllDay ? appointmentCountPerCell.allDay : appointmentCountPerCell.simple } return appointmentCountPerCell } getDropDownAppointmentWidth(intervalCount, isAllDay) { return this.getPositioningStrategy().getDropDownAppointmentWidth(intervalCount, isAllDay) } getDropDownAppointmentHeight() { return this.getPositioningStrategy().getDropDownAppointmentHeight() } getDropDownButtonAdaptiveSize() { return 28 } getCollectorTopOffset(allDay) { return this.getPositioningStrategy().getCollectorTopOffset(allDay) } getCollectorLeftOffset() { return this.getPositioningStrategy().getCollectorLeftOffset() } getAppointmentDataCalculator() {} getVerticalAppointmentHeight(cellHeight, currentAppointmentCountInCell, maxAppointmentsPerCell) { let resultMaxAppointmentsPerCell = maxAppointmentsPerCell; if ((0, _type.isNumeric)(this.maxAppointmentsPerCell)) { const dynamicAppointmentCountPerCell = this._getDynamicAppointmentCountPerCell(); const maxAppointmentCountDisplayedInCell = dynamicAppointmentCountPerCell.allDay || dynamicAppointmentCountPerCell; const maxAppointmentsCount = Math.max(currentAppointmentCountInCell, maxAppointmentCountDisplayedInCell); resultMaxAppointmentsPerCell = Math.min(maxAppointmentsCount, maxAppointmentsPerCell) } return cellHeight / resultMaxAppointmentsPerCell } _customizeCoordinates(coordinates, cellHeight, appointmentCountPerCell, topOffset, isAllDay) { const { index: index, count: count } = coordinates; const appointmentHeight = this.getVerticalAppointmentHeight(cellHeight, count, appointmentCountPerCell); const appointmentTop = coordinates.top + index * appointmentHeight; const top = appointmentTop + topOffset; const { width: width } = coordinates; const { left: left } = coordinates; if (coordinates.isCompact) { this.isAdaptive && this._correctCollectorCoordinatesInAdaptive(coordinates, isAllDay); this._markAppointmentAsVirtual(coordinates, isAllDay) } return { height: appointmentHeight, width: width, top: top, left: left, empty: this._isAppointmentEmpty(cellHeight, width) } } _isAppointmentEmpty(height, width) { return height < this._getAppointmentMinHeight() || width < this._getAppointmentMinWidth() } _calculateGeometryConfig(coordinates) { const overlappingMode = this.maxAppointmentsPerCell; const offsets = this._getOffsets(); const appointmentDefaultOffset = this._getAppointmentDefaultOffset(); let appointmentCountPerCell = this._getAppointmentCount(overlappingMode, coordinates); let ratio = this._getDefaultRatio(coordinates, appointmentCountPerCell); let maxHeight = this._getMaxHeight(); if (!(0, _type.isNumeric)(appointmentCountPerCell)) { appointmentCountPerCell = coordinates.count; ratio = (maxHeight - offsets.unlimited) / maxHeight } let 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 } } _getAppointmentCount(overlappingMode, coordinates) {} _getDefaultRatio(coordinates, appointmentCountPerCell) {} _getOffsets() {} _getMaxHeight() {} _needVerifyItemSize() { return false } _getMaxAppointmentCountPerCell() { if (!this._maxAppointmentCountPerCell) { const overlappingMode = this.maxAppointmentsPerCell; let appointmentCountPerCell; 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 } _getDynamicAppointmentCountPerCell() { return this.getPositioningStrategy().getDynamicAppointmentCountPerCell() } allDaySupported() { return false } _isCompactTheme() { return "compact" === ((0, _themes.current)() || "").split(".").pop() } _getAppointmentDefaultOffset() { return this.getPositioningStrategy().getAppointmentDefaultOffset() } _getAppointmentDefaultHeight() { return this._getAppointmentHeightByTheme() } _getAppointmentMinHeight() { return this._getAppointmentDefaultHeight() } _getAppointmentHeightByTheme() { return this._isCompactTheme() ? 18 : 20 } _getAppointmentDefaultWidth() { return this.getPositioningStrategy()._getAppointmentDefaultWidth() } _getAppointmentMinWidth() { return this._getAppointmentDefaultWidth() } _needVerticalGroupBounds(allDay) { return false } _needHorizontalGroupBounds() { return false } getAppointmentDurationInMs(apptStartDate, apptEndDate, allDay) { if (allDay) { const appointmentDuration = apptEndDate.getTime() - apptStartDate.getTime(); const ceilQuantityOfDays = Math.ceil(appointmentDuration / toMs("day")); return ceilQuantityOfDays * this.visibleDayDuration } const msInHour = toMs("hour"); const trimmedStartDate = _date.default.trimTime(apptStartDate); const trimmedEndDate = _date.default.trimTime(apptEndDate); const deltaDate = trimmedEndDate - trimmedStartDate; const quantityOfDays = deltaDate / toMs("day") + 1; const dayVisibleHours = this.endDayHour - this.startDayHour; const appointmentDayHours = dayVisibleHours * quantityOfDays; const startHours = (apptStartDate - trimmedStartDate) / msInHour; const apptStartDelta = Math.max(0, startHours - this.startDayHour); const endHours = Math.max(0, (apptEndDate - trimmedEndDate) / msInHour - this.startDayHour); const apptEndDelta = Math.max(0, dayVisibleHours - endHours); const result = (appointmentDayHours - (apptStartDelta + apptEndDelta)) * msInHour; return result } getPositionShift(timeShift, isAllDay) { return { top: timeShift * this.cellHeight, left: 0, cellPosition: 0 } } shiftAppointmentByViewOffset(appointment) { const { viewOffset: viewOffset } = this.options; const startDateField = this.dataAccessors.expr.startDateExpr; const endDateField = this.dataAccessors.expr.endDateExpr; let startDate = new Date(_m_expression_utils.ExpressionUtils.getField(this.dataAccessors, "startDate", appointment)); startDate = _date2.dateUtilsTs.addOffsets(startDate, [-viewOffset]); let endDate = new Date(_m_expression_utils.ExpressionUtils.getField(this.dataAccessors, "endDate", appointment)); endDate = _date2.dateUtilsTs.addOffsets(endDate, [-viewOffset]); return _extends({}, appointment, { [startDateField]: startDate, [endDateField]: endDate }) } } }, 50323: /*!*****************************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/rendering_strategies/m_strategy_horizontal.js ***! \*****************************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198)); var _index = __webpack_require__( /*! ../../../scheduler/r1/utils/index */ 94084); var _m_expression_utils = __webpack_require__( /*! ../../m_expression_utils */ 30906); var _m_strategy_base = _interopRequireDefault(__webpack_require__( /*! ./m_strategy_base */ 64173)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const toMs = _date.default.dateToMilliseconds; class HorizontalRenderingStrategy extends _m_strategy_base.default { _needVerifyItemSize() { return true } calculateAppointmentWidth(appointment, position) { const cellWidth = this.cellWidth || this.getAppointmentMinSize(); const allDay = _m_expression_utils.ExpressionUtils.getField(this.dataAccessors, "allDay", appointment); const { startDate: startDate, endDate: endDate, normalizedEndDate: normalizedEndDate } = position.info.appointment; let duration = this.getAppointmentDurationInMs(startDate, normalizedEndDate, allDay); duration = this._adjustDurationByDaylightDiff(duration, startDate, normalizedEndDate); const cellDuration = this.cellDurationInMinutes * toMs("minute"); const skippedHours = (0, _index.getSkippedHoursInRange)(startDate, endDate, appointment.allDay, this.viewDataProvider); const durationInCells = (duration - skippedHours * toMs("hour")) / cellDuration; const width = this.cropAppointmentWidth(durationInCells * cellWidth, cellWidth); return width } _needAdjustDuration(diff) { return diff < 0 } getAppointmentGeometry(coordinates) { const result = this._customizeAppointmentGeometry(coordinates); return super.getAppointmentGeometry(result) } _customizeAppointmentGeometry(coordinates) { const config = this._calculateGeometryConfig(coordinates); return this._customizeCoordinates(coordinates, config.height, config.appointmentCountPerCell, config.offset) } _getOffsets() { return { unlimited: 0, auto: 0 } } _getCompactLeftCoordinate(itemLeft, index) { const cellWidth = this.cellWidth || this.getAppointmentMinSize(); return itemLeft + cellWidth * index } _getMaxHeight() { return this.cellHeight || this.getAppointmentMinSize() } _getAppointmentCount(overlappingMode, coordinates) { return this._getMaxAppointmentCountPerCellByType(false) } _getAppointmentDefaultHeight() { return 60 } _getAppointmentMinHeight() { return 35 } _sortCondition(a, b) { return this._columnCondition(a, b) } _getOrientation() { return ["left", "right", "top"] } getDropDownAppointmentWidth(intervalCount, isAllDay) { return this.cellWidth - 4 } getDeltaTime(args, initialSize) { let deltaTime = 0; const deltaWidth = args.width - initialSize.width; deltaTime = toMs("minute") * Math.round(deltaWidth / this.cellWidth * this.cellDurationInMinutes); return deltaTime } isAllDay(appointmentData) { return _m_expression_utils.ExpressionUtils.getField(this.dataAccessors, "allDay", appointmentData) } _isItemsCross(firstItem, secondItem) { const orientation = this._getOrientation(); return this._checkItemsCrossing(firstItem, secondItem, orientation) } getPositionShift(timeShift) { const positionShift = super.getPositionShift(timeShift); let left = this.cellWidth * timeShift; if (this.rtlEnabled) { left *= -1 } left += positionShift.left; return { top: 0, left: left, cellPosition: left } } supportCompactDropDownAppointments() { return false } } exports.default = HorizontalRenderingStrategy }, 92888: /*!***********************************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/rendering_strategies/m_strategy_horizontal_month.js ***! \***********************************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198)); var _m_position_helper = __webpack_require__( /*! ../../workspaces/helpers/m_position_helper */ 94654); var _m_strategy_horizontal_month_line = _interopRequireDefault(__webpack_require__( /*! ./m_strategy_horizontal_month_line */ 24049)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const toMs = _date.default.dateToMilliseconds; class HorizontalMonthRenderingStrategy extends _m_strategy_horizontal_month_line.default { get endViewDate() { return this.options.endViewDate } get adaptivityEnabled() { return this.options.adaptivityEnabled } get DOMMetaData() { return this.options.DOMMetaData } _getLeftPosition(settings) { const fullWeekAppointmentWidth = this.getGroupWidth(settings.groupIndex); return this._calculateMultiWeekAppointmentLeftOffset(settings.hMax, fullWeekAppointmentWidth) } _getChunkCount(fullChunksWidth, firstChunkWidth, weekWidth, settings) { const { groupIndex: groupIndex, info: { appointment: { startDate: startDate } } } = settings; const rawFullChunksWidth = fullChunksWidth - firstChunkWidth + weekWidth; const allChunksCount = Math.ceil(rawFullChunksWidth / weekWidth); const viewRowIndex = this._tryGetRowIndexInView(startDate); if (void 0 !== viewRowIndex) { const viewChunksCount = this.viewDataProvider.getRowCountInGroup(groupIndex); const allowedChunksCount = viewChunksCount - viewRowIndex; return allChunksCount <= allowedChunksCount ? allChunksCount : allowedChunksCount } return allChunksCount } _tryGetRowIndexInView(positionStartDate) { var _this$options$dataRan; const columnsCount = this.viewDataProvider.getColumnsCount(); if ((null === (_this$options$dataRan = this.options.dataRange) || void 0 === _this$options$dataRan ? void 0 : _this$options$dataRan.length) < 1 || !columnsCount) { return } const [startViewDate] = this.options.dateRange; const dayDurationMs = toMs("day"); const timeFromStart = positionStartDate.getTime() - startViewDate.getTime(); return Math.floor(timeFromStart / dayDurationMs / columnsCount) } _getChunkWidths(geometry, settings, weekWidth) { const firstChunkWidth = geometry.reducedWidth; const fullChunksWidth = Math.floor(geometry.sourceAppointmentWidth); const widthWithoutFirstChunk = fullChunksWidth - firstChunkWidth; return [firstChunkWidth, fullChunksWidth, widthWithoutFirstChunk] } _getTailChunkSettings(withoutFirstChunkWidth, weekWidth, leftPosition) { const tailChunkWidth = withoutFirstChunkWidth % weekWidth || weekWidth; const rtlPosition = leftPosition + (weekWidth - tailChunkWidth); const tailChunkLeftPosition = this.rtlEnabled ? rtlPosition : leftPosition; return [tailChunkWidth, tailChunkLeftPosition] } _getAppointmentParts(geometry, settings) { const result = []; const weekWidth = Math.round(this.getGroupWidth(settings.groupIndex)); const [firstChunkWidth, fullChunksWidth, withoutFirstChunkWidth] = this._getChunkWidths(geometry, settings, weekWidth); const leftPosition = this._getLeftPosition(settings); const { endDate: endDate } = settings.info.appointment; const hasTailChunk = this.endViewDate > endDate; const chunkCount = this._getChunkCount(fullChunksWidth, firstChunkWidth, weekWidth, settings); const [tailChunkWidth, tailChunkLeftPosition] = this._getTailChunkSettings(withoutFirstChunkWidth, weekWidth, leftPosition); for (let chunkIndex = 1; chunkIndex < chunkCount; chunkIndex++) { const topPosition = settings.top + this.cellHeight * chunkIndex; const isTailChunk = hasTailChunk && chunkIndex === chunkCount - 1; result.push(_extends({}, settings, { top: topPosition, left: isTailChunk ? tailChunkLeftPosition : leftPosition, height: geometry.height, width: isTailChunk ? tailChunkWidth : weekWidth, appointmentReduced: isTailChunk ? "tail" : "body", rowIndex: ++settings.rowIndex, columnIndex: 0 })) } return result } _calculateMultiWeekAppointmentLeftOffset(max, width) { return this.rtlEnabled ? max : max - width } getGroupWidth(groupIndex) { return (0, _m_position_helper.getGroupWidth)(groupIndex, this.viewDataProvider, { intervalCount: this.options.intervalCount, currentDate: this.options.currentDate, viewType: this.options.viewType, hoursInterval: this.options.hoursInterval, startDayHour: this.options.startDayHour, endDayHour: this.options.endDayHour, isVirtualScrolling: this.isVirtualScrolling, rtlEnabled: this.rtlEnabled, DOMMetaData: this.DOMMetaData }) } _getAppointmentDefaultHeight() { return this._getAppointmentHeightByTheme() } _getAppointmentMinHeight() { return this._getAppointmentDefaultHeight() } createTaskPositionMap(items) { return super.createTaskPositionMap(items, true) } _getSortedPositions(map) { return super._getSortedPositions(map, true) } _getDefaultRatio() { return .6 } _getOffsets() { return { unlimited: 26, auto: 30 } } getDropDownAppointmentWidth(intervalCount, isAllDay) { if (this.adaptivityEnabled) { return this.getDropDownButtonAdaptiveSize() } const offset = intervalCount > 1 ? 60 : 36; return this.cellWidth - offset } needCorrectAppointmentDates() { return false } _needVerticalGroupBounds() { return false } _needHorizontalGroupBounds() { return true } } exports.default = HorizontalMonthRenderingStrategy }, 24049: /*!****************************************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/rendering_strategies/m_strategy_horizontal_month_line.js ***! \****************************************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198)); var _query = _interopRequireDefault(__webpack_require__( /*! ../../../../data/query */ 96687)); var _m_utils = __webpack_require__( /*! ../data_provider/m_utils */ 55523); var _m_strategy_horizontal = _interopRequireDefault(__webpack_require__( /*! ./m_strategy_horizontal */ 50323)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } class HorizontalMonthLineRenderingStrategy extends _m_strategy_horizontal.default { calculateAppointmentWidth(_, position) { const { startDate: startDateWithTime, normalizedEndDate: normalizedEndDate } = position.info.appointment; const startDate = _date.default.trimTime(startDateWithTime); const cellWidth = this.cellWidth || this.getAppointmentMinSize(); const duration = Math.ceil(this._getDurationInDays(startDate, normalizedEndDate)); let width = this.cropAppointmentWidth(duration * cellWidth, cellWidth); if (this.isVirtualScrolling) { const skippedDays = this.viewDataProvider.getSkippedDaysCount(position.groupIndex, startDate, normalizedEndDate, duration); width -= skippedDays * cellWidth } return width } _columnCondition(a, b) { const conditions = this._getConditions(a, b); return conditions.rowCondition || conditions.columnCondition || conditions.cellPositionCondition } _getDurationInDays(startDate, endDate) { const adjustedDuration = this._adjustDurationByDaylightDiff(endDate.getTime() - startDate.getTime(), startDate, endDate); return adjustedDuration / _date.default.dateToMilliseconds("day") || 1 } getDeltaTime(args, initialSize) { return 864e5 * this._getDeltaWidth(args, initialSize) } isAllDay() { return false } createTaskPositionMap(items, skipSorting) { if (!skipSorting) { (0, _m_utils.sortAppointmentsByStartDate)(items, this.dataAccessors) } return super.createTaskPositionMap(items) } _getSortedPositions(map, skipSorting) { let result = super._getSortedPositions(map); if (!skipSorting) { result = (0, _query.default)(result).sortBy("top").thenBy("left").thenBy("cellPosition").thenBy("i").toArray() } return result } needCorrectAppointmentDates() { return false } getPositionShift(timeShift) { return { top: 0, left: 0, cellPosition: timeShift * this.cellWidth } } } exports.default = HorizontalMonthLineRenderingStrategy }, 20523: /*!***************************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/rendering_strategies/m_strategy_vertical.js ***! \***************************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198)); var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _math = __webpack_require__( /*! ../../../../core/utils/math */ 60810); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _index = __webpack_require__( /*! ../../../scheduler/r1/utils/index */ 94084); var _m_appointment_adapter = __webpack_require__( /*! ../../m_appointment_adapter */ 72734); var _m_expression_utils = __webpack_require__( /*! ../../m_expression_utils */ 30906); var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../../m_utils_time_zone */ 57880)); var _m_strategy_base = _interopRequireDefault(__webpack_require__( /*! ./m_strategy_base */ 64173)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const toMs = _date.default.dateToMilliseconds; class VerticalRenderingStrategy extends _m_strategy_base.default { getDeltaTime(args, initialSize, appointment) { let deltaTime = 0; if (this.isAllDay(appointment)) { deltaTime = this._getDeltaWidth(args, initialSize) * toMs("day") } else { const deltaHeight = args.height - initialSize.height; deltaTime = toMs("minute") * Math.round(deltaHeight / this.cellHeight * this.cellDurationInMinutes) } return deltaTime } _correctCollectorCoordinatesInAdaptive(coordinates, isAllDay) { if (isAllDay) { super._correctCollectorCoordinatesInAdaptive(coordinates, isAllDay) } else if (0 === this._getMaxAppointmentCountPerCellByType()) { const { cellHeight: cellHeight } = this; const { cellWidth: cellWidth } = this; coordinates.top += (cellHeight - this.getDropDownButtonAdaptiveSize()) / 2; coordinates.left += (cellWidth - this.getDropDownButtonAdaptiveSize()) / 2 } } getAppointmentGeometry(coordinates) { let geometry = null; if (coordinates.allDay) { geometry = this._getAllDayAppointmentGeometry(coordinates) } else { geometry = this.isAdaptive && coordinates.isCompact ? this._getAdaptiveGeometry(coordinates) : this._getVerticalAppointmentGeometry(coordinates) } return super.getAppointmentGeometry(geometry) } _getAdaptiveGeometry(coordinates) { const config = this._calculateGeometryConfig(coordinates); return this._customizeCoordinates(coordinates, config.height, config.appointmentCountPerCell, config.offset) } _getItemPosition(initialAppointment) { const allDay = this.isAllDay(initialAppointment); if (allDay) { return super._getItemPosition(initialAppointment) } const appointment = super.shiftAppointmentByViewOffset(initialAppointment); const adapter = (0, _m_appointment_adapter.createAppointmentAdapter)(appointment, this.dataAccessors, this.timeZoneCalculator); const isRecurring = !!adapter.recurrenceRule; const appointmentStartDate = adapter.calculateStartDate("toGrid"); const appointmentEndDate = adapter.calculateEndDate("toGrid"); const appointmentDuration = appointmentEndDate - appointmentStartDate; const appointmentBeginInCurrentView = this.options.startViewDate < appointmentStartDate; const isAppointmentTakesSeveralDays = !_m_utils_time_zone.default.isSameAppointmentDates(appointmentStartDate, appointmentEndDate); const settings = this.generateAppointmentSettings(appointment); let result = []; for (let j = 0; j < settings.length; j++) { const currentSetting = settings[j]; const height = this.calculateAppointmentHeight(appointment, currentSetting); const width = this.calculateAppointmentWidth(appointment, currentSetting); let resultHeight = height; let appointmentReduced = null; let multiDaysAppointmentParts = []; const currentMaxAllowedPosition = currentSetting.vMax; if (this._isMultiViewAppointment(currentSetting, height) || isAppointmentTakesSeveralDays && !isRecurring) { const trimmedStartDate = _date.default.trimTime(appointmentStartDate); const trimmedSettingStartDate = _date.default.trimTime(currentSetting.info.appointment.startDate); const reduceHead = trimmedStartDate <= trimmedSettingStartDate || isRecurring; if (reduceHead) { resultHeight = this._reduceMultiDayAppointment(height, { top: currentSetting.top, bottom: currentMaxAllowedPosition }); multiDaysAppointmentParts = this._getAppointmentParts({ sourceAppointmentHeight: height, reducedHeight: resultHeight, width: width }, currentSetting) } const { startDate: currentSettingStartDate, normalizedEndDate: currentSettingNormalizedEndDate } = currentSetting.info.appointment; const currentSettingDuration = currentSettingNormalizedEndDate - currentSettingStartDate; const hasNextParts = currentSettingDuration < appointmentDuration; appointmentReduced = hasNextParts ? appointmentBeginInCurrentView ? "head" : "body" : appointmentBeginInCurrentView ? "head" : "tail" }(0, _extend.extend)(currentSetting, { height: resultHeight, width: width, allDay: allDay, appointmentReduced: appointmentReduced }); result = this._getAppointmentPartsPosition(multiDaysAppointmentParts, currentSetting, result) } return result } _isMultiViewAppointment(_ref, height) { let { vMax: vMax, top: top } = _ref; const fullAppointmentHeight = (0, _math.roundFloatPart)(height, 2); const remainingHeight = (0, _math.roundFloatPart)(vMax - top, 2); return fullAppointmentHeight > remainingHeight } _reduceMultiDayAppointment(sourceAppointmentHeight, bound) { return Math.min(sourceAppointmentHeight, bound.bottom - Math.floor(bound.top)) } _getGroupHeight() { return this.cellHeight * this.rowCount } _getGroupTopOffset(appointmentSettings) { const { groupIndex: groupIndex } = appointmentSettings; const groupTop = Math.max(0, this.positionHelper.getGroupTop({ groupIndex: groupIndex, showAllDayPanel: this.showAllDayPanel, isGroupedAllDayPanel: this.isGroupedAllDayPanel })); const allDayPanelOffset = this.positionHelper.getOffsetByAllDayPanel({ groupIndex: groupIndex, supportAllDayRow: this.allDaySupported(), showAllDayPanel: this.showAllDayPanel }); const appointmentGroupTopOffset = appointmentSettings.top - groupTop - allDayPanelOffset; return appointmentGroupTopOffset } _getTailHeight(appointmentGeometry, appointmentSettings) { if (!this.isVirtualScrolling) { return appointmentGeometry.sourceAppointmentHeight - appointmentGeometry.reducedHeight } const appointmentGroupTopOffset = this._getGroupTopOffset(appointmentSettings); const { sourceAppointmentHeight: sourceAppointmentHeight } = appointmentGeometry; const groupHeight = this._getGroupHeight(); const tailHeight = appointmentGroupTopOffset + sourceAppointmentHeight - groupHeight; return tailHeight } _getAppointmentParts(appointmentGeometry, appointmentSettings) { const { width: width } = appointmentGeometry; const result = []; let currentPartTop = Math.max(0, this.positionHelper.getGroupTop({ groupIndex: appointmentSettings.groupIndex, showAllDayPanel: this.showAllDayPanel, isGroupedAllDayPanel: this.isGroupedAllDayPanel })); const cellsDiff = this.isGroupedByDate ? this.groupCount : 1; const offset = this.cellWidth * cellsDiff; const allDayPanelOffset = this.positionHelper.getOffsetByAllDayPanel({ groupIndex: appointmentSettings.groupIndex, supportAllDayRow: this.allDaySupported(), showAllDayPanel: this.showAllDayPanel }); currentPartTop += allDayPanelOffset; const minHeight = this.getAppointmentMinSize(); const { hMax: hMax, vMax: vMax, vMin: vMin } = appointmentSettings; const maxHeight = this.isVirtualScrolling ? vMax : vMax - vMin; const hasTailPart = this.options.endViewDate > appointmentSettings.info.appointment.endDate; let left = Math.round(appointmentSettings.left + offset); let tailHeight = this._getTailHeight(appointmentGeometry, appointmentSettings); let { columnIndex: columnIndex } = appointmentSettings; while (tailHeight > 0 && left < hMax) { tailHeight = Math.max(minHeight, tailHeight); columnIndex += cellsDiff; const height = Math.min(tailHeight, maxHeight); result.push(_extends({}, appointmentSettings, { top: currentPartTop, left: left, height: height, width: width, appointmentReduced: "body", rowIndex: 0, columnIndex: columnIndex })); left += offset; tailHeight -= maxHeight } if (hasTailPart && result.length > 0) { result[result.length - 1].appointmentReduced = "tail" } return result } _getMinuteHeight() { return this.cellHeight / this.cellDurationInMinutes } _getCompactLeftCoordinate(itemLeft, index) { const cellWidth = this.cellWidth || this.getAppointmentMinSize(); return itemLeft + (1 + cellWidth) * index } _getVerticalAppointmentGeometry(coordinates) { const config = this._calculateVerticalGeometryConfig(coordinates); return this._customizeVerticalCoordinates(coordinates, config.width, config.appointmentCountPerCell, config.offset) } _customizeVerticalCoordinates(coordinates, width, appointmentCountPerCell, topOffset, isAllDay) { const appointmentWidth = Math.max(width / appointmentCountPerCell, width / coordinates.count); const { height: height } = coordinates; const appointmentLeft = coordinates.left + coordinates.index * appointmentWidth; const { top: top } = coordinates; if (coordinates.isCompact) { this._markAppointmentAsVirtual(coordinates, isAllDay) } return { height: height, width: appointmentWidth, top: top, left: appointmentLeft, empty: this._isAppointmentEmpty(height, width) } } _calculateVerticalGeometryConfig(coordinates) { const overlappingMode = this.maxAppointmentsPerCell; const offsets = this._getOffsets(); const appointmentDefaultOffset = this._getAppointmentDefaultOffset(); let appointmentCountPerCell = this._getAppointmentCount(overlappingMode, coordinates); let ratio = this._getDefaultRatio(coordinates, appointmentCountPerCell); let maxWidth = this._getMaxWidth(); if (!appointmentCountPerCell) { appointmentCountPerCell = coordinates.count; ratio = (maxWidth - offsets.unlimited) / maxWidth } let topOffset = (1 - ratio) * maxWidth; if ("auto" === overlappingMode || (0, _type.isNumeric)(overlappingMode)) { ratio = 1; maxWidth -= appointmentDefaultOffset; topOffset = 0 } return { width: ratio * maxWidth, appointmentCountPerCell: appointmentCountPerCell, offset: topOffset } } _getMaxWidth() { return this.cellWidth } isAllDay(appointmentData) { return (0, _index.getAppointmentTakesAllDay)((0, _m_appointment_adapter.createAppointmentAdapter)(appointmentData, this.dataAccessors, this.timeZoneCalculator), this.allDayPanelMode) } _getAppointmentMaxWidth() { return this.cellWidth - this._getAppointmentDefaultOffset() } calculateAppointmentWidth(appointment, position) { if (!this.isAllDay(appointment)) { return 0 } const { startDate: startDateWithTime, endDate: endDate, normalizedEndDate: normalizedEndDate } = position.info.appointment; const startDate = _date.default.trimTime(startDateWithTime); const cellWidth = this.cellWidth || this.getAppointmentMinSize(); const durationInHours = (normalizedEndDate.getTime() - startDate.getTime()) / toMs("hour"); const skippedHours = (0, _index.getSkippedHoursInRange)(startDate, endDate, appointment.allDay, this.viewDataProvider); let width = Math.ceil((durationInHours - skippedHours) / 24) * cellWidth; width = this.cropAppointmentWidth(width, cellWidth); return width } calculateAppointmentHeight(appointment, position) { if (this.isAllDay(appointment)) { return 0 } const { startDate: startDate, normalizedEndDate: normalizedEndDate } = position.info.appointment; const allDay = _m_expression_utils.ExpressionUtils.getField(this.dataAccessors, "allDay", appointment); const duration = this.getAppointmentDurationInMs(startDate, normalizedEndDate, allDay); const skippedMinutes = 60 * (0, _index.getSkippedHoursInRange)(startDate, normalizedEndDate, appointment.allDay, this.viewDataProvider); const durationInMinutes = this._adjustDurationByDaylightDiff(duration, startDate, normalizedEndDate) / toMs("minute") - skippedMinutes; const height = durationInMinutes * this._getMinuteHeight(); return height } getDirection() { return "vertical" } _sortCondition(a, b) { if (!!a.allDay !== !!b.allDay) { return a.allDay ? 1 : -1 } const isAllDay = a.allDay && b.allDay; return "vertical" === this.groupOrientation && isAllDay ? this._columnCondition(a, b) : this._rowCondition(a, b) } allDaySupported() { return true } _getAllDayAppointmentGeometry(coordinates) { const config = this._calculateGeometryConfig(coordinates); return this._customizeCoordinates(coordinates, config.height, config.appointmentCountPerCell, config.offset, true) } _calculateGeometryConfig(coordinates) { if (!this.allowResizing || !this.allowAllDayResizing) { coordinates.skipResizing = true } const config = super._calculateGeometryConfig(coordinates); const minAppointmentCountPerCell = Math.min(config.appointmentCountPerCell, this._getDynamicAppointmentCountPerCell().allDay); if (coordinates.allDay && coordinates.count <= minAppointmentCountPerCell) { config.offset = 0 } return config } _getAppointmentCount(overlappingMode, coordinates) { return "auto" !== overlappingMode && 1 === coordinates.count && !(0, _type.isNumeric)(overlappingMode) ? coordinates.count : this._getMaxAppointmentCountPerCellByType(coordinates.allDay) } _getDefaultRatio(coordinates, appointmentCountPerCell) { return coordinates.count > this.appointmentCountPerCell ? .65 : 1 } _getOffsets() { return { unlimited: 5, auto: 20 } } _getMaxHeight() { return this.allDayHeight || this.getAppointmentMinSize() } _needVerticalGroupBounds(allDay) { return !allDay } _needHorizontalGroupBounds() { return false } getPositionShift(timeShift, isAllDay) { if (!isAllDay && this.isAdaptive && 0 === this._getMaxAppointmentCountPerCellByType(isAllDay)) { return { top: 0, left: 0, cellPosition: 0 } } return super.getPositionShift(timeShift, isAllDay) } } exports.default = VerticalRenderingStrategy }, 25410: /*!***********************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/rendering_strategies/m_strategy_week.js ***! \***********************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _m_strategy_vertical = (obj = __webpack_require__( /*! ./m_strategy_vertical */ 20523), obj && obj.__esModule ? obj : { default: obj }); var obj; class WeekAppointmentRenderingStrategy extends _m_strategy_vertical.default { isApplyCompactAppointmentOffset() { if (this.isAdaptive && 0 === this._getMaxAppointmentCountPerCellByType()) { return false } return this.supportCompactDropDownAppointments() } } exports.default = WeekAppointmentRenderingStrategy }, 71687: /*!**************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/appointments/resizing/m_core.js ***! \**************************************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.getAppointmentDateRange = void 0; function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const getAppointmentLeftCell = options => { const { cellHeight: cellHeight, cellWidth: cellWidth, viewDataProvider: viewDataProvider, relativeAppointmentRect: relativeAppointmentRect, appointmentSettings: appointmentSettings, rtlEnabled: rtlEnabled } = options; const cellRowIndex = Math.floor(relativeAppointmentRect.top / cellHeight); const cellColumnIndex = Math.round(relativeAppointmentRect.left / cellWidth); const leftCell = viewDataProvider.getCellData(cellRowIndex, cellColumnIndex, appointmentSettings.allDay, rtlEnabled); return leftCell }; exports.getAppointmentDateRange = options => { const { appointmentSettings: appointmentSettings } = options; const relativeAppointmentRect = ((appointmentRect, parentAppointmentRect) => { const left = appointmentRect.left - parentAppointmentRect.left; const top = appointmentRect.top - parentAppointmentRect.top; const width = left < 0 ? appointmentRect.width + left : appointmentRect.width; const height = top < 0 ? appointmentRect.height + top : appointmentRect.height; return { left: Math.max(0, left), top: Math.max(0, top), width: width, height: height } })(options.appointmentRect, options.parentAppointmentRect); const cellInfo = (options => { const { appointmentSettings: appointmentSettings, isVerticalGroupedWorkSpace: isVerticalGroupedWorkSpace, DOMMetaData: DOMMetaData } = options; const DOMMetaTable = appointmentSettings.allDay && !isVerticalGroupedWorkSpace ? [DOMMetaData.allDayPanelCellsMeta] : DOMMetaData.dateTableCellsMeta; const { positionByMap: positionByMap } = appointmentSettings; const { height: cellHeight, width: cellWidth } = DOMMetaTable[positionByMap.rowIndex][positionByMap.columnIndex]; const cellCountInRow = DOMMetaTable[positionByMap.rowIndex].length; return { cellWidth: cellWidth, cellHeight: cellHeight, cellCountInRow: cellCountInRow } })(options); const considerTime = !options.isDateAndTimeView || appointmentSettings.allDay; const extendedOptions = _extends({}, options, cellInfo, { considerTime: considerTime, relativeAppointmentRect: relativeAppointmentRect }); return !options.rtlEnabled ? (options => { const { cellWidth: cellWidth, cellCountInRow: cellCountInRow, relativeAppointmentRect: relativeAppointmentRect, viewDataProvider: viewDataProvider, appointmentSettings: appointmentSettings, handles: handles } = options; const appointmentFirstCell = getAppointmentLeftCell(options); const appointmentCellsAmount = Math.round(relativeAppointmentRect.width / cellWidth); const appointmentLastCellIndex = appointmentFirstCell.index + (appointmentCellsAmount - 1); const { sourceAppointment: sourceAppointment } = appointmentSettings.info; const { allDay: allDay } = appointmentSettings.info.appointment; if (handles.left) { return { startDate: appointmentFirstCell.startDate, endDate: appointmentFirstCell.startDate > sourceAppointment.endDate ? appointmentFirstCell.startDate : sourceAppointment.endDate } } const appointmentRowIndex = Math.floor(appointmentLastCellIndex / cellCountInRow); const appointmentColumnIndex = appointmentLastCellIndex % cellCountInRow; const appointmentLastCell = viewDataProvider.getCellData(appointmentRowIndex, appointmentColumnIndex, allDay); const endDate = !options.considerTime ? appointmentLastCell.endDate : appointmentLastCell.startDate; return { startDate: endDate < sourceAppointment.startDate ? endDate : sourceAppointment.startDate, endDate: endDate } })(extendedOptions) : (options => { const { viewDataProvider: viewDataProvider, cellCountInRow: cellCountInRow, appointmentSettings: appointmentSettings, handles: handles, cellWidth: cellWidth, relativeAppointmentRect: relativeAppointmentRect } = options; const appointmentLastCell = getAppointmentLeftCell(options); const { sourceAppointment: sourceAppointment } = appointmentSettings.info; const { allDay: allDay } = appointmentSettings.info.appointment; if (handles.right) { const appointmentLastCellIndex = appointmentLastCell.index; const appointmentCellsAmount = Math.round(relativeAppointmentRect.width / cellWidth); const appointmentFirstCellIndex = appointmentLastCellIndex - appointmentCellsAmount + 1; const appointmentRowIndex = Math.floor(appointmentLastCellIndex / cellCountInRow); const appointmentFirstCell = viewDataProvider.getCellData(appointmentRowIndex, appointmentFirstCellIndex, allDay, true); return { startDate: appointmentFirstCell.startDate, endDate: appointmentFirstCell.startDate > sourceAppointment.endDate ? appointmentFirstCell.startDate : sourceAppointment.endDate } } const endDate = !options.considerTime ? appointmentLastCell.endDate : appointmentLastCell.startDate; return { startDate: endDate < sourceAppointment.startDate ? endDate : sourceAppointment.startDate, endDate: endDate } })(extendedOptions) } }, 79427: /*!********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/base/m_widget_observer.js ***! \********************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _ui = (obj = __webpack_require__( /*! ../../../ui/widget/ui.widget */ 14390), obj && obj.__esModule ? obj : { default: obj }); var obj; class WidgetObserver extends _ui.default { notifyObserver(subject, args) { const observer = this.option("observer"); if (observer) { observer.fire(subject, args) } } invoke() { const observer = this.option("observer"); if (observer) { return observer.fire.apply(observer, arguments) } } } exports.default = WidgetObserver }, 20332: /*!***************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/header/m_calendar.js ***! \***************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 99393)); var _devices = _interopRequireDefault(__webpack_require__( /*! ../../../core/devices */ 20530)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374)); var _calendar = _interopRequireDefault(__webpack_require__( /*! ../../../ui/calendar */ 26559)); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../ui/popover/ui.popover */ 17287)); var _ui2 = _interopRequireDefault(__webpack_require__( /*! ../../../ui/popup/ui.popup */ 51495)); var _ui3 = _interopRequireDefault(__webpack_require__( /*! ../../../ui/scroll_view/ui.scrollable */ 41183)); var _ui4 = _interopRequireDefault(__webpack_require__( /*! ../../../ui/widget/ui.widget */ 14390)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } class SchedulerCalendar extends _ui4.default { show(target) { if (!this._isMobileLayout()) { this._overlay.option("target", target) } this._overlay.show() } hide() { this._overlay.hide() } _keyboardHandler(opts) { var _this$_calendar; null === (_this$_calendar = this._calendar) || void 0 === _this$_calendar || _this$_calendar._keyboardHandler(opts) } _init() { super._init(); this.$element() } _render() { super._render(); this._renderOverlay() } _renderOverlay() { this.$element().addClass("dx-scheduler-navigator-calendar-popover"); const isMobileLayout = this._isMobileLayout(); const overlayType = isMobileLayout ? _ui2.default : _ui.default; this._overlay = this._createComponent(this.$element(), overlayType, { contentTemplate: () => this._createOverlayContent(), onShown: () => this._calendar.focus(), defaultOptionsRules: [{ device: () => isMobileLayout, options: { fullScreen: true, showCloseButton: false, toolbarItems: [{ shortcut: "cancel" }], _ignorePreventScrollEventsDeprecation: true, preventScrollEvents: false, enableBodyScroll: false } }] }) } _createOverlayContent() { const result = (0, _renderer.default)("
").addClass("dx-scheduler-navigator-calendar"); this._calendar = this._createComponent(result, _calendar.default, this._getCalendarOptions()); if (this._isMobileLayout()) { const scrollable = this._createScrollable(result); return scrollable.$element() } return result } _createScrollable(content) { const result = this._createComponent("
", _ui3.default, { height: "auto", direction: "both" }); result.$content().append(content); return result } _optionChanged(_ref) { var _this$_calendar2; let { name: name, value: value } = _ref; if ("value" === name) { null === (_this$_calendar2 = this._calendar) || void 0 === _this$_calendar2 || _this$_calendar2.option("value", value) } } _getCalendarOptions() { return { value: this.option("value"), min: this.option("min"), max: this.option("max"), firstDayOfWeek: this.option("firstDayOfWeek"), focusStateEnabled: this.option("focusStateEnabled"), onValueChanged: this.option("onValueChanged"), skipFocusCheck: true, tabIndex: this.option("tabIndex") } } _isMobileLayout() { return !_devices.default.current().generic } } exports.default = SchedulerCalendar; (0, _component_registrator.default)("dxSchedulerCalendarPopup", SchedulerCalendar) }, 76310: /*!*********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/header/m_date_navigator.js ***! \*********************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.getDateNavigator = void 0; var _date = (obj = __webpack_require__( /*! ../../../core/utils/date */ 91198), obj && obj.__esModule ? obj : { default: obj }); var obj; var _themes = __webpack_require__( /*! ../../../ui/themes */ 75811); function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const { trimTime: trimTime } = _date.default; exports.getDateNavigator = (header, item) => { const items = [getPreviousButtonOptions(header), getCalendarButtonOptions(header), getNextButtonOptions(header)]; const stylingMode = (0, _themes.isMaterialBased)() ? "text" : "contained"; return _extends({ widget: "dxButtonGroup", cssClass: "dx-scheduler-navigator", options: { items: items, stylingMode: stylingMode, selectionMode: "none", onItemClick: e => { e.itemData.clickHandler(e) } } }, item) }; const getPreviousButtonOptions = header => ({ key: "previous", icon: "chevronprev", elementAttr: { class: "dx-scheduler-navigator-previous" }, clickHandler: () => header._updateDateByDirection(-1), onContentReady: e => { const previousButton = e.component; previousButton.option("disabled", isPreviousButtonDisabled(header)); header._addEvent("min", (() => { previousButton.option("disabled", isPreviousButtonDisabled(header)) })); header._addEvent("currentDate", (() => { previousButton.option("disabled", isPreviousButtonDisabled(header)) })); header._addEvent("startViewDate", (() => { previousButton.option("disabled", isPreviousButtonDisabled(header)) })) } }); const getCalendarButtonOptions = header => ({ key: "calendar", text: header.captionText, elementAttr: { class: "dx-scheduler-navigator-caption" }, clickHandler: e => header._showCalendar(e), onContentReady: e => { const calendarButton = e.component; header._addEvent("currentView", (() => { calendarButton.option("text", header.captionText) })); header._addEvent("currentDate", (() => { calendarButton.option("text", header.captionText) })); header._addEvent("startViewDate", (() => { calendarButton.option("text", header.captionText) })); header._addEvent("views", (() => { calendarButton.option("text", header.captionText) })); header._addEvent("firstDayOfWeek", (() => { calendarButton.option("text", header.captionText) })) } }); const getNextButtonOptions = header => ({ key: "next", icon: "chevronnext", elementAttr: { class: "dx-scheduler-navigator-next" }, clickHandler: () => header._updateDateByDirection(1), onContentReady: e => { const nextButton = e.component; nextButton.option("disabled", isNextButtonDisabled(header)); header._addEvent("min", (() => { nextButton.option("disabled", isNextButtonDisabled(header)) })); header._addEvent("currentDate", (() => { nextButton.option("disabled", isNextButtonDisabled(header)) })); header._addEvent("startViewDate", (() => { nextButton.option("disabled", isNextButtonDisabled(header)) })) } }); const isPreviousButtonDisabled = header => { let min = header.option("min"); if (!min) { return false } min = new Date(min); const caption = header._getCaption(); min = trimTime(min); const previousDate = header._getNextDate(-1, caption.endDate); return previousDate < min }; const isNextButtonDisabled = header => { let max = header.option("max"); if (!max) { return false } max = new Date(max); const caption = header._getCaption(); max = max.setHours(23, 59, 59); const nextDate = header._getNextDate(1, caption.startDate); return nextDate > max } }, 5757: /*!*************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/header/m_header.js ***! \*************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.SchedulerHeader = void 0; __webpack_require__( /*! ../../../ui/button_group */ 28236); __webpack_require__( /*! ../../../ui/drop_down_button */ 45231); var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 99393)); var _devices = _interopRequireDefault(__webpack_require__( /*! ../../../core/devices */ 20530)); var _errors = _interopRequireDefault(__webpack_require__( /*! ../../../core/errors */ 17381)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374)); var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198)); var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306); var _toolbar = _interopRequireDefault(__webpack_require__( /*! ../../../ui/toolbar */ 71042)); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../ui/widget/ui.widget */ 14390)); var _index = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084); var _m_calendar = _interopRequireDefault(__webpack_require__( /*! ./m_calendar */ 20332)); var _m_date_navigator = __webpack_require__( /*! ./m_date_navigator */ 76310); var _m_utils = __webpack_require__( /*! ./m_utils */ 31047); var _m_view_switcher = __webpack_require__( /*! ./m_view_switcher */ 93327); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } class SchedulerHeader extends _ui.default { get views() { return this.option("views") } get captionText() { return this._getCaption().text } get intervalOptions() { const step = (0, _m_utils.getStep)(this.currentView); const intervalCount = this.option("intervalCount"); const firstDayOfWeek = this.option("firstDayOfWeek"); const agendaDuration = this.option("agendaDuration"); return { step: step, intervalCount: intervalCount, firstDayOfWeek: firstDayOfWeek, agendaDuration: agendaDuration } } _getDefaultOptions() { return (0, _extend.extend)(super._getDefaultOptions(), { _useShortDateFormat: !_devices.default.real().generic || _devices.default.isSimulator() }) } _createEventMap() { this.eventMap = new Map([ ["currentView", [view => { this.currentView = _index.viewsUtils.getCurrentView((0, _m_utils.getViewName)(view), this.option("views")) }]], ["items", [this.repaint.bind(this)]], ["views", [_m_utils.validateViews]], ["currentDate", [this._getCalendarOptionUpdater("value")]], ["min", [this._getCalendarOptionUpdater("min")]], ["max", [this._getCalendarOptionUpdater("max")]], ["tabIndex", [this.repaint.bind(this)]], ["focusStateEnabled", [this.repaint.bind(this)]], ["useDropDownViewSwitcher", [this.repaint.bind(this)]] ]) } _addEvent(name, event) { if (!this.eventMap.has(name)) { this.eventMap.set(name, []) } const events = this.eventMap.get(name); this.eventMap.set(name, [...events, event]) } _optionChanged(args) { const { name: name, value: value } = args; if (this.eventMap.has(name)) { const events = this.eventMap.get(name); events.forEach((event => { event(value) })) } } _init() { super._init(); this._createEventMap(); this.$element().addClass("dx-scheduler-header"); this.currentView = _index.viewsUtils.getCurrentView((0, _m_utils.getViewName)(this.option("currentView")), this.option("views")) } _render() { super._render(); this._createEventMap(); this._renderToolbar() } _renderToolbar() { const config = this._createToolbarConfig(); const toolbarElement = (0, _renderer.default)("
"); toolbarElement.appendTo(this.$element()); this._toolbar = this._createComponent(toolbarElement, _toolbar.default, config) } _createToolbarConfig() { const items = this.option("items"); const parsedItems = items.map((element => this._parseItem(element))); return { items: parsedItems } } _parseItem(item) { const isDefaultElement = this._isDefaultItem(item); if (isDefaultElement) { const defaultElementType = item.defaultElement; switch (defaultElementType) { case "viewSwitcher": if (this.option("useDropDownViewSwitcher")) { return (0, _m_view_switcher.getDropDownViewSwitcher)(this, item) } return (0, _m_view_switcher.getViewSwitcher)(this, item); case "dateNavigator": this._renderCalendar(); return (0, _m_date_navigator.getDateNavigator)(this, item); default: _errors.default.log(`Unknown default element type: ${defaultElementType}`) } } return item } _callEvent(event, arg) { if (this.eventMap.has(event)) { const events = this.eventMap.get(event); events.forEach((event => event(arg))) } } _updateCurrentView(view) { const onCurrentViewChange = this.option("onCurrentViewChange"); onCurrentViewChange(view.name); this._callEvent("currentView", view) } _updateCalendarValueAndCurrentDate(date) { this._updateCurrentDate(date); this._calendar.option("value", date) } _updateCurrentDate(date) { const onCurrentDateChange = this.option("onCurrentDateChange"); onCurrentDateChange(date); this._callEvent("currentDate", date) } _renderCalendar() { this._calendar = this._createComponent("
", _m_calendar.default, { value: this.option("currentDate"), min: this.option("min"), max: this.option("max"), firstDayOfWeek: this.option("firstDayOfWeek"), focusStateEnabled: this.option("focusStateEnabled"), tabIndex: this.option("tabIndex"), onValueChanged: e => { this._updateCurrentDate(e.value); this._calendar.hide() } }); this._calendar.$element().appendTo(this.$element()) } _getCalendarOptionUpdater(name) { return value => { if (this._calendar) { this._calendar.option(name, value) } } } _getNextDate(direction) { let initialDate = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null; const date = initialDate ?? this.option("currentDate"); const options = _extends({}, this.intervalOptions, { date: date }); return (0, _m_utils.getNextIntervalDate)(options, direction) } _isMonth() { const { currentView: currentView } = this; return "month" === (0, _m_utils.getViewType)(currentView) } _getDisplayedDate() { const startViewDate = this.option("startViewDate"); if (this._isMonth()) { return (0, _m_utils.nextWeek)(startViewDate) } return new Date(startViewDate) } _getCaption() { let date = this.option("currentDate"); if (this.option("startViewDate")) { date = this._getDisplayedDate() } date = _date.default.trimTime(date); const options = _extends({}, this.intervalOptions, { date: date }); const customizationFunction = this.option("customizeDateNavigatorText"); const useShortDateFormat = this.option("_useShortDateFormat"); return (0, _m_utils.getCaption)(options, useShortDateFormat, customizationFunction) } _updateDateByDirection(direction) { const date = this._getNextDate(direction); this._updateCalendarValueAndCurrentDate(date) } _showCalendar(e) { this._calendar.show(e.element) } _hideCalendar() { this._calendar.hide() } _isDefaultItem(item) { return Object.prototype.hasOwnProperty.call(item, "defaultElement") } } exports.SchedulerHeader = SchedulerHeader; (0, _component_registrator.default)("dxSchedulerHeader", SchedulerHeader) }, 31047: /*!************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/header/m_utils.js ***! \************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.validateViews = exports.nextWeek = exports.isOneView = exports.getViewType = exports.getViewText = exports.getViewName = exports.getStep = exports.getNextIntervalDate = exports.getCaption = exports.formatViews = void 0; var _errors = _interopRequireDefault(__webpack_require__( /*! ../../../core/errors */ 17381)); var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198)); var _inflector = __webpack_require__( /*! ../../../core/utils/inflector */ 78008); var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922); var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../../localization/date */ 91500)); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../localization/message */ 28109)); var _m_constants = __webpack_require__( /*! ../m_constants */ 6324); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const { correctDateWithUnitBeginning: getPeriodStart, getFirstWeekDate: getWeekStart, getLastMonthDay: getLastMonthDay, addDateInterval: addDateInterval } = _date.default; const { format: formatDate } = _date2.default; const MS_DURATION = { milliseconds: 1 }; const DAY_DURATION = { days: 1 }; const WEEK_DURATION = { days: 7 }; const nextDay = date => addDateInterval(date, DAY_DURATION, 1); const nextWeek = date => addDateInterval(date, WEEK_DURATION, 1); exports.nextWeek = nextWeek; const isWeekend = date => 6 === date.getDay() || 0 === date.getDay(); const getIntervalStartDate = options => { const { date: date, step: step, firstDayOfWeek: firstDayOfWeek } = options; switch (step) { case "day": case "week": case "month": return getPeriodStart(date, step, false, firstDayOfWeek); case "workWeek": const firstWeekDay = getWeekStart(date, firstDayOfWeek); return (firstDayOfWeek => { let date = new Date(firstDayOfWeek); while (isWeekend(date)) { date = nextDay(date) } return date })(firstWeekDay); case "agenda": return new Date(date) } }; const getIntervalEndDate = (startDate, options) => { const { intervalCount: intervalCount, step: step, agendaDuration: agendaDuration } = options; let periodStartDate; let periodEndDate; let nextPeriodStartDate = new Date(startDate); for (let i = 0; i < intervalCount; i++) { periodStartDate = nextPeriodStartDate; periodEndDate = getPeriodEndDate(periodStartDate, step, agendaDuration); nextPeriodStartDate = getNextPeriodStartDate(periodEndDate, step) } return periodEndDate }; const getPeriodEndDate = (currentPeriodStartDate, step, agendaDuration) => { let date; switch (step) { case "day": date = nextDay(currentPeriodStartDate); break; case "week": date = nextWeek(currentPeriodStartDate); break; case "month": date = (date => { const days = getLastMonthDay(date); return addDateInterval(date, { days: days }, 1) })(currentPeriodStartDate); break; case "workWeek": date = (workWeekStart => { let date = new Date(workWeekStart); let workDaysCount = 0; while (workDaysCount < 5) { if (!isWeekend(date)) { workDaysCount++ } date = nextDay(date) } return date })(currentPeriodStartDate); break; case "agenda": date = ((date, agendaDuration) => addDateInterval(date, { days: agendaDuration }, 1))(currentPeriodStartDate, agendaDuration) } return (date => addDateInterval(date, MS_DURATION, -1))(date) }; const getNextPeriodStartDate = (currentPeriodEndDate, step) => { let date = (date => addDateInterval(date, MS_DURATION, 1))(currentPeriodEndDate); if ("workWeek" === step) { while (isWeekend(date)) { date = nextDay(date) } } return date }; exports.getNextIntervalDate = (options, direction) => { const { date: date, step: step, intervalCount: intervalCount, agendaDuration: agendaDuration } = options; let dayDuration; switch (step) { case "day": dayDuration = 1 * intervalCount; break; case "week": case "workWeek": dayDuration = 7 * intervalCount; break; case "agenda": dayDuration = agendaDuration; break; case "month": return getNextMonthDate(date, intervalCount, direction) } return addDateInterval(date, { days: dayDuration }, direction) }; const getNextMonthDate = (date, intervalCount, direction) => { const currentDate = date.getDate(); const currentMonthFirstDate = new Date(new Date(date.getTime()).setDate(1)); const thatMonthFirstDate = new Date(currentMonthFirstDate.setMonth(currentMonthFirstDate.getMonth() + intervalCount * direction)); const thatMonthDuration = getLastMonthDay(thatMonthFirstDate); const minDate = currentDate < thatMonthDuration ? currentDate : thatMonthDuration; const currentMonthMinDate = new Date(new Date(date.getTime()).setDate(minDate)); const thatMonthMinDate = new Date(currentMonthMinDate.setMonth(currentMonthMinDate.getMonth() + intervalCount * direction)); return thatMonthMinDate }; const getDateMonthFormatter = isShort => { const monthType = isShort ? "abbreviated" : "wide"; const months = _date2.default.getMonthNames(monthType); return date => { const day = formatDate(date, "day"); const month = months[date.getMonth()]; return `${day} ${month}` } }; const formatMonthYear = date => { const months = _date2.default.getMonthNames("abbreviated"); const month = months[date.getMonth()]; const year = formatDate(date, "year"); return `${month} ${year}` }; const getDateMonthYearFormatter = isShort => date => { const dateMonthFormat = getDateMonthFormatter(isShort); const dateMonth = dateMonthFormat(date); const year = formatDate(date, "year"); return `${dateMonth} ${year}` }; const formatCaptionByMonths = (startDate, endDate, isShort) => { const isDifferentYears = startDate.getFullYear() !== endDate.getFullYear(); if (isDifferentYears) { return ((startDate, endDate) => { const firstDateText = formatDate(startDate, getDateMonthYearFormatter(true)); const lastDateDateText = formatDate(endDate, getDateMonthYearFormatter(true)); return `${firstDateText}-${lastDateDateText}` })(startDate, endDate) } return ((startDate, endDate, isShort) => { const isDifferentMonthDates = startDate.getMonth() !== endDate.getMonth(); const useShortFormat = isDifferentMonthDates || isShort; const firstDateFormat = isDifferentMonthDates ? getDateMonthFormatter(useShortFormat) : "d"; const firstDateText = formatDate(startDate, firstDateFormat); const lastDateText = formatDate(endDate, getDateMonthYearFormatter(useShortFormat)); return `${firstDateText}-${lastDateText}` })(startDate, endDate, isShort) }; const getCaptionText = (startDate, endDate, isShort, step) => { if (_date.default.sameDate(startDate, endDate)) { return ((date, step, isShort) => { const useShortFormat = "agenda" === step ? isShort : false; const dateMonthFormat = getDateMonthFormatter(useShortFormat); const dateMonth = dateMonthFormat(date); const year = formatDate(date, "year"); return `${dateMonth} ${year}` })(startDate, step, isShort) } if ("month" === step) { return ((startDate, endDate) => { if (_date.default.sameMonth(startDate, endDate)) { return formatDate(startDate, "monthandyear") } const isSameYear = _date.default.sameYear(startDate, endDate); const firstDateText = isSameYear ? _date2.default.getMonthNames("abbreviated")[startDate.getMonth()] : formatMonthYear(startDate); const lastDateText = formatMonthYear(endDate); return `${firstDateText}-${lastDateText}` })(startDate, endDate) } return formatCaptionByMonths(startDate, endDate, isShort) }; exports.getCaption = (options, isShort, customizationFunction) => { const { startDate: startDate, endDate: endDate } = (options => { const startDate = getIntervalStartDate(options); const endDate = getIntervalEndDate(startDate, options); return { startDate: startDate, endDate: endDate } })(options); let text = getCaptionText(startDate, endDate, isShort, options.step); if ((0, _type.isFunction)(customizationFunction)) { text = customizationFunction({ startDate: startDate, endDate: endDate, text: text }) } return { startDate: startDate, endDate: endDate, text: text } }; const STEP_MAP = { day: "day", week: "week", workWeek: "workWeek", month: "month", timelineDay: "day", timelineWeek: "week", timelineWorkWeek: "workWeek", timelineMonth: "month", agenda: "agenda" }; exports.getStep = view => STEP_MAP[getViewType(view)]; const getViewType = view => { if ((0, _type.isObject)(view) && view.type) { return view.type } return view }; exports.getViewType = getViewType; const getViewName = view => { if ((0, _type.isObject)(view)) { return view.name ? view.name : view.type } return view }; exports.getViewName = getViewName; const getViewText = view => { if (view.name) { return view.name } const viewName = (0, _inflector.camelize)(view.type || view, true); return _message.default.format(`dxScheduler-switcher${viewName}`) }; exports.getViewText = getViewText; const validateViews = views => { views.forEach((view => { const viewType = getViewType(view); if (!(view => Object.values(_m_constants.VIEWS).includes(view))(viewType)) { _errors.default.log("W0008", viewType) } })) }; exports.validateViews = validateViews; exports.formatViews = views => { validateViews(views); return views.map((view => { const text = getViewText(view); const type = getViewType(view); const name = getViewName(view); return { text: text, name: name, view: { text: text, type: type, name: name } } })) }; exports.isOneView = (views, selectedView) => 1 === views.length && views[0].name === selectedView }, 93327: /*!********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/header/m_view_switcher.js ***! \********************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.getViewSwitcher = exports.getDropDownViewSwitcher = void 0; var _themes = __webpack_require__( /*! ../../../ui/themes */ 75811); var _m_utils = __webpack_require__( /*! ./m_utils */ 31047); function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const getViewsAndSelectedView = header => { const views = (0, _m_utils.formatViews)(header.views); let selectedView = (0, _m_utils.getViewName)(header.currentView); const isSelectedViewInViews = views.some((view => view.name === selectedView)); selectedView = isSelectedViewInViews ? selectedView : void 0; return { selectedView: selectedView, views: views } }; exports.getViewSwitcher = (header, item) => { const { selectedView: selectedView, views: views } = getViewsAndSelectedView(header); const stylingMode = (0, _themes.isFluent)() ? "outlined" : "contained"; return _extends({ widget: "dxButtonGroup", locateInMenu: "auto", cssClass: "dx-scheduler-view-switcher", options: { items: views, keyExpr: "name", selectedItemKeys: [selectedView], stylingMode: stylingMode, onItemClick: e => { const { view: view } = e.itemData; header._updateCurrentView(view) }, onContentReady: e => { const viewSwitcher = e.component; header._addEvent("currentView", (view => { viewSwitcher.option("selectedItemKeys", [(0, _m_utils.getViewName)(view)]) })) } } }, item) }; exports.getDropDownViewSwitcher = (header, item) => { const { selectedView: selectedView, views: views } = getViewsAndSelectedView(header); const oneView = (0, _m_utils.isOneView)(views, selectedView); return _extends({ widget: "dxDropDownButton", locateInMenu: "never", cssClass: "dx-scheduler-view-switcher", options: { items: views, useSelectMode: true, keyExpr: "name", selectedItemKey: selectedView, displayExpr: "text", showArrowIcon: !oneView, elementAttr: { class: "dx-scheduler-view-switcher-dropdown-button" }, onItemClick: e => { const { view: view } = e.itemData; header._updateCurrentView(view) }, onContentReady: e => { const viewSwitcher = e.component; header._addEvent("currentView", (view => { const views = (0, _m_utils.formatViews)(header.views); if ((0, _m_utils.isOneView)(views, view)) { header.repaint() } viewSwitcher.option("selectedItemKey", (0, _m_utils.getViewName)(view)) })) }, dropDownOptions: { onShowing: e => { if (oneView) { e.cancel = true } }, width: "max-content", _wrapperClassExternal: "dx-scheduler-view-switcher-dropdown-button-content" } } }, item) } }, 72734: /*!*******************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_appointment_adapter.js ***! \*******************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.createAppointmentAdapter = void 0; var _extend = __webpack_require__( /*! ../../core/utils/extend */ 13306); var _object = __webpack_require__( /*! ../../core/utils/object */ 48013); var _ui = (obj = __webpack_require__( /*! ../../ui/widget/ui.errors */ 96688), obj && obj.__esModule ? obj : { default: obj }); var obj; var _m_expression_utils = __webpack_require__( /*! ./m_expression_utils */ 30906); var _m_recurrence = __webpack_require__( /*! ./m_recurrence */ 38227); const PROPERTY_NAMES_startDate = "startDate", PROPERTY_NAMES_endDate = "endDate", PROPERTY_NAMES_allDay = "allDay", PROPERTY_NAMES_text = "text", PROPERTY_NAMES_description = "description", PROPERTY_NAMES_startDateTimeZone = "startDateTimeZone", PROPERTY_NAMES_endDateTimeZone = "endDateTimeZone", PROPERTY_NAMES_recurrenceRule = "recurrenceRule", PROPERTY_NAMES_recurrenceException = "recurrenceException", PROPERTY_NAMES_disabled = "disabled"; class AppointmentAdapter { constructor(rawAppointment, dataAccessors, timeZoneCalculator, options) { this.rawAppointment = rawAppointment; this.dataAccessors = dataAccessors; this.timeZoneCalculator = timeZoneCalculator; this.options = options } get duration() { return this.endDate ? this.endDate - this.startDate : 0 } get startDate() { const result = this.getField(PROPERTY_NAMES_startDate); return void 0 === result ? result : new Date(result) } set startDate(value) { this.setField(PROPERTY_NAMES_startDate, value) } get endDate() { const result = this.getField(PROPERTY_NAMES_endDate); return void 0 === result ? result : new Date(result) } set endDate(value) { this.setField(PROPERTY_NAMES_endDate, value) } get allDay() { return this.getField(PROPERTY_NAMES_allDay) } set allDay(value) { this.setField(PROPERTY_NAMES_allDay, value) } get text() { return this.getField(PROPERTY_NAMES_text) } set text(value) { this.setField(PROPERTY_NAMES_text, value) } get description() { return this.getField(PROPERTY_NAMES_description) } set description(value) { this.setField(PROPERTY_NAMES_description, value) } get startDateTimeZone() { return this.getField(PROPERTY_NAMES_startDateTimeZone) } get endDateTimeZone() { return this.getField(PROPERTY_NAMES_endDateTimeZone) } get recurrenceRule() { return this.getField(PROPERTY_NAMES_recurrenceRule) } set recurrenceRule(value) { this.setField(PROPERTY_NAMES_recurrenceRule, value) } get recurrenceException() { return this.getField(PROPERTY_NAMES_recurrenceException) } set recurrenceException(value) { this.setField(PROPERTY_NAMES_recurrenceException, value) } get disabled() { return !!this.getField(PROPERTY_NAMES_disabled) } get isRecurrent() { return (0, _m_recurrence.getRecurrenceProcessor)().isValidRecurrenceRule(this.recurrenceRule) } getField(property) { return _m_expression_utils.ExpressionUtils.getField(this.dataAccessors, property, this.rawAppointment) } setField(property, value) { return _m_expression_utils.ExpressionUtils.setField(this.dataAccessors, property, this.rawAppointment, value) } calculateStartDate(pathTimeZoneConversion) { if (!this.startDate || isNaN(this.startDate.getTime())) { throw _ui.default.Error("E1032", this.text) } return this.calculateDate(this.startDate, this.startDateTimeZone, pathTimeZoneConversion) } calculateEndDate(pathTimeZoneConversion) { return this.calculateDate(this.endDate, this.endDateTimeZone, pathTimeZoneConversion) } calculateDate(date, appointmentTimeZone, pathTimeZoneConversion) { if (!date) { return } return this.timeZoneCalculator.createDate(date, { appointmentTimeZone: appointmentTimeZone, path: pathTimeZoneConversion }) } clone() { let options = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : void 0; const result = new AppointmentAdapter((0, _object.deepExtendArraySafe)({}, this.rawAppointment), this.dataAccessors, this.timeZoneCalculator, options); if (null !== options && void 0 !== options && options.pathTimeZone) { result.startDate = result.calculateStartDate(options.pathTimeZone); result.endDate = result.calculateEndDate(options.pathTimeZone) } return result } source() { let serializeDate = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : false; if (serializeDate) { const clonedAdapter = this.clone(); clonedAdapter.startDate = this.startDate; clonedAdapter.endDate = this.endDate; return clonedAdapter.source() } return (0, _extend.extend)({}, this.rawAppointment) } } exports.default = AppointmentAdapter; exports.createAppointmentAdapter = (rawAppointment, dataAccessors, timeZoneCalculator, options) => new AppointmentAdapter(rawAppointment, dataAccessors, timeZoneCalculator, options) }, 54915: /*!*************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_appointment_drag_behavior.js ***! \*************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../core/renderer */ 68374)); var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 13306); var _draggable = _interopRequireDefault(__webpack_require__( /*! ../../ui/draggable */ 42160)); var _m_constants = __webpack_require__( /*! ./m_constants */ 6324); var _is_scheduler_component = __webpack_require__( /*! ./utils/is_scheduler_component */ 79456); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } exports.default = class { constructor(scheduler) { this.scheduler = scheduler; this.workspace = this.scheduler._workSpace; this.appointments = this.scheduler._appointments; this.initialPosition = { left: 0, top: 0 }; this.appointmentInfo = null; this.dragBetweenComponentsPromise = null } isAllDay(appointment) { return appointment.data("dxAppointmentSettings").allDay } onDragStart(e) { const { itemSettings: itemSettings, itemData: itemData, initialPosition: initialPosition } = e; this.initialPosition = initialPosition; this.appointmentInfo = { appointment: itemData, settings: itemSettings }; this.appointments.notifyObserver("hideAppointmentTooltip") } onDragMove(e) { if (e.fromComponent !== e.toComponent) { this.appointments.notifyObserver("removeDroppableCellClass") } } getAppointmentElement(e) { const itemElement = e.event.data && e.event.data.itemElement || e.itemElement; return (0, _renderer.default)(itemElement) } onDragEnd(event) { const element = this.getAppointmentElement(event); const rawAppointment = this.appointments._getItemData(element); const container = this.appointments._getAppointmentContainer(this.isAllDay(element)); container.append(element); const newCellIndex = this.workspace.getDroppableCellIndex(); const oldCellIndex = this.workspace.getCellIndexByCoordinates(this.initialPosition); this.appointments.notifyObserver("updateAppointmentAfterDrag", { event: event, element: element, rawAppointment: rawAppointment, newCellIndex: newCellIndex, oldCellIndex: oldCellIndex }) } onDragCancel() { this.removeDroppableClasses() } getItemData(appointmentElement) { const dataFromTooltip = (0, _renderer.default)(appointmentElement).data(_m_constants.LIST_ITEM_DATA_KEY); const itemDataFromTooltip = null === dataFromTooltip || void 0 === dataFromTooltip ? void 0 : dataFromTooltip.appointment; const itemDataFromGrid = this.appointments._getItemData(appointmentElement); return itemDataFromTooltip || itemDataFromGrid } getItemSettings(appointment) { const itemData = (0, _renderer.default)(appointment).data(_m_constants.LIST_ITEM_DATA_KEY); return itemData && itemData.settings || [] } createDragStartHandler(options, appointmentDragging) { return e => { e.itemData = this.getItemData(e.itemElement); e.itemSettings = this.getItemSettings(e.itemElement); appointmentDragging.onDragStart && appointmentDragging.onDragStart(e); if (!e.cancel) { options.onDragStart(e) } } } createDragMoveHandler(options, appointmentDragging) { return e => { appointmentDragging.onDragMove && appointmentDragging.onDragMove(e); if (!e.cancel) { options.onDragMove(e) } } } createDragEndHandler(options, appointmentDragging) { return e => { const updatedData = this.appointments.invoke("getUpdatedData", e.itemData); this.appointmentInfo = null; e.toItemData = (0, _extend.extend)({}, e.itemData, updatedData); appointmentDragging.onDragEnd && appointmentDragging.onDragEnd(e); if (!e.cancel) { options.onDragEnd(e); if (e.fromComponent !== e.toComponent) { appointmentDragging.onRemove && appointmentDragging.onRemove(e) } } if (true === e.cancel) { this.removeDroppableClasses() } if (true !== e.cancel && (0, _is_scheduler_component.isSchedulerComponent)(e.toComponent)) { const targetDragBehavior = e.toComponent._getDragBehavior(); targetDragBehavior.dragBetweenComponentsPromise = new _deferred.Deferred } } } createDropHandler(appointmentDragging) { return e => { const updatedData = this.appointments.invoke("getUpdatedData", e.itemData); e.itemData = (0, _extend.extend)({}, e.itemData, updatedData); if (e.fromComponent !== e.toComponent) { appointmentDragging.onAdd && appointmentDragging.onAdd(e) } if (this.dragBetweenComponentsPromise) { this.dragBetweenComponentsPromise.resolve() } } } addTo(container, config) { const appointmentDragging = this.scheduler.option("appointmentDragging") || {}; const options = (0, _extend.extend)({ component: this.scheduler, contentTemplate: null, filter: ".dx-scheduler-appointment", immediate: false, onDragStart: this.onDragStart.bind(this), onDragMove: this.onDragMove.bind(this), onDragEnd: this.onDragEnd.bind(this), onDragCancel: this.onDragCancel.bind(this) }, config); this.appointments._createComponent(container, _draggable.default, (0, _extend.extend)({}, options, appointmentDragging, { onDragStart: this.createDragStartHandler(options, appointmentDragging), onDragMove: this.createDragMoveHandler(options, appointmentDragging), onDragEnd: this.createDragEndHandler(options, appointmentDragging), onDrop: this.createDropHandler(appointmentDragging), onCancelByEsc: true })) } updateDragSource(appointment, settings) { const { appointmentInfo: appointmentInfo } = this; if (appointmentInfo || appointment) { const currentAppointment = appointment || appointmentInfo.appointment; const currentSettings = settings || appointmentInfo.settings; this.appointments._setDragSourceAppointment(currentAppointment, currentSettings) } } removeDroppableClasses() { this.appointments._removeDragSourceClassFromDraggedAppointment(); this.workspace.removeDroppableCellClass() } } }, 43919: /*!***************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_appointments_layout_manager.js ***! \***************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _common = __webpack_require__( /*! ../../core/utils/common */ 20576); var _date = (obj = __webpack_require__( /*! ../../core/utils/date */ 91198), obj && obj.__esModule ? obj : { default: obj }); var obj; var _index = __webpack_require__( /*! ../scheduler/r1/utils/index */ 94084); var _m_view_model_generator = __webpack_require__( /*! ./appointments/m_view_model_generator */ 62386); var _m_position_helper = __webpack_require__( /*! ./workspaces/helpers/m_position_helper */ 94654); function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const toMs = _date.default.dateToMilliseconds; exports.default = class { constructor(instance) { this.instance = instance; this.appointmentViewModel = new _m_view_model_generator.AppointmentViewModelGenerator } get appointmentRenderingStrategyName() { return (0, _index.getAppointmentRenderingStrategyName)(this.instance.currentViewType) } getCellDimensions(options) { if (this.instance._workSpace) { return { width: this.instance._workSpace.getCellWidth(), height: this.instance._workSpace.getCellHeight(), allDayHeight: this.instance._workSpace.getAllDayHeight() } } return } _getRenderingStrategyOptions() { const workspace = this.instance.getWorkSpace(); const { virtualScrollingDispatcher: virtualScrollingDispatcher } = this.instance.getWorkSpace(); const { cellCountInsideLeftVirtualCell: cellCountInsideLeftVirtualCell, cellCountInsideTopVirtualRow: cellCountInsideTopVirtualRow } = virtualScrollingDispatcher; const groupCount = (0, _index.getGroupCount)(this.instance.option("loadedResources")); const DOMMetaData = workspace.getDOMElementsMetaData(); const allDayHeight = (0, _m_position_helper.getAllDayHeight)(workspace.option("showAllDayPanel"), workspace._isVerticalGroupedWorkSpace(), DOMMetaData); const rowCount = workspace._getRowCount(); const { positionHelper: positionHelper, viewDataProvider: viewDataProvider } = workspace; const visibleDayDuration = viewDataProvider.getVisibleDayDuration(workspace.option("startDayHour"), workspace.option("endDayHour"), workspace.option("hoursInterval")); const cellDuration = (0, _index.getCellDuration)(workspace.type, workspace.option("startDayHour"), workspace.option("endDayHour"), workspace.option("hoursInterval")); return { resources: this.instance.option("resources"), loadedResources: this.instance.option("loadedResources"), getAppointmentColor: this.instance.createGetAppointmentColor(), dataAccessors: this.instance._dataAccessors, appointmentRenderingStrategyName: this.appointmentRenderingStrategyName, adaptivityEnabled: this.instance.option("adaptivityEnabled"), rtlEnabled: this.instance.option("rtlEnabled"), startDayHour: this.instance._getCurrentViewOption("startDayHour"), endDayHour: this.instance._getCurrentViewOption("endDayHour"), viewOffset: this.instance._getCurrentViewOption("offset") * toMs("minute"), maxAppointmentsPerCell: this.instance._getCurrentViewOption("maxAppointmentsPerCell"), currentDate: this.instance.option("currentDate"), isVirtualScrolling: this.instance.isVirtualScrolling(), leftVirtualCellCount: cellCountInsideLeftVirtualCell, topVirtualCellCount: cellCountInsideTopVirtualRow, intervalCount: workspace.option("intervalCount"), hoursInterval: workspace.option("hoursInterval"), showAllDayPanel: workspace.option("showAllDayPanel"), isGroupedAllDayPanel: workspace.isGroupedAllDayPanel(), groups: this.instance._getCurrentViewOption("groups"), groupCount: groupCount, rowCount: rowCount, appointmentCountPerCell: this.instance.option("_appointmentCountPerCell"), appointmentOffset: this.instance.option("_appointmentOffset"), allowResizing: this.instance._allowResizing(), allowAllDayResizing: this.instance._allowAllDayResizing(), startViewDate: workspace.getStartViewDate(), groupOrientation: workspace._getRealGroupOrientation(), cellWidth: (0, _m_position_helper.getCellWidth)(DOMMetaData), cellHeight: (0, _m_position_helper.getCellHeight)(DOMMetaData), allDayHeight: allDayHeight, resizableStep: positionHelper.getResizableStep(), visibleDayDuration: visibleDayDuration, allDayPanelMode: this.instance._getCurrentViewOption("allDayPanelMode"), timeZoneCalculator: this.instance.timeZoneCalculator, timeZone: this.instance.option("timeZone"), firstDayOfWeek: this.instance.getFirstDayOfWeek(), viewStartDayHour: this.instance._getCurrentViewOption("startDayHour"), viewEndDayHour: this.instance._getCurrentViewOption("endDayHour"), viewType: workspace.type, endViewDate: workspace.getEndViewDate(), positionHelper: positionHelper, isGroupedByDate: workspace.isGroupedByDate(), cellDuration: cellDuration, cellDurationInMinutes: workspace.option("cellDuration"), viewDataProvider: workspace.viewDataProvider, supportAllDayRow: workspace.supportAllDayRow(), dateRange: workspace.getDateRange(), intervalDuration: workspace.getIntervalDuration(), allDayIntervalDuration: workspace.getIntervalDuration(true), isVerticalGroupOrientation: workspace.isVerticalOrientation(), DOMMetaData: DOMMetaData, instance: this.instance, agendaDuration: workspace.option("agendaDuration") } } createAppointmentsMap(items) { const renderingStrategyOptions = this._getRenderingStrategyOptions(); const { viewModel: viewModel, positionMap: positionMap } = this.appointmentViewModel.generate(items, renderingStrategyOptions); this._positionMap = positionMap; return viewModel } _isDataChanged(data) { const { appointmentDataProvider: appointmentDataProvider } = this.instance; const updatedData = appointmentDataProvider.getUpdatedAppointment(); return updatedData === data || appointmentDataProvider.getUpdatedAppointmentKeys().some((item => data[item.key] === item.value)) } _isAppointmentShouldAppear(currentAppointment, sourceAppointment) { return currentAppointment.needRepaint && sourceAppointment.needRemove } _isSettingChanged(settings, sourceSetting) { if (settings.length !== sourceSetting.length) { return true } const createSettingsToCompare = (settings, index) => { const currentSetting = settings[index]; const leftVirtualCellCount = currentSetting.leftVirtualCellCount || 0; const topVirtualCellCount = currentSetting.topVirtualCellCount || 0; const columnIndex = currentSetting.columnIndex + leftVirtualCellCount; const rowIndex = currentSetting.rowIndex + topVirtualCellCount; const hMax = currentSetting.reduced ? currentSetting.hMax : void 0; const vMax = currentSetting.reduced ? currentSetting.vMax : void 0; return _extends({}, currentSetting, { columnIndex: columnIndex, rowIndex: rowIndex, positionByMap: void 0, topVirtualCellCount: void 0, leftVirtualCellCount: void 0, leftVirtualWidth: void 0, topVirtualHeight: void 0, hMax: hMax, vMax: vMax, info: {} }) }; for (let i = 0; i < settings.length; i++) { const newSettings = createSettingsToCompare(settings, i); const oldSettings = createSettingsToCompare(sourceSetting, i); if (oldSettings) { oldSettings.sortedIndex = newSettings.sortedIndex } if (!(0, _common.equalByValue)(newSettings, oldSettings)) { return true } } return false } _getAssociatedSourceAppointment(currentAppointment, sourceAppointments) { for (let i = 0; i < sourceAppointments.length; i++) { const item = sourceAppointments[i]; if (item.itemData === currentAppointment.itemData) { return item } } return null } _getDeletedAppointments(currentAppointments, sourceAppointments) { const result = []; for (let i = 0; i < sourceAppointments.length; i++) { const sourceAppointment = sourceAppointments[i]; const currentAppointment = this._getAssociatedSourceAppointment(sourceAppointment, currentAppointments); if (!currentAppointment) { sourceAppointment.needRemove = true; result.push(sourceAppointment) } } return result } getRepaintedAppointments(currentAppointments, sourceAppointments) { if (0 === sourceAppointments.length || "agenda" === this.appointmentRenderingStrategyName) { return currentAppointments } currentAppointments.forEach((appointment => { const sourceAppointment = this._getAssociatedSourceAppointment(appointment, sourceAppointments); if (sourceAppointment) { const isDataChanged = this._isDataChanged(appointment.itemData); const isSettingChanged = this._isSettingChanged(appointment.settings, sourceAppointment.settings); const isAppointmentShouldAppear = this._isAppointmentShouldAppear(appointment, sourceAppointment); appointment.needRepaint = isDataChanged || isSettingChanged || isAppointmentShouldAppear } })); return currentAppointments.concat(this._getDeletedAppointments(currentAppointments, sourceAppointments)) } getRenderingStrategyInstance() { const renderingStrategy = this.appointmentViewModel.getRenderingStrategy(); if (!renderingStrategy) { const options = this._getRenderingStrategyOptions(); this.appointmentViewModel.initRenderingStrategy(options) } return this.appointmentViewModel.getRenderingStrategy() } } }, 43600: /*!*******************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_classes.js ***! \*******************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.VIRTUAL_CELL_CLASS = exports.VERTICAL_GROUP_COUNT_CLASSES = exports.TIME_PANEL_CLASS = exports.REDUCED_APPOINTMENT_PARTS_CLASSES = exports.REDUCED_APPOINTMENT_ICON = exports.REDUCED_APPOINTMENT_CLASS = exports.RECURRENCE_APPOINTMENT_CLASS = exports.LAST_GROUP_CELL_CLASS = exports.HEADER_CURRENT_TIME_CELL_CLASS = exports.GROUP_ROW_CLASS = exports.GROUP_HEADER_CONTENT_CLASS = exports.FIXED_CONTAINER_CLASS = exports.FIRST_GROUP_CELL_CLASS = exports.EMPTY_APPOINTMENT_CLASS = exports.DIRECTION_APPOINTMENT_CLASSES = exports.DATE_TABLE_ROW_CLASS = exports.DATE_TABLE_CLASS = exports.APPOINTMENT_ITEM_CLASS = exports.APPOINTMENT_HAS_RESOURCE_COLOR_CLASS = exports.APPOINTMENT_DRAG_SOURCE_CLASS = exports.APPOINTMENT_CONTENT_CLASSES = exports.ALL_DAY_APPOINTMENT_CLASS = exports.AGENDA_LAST_IN_DATE_APPOINTMENT_CLASS = void 0; exports.FIXED_CONTAINER_CLASS = "dx-scheduler-fixed-appointments"; exports.REDUCED_APPOINTMENT_CLASS = "dx-scheduler-appointment-reduced"; exports.REDUCED_APPOINTMENT_ICON = "dx-scheduler-appointment-reduced-icon"; exports.RECURRENCE_APPOINTMENT_CLASS = "dx-scheduler-appointment-recurrence"; exports.EMPTY_APPOINTMENT_CLASS = "dx-scheduler-appointment-empty"; exports.ALL_DAY_APPOINTMENT_CLASS = "dx-scheduler-all-day-appointment"; exports.REDUCED_APPOINTMENT_PARTS_CLASSES = { head: "dx-scheduler-appointment-head", body: "dx-scheduler-appointment-body", tail: "dx-scheduler-appointment-tail" }; exports.DIRECTION_APPOINTMENT_CLASSES = { horizontal: "dx-scheduler-appointment-horizontal", vertical: "dx-scheduler-appointment-vertical" }; exports.APPOINTMENT_DRAG_SOURCE_CLASS = "dx-scheduler-appointment-drag-source"; exports.APPOINTMENT_ITEM_CLASS = "dx-scheduler-appointment"; exports.APPOINTMENT_CONTENT_CLASSES = { APPOINTMENT_CONTENT_DETAILS: "dx-scheduler-appointment-content-details", RECURRING_ICON: "dx-scheduler-appointment-recurrence-icon", APPOINTMENT_TITLE: "dx-scheduler-appointment-title", APPOINTMENT_DATE: "dx-scheduler-appointment-content-date", ALL_DAY_CONTENT: "dx-scheduler-appointment-content-allday", ITEM: "dx-scheduler-appointment", STRIP: "dx-scheduler-appointment-strip", AGENDA_MARKER: "dx-scheduler-agenda-appointment-marker", AGENDA_RESOURCE_LIST: "dx-scheduler-appointment-resource-list", AGENDA_RESOURCE_LIST_ITEM: "dx-scheduler-appointment-resource-item", AGENDA_RESOURCE_LIST_ITEM_VALUE: "dx-scheduler-appointment-resource-item-value" }; exports.AGENDA_LAST_IN_DATE_APPOINTMENT_CLASS = "dx-scheduler-last-in-date-agenda-appointment"; exports.APPOINTMENT_HAS_RESOURCE_COLOR_CLASS = "dx-scheduler-appointment-has-resource-color"; exports.HEADER_CURRENT_TIME_CELL_CLASS = "dx-scheduler-header-panel-current-time-cell"; exports.VIRTUAL_CELL_CLASS = "dx-scheduler-virtual-cell"; exports.TIME_PANEL_CLASS = "dx-scheduler-time-panel"; exports.DATE_TABLE_CLASS = "dx-scheduler-date-table"; exports.DATE_TABLE_ROW_CLASS = "dx-scheduler-date-table-row"; exports.GROUP_ROW_CLASS = "dx-scheduler-group-row"; exports.GROUP_HEADER_CONTENT_CLASS = "dx-scheduler-group-header-content"; exports.LAST_GROUP_CELL_CLASS = "dx-scheduler-last-group-cell"; exports.FIRST_GROUP_CELL_CLASS = "dx-scheduler-first-group-cell"; exports.VERTICAL_GROUP_COUNT_CLASSES = ["dx-scheduler-group-column-count-one", "dx-scheduler-group-column-count-two", "dx-scheduler-group-column-count-three"] }, 38088: /*!***************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_compact_appointments_helper.js ***! \***************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.CompactAppointmentsHelper = void 0; var _translator = __webpack_require__( /*! ../../animation/translator */ 31648); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../core/renderer */ 68374)); var _function_template = __webpack_require__( /*! ../../core/templates/function_template */ 68494); var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 62754); var _position = __webpack_require__( /*! ../../core/utils/position */ 37518); var _message = _interopRequireDefault(__webpack_require__( /*! ../../localization/message */ 28109)); var _button = _interopRequireDefault(__webpack_require__( /*! ../../ui/button */ 63008)); var _index = __webpack_require__( /*! ../scheduler/r1/utils/index */ 94084); var _m_appointment_adapter = __webpack_require__( /*! ./m_appointment_adapter */ 72734); var _m_constants = __webpack_require__( /*! ./m_constants */ 6324); var _m_data_structures = __webpack_require__( /*! ./m_data_structures */ 98865); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } exports.CompactAppointmentsHelper = class { constructor(instance) { this.instance = instance; this.elements = [] } render(options) { const { isCompact: isCompact, items: items, buttonColor: buttonColor } = options; const template = this._createTemplate(items.data.length, isCompact); const button = this._createCompactButton(template, options); const $button = button.$element(); this._makeBackgroundColor($button, items.colors, buttonColor); this._makeBackgroundDarker($button); this.elements.push($button); $button.data("items", this._createTooltipInfos(items)); return $button } clear() { this.elements.forEach((button => { button.detach(); button.remove() })); this.elements = [] } _createTooltipInfos(items) { return items.data.map(((appointment, index) => { var _items$settings; const targetedAdapter = (0, _m_appointment_adapter.createAppointmentAdapter)(appointment, this.instance._dataAccessors, this.instance.timeZoneCalculator).clone(); if ((null === (_items$settings = items.settings) || void 0 === _items$settings ? void 0 : _items$settings.length) > 0) { const { info: info } = items.settings[index]; targetedAdapter.startDate = info.sourceAppointment.startDate; targetedAdapter.endDate = info.sourceAppointment.endDate } return new _m_data_structures.AppointmentTooltipInfo(appointment, targetedAdapter.source(), items.colors[index], items.settings[index]) })) } _onButtonClick(e, options) { const $button = (0, _renderer.default)(e.element); this.instance.showAppointmentTooltipCore($button, $button.data("items"), this._getExtraOptionsForTooltip(options, $button)) } _getExtraOptionsForTooltip(options, $appointmentCollector) { return { clickEvent: this._clickEvent(options.onAppointmentClick).bind(this), dragBehavior: options.allowDrag && this._createTooltipDragBehavior($appointmentCollector).bind(this), dropDownAppointmentTemplate: this.instance.option().dropDownAppointmentTemplate, isButtonClick: true } } _clickEvent(onAppointmentClick) { return e => { const clickEventArgs = this.instance._createEventArgs(e); onAppointmentClick(clickEventArgs) } } _createTooltipDragBehavior($appointmentCollector) { return e => { const $element = (0, _renderer.default)(e.element); const $schedulerElement = (0, _renderer.default)(this.instance.element()); const workSpace = this.instance.getWorkSpace(); const initialPosition = (0, _translator.locate)($appointmentCollector); const options = { filter: `.${_m_constants.LIST_ITEM_CLASS}`, isSetCursorOffset: true, initialPosition: initialPosition, getItemData: itemElement => { var _$$data; return null === (_$$data = (0, _renderer.default)(itemElement).data(_m_constants.LIST_ITEM_DATA_KEY)) || void 0 === _$$data ? void 0 : _$$data.appointment }, getItemSettings: (_, event) => event.itemSettings }; workSpace._createDragBehaviorBase($element, $schedulerElement, options) } } _getCollectorOffset(width, cellWidth) { return cellWidth - width - this._getCollectorRightOffset() } _getCollectorRightOffset() { return this.instance.getRenderingStrategyInstance()._isCompactTheme() ? 1 : 5 } _makeBackgroundDarker(button) { button.css("boxShadow", `inset ${(0,_position.getBoundingRect)(button.get(0)).width}px 0 0 0 rgba(0, 0, 0, 0.3)`) } _makeBackgroundColor($button, colors, color) { _deferred.when.apply(null, colors).done(function() { this._makeBackgroundColorCore($button, color, [...arguments]) }.bind(this)) } _makeBackgroundColorCore($button, color, itemColors) { color && color.done((color => { const backgroundColor = (0, _index.getOverflowIndicatorColor)(color, itemColors); if (backgroundColor) { $button.css("backgroundColor", backgroundColor) } })) } _setPosition(element, position) { (0, _translator.move)(element, { top: position.top, left: position.left }) } _createCompactButton(template, options) { const $button = this._createCompactButtonElement(options); return this.instance._createComponent($button, _button.default, { type: "default", width: options.width, height: options.height, onClick: e => this._onButtonClick(e, options), template: this._renderTemplate(template, options.items, options.isCompact) }) } _createCompactButtonElement(_ref) { let { isCompact: isCompact, $container: $container, coordinates: coordinates } = _ref; const result = (0, _renderer.default)("
").addClass("dx-scheduler-appointment-collector").toggleClass("dx-scheduler-appointment-collector-compact", isCompact).appendTo($container); this._setPosition(result, coordinates); return result } _renderTemplate(template, items, isCompact) { return new _function_template.FunctionTemplate((options => template.render({ model: { appointmentCount: items.data.length, isCompact: isCompact }, container: options.container }))) } _createTemplate(count, isCompact) { this._initButtonTemplate(count, isCompact); return this.instance._getAppointmentTemplate("appointmentCollectorTemplate") } _initButtonTemplate(count, isCompact) { this.instance._templateManager.addDefaultTemplates({ appointmentCollector: new _function_template.FunctionTemplate((options => this._createButtonTemplate(count, (0, _renderer.default)(options.container), isCompact))) }) } _createButtonTemplate(appointmentCount, element, isCompact) { const text = isCompact ? appointmentCount : _message.default.getFormatter("dxScheduler-moreAppointments")(appointmentCount); return element.append((0, _renderer.default)("").text(text)).addClass("dx-scheduler-appointment-collector-content") } } }, 6324: /*!*********************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_constants.js ***! \*********************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.VIEWS = exports.LIST_ITEM_DATA_KEY = exports.LIST_ITEM_CLASS = exports.HORIZONTAL_GROUP_ORIENTATION = exports.APPOINTMENT_SETTINGS_KEY = void 0; exports.LIST_ITEM_DATA_KEY = "dxListItemData"; exports.LIST_ITEM_CLASS = "dx-list-item"; exports.APPOINTMENT_SETTINGS_KEY = "dxAppointmentSettings"; exports.HORIZONTAL_GROUP_ORIENTATION = "horizontal"; exports.VIEWS = { DAY: "day", WEEK: "week", WORK_WEEK: "workWeek", MONTH: "month", TIMELINE_DAY: "timelineDay", TIMELINE_WEEK: "timelineWeek", TIMELINE_WORK_WEEK: "timelineWorkWeek", TIMELINE_MONTH: "timelineMonth", AGENDA: "agenda" } }, 98865: /*!***************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_data_structures.js ***! \***************************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.AppointmentTooltipInfo = void 0; exports.AppointmentTooltipInfo = class { constructor(appointment) { let targetedAppointment = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : void 0; let color = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : []; let settings = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : []; this.appointment = appointment; this.targetedAppointment = targetedAppointment; this.color = color; this.settings = settings } } }, 90006: /*!************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_date_adapter.js ***! \************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _date = (obj = __webpack_require__( /*! ../../core/utils/date */ 91198), obj && obj.__esModule ? obj : { default: obj }); var obj; const toMs = _date.default.dateToMilliseconds; class DateAdapterCore { constructor(source) { this._source = new Date(source.getTime ? source.getTime() : source) } get source() { return this._source } result() { return this._source } getTimezoneOffset() { let format = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : void 0; const value = this._source.getTimezoneOffset(); if ("minute" === format) { return value * toMs("minute") } return value } getTime() { return this._source.getTime() } setTime(value) { this._source.setTime(value); return this } addTime(value) { this._source.setTime(this._source.getTime() + value); return this } setMinutes(value) { this._source.setMinutes(value); return this } addMinutes(value) { this._source.setMinutes(this._source.getMinutes() + value); return this } subtractMinutes(value) { this._source.setMinutes(this._source.getMinutes() - value); return this } } exports.default = date => new DateAdapterCore(date) }, 30906: /*!****************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_expression_utils.js ***! \****************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.ExpressionUtils = void 0; var _type = __webpack_require__( /*! ../../core/utils/type */ 35922); exports.ExpressionUtils = { getField: (dataAccessors, field, obj) => { if (!(0, _type.isDefined)(dataAccessors.getter[field])) { return } return dataAccessors.getter[field](obj) }, setField: (dataAccessors, field, obj, value) => { if (!(0, _type.isDefined)(dataAccessors.setter[field])) { return } dataAccessors.setter[field](obj, value); return obj } } }, 28066: /*!*******************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_loading.js ***! \*******************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.hide = function() { if (!loading) { return (new _deferred.Deferred).resolve() } return loading.hide().done(removeLoadPanel).promise() }; exports.show = function(options) { removeLoadPanel(); loading = createLoadPanel(options); return loading.show() }; var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../core/renderer */ 68374)); var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 62754); var _view_port = __webpack_require__( /*! ../../core/utils/view_port */ 77695); var _load_panel = _interopRequireDefault(__webpack_require__( /*! ../../ui/load_panel */ 97218)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } let loading = null; const createLoadPanel = function(options) { return new _load_panel.default((0, _renderer.default)("
").appendTo(options && options.container || (0, _view_port.value)()), options) }; const removeLoadPanel = function() { if (!loading) { return } loading.$element().remove(); loading = null } }, 38227: /*!**********************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_recurrence.js ***! \**********************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.getRecurrenceProcessor = getRecurrenceProcessor; var _errors = _interopRequireDefault(__webpack_require__( /*! ../../core/errors */ 17381)); var _date = _interopRequireDefault(__webpack_require__( /*! ../../core/utils/date */ 91198)); var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 95479); var _rrule = __webpack_require__( /*! rrule */ 98919); var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ./m_utils_time_zone */ 57880)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const toMs = _date.default.dateToMilliseconds; const ruleNames = ["freq", "interval", "byday", "byweekno", "byyearday", "bymonth", "bymonthday", "count", "until", "byhour", "byminute", "bysecond", "bysetpos", "wkst"]; const freqNames = ["DAILY", "WEEKLY", "MONTHLY", "YEARLY", "SECONDLY", "MINUTELY", "HOURLY"]; const days = { SU: 0, MO: 1, TU: 2, WE: 3, TH: 4, FR: 5, SA: 6 }; const loggedWarnings = []; const RRULE_BROKEN_TIMEZONES = ["Etc/GMT-13", "MIT", "Pacific/Apia", "Pacific/Enderbury", "Pacific/Tongatapu", "Etc/GMT-14", "Pacific/Kiritimati"]; let recurrence = null; function getRecurrenceProcessor() { if (!recurrence) { recurrence = new RecurrenceProcessor } return recurrence } class RecurrenceProcessor { constructor() { this.rRule = null; this.rRuleSet = null; this.validator = new RecurrenceValidator } generateDates(options) { const recurrenceRule = this.evalRecurrenceRule(options.rule); const { rule: rule } = recurrenceRule; if (!recurrenceRule.isValid || !rule.freq) { return [] } const rruleIntervalParams = this._createRruleIntervalParams(options); this._initializeRRule(options, rruleIntervalParams.startIntervalDate, rule.until); return this.rRuleSet.between(rruleIntervalParams.minViewDate, rruleIntervalParams.maxViewDate, true).filter((date => date.getTime() + rruleIntervalParams.appointmentDuration >= rruleIntervalParams.minViewTime)).map((date => this._convertRruleResult(rruleIntervalParams, options, date))) } _createRruleIntervalParams(options) { const { start: start, min: min, max: max, appointmentTimezoneOffset: appointmentTimezoneOffset } = options; const clientOffsets_startDate = _m_utils_time_zone.default.getClientTimezoneOffset(start), clientOffsets_minViewDate = _m_utils_time_zone.default.getClientTimezoneOffset(min), clientOffsets_maxViewDate = _m_utils_time_zone.default.getClientTimezoneOffset(max); const duration = options.end ? options.end.getTime() - options.start.getTime() : 0; const startIntervalDate = _m_utils_time_zone.default.setOffsetsToDate(options.start, [-clientOffsets_startDate, appointmentTimezoneOffset]); const minViewTime = options.min.getTime() - clientOffsets_minViewDate + appointmentTimezoneOffset; const minViewDate = new Date(minViewTime - duration); const maxViewDate = _m_utils_time_zone.default.setOffsetsToDate(options.max, [-clientOffsets_maxViewDate, appointmentTimezoneOffset]); const startDateDSTDifferenceMs = _m_utils_time_zone.default.getDiffBetweenClientTimezoneOffsets(options.start, startIntervalDate); const switchToSummerTime = startDateDSTDifferenceMs < 0; return { startIntervalDate: startIntervalDate, minViewTime: minViewTime, minViewDate: minViewDate, maxViewDate: maxViewDate, startIntervalDateDSTShift: switchToSummerTime ? 0 : startDateDSTDifferenceMs, appointmentDuration: duration } } _convertRruleResult(rruleIntervalParams, options, rruleDate) { const convertedBackDate = _m_utils_time_zone.default.setOffsetsToDate(rruleDate, [...this._getLocalMachineOffset(rruleDate), -options.appointmentTimezoneOffset, rruleIntervalParams.startIntervalDateDSTShift]); const convertedDateDSTShift = _m_utils_time_zone.default.getDiffBetweenClientTimezoneOffsets(convertedBackDate, rruleDate); const switchToSummerTime = convertedDateDSTShift < 0; const resultDate = _m_utils_time_zone.default.setOffsetsToDate(convertedBackDate, [convertedDateDSTShift]); const resultDateDSTShift = _m_utils_time_zone.default.getDiffBetweenClientTimezoneOffsets(resultDate, convertedBackDate); if (resultDateDSTShift && switchToSummerTime) { return new Date(resultDate.getTime() + resultDateDSTShift) } return resultDate } _getLocalMachineOffset(rruleDate) { const machineTimezoneOffset = _m_utils_time_zone.default.getClientTimezoneOffset(rruleDate); const machineTimezoneName = _date.default.getMachineTimezoneName(); const result = [machineTimezoneOffset]; const isTimezoneOffsetInBrokenRange = machineTimezoneOffset / 36e5 <= -13; const isTimezoneNameInBrokenNames = !machineTimezoneName || RRULE_BROKEN_TIMEZONES.some((timezone => machineTimezoneName.includes(timezone))); if (isTimezoneOffsetInBrokenRange && isTimezoneNameInBrokenNames) { result.push(-864e5) } return result } hasRecurrence(options) { return !!this.generateDates(options).length } evalRecurrenceRule(rule) { const result = { rule: {}, isValid: false }; if (rule) { result.rule = this._parseRecurrenceRule(rule); result.isValid = this.validator.validateRRule(result.rule, rule) } return result } isValidRecurrenceRule(rule) { return this.evalRecurrenceRule(rule).isValid } daysFromByDayRule(rule) { let result = []; if (rule.byday) { if (Array.isArray(rule.byday)) { result = rule.byday } else { result = rule.byday.split(",") } } return result.map((item => { const match = item.match(/[A-Za-z]+/); return !!match && match[0] })).filter((item => !!item)) } getAsciiStringByDate(date) { const currentOffset = date.getTimezoneOffset() * toMs("minute"); const offsetDate = new Date(date.getTime() + currentOffset); return `${offsetDate.getFullYear()+`0${offsetDate.getMonth()+1}`.slice(-2)+`0${offsetDate.getDate()}`.slice(-2)}T${`0${offsetDate.getHours()}`.slice(-2)}${`0${offsetDate.getMinutes()}`.slice(-2)}${`0${offsetDate.getSeconds()}`.slice(-2)}Z` } getRecurrenceString(object) { if (!object || !object.freq) { return } let result = ""; for (const field in object) { let value = object[field]; if ("interval" === field && value < 2) { continue } if ("until" === field) { value = this.getAsciiStringByDate(value) } result += `${field}=${value};` } result = result.substring(0, result.length - 1); return result.toUpperCase() } _parseExceptionToRawArray(value) { return value.match(/(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2}))?(Z)?/) } getDateByAsciiString(exceptionText) { if ("string" !== typeof exceptionText) { return exceptionText } const result = this._parseExceptionToRawArray(exceptionText); if (!result) { return null } const [year, month, date, hours, minutes, seconds, isUtc] = this._createDateTuple(result); if (isUtc) { return new Date(Date.UTC(year, month, date, hours, minutes, seconds)) } return new Date(year, month, date, hours, minutes, seconds) } _dispose() { if (this.rRuleSet) { delete this.rRuleSet; this.rRuleSet = null } if (this.rRule) { delete this.rRule; this.rRule = null } } _getTimeZoneOffset() { return (new Date).getTimezoneOffset() } _initializeRRule(options, startDateUtc, until) { const ruleOptions = _rrule.RRule.parseString(options.rule); const { firstDayOfWeek: firstDayOfWeek } = options; ruleOptions.dtstart = startDateUtc; if (!ruleOptions.wkst && firstDayOfWeek) { const weekDayNumbers = [6, 0, 1, 2, 3, 4, 5]; ruleOptions.wkst = weekDayNumbers[firstDayOfWeek] } if (until) { ruleOptions.until = _m_utils_time_zone.default.setOffsetsToDate(until, [-_m_utils_time_zone.default.getClientTimezoneOffset(until), options.appointmentTimezoneOffset]) } this._createRRule(ruleOptions); if (options.exception) { const exceptionStrings = options.exception; const exceptionDates = exceptionStrings.split(",").map((rule => this.getDateByAsciiString(rule))); exceptionDates.forEach((date => { if (options.getPostProcessedException) { date = options.getPostProcessedException(date) } const utcDate = _m_utils_time_zone.default.setOffsetsToDate(date, [-_m_utils_time_zone.default.getClientTimezoneOffset(date), options.appointmentTimezoneOffset]); this.rRuleSet.exdate(utcDate) })) } } _createRRule(ruleOptions) { this._dispose(); this.rRuleSet = new _rrule.RRuleSet; this.rRule = new _rrule.RRule(ruleOptions); this.rRuleSet.rrule(this.rRule) } _parseRecurrenceRule(recurrence) { const ruleObject = {}; const ruleParts = recurrence.split(";"); for (let i = 0, len = ruleParts.length; i < len; i++) { const rule = ruleParts[i].split("="); const ruleName = rule[0].toLowerCase(); const ruleValue = rule[1]; ruleObject[ruleName] = ruleValue } const count = parseInt(ruleObject.count); if (!isNaN(count)) { ruleObject.count = count } if (ruleObject.interval) { const interval = parseInt(ruleObject.interval); if (!isNaN(interval)) { ruleObject.interval = interval } } else { ruleObject.interval = 1 } if (ruleObject.freq && ruleObject.until) { ruleObject.until = this.getDateByAsciiString(ruleObject.until) } return ruleObject } _createDateTuple(parseResult) { const isUtc = void 0 !== parseResult[8]; parseResult.shift(); if (void 0 === parseResult[3]) { parseResult.splice(3) } else { parseResult.splice(3, 1); parseResult.splice(6) } parseResult[1]--; parseResult.unshift(null); return [parseInt(parseResult[1]), parseInt(parseResult[2]), parseInt(parseResult[3]), parseInt(parseResult[4]) || 0, parseInt(parseResult[5]) || 0, parseInt(parseResult[6]) || 0, isUtc] } } class RecurrenceValidator { validateRRule(rule, recurrence) { if (this._brokenRuleNameExists(rule) || !freqNames.includes(rule.freq) || this._wrongCountRule(rule) || this._wrongIntervalRule(rule) || this._wrongDayOfWeek(rule) || this._wrongByMonthDayRule(rule) || this._wrongByMonth(rule) || this._wrongUntilRule(rule)) { this._logBrokenRule(recurrence); return false } return true } _wrongUntilRule(rule) { let wrongUntil = false; const { until: until } = rule; if (void 0 !== until && !(until instanceof Date)) { wrongUntil = true } return wrongUntil } _wrongCountRule(rule) { let wrongCount = false; const { count: count } = rule; if (count && "string" === typeof count) { wrongCount = true } return wrongCount } _wrongByMonthDayRule(rule) { let wrongByMonthDay = false; const byMonthDay = rule.bymonthday; if (byMonthDay && isNaN(parseInt(byMonthDay))) { wrongByMonthDay = true } return wrongByMonthDay } _wrongByMonth(rule) { let wrongByMonth = false; const byMonth = rule.bymonth; if (byMonth && isNaN(parseInt(byMonth))) { wrongByMonth = true } return wrongByMonth } _wrongIntervalRule(rule) { let wrongInterval = false; const { interval: interval } = rule; if (interval && "string" === typeof interval) { wrongInterval = true } return wrongInterval } _wrongDayOfWeek(rule) { const byDay = rule.byday; const daysByRule = getRecurrenceProcessor().daysFromByDayRule(rule); let brokenDaysExist = false; if ("" === byDay) { brokenDaysExist = true }(0, _iterator.each)(daysByRule, ((_, day) => { if (!Object.prototype.hasOwnProperty.call(days, day)) { brokenDaysExist = true; return false } return })); return brokenDaysExist } _brokenRuleNameExists(rule) { let brokenRuleExists = false; (0, _iterator.each)(rule, (ruleName => { if (!ruleNames.includes(ruleName)) { brokenRuleExists = true; return false } return })); return brokenRuleExists } _logBrokenRule(recurrence) { if (!loggedWarnings.includes(recurrence)) { _errors.default.log("W0006", recurrence); loggedWarnings.push(recurrence) } } } }, 70184: /*!*****************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_recurrence_editor.js ***! \*****************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; __webpack_require__( /*! ../../ui/radio_group */ 14305); var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../core/component_registrator */ 99393)); var _guid = _interopRequireDefault(__webpack_require__( /*! ../../core/guid */ 73176)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../core/renderer */ 68374)); var _date = _interopRequireDefault(__webpack_require__( /*! ../../core/utils/date */ 91198)); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 13306); var _type = __webpack_require__( /*! ../../core/utils/type */ 35922); var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../localization/date */ 91500)); var _message = _interopRequireDefault(__webpack_require__( /*! ../../localization/message */ 28109)); var _button_group = _interopRequireDefault(__webpack_require__( /*! ../../ui/button_group */ 28236)); var _date_box = _interopRequireDefault(__webpack_require__( /*! ../../ui/date_box */ 29589)); var _editor = _interopRequireDefault(__webpack_require__( /*! ../../ui/editor/editor */ 96452)); var _form = _interopRequireDefault(__webpack_require__( /*! ../../ui/form */ 17737)); var _number_box = _interopRequireDefault(__webpack_require__( /*! ../../ui/number_box */ 34171)); var _themes = __webpack_require__( /*! ../../ui/themes */ 75811); var _index = __webpack_require__( /*! ../scheduler/r1/timezone_calculator/index */ 6155); var _m_recurrence = __webpack_require__( /*! ./m_recurrence */ 38227); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const REPEAT_END_EDITOR = "dx-recurrence-repeat-end"; const INTERVAL_EDITOR = "dx-recurrence-numberbox-interval"; const frequenciesMessages = [{ recurrence: "dxScheduler-recurrenceHourly", value: "hourly" }, { recurrence: "dxScheduler-recurrenceDaily", value: "daily" }, { recurrence: "dxScheduler-recurrenceWeekly", value: "weekly" }, { recurrence: "dxScheduler-recurrenceMonthly", value: "monthly" }, { recurrence: "dxScheduler-recurrenceYearly", value: "yearly" }]; const frequencies = frequenciesMessages.map((item => ({ text: () => _message.default.format(item.recurrence), value: item.value }))); const repeatEndTypes = [{ type: "never" }, { type: "until" }, { type: "count" }]; const days = ["SU", "MO", "TU", "WE", "TH", "FR", "SA"]; const getStylingModeFunc = () => (0, _themes.isFluent)((0, _themes.current)()) ? "filled" : void 0; class RecurrenceRule { constructor(rule) { this._recurrenceProcessor = (0, _m_recurrence.getRecurrenceProcessor)(); this._recurrenceProcessor = (0, _m_recurrence.getRecurrenceProcessor)(); this._recurrenceRule = this._recurrenceProcessor.evalRecurrenceRule(rule).rule } makeRules(string) { this._recurrenceRule = this._recurrenceProcessor.evalRecurrenceRule(string).rule } makeRule(field, value) { if (!value || Array.isArray(value) && !value.length) { delete this._recurrenceRule[field]; return } if ((0, _type.isDefined)(field)) { if ("until" === field) { delete this._recurrenceRule.count } if ("count" === field) { delete this._recurrenceRule.until } this._recurrenceRule[field] = value } } getRepeatEndRule() { const rules = this._recurrenceRule; if ("count" in rules) { return "count" } if ("until" in rules) { return "until" } return "never" } getRecurrenceString() { return this._recurrenceProcessor.getRecurrenceString(this._recurrenceRule) } getRules() { return this._recurrenceRule } getDaysFromByDayRule() { return this._recurrenceProcessor.daysFromByDayRule(this._recurrenceRule) } } class RecurrenceEditor extends _editor.default { _getDefaultOptions() { const defaultOptions = super._getDefaultOptions(); return (0, _extend.extend)(defaultOptions, { value: null, startDate: new Date, firstDayOfWeek: void 0 }) } _getFirstDayOfWeek() { const firstDayOfWeek = this.option("firstDayOfWeek"); return (0, _type.isDefined)(firstDayOfWeek) ? firstDayOfWeek : _date2.default.firstDayOfWeekIndex() } _createComponent(element, name) { let config = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; this._extendConfig(config, { readOnly: this.option("readOnly") }); return super._createComponent(element, name, config) } _init() { super._init(); this._recurrenceRule = new RecurrenceRule(this.option("value")) } _render() { super._render(); this.$element().addClass("dx-recurrence-editor"); this._$container = (0, _renderer.default)("
").addClass("dx-recurrence-editor-container").appendTo(this.$element()); this._prepareEditors(); this._renderEditors(this._$container) } getEditorByField(fieldName) { let editor = this.getRecurrenceForm().getEditor(fieldName); if (!(0, _type.isDefined)(editor)) { switch (fieldName) { case "byday": editor = this._weekEditor; break; case "count": editor = this._repeatCountEditor; break; case "until": editor = this._repeatUntilDate } } return editor } _prepareEditors() { const freq = (this._recurrenceRule.getRules().freq || frequenciesMessages[1].value).toLowerCase(); this._editors = [this._createFreqEditor(freq), this._createIntervalEditor(freq), this._createRepeatOnLabel(freq), { itemType: "group", cssClass: "dx-recurrence-repeat-on", colCount: 2, colCountByScreen: { xs: 2 }, items: this._createRepeatOnEditor(freq) }, { itemType: "group", items: this._createRepeatEndEditor() }]; return this._editors } _createFreqEditor(freq) { return { dataField: "freq", name: "FREQ", editorType: "dxSelectBox", cssClass: "dx-recurrence-selectbox-freq", editorOptions: { stylingMode: getStylingModeFunc(), items: frequencies, value: freq, field: "freq", valueExpr: "value", displayExpr: "text", layout: "horizontal", elementAttr: { class: "dx-recurrence-selectbox-freq" }, onValueChanged: args => this._valueChangedHandler(args) }, label: { text: _message.default.format("dxScheduler-editorLabelRecurrence") } } } _createIntervalEditor(freq) { const interval = this._recurrenceRule.getRules().interval || 1; return { itemType: "group", colCount: 2, cssClass: `${INTERVAL_EDITOR}-wrapper`, colCountByScreen: { xs: 2 }, items: [{ dataField: "interval", editorType: "dxNumberBox", editorOptions: { stylingMode: getStylingModeFunc(), format: "#", width: 70, min: 1, field: "interval", value: interval, showSpinButtons: true, useLargeSpinButtons: false, elementAttr: { class: INTERVAL_EDITOR }, onValueChanged: args => this._valueChangedHandler(args) }, label: { text: _message.default.format("dxScheduler-recurrenceRepeatEvery") } }, { name: "intervalLabel", cssClass: `${INTERVAL_EDITOR}-label`, template: () => _message.default.format(`dxScheduler-recurrenceRepeat${freq.charAt(0).toUpperCase()}${freq.substr(1).toLowerCase()}`) }] } } _createRepeatOnLabel(freq) { return { itemType: "group", cssClass: "dx-recurrence-repeat-on-label", items: [{ name: "repeatOnLabel", colSpan: 2, template: () => _message.default.format("dxScheduler-recurrenceRepeatOn"), visible: freq && "daily" !== freq && "hourly" !== freq }] } } _createRepeatOnEditor(freq) { return [this._createByDayEditor(freq), this._createByMonthEditor(freq), this._createByMonthDayEditor(freq)] } _createByDayEditor(freq) { return { dataField: "byday", colSpan: 2, template: (_, itemElement) => { const firstDayOfWeek = this._getFirstDayOfWeek(); const byDay = this._daysOfWeekByRules(); const localDaysNames = _date2.default.getDayNames("abbreviated"); const dayNames = days.slice(firstDayOfWeek).concat(days.slice(0, firstDayOfWeek)); const itemsButtonGroup = localDaysNames.slice(firstDayOfWeek).concat(localDaysNames.slice(0, firstDayOfWeek)).map(((item, index) => ({ text: item, key: dayNames[index] }))); this._$repeatOnWeek = (0, _renderer.default)("
").addClass("dx-recurrence-button-group").appendTo(itemElement); this._weekEditor = this._createComponent(this._$repeatOnWeek, _button_group.default, { items: itemsButtonGroup, field: "byday", selectionMode: "multiple", selectedItemKeys: byDay, keyExpr: "key", onSelectionChanged: e => { const selectedItemKeys = e.component.option("selectedItemKeys"); const selectedKeys = null !== selectedItemKeys && void 0 !== selectedItemKeys && selectedItemKeys.length ? selectedItemKeys : this._getDefaultByDayValue(); this._recurrenceRule.makeRule("byday", selectedKeys); this._changeEditorValue() } }) }, visible: "weekly" === freq, label: { visible: false } } } _createByMonthEditor(freq) { const monthsName = _date2.default.getMonthNames("wide"); const months = [...Array(12)].map(((_, i) => ({ value: `${i+1}`, text: monthsName[i] }))); return { dataField: "bymonth", editorType: "dxSelectBox", editorOptions: { stylingMode: getStylingModeFunc(), field: "bymonth", items: months, value: this._monthOfYearByRules(), width: 120, displayExpr: "text", valueExpr: "value", elementAttr: { class: "dx-recurrence-selectbox-month-of-year" }, onValueChanged: args => this._valueChangedHandler(args) }, visible: "yearly" === freq, label: { visible: false } } } _createByMonthDayEditor(freq) { return { dataField: "bymonthday", editorType: "dxNumberBox", editorOptions: { stylingMode: getStylingModeFunc(), min: 1, max: 31, format: "#", width: 70, field: "bymonthday", showSpinButtons: true, useLargeSpinButtons: false, value: this._dayOfMonthByRules(), elementAttr: { class: "dx-recurrence-numberbox-day-of-month" }, onValueChanged: args => this._valueChangedHandler(args) }, visible: "monthly" === freq || "yearly" === freq, label: { visible: false } } } _createRepeatEndEditor() { const repeatType = this._recurrenceRule.getRepeatEndRule(); return [{ dataField: "repeatEnd", editorType: "dxRadioGroup", editorOptions: { items: repeatEndTypes, value: repeatType, valueExpr: "type", field: "repeatEnd", itemTemplate: itemData => { if ("count" === itemData.type) { return this._renderRepeatCountEditor() } if ("until" === itemData.type) { return this._renderRepeatUntilEditor() } return this._renderDefaultRepeatEnd() }, layout: "vertical", elementAttr: { class: "dx-recurrence-radiogroup-repeat-type" }, onValueChanged: args => this._repeatEndValueChangedHandler(args) }, label: { text: _message.default.format("dxScheduler-recurrenceEnd") } }] } _renderEditors($container) { this._recurrenceForm = this._createComponent($container, _form.default, { items: this._editors, showValidationSummary: false, scrollingEnabled: true, showColonAfterLabel: false, labelLocation: "top" }); this._disableRepeatEndParts() } _setAriaDescribedBy(editor, $label) { const labelId = `label-${new _guid.default}`; editor.setAria("describedby", labelId); editor.setAria("id", labelId, $label) } getRecurrenceForm() { return this._recurrenceForm } changeValueByVisibility(value) { if (value) { if (!this.option("value")) { this._handleDefaults() } } else { this._recurrenceRule.makeRules(""); this.option("value", "") } } _handleDefaults() { this._recurrenceRule.makeRule("freq", frequenciesMessages[1].value); this._changeEditorValue() } _changeEditorValue() { this.option("value", this._recurrenceRule.getRecurrenceString() || "") } _daysOfWeekByRules() { let daysByRule = this._recurrenceRule.getDaysFromByDayRule(); if (!daysByRule.length) { daysByRule = this._getDefaultByDayValue() } return daysByRule } _getDefaultByDayValue() { const startDate = this.option("startDate"); const startDay = startDate.getDay(); return [days[startDay]] } _dayOfMonthByRules() { let dayByRule = this._recurrenceRule.getRules().bymonthday; if (!dayByRule) { dayByRule = this.option("startDate").getDate() } return dayByRule } _monthOfYearByRules() { let monthByRule = this._recurrenceRule.getRules().bymonth; if (!monthByRule) { monthByRule = this.option("startDate").getMonth() + 1 } return String(monthByRule) } _renderDefaultRepeatEnd() { const $editorTemplate = (0, _renderer.default)("
").addClass(REPEAT_END_EDITOR + "-wrapper"); (0, _renderer.default)("
").text(_message.default.format("dxScheduler-recurrenceNever")).addClass(REPEAT_END_EDITOR + "-label").appendTo($editorTemplate); return $editorTemplate } _repeatEndValueChangedHandler(args) { const { value: value } = args; this._disableRepeatEndParts(value); if ("until" === value) { this._recurrenceRule.makeRule(value, this._getUntilValue()) } if ("count" === value) { this._recurrenceRule.makeRule(value, this._repeatCountEditor.option("value")) } if ("never" === value) { this._recurrenceRule.makeRule("count", ""); this._recurrenceRule.makeRule("until", "") } this._changeEditorValue() } _disableRepeatEndParts() { let value = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this._recurrenceRule.getRepeatEndRule(); if ("until" === value) { this._repeatCountEditor.option("disabled", true); this._repeatUntilDate.option("disabled", false) } if ("count" === value) { this._repeatCountEditor.option("disabled", false); this._repeatUntilDate.option("disabled", true) } if ("never" === value) { this._repeatCountEditor.option("disabled", true); this._repeatUntilDate.option("disabled", true) } } _renderRepeatCountEditor() { const repeatCount = this._recurrenceRule.getRules().count || 1; const $editorWrapper = (0, _renderer.default)("
").addClass(REPEAT_END_EDITOR + "-wrapper"); (0, _renderer.default)("
").text(_message.default.format("dxScheduler-recurrenceAfter")).addClass(REPEAT_END_EDITOR + "-label").appendTo($editorWrapper); this._$repeatCountEditor = (0, _renderer.default)("
").addClass("dx-recurrence-numberbox-repeat-count").appendTo($editorWrapper); (0, _renderer.default)("
").text(_message.default.format("dxScheduler-recurrenceRepeatCount")).addClass(REPEAT_END_EDITOR + "-label").appendTo($editorWrapper); this._repeatCountEditor = this._createComponent(this._$repeatCountEditor, _number_box.default, { stylingMode: getStylingModeFunc(), field: "count", format: "#", width: 70, min: 1, showSpinButtons: true, useLargeSpinButtons: false, value: repeatCount, onValueChanged: this._repeatCountValueChangeHandler.bind(this) }); return $editorWrapper } _repeatCountValueChangeHandler(args) { if ("count" === this._recurrenceRule.getRepeatEndRule()) { const { value: value } = args; this._recurrenceRule.makeRule("count", value); this._changeEditorValue() } } _formatUntilDate(date) { if (this._recurrenceRule.getRules().until && _date.default.sameDate(this._recurrenceRule.getRules().until, date)) { return date } return _date.default.setToDayEnd(date) } _renderRepeatUntilEditor() { const repeatUntil = this._getUntilValue(); const $editorWrapper = (0, _renderer.default)("
").addClass(REPEAT_END_EDITOR + "-wrapper"); (0, _renderer.default)("
").text(_message.default.format("dxScheduler-recurrenceOn")).addClass(REPEAT_END_EDITOR + "-label").appendTo($editorWrapper); this._$repeatDateEditor = (0, _renderer.default)("
").addClass("dx-recurrence-datebox-until-date").appendTo($editorWrapper); this._repeatUntilDate = this._createComponent(this._$repeatDateEditor, _date_box.default, { stylingMode: getStylingModeFunc(), field: "until", value: repeatUntil, type: "date", onValueChanged: this._repeatUntilValueChangeHandler.bind(this), calendarOptions: { firstDayOfWeek: this._getFirstDayOfWeek() }, useMaskBehavior: true }); return $editorWrapper } _repeatUntilValueChangeHandler(args) { if ("until" === this._recurrenceRule.getRepeatEndRule()) { const dateInTimeZone = this._formatUntilDate(new Date(args.value)); const getStartDateTimeZone = this.option("getStartDateTimeZone"); const appointmentTimeZone = getStartDateTimeZone(); const path = appointmentTimeZone ? _index.PathTimeZoneConversion.fromAppointmentToSource : _index.PathTimeZoneConversion.fromGridToSource; const dateInLocaleTimeZone = this.option("timeZoneCalculator").createDate(dateInTimeZone, { path: path, appointmentTimeZone: appointmentTimeZone }); this._recurrenceRule.makeRule("until", dateInLocaleTimeZone); this._changeEditorValue() } } _valueChangedHandler(args) { const { value: value, previousValue: previousValue } = args; const field = args.component.option("field"); if (!this.option("visible")) { this.option("value", "") } else { this._recurrenceRule.makeRule(field, value); if ("freq" === field) { this._makeRepeatOnRule(value); this._changeRepeatOnVisibility(value, previousValue) } this._changeEditorValue() } } _makeRepeatOnRule(value) { if ("daily" === value || "hourly" === value) { this._recurrenceRule.makeRule("byday", ""); this._recurrenceRule.makeRule("bymonth", ""); this._recurrenceRule.makeRule("bymonthday", "") } if ("weekly" === value) { this._recurrenceRule.makeRule("byday", this._daysOfWeekByRules()); this._recurrenceRule.makeRule("bymonth", ""); this._recurrenceRule.makeRule("bymonthday", "") } if ("monthly" === value) { this._recurrenceRule.makeRule("bymonthday", this._dayOfMonthByRules()); this._recurrenceRule.makeRule("bymonth", ""); this._recurrenceRule.makeRule("byday", "") } if ("yearly" === value) { this._recurrenceRule.makeRule("bymonthday", this._dayOfMonthByRules()); this._recurrenceRule.makeRule("bymonth", this._monthOfYearByRules()); this._recurrenceRule.makeRule("byday", "") } } _optionChanged(args) { var _this$_recurrenceForm, _this$_repeatCountEdi, _this$_weekEditor, _this$_repeatUntilDat; switch (args.name) { case "readOnly": null === (_this$_recurrenceForm = this._recurrenceForm) || void 0 === _this$_recurrenceForm || _this$_recurrenceForm.option("readOnly", args.value); null === (_this$_repeatCountEdi = this._repeatCountEditor) || void 0 === _this$_repeatCountEdi || _this$_repeatCountEdi.option("readOnly", args.value); null === (_this$_weekEditor = this._weekEditor) || void 0 === _this$_weekEditor || _this$_weekEditor.option("readOnly", args.value); null === (_this$_repeatUntilDat = this._repeatUntilDate) || void 0 === _this$_repeatUntilDat || _this$_repeatUntilDat.option("readOnly", args.value); super._optionChanged(args); break; case "value": this._recurrenceRule.makeRules(args.value); this._changeRepeatIntervalLabel(); this._disableRepeatEndParts(); this._changeEditorsValue(this._recurrenceRule.getRules()); super._optionChanged(args); break; case "startDate": this._makeRepeatOnRule(this._recurrenceRule.getRules().freq); if ((0, _type.isDefined)(this._recurrenceRule.getRecurrenceString())) { this._changeEditorValue() } break; case "firstDayOfWeek": if (this._weekEditor) { const localDaysNames = _date2.default.getDayNames("abbreviated"); const dayNames = days.slice(args.value).concat(days.slice(0, args.value)); const itemsButtonGroup = localDaysNames.slice(args.value).concat(localDaysNames.slice(0, args.value)).map(((item, index) => ({ text: item, key: dayNames[index] }))); this._weekEditor.option("items", itemsButtonGroup) } if (this._$repeatDateEditor) { this._repeatUntilDate.option("calendarOptions.firstDayOfWeek", this._getFirstDayOfWeek()) } break; default: super._optionChanged(args) } } _changeRepeatOnVisibility(freq, previousFreq) { if (freq !== previousFreq) { this._recurrenceForm.itemOption("byday", "visible", false); this._recurrenceForm.itemOption("bymonthday", "visible", false); this._recurrenceForm.itemOption("bymonth", "visible", false); this._recurrenceForm.itemOption("repeatOnLabel", "visible", freq && "daily" !== freq && "hourly" !== freq); if ("weekly" === freq) { this._recurrenceForm.itemOption("byday", "visible", true) } if ("monthly" === freq) { this._recurrenceForm.itemOption("bymonthday", "visible", true) } if ("yearly" === freq) { this._recurrenceForm.itemOption("bymonthday", "visible", true); this._recurrenceForm.itemOption("bymonth", "visible", true) } } } _changeRepeatIntervalLabel() { const { freq: freq } = this._recurrenceRule.getRules(); freq && this._recurrenceForm.itemOption("intervalLabel", "template", _message.default.format(`dxScheduler-recurrenceRepeat${freq.charAt(0).toUpperCase()}${freq.substr(1).toLowerCase()}`)) } _changeEditorsValue(rules) { this._recurrenceForm.getEditor("freq").option("value", (rules.freq || frequenciesMessages[1].value).toLowerCase()); this._changeDayOfWeekValue(); this._changeDayOfMonthValue(); this._changeMonthOfYearValue(); this._changeIntervalValue(rules.interval); this._changeRepeatCountValue(); this._changeRepeatEndValue(); this._changeRepeatUntilValue() } _changeIntervalValue(value) { this._recurrenceForm.getEditor("interval").option("value", value || 1) } _changeRepeatEndValue() { const repeatType = this._recurrenceRule.getRepeatEndRule(); this._recurrenceForm.getEditor("repeatEnd").option("value", repeatType) } _changeDayOfWeekValue() { const isEditorVisible = this._recurrenceForm.itemOption("byday").visible; if (isEditorVisible) { const days = this._daysOfWeekByRules(); this.getEditorByField("byday").option("selectedItemKeys", days) } } _changeDayOfMonthValue() { const isEditorVisible = this._recurrenceForm.itemOption("bymonthday").visible; if (isEditorVisible) { const day = this._dayOfMonthByRules(); this._recurrenceForm.getEditor("bymonthday").option("value", day) } } _changeMonthOfYearValue() { const isEditorVisible = this._recurrenceForm.itemOption("bymonth").visible; if (isEditorVisible) { const month = this._monthOfYearByRules(); this._recurrenceForm.getEditor("bymonth").option("value", month) } } _changeRepeatCountValue() { const count = this._recurrenceRule.getRules().count || 1; this._repeatCountEditor.option("value", count) } _changeRepeatUntilValue() { this._repeatUntilDate.option("value", this._getUntilValue()) } _getUntilValue() { const untilDate = this._recurrenceRule.getRules().until; if (!untilDate) { return this._formatUntilDate(new Date) } const getStartDateTimeZone = this.option("getStartDateTimeZone"); const appointmentTimeZone = getStartDateTimeZone(); const path = appointmentTimeZone ? _index.PathTimeZoneConversion.fromSourceToAppointment : _index.PathTimeZoneConversion.fromSourceToGrid; return this.option("timeZoneCalculator").createDate(untilDate, { path: path, appointmentTimeZone: appointmentTimeZone }) } toggle() { this._freqEditor.focus() } setAria() { if (this._switchEditor) { this._switchEditor.setAria(arguments.length <= 0 ? void 0 : arguments[0], arguments.length <= 1 ? void 0 : arguments[1]) } } }(0, _component_registrator.default)("dxRecurrenceEditor", RecurrenceEditor); exports.default = RecurrenceEditor }, 97468: /*!*********************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_scheduler.js ***! \*********************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../core/component_registrator */ 99393)); var _config = _interopRequireDefault(__webpack_require__( /*! ../../core/config */ 80209)); var _devices = _interopRequireDefault(__webpack_require__( /*! ../../core/devices */ 20530)); var _element = __webpack_require__( /*! ../../core/element */ 6415); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../core/renderer */ 68374)); var _bindable_template = __webpack_require__( /*! ../../core/templates/bindable_template */ 93280); var _empty_template = __webpack_require__( /*! ../../core/templates/empty_template */ 10688); var _callbacks = _interopRequireDefault(__webpack_require__( /*! ../../core/utils/callbacks */ 44504)); var _common = __webpack_require__( /*! ../../core/utils/common */ 20576); var _data = __webpack_require__( /*! ../../core/utils/data */ 47617); var _date = _interopRequireDefault(__webpack_require__( /*! ../../core/utils/date */ 91198)); var _date_serialization = _interopRequireDefault(__webpack_require__( /*! ../../core/utils/date_serialization */ 69434)); var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 95479); var _position = __webpack_require__( /*! ../../core/utils/position */ 37518); var _type = __webpack_require__( /*! ../../core/utils/type */ 35922); var _window = __webpack_require__( /*! ../../core/utils/window */ 58201); var _data_helper = _interopRequireDefault(__webpack_require__( /*! ../../data_helper */ 53305)); var _visibility_change = __webpack_require__( /*! ../../events/visibility_change */ 80506); var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../localization/date */ 91500)); var _message = _interopRequireDefault(__webpack_require__( /*! ../../localization/message */ 28109)); var _dialog = __webpack_require__( /*! ../../ui/dialog */ 15029); var _themes = __webpack_require__( /*! ../../ui/themes */ 75811); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../ui/widget/ui.errors */ 96688)); var _ui2 = _interopRequireDefault(__webpack_require__( /*! ../../ui/widget/ui.widget */ 14390)); var _date3 = __webpack_require__( /*! ../core/utils/date */ 24321); var _index = __webpack_require__( /*! ../scheduler/r1/timezone_calculator/index */ 6155); var _index2 = __webpack_require__( /*! ../scheduler/r1/utils/index */ 94084); var _m_form = __webpack_require__( /*! ./appointment_popup/m_form */ 25387); var _m_popup = __webpack_require__( /*! ./appointment_popup/m_popup */ 77135); var _m_appointment_data_provider = __webpack_require__( /*! ./appointments/data_provider/m_appointment_data_provider */ 92823); var _m_appointment_collection = _interopRequireDefault(__webpack_require__( /*! ./appointments/m_appointment_collection */ 16993)); var _m_header = __webpack_require__( /*! ./header/m_header */ 5757); var _m_appointment_adapter = __webpack_require__( /*! ./m_appointment_adapter */ 72734); var _m_appointments_layout_manager = _interopRequireDefault(__webpack_require__( /*! ./m_appointments_layout_manager */ 43919)); var _m_compact_appointments_helper = __webpack_require__( /*! ./m_compact_appointments_helper */ 38088); var _m_constants = __webpack_require__( /*! ./m_constants */ 6324); var _m_data_structures = __webpack_require__( /*! ./m_data_structures */ 98865); var _m_expression_utils = __webpack_require__( /*! ./m_expression_utils */ 30906); var _m_loading = __webpack_require__( /*! ./m_loading */ 28066); var _m_recurrence = __webpack_require__( /*! ./m_recurrence */ 38227); var _m_subscribes = _interopRequireDefault(__webpack_require__( /*! ./m_subscribes */ 86681)); var _m_utils = __webpack_require__( /*! ./m_utils */ 84110); var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ./m_utils_time_zone */ 57880)); var _index3 = __webpack_require__( /*! ./options_validator/index */ 18397); var _m_agenda_resource_processor = __webpack_require__( /*! ./resources/m_agenda_resource_processor */ 547); var _m_utils2 = __webpack_require__( /*! ./resources/m_utils */ 31359); var _m_desktop_tooltip_strategy = __webpack_require__( /*! ./tooltip_strategies/m_desktop_tooltip_strategy */ 48158); var _m_mobile_tooltip_strategy = __webpack_require__( /*! ./tooltip_strategies/m_mobile_tooltip_strategy */ 60737); var _m_agenda = _interopRequireDefault(__webpack_require__( /*! ./workspaces/m_agenda */ 32316)); var _m_timeline_day = _interopRequireDefault(__webpack_require__( /*! ./workspaces/m_timeline_day */ 10356)); var _m_timeline_month = _interopRequireDefault(__webpack_require__( /*! ./workspaces/m_timeline_month */ 91274)); var _m_timeline_week = _interopRequireDefault(__webpack_require__( /*! ./workspaces/m_timeline_week */ 32414)); var _m_timeline_work_week = _interopRequireDefault(__webpack_require__( /*! ./workspaces/m_timeline_work_week */ 23855)); var _m_work_space_day = _interopRequireDefault(__webpack_require__( /*! ./workspaces/m_work_space_day */ 74228)); var _m_work_space_month = _interopRequireDefault(__webpack_require__( /*! ./workspaces/m_work_space_month */ 50011)); var _m_work_space_week = _interopRequireDefault(__webpack_require__( /*! ./workspaces/m_work_space_week */ 36828)); var _m_work_space_work_week = _interopRequireDefault(__webpack_require__( /*! ./workspaces/m_work_space_work_week */ 29544)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const toMs = _date.default.dateToMilliseconds; const VIEWS_CONFIG = { day: { workSpace: _m_work_space_day.default, renderingStrategy: "vertical" }, week: { workSpace: _m_work_space_week.default, renderingStrategy: "vertical" }, workWeek: { workSpace: _m_work_space_work_week.default, renderingStrategy: "vertical" }, month: { workSpace: _m_work_space_month.default, renderingStrategy: "horizontalMonth" }, timelineDay: { workSpace: _m_timeline_day.default, renderingStrategy: "horizontal" }, timelineWeek: { workSpace: _m_timeline_week.default, renderingStrategy: "horizontal" }, timelineWorkWeek: { workSpace: _m_timeline_work_week.default, renderingStrategy: "horizontal" }, timelineMonth: { workSpace: _m_timeline_month.default, renderingStrategy: "horizontalMonthLine" }, agenda: { workSpace: _m_agenda.default, renderingStrategy: "agenda" } }; const StoreEventNames_ADDING = "onAppointmentAdding", StoreEventNames_ADDED = "onAppointmentAdded", StoreEventNames_DELETING = "onAppointmentDeleting", StoreEventNames_DELETED = "onAppointmentDeleted", StoreEventNames_UPDATING = "onAppointmentUpdating", StoreEventNames_UPDATED = "onAppointmentUpdated"; const RECURRENCE_EDITING_MODE_SERIES = "editSeries", RECURRENCE_EDITING_MODE_OCCURENCE = "editOccurence", RECURRENCE_EDITING_MODE_CANCEL = "cancel"; class Scheduler extends _ui2.default { _getDefaultOptions() { const defaultOptions = (0, _extend.extend)(super._getDefaultOptions(), { views: ["day", "week"], currentView: "day", currentDate: _date.default.trimTime(new Date), min: void 0, max: void 0, dateSerializationFormat: void 0, firstDayOfWeek: void 0, groups: [], resources: [], loadedResources: [], resourceLoaderMap: new Map, dataSource: null, customizeDateNavigatorText: void 0, appointmentTemplate: "item", dropDownAppointmentTemplate: "dropDownAppointment", appointmentCollectorTemplate: "appointmentCollector", dataCellTemplate: null, timeCellTemplate: null, resourceCellTemplate: null, dateCellTemplate: null, startDayHour: 0, endDayHour: 24, offset: 0, editing: { allowAdding: true, allowDeleting: true, allowDragging: true, allowResizing: true, allowUpdating: true, allowTimeZoneEditing: false }, showAllDayPanel: true, showCurrentTimeIndicator: true, shadeUntilCurrentTime: false, indicatorUpdateInterval: 3e5, indicatorTime: void 0, recurrenceEditMode: "dialog", cellDuration: 30, maxAppointmentsPerCell: "auto", selectedCellData: [], groupByDate: false, onAppointmentRendered: null, onAppointmentClick: null, onAppointmentDblClick: null, onAppointmentContextMenu: null, onCellClick: null, onCellContextMenu: null, onAppointmentAdding: null, onAppointmentAdded: null, onAppointmentUpdating: null, onAppointmentUpdated: null, onAppointmentDeleting: null, onAppointmentDeleted: null, onAppointmentFormOpening: null, onAppointmentTooltipShowing: null, appointmentTooltipTemplate: "appointmentTooltip", appointmentPopupTemplate: "appointmentPopup", crossScrollingEnabled: false, useDropDownViewSwitcher: false, startDateExpr: "startDate", endDateExpr: "endDate", textExpr: "text", descriptionExpr: "description", allDayExpr: "allDay", recurrenceRuleExpr: "recurrenceRule", recurrenceExceptionExpr: "recurrenceException", disabledExpr: "disabled", remoteFiltering: false, timeZone: "", startDateTimeZoneExpr: "startDateTimeZone", endDateTimeZoneExpr: "endDateTimeZone", noDataText: _message.default.format("dxCollectionWidget-noDataText"), adaptivityEnabled: false, allowMultipleCellSelection: true, scrolling: { mode: "standard" }, allDayPanelMode: "all", renovateRender: true, _draggingMode: "outlook", _appointmentTooltipOffset: { x: 0, y: 0 }, _appointmentTooltipButtonsPosition: "bottom", _appointmentTooltipOpenButtonText: _message.default.format("dxScheduler-openAppointment"), _appointmentCountPerCell: 2, _collectorOffset: 0, _appointmentOffset: 26, toolbar: [{ location: "before", defaultElement: "dateNavigator" }, { location: "after", defaultElement: "viewSwitcher" }] }); return (0, _extend.extend)(true, defaultOptions, { integrationOptions: { useDeferUpdateForTemplates: false } }) } get filteredItems() { if (!this._filteredItems) { this._filteredItems = [] } return this._filteredItems } set filteredItems(value) { this._filteredItems = value } get preparedItems() { if (!this._preparedItems) { this._preparedItems = [] } return this._preparedItems } set preparedItems(value) { this._preparedItems = value } get currentView() { return _index2.viewsUtils.getCurrentView(this.option("currentView"), this.option("views")) } get currentViewType() { return (0, _type.isObject)(this.currentView) ? this.currentView.type : this.currentView } get timeZoneCalculator() { if (!this._timeZoneCalculator) { this._timeZoneCalculator = (0, _index.createTimeZoneCalculator)(this.option("timeZone")) } return this._timeZoneCalculator } _setDeprecatedOptions() { super._setDeprecatedOptions(); (0, _extend.extend)(this._deprecatedOptions, { dropDownAppointmentTemplate: { since: "19.2", message: "appointmentTooltipTemplate" } }) } _defaultOptionsRules() { return super._defaultOptionsRules().concat([{ device: () => "desktop" === _devices.default.real().deviceType && !_devices.default.isSimulator(), options: { focusStateEnabled: true } }, { device: () => !_devices.default.current().generic, options: { useDropDownViewSwitcher: true, editing: { allowDragging: false, allowResizing: false } } }, { device: () => (0, _themes.isMaterialBased)(), options: { useDropDownViewSwitcher: true, dateCellTemplate(data, index, element) { const { text: text } = data; text.split(" ").forEach(((text, index) => { const span = (0, _renderer.default)("").text(text).addClass("dx-scheduler-header-panel-cell-date"); (0, _renderer.default)(element).append(span); if (!index) { (0, _renderer.default)(element).append(" ") } })) }, _appointmentTooltipButtonsPosition: "top", _appointmentTooltipOpenButtonText: null, _appointmentCountPerCell: 1, _collectorOffset: 20, _appointmentOffset: 30 } }, { device: () => (0, _themes.isMaterial)(), options: { _appointmentTooltipOffset: { x: 0, y: 11 } } }]) } _postponeDataSourceLoading(promise) { this.postponedOperations.add("_reloadDataSource", this._reloadDataSource.bind(this), promise) } _postponeResourceLoading() { const whenLoaded = this.postponedOperations.add("loadResources", (() => { const groups = this._getCurrentViewOption("groups"); return (0, _m_utils2.loadResources)(groups, this.option("resources"), this.option("resourceLoaderMap")) })); const resolveCallbacks = new _deferred.Deferred; whenLoaded.done((resources => { this.option("loadedResources", resources); resolveCallbacks.resolve(resources) })); this._postponeDataSourceLoading(whenLoaded); return resolveCallbacks.promise() } _optionChanged(args) { var _this$_header, _this$_header2, _this$_header4; this.validateOptions(); let { value: value } = args; const { name: name } = args; switch (args.name) { case "customizeDateNavigatorText": this._updateOption("header", name, value); break; case "firstDayOfWeek": this._updateOption("workSpace", name, value); this._updateOption("header", name, value); break; case "currentDate": value = this._dateOption(name); value = _date.default.trimTime(new Date(value)); this.option("selectedCellData", []); this._workSpace.option(name, new Date(value)); null === (_this$_header = this._header) || void 0 === _this$_header || _this$_header.option(name, new Date(value)); null === (_this$_header2 = this._header) || void 0 === _this$_header2 || _this$_header2.option("startViewDate", this.getStartViewDate()); this._appointments.option("items", []); this._filterAppointmentsByDate(); this._postponeDataSourceLoading(); break; case "dataSource": this._initDataSource(); this.appointmentDataProvider.setDataSource(this._dataSource); this._postponeResourceLoading().done((() => { this._filterAppointmentsByDate(); this._updateOption("workSpace", "showAllDayPanel", this.option("showAllDayPanel")) })); break; case "min": case "max": value = this._dateOption(name); this._updateOption("header", name, new Date(value)); this._updateOption("workSpace", name, new Date(value)); break; case "views": if (this._getCurrentViewOptions()) { this.repaint() } else { var _this$_header3; null === (_this$_header3 = this._header) || void 0 === _this$_header3 || _this$_header3.option(name, value) } break; case "useDropDownViewSwitcher": null === (_this$_header4 = this._header) || void 0 === _this$_header4 || _this$_header4.option(name, value); break; case "currentView": this._appointments.option({ items: [], allowDrag: this._allowDragging(), allowResize: this._allowResizing(), itemTemplate: this._getAppointmentTemplate("appointmentTemplate") }); this._postponeResourceLoading().done((resources => { var _this$_header5; this._refreshWorkSpace(resources); null === (_this$_header5 = this._header) || void 0 === _this$_header5 || _this$_header5.option(this._headerConfig()); this._filterAppointmentsByDate(); this._appointments.option("allowAllDayResize", "day" !== value) })); this.postponedOperations.callPostponedOperations(); break; case "appointmentTemplate": this._appointments.option("itemTemplate", value); break; case "dateCellTemplate": case "resourceCellTemplate": case "dataCellTemplate": case "timeCellTemplate": this.repaint(); break; case "groups": this._postponeResourceLoading().done((resources => { this._refreshWorkSpace(resources); this._filterAppointmentsByDate() })); break; case "resources": this._dataAccessors.resources = (0, _m_utils2.createExpressions)(this.option("resources")); this.agendaResourceProcessor.initializeState(this.option("resources")); this.updateInstances(); this.option("resourceLoaderMap").clear(); this._postponeResourceLoading().done((resources => { this._appointments.option("items", []); this._refreshWorkSpace(resources); this._filterAppointmentsByDate(); this._createAppointmentPopupForm() })); break; case "startDayHour": case "endDayHour": this.updateInstances(); this._appointments.option("items", []); this._updateOption("workSpace", name, value); this._appointments.repaint(); this._filterAppointmentsByDate(); this._postponeDataSourceLoading(); break; case "offset": this.updateInstances(); this._appointments.option("items", []); this._updateOption("workSpace", "viewOffset", this.normalizeViewOffsetValue(value)); this._appointments.repaint(); this._filterAppointmentsByDate(); this._postponeDataSourceLoading(); break; case StoreEventNames_ADDING: case StoreEventNames_ADDED: case StoreEventNames_UPDATING: case StoreEventNames_UPDATED: case StoreEventNames_DELETING: case StoreEventNames_DELETED: case "onAppointmentFormOpening": case "onAppointmentTooltipShowing": this._actions[name] = this._createActionByOption(name); break; case "onAppointmentRendered": this._appointments.option("onItemRendered", this._getAppointmentRenderedAction()); break; case "onAppointmentClick": this._appointments.option("onItemClick", this._createActionByOption(name)); break; case "onAppointmentDblClick": this._appointments.option(name, this._createActionByOption(name)); break; case "onAppointmentContextMenu": this._appointments.option("onItemContextMenu", this._createActionByOption(name)); this._appointmentTooltip._options.onItemContextMenu = this._createActionByOption(name); break; case "noDataText": case "allowMultipleCellSelection": case "selectedCellData": case "accessKey": case "onCellClick": case "onCellContextMenu": this._workSpace.option(name, value); break; case "crossScrollingEnabled": this._postponeResourceLoading().done((resources => { this._appointments.option("items", []); this._refreshWorkSpace(resources); if (this._readyToRenderAppointments) { this._appointments.option("items", this._getAppointmentsToRepaint()) } })); break; case "cellDuration": this._updateOption("workSpace", name, value); this._appointments.option("items", []); if (this._readyToRenderAppointments) { this._updateOption("workSpace", "hoursInterval", value / 60); this._appointments.option("items", this._getAppointmentsToRepaint()) } break; case "tabIndex": case "focusStateEnabled": this._updateOption("header", name, value); this._updateOption("workSpace", name, value); this._appointments.option(name, value); super._optionChanged(args); break; case "width": this._updateOption("header", name, value); if (this.option("crossScrollingEnabled")) { this._updateOption("workSpace", "width", value) } this._updateOption("workSpace", "schedulerWidth", value); super._optionChanged(args); this._dimensionChanged(null, true); break; case "height": super._optionChanged(args); this._dimensionChanged(null, true); this._updateOption("workSpace", "schedulerHeight", value); break; case "editing": { this._initEditing(); const editing = this._editing; this._bringEditingModeToAppointments(editing); this.hideAppointmentTooltip(); this._cleanPopup(); break } case "showAllDayPanel": this.updateInstances(); this.repaint(); break; case "showCurrentTimeIndicator": case "indicatorTime": case "indicatorUpdateInterval": case "shadeUntilCurrentTime": case "groupByDate": this._updateOption("workSpace", name, value); this.repaint(); break; case "appointmentDragging": case "appointmentTooltipTemplate": case "appointmentPopupTemplate": case "recurrenceEditMode": case "remoteFiltering": case "timeZone": this.updateInstances(); this.repaint(); break; case "dropDownAppointmentTemplate": case "appointmentCollectorTemplate": case "_appointmentTooltipOffset": case "_appointmentTooltipButtonsPosition": case "_appointmentTooltipOpenButtonText": case "_appointmentCountPerCell": case "_collectorOffset": case "_appointmentOffset": this.repaint(); break; case "dateSerializationFormat": case "maxAppointmentsPerCell": break; case "startDateExpr": case "endDateExpr": case "startDateTimeZoneExpr": case "endDateTimeZoneExpr": case "textExpr": case "descriptionExpr": case "allDayExpr": case "recurrenceRuleExpr": case "recurrenceExceptionExpr": case "disabledExpr": this._updateExpression(name, value); this.appointmentDataProvider.updateDataAccessors(this._dataAccessors); this._initAppointmentTemplate(); this.repaint(); break; case "adaptivityEnabled": this._toggleAdaptiveClass(); this.repaint(); break; case "scrolling": this.option("crossScrollingEnabled", this._isHorizontalVirtualScrolling() || this.option("crossScrollingEnabled")); this._updateOption("workSpace", args.fullName, value); break; case "allDayPanelMode": this.updateInstances(); this._updateOption("workSpace", args.fullName, value); break; case "renovateRender": this._updateOption("workSpace", name, value); break; case "_draggingMode": this._workSpace.option("draggingMode", value); break; case "toolbar": this._header ? this._header.option("items", value) : this.repaint(); break; case "loadedResources": case "resourceLoaderMap": break; default: super._optionChanged(args) } } _dateOption(optionName) { const optionValue = this._getCurrentViewOption(optionName); return _date_serialization.default.deserializeDate(optionValue) } _getSerializationFormat(optionName) { const value = this._getCurrentViewOption(optionName); if ("number" === typeof value) { return "number" } if (!(0, _type.isString)(value)) { return } return _date_serialization.default.getDateSerializationFormat(value) } _bringEditingModeToAppointments(editing) { const editingConfig = { allowDelete: editing.allowUpdating && editing.allowDeleting }; if (!this._isAgenda()) { editingConfig.allowDrag = editing.allowDragging; editingConfig.allowResize = editing.allowResizing; editingConfig.allowAllDayResize = editing.allowResizing && this._supportAllDayResizing() } this._appointments.option(editingConfig); this.repaint() } _isAgenda() { return "agenda" === this.getLayoutManager().appointmentRenderingStrategyName } _allowDragging() { return this._editing.allowDragging && !this._isAgenda() } _allowResizing() { return this._editing.allowResizing && !this._isAgenda() } _allowAllDayResizing() { return this._editing.allowResizing && this._supportAllDayResizing() } _supportAllDayResizing() { return "day" !== this.currentViewType || this.currentView.intervalCount > 1 } _isAllDayExpanded() { return this.option("showAllDayPanel") && this.appointmentDataProvider.hasAllDayAppointments(this.filteredItems, this.preparedItems) } _getTimezoneOffsetByOption(date) { return _m_utils_time_zone.default.calculateTimezoneByValue(this.option("timeZone"), date) } _filterAppointmentsByDate() { const dateRange = this._workSpace.getDateRange(); const startDate = this.timeZoneCalculator.createDate(dateRange[0], { path: "fromGrid" }); const endDate = this.timeZoneCalculator.createDate(dateRange[1], { path: "fromGrid" }); this.appointmentDataProvider.filterByDate(startDate, endDate, this.option("remoteFiltering"), this.option("dateSerializationFormat")) } _reloadDataSource() { const result = new _deferred.Deferred; if (this._dataSource) { this._dataSource.load().done((() => { (0, _m_loading.hide)(); this._fireContentReadyAction(result) })).fail((() => { (0, _m_loading.hide)(); result.reject() })); this._dataSource.isLoading() && (0, _m_loading.show)({ container: this.$element(), position: { of: this.$element() } }) } else { this._fireContentReadyAction(result) } return result.promise() } _fireContentReadyAction(result) { const contentReadyBase = super._fireContentReadyAction.bind(this); const fireContentReady = () => { contentReadyBase(); null === result || void 0 === result || result.resolve() }; if (this._workSpaceRecalculation) { var _this$_workSpaceRecal; null === (_this$_workSpaceRecal = this._workSpaceRecalculation) || void 0 === _this$_workSpaceRecal || _this$_workSpaceRecal.done((() => { fireContentReady() })) } else { fireContentReady() } } _dimensionChanged(value) { let isForce = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : false; const isFixedHeight = "number" === typeof this.option("height"); const isFixedWidth = "number" === typeof this.option("width"); if (!this._isVisible()) { return } this._toggleSmallClass(); const workspace = this.getWorkSpace(); if (!this._isAgenda() && this.filteredItems && workspace) { if (isForce || !isFixedHeight || !isFixedWidth) { workspace.option("allDayExpanded", this._isAllDayExpanded()); workspace._dimensionChanged(); const appointments = this.getLayoutManager().createAppointmentsMap(this.filteredItems); this._appointments.option("items", appointments) } } this.hideAppointmentTooltip(); this._appointmentPopup.triggerResize(); this._appointmentPopup.updatePopupFullScreenMode() } _clean() { this._cleanPopup(); super._clean() } _toggleSmallClass() { const { width: width } = (0, _position.getBoundingRect)(this.$element().get(0)); this.$element().toggleClass("dx-scheduler-small", width < 400) } _toggleAdaptiveClass() { this.$element().toggleClass("dx-scheduler-adaptive", this.option("adaptivityEnabled")) } _visibilityChanged(visible) { visible && this._dimensionChanged(null, true) } _dataSourceOptions() { return { paginate: false } } _initAllDayPanel() { if ("hidden" === this.option("allDayPanelMode")) { this.option("showAllDayPanel", false) } } _init() { this._initExpressions({ startDate: this.option("startDateExpr"), endDate: this.option("endDateExpr"), startDateTimeZone: this.option("startDateTimeZoneExpr"), endDateTimeZone: this.option("endDateTimeZoneExpr"), allDay: this.option("allDayExpr"), text: this.option("textExpr"), description: this.option("descriptionExpr"), recurrenceRule: this.option("recurrenceRuleExpr"), recurrenceException: this.option("recurrenceExceptionExpr"), disabled: this.option("disabledExpr") }); super._init(); this._initAllDayPanel(); this._initDataSource(); this._customizeDataSourceLoadOptions(); this.$element().addClass("dx-scheduler"); this._initEditing(); this.updateInstances(); this._initActions(); this._compactAppointmentsHelper = new _m_compact_appointments_helper.CompactAppointmentsHelper(this); this._asyncTemplatesTimers = []; this._dataSourceLoadedCallback = (0, _callbacks.default)(); this._subscribes = _m_subscribes.default; this.agendaResourceProcessor = new _m_agenda_resource_processor.AgendaResourceProcessor(this.option("resources")); this._optionsValidator = new _index3.SchedulerOptionsValidator; this._optionsValidatorErrorHandler = new _index3.SchedulerOptionsValidatorErrorsHandler } createAppointmentDataProvider() { var _this$appointmentData; null === (_this$appointmentData = this.appointmentDataProvider) || void 0 === _this$appointmentData || _this$appointmentData.destroy(); this.appointmentDataProvider = new _m_appointment_data_provider.AppointmentDataProvider({ dataSource: this._dataSource, dataAccessors: this._dataAccessors, timeZoneCalculator: this.timeZoneCalculator, dateSerializationFormat: this.option("dateSerializationFormat"), resources: this.option("resources"), startDayHour: this._getCurrentViewOption("startDayHour"), endDayHour: this._getCurrentViewOption("endDayHour"), viewOffset: this.getViewOffsetMs(), appointmentDuration: this._getCurrentViewOption("cellDuration"), allDayPanelMode: this._getCurrentViewOption("allDayPanelMode"), showAllDayPanel: this.option("showAllDayPanel"), getLoadedResources: () => this.option("loadedResources"), getIsVirtualScrolling: () => this.isVirtualScrolling(), getSupportAllDayRow: () => this._workSpace.supportAllDayRow(), getViewType: () => this._workSpace.type, getViewDirection: () => this._workSpace.viewDirection, getDateRange: () => this._workSpace.getDateRange(), getGroupCount: () => this._workSpace._getGroupCount(), getViewDataProvider: () => this._workSpace.viewDataProvider }) } updateInstances() { this._timeZoneCalculator = null; if (this.getWorkSpace()) { this.createAppointmentDataProvider() } } _customizeDataSourceLoadOptions() { var _this$_dataSource; null === (_this$_dataSource = this._dataSource) || void 0 === _this$_dataSource || _this$_dataSource.on("customizeStoreLoadOptions", (_ref => { let { storeLoadOptions: storeLoadOptions } = _ref; storeLoadOptions.startDate = this.getStartViewDate(); storeLoadOptions.endDate = this.getEndViewDate() })) } _initTemplates() { this._initAppointmentTemplate(); this._templateManager.addDefaultTemplates({ appointmentTooltip: new _empty_template.EmptyTemplate, dropDownAppointment: new _empty_template.EmptyTemplate }); super._initTemplates() } _initAppointmentTemplate() { const { expr: expr } = this._dataAccessors; const createGetter = property => (0, _data.compileGetter)(`appointmentData.${property}`); const getDate = getter => data => { const value = getter(data); if (value instanceof Date) { return value.valueOf() } return value }; this._templateManager.addDefaultTemplates({ item: new _bindable_template.BindableTemplate((($container, data, model) => this.getAppointmentsInstance()._renderAppointmentTemplate($container, data, model)), ["html", "text", "startDate", "endDate", "allDay", "description", "recurrenceRule", "recurrenceException", "startDateTimeZone", "endDateTimeZone"], this.option("integrationOptions.watchMethod"), { text: createGetter(expr.textExpr), startDate: getDate(createGetter(expr.startDateExpr)), endDate: getDate(createGetter(expr.endDateExpr)), startDateTimeZone: createGetter(expr.startDateTimeZoneExpr), endDateTimeZone: createGetter(expr.endDateTimeZoneExpr), allDay: createGetter(expr.allDayExpr), recurrenceRule: createGetter(expr.recurrenceRuleExpr) }) }) } _renderContent() { this._renderContentImpl() } _updatePreparedItems(items) { this.preparedItems = (0, _index2.getPreparedDataItems)(items, this._dataAccessors, this._getCurrentViewOption("cellDuration"), this.timeZoneCalculator) } _dataSourceChangedHandler(result) { if (this._readyToRenderAppointments) { this._workSpaceRecalculation.done((() => { this._updatePreparedItems(result); this._renderAppointments(); this.getWorkSpace().onDataSourceChanged(this.filteredItems) })) } } isVirtualScrolling() { var _currentViewOptions$s; const workspace = this.getWorkSpace(); if (workspace) { return workspace.isVirtualScrolling() } const currentViewOptions = this._getCurrentViewOptions(); const scrolling = this.option("scrolling"); return "virtual" === (null === scrolling || void 0 === scrolling ? void 0 : scrolling.mode) || "virtual" === (null === currentViewOptions || void 0 === currentViewOptions || null === (_currentViewOptions$s = currentViewOptions.scrolling) || void 0 === _currentViewOptions$s ? void 0 : _currentViewOptions$s.mode) } _filterAppointments() { this.filteredItems = this.appointmentDataProvider.filter(this.preparedItems) } _renderAppointments() { const workspace = this.getWorkSpace(); this._filterAppointments(); workspace.option("allDayExpanded", this._isAllDayExpanded()); let viewModel = []; if (this._isVisible()) { viewModel = this._getAppointmentsToRepaint() } this._appointments.option("items", viewModel); this.appointmentDataProvider.cleanState() } _getAppointmentsToRepaint() { const layoutManager = this.getLayoutManager(); const appointmentsMap = layoutManager.createAppointmentsMap(this.filteredItems); return layoutManager.getRepaintedAppointments(appointmentsMap, this.getAppointmentsInstance().option("items")) } _initExpressions(fields) { this._dataAccessors = _m_utils.utils.dataAccessors.create(fields, this._dataAccessors, (0, _config.default)().forceIsoDateParsing, this.option("dateSerializationFormat")); this._dataAccessors.resources = (0, _m_utils2.createExpressions)(this.option("resources")) } _updateExpression(name, value) { const exprObj = {}; exprObj[name.replace("Expr", "")] = value; this._initExpressions(exprObj) } getResourceDataAccessors() { return this._dataAccessors.resources } _initEditing() { const editing = this.option("editing"); this._editing = { allowAdding: !!editing, allowUpdating: !!editing, allowDeleting: !!editing, allowResizing: !!editing, allowDragging: !!editing }; if ((0, _type.isObject)(editing)) { this._editing = (0, _extend.extend)(this._editing, editing) } this._editing.allowDragging = this._editing.allowDragging && this._editing.allowUpdating; this._editing.allowResizing = this._editing.allowResizing && this._editing.allowUpdating; this.$element().toggleClass("dx-scheduler-readonly", this._isReadOnly()) } _isReadOnly() { let result = true; const editing = this._editing; for (const prop in editing) { if (Object.prototype.hasOwnProperty.call(editing, prop)) { result = result && !editing[prop] } } return result } _dispose() { var _this$_recurrenceDial; this._appointmentTooltip && this._appointmentTooltip.dispose(); null === (_this$_recurrenceDial = this._recurrenceDialog) || void 0 === _this$_recurrenceDial || _this$_recurrenceDial.hide(RECURRENCE_EDITING_MODE_CANCEL); this.hideAppointmentPopup(); this.hideAppointmentTooltip(); this._asyncTemplatesTimers.forEach(clearTimeout); this._asyncTemplatesTimers = []; super._dispose() } _initActions() { this._actions = { onAppointmentAdding: this._createActionByOption(StoreEventNames_ADDING), onAppointmentAdded: this._createActionByOption(StoreEventNames_ADDED), onAppointmentUpdating: this._createActionByOption(StoreEventNames_UPDATING), onAppointmentUpdated: this._createActionByOption(StoreEventNames_UPDATED), onAppointmentDeleting: this._createActionByOption(StoreEventNames_DELETING), onAppointmentDeleted: this._createActionByOption(StoreEventNames_DELETED), onAppointmentFormOpening: this._createActionByOption("onAppointmentFormOpening"), onAppointmentTooltipShowing: this._createActionByOption("onAppointmentTooltipShowing") } } _getAppointmentRenderedAction() { return this._createActionByOption("onAppointmentRendered", { excludeValidators: ["disabled", "readOnly"] }) } _renderFocusTarget() { return (0, _common.noop)() } _initMarkup() { super._initMarkup(); this._renderMainContainer(); this._renderHeader(); this._layoutManager = new _m_appointments_layout_manager.default(this); this._appointments = this._createComponent("
", _m_appointment_collection.default, this._appointmentsConfig()); this._appointments.option("itemTemplate", this._getAppointmentTemplate("appointmentTemplate")); this._appointmentTooltip = new(this.option("adaptivityEnabled") ? _m_mobile_tooltip_strategy.MobileTooltipStrategy : _m_desktop_tooltip_strategy.DesktopTooltipStrategy)(this._getAppointmentTooltipOptions()); this._createAppointmentPopupForm(); if (this._isDataSourceLoaded() || this._isDataSourceLoading()) { this._initMarkupCore(this.option("loadedResources")); this._dataSourceChangedHandler(this._dataSource.items()); this._fireContentReadyAction() } else { const groups = this._getCurrentViewOption("groups"); (0, _m_utils2.loadResources)(groups, this.option("resources"), this.option("resourceLoaderMap")).done((resources => { this.option("loadedResources", resources); this._initMarkupCore(resources); this._reloadDataSource() })) } } _createAppointmentPopupForm() { var _this$_appointmentPop; if (this._appointmentForm) { var _this$_appointmentFor; null === (_this$_appointmentFor = this._appointmentForm.form) || void 0 === _this$_appointmentFor || _this$_appointmentFor.dispose() } this._appointmentForm = this.createAppointmentForm(); null === (_this$_appointmentPop = this._appointmentPopup) || void 0 === _this$_appointmentPop || _this$_appointmentPop.dispose(); this._appointmentPopup = this.createAppointmentPopup(this._appointmentForm) } _renderMainContainer() { this._mainContainer = (0, _renderer.default)("
").addClass("dx-scheduler-container"); this.$element().append(this._mainContainer) } createAppointmentForm() { const scheduler = { createResourceEditorModel: () => (0, _m_utils2.createResourceEditorModel)(this.option("resources"), this.option("loadedResources")), getDataAccessors: () => this._dataAccessors, createComponent: (element, component, options) => this._createComponent(element, component, options), getEditingConfig: () => this._editing, getFirstDayOfWeek: () => this.option("firstDayOfWeek"), getStartDayHour: () => this.option("startDayHour"), getCalculatedEndDate: startDateWithStartHour => this._workSpace.calculateEndDate(startDateWithStartHour), getTimeZoneCalculator: () => this.timeZoneCalculator }; return new _m_form.AppointmentForm(scheduler) } createAppointmentPopup(form) { const scheduler = { getElement: () => this.$element(), createComponent: (element, component, options) => this._createComponent(element, component, options), focus: () => this.focus(), getResources: () => this.option("resources"), getEditingConfig: () => this._editing, getTimeZoneCalculator: () => this.timeZoneCalculator, getDataAccessors: () => this._dataAccessors, getAppointmentFormOpening: () => this._actions.onAppointmentFormOpening, processActionResult: (arg, canceled) => this._processActionResult(arg, canceled), addAppointment: appointment => this.addAppointment(appointment), updateAppointment: (sourceAppointment, updatedAppointment) => this.updateAppointment(sourceAppointment, updatedAppointment), updateScrollPosition: (startDate, resourceItem, inAllDayRow) => { this._workSpace.updateScrollPosition(startDate, resourceItem, inAllDayRow) } }; return new _m_popup.AppointmentPopup(scheduler, form) } _getAppointmentTooltipOptions() { return { createComponent: this._createComponent.bind(this), container: this.$element(), getScrollableContainer: this.getWorkSpaceScrollableContainer.bind(this), addDefaultTemplates: this._templateManager.addDefaultTemplates.bind(this._templateManager), getAppointmentTemplate: this._getAppointmentTemplate.bind(this), showAppointmentPopup: this.showAppointmentPopup.bind(this), checkAndDeleteAppointment: this.checkAndDeleteAppointment.bind(this), isAppointmentInAllDayPanel: this.isAppointmentInAllDayPanel.bind(this), createFormattedDateText: (appointment, targetedAppointment, format) => this.fire("getTextAndFormatDate", appointment, targetedAppointment, format), getAppointmentDisabled: appointment => (0, _m_appointment_adapter.createAppointmentAdapter)(appointment, this._dataAccessors, this.timeZoneCalculator).disabled, onItemContextMenu: this._createActionByOption("onAppointmentContextMenu"), createEventArgs: this._createEventArgs.bind(this) } } _createEventArgs(e) { const config = { itemData: e.itemData.appointment, itemElement: e.itemElement, targetedAppointment: e.itemData.targetedAppointment }; return (0, _extend.extend)({}, this.fire("mapAppointmentFields", config), { component: e.component, element: e.element, event: e.event, model: e.model }) } checkAndDeleteAppointment(appointment, targetedAppointment) { const targetedAdapter = (0, _m_appointment_adapter.createAppointmentAdapter)(targetedAppointment, this._dataAccessors, this.timeZoneCalculator); const deletingOptions = this.fireOnAppointmentDeleting(appointment, targetedAdapter); this._checkRecurringAppointment(appointment, targetedAppointment, targetedAdapter.startDate, (() => { this.processDeleteAppointment(appointment, deletingOptions) }), true) } _getExtraAppointmentTooltipOptions() { return { rtlEnabled: this.option("rtlEnabled"), focusStateEnabled: this.option("focusStateEnabled"), editing: this.option("editing"), offset: this.option("_appointmentTooltipOffset") } } isAppointmentInAllDayPanel(appointmentData) { const workSpace = this._workSpace; const itTakesAllDay = this.appointmentTakesAllDay(appointmentData); return itTakesAllDay && workSpace.supportAllDayRow() && workSpace.option("showAllDayPanel") } _initMarkupCore(resources) { this._readyToRenderAppointments = (0, _window.hasWindow)(); this._workSpace && this._cleanWorkspace(); this._renderWorkSpace(resources); this._appointments.option({ fixedContainer: this._workSpace.getFixedContainer(), allDayContainer: this._workSpace.getAllDayContainer() }); this._waitAsyncTemplate((() => { var _this$_workSpaceRecal2; return null === (_this$_workSpaceRecal2 = this._workSpaceRecalculation) || void 0 === _this$_workSpaceRecal2 ? void 0 : _this$_workSpaceRecal2.resolve() })); this.createAppointmentDataProvider(); this._filterAppointmentsByDate(); this._validateKeyFieldIfAgendaExist() } _isDataSourceLoaded() { return this._dataSource && this._dataSource.isLoaded() } _render() { var _this$getWorkSpace; this._toggleSmallClass(); this._toggleAdaptiveClass(); null === (_this$getWorkSpace = this.getWorkSpace()) || void 0 === _this$getWorkSpace || _this$getWorkSpace.updateHeaderEmptyCellWidth(); super._render() } _renderHeader() { if (0 !== this.option("toolbar").length) { const $header = (0, _renderer.default)("
").appendTo(this._mainContainer); this._header = this._createComponent($header, _m_header.SchedulerHeader, this._headerConfig()) } } _headerConfig() { const currentViewOptions = this._getCurrentViewOptions(); const countConfig = this._getViewCountConfig(); const result = (0, _extend.extend)({ firstDayOfWeek: this.getFirstDayOfWeek(), currentView: this.option("currentView"), isAdaptive: this.option("adaptivityEnabled"), tabIndex: this.option("tabIndex"), focusStateEnabled: this.option("focusStateEnabled"), rtlEnabled: this.option("rtlEnabled"), useDropDownViewSwitcher: this.option("useDropDownViewSwitcher"), customizeDateNavigatorText: this.option("customizeDateNavigatorText"), agendaDuration: currentViewOptions.agendaDuration || 7 }, currentViewOptions); result.intervalCount = countConfig.intervalCount; result.views = this.option("views"); result.min = new Date(this._dateOption("min")); result.max = new Date(this._dateOption("max")); result.currentDate = _date.default.trimTime(new Date(this._dateOption("currentDate"))); result.onCurrentViewChange = name => { this.option("currentView", name) }; result.onCurrentDateChange = date => { this.option("currentDate", date) }; result.items = this.option("toolbar"); result.startViewDate = this.getStartViewDate(); result.todayDate = () => { const result = this.timeZoneCalculator.createDate(new Date, { path: "toGrid" }); return result }; return result } _appointmentsConfig() { const config = { getResources: () => this.option("resources"), getResourceDataAccessors: this.getResourceDataAccessors.bind(this), getAgendaResourceProcessor: () => this.agendaResourceProcessor, getAppointmentColor: this.createGetAppointmentColor(), getAppointmentDataProvider: () => this.appointmentDataProvider, dataAccessors: this._dataAccessors, observer: this, onItemRendered: this._getAppointmentRenderedAction(), onItemClick: this._createActionByOption("onAppointmentClick"), onItemContextMenu: this._createActionByOption("onAppointmentContextMenu"), onAppointmentDblClick: this._createActionByOption("onAppointmentDblClick"), tabIndex: this.option("tabIndex"), focusStateEnabled: this.option("focusStateEnabled"), allowDrag: this._allowDragging(), allowDelete: this._editing.allowUpdating && this._editing.allowDeleting, allowResize: this._allowResizing(), allowAllDayResize: this._allowAllDayResizing(), rtlEnabled: this.option("rtlEnabled"), currentView: this.currentView, groups: this._getCurrentViewOption("groups"), timeZoneCalculator: this.timeZoneCalculator, getResizableStep: () => this._workSpace ? this._workSpace.positionHelper.getResizableStep() : 0, getDOMElementsMetaData: () => { var _this$_workSpace; return null === (_this$_workSpace = this._workSpace) || void 0 === _this$_workSpace ? void 0 : _this$_workSpace.getDOMElementsMetaData() }, getViewDataProvider: () => { var _this$_workSpace2; return null === (_this$_workSpace2 = this._workSpace) || void 0 === _this$_workSpace2 ? void 0 : _this$_workSpace2.viewDataProvider }, isVerticalViewDirection: () => "vertical" === this.getRenderingStrategyInstance().getDirection(), isVerticalGroupedWorkSpace: () => this._workSpace._isVerticalGroupedWorkSpace(), isDateAndTimeView: () => (0, _index2.isDateAndTimeView)(this._workSpace.type), onContentReady: () => { var _this$_workSpace3; null === (_this$_workSpace3 = this._workSpace) || void 0 === _this$_workSpace3 || _this$_workSpace3.option("allDayExpanded", this._isAllDayExpanded()) } }; return config } getCollectorOffset() { if (this._workSpace.needApplyCollectorOffset() && !this.option("adaptivityEnabled")) { return this.option("_collectorOffset") } return 0 } getAppointmentDurationInMinutes() { return this._getCurrentViewOption("cellDuration") } _getCurrentViewType() { return this.currentViewType } _renderWorkSpace(groups) { var _this$_header6; this._readyToRenderAppointments && this._toggleSmallClass(); const $workSpace = (0, _renderer.default)("
").appendTo(this._mainContainer); const countConfig = this._getViewCountConfig(); const workSpaceComponent = VIEWS_CONFIG[this._getCurrentViewType()].workSpace; const workSpaceConfig = this._workSpaceConfig(groups, countConfig); this._workSpace = this._createComponent($workSpace, workSpaceComponent, workSpaceConfig); this._allowDragging() && this._workSpace.initDragBehavior(this, this._all); this._workSpace._attachTablesEvents(); this._workSpace.getWorkArea().append(this._appointments.$element()); this._recalculateWorkspace(); countConfig.startDate && (null === (_this$_header6 = this._header) || void 0 === _this$_header6 ? void 0 : _this$_header6.option("currentDate", this._workSpace._getHeaderDate())); this._appointments.option("_collectorOffset", this.getCollectorOffset()) } _getViewCountConfig() { const currentView = this.option("currentView"); const view = this._getViewByName(currentView); const viewCount = view && view.intervalCount || 1; const startDate = view && view.startDate || null; return { intervalCount: viewCount, startDate: startDate } } _getViewByName(name) { const views = this.option("views"); for (let i = 0; i < views.length; i++) { if (views[i].name === name || views[i].type === name || views[i] === name) { return views[i] } } } _recalculateWorkspace() { this._workSpaceRecalculation = new _deferred.Deferred; this._waitAsyncTemplate((() => { (0, _visibility_change.triggerResizeEvent)(this._workSpace.$element()); this._workSpace.renderCurrentDateTimeLineAndShader() })) } _workSpaceConfig(groups, countConfig) { var _currentViewOptions$s2; const currentViewOptions = this._getCurrentViewOptions(); const scrolling = this.option("scrolling"); const isVirtualScrolling = "virtual" === scrolling.mode || "virtual" === (null === (_currentViewOptions$s2 = currentViewOptions.scrolling) || void 0 === _currentViewOptions$s2 ? void 0 : _currentViewOptions$s2.mode); const horizontalVirtualScrollingAllowed = isVirtualScrolling && (!(0, _type.isDefined)(scrolling.orientation) || ["horizontal", "both"].filter((item => { var _currentViewOptions$s3; return scrolling.orientation === item || (null === (_currentViewOptions$s3 = currentViewOptions.scrolling) || void 0 === _currentViewOptions$s3 ? void 0 : _currentViewOptions$s3.orientation) === item })).length > 0); const crossScrollingEnabled = this.option("crossScrollingEnabled") || horizontalVirtualScrollingAllowed || (0, _index2.isTimelineView)(this.currentViewType); const result = (0, _extend.extend)({ resources: this.option("resources"), loadedResources: this.option("loadedResources"), getFilteredItems: () => this.filteredItems, getResourceDataAccessors: this.getResourceDataAccessors.bind(this), noDataText: this.option("noDataText"), firstDayOfWeek: this.option("firstDayOfWeek"), startDayHour: this.option("startDayHour"), endDayHour: this.option("endDayHour"), viewOffset: this.getViewOffsetMs(), tabIndex: this.option("tabIndex"), accessKey: this.option("accessKey"), focusStateEnabled: this.option("focusStateEnabled"), cellDuration: this.option("cellDuration"), showAllDayPanel: this.option("showAllDayPanel"), showCurrentTimeIndicator: this.option("showCurrentTimeIndicator"), indicatorTime: this.option("indicatorTime"), indicatorUpdateInterval: this.option("indicatorUpdateInterval"), shadeUntilCurrentTime: this.option("shadeUntilCurrentTime"), allDayExpanded: this._appointments.option("items"), crossScrollingEnabled: crossScrollingEnabled, dataCellTemplate: this.option("dataCellTemplate"), timeCellTemplate: this.option("timeCellTemplate"), resourceCellTemplate: this.option("resourceCellTemplate"), dateCellTemplate: this.option("dateCellTemplate"), allowMultipleCellSelection: this.option("allowMultipleCellSelection"), selectedCellData: this.option("selectedCellData"), onSelectionChanged: args => { this.option("selectedCellData", args.selectedCellData) }, groupByDate: this._getCurrentViewOption("groupByDate"), scrolling: scrolling, draggingMode: this.option("_draggingMode"), timeZoneCalculator: this.timeZoneCalculator, schedulerHeight: this.option("height"), schedulerWidth: this.option("width"), allDayPanelMode: this.option("allDayPanelMode"), onSelectedCellsClick: this.showAddAppointmentPopup.bind(this), onRenderAppointments: this._renderAppointments.bind(this), onShowAllDayPanel: value => this.option("showAllDayPanel", value), getHeaderHeight: () => _m_utils.utils.DOM.getHeaderHeight(this._header), onScrollEnd: () => this._appointments.updateResizableArea(), renovateRender: this._isRenovatedRender(isVirtualScrolling) }, currentViewOptions); result.observer = this; result.intervalCount = countConfig.intervalCount; result.startDate = countConfig.startDate; result.groups = groups; result.onCellClick = this._createActionByOption("onCellClick"); result.onCellContextMenu = this._createActionByOption("onCellContextMenu"); result.currentDate = _date.default.trimTime(new Date(this._dateOption("currentDate"))); result.hoursInterval = result.cellDuration / 60; result.allDayExpanded = false; result.dataCellTemplate = result.dataCellTemplate ? this._getTemplate(result.dataCellTemplate) : null; result.timeCellTemplate = result.timeCellTemplate ? this._getTemplate(result.timeCellTemplate) : null; result.resourceCellTemplate = result.resourceCellTemplate ? this._getTemplate(result.resourceCellTemplate) : null; result.dateCellTemplate = result.dateCellTemplate ? this._getTemplate(result.dateCellTemplate) : null; result.getAppointmentDataProvider = () => this.appointmentDataProvider; return result } _isRenovatedRender(isVirtualScrolling) { return this.option("renovateRender") && (0, _window.hasWindow)() || isVirtualScrolling } _waitAsyncTemplate(callback) { if (this._options.silent("templatesRenderAsynchronously")) { const timer = setTimeout((() => { callback(); clearTimeout(timer) })); this._asyncTemplatesTimers.push(timer) } else { callback() } } _getCurrentViewOptions() { return this.currentView } _getCurrentViewOption(optionName) { if (this.currentView && void 0 !== this.currentView[optionName]) { return this.currentView[optionName] } return this.option(optionName) } _getAppointmentTemplate(optionName) { const currentViewOptions = this._getCurrentViewOptions(); if (currentViewOptions && currentViewOptions[optionName]) { return this._getTemplate(currentViewOptions[optionName]) } return this._getTemplateByOption(optionName) } _updateOption(viewName, optionName, value) { const currentViewOptions = this._getCurrentViewOptions(); if (!currentViewOptions || !(0, _type.isDefined)(currentViewOptions[optionName])) { this[`_${viewName}`].option(optionName, value) } } _refreshWorkSpace(groups) { this._cleanWorkspace(); delete this._workSpace; this._renderWorkSpace(groups); if (this._readyToRenderAppointments) { this._appointments.option({ fixedContainer: this._workSpace.getFixedContainer(), allDayContainer: this._workSpace.getAllDayContainer() }); this._waitAsyncTemplate((() => this._workSpaceRecalculation.resolve())) } } _cleanWorkspace() { this._appointments.$element().detach(); this._workSpace._dispose(); this._workSpace.$element().remove(); this.option("selectedCellData", []) } getWorkSpaceScrollable() { return this._workSpace.getScrollable() } getWorkSpaceScrollableContainer() { return this._workSpace.getScrollableContainer() } getWorkSpace() { return this._workSpace } getHeader() { return this._header } _cleanPopup() { var _this$_appointmentPop2; null === (_this$_appointmentPop2 = this._appointmentPopup) || void 0 === _this$_appointmentPop2 || _this$_appointmentPop2.dispose() } _checkRecurringAppointment(rawAppointment, singleAppointment, exceptionDate, callback, isDeleted, isPopupEditing, dragEvent, recurrenceEditMode) { const recurrenceRule = _m_expression_utils.ExpressionUtils.getField(this._dataAccessors, "recurrenceRule", rawAppointment); if (!(0, _m_recurrence.getRecurrenceProcessor)().evalRecurrenceRule(recurrenceRule).isValid || !this._editing.allowUpdating) { callback(); return } const editMode = recurrenceEditMode || this.option("recurrenceEditMode"); switch (editMode) { case "series": callback(); break; case "occurrence": this._excludeAppointmentFromSeries(rawAppointment, singleAppointment, exceptionDate, isDeleted, isPopupEditing, dragEvent); break; default: if (dragEvent) { dragEvent.cancel = new _deferred.Deferred } this._showRecurrenceChangeConfirm(isDeleted).done((editingMode => { editingMode === RECURRENCE_EDITING_MODE_SERIES && callback(); editingMode === RECURRENCE_EDITING_MODE_OCCURENCE && this._excludeAppointmentFromSeries(rawAppointment, singleAppointment, exceptionDate, isDeleted, isPopupEditing, dragEvent) })).fail((() => this._appointments.moveAppointmentBack(dragEvent))) } } _excludeAppointmentFromSeries(rawAppointment, newRawAppointment, exceptionDate, isDeleted, isPopupEditing, dragEvent) { const appointment = (0, _index2.excludeFromRecurrence)(rawAppointment, exceptionDate, this._dataAccessors, this._timeZoneCalculator); const singleRawAppointment = _extends({}, newRawAppointment); delete singleRawAppointment[this._dataAccessors.expr.recurrenceExceptionExpr]; delete singleRawAppointment[this._dataAccessors.expr.recurrenceRuleExpr]; const keyPropertyName = this.appointmentDataProvider.keyName; delete singleRawAppointment[keyPropertyName]; const canCreateNewAppointment = !isDeleted && !isPopupEditing; if (canCreateNewAppointment) { this.addAppointment(singleRawAppointment) } if (isPopupEditing) { this._appointmentPopup.show(singleRawAppointment, { isToolbarVisible: true, action: _m_popup.ACTION_TO_APPOINTMENT.EXCLUDE_FROM_SERIES, excludeInfo: { sourceAppointment: rawAppointment, updatedAppointment: appointment.source() } }); this._editAppointmentData = rawAppointment } else { this._updateAppointment(rawAppointment, appointment.source(), (() => { this._appointments.moveAppointmentBack(dragEvent) }), dragEvent) } } _createRecurrenceException(appointment, exceptionDate) { const result = []; if (appointment.recurrenceException) { result.push(appointment.recurrenceException) } result.push(this._getSerializedDate(exceptionDate, appointment.startDate, appointment.allDay)); return result.join() } _getSerializedDate(date, startDate, isAllDay) { isAllDay && date.setHours(startDate.getHours(), startDate.getMinutes(), startDate.getSeconds(), startDate.getMilliseconds()); return _date_serialization.default.serializeDate(date, "yyyyMMddTHHmmssZ") } _showRecurrenceChangeConfirm(isDeleted) { const title = _message.default.format(isDeleted ? "dxScheduler-confirmRecurrenceDeleteTitle" : "dxScheduler-confirmRecurrenceEditTitle"); const message = _message.default.format(isDeleted ? "dxScheduler-confirmRecurrenceDeleteMessage" : "dxScheduler-confirmRecurrenceEditMessage"); const seriesText = _message.default.format(isDeleted ? "dxScheduler-confirmRecurrenceDeleteSeries" : "dxScheduler-confirmRecurrenceEditSeries"); const occurrenceText = _message.default.format(isDeleted ? "dxScheduler-confirmRecurrenceDeleteOccurrence" : "dxScheduler-confirmRecurrenceEditOccurrence"); this._recurrenceDialog = (0, _dialog.custom)({ title: title, messageHtml: message, showCloseButton: true, showTitle: true, buttons: [{ text: seriesText, onClick: () => RECURRENCE_EDITING_MODE_SERIES }, { text: occurrenceText, onClick: () => RECURRENCE_EDITING_MODE_OCCURENCE }], popupOptions: { wrapperAttr: { class: "dx-dialog" } } }); return this._recurrenceDialog.show() } _getUpdatedData(rawAppointment) { const viewOffset = this.getViewOffsetMs(); const getConvertedFromGrid = date => { if (!date) { return } const result = this.timeZoneCalculator.createDate(date, { path: "fromGrid" }); return _date3.dateUtilsTs.addOffsets(result, [-viewOffset]) }; const isValidDate = date => !isNaN(new Date(date).getTime()); const targetCell = this.getTargetCellData(); const appointment = (0, _m_appointment_adapter.createAppointmentAdapter)(rawAppointment, this._dataAccessors, this.timeZoneCalculator); const cellStartDate = getConvertedFromGrid(targetCell.startDate); const cellEndDate = getConvertedFromGrid(targetCell.endDate); let appointmentStartDate = new Date(appointment.startDate); appointmentStartDate = _date3.dateUtilsTs.addOffsets(appointmentStartDate, [-viewOffset]); let appointmentEndDate = new Date(appointment.endDate); appointmentEndDate = _date3.dateUtilsTs.addOffsets(appointmentEndDate, [-viewOffset]); let resultedStartDate = cellStartDate ?? appointmentStartDate; if (!isValidDate(appointmentStartDate)) { appointmentStartDate = resultedStartDate } if (!isValidDate(appointmentEndDate)) { appointmentEndDate = cellEndDate } const duration = appointmentEndDate.getTime() - appointmentStartDate.getTime(); const isKeepAppointmentHours = this._workSpace.keepOriginalHours() && isValidDate(appointment.startDate) && isValidDate(cellStartDate); if (isKeepAppointmentHours) { const startDate = this.timeZoneCalculator.createDate(appointmentStartDate, { path: "toGrid" }); const timeInMs = startDate.getTime() - _date.default.trimTime(startDate).getTime(); const targetCellStartDate = _date3.dateUtilsTs.addOffsets(targetCell.startDate, [-viewOffset]); resultedStartDate = new Date(_date.default.trimTime(targetCellStartDate).getTime() + timeInMs); resultedStartDate = this.timeZoneCalculator.createDate(resultedStartDate, { path: "fromGrid" }) } const result = (0, _m_appointment_adapter.createAppointmentAdapter)({}, this._dataAccessors, this.timeZoneCalculator); if (void 0 !== targetCell.allDay) { result.allDay = targetCell.allDay } result.startDate = resultedStartDate; let resultedEndDate = new Date(resultedStartDate.getTime() + duration); if (this.appointmentTakesAllDay(rawAppointment) && !result.allDay && this._workSpace.supportAllDayRow()) { resultedEndDate = this._workSpace.calculateEndDate(resultedStartDate) } if (appointment.allDay && !this._workSpace.supportAllDayRow() && !this._workSpace.keepOriginalHours()) { const dateCopy = new Date(resultedStartDate); dateCopy.setHours(0); resultedEndDate = new Date(dateCopy.getTime() + duration); if (0 !== resultedEndDate.getHours()) { resultedEndDate.setHours(this._getCurrentViewOption("endDayHour")) } } result.startDate = _date3.dateUtilsTs.addOffsets(result.startDate, [viewOffset]); result.endDate = _date3.dateUtilsTs.addOffsets(resultedEndDate, [viewOffset]); const rawResult = result.source(); (0, _m_utils2.setResourceToAppointment)(this.option("resources"), this.getResourceDataAccessors(), rawResult, targetCell.groups); return rawResult } getTargetedAppointment(appointment, element) { const settings = _m_utils.utils.dataAccessors.getAppointmentSettings(element); const info = _m_utils.utils.dataAccessors.getAppointmentInfo(element); const appointmentIndex = (0, _renderer.default)(element).data(this._appointments._itemIndexKey()); const adapter = (0, _m_appointment_adapter.createAppointmentAdapter)(appointment, this._dataAccessors, this.timeZoneCalculator); const targetedAdapter = adapter.clone(); if (this._isAgenda() && adapter.isRecurrent) { const { agendaSettings: agendaSettings } = settings; targetedAdapter.startDate = _m_expression_utils.ExpressionUtils.getField(this._dataAccessors, "startDate", agendaSettings); targetedAdapter.endDate = _m_expression_utils.ExpressionUtils.getField(this._dataAccessors, "endDate", agendaSettings) } else if (settings) { targetedAdapter.startDate = info ? info.sourceAppointment.startDate : adapter.startDate; targetedAdapter.endDate = info ? info.sourceAppointment.endDate : adapter.endDate } const rawTargetedAppointment = targetedAdapter.source(); if (element) { this.setTargetedAppointmentResources(rawTargetedAppointment, element, appointmentIndex) } if (info) { rawTargetedAppointment.displayStartDate = new Date(info.appointment.startDate); rawTargetedAppointment.displayEndDate = new Date(info.appointment.endDate) } return rawTargetedAppointment } subscribe(subject, action) { this._subscribes[subject] = _m_subscribes.default[subject] = action } fire(subject) { const callback = this._subscribes[subject]; const args = Array.prototype.slice.call(arguments); if (!(0, _type.isFunction)(callback)) { throw _ui.default.Error("E1031", subject) } return callback.apply(this, args.slice(1)) } getTargetCellData() { return this._workSpace.getDataByDroppableCell() } _updateAppointment(target, rawAppointment, onUpdatePrevented, dragEvent) { const updatingOptions = { newData: rawAppointment, oldData: (0, _extend.extend)({}, target), cancel: false }; const performFailAction = function(err) { if (onUpdatePrevented) { onUpdatePrevented.call(this) } if (err && "Error" === err.name) { throw err } }.bind(this); this._actions[StoreEventNames_UPDATING](updatingOptions); if (dragEvent && !(0, _type.isDeferred)(dragEvent.cancel)) { dragEvent.cancel = new _deferred.Deferred } return this._processActionResult(updatingOptions, (function(canceled) { let deferred = new _deferred.Deferred; if (!canceled) { this._expandAllDayPanel(rawAppointment); try { deferred = this.appointmentDataProvider.update(target, rawAppointment).done((() => { dragEvent && dragEvent.cancel.resolve(false) })).always((storeAppointment => this._onDataPromiseCompleted(StoreEventNames_UPDATED, storeAppointment))).fail((() => performFailAction())) } catch (err) { performFailAction(err); deferred.resolve() } } else { performFailAction(); deferred.resolve() } return deferred.promise() })) } _processActionResult(actionOptions, callback) { const deferred = new _deferred.Deferred; const resolveCallback = callbackResult => { (0, _deferred.when)((0, _deferred.fromPromise)(callbackResult)).always(deferred.resolve) }; if ((0, _type.isPromise)(actionOptions.cancel)) { (0, _deferred.when)((0, _deferred.fromPromise)(actionOptions.cancel)).always((cancel => { if (!(0, _type.isDefined)(cancel)) { cancel = "rejected" === actionOptions.cancel.state() } resolveCallback(callback.call(this, cancel)) })) } else { resolveCallback(callback.call(this, actionOptions.cancel)) } return deferred.promise() } _expandAllDayPanel(appointment) { if (!this._isAllDayExpanded() && this.appointmentTakesAllDay(appointment)) { this._workSpace.option("allDayExpanded", true) } } _onDataPromiseCompleted(handlerName, storeAppointment, appointment) { const args = { appointmentData: appointment || storeAppointment }; if (storeAppointment instanceof Error) { args.error = storeAppointment } else { this._appointmentPopup.visible && this._appointmentPopup.hide() } this._actions[handlerName](args); this._fireContentReadyAction() } getAppointmentsInstance() { return this._appointments } getLayoutManager() { return this._layoutManager } getRenderingStrategyInstance() { return this.getLayoutManager().getRenderingStrategyInstance() } getActions() { return this._actions } appointmentTakesAllDay(rawAppointment) { const appointment = (0, _m_appointment_adapter.createAppointmentAdapter)(rawAppointment, this._dataAccessors, this.timeZoneCalculator); return (0, _index2.getAppointmentTakesAllDay)(appointment, this._getCurrentViewOption("allDayPanelMode")) } dayHasAppointment(day, rawAppointment, trimTime) { const getConvertedToTimeZone = date => this.timeZoneCalculator.createDate(date, { path: "toGrid" }); const appointment = (0, _m_appointment_adapter.createAppointmentAdapter)(rawAppointment, this._dataAccessors, this.timeZoneCalculator); let startDate = new Date(appointment.startDate); let endDate = new Date(appointment.endDate); startDate = getConvertedToTimeZone(startDate); endDate = getConvertedToTimeZone(endDate); if (day.getTime() === endDate.getTime()) { return startDate.getTime() === endDate.getTime() } if (trimTime) { day = _date.default.trimTime(day); startDate = _date.default.trimTime(startDate); endDate = _date.default.trimTime(endDate) } const dayTimeStamp = day.getTime(); const startDateTimeStamp = startDate.getTime(); const endDateTimeStamp = endDate.getTime(); return startDateTimeStamp <= dayTimeStamp && dayTimeStamp <= endDateTimeStamp } setTargetedAppointmentResources(rawAppointment, element, appointmentIndex) { const groups = this._getCurrentViewOption("groups"); if (null !== groups && void 0 !== groups && groups.length) { const resourcesSetter = this.getResourceDataAccessors().setter; const workSpace = this._workSpace; let getGroups; let setResourceCallback; if (this._isAgenda()) { getGroups = function() { const apptSettings = this.getLayoutManager()._positionMap[appointmentIndex]; return (0, _m_utils2.getCellGroups)(apptSettings[0].groupIndex, this.getWorkSpace().option("groups")) }; setResourceCallback = function(_, group) { resourcesSetter[group.name](rawAppointment, group.id) } } else { getGroups = function() { const setting = _m_utils.utils.dataAccessors.getAppointmentSettings(element) || {}; return workSpace.getCellDataByCoordinates({ left: setting.left, top: setting.top }).groups }; setResourceCallback = function(field, value) { resourcesSetter[field](rawAppointment, value) } }(0, _iterator.each)(getGroups.call(this), setResourceCallback) } } getStartViewDate() { var _this$_workSpace4; return null === (_this$_workSpace4 = this._workSpace) || void 0 === _this$_workSpace4 ? void 0 : _this$_workSpace4.getStartViewDate() } getEndViewDate() { return this._workSpace.getEndViewDate() } showAddAppointmentPopup(cellData, cellGroups) { const appointmentAdapter = (0, _m_appointment_adapter.createAppointmentAdapter)({}, this._dataAccessors, this.timeZoneCalculator); appointmentAdapter.allDay = cellData.allDay; appointmentAdapter.startDate = this.timeZoneCalculator.createDate(cellData.startDate, { path: "fromGrid" }); appointmentAdapter.endDate = this.timeZoneCalculator.createDate(cellData.endDate, { path: "fromGrid" }); const resultAppointment = (0, _extend.extend)(appointmentAdapter.source(), cellGroups); this.showAppointmentPopup(resultAppointment, true) } showAppointmentPopup(rawAppointment, createNewAppointment, rawTargetedAppointment) { const newRawTargetedAppointment = _extends({}, rawTargetedAppointment); if (newRawTargetedAppointment) { delete newRawTargetedAppointment.displayStartDate; delete newRawTargetedAppointment.displayEndDate } const appointment = (0, _m_appointment_adapter.createAppointmentAdapter)(newRawTargetedAppointment || rawAppointment, this._dataAccessors, this.timeZoneCalculator); const newTargetedAppointment = (0, _extend.extend)({}, rawAppointment, newRawTargetedAppointment); const isCreateAppointment = createNewAppointment ?? (0, _type.isEmptyObject)(rawAppointment); if ((0, _type.isEmptyObject)(rawAppointment)) { rawAppointment = this.createPopupAppointment() } if (isCreateAppointment) { delete this._editAppointmentData; this._editing.allowAdding && this._appointmentPopup.show(rawAppointment, { isToolbarVisible: true, action: _m_popup.ACTION_TO_APPOINTMENT.CREATE }) } else { this._checkRecurringAppointment(rawAppointment, newTargetedAppointment, appointment.startDate, (() => { this._editAppointmentData = rawAppointment; this._appointmentPopup.show(rawAppointment, { isToolbarVisible: this._editing.allowUpdating, action: _m_popup.ACTION_TO_APPOINTMENT.UPDATE }) }), false, true) } } createPopupAppointment() { const result = {}; const toMs = _date.default.dateToMilliseconds; const startDate = new Date(this.option("currentDate")); const endDate = new Date(startDate.getTime() + this.option("cellDuration") * toMs("minute")); _m_expression_utils.ExpressionUtils.setField(this._dataAccessors, "startDate", result, startDate); _m_expression_utils.ExpressionUtils.setField(this._dataAccessors, "endDate", result, endDate); return result } hideAppointmentPopup(saveChanges) { var _this$_appointmentPop3; if (null !== (_this$_appointmentPop3 = this._appointmentPopup) && void 0 !== _this$_appointmentPop3 && _this$_appointmentPop3.visible) { saveChanges && this._appointmentPopup.saveChangesAsync(); this._appointmentPopup.hide() } } showAppointmentTooltip(appointment, element, targetedAppointment) { if (appointment) { const settings = _m_utils.utils.dataAccessors.getAppointmentSettings(element); const appointmentConfig = { itemData: targetedAppointment || appointment, groupIndex: null === settings || void 0 === settings ? void 0 : settings.groupIndex, groups: this.option("groups") }; const getAppointmentColor = this.createGetAppointmentColor(); const deferredColor = getAppointmentColor(appointmentConfig); const info = new _m_data_structures.AppointmentTooltipInfo(appointment, targetedAppointment, deferredColor); this.showAppointmentTooltipCore(element, [info]) } } createGetAppointmentColor() { return appointmentConfig => { const resourceConfig = { resources: this.option("resources"), dataAccessors: this.getResourceDataAccessors(), loadedResources: this.option("loadedResources"), resourceLoaderMap: this.option("resourceLoaderMap") }; return (0, _m_utils2.getAppointmentColor)(resourceConfig, appointmentConfig) } } showAppointmentTooltipCore(target, data, options) { const arg = { cancel: false, appointments: data.map((item => { const result = { appointmentData: item.appointment, currentAppointmentData: _extends({}, item.targetedAppointment), color: item.color }; if (item.settings.info) { const { startDate: startDate, endDate: endDate } = item.settings.info.appointment; result.currentAppointmentData.displayStartDate = startDate; result.currentAppointmentData.displayEndDate = endDate } return result })), targetElement: (0, _element.getPublicElement)(target) }; this._createActionByOption("onAppointmentTooltipShowing")(arg); if (this._appointmentTooltip.isAlreadyShown(target)) { this.hideAppointmentTooltip() } else { this._processActionResult(arg, (canceled => { !canceled && this._appointmentTooltip.show(target, data, _extends({}, this._getExtraAppointmentTooltipOptions(), options)) })) } } hideAppointmentTooltip() { this._appointmentTooltip && this._appointmentTooltip.hide() } scrollToTime(hours, minutes, date) { _ui.default.log("W0002", "dxScheduler", "scrollToTime", "21.1", 'Use the "scrollTo" method instead'); this._workSpace.scrollToTime(hours, minutes, date) } scrollTo(date, groups, allDay) { this._workSpace.scrollTo(date, groups, allDay) } _isHorizontalVirtualScrolling() { const scrolling = this.option("scrolling"); const { orientation: orientation, mode: mode } = scrolling; const isVirtualScrolling = "virtual" === mode; return isVirtualScrolling && ("horizontal" === orientation || "both" === orientation) } addAppointment(rawAppointment) { const appointment = (0, _m_appointment_adapter.createAppointmentAdapter)(rawAppointment, this._dataAccessors, this.timeZoneCalculator); appointment.text = appointment.text || ""; const serializedAppointment = appointment.source(true); const addingOptions = { appointmentData: serializedAppointment, cancel: false }; this._actions[StoreEventNames_ADDING](addingOptions); return this._processActionResult(addingOptions, (canceled => { if (canceled) { return (new _deferred.Deferred).resolve() } this._expandAllDayPanel(serializedAppointment); return this.appointmentDataProvider.add(serializedAppointment).always((storeAppointment => this._onDataPromiseCompleted(StoreEventNames_ADDED, storeAppointment))) })) } updateAppointment(target, appointment) { return this._updateAppointment(target, appointment) } deleteAppointment(rawAppointment) { const deletingOptions = this.fireOnAppointmentDeleting(rawAppointment); this.processDeleteAppointment(rawAppointment, deletingOptions) } fireOnAppointmentDeleting(rawAppointment, targetedAppointmentData) { const deletingOptions = { appointmentData: rawAppointment, targetedAppointmentData: targetedAppointmentData, cancel: false }; this._actions[StoreEventNames_DELETING](deletingOptions); return deletingOptions } processDeleteAppointment(rawAppointment, deletingOptions) { this._processActionResult(deletingOptions, (function(canceled) { if (!canceled) { this.appointmentDataProvider.remove(rawAppointment).always((storeAppointment => this._onDataPromiseCompleted(StoreEventNames_DELETED, storeAppointment, rawAppointment))) } })) } deleteRecurrence(appointment, date, recurrenceEditMode) { this._checkRecurringAppointment(appointment, {}, date, (() => { this.processDeleteAppointment(appointment, { cancel: false }) }), true, false, null, recurrenceEditMode) } focus() { if (this._editAppointmentData) { this._appointments.focus() } else { this._workSpace.focus() } } getFirstDayOfWeek() { return (0, _type.isDefined)(this.option("firstDayOfWeek")) ? this.option("firstDayOfWeek") : _date2.default.firstDayOfWeekIndex() } _validateKeyFieldIfAgendaExist() { if (!this.appointmentDataProvider.isDataSourceInit) { return } const hasAgendaView = !!this._getViewByName("agenda"); const isKeyExist = !!this.appointmentDataProvider.keyName; if (hasAgendaView && !isKeyExist) { _ui.default.log("W1023") } } _getDragBehavior() { return this._workSpace.dragBehavior } getViewOffsetMs() { const offsetFromOptions = this._getCurrentViewOption("offset"); return this.normalizeViewOffsetValue(offsetFromOptions) } normalizeViewOffsetValue(viewOffset) { if (!(0, _type.isDefined)(viewOffset) || this.currentViewType === _m_constants.VIEWS.AGENDA) { return 0 } return viewOffset * toMs("minute") } validateOptions() { const currentViewOptions = _extends({}, this.option(), { startDayHour: this._getCurrentViewOption("startDayHour"), endDayHour: this._getCurrentViewOption("endDayHour"), offset: this._getCurrentViewOption("offset"), cellDuration: this._getCurrentViewOption("cellDuration") }); const validationResult = this._optionsValidator.validate(currentViewOptions); this._optionsValidatorErrorHandler.handleValidationResult(validationResult) } } Scheduler.include(_data_helper.default); (0, _component_registrator.default)("dxScheduler", Scheduler); exports.default = Scheduler }, 86681: /*!**********************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_subscribes.js ***! \**********************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../core/renderer */ 68374)); var _date = _interopRequireDefault(__webpack_require__( /*! ../../core/utils/date */ 91198)); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 95479); var _type = __webpack_require__( /*! ../../core/utils/type */ 35922); var _m_text_utils = __webpack_require__( /*! ./appointments/m_text_utils */ 18775); var _m_appointment_adapter = __webpack_require__( /*! ./m_appointment_adapter */ 72734); var _m_classes = __webpack_require__( /*! ./m_classes */ 43600); var _m_utils = __webpack_require__( /*! ./m_utils */ 84110); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const toMs = _date.default.dateToMilliseconds; const subscribes = { isCurrentViewAgenda() { return "agenda" === this.currentViewType }, currentViewUpdated(currentView) { this.option("currentView", currentView) }, currentDateUpdated(date) { this.option("currentDate", date) }, getOption(name) { return this.option(name) }, getWorkspaceOption(name) { return this.getWorkSpace().option(name) }, isVirtualScrolling() { return this.isVirtualScrolling() }, setCellDataCacheAlias(appointment, geometry) { this._workSpace.setCellDataCacheAlias(appointment, geometry) }, isGroupedByDate() { return this.getWorkSpace().isGroupedByDate() }, showAppointmentTooltip(options) { const targetedAppointment = this.getTargetedAppointment(options.data, options.target); this.showAppointmentTooltip(options.data, options.target, targetedAppointment) }, hideAppointmentTooltip() { this.hideAppointmentTooltip() }, showEditAppointmentPopup(options) { const targetedData = this.getTargetedAppointment(options.data, options.target); this.showAppointmentPopup(options.data, false, targetedData) }, updateAppointmentAfterResize(options) { const info = _m_utils.utils.dataAccessors.getAppointmentInfo(options.$appointment); const { exceptionDate: exceptionDate } = info.sourceAppointment; this._checkRecurringAppointment(options.target, options.data, exceptionDate, (() => { this._updateAppointment(options.target, options.data, (function() { this._appointments.moveAppointmentBack() })) })) }, getUpdatedData(rawAppointment) { return this._getUpdatedData(rawAppointment) }, updateAppointmentAfterDrag(_ref) { let { event: event, element: element, rawAppointment: rawAppointment, newCellIndex: newCellIndex, oldCellIndex: oldCellIndex } = _ref; const info = _m_utils.utils.dataAccessors.getAppointmentInfo(element); const appointment = (0, _m_appointment_adapter.createAppointmentAdapter)(rawAppointment, this._dataAccessors, this.timeZoneCalculator); const targetedAppointment = (0, _m_appointment_adapter.createAppointmentAdapter)((0, _extend.extend)({}, rawAppointment, this._getUpdatedData(rawAppointment)), this._dataAccessors, this.timeZoneCalculator); const targetedRawAppointment = targetedAppointment.source(); const becomeAllDay = targetedAppointment.allDay; const wasAllDay = appointment.allDay; const movedBetweenAllDayAndSimple = this._workSpace.supportAllDayRow() && (wasAllDay && !becomeAllDay || !wasAllDay && becomeAllDay); const isDragAndDropBetweenComponents = event.fromComponent !== event.toComponent; if (-1 === newCellIndex) { if (!isDragAndDropBetweenComponents) { this._appointments.moveAppointmentBack(event) } return } if (newCellIndex !== oldCellIndex || isDragAndDropBetweenComponents || movedBetweenAllDayAndSimple) { this._checkRecurringAppointment(rawAppointment, targetedRawAppointment, info.sourceAppointment.exceptionDate, (() => { this._updateAppointment(rawAppointment, targetedRawAppointment, (function() { this._appointments.moveAppointmentBack(event) }), event) }), void 0, void 0, event) } else { this._appointments.moveAppointmentBack(event) } }, onDeleteButtonPress(options) { const targetedData = this.getTargetedAppointment(options.data, (0, _renderer.default)(options.target)); this.checkAndDeleteAppointment(options.data, targetedData); this.hideAppointmentTooltip() }, getTextAndFormatDate(appointmentRaw, targetedAppointmentRaw, format) { const appointmentAdapter = (0, _m_appointment_adapter.createAppointmentAdapter)(appointmentRaw, this._dataAccessors, this.timeZoneCalculator); const targetedAdapter = (0, _m_appointment_adapter.createAppointmentAdapter)(targetedAppointmentRaw || appointmentRaw, this._dataAccessors, this.timeZoneCalculator); const startDate = this.timeZoneCalculator.createDate(targetedAdapter.startDate, { path: "toGrid" }); const endDate = this.timeZoneCalculator.createDate(targetedAdapter.endDate, { path: "toGrid" }); const formatType = format || (0, _m_text_utils.getFormatType)(startDate, endDate, targetedAdapter.allDay, "month" !== this.currentViewType); return { text: targetedAdapter.text || appointmentAdapter.text, formatDate: (0, _m_text_utils.formatDates)(startDate, endDate, formatType) } }, _createAppointmentTitle(data) { if ((0, _type.isPlainObject)(data)) { return data.text } return String(data) }, getResizableAppointmentArea(options) { const { allDay: allDay } = options; const groups = this._getCurrentViewOption("groups"); if (groups && groups.length) { if (allDay || this.getLayoutManager().getRenderingStrategyInstance()._needHorizontalGroupBounds()) { const horizontalGroupBounds = this._workSpace.getGroupBounds(options.coordinates); return { left: horizontalGroupBounds.left, right: horizontalGroupBounds.right, top: 0, bottom: 0 } } if (this.getLayoutManager().getRenderingStrategyInstance()._needVerticalGroupBounds(allDay) && this._workSpace._isVerticalGroupedWorkSpace()) { const verticalGroupBounds = this._workSpace.getGroupBounds(options.coordinates); return { left: 0, right: 0, top: verticalGroupBounds.top, bottom: verticalGroupBounds.bottom } } } return }, needRecalculateResizableArea() { return this.getWorkSpace().needRecalculateResizableArea() }, getAppointmentGeometry(settings) { return this.getLayoutManager().getRenderingStrategyInstance().getAppointmentGeometry(settings) }, isAllDay(appointmentData) { return this.getLayoutManager().getRenderingStrategyInstance().isAllDay(appointmentData) }, getDeltaTime(e, initialSize, itemData) { return this.getLayoutManager().getRenderingStrategyInstance().getDeltaTime(e, initialSize, itemData) }, getDropDownAppointmentWidth(isAllDay) { return this.getLayoutManager().getRenderingStrategyInstance().getDropDownAppointmentWidth(this._getViewCountConfig().intervalCount, isAllDay) }, getDropDownAppointmentHeight() { return this.getLayoutManager().getRenderingStrategyInstance().getDropDownAppointmentHeight() }, getCellWidth() { return this.getWorkSpace().getCellWidth() }, getCellHeight() { return this.getWorkSpace().getCellHeight() }, getMaxAppointmentCountPerCellByType(isAllDay) { return this.getRenderingStrategyInstance()._getMaxAppointmentCountPerCellByType(isAllDay) }, needCorrectAppointmentDates() { return this.getRenderingStrategyInstance().needCorrectAppointmentDates() }, getRenderingStrategyDirection() { return this.getRenderingStrategyInstance().getDirection() }, updateAppointmentEndDate(options) { const { endDate: endDate } = options; const endDayHour = this._getCurrentViewOption("endDayHour"); const startDayHour = this._getCurrentViewOption("startDayHour"); let updatedEndDate = endDate; if (endDate.getHours() >= endDayHour) { updatedEndDate.setHours(endDayHour, 0, 0, 0) } else if (!options.isSameDate && startDayHour > 0 && 60 * endDate.getHours() + endDate.getMinutes() < 60 * startDayHour) { updatedEndDate = new Date(updatedEndDate.getTime() - toMs("day")); updatedEndDate.setHours(endDayHour, 0, 0, 0) } return updatedEndDate }, renderCompactAppointments(options) { this._compactAppointmentsHelper.render(options) }, clearCompactAppointments() { this._compactAppointmentsHelper.clear() }, supportCompactDropDownAppointments() { return this.getLayoutManager().getRenderingStrategyInstance().supportCompactDropDownAppointments() }, getGroupCount() { return this._workSpace._getGroupCount() }, mapAppointmentFields(config) { const { itemData: itemData, itemElement: itemElement, targetedAppointment: targetedAppointment } = config; const targetedData = targetedAppointment || this.getTargetedAppointment(itemData, itemElement); return { appointmentData: config.itemData, appointmentElement: config.itemElement, targetedAppointmentData: targetedData } }, dayHasAppointment(day, appointment, trimTime) { return this.dayHasAppointment(day, appointment, trimTime) }, getLayoutManager() { return this._layoutManager }, getAgendaVerticalStepHeight() { return this.getWorkSpace().getAgendaVerticalStepHeight() }, getAgendaDuration() { return this._getCurrentViewOption("agendaDuration") }, getStartViewDate() { return this.getStartViewDate() }, getEndViewDate() { return this.getEndViewDate() }, forceMaxAppointmentPerCell() { return this.forceMaxAppointmentPerCell() }, onAgendaReady(rows) { const $appts = this.getAppointmentsInstance()._itemElements(); let total = 0; const applyClass = function(_, count) { const index = count + total - 1; $appts.eq(index).addClass(_m_classes.AGENDA_LAST_IN_DATE_APPOINTMENT_CLASS); total += count }; for (let i = 0; i < rows.length; i++) { (0, _iterator.each)(rows[i], applyClass) } }, getTimezone() { return this._getTimezoneOffsetByOption() }, getTargetedAppointmentData(appointment, element) { return this.getTargetedAppointment(appointment, element) }, getEndDayHour() { return this._workSpace.option("endDayHour") || this.option("endDayHour") }, getStartDayHour() { return this._workSpace.option("startDayHour") || this.option("startDayHour") }, getViewOffsetMs() { return this.getViewOffsetMs() }, isAdaptive() { return this.option("adaptivityEnabled") }, removeDroppableCellClass() { this._workSpace.removeDroppableCellClass() } }; exports.default = subscribes }, 82215: /*!*************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_table_creator.js ***! \*************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../core/dom_adapter */ 73349)); var _element = __webpack_require__( /*! ../../core/element */ 6415); var _element_data = __webpack_require__( /*! ../../core/element_data */ 97906); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../core/renderer */ 68374)); var _type = __webpack_require__( /*! ../../core/utils/type */ 35922); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } exports.default = { tableCreator: new class { constructor() { this.VERTICAL = "vertical"; this.HORIZONTAL = "horizontal" } insertAllDayRow(allDayElements, tableBody, index) { if (allDayElements[index]) { let row = allDayElements[index].find("tr"); if (!row.length) { row = (0, _renderer.default)(_dom_adapter.default.createElement("tr")); row.append(allDayElements[index].get(0)) } tableBody.appendChild(row.get ? row.get(0) : row) } } makeTable(options) { const tableBody = _dom_adapter.default.createElement("tbody"); const templateCallbacks = []; let row; const rowCountInGroup = options.groupCount ? options.rowCount / options.groupCount : options.rowCount; let allDayElementIndex = 0; const { allDayElements: allDayElements } = options; const { groupIndex: groupIndex } = options; const { rowCount: rowCount } = options; (0, _renderer.default)(options.container).append(tableBody); if (allDayElements) { this.insertAllDayRow(allDayElements, tableBody, 0); allDayElementIndex++ } for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) { row = _dom_adapter.default.createElement("tr"); tableBody.appendChild(row); const isLastRowInGroup = (rowIndex + 1) % rowCountInGroup === 0; if (options.rowClass) { row.className = options.rowClass } for (let columnIndex = 0; columnIndex < options.cellCount; columnIndex++) { var _options$setAdditiona; const td = _dom_adapter.default.createElement("td"); row.appendChild(td); if (options.cellClass) { if ((0, _type.isFunction)(options.cellClass)) { td.className = options.cellClass(rowIndex, columnIndex) } else { td.className = options.cellClass } } let cellDataObject; let dataKey; let dataValue; if (options.getCellData) { cellDataObject = options.getCellData(td, rowIndex, columnIndex, groupIndex); dataKey = cellDataObject.key; dataValue = cellDataObject.value; dataKey && (0, _element_data.data)(td, dataKey, dataValue) } null === (_options$setAdditiona = options.setAdditionalClasses) || void 0 === _options$setAdditiona || _options$setAdditiona.call(options, (0, _renderer.default)(td), dataValue); if (options.cellTemplate && options.cellTemplate.render) { const additionalTemplateData = options.getTemplateData ? options.getTemplateData(rowIndex) : {}; const templateOptions = { model: _extends({ text: options.getCellText ? options.getCellText(rowIndex, columnIndex) : "", date: options.getCellDate ? options.getCellDate(rowIndex) : void 0 }, additionalTemplateData), container: (0, _element.getPublicElement)((0, _renderer.default)(td)), index: rowIndex * options.cellCount + columnIndex }; 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) { (0, _renderer.default)("
").text(options.getCellText(rowIndex, columnIndex)).addClass(options.getCellTextClass).appendTo((0, _renderer.default)(td)) } } if (allDayElements && isLastRowInGroup) { this.insertAllDayRow(allDayElements, tableBody, allDayElementIndex); allDayElementIndex++ } } return templateCallbacks } makeGroupedTable(type, groups, cssClasses, cellCount, cellTemplate, rowCount, groupByDate) { let rows = []; if (type === this.VERTICAL) { rows = this._makeVerticalGroupedRows(groups, cssClasses, cellTemplate, rowCount) } else { rows = this._makeHorizontalGroupedRows(groups, cssClasses, cellCount, cellTemplate, groupByDate) } return rows } makeGroupedTableFromJSON(type, data, config) { let table; const cellStorage = []; let rowIndex = 0; config = config || {}; const cellTag = config.cellTag || "td"; const childrenField = config.childrenField || "children"; const titleField = config.titleField || "title"; const { groupTableClass: groupTableClass } = config; const { groupRowClass: groupRowClass } = config; const { groupCellClass: groupCellClass } = config; const { groupCellCustomContent: groupCellCustomContent } = config; function getChildCount(item) { if (item[childrenField]) { return item[childrenField].length } return 0 } function createCell(text, childCount, index, data) { const cell = { element: _dom_adapter.default.createElement(cellTag), childCount: childCount }; if (groupCellClass) { cell.element.className = groupCellClass } const cellText = _dom_adapter.default.createTextNode(text); if ("function" === typeof groupCellCustomContent) { groupCellCustomContent(cell.element, cellText, index, data) } else { cell.element.appendChild(cellText) } return cell }! function() { table = _dom_adapter.default.createElement("table"); if (groupTableClass) { table.className = groupTableClass } }(); ! function generateCells(data) { for (let i = 0; i < data.length; i++) { const childCount = getChildCount(data[i]); const 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++ } } }(data); void cellStorage.forEach((cells => { const row = _dom_adapter.default.createElement("tr"); if (groupRowClass) { row.className = groupRowClass } const rowspans = []; for (let i = cells.length - 1; i >= 0; i--) { const prev = cells[i + 1]; let rowspan = cells[i].childCount; if (prev && prev.childCount) { rowspan *= prev.childCount } rowspans.push(rowspan) } rowspans.reverse(); cells.forEach(((cell, index) => { if (rowspans[index]) { cell.element.setAttribute("rowSpan", rowspans[index]) } row.appendChild(cell.element) })); table.appendChild(row) })); return table } _makeFlexGroupedRowCells(group, repeatCount, cssClasses, cellTemplate) { let repeatByDate = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 1; const cells = []; const { items: items } = group; const itemCount = items.length; for (let i = 0; i < repeatCount * repeatByDate; i++) { for (let j = 0; j < itemCount; j++) { let $container = (0, _renderer.default)("
"); const cell = {}; if (cellTemplate && cellTemplate.render) { const templateOptions = { model: items[j], container: (0, _element.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).attr("title", items[j].text).addClass("dx-scheduler-group-header-content"); $container = (0, _renderer.default)("
").append($container) } const cssClass = (0, _type.isFunction)(cssClasses.groupHeaderClass) ? cssClasses.groupHeaderClass(j) : cssClasses.groupHeaderClass; cell.element = $container.addClass(cssClass); cells.push(cell) } } return cells } _makeVerticalGroupedRows(groups, cssClasses, cellTemplate, rowCount) { const cellTemplates = []; let repeatCount = 1; const cellsArray = []; const cellIterator = function(cell) { if (cell.template) { cellTemplates.push(cell.template) } }; for (let i = 0; i < groups.length; i++) { if (i > 0) { repeatCount = groups[i - 1].items.length * repeatCount } const cells = this._makeFlexGroupedRowCells(groups[i], repeatCount, cssClasses, cellTemplate); cells.forEach(cellIterator); cellsArray.push(cells) } const rows = []; const groupCount = cellsArray.length; for (let i = 0; i < groupCount; i++) { rows.push((0, _renderer.default)("
").addClass(cssClasses.groupHeaderRowClass)) } for (let i = groupCount - 1; i >= 0; i--) { const currentColumnLength = cellsArray[i].length; for (let j = 0; j < currentColumnLength; j++) { rows[i].append(cellsArray[i][j].element) } } return { elements: (0, _renderer.default)("
").addClass("dx-scheduler-group-flex-container").append(rows), cellTemplates: cellTemplates } } _makeHorizontalGroupedRows(groups, cssClasses, cellCount, cellTemplate, groupByDate) { let repeatCount = 1; const groupCount = groups.length; const rows = []; const cellTemplates = []; const repeatByDate = groupByDate ? cellCount : 1; const cellIterator = function(cell) { if (cell.template) { cellTemplates.push(cell.template) } return cell.element }; for (let i = 0; i < groupCount; i++) { if (i > 0) { repeatCount = groups[i - 1].items.length * repeatCount } const cells = this._makeGroupedRowCells(groups[i], repeatCount, cssClasses, cellTemplate, repeatByDate); rows.push((0, _renderer.default)("
").addClass(cssClass).append($container); cells.push(cell) } } return cells } } } }, 84110: /*!*****************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_utils.js ***! \*****************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.utils = void 0; var _element = __webpack_require__( /*! ../../core/element */ 6415); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../core/renderer */ 68374)); var _data = __webpack_require__( /*! ../../core/utils/data */ 47617); var _date_serialization = _interopRequireDefault(__webpack_require__( /*! ../../core/utils/date_serialization */ 69434)); var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 95479); var _size = __webpack_require__( /*! ../../core/utils/size */ 58664); var _m_constants = __webpack_require__( /*! ./m_constants */ 6324); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const utils = exports.utils = { dataAccessors: { getAppointmentSettings: element => (0, _renderer.default)(element).data(_m_constants.APPOINTMENT_SETTINGS_KEY), getAppointmentInfo: element => { const settings = utils.dataAccessors.getAppointmentSettings(element); return null === settings || void 0 === settings ? void 0 : settings.info }, create: (fields, currentDataAccessors, forceIsoDateParsing, dateSerializationFormat) => { const dataAccessors = currentDataAccessors ? _extends({}, currentDataAccessors) : { getter: {}, setter: {}, expr: {} }; (0, _iterator.each)(fields, ((name, expr) => { if (expr) { const getter = (0, _data.compileGetter)(expr); const setter = (0, _data.compileSetter)(expr); let dateGetter; let dateSetter; let serializationFormat; if (field = name, "startDate" === field || "endDate" === field) { dateGetter = object => { let value = getter(object); if (forceIsoDateParsing) { value = _date_serialization.default.deserializeDate(value) } return value }; dateSetter = (object, value) => { if (dateSerializationFormat) { serializationFormat = dateSerializationFormat } else if (forceIsoDateParsing && !serializationFormat) { const oldValue = getter(object); serializationFormat = _date_serialization.default.getDateSerializationFormat(oldValue) } const newValue = _date_serialization.default.serializeDate(value, serializationFormat); setter(object, newValue) } } dataAccessors.getter[name] = dateGetter || getter; dataAccessors.setter[name] = dateSetter || setter; dataAccessors.expr[`${name}Expr`] = expr } else { delete dataAccessors.getter[name]; delete dataAccessors.setter[name]; delete dataAccessors.expr[`${name}Expr`] } var field })); return dataAccessors } }, DOM: { getHeaderHeight: header => header ? header._$element && parseInt((0, _size.getOuterHeight)(header._$element), 10) : 0 }, renovation: { renderComponent: (widget, parentElement, componentClass, componentName, viewModel) => { let component = widget[componentName]; if (!component) { const container = (0, _element.getPublicElement)(parentElement); component = widget._createComponent(container, componentClass, viewModel); widget[componentName] = component } else { const $element = component.$element(); const elementStyle = $element.get(0).style; const { height: height } = elementStyle; const { width: width } = elementStyle; component.option(viewModel); if (height) { (0, _size.setHeight)($element, height) } if (width) { (0, _size.setWidth)($element, width) } } } } } }, 57880: /*!***************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/m_utils_time_zone.js ***! \***************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _errors = _interopRequireDefault(__webpack_require__( /*! ../../core/errors */ 17381)); var _date = __webpack_require__( /*! ../core/utils/date */ 24321); var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../core/utils/date */ 91198)); var _m_date_adapter = _interopRequireDefault(__webpack_require__( /*! ./m_date_adapter */ 90006)); var _m_utils_timezones_data = _interopRequireDefault(__webpack_require__( /*! ./timezones/m_utils_timezones_data */ 23778)); var _timezone_list = _interopRequireDefault(__webpack_require__( /*! ./timezones/timezone_list */ 99740)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const toMs = _date2.default.dateToMilliseconds; const offsetFormatRegexp = /^GMT(?:[+-]\d{2}:\d{2})?$/; const createUTCDate = date => new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes())); const getTimezoneOffsetChangeInMinutes = (startDate, endDate, updatedStartDate, updatedEndDate) => getDaylightOffset(updatedStartDate, updatedEndDate) - getDaylightOffset(startDate, endDate); const getDaylightOffset = (startDate, endDate) => new Date(startDate).getTimezoneOffset() - new Date(endDate).getTimezoneOffset(); const getDaylightOffsetInMs = (startDate, endDate) => getDaylightOffset(startDate, endDate) * toMs("minute"); const isValidDate = date => date instanceof Date && !isNaN(date.valueOf()); const calculateTimezoneByValue = function(timeZone) { let date = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new Date; if (!timeZone) { return } const isValidTimezone = _timezone_list.default.value.includes(timeZone); if (!isValidTimezone) { _errors.default.log("W0009", timeZone); return } if (!isValidDate(date)) { return } let result = function(timezone) { let date = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new Date; const customTimezones = _m_utils_timezones_data.default.getTimeZonesOld(); if (0 === customTimezones.length) { return } const dateUtc = createUTCDate(date); return _m_utils_timezones_data.default.getTimeZoneOffsetById(timezone, dateUtc.getTime()) }(timeZone, date); if (void 0 === result) { result = function(timeZone) { let date = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new Date; const offset = getStringOffset(timeZone, date); if (void 0 === offset) { return } if ("GMT" === offset) { return 0 } const isMinus = "-" === offset.substring(3, 4); const hours = offset.substring(4, 6); const minutes = offset.substring(7, 9); const result = parseInt(hours, 10) + parseInt(minutes, 10) / 60; return isMinus ? -result : result }(timeZone, date) } return result }; const getStringOffset = function(timeZone) { let date = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new Date; let result = ""; try { var _dateTimeFormat$forma; const dateTimeFormat = new Intl.DateTimeFormat("en-US", { timeZone: timeZone, timeZoneName: "longOffset" }); result = (null === (_dateTimeFormat$forma = dateTimeFormat.formatToParts(date).find((_ref => { let { type: type } = _ref; return "timeZoneName" === type }))) || void 0 === _dateTimeFormat$forma ? void 0 : _dateTimeFormat$forma.value) ?? "" } catch (e) { _errors.default.log("W0009", timeZone); return } const isSupportedFormat = offsetFormatRegexp.test(result); if (!isSupportedFormat) { _errors.default.log("W0009", timeZone); return } return result }; const getTimezoneTitle = function(timeZone) { let date = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new Date; if (!isValidDate(date)) { return "" } const tzNamePart = timeZone.replace(/\//g, " - ").replace(/_/g, " "); const offset = getStringOffset(timeZone, date); if (void 0 === offset) { return } const offsetNamePart = (offset => { if ("GMT" === offset) { return `${offset} +00:00` } return offset.replace("GMT", "GMT ") })(offset); return `(${offsetNamePart}) ${tzNamePart}` }; const _getDaylightOffsetByTimezone = (startDate, endDate, timeZone) => { const startDayOffset = calculateTimezoneByValue(timeZone, startDate); const endDayOffset = calculateTimezoneByValue(timeZone, endDate); if (void 0 === startDayOffset || void 0 === endDayOffset) { return 0 } return startDayOffset - endDayOffset }; const isTimezoneChangeInDate = date => { const startDayDate = new Date(new Date(date).setHours(0, 0, 0, 0)); const endDayDate = new Date(new Date(date).setHours(23, 59, 59, 0)); return startDayDate.getTimezoneOffset() - endDayDate.getTimezoneOffset() !== 0 }; const getClientTimezoneOffset = function() { let date = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : new Date; return 6e4 * date.getTimezoneOffset() }; const hasDSTInLocalTimeZone = () => { const [startDate, endDate] = getExtremeDates(); return startDate.getTimezoneOffset() !== endDate.getTimezoneOffset() }; const getOffset = date => -date.getTimezoneOffset() / 60; const getDateAndMoveHourBack = dateStamp => new Date(dateStamp - toMs("hour")); const isEqualLocalTimeZoneByDeclaration = (timeZoneName, date) => { const customTimezones = _m_utils_timezones_data.default.getTimeZonesOld(); const targetTimezoneData = customTimezones.filter((tz => tz.id === timeZoneName)); if (1 === targetTimezoneData.length) { return ((timeZoneName, date) => { const year = date.getFullYear(); const configTuple = _m_utils_timezones_data.default.getTimeZoneDeclarationTuple(timeZoneName, year); const [summerTime, winterTime] = configTuple; const noDSTInTargetTimeZone = configTuple.length < 2; if (noDSTInTargetTimeZone) { const targetTimeZoneOffset = _m_utils_timezones_data.default.getTimeZoneOffsetById(timeZoneName, date); const localTimeZoneOffset = getOffset(date); if (targetTimeZoneOffset !== localTimeZoneOffset) { return false } return !hasDSTInLocalTimeZone() } const localSummerOffset = getOffset(new Date(summerTime.date)); const localWinterOffset = getOffset(new Date(winterTime.date)); if (localSummerOffset !== summerTime.offset) { return false } if (localSummerOffset === getOffset(getDateAndMoveHourBack(summerTime.date))) { return false } if (localWinterOffset !== winterTime.offset) { return false } if (localWinterOffset === getOffset(getDateAndMoveHourBack(winterTime.date))) { return false } return true })(timeZoneName, date) } return false }; const getExtremeDates = () => { const nowDate = new Date(Date.now()); const startDate = new Date; const endDate = new Date; startDate.setFullYear(nowDate.getFullYear(), 0, 1); endDate.setFullYear(nowDate.getFullYear(), 6, 1); return [startDate, endDate] }; const utils = { getDaylightOffset: getDaylightOffset, getDaylightOffsetInMs: getDaylightOffsetInMs, getTimezoneOffsetChangeInMinutes: getTimezoneOffsetChangeInMinutes, getTimezoneOffsetChangeInMs: (startDate, endDate, updatedStartDate, updatedEndDate) => getTimezoneOffsetChangeInMinutes(startDate, endDate, updatedStartDate, updatedEndDate) * toMs("minute"), calculateTimezoneByValue: calculateTimezoneByValue, getCorrectedDateByDaylightOffsets: (convertedOriginalStartDate, convertedDate, date, timeZone, startDateTimezone) => { const daylightOffsetByCommonTimezone = _getDaylightOffsetByTimezone(convertedOriginalStartDate, convertedDate, timeZone); const daylightOffsetByAppointmentTimezone = _getDaylightOffsetByTimezone(convertedOriginalStartDate, convertedDate, startDateTimezone); const diff = daylightOffsetByCommonTimezone - daylightOffsetByAppointmentTimezone; return new Date(date.getTime() - diff * toMs("hour")) }, isSameAppointmentDates: (startDate, endDate) => { endDate = new Date(endDate.getTime() - 1); return _date2.default.sameDate(startDate, endDate) }, correctRecurrenceExceptionByTimezone: function(exception, exceptionByStartDate, timeZone, startDateTimeZone) { let isBackConversion = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : false; let timezoneOffset = (exception.getTimezoneOffset() - exceptionByStartDate.getTimezoneOffset()) / 60; if (startDateTimeZone) { timezoneOffset = _getDaylightOffsetByTimezone(exceptionByStartDate, exception, startDateTimeZone) } else if (timeZone) { timezoneOffset = _getDaylightOffsetByTimezone(exceptionByStartDate, exception, timeZone) } return new Date(exception.getTime() + (isBackConversion ? -1 : 1) * timezoneOffset * toMs("hour")) }, getClientTimezoneOffset: getClientTimezoneOffset, getDiffBetweenClientTimezoneOffsets: function() { let firstDate = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : new Date; let secondDate = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new Date; return getClientTimezoneOffset(firstDate) - getClientTimezoneOffset(secondDate) }, createUTCDateWithLocalOffset: date => { if (!date) { return null } return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds())) }, createDateFromUTCWithLocalOffset: date => { const result = (0, _m_date_adapter.default)(date); const timezoneOffsetBeforeInMin = result.getTimezoneOffset(); result.addTime(result.getTimezoneOffset("minute")); result.subtractMinutes(timezoneOffsetBeforeInMin - result.getTimezoneOffset()); return result.source }, createUTCDate: createUTCDate, isTimezoneChangeInDate: isTimezoneChangeInDate, getDateWithoutTimezoneChange: date => { const clonedDate = new Date(date); if (isTimezoneChangeInDate(clonedDate)) { const result = new Date(clonedDate); return new Date(result.setDate(result.getDate() + 1)) } return clonedDate }, hasDSTInLocalTimeZone: hasDSTInLocalTimeZone, isEqualLocalTimeZone: function(timeZoneName) { let date = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : new Date; if (Intl) { const localTimeZoneName = Intl.DateTimeFormat().resolvedOptions().timeZone; if (localTimeZoneName === timeZoneName) { return true } } return isEqualLocalTimeZoneByDeclaration(timeZoneName, date) }, isEqualLocalTimeZoneByDeclaration: isEqualLocalTimeZoneByDeclaration, getTimeZones: function() { let date = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : new Date; return _timezone_list.default.value.map((tz => ({ offset: calculateTimezoneByValue(tz, date), title: getTimezoneTitle(tz, date), id: tz }))) }, setOffsetsToDate: (targetDate, offsetsArray) => { const newDateMs = offsetsArray.reduce(((result, offset) => result + offset), targetDate.getTime()); return new Date(newDateMs) }, addOffsetsWithoutDST: function(date) { for (var _len = arguments.length, offsets = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { offsets[_key - 1] = arguments[_key] } const newDate = _date.dateUtilsTs.addOffsets(date, offsets); const daylightShift = getDaylightOffsetInMs(date, newDate); if (!daylightShift) { return newDate } const correctLocalDate = _date.dateUtilsTs.addOffsets(newDate, [-daylightShift]); const daylightSecondShift = getDaylightOffsetInMs(newDate, correctLocalDate); return !daylightSecondShift ? correctLocalDate : newDate } }; exports.default = utils }, 39146: /*!****************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/options_validator/common/index.js ***! \****************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); var _validation_functions = __webpack_require__( /*! ./validation_functions */ 52257); Object.keys(_validation_functions).forEach((function(key) { if ("default" === key || "__esModule" === key) { return } if (key in exports && exports[key] === _validation_functions[key]) { return } Object.defineProperty(exports, key, { enumerable: true, get: function() { return _validation_functions[key] } }) })); var _validator_rules = __webpack_require__( /*! ./validator_rules */ 63974); Object.keys(_validator_rules).forEach((function(key) { if ("default" === key || "__esModule" === key) { return } if (key in exports && exports[key] === _validator_rules[key]) { return } Object.defineProperty(exports, key, { enumerable: true, get: function() { return _validator_rules[key] } }) })) }, 52257: /*!*******************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/options_validator/common/validation_functions.js ***! \*******************************************************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.lessThan = exports.isInteger = exports.inRange = exports.greaterThan = exports.divisibleBy = void 0; exports.isInteger = value => Number.isInteger(value); exports.greaterThan = function(value, minimalValue) { let strict = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : true; return strict ? value > minimalValue : value >= minimalValue }; exports.lessThan = function(value, maximalValue) { let strict = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : true; return strict ? value < maximalValue : value <= maximalValue }; exports.inRange = (value, _ref) => { let [from, to] = _ref; return value >= from && value <= to }; exports.divisibleBy = (value, divider) => value % divider === 0 }, 63974: /*!**************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/options_validator/common/validator_rules.js ***! \**************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.mustBeLessThan = exports.mustBeInteger = exports.mustBeInRange = exports.mustBeGreaterThan = exports.mustBeDivisibleBy = void 0; var _index = __webpack_require__( /*! ../core/index */ 28410); var _validation_functions = __webpack_require__( /*! ./validation_functions */ 52257); exports.mustBeInteger = (0, _index.createValidatorRule)("mustBeInteger", (value => (0, _validation_functions.isInteger)(value) || `${value} must be an integer.`)); exports.mustBeGreaterThan = function(minimalValue) { let strict = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : true; return (0, _index.createValidatorRule)("mustBeGreaterThan", (value => (0, _validation_functions.greaterThan)(value, minimalValue, strict) || `${value} must be ${strict?">":">="} than ${minimalValue}.`)) }; exports.mustBeLessThan = function(maximalValue) { let strict = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : true; return (0, _index.createValidatorRule)("mustBeLessThan", (value => (0, _validation_functions.lessThan)(value, maximalValue, strict) || `${value} must be ${strict?"<":"<="} than ${maximalValue}.`)) }; exports.mustBeInRange = range => (0, _index.createValidatorRule)("mustBeInRange", (value => (0, _validation_functions.inRange)(value, range) || `${value} must be in range [${range[0]}, ${range[1]}].`)); exports.mustBeDivisibleBy = divider => (0, _index.createValidatorRule)("mustBeDivisibleBy", (value => (0, _validation_functions.divisibleBy)(value, divider) || `${value} must be divisible by ${divider}.`)) }, 28410: /*!**************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/options_validator/core/index.js ***! \**************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); var _exportNames = { OptionsValidator: true, OptionsValidatorErrorHandler: true, Validator: true }; Object.defineProperty(exports, "OptionsValidator", { enumerable: true, get: function() { return _options_validator.OptionsValidator } }); Object.defineProperty(exports, "OptionsValidatorErrorHandler", { enumerable: true, get: function() { return _options_validator_error_handler.OptionsValidatorErrorHandler } }); Object.defineProperty(exports, "Validator", { enumerable: true, get: function() { return _validator.Validator } }); var _options_validator = __webpack_require__( /*! ./options_validator */ 88942); var _options_validator_error_handler = __webpack_require__( /*! ./options_validator_error_handler */ 2572); var _types = __webpack_require__( /*! ./types */ 56007); Object.keys(_types).forEach((function(key) { if ("default" === key || "__esModule" === key) { return } if (Object.prototype.hasOwnProperty.call(_exportNames, key)) { return } if (key in exports && exports[key] === _types[key]) { return } Object.defineProperty(exports, key, { enumerable: true, get: function() { return _types[key] } }) })); var _validator = __webpack_require__( /*! ./validator */ 61614); var _validator_rules = __webpack_require__( /*! ./validator_rules */ 28396); Object.keys(_validator_rules).forEach((function(key) { if ("default" === key || "__esModule" === key) { return } if (Object.prototype.hasOwnProperty.call(_exportNames, key)) { return } if (key in exports && exports[key] === _validator_rules[key]) { return } Object.defineProperty(exports, key, { enumerable: true, get: function() { return _validator_rules[key] } }) })) }, 88942: /*!**************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/options_validator/core/options_validator.js ***! \**************************************************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.OptionsValidator = void 0; exports.OptionsValidator = class { constructor(validators) { this.validators = validators } validate(options) { const errors = Object.entries(this.validators).reduce(((result, _ref) => { let [validatorName, validator] = _ref; const validatorResult = validator.validate(options); if (true !== validatorResult) { result[validatorName] = validatorResult } return result }), {}); return Object.keys(errors).length > 0 ? errors : true } } }, 2572: /*!****************************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/options_validator/core/options_validator_error_handler.js ***! \****************************************************************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.OptionsValidatorErrorHandler = void 0; exports.OptionsValidatorErrorHandler = class { constructor(validatorNameToErrorCodeMap, globalErrorHandler) { this.validatorNameToErrorCodeMap = validatorNameToErrorCodeMap; this.globalErrorHandler = globalErrorHandler } handleValidationResult(optionsValidatorResult) { if (true === optionsValidatorResult) { return } const uniqErrorCodes = Object.keys(optionsValidatorResult).reduce(((set, validatorName) => { const errorCode = this.validatorNameToErrorCodeMap[validatorName]; if (errorCode) { set.add(errorCode) } return set }), new Set); const errorCodeArray = [...uniqErrorCodes]; errorCodeArray.forEach(((errorCode, idx) => { const isLastErrorCode = idx === errorCodeArray.length - 1; if (!isLastErrorCode) { this.globalErrorHandler.logError(errorCode) } else { this.globalErrorHandler.throwError(errorCode) } })) } } }, 56007: /*!**************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/options_validator/core/types.js ***! \**************************************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.REDUNDANT_EXPORT = void 0; exports.REDUNDANT_EXPORT = void 0 }, 61614: /*!******************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/options_validator/core/validator.js ***! \******************************************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.Validator = void 0; exports.Validator = class { constructor(valueSelector, rules) { this.valueSelector = valueSelector; this.rules = rules } validate(options) { const value = this.valueSelector(options); const errors = this.rules.reduce(((result, rule) => { const validationResult = rule(value); if (true !== validationResult) { result[rule.name] = validationResult } return result }), {}); return Object.keys(errors).length ? errors : true } } }, 28396: /*!************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/options_validator/core/validator_rules.js ***! \************************************************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.createValidatorRule = void 0; exports.createValidatorRule = (name, ruleFunc) => { Object.defineProperty(ruleFunc, "name", { value: name, writable: false }); return ruleFunc } }, 18397: /*!*********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/options_validator/index.js ***! \*********************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "SchedulerOptionsValidator", { enumerable: true, get: function() { return _options_validator.SchedulerOptionsValidator } }); Object.defineProperty(exports, "SchedulerOptionsValidatorErrorsHandler", { enumerable: true, get: function() { return _options_validator_errors_handler.SchedulerOptionsValidatorErrorsHandler } }); var _options_validator = __webpack_require__( /*! ./options_validator */ 8226); var _options_validator_errors_handler = __webpack_require__( /*! ./options_validator_errors_handler */ 39452) }, 8226: /*!*********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/options_validator/options_validator.js ***! \*********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.SchedulerOptionsValidator = void 0; var _index = __webpack_require__( /*! ./common/index */ 39146); var _index2 = __webpack_require__( /*! ./core/index */ 28410); var _validator_rules = __webpack_require__( /*! ./validator_rules */ 1603); class SchedulerOptionsValidator extends _index2.OptionsValidator { constructor() { super({ startDayHour: new _index2.Validator((_ref => { let { startDayHour: startDayHour } = _ref; return startDayHour }), [_index.mustBeInteger, (0, _index.mustBeInRange)([0, 24])]), endDayHour: new _index2.Validator((_ref2 => { let { endDayHour: endDayHour } = _ref2; return endDayHour }), [_index.mustBeInteger, (0, _index.mustBeInRange)([0, 24])]), offset: new _index2.Validator((_ref3 => { let { offset: offset } = _ref3; return offset }), [_index.mustBeInteger, (0, _index.mustBeInRange)([-1440, 1440]), (0, _index.mustBeDivisibleBy)(5)]), cellDuration: new _index2.Validator((_ref4 => { let { cellDuration: cellDuration } = _ref4; return cellDuration }), [_index.mustBeInteger, (0, _index.mustBeGreaterThan)(0)]), startDayHourAndEndDayHour: new _index2.Validator((options => options), [_validator_rules.endDayHourMustBeGreaterThanStartDayHour]), cellDurationAndVisibleInterval: new _index2.Validator((options => options), [_validator_rules.visibleIntervalMustBeDivisibleByCellDuration, _validator_rules.cellDurationMustBeLessThanVisibleInterval]) }) } } exports.SchedulerOptionsValidator = SchedulerOptionsValidator }, 39452: /*!************************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/options_validator/options_validator_errors_handler.js ***! \************************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.SchedulerOptionsValidatorErrorsHandler = void 0; var _ui = (obj = __webpack_require__( /*! ../../../ui/widget/ui.errors */ 96688), obj && obj.__esModule ? obj : { default: obj }); var obj; var _index = __webpack_require__( /*! ./core/index */ 28410); const GLOBAL_ERROR_HANDLER = { logError: errorCode => { _ui.default.log(errorCode) }, throwError: errorCode => { throw _ui.default.Error(errorCode) } }; class SchedulerOptionsValidatorErrorsHandler extends _index.OptionsValidatorErrorHandler { constructor() { super({ startDayHour: "E1058", endDayHour: "E1058", startDayHourAndEndDayHour: "E1058", offset: "E1061", cellDuration: "E1062", cellDurationAndVisibleInterval: "E1062" }, GLOBAL_ERROR_HANDLER) } } exports.SchedulerOptionsValidatorErrorsHandler = SchedulerOptionsValidatorErrorsHandler }, 1603: /*!*******************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/options_validator/validator_rules.js ***! \*******************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.visibleIntervalMustBeDivisibleByCellDuration = exports.endDayHourMustBeGreaterThanStartDayHour = exports.cellDurationMustBeLessThanVisibleInterval = void 0; var _index = __webpack_require__( /*! ./common/index */ 39146); var _index2 = __webpack_require__( /*! ./core/index */ 28410); exports.endDayHourMustBeGreaterThanStartDayHour = (0, _index2.createValidatorRule)("endDayHourGreaterThanStartDayHour", (_ref => { let { startDayHour: startDayHour, endDayHour: endDayHour } = _ref; return (0, _index.greaterThan)(endDayHour, startDayHour) || `endDayHour: ${endDayHour} must be greater that startDayHour: ${startDayHour}.` })); exports.visibleIntervalMustBeDivisibleByCellDuration = (0, _index2.createValidatorRule)("visibleIntervalMustBeDivisibleByCellDuration", (_ref2 => { let { cellDuration: cellDuration, startDayHour: startDayHour, endDayHour: endDayHour } = _ref2; const visibleInterval = 60 * (endDayHour - startDayHour); return (0, _index.divisibleBy)(visibleInterval, cellDuration) || `endDayHour - startDayHour: ${visibleInterval} (minutes), must be divisible by cellDuration: ${cellDuration} (minutes).` })); exports.cellDurationMustBeLessThanVisibleInterval = (0, _index2.createValidatorRule)("cellDurationMustBeLessThanVisibleInterval", (_ref3 => { let { cellDuration: cellDuration, startDayHour: startDayHour, endDayHour: endDayHour } = _ref3; const visibleInterval = 60 * (endDayHour - startDayHour); return (0, _index.lessThan)(cellDuration, visibleInterval, false) || `endDayHour - startDayHour: ${visibleInterval} (minutes), must be greater or equal the cellDuration: ${cellDuration} (minutes).` })) }, 62059: /*!*************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/appointment_popup/config.js ***! \*************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.isPopupFullScreenNeeded = exports.getPopupToolbarItems = exports.getPopupSize = exports.getMaxWidth = exports.defaultAnimation = exports.POPUP_WIDTH = void 0; var _devices = _interopRequireDefault(__webpack_require__( /*! ../../../../core/devices */ 20530)); var _size = __webpack_require__( /*! ../../../../core/utils/size */ 58664); var _window = __webpack_require__( /*! ../../../../core/utils/window */ 58201); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/message */ 28109)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const POPUP_WIDTH = exports.POPUP_WIDTH = { DEFAULT: 485, RECURRENCE: 970, FULLSCREEN: 1e3, MOBILE: { DEFAULT: 350, FULLSCREEN: 500 } }; exports.defaultAnimation = { show: { type: "pop", duration: 300, from: { scale: .55 } }, hide: { type: "pop", duration: 300, to: { opacity: 0, scale: .55 }, from: { opacity: 1, scale: 1 } } }; const isMobile = () => "desktop" !== _devices.default.current().deviceType; const TOOLBAR_LOCATION_AFTER = "after", TOOLBAR_LOCATION_BEFORE = "before"; exports.getPopupToolbarItems = (allowUpdating, doneClick) => { const result = []; const buttonsConfig = { doneButton: { shortcut: "done", options: { text: _message.default.format("Done") }, location: TOOLBAR_LOCATION_AFTER }, cancelButton: { shortcut: "cancel", location: "ios" === _devices.default.current().platform ? TOOLBAR_LOCATION_BEFORE : TOOLBAR_LOCATION_AFTER } }; if (allowUpdating) { result.push(_extends({}, buttonsConfig.doneButton, { onClick: doneClick })) } result.push(buttonsConfig.cancelButton); return result }; const isPopupFullScreenNeeded = () => { const window = (0, _window.getWindow)(); const width = window && (0, _size.getWidth)(window); if (width) { return isMobile() ? width < POPUP_WIDTH.MOBILE.FULLSCREEN : width < POPUP_WIDTH.FULLSCREEN } return false }; exports.isPopupFullScreenNeeded = isPopupFullScreenNeeded; const getMaxWidth = isRecurrence => { if (isMobile()) { return POPUP_WIDTH.MOBILE.DEFAULT } return isRecurrence ? POPUP_WIDTH.RECURRENCE : POPUP_WIDTH.DEFAULT }; exports.getMaxWidth = getMaxWidth; exports.getPopupSize = isRecurrence => ({ fullScreen: isPopupFullScreenNeeded(), maxWidth: getMaxWidth(isRecurrence) }) }, 30695: /*!************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/appointment_popup/index.js ***! \************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "POPUP_WIDTH", { enumerable: true, get: function() { return _config.POPUP_WIDTH } }); Object.defineProperty(exports, "defaultAnimation", { enumerable: true, get: function() { return _config.defaultAnimation } }); Object.defineProperty(exports, "getMaxWidth", { enumerable: true, get: function() { return _config.getMaxWidth } }); Object.defineProperty(exports, "getPopupSize", { enumerable: true, get: function() { return _config.getPopupSize } }); Object.defineProperty(exports, "getPopupToolbarItems", { enumerable: true, get: function() { return _config.getPopupToolbarItems } }); Object.defineProperty(exports, "isPopupFullScreenNeeded", { enumerable: true, get: function() { return _config.isPopupFullScreenNeeded } }); var _config = __webpack_require__( /*! ./config */ 62059) }, 94460: /*!***********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/all_day_panel_cell.js ***! \***********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.AllDayPanelCell = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587); var _const = __webpack_require__( /*! ../const */ 6186); var _date_table_cell_base = __webpack_require__( /*! ./date_table_cell_base */ 75582); class AllDayPanelCell extends _inferno2.BaseInfernoComponent { render() { const { className: className, viewContext: viewContext, dataCellTemplate: dataCellTemplate, endDate: endDate, groupIndex: groupIndex, groups: groups, index: index, isFirstGroupCell: isFirstGroupCell, isFocused: isFocused, isLastGroupCell: isLastGroupCell, isSelected: isSelected, startDate: startDate } = this.props; const DataCellTemplateComponent = (0, _index.getTemplate)(dataCellTemplate); return (0, _inferno.createComponentVNode)(2, _date_table_cell_base.DateTableCellBase, { className: `${_const.ALL_DAY_PANEL_CELL_CLASS} ${className}`, viewContext: viewContext, startDate: startDate, endDate: endDate, groups: groups, groupIndex: groupIndex, allDay: true, isFirstGroupCell: isFirstGroupCell, isLastGroupCell: isLastGroupCell, index: index, dataCellTemplate: DataCellTemplateComponent, isSelected: isSelected, isFocused: isFocused }) } } exports.AllDayPanelCell = AllDayPanelCell; AllDayPanelCell.defaultProps = _date_table_cell_base.DateTableCallBaseDefaultProps }, 35947: /*!************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/all_day_panel_table.js ***! \************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.AllDayTable = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587); var _const = __webpack_require__( /*! ../const */ 6186); var _all_day_panel_table_body = __webpack_require__( /*! ./all_day_panel_table_body */ 28698); var _layout_props = __webpack_require__( /*! ./layout_props */ 21487); var _table = __webpack_require__( /*! ./table */ 1475); class AllDayTable extends _inferno2.InfernoWrapperComponent { constructor() { super(...arguments); this.allDayPanelData = null } createEffects() { return [(0, _inferno2.createReRenderEffect)()] } getAllDayPanelData() { if (null !== this.allDayPanelData) { return this.allDayPanelData } this.allDayPanelData = this.props.viewData.groupedData[0].allDayPanel; return this.allDayPanelData } componentWillUpdate(nextProps) { super.componentWillUpdate(); if (this.props.viewData !== nextProps.viewData) { this.allDayPanelData = null } } render() { const { viewData: viewData, viewContext: viewContext, width: width, tableRef: tableRef, dataCellTemplate: dataCellTemplate } = this.props; const allDayPanelData = this.getAllDayPanelData(); const DataCellTemplateComponent = (0, _index.getTemplate)(dataCellTemplate); return (0, _inferno.createComponentVNode)(2, _table.Table, { className: "dx-scheduler-all-day-table", height: allDayPanelData ? void 0 : _const.DefaultSizes.allDayPanelHeight, width: width, tableRef: tableRef, children: (0, _inferno.createComponentVNode)(2, _all_day_panel_table_body.AllDayPanelTableBody, { viewData: allDayPanelData ?? _all_day_panel_table_body.AllDayPanelTableBodyDefaultProps.viewData, viewContext: viewContext, leftVirtualCellWidth: viewData.leftVirtualCellWidth ?? _all_day_panel_table_body.AllDayPanelTableBodyDefaultProps.leftVirtualCellWidth, rightVirtualCellWidth: viewData.rightVirtualCellWidth ?? _all_day_panel_table_body.AllDayPanelTableBodyDefaultProps.rightVirtualCellWidth, leftVirtualCellCount: viewData.leftVirtualCellCount, rightVirtualCellCount: viewData.rightVirtualCellCount, dataCellTemplate: DataCellTemplateComponent }) }) } } exports.AllDayTable = AllDayTable; AllDayTable.defaultProps = _layout_props.LayoutDefaultProps }, 28698: /*!*****************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/all_day_panel_table_body.js ***! \*****************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.AllDayPanelTableBodyDefaultProps = exports.AllDayPanelTableBody = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587); var _index2 = __webpack_require__( /*! ../../utils/index */ 94084); var _all_day_panel_cell = __webpack_require__( /*! ./all_day_panel_cell */ 94460); var _row = __webpack_require__( /*! ./row */ 56449); const AllDayPanelTableBodyDefaultProps = exports.AllDayPanelTableBodyDefaultProps = { viewData: [], isVerticalGroupOrientation: false, className: "", leftVirtualCellWidth: 0, rightVirtualCellWidth: 0 }; class AllDayPanelTableBody extends _inferno2.BaseInfernoComponent { render() { const { className: className, viewData: viewData, viewContext: viewContext, leftVirtualCellWidth: leftVirtualCellWidth, rightVirtualCellWidth: rightVirtualCellWidth, leftVirtualCellCount: leftVirtualCellCount, rightVirtualCellCount: rightVirtualCellCount, isVerticalGroupOrientation: isVerticalGroupOrientation, dataCellTemplate: dataCellTemplate } = this.props; const classes = _index2.renderUtils.combineClasses({ "dx-scheduler-all-day-table-row": true, [className ?? ""]: !!className }); const DataCellTemplateComponent = (0, _index.getTemplate)(dataCellTemplate); return (0, _inferno.createComponentVNode)(2, _row.Row, { leftVirtualCellWidth: leftVirtualCellWidth, rightVirtualCellWidth: rightVirtualCellWidth, leftVirtualCellCount: leftVirtualCellCount, rightVirtualCellCount: rightVirtualCellCount, className: classes, children: viewData.map((_ref => { let { endDate: endDate, groupIndex: cellGroupIndex, groups: groups, index: cellIndex, isFirstGroupCell: isFirstGroupCell, isFocused: isFocused, isLastGroupCell: isLastGroupCell, isSelected: isSelected, key: key, startDate: startDate } = _ref; return (0, _inferno.createComponentVNode)(2, _all_day_panel_cell.AllDayPanelCell, { viewContext: viewContext, isFirstGroupCell: !isVerticalGroupOrientation && isFirstGroupCell, isLastGroupCell: !isVerticalGroupOrientation && isLastGroupCell, startDate: startDate, endDate: endDate, groups: groups, groupIndex: cellGroupIndex, index: cellIndex, dataCellTemplate: DataCellTemplateComponent, isSelected: isSelected ?? false, isFocused: isFocused ?? false }, key) })) }) } } exports.AllDayPanelTableBody = AllDayPanelTableBody; AllDayPanelTableBody.defaultProps = AllDayPanelTableBodyDefaultProps }, 84501: /*!************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/all_day_panel_title.js ***! \************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.AllDayPanelTitle = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); var _message = (obj = __webpack_require__( /*! ../../../../../localization/message */ 28109), obj && obj.__esModule ? obj : { default: obj }); var obj; class AllDayPanelTitle extends _inferno2.InfernoWrapperComponent { createEffects() { return [(0, _inferno2.createReRenderEffect)()] } render() { const text = _message.default.format("dxScheduler-allDay"); return (0, _inferno.createVNode)(1, "div", "dx-scheduler-all-day-title", text, 0) } } exports.AllDayPanelTitle = AllDayPanelTitle; AllDayPanelTitle.defaultProps = {} }, 42654: /*!*********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/cell.js ***! \*********************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.CellBaseDefaultProps = exports.CellBase = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); var _index = __webpack_require__( /*! ../../utils/index */ 94084); const CellBaseDefaultProps = exports.CellBaseDefaultProps = { className: "", isFirstGroupCell: false, isLastGroupCell: false, startDate: new Date, endDate: new Date, allDay: false, text: "", index: 0, contentTemplateProps: { data: {}, index: 0 } }; class CellBase extends _inferno2.BaseInfernoComponent { render() { const { className: className, isFirstGroupCell: isFirstGroupCell, isLastGroupCell: isLastGroupCell, children: children, ariaLabel: ariaLabel } = this.props; const classes = _index.renderUtils.getGroupCellClasses(isFirstGroupCell, isLastGroupCell, className); return (0, _inferno.createVNode)(1, "td", classes, children, 0, { "aria-label": ariaLabel }) } } exports.CellBase = CellBase; CellBase.defaultProps = CellBaseDefaultProps }, 1889: /*!****************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/date_header.js ***! \****************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.DateHeaderDefaultProps = exports.DateHeader = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587); var _index2 = __webpack_require__( /*! ../../utils/index */ 94084); var _date_header_cell = __webpack_require__( /*! ./date_header_cell */ 65186); var _row = __webpack_require__( /*! ./row */ 56449); const { isMaterialBased: isMaterialBased } = _index2.themeUtils.getThemeType(); const DateHeaderDefaultProps = exports.DateHeaderDefaultProps = { groupOrientation: "horizontal", groupByDate: false, groups: [] }; class DateHeader extends _inferno2.BaseInfernoComponent { render() { const { viewContext: viewContext, dateCellTemplate: dateCellTemplate, dateHeaderData: { dataMap: dataMap, leftVirtualCellCount: leftVirtualCellCount, leftVirtualCellWidth: leftVirtualCellWidth, rightVirtualCellCount: rightVirtualCellCount, rightVirtualCellWidth: rightVirtualCellWidth }, groupByDate: groupByDate, groupOrientation: groupOrientation, groups: groups } = this.props; const isHorizontalGrouping = (0, _index2.isHorizontalGroupingApplied)(groups, groupOrientation) && !groupByDate; const DateCellTemplateComponent = (0, _index.getTemplate)(dateCellTemplate); return (0, _inferno.createFragment)(dataMap.map(((dateHeaderRow, rowIndex) => (0, _inferno.createComponentVNode)(2, _row.Row, { className: "dx-scheduler-header-row", leftVirtualCellWidth: leftVirtualCellWidth, leftVirtualCellCount: leftVirtualCellCount, rightVirtualCellWidth: rightVirtualCellWidth, rightVirtualCellCount: rightVirtualCellCount, isHeaderRow: true, children: dateHeaderRow.map((_ref => { let { colSpan: colSpan, endDate: endDate, groupIndex: groupIndex, groups: cellGroups, index: index, isFirstGroupCell: isFirstGroupCell, isLastGroupCell: isLastGroupCell, key: key, startDate: startDate, text: text, today: today } = _ref; return (0, _inferno.createComponentVNode)(2, _date_header_cell.DateHeaderCell, { viewContext: viewContext, startDate: startDate, endDate: endDate, groups: isHorizontalGrouping ? cellGroups : void 0, groupIndex: isHorizontalGrouping ? groupIndex : void 0, today: today ?? false, isWeekDayCell: false, isTimeCellTemplate: false, index: index, text: text, isFirstGroupCell: isFirstGroupCell, isLastGroupCell: isLastGroupCell, dateCellTemplate: DateCellTemplateComponent, colSpan: colSpan, splitText: isMaterialBased }, key) })) }, rowIndex.toString()))), 0) } } exports.DateHeader = DateHeader; DateHeader.defaultProps = DateHeaderDefaultProps }, 65186: /*!*********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/date_header_cell.js ***! \*********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.DateHeaderCellDefaultProps = exports.DateHeaderCell = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587); var _index2 = __webpack_require__( /*! ../../utils/index */ 94084); var _cell = __webpack_require__( /*! ./cell */ 42654); var _date_header_text = __webpack_require__( /*! ./date_header_text */ 98911); function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const DateHeaderCellDefaultProps = exports.DateHeaderCellDefaultProps = _extends({}, _cell.CellBaseDefaultProps, { today: false, colSpan: 1, isWeekDayCell: false, splitText: false, isTimeCellTemplate: false }); class DateHeaderCell extends _inferno2.BaseInfernoComponent { render() { const { viewContext: { view: { type: viewType }, crossScrollingEnabled: crossScrollingEnabled }, colSpan: colSpan, dateCellTemplate: dateCellTemplate, groupIndex: groupIndex, groups: groups, index: index, isTimeCellTemplate: isTimeCellTemplate, splitText: splitText, startDate: startDate, text: text, timeCellTemplate: timeCellTemplate, className: className, isFirstGroupCell: isFirstGroupCell, isLastGroupCell: isLastGroupCell, isWeekDayCell: isWeekDayCell, today: today } = this.props; const cellSizeHorizontalClass = _index2.renderUtils.getCellSizeHorizontalClass(viewType, crossScrollingEnabled); const cellClasses = _index2.renderUtils.combineClasses({ "dx-scheduler-header-panel-cell": true, [cellSizeHorizontalClass]: true, "dx-scheduler-header-panel-current-time-cell": today, "dx-scheduler-header-panel-week-cell": isWeekDayCell, [className ?? ""]: !!className }); const classes = _index2.renderUtils.getGroupCellClasses(isFirstGroupCell, isLastGroupCell, cellClasses); const useTemplate = !isTimeCellTemplate && !!dateCellTemplate || isTimeCellTemplate && !!timeCellTemplate; const TimeCellTemplateComponent = (0, _index.getTemplate)(timeCellTemplate); const DateCellTemplateComponent = (0, _index.getTemplate)(dateCellTemplate); const children = useTemplate ? (0, _inferno.createFragment)([isTimeCellTemplate && TimeCellTemplateComponent && TimeCellTemplateComponent({ data: { date: startDate, text: text, groups: groups, groupIndex: groupIndex }, index: index }), !isTimeCellTemplate && DateCellTemplateComponent && DateCellTemplateComponent({ data: { date: startDate, text: text, groups: groups, groupIndex: groupIndex }, index: index })], 0) : (0, _inferno.createComponentVNode)(2, _date_header_text.DateHeaderText, { splitText: splitText, text: text }); return (0, _inferno.createVNode)(1, "th", classes, children, 0, { colSpan: colSpan, title: text }) } } exports.DateHeaderCell = DateHeaderCell; DateHeaderCell.defaultProps = DateHeaderCellDefaultProps }, 98911: /*!*********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/date_header_text.js ***! \*********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.DateHeaderText = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); class DateHeaderText extends _inferno2.BaseInfernoComponent { constructor() { super(...arguments); this._textCache = null } getTextParts() { if (null !== this._textCache) { return this._textCache } const { text: text } = this.props; this._textCache = text ? text.split(" ") : [""]; return this._textCache } componentWillUpdate(nextProps) { if (this.props.text !== nextProps.text) { this._textCache = null } } render() { const { splitText: splitText, text: text } = this.props; const textParts = this.getTextParts(); return (0, _inferno.createFragment)(splitText ? textParts.map((part => (0, _inferno.createVNode)(1, "div", "dx-scheduler-header-panel-cell-date", (0, _inferno.createVNode)(1, "span", null, part, 0), 2))) : text, 0) } } exports.DateHeaderText = DateHeaderText; DateHeaderText.defaultProps = { text: "", splitText: false } }, 69997: /*!***************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/date_table.js ***! \***************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.DateTableDefaultProps = exports.DateTable = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587); var _date_table_body = __webpack_require__( /*! ./date_table_body */ 23287); var _date_table_cell_base = __webpack_require__( /*! ./date_table_cell_base */ 75582); var _layout_props = __webpack_require__( /*! ./layout_props */ 21487); var _table = __webpack_require__( /*! ./table */ 1475); const _excluded = ["viewData", "viewContext", "tableRef", "addDateTableClass", "width", "cellTemplate", "dataCellTemplate", "groupOrientation", "addVerticalSizesClassToRows"]; function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const DateTableDefaultProps = exports.DateTableDefaultProps = _extends({}, _layout_props.LayoutDefaultProps, { cellTemplate: _date_table_cell_base.DateTableCellBase }); class DateTable extends _inferno2.InfernoWrapperComponent { createEffects() { return [(0, _inferno2.createReRenderEffect)()] } render() { const _this$props = this.props, { viewData: viewData, viewContext: viewContext, tableRef: tableRef, addDateTableClass: addDateTableClass, width: width, cellTemplate: cellTemplate, dataCellTemplate: dataCellTemplate, groupOrientation: groupOrientation, addVerticalSizesClassToRows: addVerticalSizesClassToRows } = _this$props, restProps = function(source, excluded) { if (null == source) { return {} } var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) { continue } target[key] = source[key] } } return target }(_this$props, _excluded); const classes = addDateTableClass ? "dx-scheduler-date-table" : void 0; const topVirtualRowHeight = viewData.topVirtualRowHeight ?? 0; const bottomVirtualRowHeight = viewData.bottomVirtualRowHeight ?? 0; const leftVirtualCellWidth = viewData.leftVirtualCellWidth ?? 0; const rightVirtualCellWidth = viewData.rightVirtualCellWidth ?? 0; const virtualCellsCount = viewData.groupedData[0].dateTable[0].cells.length; const CellTemplateComponent = (0, _index.getTemplate)(cellTemplate); const DataCellTemplateComponent = (0, _index.getTemplate)(dataCellTemplate); return (0, _inferno.normalizeProps)((0, _inferno.createComponentVNode)(2, _table.Table, _extends({}, restProps, { tableRef: tableRef, topVirtualRowHeight: topVirtualRowHeight, bottomVirtualRowHeight: bottomVirtualRowHeight, leftVirtualCellWidth: leftVirtualCellWidth, rightVirtualCellWidth: rightVirtualCellWidth, leftVirtualCellCount: viewData.leftVirtualCellCount, rightVirtualCellCount: viewData.rightVirtualCellCount, virtualCellsCount: virtualCellsCount, className: classes, width: width, children: (0, _inferno.createComponentVNode)(2, _date_table_body.DateTableBody, { viewData: viewData, viewContext: viewContext, cellTemplate: CellTemplateComponent, dataCellTemplate: DataCellTemplateComponent, leftVirtualCellWidth: leftVirtualCellWidth, rightVirtualCellWidth: rightVirtualCellWidth, groupOrientation: groupOrientation, addVerticalSizesClassToRows: addVerticalSizesClassToRows, topVirtualRowHeight: _date_table_body.DateTableBodyDefaultProps.topVirtualRowHeight, bottomVirtualRowHeight: _date_table_body.DateTableBodyDefaultProps.bottomVirtualRowHeight, addDateTableClass: _date_table_body.DateTableBodyDefaultProps.addDateTableClass }) }))) } } exports.DateTable = DateTable; DateTable.defaultProps = DateTableDefaultProps }, 23287: /*!********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/date_table_body.js ***! \********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.DateTableBodyDefaultProps = exports.DateTableBody = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587); var _index2 = __webpack_require__( /*! ../../utils/index */ 94084); var _const = __webpack_require__( /*! ../const */ 6186); var _all_day_panel_table_body = __webpack_require__( /*! ./all_day_panel_table_body */ 28698); var _date_table_cell_base = __webpack_require__( /*! ./date_table_cell_base */ 75582); var _layout_props = __webpack_require__( /*! ./layout_props */ 21487); var _row = __webpack_require__( /*! ./row */ 56449); function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const DateTableBodyDefaultProps = exports.DateTableBodyDefaultProps = _extends({}, _layout_props.LayoutDefaultProps, { cellTemplate: _date_table_cell_base.DateTableCellBase }); class DateTableBody extends _inferno2.BaseInfernoComponent { render() { const { viewData: viewData, viewContext: viewContext, addVerticalSizesClassToRows: addVerticalSizesClassToRows, cellTemplate: cellTemplate, dataCellTemplate: dataCellTemplate } = this.props; const rowClasses = _index2.renderUtils.combineClasses({ [_const.DATE_TABLE_ROW_CLASS]: true, "dx-scheduler-cell-sizes-vertical": addVerticalSizesClassToRows }); const CellTemplateComponent = (0, _index.getTemplate)(cellTemplate); const DataCellTemplateComponent = (0, _index.getTemplate)(dataCellTemplate); return (0, _inferno.createFragment)(viewData.groupedData.map((_ref => { let { allDayPanel: allDayPanel, dateTable: dateTable, isGroupedAllDayPanel: isGroupedAllDayPanel, key: fragmentKey } = _ref; return (0, _inferno.createFragment)([isGroupedAllDayPanel && (0, _inferno.createComponentVNode)(2, _all_day_panel_table_body.AllDayPanelTableBody, { viewData: allDayPanel ?? _all_day_panel_table_body.AllDayPanelTableBodyDefaultProps.viewData, viewContext: viewContext, dataCellTemplate: DataCellTemplateComponent, isVerticalGroupOrientation: true, leftVirtualCellWidth: viewData.leftVirtualCellWidth ?? _all_day_panel_table_body.AllDayPanelTableBodyDefaultProps.leftVirtualCellWidth, rightVirtualCellWidth: viewData.rightVirtualCellWidth ?? _all_day_panel_table_body.AllDayPanelTableBodyDefaultProps.rightVirtualCellWidth, leftVirtualCellCount: viewData.leftVirtualCellCount, rightVirtualCellCount: viewData.rightVirtualCellCount }), dateTable.map((_ref2 => { let { cells: cells, key: rowKey } = _ref2; return (0, _inferno.createComponentVNode)(2, _row.Row, { className: rowClasses, leftVirtualCellWidth: viewData.leftVirtualCellWidth ?? _row.RowDefaultProps.leftVirtualCellWidth, rightVirtualCellWidth: viewData.rightVirtualCellWidth ?? _row.RowDefaultProps.rightVirtualCellWidth, leftVirtualCellCount: viewData.leftVirtualCellCount, rightVirtualCellCount: viewData.rightVirtualCellCount, children: cells.map((_ref3 => { let { key: cellKey, endDate: endDate, firstDayOfMonth: firstDayOfMonth, groupIndex: cellGroupIndex, groups: groups, index: cellIndex, isFirstGroupCell: isFirstGroupCell, isFocused: isFocused, isLastGroupCell: isLastGroupCell, isSelected: isSelected, otherMonth: otherMonth, startDate: startDate, text: text, today: today } = _ref3; return CellTemplateComponent({ key: cellKey, viewContext: viewContext, isFirstGroupCell: isFirstGroupCell, isLastGroupCell: isLastGroupCell, startDate: startDate, endDate: endDate, groups: groups, groupIndex: cellGroupIndex, index: cellIndex, dataCellTemplate: DataCellTemplateComponent, text: text, today: today, otherMonth: otherMonth, firstDayOfMonth: firstDayOfMonth, isSelected: isSelected, isFocused: isFocused }) })) }, rowKey) }))], 0, fragmentKey) })), 0) } } exports.DateTableBody = DateTableBody; DateTableBody.defaultProps = DateTableBodyDefaultProps }, 75582: /*!*************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/date_table_cell_base.js ***! \*************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.DateTableCellBase = exports.DateTableCallBaseDefaultProps = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587); var _index2 = __webpack_require__( /*! ../../utils/index */ 94084); var _const = __webpack_require__( /*! ../const */ 6186); var _cell = __webpack_require__( /*! ./cell */ 42654); function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const DateTableCallBaseDefaultProps = exports.DateTableCallBaseDefaultProps = _extends({}, _cell.CellBaseDefaultProps, { otherMonth: false, today: false, firstDayOfMonth: false, isSelected: false, isFocused: false }); class DateTableCellBase extends _inferno2.BaseInfernoComponent { constructor() { super(...arguments); this.dataCellTemplateProps = null } getDataCellTemplateProps() { if (null !== this.dataCellTemplateProps) { return this.dataCellTemplateProps } const { allDay: allDay, contentTemplateProps: contentTemplateProps, endDate: endDate, groupIndex: groupIndex, groups: groups, index: index, startDate: startDate } = this.props; this.dataCellTemplateProps = { data: _extends({ startDate: startDate, endDate: endDate, groups: groups, groupIndex: groups ? groupIndex : void 0, text: "", allDay: !!allDay || void 0 }, null === contentTemplateProps || void 0 === contentTemplateProps ? void 0 : contentTemplateProps.data), index: index }; return this.dataCellTemplateProps } componentWillUpdate(nextProps) { if (this.props.allDay !== nextProps.allDay || this.props.contentTemplateProps !== nextProps.contentTemplateProps || this.props.endDate !== nextProps.endDate || this.props.groupIndex !== nextProps.groupIndex || this.props.groups !== nextProps.groups || this.props.index !== nextProps.index || this.props.startDate !== nextProps.startDate) { this.dataCellTemplateProps = null } } render() { const { viewContext: viewContext, allDay: allDay, className: className, isFocused: isFocused, isSelected: isSelected, isFirstGroupCell: isFirstGroupCell, isLastGroupCell: isLastGroupCell, dataCellTemplate: dataCellTemplate, children: children } = this.props; const { view: { type: viewType }, crossScrollingEnabled: crossScrollingEnabled } = viewContext; const cellSizeHorizontalClass = _index2.renderUtils.getCellSizeHorizontalClass(viewType, crossScrollingEnabled); const cellSizeVerticalClass = _index2.renderUtils.getCellSizeVerticalClass(!!allDay); const classes = _index2.renderUtils.combineClasses({ [cellSizeHorizontalClass]: true, [cellSizeVerticalClass]: true, [_const.DATE_TABLE_CELL_CLASS]: !allDay, "dx-state-focused": isSelected, "dx-scheduler-focused-cell": isFocused, [className ?? ""]: true }); const ariaLabel = isSelected ? "Add appointment" : void 0; const dataCellTemplateProps = this.getDataCellTemplateProps(); const DataCellTemplateComponent = (0, _index.getTemplate)(dataCellTemplate); return (0, _inferno.createComponentVNode)(2, _cell.CellBase, { className: classes, viewContext: viewContext, isFirstGroupCell: isFirstGroupCell, isLastGroupCell: isLastGroupCell, ariaLabel: ariaLabel, startDate: _cell.CellBaseDefaultProps.startDate, endDate: _cell.CellBaseDefaultProps.endDate, index: _cell.CellBaseDefaultProps.index, children: (0, _inferno.createFragment)([!DataCellTemplateComponent && children, !!DataCellTemplateComponent && DataCellTemplateComponent({ index: dataCellTemplateProps.index, data: dataCellTemplateProps.data })], 0) }) } } exports.DateTableCellBase = DateTableCellBase; DateTableCellBase.defaultProps = DateTableCallBaseDefaultProps }, 14225: /*!****************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/group_panel.js ***! \****************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.GroupPanelDefaultProps = exports.GroupPanel = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587); var _const = __webpack_require__( /*! ../../const */ 4907); var _index2 = __webpack_require__( /*! ../../utils/index */ 94084); var _group_panel_horizontal = __webpack_require__( /*! ./group_panel_horizontal */ 3104); var _group_panel_props = __webpack_require__( /*! ./group_panel_props */ 33725); var _group_panel_vertical = __webpack_require__( /*! ./group_panel_vertical */ 10405); function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const GroupPanelDefaultProps = exports.GroupPanelDefaultProps = _extends({}, _group_panel_props.GroupPanelBaseDefaultProps, { groups: [], groupOrientation: _const.VERTICAL_GROUP_ORIENTATION }); class GroupPanel extends _inferno2.InfernoWrapperComponent { createEffects() { return [(0, _inferno2.createReRenderEffect)()] } render() { const { className: className, viewContext: viewContext, elementRef: elementRef, groupPanelData: groupPanelData, height: height, resourceCellTemplate: resourceCellTemplate, groupOrientation: groupOrientation, groups: groups, styles: styles } = this.props; const ResourceCellTemplateComponent = (0, _index.getTemplate)(resourceCellTemplate); const isVerticalLayout = (0, _index2.isVerticalGroupingApplied)(groups, groupOrientation); const Layout = isVerticalLayout ? _group_panel_vertical.GroupPanelVertical : _group_panel_horizontal.GroupPanelHorizontal; return (0, _inferno.createComponentVNode)(2, Layout, { viewContext: viewContext, height: height, resourceCellTemplate: ResourceCellTemplateComponent, className: className, groupPanelData: groupPanelData, elementRef: elementRef, styles: styles, groups: GroupPanelDefaultProps.groups, groupOrientation: GroupPanelDefaultProps.groupOrientation, groupByDate: GroupPanelDefaultProps.groupByDate }) } } exports.GroupPanel = GroupPanel; GroupPanel.defaultProps = GroupPanelDefaultProps }, 3104: /*!***************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/group_panel_horizontal.js ***! \***************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.GroupPanelHorizontal = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587); var _group_panel_horizontal_row = __webpack_require__( /*! ./group_panel_horizontal_row */ 14292); var _group_panel_props = __webpack_require__( /*! ./group_panel_props */ 33725); function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } class GroupPanelHorizontal extends _inferno2.BaseInfernoComponent { constructor() { super(...arguments); this._groupPanelItems = null } getGroupPanelItems() { if (null !== this._groupPanelItems) { return this._groupPanelItems } const { groupPanelData: { baseColSpan: baseColSpan, groupPanelItems: groupPanelItems } } = this.props; const colSpans = groupPanelItems.reduceRight(((currentColSpans, groupsRow, idx) => { const nextColSpans = currentColSpans; const currentLevelGroupCount = groupsRow.length; const previousColSpan = idx === groupPanelItems.length - 1 ? baseColSpan : currentColSpans[idx + 1]; const previousLevelGroupCount = idx === groupPanelItems.length - 1 ? currentLevelGroupCount : groupPanelItems[idx + 1].length; const groupCountDiff = previousLevelGroupCount / currentLevelGroupCount; nextColSpans[idx] = groupCountDiff * previousColSpan; return nextColSpans }), [...new Array(groupPanelItems.length)]); this._groupPanelItems = groupPanelItems.map(((groupsRenderRow, index) => { const colSpan = colSpans[index]; return groupsRenderRow.map((groupItem => _extends({}, groupItem, { colSpan: colSpan }))) })); return this._groupPanelItems } componentWillUpdate(nextProps) { if (this.props.groupPanelData !== nextProps.groupPanelData) { this._groupPanelItems = null } } render() { const { resourceCellTemplate: resourceCellTemplate } = this.props; const groupPanelItems = this.getGroupPanelItems(); const ResourceCellTemplateComponent = (0, _index.getTemplate)(resourceCellTemplate); return (0, _inferno.createFragment)(groupPanelItems.map((group => (0, _inferno.createComponentVNode)(2, _group_panel_horizontal_row.GroupPanelHorizontalRow, { groupItems: group, cellTemplate: ResourceCellTemplateComponent }, group[0].key))), 0) } } exports.GroupPanelHorizontal = GroupPanelHorizontal; GroupPanelHorizontal.defaultProps = _group_panel_props.GroupPanelBaseDefaultProps }, 62734: /*!********************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/group_panel_horizontal_cell.js ***! \********************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.GroupPanelHorizontalCellDefaultProps = exports.GroupPanelHorizontalCell = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587); var _index2 = __webpack_require__( /*! ../../utils/index */ 94084); var _group_panel_props = __webpack_require__( /*! ./group_panel_props */ 33725); function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const GroupPanelHorizontalCellDefaultProps = exports.GroupPanelHorizontalCellDefaultProps = _extends({}, _group_panel_props.GroupPanelCellDefaultProps, { isFirstGroupCell: false, isLastGroupCell: false, colSpan: 1 }); class GroupPanelHorizontalCell extends _inferno2.BaseInfernoComponent { render() { const { cellTemplate: cellTemplate, colSpan: colSpan, color: color, data: data, id: id, index: index, text: text, className: className, isFirstGroupCell: isFirstGroupCell, isLastGroupCell: isLastGroupCell } = this.props; const classes = _index2.renderUtils.combineClasses({ "dx-scheduler-group-header": true, "dx-scheduler-first-group-cell": isFirstGroupCell, "dx-scheduler-last-group-cell": isLastGroupCell, [className ?? ""]: !!className }); const CellTemplateComponent = (0, _index.getTemplate)(cellTemplate); return (0, _inferno.createVNode)(1, "th", classes, (0, _inferno.createVNode)(1, "div", "dx-scheduler-group-header-content", CellTemplateComponent ? CellTemplateComponent({ data: { data: data, id: id, color: color, text: text }, index: index }) : (0, _inferno.createVNode)(1, "div", null, text, 0), 0), 2, { colSpan: colSpan }) } } exports.GroupPanelHorizontalCell = GroupPanelHorizontalCell; GroupPanelHorizontalCell.defaultProps = GroupPanelHorizontalCellDefaultProps }, 14292: /*!*******************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/group_panel_horizontal_row.js ***! \*******************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.GroupPanelHorizontalRow = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587); var _group_panel_horizontal_cell = __webpack_require__( /*! ./group_panel_horizontal_cell */ 62734); var _group_panel_props = __webpack_require__( /*! ./group_panel_props */ 33725); class GroupPanelHorizontalRow extends _inferno2.BaseInfernoComponent { render() { const { cellTemplate: cellTemplate, className: className, groupItems: groupItems } = this.props; const CellTemplateComponent = (0, _index.getTemplate)(cellTemplate); return (0, _inferno.createVNode)(1, "tr", `dx-scheduler-group-row ${className}`, groupItems.map(((_ref, index) => { let { colSpan: colSpan, color: color, data: data, id: id, isFirstGroupCell: isFirstGroupCell, isLastGroupCell: isLastGroupCell, key: key, text: text } = _ref; return (0, _inferno.createComponentVNode)(2, _group_panel_horizontal_cell.GroupPanelHorizontalCell, { text: text, id: id, data: data, index: index, color: color, colSpan: colSpan ?? _group_panel_horizontal_cell.GroupPanelHorizontalCellDefaultProps.colSpan, isFirstGroupCell: !!isFirstGroupCell, isLastGroupCell: !!isLastGroupCell, cellTemplate: CellTemplateComponent }, key) })), 0) } } exports.GroupPanelHorizontalRow = GroupPanelHorizontalRow; GroupPanelHorizontalRow.defaultProps = _group_panel_props.GroupPanelRowDefaultProps }, 33725: /*!**********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/group_panel_props.js ***! \**********************************************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.GroupPanelRowDefaultProps = exports.GroupPanelCellDefaultProps = exports.GroupPanelBaseDefaultProps = void 0; exports.GroupPanelBaseDefaultProps = { groupPanelData: { groupPanelItems: [], baseColSpan: 1 }, groupByDate: false, styles: {} }; exports.GroupPanelCellDefaultProps = { id: 0, text: "", data: { id: 0 }, className: "" }; exports.GroupPanelRowDefaultProps = { groupItems: [], className: "" } }, 10405: /*!*************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/group_panel_vertical.js ***! \*************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.GroupPanelVertical = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587); var _index2 = __webpack_require__( /*! ../../utils/index */ 94084); var _group_panel_props = __webpack_require__( /*! ./group_panel_props */ 33725); var _group_panel_vertical_row = __webpack_require__( /*! ./group_panel_vertical_row */ 15394); class GroupPanelVertical extends _inferno2.BaseInfernoComponent { render() { const { className: className, elementRef: elementRef, groupPanelData: groupPanelData, resourceCellTemplate: resourceCellTemplate, height: height, styles: styles } = this.props; const style = (0, _inferno2.normalizeStyles)(_index2.renderUtils.addHeightToStyle(height, styles)); const ResourceCellTemplateComponent = (0, _index.getTemplate)(resourceCellTemplate); return (0, _inferno.createVNode)(1, "div", className, (0, _inferno.createVNode)(1, "div", "dx-scheduler-group-flex-container", groupPanelData.groupPanelItems.map((group => (0, _inferno.createComponentVNode)(2, _group_panel_vertical_row.GroupPanelVerticalRow, { groupItems: group, cellTemplate: ResourceCellTemplateComponent }, group[0].key))), 0), 2, { style: style }, null, elementRef) } } exports.GroupPanelVertical = GroupPanelVertical; GroupPanelVertical.defaultProps = _group_panel_props.GroupPanelBaseDefaultProps }, 52369: /*!******************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/group_panel_vertical_cell.js ***! \******************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.GroupPanelVerticalCell = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587); var _group_panel_props = __webpack_require__( /*! ./group_panel_props */ 33725); class GroupPanelVerticalCell extends _inferno2.BaseInfernoComponent { render() { const { className: className, data: data, id: id, color: color, text: text, index: index, cellTemplate: cellTemplate } = this.props; const CellTemplateComponent = (0, _index.getTemplate)(cellTemplate); return (0, _inferno.createVNode)(1, "div", `dx-scheduler-group-header ${className}`, CellTemplateComponent ? CellTemplateComponent({ data: { data: data, id: id, color: color, text: text }, index: index }) : (0, _inferno.createVNode)(1, "div", "dx-scheduler-group-header-content", text, 0), 0) } } exports.GroupPanelVerticalCell = GroupPanelVerticalCell; GroupPanelVerticalCell.defaultProps = _group_panel_props.GroupPanelCellDefaultProps }, 15394: /*!*****************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/group_panel_vertical_row.js ***! \*****************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.GroupPanelVerticalRow = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587); var _group_panel_props = __webpack_require__( /*! ./group_panel_props */ 33725); var _group_panel_vertical_cell = __webpack_require__( /*! ./group_panel_vertical_cell */ 52369); class GroupPanelVerticalRow extends _inferno2.BaseInfernoComponent { render() { const { className: className, groupItems: groupItems, cellTemplate: cellTemplate } = this.props; const CellTemplateComponent = (0, _index.getTemplate)(cellTemplate); return (0, _inferno.createVNode)(1, "div", `dx-scheduler-group-row ${className}`, groupItems.map(((_ref, index) => { let { color: color, data: data, id: id, key: key, text: text } = _ref; return (0, _inferno.createComponentVNode)(2, _group_panel_vertical_cell.GroupPanelVerticalCell, { text: text, id: id, data: data, index: index, color: color, cellTemplate: CellTemplateComponent }, key) })), 0) } } exports.GroupPanelVerticalRow = GroupPanelVerticalRow; GroupPanelVerticalRow.defaultProps = _group_panel_props.GroupPanelRowDefaultProps }, 38885: /*!****************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/header_cell.js ***! \****************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.HeaderCell = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); var _ordinary_cell = __webpack_require__( /*! ./ordinary_cell */ 98349); class HeaderCell extends _inferno2.BaseInfernoComponent { render() { const { children: children, className: className, colSpan: colSpan, styles: styles } = this.props; return (0, _inferno.createVNode)(1, "th", className, children, 0, { style: (0, _inferno2.normalizeStyles)(styles), colSpan: colSpan }) } } exports.HeaderCell = HeaderCell; HeaderCell.defaultProps = _ordinary_cell.OrdinaryCellDefaultProps }, 69667: /*!*****************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/header_panel.js ***! \*****************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.HeaderPanelDefaultProps = exports.HeaderPanel = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587); var _index2 = __webpack_require__( /*! ../../utils/index */ 94084); var _date_header = __webpack_require__( /*! ./date_header */ 1889); var _group_panel = __webpack_require__( /*! ./group_panel */ 14225); function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const HeaderPanelDefaultProps = exports.HeaderPanelDefaultProps = _extends({}, _group_panel.GroupPanelDefaultProps, { isRenderDateHeader: true, dateHeaderTemplate: _date_header.DateHeader }); class HeaderPanel extends _inferno2.InfernoWrapperComponent { createEffects() { return [(0, _inferno2.createReRenderEffect)()] } render() { const { viewContext: viewContext, dateHeaderData: dateHeaderData, groupByDate: groupByDate, groupOrientation: groupOrientation, groupPanelData: groupPanelData, groups: groups, isRenderDateHeader: isRenderDateHeader, dateCellTemplate: dateCellTemplate, dateHeaderTemplate: dateHeaderTemplate, resourceCellTemplate: resourceCellTemplate, timeCellTemplate: timeCellTemplate } = this.props; const isHorizontalGrouping = (0, _index2.isHorizontalGroupingApplied)(groups, groupOrientation); const DateCellTemplateComponent = (0, _index.getTemplate)(dateCellTemplate); const DateHeaderTemplateComponent = (0, _index.getTemplate)(dateHeaderTemplate); const ResourceCellTemplateComponent = (0, _index.getTemplate)(resourceCellTemplate); const TimeCellTemplateComponent = (0, _index.getTemplate)(timeCellTemplate); return (0, _inferno.createVNode)(1, "thead", null, [isHorizontalGrouping && !groupByDate && (0, _inferno.createComponentVNode)(2, _group_panel.GroupPanel, { viewContext: viewContext, groupPanelData: groupPanelData, groups: groups, groupByDate: groupByDate, groupOrientation: groupOrientation, resourceCellTemplate: ResourceCellTemplateComponent }), isRenderDateHeader && DateHeaderTemplateComponent({ viewContext: viewContext, groupByDate: groupByDate, dateHeaderData: dateHeaderData, groupOrientation: groupOrientation, groups: groups, dateCellTemplate: DateCellTemplateComponent, timeCellTemplate: TimeCellTemplateComponent }), groupByDate && (0, _inferno.createComponentVNode)(2, _group_panel.GroupPanel, { viewContext: viewContext, groupPanelData: groupPanelData, groups: groups, groupByDate: groupByDate, groupOrientation: groupOrientation, resourceCellTemplate: ResourceCellTemplateComponent })], 0) } } exports.HeaderPanel = HeaderPanel; HeaderPanel.defaultProps = HeaderPanelDefaultProps }, 21487: /*!*****************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/layout_props.js ***! \*****************************************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.LayoutDefaultProps = void 0; exports.LayoutDefaultProps = { viewData: { groupedData: [], leftVirtualCellCount: 0, rightVirtualCellCount: 0, topVirtualRowCount: 0, bottomVirtualRowCount: 0 }, leftVirtualCellWidth: 0, rightVirtualCellWidth: 0, topVirtualRowHeight: 0, bottomVirtualRowHeight: 0, addDateTableClass: true, addVerticalSizesClassToRows: true } }, 98349: /*!******************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/ordinary_cell.js ***! \******************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.OrdinaryCellDefaultProps = exports.OrdinaryCell = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); const OrdinaryCellDefaultProps = exports.OrdinaryCellDefaultProps = {}; class OrdinaryCell extends _inferno2.BaseInfernoComponent { render() { const { children: children, className: className, colSpan: colSpan, styles: styles } = this.props; return (0, _inferno.createVNode)(1, "td", className, children, 0, { style: (0, _inferno2.normalizeStyles)(styles), colSpan: colSpan }) } } exports.OrdinaryCell = OrdinaryCell; OrdinaryCell.defaultProps = OrdinaryCellDefaultProps }, 56449: /*!********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/row.js ***! \********************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.RowDefaultProps = exports.Row = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); var _index = __webpack_require__( /*! ../../utils/index */ 94084); var _virtual_cell = __webpack_require__( /*! ./virtual_cell */ 73966); const RowDefaultProps = exports.RowDefaultProps = { className: "", leftVirtualCellWidth: 0, rightVirtualCellWidth: 0, isHeaderRow: false }; class Row extends _inferno2.BaseInfernoComponent { render() { const { children: children, className: className, isHeaderRow: isHeaderRow, leftVirtualCellCount: leftVirtualCellCount, leftVirtualCellWidth: leftVirtualCellWidth, rightVirtualCellCount: rightVirtualCellCount, rightVirtualCellWidth: rightVirtualCellWidth, styles: styles } = this.props; const hasLeftVirtualCell = !!leftVirtualCellCount; const hasRightVirtualCell = !!rightVirtualCellCount; return (0, _inferno.createVNode)(1, "tr", className, [hasLeftVirtualCell && null != leftVirtualCellCount && (0, _index.splitNumber)(leftVirtualCellCount, 1e3).map(((colSpan, index) => (0, _inferno.createComponentVNode)(2, _virtual_cell.VirtualCell, { className: `left-virtual-cell-${index}`, width: leftVirtualCellWidth * (colSpan / leftVirtualCellCount), colSpan: colSpan, isHeaderCell: isHeaderRow ?? _virtual_cell.VirtualCellDefaultProps.isHeaderCell }))), children, hasRightVirtualCell && null != rightVirtualCellCount && (0, _index.splitNumber)(rightVirtualCellCount, 1e3).map(((colSpan, index) => (0, _inferno.createComponentVNode)(2, _virtual_cell.VirtualCell, { className: `right-virtual-cell-${index}`, width: rightVirtualCellWidth * (colSpan / rightVirtualCellCount), colSpan: colSpan, isHeaderCell: isHeaderRow ?? _virtual_cell.VirtualCellDefaultProps.isHeaderCell })))], 0, { style: (0, _inferno2.normalizeStyles)(styles) }) } } exports.Row = Row; Row.defaultProps = RowDefaultProps }, 1475: /*!**********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/table.js ***! \**********************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.TableDefaultProps = exports.Table = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); var _index = __webpack_require__( /*! ../../utils/index */ 94084); var _virtual_row = __webpack_require__( /*! ./virtual_row */ 50830); const TableDefaultProps = exports.TableDefaultProps = { topVirtualRowHeight: 0, bottomVirtualRowHeight: 0, leftVirtualCellWidth: 0, rightVirtualCellWidth: 0, virtualCellsCount: 0 }; class Table extends _inferno2.BaseInfernoComponent { getResultStyles() { const { height: height, width: width, styles: styles } = this.props; const heightAdded = _index.renderUtils.addHeightToStyle(height, styles); return _index.renderUtils.addWidthToStyle(width, heightAdded) } render() { const { className: className, topVirtualRowHeight: topVirtualRowHeight, bottomVirtualRowHeight: bottomVirtualRowHeight, children: children, leftVirtualCellCount: leftVirtualCellCount, leftVirtualCellWidth: leftVirtualCellWidth, rightVirtualCellCount: rightVirtualCellCount, rightVirtualCellWidth: rightVirtualCellWidth, tableRef: tableRef, virtualCellsCount: virtualCellsCount } = this.props; const hasTopVirtualRow = !!topVirtualRowHeight; const hasBottomVirtualRow = !!bottomVirtualRowHeight; const resultStyles = this.getResultStyles(); return (0, _inferno.createVNode)(1, "table", className, (0, _inferno.createVNode)(1, "tbody", null, [hasTopVirtualRow && (0, _inferno.createComponentVNode)(2, _virtual_row.VirtualRow, { height: topVirtualRowHeight, cellsCount: virtualCellsCount ?? _virtual_row.VirtualRowDefaultProps.cellsCount, leftVirtualCellWidth: leftVirtualCellWidth ?? _virtual_row.VirtualRowDefaultProps.leftVirtualCellWidth, rightVirtualCellWidth: rightVirtualCellWidth ?? _virtual_row.VirtualRowDefaultProps.rightVirtualCellWidth, leftVirtualCellCount: leftVirtualCellCount, rightVirtualCellCount: rightVirtualCellCount }), children, hasBottomVirtualRow && (0, _inferno.createComponentVNode)(2, _virtual_row.VirtualRow, { height: bottomVirtualRowHeight, cellsCount: virtualCellsCount ?? _virtual_row.VirtualRowDefaultProps.cellsCount, leftVirtualCellWidth: leftVirtualCellWidth ?? _virtual_row.VirtualRowDefaultProps.leftVirtualCellWidth, rightVirtualCellWidth: rightVirtualCellWidth ?? _virtual_row.VirtualRowDefaultProps.rightVirtualCellWidth, leftVirtualCellCount: leftVirtualCellCount, rightVirtualCellCount: rightVirtualCellCount })], 0), 2, { style: (0, _inferno2.normalizeStyles)(resultStyles) }, null, tableRef) } } exports.Table = Table; Table.defaultProps = TableDefaultProps }, 16400: /*!********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/time_panel_cell.js ***! \********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.TimePanelCell = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587); var _index2 = __webpack_require__( /*! ../../utils/index */ 94084); var _cell = __webpack_require__( /*! ./cell */ 42654); class TimePanelCell extends _inferno2.BaseInfernoComponent { constructor() { super(...arguments); this.timeCellTemplateProps = null } getTimeCellTemplateProps() { if (null !== this.timeCellTemplateProps) { return this.timeCellTemplateProps } const { groupIndex: groupIndex, groups: groups, index: index, startDate: startDate, text: text } = this.props; this.timeCellTemplateProps = { data: { date: startDate, groups: groups, groupIndex: groupIndex, text: text }, index: index }; return this.timeCellTemplateProps } componentWillUpdate(nextProps) { if (this.props.groupIndex !== nextProps.groupIndex || this.props.groups !== nextProps.groups || this.props.index !== nextProps.index || this.props.startDate !== nextProps.startDate || this.props.text !== nextProps.text) { this.timeCellTemplateProps = null } } render() { const { className: className, viewContext: viewContext, highlighted: highlighted, isFirstGroupCell: isFirstGroupCell, isLastGroupCell: isLastGroupCell, text: text, timeCellTemplate: timeCellTemplate } = this.props; const cellSizeVerticalClass = _index2.renderUtils.getCellSizeVerticalClass(false); const classes = _index2.renderUtils.combineClasses({ "dx-scheduler-time-panel-cell": true, [cellSizeVerticalClass]: true, "dx-scheduler-time-panel-current-time-cell": !!highlighted, [className ?? ""]: true }); const timeCellTemplateProps = this.getTimeCellTemplateProps(); const TimeCellTemplateComponent = (0, _index.getTemplate)(timeCellTemplate); return (0, _inferno.createComponentVNode)(2, _cell.CellBase, { className: classes, viewContext: viewContext, isFirstGroupCell: isFirstGroupCell, isLastGroupCell: isLastGroupCell, startDate: _cell.CellBaseDefaultProps.startDate, endDate: _cell.CellBaseDefaultProps.endDate, index: _cell.CellBaseDefaultProps.index, children: TimeCellTemplateComponent ? TimeCellTemplateComponent({ index: timeCellTemplateProps.index, data: timeCellTemplateProps.data }) : (0, _inferno.createVNode)(1, "div", null, text, 0) }) } } exports.TimePanelCell = TimePanelCell; TimePanelCell.defaultProps = _cell.CellBaseDefaultProps }, 71630: /*!*********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/time_panel_table.js ***! \*********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.TimePanelTableDefaultProps = exports.TimePanelTable = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587); var _all_day_panel_title = __webpack_require__( /*! ./all_day_panel_title */ 84501); var _cell = __webpack_require__( /*! ./cell */ 42654); var _row = __webpack_require__( /*! ./row */ 56449); var _table = __webpack_require__( /*! ./table */ 1475); var _time_panel_cell = __webpack_require__( /*! ./time_panel_cell */ 16400); const _excluded = ["timePanelData", "viewContext", "tableRef", "timeCellTemplate"]; function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const TimePanelTableDefaultProps = exports.TimePanelTableDefaultProps = { timePanelData: { groupedData: [], leftVirtualCellCount: 0, rightVirtualCellCount: 0, topVirtualRowCount: 0, bottomVirtualRowCount: 0 } }; class TimePanelTable extends _inferno2.InfernoWrapperComponent { createEffects() { return [(0, _inferno2.createReRenderEffect)()] } render() { const _this$props = this.props, { timePanelData: timePanelData, viewContext: viewContext, tableRef: tableRef, timeCellTemplate: timeCellTemplate } = _this$props, restProps = function(source, excluded) { if (null == source) { return {} } var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) { continue } target[key] = source[key] } } return target }(_this$props, _excluded); const { topVirtualRowHeight: topVirtualRowHeight, bottomVirtualRowHeight: bottomVirtualRowHeight } = timePanelData; const TimeCellTemplateComponent = (0, _index.getTemplate)(timeCellTemplate); return (0, _inferno.normalizeProps)((0, _inferno.createComponentVNode)(2, _table.Table, _extends({}, restProps, { className: "dx-scheduler-time-panel", topVirtualRowHeight: topVirtualRowHeight ?? 0, bottomVirtualRowHeight: bottomVirtualRowHeight ?? 0, virtualCellsCount: 1, tableRef: tableRef, children: timePanelData.groupedData.map((_ref => { let { dateTable: dateTable, groupIndex: groupIndex, isGroupedAllDayPanel: isGroupedAllDayPanel, key: fragmentKey } = _ref; return (0, _inferno.createFragment)([isGroupedAllDayPanel && (0, _inferno.createComponentVNode)(2, _row.Row, { leftVirtualCellWidth: _row.RowDefaultProps.leftVirtualCellWidth, rightVirtualCellWidth: _row.RowDefaultProps.rightVirtualCellWidth, children: (0, _inferno.createComponentVNode)(2, _cell.CellBase, { className: "dx-scheduler-time-panel-title-cell", viewContext: viewContext, startDate: _cell.CellBaseDefaultProps.startDate, endDate: _cell.CellBaseDefaultProps.endDate, index: _cell.CellBaseDefaultProps.index, children: (0, _inferno.createComponentVNode)(2, _all_day_panel_title.AllDayPanelTitle) }) }), dateTable.map((_ref2 => { let { groups: groups, highlighted: highlighted, index: cellIndex, isFirstGroupCell: isFirstGroupCell, isLastGroupCell: isLastGroupCell, key: key, startDate: startDate, text: text } = _ref2; return (0, _inferno.createComponentVNode)(2, _row.Row, { className: "dx-scheduler-time-panel-row", leftVirtualCellWidth: _row.RowDefaultProps.leftVirtualCellWidth, rightVirtualCellWidth: _row.RowDefaultProps.rightVirtualCellWidth, children: (0, _inferno.createComponentVNode)(2, _time_panel_cell.TimePanelCell, { viewContext: viewContext, startDate: startDate, endDate: _cell.CellBaseDefaultProps.endDate, text: text, groups: groups, groupIndex: groupIndex, isFirstGroupCell: isFirstGroupCell, isLastGroupCell: isLastGroupCell, index: cellIndex, timeCellTemplate: TimeCellTemplateComponent, highlighted: highlighted }) }, key) }))], 0, fragmentKey) })) }))) } } exports.TimePanelTable = TimePanelTable; TimePanelTable.defaultProps = TimePanelTableDefaultProps }, 73966: /*!*****************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/virtual_cell.js ***! \*****************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.VirtualCellDefaultProps = exports.VirtualCell = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); var _index = __webpack_require__( /*! ../../utils/index */ 94084); var _header_cell = __webpack_require__( /*! ./header_cell */ 38885); var _ordinary_cell = __webpack_require__( /*! ./ordinary_cell */ 98349); const VirtualCellDefaultProps = exports.VirtualCellDefaultProps = { width: 0, isHeaderCell: false }; class VirtualCell extends _inferno2.BaseInfernoComponent { render() { const { colSpan: colSpan, isHeaderCell: isHeaderCell, width: width, styles: styles } = this.props; const modifiedStyles = _index.renderUtils.addWidthToStyle(width, styles); const Cell = isHeaderCell ? _header_cell.HeaderCell : _ordinary_cell.OrdinaryCell; return (0, _inferno.createComponentVNode)(2, Cell, { className: "dx-scheduler-virtual-cell", styles: modifiedStyles, colSpan: colSpan }) } } exports.VirtualCell = VirtualCell; VirtualCell.defaultProps = VirtualCellDefaultProps }, 50830: /*!****************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/base/virtual_row.js ***! \****************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.VirtualRowDefaultProps = exports.VirtualRow = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); var _index = __webpack_require__( /*! ../../utils/index */ 94084); var _row = __webpack_require__( /*! ./row */ 56449); var _virtual_cell = __webpack_require__( /*! ./virtual_cell */ 73966); function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const VirtualRowDefaultProps = exports.VirtualRowDefaultProps = _extends({}, _row.RowDefaultProps, { leftVirtualCellWidth: 0, rightVirtualCellWidth: 0, cellsCount: 1 }); class VirtualRow extends _inferno2.BaseInfernoComponent { constructor() { super(...arguments); this.virtualCells = null } getVirtualCells() { if (null !== this.virtualCells) { return this.virtualCells } const { cellsCount: cellsCount } = this.props; this.virtualCells = [...Array(cellsCount)]; return this.virtualCells } componentWillUpdate(nextProps) { if (this.props.cellsCount !== nextProps.cellsCount) { this.virtualCells = null } } render() { const { className: className, leftVirtualCellCount: leftVirtualCellCount, leftVirtualCellWidth: leftVirtualCellWidth, rightVirtualCellCount: rightVirtualCellCount, rightVirtualCellWidth: rightVirtualCellWidth, styles: styles, height: height } = this.props; const classes = `dx-scheduler-virtual-row ${className}`; const modifiedStyles = _index.renderUtils.addHeightToStyle(height, styles); const virtualCells = this.getVirtualCells(); return (0, _inferno.createComponentVNode)(2, _row.Row, { className: classes, styles: modifiedStyles, leftVirtualCellWidth: leftVirtualCellWidth, rightVirtualCellWidth: rightVirtualCellWidth, leftVirtualCellCount: leftVirtualCellCount, rightVirtualCellCount: rightVirtualCellCount, children: virtualCells.map(((_, index) => (0, _inferno.createComponentVNode)(2, _virtual_cell.VirtualCell, { width: _virtual_cell.VirtualCellDefaultProps.width, isHeaderCell: _virtual_cell.VirtualCellDefaultProps.isHeaderCell }, index.toString()))) }) } } exports.VirtualRow = VirtualRow; VirtualRow.defaultProps = VirtualRowDefaultProps }, 6186: /*!*****************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/const.js ***! \*****************************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.DefaultSizes = exports.DATE_TABLE_ROW_CLASS = exports.DATE_TABLE_CELL_CLASS = exports.ALL_DAY_PANEL_CELL_CLASS = void 0; exports.DefaultSizes = { allDayPanelHeight: 25 }; exports.DATE_TABLE_CELL_CLASS = "dx-scheduler-date-table-cell"; exports.DATE_TABLE_ROW_CLASS = "dx-scheduler-date-table-row"; exports.ALL_DAY_PANEL_CELL_CLASS = "dx-scheduler-all-day-table-cell" }, 42515: /*!*****************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/index.js ***! \*****************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "AllDayPanelTitleComponent", { enumerable: true, get: function() { return _all_day_panel_title.AllDayPanelTitleComponent } }); Object.defineProperty(exports, "AllDayTableComponent", { enumerable: true, get: function() { return _all_day_table.AllDayTableComponent } }); Object.defineProperty(exports, "DateTableComponent", { enumerable: true, get: function() { return _date_table.DateTableComponent } }); Object.defineProperty(exports, "DateTableMonthComponent", { enumerable: true, get: function() { return _date_table_month.DateTableMonthComponent } }); Object.defineProperty(exports, "GroupPanelComponent", { enumerable: true, get: function() { return _group_panel.GroupPanelComponent } }); Object.defineProperty(exports, "HeaderPanelComponent", { enumerable: true, get: function() { return _header_panel.HeaderPanelComponent } }); Object.defineProperty(exports, "HeaderPanelTimelineComponent", { enumerable: true, get: function() { return _header_panel_timeline.HeaderPanelTimelineComponent } }); Object.defineProperty(exports, "TimePanelComponent", { enumerable: true, get: function() { return _time_panel.TimePanelComponent } }); var _all_day_panel_title = __webpack_require__( /*! ./wrappers/all_day_panel_title */ 26426); var _all_day_table = __webpack_require__( /*! ./wrappers/all_day_table */ 43422); var _date_table = __webpack_require__( /*! ./wrappers/date_table */ 66225); var _date_table_month = __webpack_require__( /*! ./wrappers/date_table_month */ 22478); var _group_panel = __webpack_require__( /*! ./wrappers/group_panel */ 42523); var _header_panel = __webpack_require__( /*! ./wrappers/header_panel */ 56108); var _header_panel_timeline = __webpack_require__( /*! ./wrappers/header_panel_timeline */ 73725); var _time_panel = __webpack_require__( /*! ./wrappers/time_panel */ 64608) }, 47710: /*!**********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/month/date_table_month.js ***! \**********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.DateTableMonth = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587); var _date_table = __webpack_require__( /*! ../base/date_table */ 69997); var _date_table_month_cell = __webpack_require__( /*! ./date_table_month_cell */ 73081); const _excluded = ["viewData", "viewContext", "addDateTableClass", "addVerticalSizesClassToRows", "dataCellTemplate", "groupOrientation", "tableRef", "width"]; function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } class DateTableMonth extends _inferno2.InfernoWrapperComponent { createEffects() { return [(0, _inferno2.createReRenderEffect)()] } render() { const _this$props = this.props, { viewData: viewData, viewContext: viewContext, addDateTableClass: addDateTableClass, addVerticalSizesClassToRows: addVerticalSizesClassToRows, dataCellTemplate: dataCellTemplate, groupOrientation: groupOrientation, tableRef: tableRef, width: width } = _this$props, restProps = function(source, excluded) { if (null == source) { return {} } var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) { continue } target[key] = source[key] } } return target }(_this$props, _excluded); const DataCellTemplateComponent = (0, _index.getTemplate)(dataCellTemplate); return (0, _inferno.normalizeProps)((0, _inferno.createComponentVNode)(2, _date_table.DateTable, _extends({}, restProps, { viewData: viewData, viewContext: viewContext, groupOrientation: groupOrientation, addDateTableClass: addDateTableClass, dataCellTemplate: DataCellTemplateComponent, cellTemplate: _date_table_month_cell.DateTableMonthCell, tableRef: tableRef, addVerticalSizesClassToRows: addVerticalSizesClassToRows, width: width }))) } } exports.DateTableMonth = DateTableMonth; DateTableMonth.defaultProps = _date_table.DateTableDefaultProps }, 73081: /*!***************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/month/date_table_month_cell.js ***! \***************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.DateTableMonthCell = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587); var _index2 = __webpack_require__( /*! ../../utils/index */ 94084); var _date_table_cell_base = __webpack_require__( /*! ../base/date_table_cell_base */ 75582); class DateTableMonthCell extends _inferno2.BaseInfernoComponent { constructor() { super(...arguments); this.contentTemplateProps = null } getContentTemplateProps() { if (null !== this.contentTemplateProps) { return this.contentTemplateProps } const { index: index, text: text } = this.props; this.contentTemplateProps = { data: { text: text }, index: index }; return this.contentTemplateProps } componentWillUpdate(nextProps) { if (this.props.index !== nextProps.index || this.props.text !== nextProps.text) { this.contentTemplateProps = null } } render() { const { viewContext: viewContext, dataCellTemplate: dataCellTemplate, endDate: endDate, groupIndex: groupIndex, groups: groups, index: index, isFirstGroupCell: isFirstGroupCell, isFocused: isFocused, isLastGroupCell: isLastGroupCell, isSelected: isSelected, startDate: startDate, text: text, className: className, firstDayOfMonth: firstDayOfMonth, otherMonth: otherMonth, today: today } = this.props; const classes = _index2.renderUtils.combineClasses({ "dx-scheduler-date-table-other-month": !!otherMonth, "dx-scheduler-date-table-current-date": !!today, "dx-scheduler-date-table-first-of-month": !!firstDayOfMonth, [className ?? ""]: !!className }); const contentTemplateProps = this.getContentTemplateProps(); const DataCellTemplateComponent = (0, _index.getTemplate)(dataCellTemplate); return (0, _inferno.createComponentVNode)(2, _date_table_cell_base.DateTableCellBase, { className: classes, viewContext: viewContext, dataCellTemplate: DataCellTemplateComponent, startDate: startDate, endDate: endDate, text: text, groups: groups, groupIndex: groupIndex, index: index, isFirstGroupCell: isFirstGroupCell, isLastGroupCell: isLastGroupCell, isSelected: isSelected, isFocused: isFocused, contentTemplateProps: contentTemplateProps, children: (0, _inferno.createVNode)(1, "div", "dx-scheduler-date-table-cell-text", text, 0) }) } } exports.DateTableMonthCell = DateTableMonthCell; DateTableMonthCell.defaultProps = _date_table_cell_base.DateTableCallBaseDefaultProps }, 99099: /*!*****************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/timeline/date_header_timeline.js ***! \*****************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.TimelineDateHeaderLayout = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587); var _themes = __webpack_require__( /*! ../../../../scheduler/r1/utils/themes */ 52821); var _index2 = __webpack_require__( /*! ../../utils/index */ 94084); var _date_header = __webpack_require__( /*! ../base/date_header */ 1889); var _date_header_cell = __webpack_require__( /*! ../base/date_header_cell */ 65186); var _row = __webpack_require__( /*! ../base/row */ 56449); const { isMaterialBased: isMaterialBased } = (0, _themes.getThemeType)(); class TimelineDateHeaderLayout extends _inferno2.BaseInfernoComponent { render() { const { viewContext: viewContext, groupByDate: groupByDate, groupOrientation: groupOrientation, groups: groups, dateHeaderData: dateHeaderData, dateCellTemplate: dateCellTemplate, timeCellTemplate: timeCellTemplate } = this.props; const { dataMap: dataMap, isMonthDateHeader: isMonthDateHeader, leftVirtualCellCount: leftVirtualCellCount, leftVirtualCellWidth: leftVirtualCellWidth, rightVirtualCellCount: rightVirtualCellCount, rightVirtualCellWidth: rightVirtualCellWidth, weekDayLeftVirtualCellCount: weekDayLeftVirtualCellCount, weekDayLeftVirtualCellWidth: weekDayLeftVirtualCellWidth, weekDayRightVirtualCellCount: weekDayRightVirtualCellCount, weekDayRightVirtualCellWidth: weekDayRightVirtualCellWidth } = dateHeaderData; const isHorizontalGrouping = (0, _index2.isHorizontalGroupingApplied)(groups, groupOrientation) && !groupByDate; const DateCellTemplateComponent = (0, _index.getTemplate)(dateCellTemplate); const TimeCellTemplateComponent = (0, _index.getTemplate)(timeCellTemplate); return (0, _inferno.createFragment)(dataMap.map(((dateHeaderRow, rowIndex) => { const rowsCount = dataMap.length; const isTimeCellTemplate = rowsCount - 1 === rowIndex; const isWeekDayRow = rowsCount > 1 && 0 === rowIndex; const splitText = isMaterialBased && (isMonthDateHeader || isWeekDayRow); let validLeftVirtualCellCount = leftVirtualCellCount; let validRightVirtualCellCount = rightVirtualCellCount; let validRightVirtualCellWidth = rightVirtualCellWidth; let validLeftVirtualCellWidth = leftVirtualCellWidth; if (isWeekDayRow) { validLeftVirtualCellCount = weekDayLeftVirtualCellCount; validRightVirtualCellCount = weekDayRightVirtualCellCount; validRightVirtualCellWidth = weekDayRightVirtualCellWidth; validLeftVirtualCellWidth = weekDayLeftVirtualCellWidth } return (0, _inferno.createComponentVNode)(2, _row.Row, { className: "dx-scheduler-header-row", leftVirtualCellWidth: validLeftVirtualCellWidth ?? _row.RowDefaultProps.leftVirtualCellWidth, leftVirtualCellCount: validLeftVirtualCellCount, rightVirtualCellWidth: validRightVirtualCellWidth ?? _row.RowDefaultProps.rightVirtualCellWidth, rightVirtualCellCount: validRightVirtualCellCount, children: dateHeaderRow.map((_ref => { let { colSpan: colSpan, endDate: endDate, groupIndex: groupIndex, groups: cellGroups, index: index, isFirstGroupCell: isFirstGroupCell, isLastGroupCell: isLastGroupCell, key: key, startDate: startDate, text: text, today: today } = _ref; return (0, _inferno.createComponentVNode)(2, _date_header_cell.DateHeaderCell, { viewContext: viewContext, startDate: startDate, endDate: endDate, groups: isHorizontalGrouping ? cellGroups : void 0, groupIndex: isHorizontalGrouping ? groupIndex : void 0, today: today ?? _date_header_cell.DateHeaderCellDefaultProps.today, index: index, text: text, isFirstGroupCell: isFirstGroupCell, isLastGroupCell: isLastGroupCell, isWeekDayCell: isWeekDayRow, colSpan: colSpan, splitText: splitText, dateCellTemplate: DateCellTemplateComponent, timeCellTemplate: TimeCellTemplateComponent, isTimeCellTemplate: isTimeCellTemplate }, key) })) }, rowIndex.toString()) })), 0) } } exports.TimelineDateHeaderLayout = TimelineDateHeaderLayout; TimelineDateHeaderLayout.defaultProps = _date_header.DateHeaderDefaultProps }, 51519: /*!******************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/timeline/header_panel_timeline.js ***! \******************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.HeaderPanelTimeline = void 0; var _inferno = __webpack_require__( /*! inferno */ 65414); var _inferno2 = __webpack_require__( /*! @devextreme/runtime/inferno */ 74219); var _index = __webpack_require__( /*! ../../../../core/r1/utils/index */ 71587); var _header_panel = __webpack_require__( /*! ../base/header_panel */ 69667); var _date_header_timeline = __webpack_require__( /*! ./date_header_timeline */ 99099); class HeaderPanelTimeline extends _inferno2.InfernoWrapperComponent { createEffects() { return [(0, _inferno2.createReRenderEffect)()] } render() { const { viewContext: viewContext, dateCellTemplate: dateCellTemplate, dateHeaderData: dateHeaderData, groupByDate: groupByDate, groupOrientation: groupOrientation, groupPanelData: groupPanelData, groups: groups, isRenderDateHeader: isRenderDateHeader, resourceCellTemplate: resourceCellTemplate, timeCellTemplate: timeCellTemplate } = this.props; const DateCellTemplateComponent = (0, _index.getTemplate)(dateCellTemplate); const ResourceCellTemplateComponent = (0, _index.getTemplate)(resourceCellTemplate); const TimeCellTemplateComponent = (0, _index.getTemplate)(timeCellTemplate); return (0, _inferno.createComponentVNode)(2, _header_panel.HeaderPanel, { viewContext: viewContext, dateHeaderData: dateHeaderData, groupPanelData: groupPanelData, groupByDate: groupByDate, groups: groups, groupOrientation: groupOrientation, isRenderDateHeader: isRenderDateHeader, dateHeaderTemplate: _date_header_timeline.TimelineDateHeaderLayout, resourceCellTemplate: ResourceCellTemplateComponent, dateCellTemplate: DateCellTemplateComponent, timeCellTemplate: TimeCellTemplateComponent }) } } exports.HeaderPanelTimeline = HeaderPanelTimeline; HeaderPanelTimeline.defaultProps = _header_panel.HeaderPanelDefaultProps }, 26426: /*!****************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/wrappers/all_day_panel_title.js ***! \****************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.AllDayPanelTitleComponent = void 0; var _component_registrator = (obj = __webpack_require__( /*! ../../../../../core/component_registrator */ 99393), obj && obj.__esModule ? obj : { default: obj }); var obj; var _index = __webpack_require__( /*! ../../../../core/r1/index */ 68789); var _all_day_panel_title = __webpack_require__( /*! ../base/all_day_panel_title */ 84501); class AllDayPanelTitleComponent extends _index.ComponentWrapper { get _propsInfo() { return { twoWay: [], allowNull: [], elements: [], templates: [], props: [] } } get _viewComponent() { return _all_day_panel_title.AllDayPanelTitle } } exports.AllDayPanelTitleComponent = AllDayPanelTitleComponent; (0, _component_registrator.default)("dxAllDayPanelTitle", AllDayPanelTitleComponent) }, 43422: /*!**********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/wrappers/all_day_table.js ***! \**********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.AllDayTableComponent = void 0; var _component_registrator = (obj = __webpack_require__( /*! ../../../../../core/component_registrator */ 99393), obj && obj.__esModule ? obj : { default: obj }); var obj; var _all_day_panel_table = __webpack_require__( /*! ../../../../scheduler/r1/components/base/all_day_panel_table */ 35947); var _date_table = __webpack_require__( /*! ./date_table */ 66225); class AllDayTableComponent extends _date_table.DateTableComponent { get _propsInfo() { return { twoWay: [], allowNull: [], elements: [], templates: ["dataCellTemplate"], props: ["viewData", "viewContext", "groupOrientation", "leftVirtualCellWidth", "rightVirtualCellWidth", "topVirtualRowHeight", "bottomVirtualRowHeight", "addDateTableClass", "addVerticalSizesClassToRows", "width", "dataCellTemplate"] } } get _viewComponent() { return _all_day_panel_table.AllDayTable } } exports.AllDayTableComponent = AllDayTableComponent; (0, _component_registrator.default)("dxAllDayTable", AllDayTableComponent) }, 66225: /*!*******************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/wrappers/date_table.js ***! \*******************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.DateTableComponent = void 0; var _component_registrator = (obj = __webpack_require__( /*! ../../../../../core/component_registrator */ 99393), obj && obj.__esModule ? obj : { default: obj }); var obj; var _index = __webpack_require__( /*! ../../../../core/r1/index */ 68789); var _date_table = __webpack_require__( /*! ../base/date_table */ 69997); function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } class DateTableComponent extends _index.ComponentWrapper { _setOptionsByReference() { super._setOptionsByReference(); this._optionsByReference = _extends({}, this._optionsByReference, { dataCellTemplate: true }) } get _propsInfo() { return { twoWay: [], allowNull: [], elements: [], templates: ["cellTemplate", "dataCellTemplate"], props: ["viewData", "viewContext", "cellTemplate", "groupOrientation", "leftVirtualCellWidth", "rightVirtualCellWidth", "topVirtualRowHeight", "bottomVirtualRowHeight", "addDateTableClass", "addVerticalSizesClassToRows", "width", "dataCellTemplate"] } } get _viewComponent() { return _date_table.DateTable } } exports.DateTableComponent = DateTableComponent; (0, _component_registrator.default)("dxDateTableLayoutBase", DateTableComponent) }, 22478: /*!*************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/wrappers/date_table_month.js ***! \*************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.DateTableMonthComponent = void 0; var _component_registrator = (obj = __webpack_require__( /*! ../../../../../core/component_registrator */ 99393), obj && obj.__esModule ? obj : { default: obj }); var obj; var _date_table_month = __webpack_require__( /*! ../month/date_table_month */ 47710); var _date_table = __webpack_require__( /*! ./date_table */ 66225); class DateTableMonthComponent extends _date_table.DateTableComponent { get _propsInfo() { return { twoWay: [], allowNull: [], elements: [], templates: ["cellTemplate", "dataCellTemplate"], props: ["viewData", "viewContext", "cellTemplate", "groupOrientation", "leftVirtualCellWidth", "rightVirtualCellWidth", "topVirtualRowHeight", "bottomVirtualRowHeight", "addDateTableClass", "addVerticalSizesClassToRows", "width", "dataCellTemplate"] } } get _viewComponent() { return _date_table_month.DateTableMonth } } exports.DateTableMonthComponent = DateTableMonthComponent; (0, _component_registrator.default)("dxMonthDateTableLayout", DateTableMonthComponent) }, 42523: /*!********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/wrappers/group_panel.js ***! \********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.GroupPanelComponent = void 0; var _component_registrator = (obj = __webpack_require__( /*! ../../../../../core/component_registrator */ 99393), obj && obj.__esModule ? obj : { default: obj }); var obj; var _index = __webpack_require__( /*! ../../../../core/r1/index */ 68789); var _group_panel = __webpack_require__( /*! ../base/group_panel */ 14225); function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } class GroupPanelComponent extends _index.ComponentWrapper { _setOptionsByReference() { super._setOptionsByReference(); this._optionsByReference = _extends({}, this._optionsByReference, { resourceCellTemplate: true }) } get _propsInfo() { return { twoWay: [], allowNull: [], elements: [], templates: ["resourceCellTemplate"], props: ["viewContext", "groups", "groupOrientation", "groupPanelData", "groupByDate", "height", "className", "resourceCellTemplate"] } } get _viewComponent() { return _group_panel.GroupPanel } } exports.GroupPanelComponent = GroupPanelComponent; (0, _component_registrator.default)("dxGroupPanel", GroupPanelComponent) }, 56108: /*!*********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/wrappers/header_panel.js ***! \*********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.HeaderPanelComponent = void 0; var _component_registrator = (obj = __webpack_require__( /*! ../../../../../core/component_registrator */ 99393), obj && obj.__esModule ? obj : { default: obj }); var obj; var _index = __webpack_require__( /*! ../../../../core/r1/index */ 68789); var _header_panel = __webpack_require__( /*! ../base/header_panel */ 69667); function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } class HeaderPanelComponent extends _index.ComponentWrapper { _setOptionsByReference() { super._setOptionsByReference(); this._optionsByReference = _extends({}, this._optionsByReference, { dateHeaderData: true, resourceCellTemplate: true, dateCellTemplate: true, timeCellTemplate: true }) } get _propsInfo() { return { twoWay: [], allowNull: [], elements: [], templates: ["dateCellTemplate", "timeCellTemplate", "dateHeaderTemplate", "resourceCellTemplate"], props: ["viewContext", "dateHeaderData", "isRenderDateHeader", "dateCellTemplate", "timeCellTemplate", "dateHeaderTemplate", "groups", "groupOrientation", "groupPanelData", "groupByDate", "height", "className", "resourceCellTemplate"] } } get _viewComponent() { return _header_panel.HeaderPanel } } exports.HeaderPanelComponent = HeaderPanelComponent; (0, _component_registrator.default)("dxHeaderPanelLayout", HeaderPanelComponent) }, 73725: /*!******************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/wrappers/header_panel_timeline.js ***! \******************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.HeaderPanelTimelineComponent = void 0; var _component_registrator = (obj = __webpack_require__( /*! ../../../../../core/component_registrator */ 99393), obj && obj.__esModule ? obj : { default: obj }); var obj; var _header_panel_timeline = __webpack_require__( /*! ../timeline/header_panel_timeline */ 51519); var _header_panel = __webpack_require__( /*! ./header_panel */ 56108); class HeaderPanelTimelineComponent extends _header_panel.HeaderPanelComponent { get _propsInfo() { return { twoWay: [], allowNull: [], elements: [], templates: ["dateCellTemplate", "timeCellTemplate", "dateHeaderTemplate", "resourceCellTemplate"], props: ["viewContext", "dateHeaderData", "isRenderDateHeader", "dateCellTemplate", "timeCellTemplate", "dateHeaderTemplate", "groups", "groupOrientation", "groupPanelData", "groupByDate", "height", "className", "resourceCellTemplate"] } } get _viewComponent() { return _header_panel_timeline.HeaderPanelTimeline } } exports.HeaderPanelTimelineComponent = HeaderPanelTimelineComponent; (0, _component_registrator.default)("dxTimelineHeaderPanelLayout", HeaderPanelTimelineComponent) }, 64608: /*!*******************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/components/wrappers/time_panel.js ***! \*******************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.TimePanelComponent = void 0; var _component_registrator = (obj = __webpack_require__( /*! ../../../../../core/component_registrator */ 99393), obj && obj.__esModule ? obj : { default: obj }); var obj; var _index = __webpack_require__( /*! ../../../../core/r1/index */ 68789); var _time_panel_table = __webpack_require__( /*! ../base/time_panel_table */ 71630); function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } class TimePanelComponent extends _index.ComponentWrapper { _setOptionsByReference() { super._setOptionsByReference(); this._optionsByReference = _extends({}, this._optionsByReference, { timeCellTemplate: true }) } get _propsInfo() { return { twoWay: [], allowNull: [], elements: [], templates: ["timeCellTemplate"], props: ["viewContext", "groupOrientation", "timePanelData", "timeCellTemplate"] } } get _viewComponent() { return _time_panel_table.TimePanelTable } } exports.TimePanelComponent = TimePanelComponent; (0, _component_registrator.default)("dxTimePanelTableLayout", TimePanelComponent) }, 4907: /*!******************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/const.js ***! \******************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.VIEW_TYPES = exports.VERTICAL_GROUP_ORIENTATION = exports.TIMELINE_VIEWS = exports.HORIZONTAL_GROUP_ORIENTATION = void 0; exports.VERTICAL_GROUP_ORIENTATION = "vertical"; exports.HORIZONTAL_GROUP_ORIENTATION = "horizontal"; exports.TIMELINE_VIEWS = { timelineDay: true, timelineWeek: true, timelineWorkWeek: true, timelineMonth: true }; exports.VIEW_TYPES = ["day", "week", "workWeek", "month", "timelineDay", "timelineWeek", "timelineWorkWeek", "timelineMonth", "agenda"] }, 7884: /*!*****************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/filterting/index.js ***! \*****************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "combineRemoteFilter", { enumerable: true, get: function() { return _remote.combineRemoteFilter } }); var _remote = __webpack_require__( /*! ./remote */ 19206) }, 19206: /*!******************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/filterting/remote.js ***! \******************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.combineRemoteFilter = void 0; var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _date_serialization = (obj = __webpack_require__( /*! ../../../../core/utils/date_serialization */ 69434), obj && obj.__esModule ? obj : { default: obj }); var obj; var _extend = __webpack_require__( /*! ../../../../core/utils/extend */ 13306); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _index = __webpack_require__( /*! ../utils/index */ 94084); const FilterPosition_dateFilter = 0, FilterPosition_userFilter = 1; class RemoteFilterCombiner { constructor(options) { this.options = options } get dataAccessors() { return this.options.dataAccessors } get dataSourceFilter() { return this.options.dataSourceFilter } get dateSerializationFormat() { return this.options.dateSerializationFormat } get forceIsoDateParsing() { return (0, _type.isDefined)(this.options.forceIsoDateParsing) ? this.options.forceIsoDateParsing : true } makeDateFilter(min, max) { const { startDateExpr: startDateExpr, endDateExpr: endDateExpr, recurrenceRuleExpr: recurrenceRuleExpr } = this.dataAccessors.expr; const dateFilter = [ [ [endDateExpr, ">=", min], [startDateExpr, "<", max] ], "or", [recurrenceRuleExpr, "startswith", "freq"], "or", [ [endDateExpr, min], [startDateExpr, min] ] ]; if (!recurrenceRuleExpr) { dateFilter.splice(1, 2) } return dateFilter } combineFilters(dateFilter, userFilter) { const combinedFilter = []; if (dateFilter) { combinedFilter.push(dateFilter) } if (userFilter) { combinedFilter.push(userFilter) } return this.serializeRemoteFilter(combinedFilter) } serializeRemoteFilter(combinedFilter) { if (!Array.isArray(combinedFilter)) { return combinedFilter } const { startDateExpr: startDateExpr, endDateExpr: endDateExpr } = this.dataAccessors.expr; const filter = (0, _extend.extend)([], combinedFilter); if ((0, _type.isString)(filter[0])) { if (this.forceIsoDateParsing && filter.length > 1) { if (filter[0] === startDateExpr || filter[0] === endDateExpr) { const lastFilterValue = filter[filter.length - 1]; filter[filter.length - 1] = _date_serialization.default.serializeDate(new Date(lastFilterValue), this.dateSerializationFormat) } } } for (let i = 0; i < filter.length; i += 1) { filter[i] = this.serializeRemoteFilter(filter[i]) } return filter } getUserFilter(dateFilter) { if (!this.dataSourceFilter || (0, _common.equalByValue)(this.dataSourceFilter, dateFilter)) { return } const containsDateFilter = this.dataSourceFilter.length > 0 && (0, _common.equalByValue)(this.dataSourceFilter[FilterPosition_dateFilter], dateFilter); const userFilter = containsDateFilter ? this.dataSourceFilter[FilterPosition_userFilter] : this.dataSourceFilter; return userFilter } combine(min, max) { const [trimMin, trimMax] = (0, _index.getDatesWithoutTime)(min, max); const dateFilter = this.makeDateFilter(trimMin, trimMax); const userFilter = this.getUserFilter(dateFilter); const combinedFilter = this.combineFilters(dateFilter, userFilter); return combinedFilter } } exports.combineRemoteFilter = options => new RemoteFilterCombiner(options).combine(options.min, options.max) }, 66803: /*!****************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/semaphore/index.js ***! \****************************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.Semaphore = void 0; exports.Semaphore = class { constructor() { this.counter = 0 } isFree() { return 0 === this.counter } take() { this.counter += 1 } release() { this.counter -= 1; if (this.counter < 0) { this.counter = 0 } } } }, 71353: /*!*******************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/timezone_calculator/calculator.js ***! \*******************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.TimeZoneCalculator = void 0; var _date = (obj = __webpack_require__( /*! ../../../../core/utils/date */ 91198), obj && obj.__esModule ? obj : { default: obj }); var obj; var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _date2 = __webpack_require__( /*! ../../../core/utils/date */ 24321); var _const = __webpack_require__( /*! ./const */ 45360); const toMs = _date.default.dateToMilliseconds; exports.TimeZoneCalculator = class { constructor(options) { this.options = options } createDate(sourceDate, info) { const date = new Date(sourceDate); switch (info.path) { case _const.PathTimeZoneConversion.fromSourceToAppointment: return this.getConvertedDate(date, info.appointmentTimeZone, true, false); case _const.PathTimeZoneConversion.fromAppointmentToSource: return this.getConvertedDate(date, info.appointmentTimeZone, true, true); case _const.PathTimeZoneConversion.fromSourceToGrid: return this.getConvertedDate(date, info.appointmentTimeZone, false, false); case _const.PathTimeZoneConversion.fromGridToSource: return this.getConvertedDate(date, info.appointmentTimeZone, false, true); default: throw new Error("not specified pathTimeZoneConversion") } } getOffsets(date, appointmentTimezone) { const clientOffset = -this.getClientOffset(date) / _date.default.dateToMilliseconds("hour"); const commonOffset = this.getCommonOffset(date); const appointmentOffset = this.getAppointmentOffset(date, appointmentTimezone); return { client: clientOffset, common: !(0, _type.isDefined)(commonOffset) ? clientOffset : commonOffset, appointment: "number" !== typeof appointmentOffset ? clientOffset : appointmentOffset } } getConvertedDateByOffsets(date, clientOffset, targetOffset, isBack) { const direction = isBack ? -1 : 1; const resultDate = new Date(date); return _date2.dateUtilsTs.addOffsets(resultDate, [direction * (toMs("hour") * targetOffset), -direction * (toMs("hour") * clientOffset)]) } getOriginStartDateOffsetInMs(date, timezone, isUTCDate) { const offsetInHours = this.getOffsetInHours(date, timezone, isUTCDate); return 36e5 * offsetInHours } getOffsetInHours(date, timezone, isUTCDate) { const { client: client, appointment: appointment, common: common } = this.getOffsets(date, timezone); if (!!timezone && isUTCDate) { return appointment - client } if (!!timezone && !isUTCDate) { return appointment - common } if (!timezone && isUTCDate) { return common - client } return 0 } getClientOffset(date) { return this.options.getClientOffset(date) } getCommonOffset(date) { return this.options.tryGetCommonOffset(date) } getAppointmentOffset(date, appointmentTimezone) { return this.options.tryGetAppointmentOffset(date, appointmentTimezone) } getConvertedDate(date, appointmentTimezone, useAppointmentTimeZone, isBack) { const newDate = new Date(date.getTime()); const offsets = this.getOffsets(newDate, appointmentTimezone); if (useAppointmentTimeZone && !!appointmentTimezone) { return this.getConvertedDateByOffsets(date, offsets.client, offsets.appointment, isBack) } return this.getConvertedDateByOffsets(date, offsets.client, offsets.common, isBack) } } }, 45360: /*!**************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/timezone_calculator/const.js ***! \**************************************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.PathTimeZoneConversion = void 0; var PathTimeZoneConversion; ! function(PathTimeZoneConversion) { PathTimeZoneConversion.fromSourceToAppointment = "toAppointment"; PathTimeZoneConversion.fromAppointmentToSource = "fromAppointment"; PathTimeZoneConversion.fromSourceToGrid = "toGrid"; PathTimeZoneConversion.fromGridToSource = "fromGrid" }(PathTimeZoneConversion || (exports.PathTimeZoneConversion = PathTimeZoneConversion = {})) }, 6155: /*!**************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/timezone_calculator/index.js ***! \**************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "PathTimeZoneConversion", { enumerable: true, get: function() { return _const.PathTimeZoneConversion } }); Object.defineProperty(exports, "TimeZoneCalculator", { enumerable: true, get: function() { return _calculator.TimeZoneCalculator } }); Object.defineProperty(exports, "createTimeZoneCalculator", { enumerable: true, get: function() { return _utils.createTimeZoneCalculator } }); var _calculator = __webpack_require__( /*! ./calculator */ 71353); var _const = __webpack_require__( /*! ./const */ 45360); var _utils = __webpack_require__( /*! ./utils */ 21741) }, 21741: /*!**************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/timezone_calculator/utils.js ***! \**************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.createTimeZoneCalculator = void 0; var _m_utils_time_zone = (obj = __webpack_require__( /*! ../../m_utils_time_zone */ 57880), obj && obj.__esModule ? obj : { default: obj }); var obj; var _calculator = __webpack_require__( /*! ./calculator */ 71353); exports.createTimeZoneCalculator = currentTimeZone => new _calculator.TimeZoneCalculator({ getClientOffset: date => _m_utils_time_zone.default.getClientTimezoneOffset(date), tryGetCommonOffset: date => _m_utils_time_zone.default.calculateTimezoneByValue(currentTimeZone, date), tryGetAppointmentOffset: (date, appointmentTimezone) => _m_utils_time_zone.default.calculateTimezoneByValue(appointmentTimezone, date) }) }, 49372: /*!*************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/utils/agenda.js ***! \*************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.calculateStartViewDate = void 0; var _base = __webpack_require__( /*! ./base */ 33053); exports.calculateStartViewDate = (currentDate, startDayHour) => { const validCurrentDate = new Date(currentDate); return (0, _base.setOptionHour)(validCurrentDate, startDayHour) } }, 33053: /*!***********************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/utils/base.js ***! \***********************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.splitNumber = exports.setOptionHour = exports.isVerticalGroupingApplied = exports.isTimelineView = exports.isHorizontalView = exports.isHorizontalGroupingApplied = exports.isGroupingByDate = exports.isFirstCellInMonthWithIntervalCount = exports.isDateInRange = exports.isDateAndTimeView = exports.isDataOnWeekend = exports.hasResourceValue = exports.getWeekendsCount = exports.getViewStartByOptions = exports.getVerticalGroupCountClass = exports.getValidCellDateForLocalTimeFormat = exports.getTotalRowCountByCompleteData = exports.getTotalCellCountByCompleteData = exports.getToday = exports.getStartViewDateWithoutDST = exports.getStartViewDateTimeOffset = exports.getSkippedHoursInRange = exports.getOverflowIndicatorColor = exports.getKeyByGroup = exports.getIsGroupedAllDayPanel = exports.getHorizontalGroupCount = exports.getHeaderCellText = exports.getGroupPanelData = exports.getGroupCount = exports.getDisplayedRowCount = exports.getDisplayedCellCount = exports.getDatesWithoutTime = exports.getCellDuration = exports.getCalculatedFirstDayOfWeek = exports.getAppointmentTakesAllDay = exports.getAppointmentRenderingStrategyName = exports.getAppointmentKey = exports.extendGroupItemsForGroupingByDate = exports.calculateViewStartDate = exports.calculateIsGroupedAllDayPanel = exports.calculateDayDuration = exports.calculateCellIndex = void 0; var _common = __webpack_require__( /*! ../../../../core/utils/common */ 20576); var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198)); var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/date */ 91500)); var _date3 = __webpack_require__( /*! ../../../core/utils/date */ 24321); var _m_classes = __webpack_require__( /*! ../../m_classes */ 43600); var _m_constants = __webpack_require__( /*! ../../m_constants */ 6324); var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../../m_utils_time_zone */ 57880)); var _const = __webpack_require__( /*! ../const */ 4907); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const toMs = _date.default.dateToMilliseconds; exports.getDatesWithoutTime = (min, max) => { const newMin = _date.default.trimTime(min); const newMax = _date.default.trimTime(max); newMax.setDate(newMax.getDate() + 1); return [newMin, newMax] }; exports.getAppointmentRenderingStrategyName = viewType => { const { renderingStrategy: renderingStrategy } = { day: { renderingStrategy: "vertical" }, week: { renderingStrategy: "week" }, workWeek: { renderingStrategy: "week" }, month: { renderingStrategy: "horizontalMonth" }, timelineDay: { renderingStrategy: "horizontal" }, timelineWeek: { renderingStrategy: "horizontal" }, timelineWorkWeek: { renderingStrategy: "horizontal" }, timelineMonth: { renderingStrategy: "horizontalMonthLine" }, agenda: { renderingStrategy: "agenda" } } [viewType]; return renderingStrategy }; exports.getAppointmentTakesAllDay = (appointmentAdapter, allDayPanelMode) => { const { startDate: startDate, endDate: endDate, allDay: allDay } = appointmentAdapter; switch (allDayPanelMode) { case "hidden": return false; case "allDay": return allDay; default: if (allDay) { return true } if (!(0, _type.isDefined)(endDate)) { return false } return ((startDate, endDate) => Math.floor((endDate.getTime() - startDate.getTime()) / toMs("hour")))(startDate, endDate) >= 24 } }; exports.getAppointmentKey = geometry => { const { left: left, top: top, width: width, height: height } = geometry; return `${left}-${top}-${width}-${height}` }; exports.hasResourceValue = (resourceValues, itemValue) => (0, _type.isDefined)(resourceValues.find((value => (0, _common.equalByValue)(value, itemValue)))); exports.getOverflowIndicatorColor = (color, colors) => !colors.length || 0 === colors.filter((item => item !== color)).length ? color : void 0; exports.getVerticalGroupCountClass = groups => { switch (null === groups || void 0 === groups ? void 0 : groups.length) { case 1: return _m_classes.VERTICAL_GROUP_COUNT_CLASSES[0]; case 2: return _m_classes.VERTICAL_GROUP_COUNT_CLASSES[1]; case 3: return _m_classes.VERTICAL_GROUP_COUNT_CLASSES[2]; default: return } }; exports.setOptionHour = (date, optionHour) => { const nextDate = new Date(date); if (!(0, _type.isDefined)(optionHour)) { return nextDate } nextDate.setHours(optionHour, optionHour % 1 * 60, 0, 0); return nextDate }; const calculateDayDuration = (startDayHour, endDayHour) => endDayHour - startDayHour; exports.calculateDayDuration = calculateDayDuration; const getStartViewDateTimeOffset = (startViewDate, startDayHour) => { const validStartDayHour = Math.floor(startDayHour); const isDSTChange = _m_utils_time_zone.default.isTimezoneChangeInDate(startViewDate); if (isDSTChange && validStartDayHour !== startViewDate.getHours()) { return _date.default.dateToMilliseconds("hour") } return 0 }; exports.getStartViewDateTimeOffset = getStartViewDateTimeOffset; exports.getValidCellDateForLocalTimeFormat = (date, _ref) => { let { startViewDate: startViewDate, startDayHour: startDayHour, cellIndexShift: cellIndexShift, viewOffset: viewOffset } = _ref; const originDate = _date3.dateUtilsTs.addOffsets(date, [-viewOffset]); const localTimeZoneChangedInOriginDate = _m_utils_time_zone.default.isTimezoneChangeInDate(originDate); if (!localTimeZoneChangedInOriginDate) { return date } const startViewDateWithoutDST = new Date(new Date(startViewDate).setDate(startViewDate.getDate() + 2)); const startViewDateOffset = getStartViewDateTimeOffset(startViewDate, startDayHour); return _date3.dateUtilsTs.addOffsets(startViewDateWithoutDST, [viewOffset, cellIndexShift, -startViewDateOffset]) }; const getTotalCellCountByCompleteData = completeData => completeData[completeData.length - 1].length; exports.getTotalCellCountByCompleteData = getTotalCellCountByCompleteData; exports.getDisplayedCellCount = (displayedCellCount, completeData) => displayedCellCount ?? getTotalCellCountByCompleteData(completeData); exports.getHeaderCellText = (headerIndex, date, headerCellTextFormat, getDateForHeaderText, additionalOptions) => { const validDate = getDateForHeaderText(headerIndex, date, additionalOptions); return _date2.default.format(validDate, headerCellTextFormat) }; const isVerticalGroupingApplied = (groups, groupOrientation) => groupOrientation === _const.VERTICAL_GROUP_ORIENTATION && !!groups.length; exports.isVerticalGroupingApplied = isVerticalGroupingApplied; const getGroupCount = groups => { let result = 0; for (let i = 0, len = groups.length; i < len; i += 1) { if (!i) { result = groups[i].items.length } else { result *= groups[i].items.length } } return result }; exports.getGroupCount = getGroupCount; exports.getHorizontalGroupCount = (groups, groupOrientation) => { const groupCount = getGroupCount(groups) || 1; const isVerticalGrouping = isVerticalGroupingApplied(groups, groupOrientation); return isVerticalGrouping ? 1 : groupCount }; exports.isTimelineView = viewType => !!_const.TIMELINE_VIEWS[viewType]; exports.isDateAndTimeView = viewType => viewType !== _m_constants.VIEWS.TIMELINE_MONTH && viewType !== _m_constants.VIEWS.MONTH; exports.isHorizontalView = viewType => { switch (viewType) { case _m_constants.VIEWS.TIMELINE_DAY: case _m_constants.VIEWS.TIMELINE_WEEK: case _m_constants.VIEWS.TIMELINE_WORK_WEEK: case _m_constants.VIEWS.TIMELINE_MONTH: case _m_constants.VIEWS.MONTH: return true; default: return false } }; const isDateInRange = (date, startDate, endDate, diff) => diff > 0 ? _date.default.dateInRange(date, startDate, new Date(endDate.getTime() - 1)) : _date.default.dateInRange(date, endDate, startDate, "date"); exports.isDateInRange = isDateInRange; exports.isFirstCellInMonthWithIntervalCount = (cellDate, intervalCount) => 1 === cellDate.getDate() && intervalCount > 1; exports.getViewStartByOptions = (startDate, currentDate, intervalDuration, startViewDate) => { if (!startDate) { return new Date(currentDate) } let currentStartDate = _date.default.trimTime(startViewDate); const diff = currentStartDate.getTime() <= currentDate.getTime() ? 1 : -1; let endDate = new Date(currentStartDate.getTime() + intervalDuration * diff); while (!isDateInRange(currentDate, currentStartDate, endDate, diff)) { currentStartDate = endDate; endDate = new Date(currentStartDate.getTime() + intervalDuration * diff) } return diff > 0 ? currentStartDate : endDate }; exports.calculateIsGroupedAllDayPanel = (groups, groupOrientation, isAllDayPanelVisible) => isVerticalGroupingApplied(groups, groupOrientation) && isAllDayPanelVisible; exports.calculateViewStartDate = startDateOption => startDateOption; exports.getCellDuration = (viewType, startDayHour, endDayHour, hoursInterval) => { switch (viewType) { case "month": return 36e5 * calculateDayDuration(startDayHour, endDayHour); case "timelineMonth": return _date.default.dateToMilliseconds("day"); default: return 36e5 * hoursInterval } }; exports.calculateCellIndex = (rowIndex, columnIndex, rowCount) => columnIndex * rowCount + rowIndex; const getTotalRowCountByCompleteData = completeData => completeData.length; exports.getTotalRowCountByCompleteData = getTotalRowCountByCompleteData; exports.getDisplayedRowCount = (displayedRowCount, completeData) => displayedRowCount ?? getTotalRowCountByCompleteData(completeData); exports.getStartViewDateWithoutDST = (startViewDate, startDayHour) => { const newStartViewDate = _m_utils_time_zone.default.getDateWithoutTimezoneChange(startViewDate); newStartViewDate.setHours(startDayHour); return newStartViewDate }; exports.getIsGroupedAllDayPanel = (hasAllDayRow, isVerticalGrouping) => hasAllDayRow && isVerticalGrouping; exports.getKeyByGroup = (groupIndex, isVerticalGrouping) => { if (isVerticalGrouping && !!groupIndex) { return groupIndex.toString() } return "0" }; exports.getToday = (indicatorTime, timeZoneCalculator) => { const todayDate = indicatorTime ?? new Date; return (null === timeZoneCalculator || void 0 === timeZoneCalculator ? void 0 : timeZoneCalculator.createDate(todayDate, { path: "toGrid" })) || todayDate }; exports.getCalculatedFirstDayOfWeek = firstDayOfWeekOption => (0, _type.isDefined)(firstDayOfWeekOption) ? firstDayOfWeekOption : _date2.default.firstDayOfWeekIndex(); const isHorizontalGroupingApplied = (groups, groupOrientation) => groupOrientation === _const.HORIZONTAL_GROUP_ORIENTATION && !!groups.length; exports.isHorizontalGroupingApplied = isHorizontalGroupingApplied; exports.isGroupingByDate = (groups, groupOrientation, groupByDate) => { const isHorizontalGrouping = isHorizontalGroupingApplied(groups, groupOrientation); return groupByDate && isHorizontalGrouping }; exports.getSkippedHoursInRange = (startDate, endDate, allDay, viewDataProvider) => { const isAllDay = allDay && !viewDataProvider.viewType.includes("timeline"); let result = 0; const currentDate = new Date(startDate); currentDate.setDate(currentDate.getDate() + 1); currentDate.setHours(0, 0, 0, 0); const endDateWithStartHour = new Date(endDate); endDateWithStartHour.setHours(0, 0, 0, 0); const { startDayHour: startDayHour, endDayHour: endDayHour } = viewDataProvider.getViewOptions(); const dayHours = isAllDay ? 24 : endDayHour - startDayHour; while (currentDate < endDateWithStartHour) { if (viewDataProvider.isSkippedDate(currentDate)) { result += dayHours } currentDate.setDate(currentDate.getDate() + 1) } const startDateHours = startDate.getHours(); const endDateHours = endDate.getHours() + endDate.getTime() % 36e5 / 36e5; if (viewDataProvider.isSkippedDate(startDate)) { if (isAllDay) { result += 24 } else if (startDateHours < startDayHour) { result += dayHours } else if (startDateHours < endDayHour) { result += endDayHour - startDateHours } } if (viewDataProvider.isSkippedDate(endDate)) { if (isAllDay) { result += 24 } else if (endDateHours > endDayHour) { result += dayHours } else if (endDateHours > startDayHour) { result += endDateHours - startDayHour } } return result }; exports.isDataOnWeekend = date => { const day = date.getDay(); return 6 === day || 0 === day }; exports.getWeekendsCount = days => 2 * Math.floor(days / 7); const extendGroupItemsForGroupingByDate = (groupRenderItems, columnCountPerGroup) => [...new Array(columnCountPerGroup)].reduce(((currentGroupItems, _, index) => groupRenderItems.map(((groupsRow, rowIndex) => { const currentRow = currentGroupItems[rowIndex] || []; return [...currentRow, ...groupsRow.map(((item, columnIndex) => _extends({}, item, { key: `${item.key}_group_by_date_${index}`, isFirstGroupCell: 0 === columnIndex, isLastGroupCell: columnIndex === groupsRow.length - 1 })))] }))), []); exports.extendGroupItemsForGroupingByDate = extendGroupItemsForGroupingByDate; exports.getGroupPanelData = (groups, columnCountPerGroup, groupByDate, baseColSpan) => { let repeatCount = 1; let groupPanelItems = groups.map((group => { const result = []; const { name: resourceName, items: items, data: data } = group; for (let iterator = 0; iterator < repeatCount; iterator += 1) { result.push(...items.map(((_ref2, index) => { let { id: id, text: text, color: color } = _ref2; return { id: id, text: text, color: color, key: `${iterator}_${resourceName}_${id}`, resourceName: resourceName, data: null === data || void 0 === data ? void 0 : data[index] } }))) } repeatCount *= items.length; return result })); if (groupByDate) { groupPanelItems = extendGroupItemsForGroupingByDate(groupPanelItems, columnCountPerGroup) } return { groupPanelItems: groupPanelItems, baseColSpan: baseColSpan } }; exports.splitNumber = (value, splitValue) => Array.from({ length: Math.ceil(value / splitValue) }, ((_, index) => Math.min(value - splitValue * index, splitValue))) }, 60961: /*!***********************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/utils/data.js ***! \***********************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.resolveDataItems = exports.getPreparedDataItems = void 0; var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _m_utils = __webpack_require__( /*! ../../appointments/data_provider/m_utils */ 55523); var _m_appointment_adapter = __webpack_require__( /*! ../../m_appointment_adapter */ 72734); exports.getPreparedDataItems = (dataItems, dataAccessors, cellDurationInMinutes, timeZoneCalculator) => { const result = []; null === dataItems || void 0 === dataItems || dataItems.forEach((rawAppointment => { var _recurrenceRule$match; const startDate = new Date(dataAccessors.getter.startDate(rawAppointment)); const endDate = new Date(dataAccessors.getter.endDate(rawAppointment)); (0, _m_utils.replaceWrongEndDate)(rawAppointment, startDate, endDate, cellDurationInMinutes, dataAccessors); const adapter = (0, _m_appointment_adapter.createAppointmentAdapter)(rawAppointment, dataAccessors, timeZoneCalculator); const comparableStartDate = adapter.startDate && adapter.calculateStartDate("toGrid"); const comparableEndDate = adapter.endDate && adapter.calculateEndDate("toGrid"); const regex = new RegExp("freq", "gi"); const recurrenceRule = adapter.recurrenceRule; const hasRecurrenceRule = !!(null !== recurrenceRule && void 0 !== recurrenceRule && null !== (_recurrenceRule$match = recurrenceRule.match(regex)) && void 0 !== _recurrenceRule$match && _recurrenceRule$match.length); const visible = (0, _type.isDefined)(rawAppointment.visible) ? !!rawAppointment.visible : true; if (comparableStartDate && comparableEndDate) { result.push({ allDay: !!adapter.allDay, startDate: comparableStartDate, startDateTimeZone: rawAppointment.startDateTimeZone, endDate: comparableEndDate, endDateTimeZone: rawAppointment.endDateTimeZone, recurrenceRule: adapter.recurrenceRule, recurrenceException: adapter.recurrenceException, hasRecurrenceRule: hasRecurrenceRule, visible: visible, rawAppointment: rawAppointment }) } })); return result }; exports.resolveDataItems = options => Array.isArray(options) ? options : options.data }, 44246: /*!**********************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/utils/day.js ***! \**********************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.calculateStartViewDate = void 0; var _base = __webpack_require__( /*! ./base */ 33053); exports.calculateStartViewDate = (currentDate, startDayHour, startDate, intervalDuration) => { const firstViewDate = (0, _base.getViewStartByOptions)(startDate, currentDate, intervalDuration, startDate); return (0, _base.setOptionHour)(firstViewDate, startDayHour) } }, 33597: /*!******************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/utils/exclude_from_recurrence.js ***! \******************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.excludeFromRecurrence = void 0; var _date_serialization = (obj = __webpack_require__( /*! ../../../../core/utils/date_serialization */ 69434), obj && obj.__esModule ? obj : { default: obj }); var obj; var _m_appointment_adapter = __webpack_require__( /*! ../../m_appointment_adapter */ 72734); function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const createRecurrenceException = (appointmentAdapter, exceptionDate) => { const result = []; if (appointmentAdapter.recurrenceException) { result.push(appointmentAdapter.recurrenceException) } result.push(((date, startDate, isAllDay) => { if (isAllDay) { date.setHours(startDate.getHours(), startDate.getMinutes(), startDate.getSeconds(), startDate.getMilliseconds()) } return _date_serialization.default.serializeDate(date, "yyyyMMddTHHmmssZ") })(exceptionDate, appointmentAdapter.startDate, appointmentAdapter.allDay)); return result.join() }; exports.excludeFromRecurrence = (appointment, exceptionDate, dataAccessors, timeZoneCalculator) => { const appointmentAdapter = (0, _m_appointment_adapter.createAppointmentAdapter)(_extends({}, appointment), dataAccessors, timeZoneCalculator); appointmentAdapter.recurrenceException = createRecurrenceException(appointmentAdapter, exceptionDate); return appointmentAdapter } }, 29927: /*!*********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/utils/format_weekday.js ***! \*********************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.formatWeekdayAndDay = exports.formatWeekday = void 0; var _date = (obj = __webpack_require__( /*! ../../../../localization/date */ 91500), obj && obj.__esModule ? obj : { default: obj }); var obj; const formatWeekday = date => _date.default.getDayNames("abbreviated")[date.getDay()]; exports.formatWeekday = formatWeekday; exports.formatWeekdayAndDay = date => `${formatWeekday(date)} ${_date.default.format(date,"day")}` }, 94084: /*!************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/utils/index.js ***! \************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.agendaUtils = void 0; Object.defineProperty(exports, "calculateCellIndex", { enumerable: true, get: function() { return _base.calculateCellIndex } }); Object.defineProperty(exports, "calculateDayDuration", { enumerable: true, get: function() { return _base.calculateDayDuration } }); Object.defineProperty(exports, "calculateIsGroupedAllDayPanel", { enumerable: true, get: function() { return _base.calculateIsGroupedAllDayPanel } }); Object.defineProperty(exports, "calculateViewStartDate", { enumerable: true, get: function() { return _base.calculateViewStartDate } }); exports.dayUtils = void 0; Object.defineProperty(exports, "excludeFromRecurrence", { enumerable: true, get: function() { return _exclude_from_recurrence.excludeFromRecurrence } }); Object.defineProperty(exports, "extendGroupItemsForGroupingByDate", { enumerable: true, get: function() { return _base.extendGroupItemsForGroupingByDate } }); Object.defineProperty(exports, "formatWeekday", { enumerable: true, get: function() { return _format_weekday.formatWeekday } }); Object.defineProperty(exports, "formatWeekdayAndDay", { enumerable: true, get: function() { return _format_weekday.formatWeekdayAndDay } }); Object.defineProperty(exports, "getAppointmentKey", { enumerable: true, get: function() { return _base.getAppointmentKey } }); Object.defineProperty(exports, "getAppointmentRenderingStrategyName", { enumerable: true, get: function() { return _base.getAppointmentRenderingStrategyName } }); Object.defineProperty(exports, "getAppointmentTakesAllDay", { enumerable: true, get: function() { return _base.getAppointmentTakesAllDay } }); Object.defineProperty(exports, "getCalculatedFirstDayOfWeek", { enumerable: true, get: function() { return _base.getCalculatedFirstDayOfWeek } }); Object.defineProperty(exports, "getCellDuration", { enumerable: true, get: function() { return _base.getCellDuration } }); Object.defineProperty(exports, "getDatesWithoutTime", { enumerable: true, get: function() { return _base.getDatesWithoutTime } }); Object.defineProperty(exports, "getDisplayedCellCount", { enumerable: true, get: function() { return _base.getDisplayedCellCount } }); Object.defineProperty(exports, "getDisplayedRowCount", { enumerable: true, get: function() { return _base.getDisplayedRowCount } }); Object.defineProperty(exports, "getGroupCount", { enumerable: true, get: function() { return _base.getGroupCount } }); Object.defineProperty(exports, "getGroupPanelData", { enumerable: true, get: function() { return _base.getGroupPanelData } }); Object.defineProperty(exports, "getHeaderCellText", { enumerable: true, get: function() { return _base.getHeaderCellText } }); Object.defineProperty(exports, "getHorizontalGroupCount", { enumerable: true, get: function() { return _base.getHorizontalGroupCount } }); Object.defineProperty(exports, "getIsGroupedAllDayPanel", { enumerable: true, get: function() { return _base.getIsGroupedAllDayPanel } }); Object.defineProperty(exports, "getKeyByGroup", { enumerable: true, get: function() { return _base.getKeyByGroup } }); Object.defineProperty(exports, "getOverflowIndicatorColor", { enumerable: true, get: function() { return _base.getOverflowIndicatorColor } }); Object.defineProperty(exports, "getPreparedDataItems", { enumerable: true, get: function() { return _data.getPreparedDataItems } }); Object.defineProperty(exports, "getSkippedHoursInRange", { enumerable: true, get: function() { return _base.getSkippedHoursInRange } }); Object.defineProperty(exports, "getStartViewDateTimeOffset", { enumerable: true, get: function() { return _base.getStartViewDateTimeOffset } }); Object.defineProperty(exports, "getStartViewDateWithoutDST", { enumerable: true, get: function() { return _base.getStartViewDateWithoutDST } }); Object.defineProperty(exports, "getToday", { enumerable: true, get: function() { return _base.getToday } }); Object.defineProperty(exports, "getTotalCellCountByCompleteData", { enumerable: true, get: function() { return _base.getTotalCellCountByCompleteData } }); Object.defineProperty(exports, "getTotalRowCountByCompleteData", { enumerable: true, get: function() { return _base.getTotalRowCountByCompleteData } }); Object.defineProperty(exports, "getValidCellDateForLocalTimeFormat", { enumerable: true, get: function() { return _base.getValidCellDateForLocalTimeFormat } }); Object.defineProperty(exports, "getVerticalGroupCountClass", { enumerable: true, get: function() { return _base.getVerticalGroupCountClass } }); Object.defineProperty(exports, "getViewStartByOptions", { enumerable: true, get: function() { return _base.getViewStartByOptions } }); Object.defineProperty(exports, "getWeekendsCount", { enumerable: true, get: function() { return _base.getWeekendsCount } }); Object.defineProperty(exports, "hasResourceValue", { enumerable: true, get: function() { return _base.hasResourceValue } }); Object.defineProperty(exports, "isDataOnWeekend", { enumerable: true, get: function() { return _base.isDataOnWeekend } }); Object.defineProperty(exports, "isDateAndTimeView", { enumerable: true, get: function() { return _base.isDateAndTimeView } }); Object.defineProperty(exports, "isDateInRange", { enumerable: true, get: function() { return _base.isDateInRange } }); Object.defineProperty(exports, "isFirstCellInMonthWithIntervalCount", { enumerable: true, get: function() { return _base.isFirstCellInMonthWithIntervalCount } }); Object.defineProperty(exports, "isGroupingByDate", { enumerable: true, get: function() { return _base.isGroupingByDate } }); Object.defineProperty(exports, "isHorizontalGroupingApplied", { enumerable: true, get: function() { return _base.isHorizontalGroupingApplied } }); Object.defineProperty(exports, "isHorizontalView", { enumerable: true, get: function() { return _base.isHorizontalView } }); Object.defineProperty(exports, "isTimelineView", { enumerable: true, get: function() { return _base.isTimelineView } }); Object.defineProperty(exports, "isVerticalGroupingApplied", { enumerable: true, get: function() { return _base.isVerticalGroupingApplied } }); exports.renderUtils = exports.monthUtils = void 0; Object.defineProperty(exports, "setOptionHour", { enumerable: true, get: function() { return _base.setOptionHour } }); Object.defineProperty(exports, "splitNumber", { enumerable: true, get: function() { return _base.splitNumber } }); exports.workWeekUtils = exports.weekUtils = exports.viewsUtils = exports.timelineWeekUtils = exports.timelineMonthUtils = exports.themeUtils = void 0; var _themes = __webpack_require__( /*! ../../../scheduler/r1/utils/themes */ 52821); var _agenda = __webpack_require__( /*! ./agenda */ 49372); var _day = __webpack_require__( /*! ./day */ 44246); var _month = __webpack_require__( /*! ./month */ 6076); var _render = __webpack_require__( /*! ./render */ 52183); var _timeline_month = __webpack_require__( /*! ./timeline_month */ 28413); var _timeline_week = __webpack_require__( /*! ./timeline_week */ 15311); var _views = __webpack_require__( /*! ./views */ 62556); var _week = __webpack_require__( /*! ./week */ 47085); var _work_week = __webpack_require__( /*! ./work_week */ 92637); var _base = __webpack_require__( /*! ./base */ 33053); var _data = __webpack_require__( /*! ./data */ 60961); var _exclude_from_recurrence = __webpack_require__( /*! ./exclude_from_recurrence */ 33597); var _format_weekday = __webpack_require__( /*! ./format_weekday */ 29927); exports.agendaUtils = { calculateStartViewDate: _agenda.calculateStartViewDate }; exports.dayUtils = { calculateStartViewDate: _day.calculateStartViewDate }; exports.weekUtils = { getIntervalDuration: _week.getIntervalDuration, getTimePanelCellText: _week.getTimePanelCellText, calculateStartViewDate: _week.calculateStartViewDate, calculateViewStartDate: _week.calculateViewStartDate }; exports.workWeekUtils = { calculateStartViewDate: _work_week.calculateStartViewDate }; exports.monthUtils = { getViewStartByOptions: _month.getViewStartByOptions, getCellText: _month.getCellText, calculateCellIndex: _month.calculateCellIndex, calculateStartViewDate: _month.calculateStartViewDate }; exports.timelineWeekUtils = { getDateForHeaderText: _timeline_week.getDateForHeaderText }; exports.timelineMonthUtils = { calculateStartViewDate: _timeline_month.calculateStartViewDate }; exports.viewsUtils = { getCurrentView: _views.getCurrentView }; exports.renderUtils = { addToStyles: _render.addToStyles, addWidthToStyle: _render.addWidthToStyle, addHeightToStyle: _render.addHeightToStyle, getGroupCellClasses: _render.getGroupCellClasses, combineClasses: _render.combineClasses, getCellSizeHorizontalClass: _render.getCellSizeHorizontalClass, getCellSizeVerticalClass: _render.getCellSizeVerticalClass }; exports.themeUtils = { getThemeType: _themes.getThemeType } }, 6076: /*!************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/utils/month.js ***! \************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.getViewStartByOptions = exports.getCellText = exports.calculateStartViewDate = exports.calculateCellIndex = void 0; var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198)); var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/date */ 91500)); var _base = __webpack_require__( /*! ./base */ 33053); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } exports.calculateCellIndex = (rowIndex, columnIndex, _, columnCount) => rowIndex * columnCount + columnIndex; const getViewStartByOptions = (startDate, currentDate, intervalCount, startViewDate) => { if (!startDate) { return new Date(currentDate) } let currentStartDate = new Date(startViewDate); const validStartViewDate = new Date(startViewDate); const diff = currentStartDate.getTime() <= currentDate.getTime() ? 1 : -1; let endDate = new Date(new Date(validStartViewDate.setMonth(validStartViewDate.getMonth() + diff * intervalCount))); while (!(0, _base.isDateInRange)(currentDate, currentStartDate, endDate, diff)) { currentStartDate = new Date(endDate); if (diff > 0) { currentStartDate.setDate(1) } endDate = new Date(new Date(endDate.setMonth(endDate.getMonth() + diff * intervalCount))) } return diff > 0 ? currentStartDate : endDate }; exports.getViewStartByOptions = getViewStartByOptions; exports.getCellText = (date, intervalCount) => { if ((0, _base.isFirstCellInMonthWithIntervalCount)(date, intervalCount)) { const monthName = _date2.default.getMonthNames("abbreviated")[date.getMonth()]; return [monthName, _date2.default.format(date, "day")].join(" ") } return _date2.default.format(date, "dd") }; exports.calculateStartViewDate = (currentDate, startDayHour, startDate, intervalCount, firstDayOfWeekOption) => { const viewStart = getViewStartByOptions(startDate, currentDate, intervalCount, _date.default.getFirstMonthDate(startDate)); const firstMonthDate = _date.default.getFirstMonthDate(viewStart); const firstDayOfWeek = (0, _base.getCalculatedFirstDayOfWeek)(firstDayOfWeekOption); const firstViewDate = _date.default.getFirstWeekDate(firstMonthDate, firstDayOfWeek); return (0, _base.setOptionHour)(firstViewDate, startDayHour) } }, 52183: /*!*************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/utils/render.js ***! \*************************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.getGroupCellClasses = exports.getCellSizeVerticalClass = exports.getCellSizeHorizontalClass = exports.combineClasses = exports.addWidthToStyle = exports.addToStyles = exports.addHeightToStyle = void 0; function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const addToStyles = (options, style) => { const nextStyle = style ?? {}; const result = _extends({}, nextStyle); options.forEach((_ref => { let { attr: attr, value: value } = _ref; result[attr] = value || nextStyle[attr] })); return result }; exports.addToStyles = addToStyles; exports.addWidthToStyle = (value, style) => { const width = value ? `${value}px` : ""; return addToStyles([{ attr: "width", value: width }], style) }; exports.addHeightToStyle = (value, style) => { const height = value ? `${value}px` : ""; return addToStyles([{ attr: "height", value: height }], style) }; const combineClasses = classesMap => Object.keys(classesMap).filter((cssClass => !!cssClass && classesMap[cssClass])).join(" "); exports.combineClasses = combineClasses; exports.getGroupCellClasses = function() { let isFirstGroupCell = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : false; let isLastGroupCell = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : false; let className = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : ""; return combineClasses({ "dx-scheduler-first-group-cell": isFirstGroupCell, "dx-scheduler-last-group-cell": isLastGroupCell, [className]: true }) }; exports.getCellSizeHorizontalClass = (viewType, crossScrollingEnabled) => { switch (viewType) { case "day": case "week": case "workWeek": case "month": return crossScrollingEnabled ? "dx-scheduler-cell-sizes-horizontal" : ""; default: return "dx-scheduler-cell-sizes-horizontal" } }; exports.getCellSizeVerticalClass = isAllDayCell => !isAllDayCell ? "dx-scheduler-cell-sizes-vertical" : "" }, 52821: /*!*************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/utils/themes.js ***! \*************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.getThemeType = void 0; var _themes = __webpack_require__( /*! ../../../../ui/themes */ 75811); exports.getThemeType = () => { const theme = (0, _themes.current)(); return { isCompact: (0, _themes.isCompact)(theme), isMaterial: (0, _themes.isMaterial)(theme), isFluent: (0, _themes.isFluent)(theme), isMaterialBased: (0, _themes.isMaterialBased)(theme) } } }, 28413: /*!*********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/utils/timeline_month.js ***! \*********************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.calculateStartViewDate = void 0; var _date = (obj = __webpack_require__( /*! ../../../../core/utils/date */ 91198), obj && obj.__esModule ? obj : { default: obj }); var obj; var _base = __webpack_require__( /*! ./base */ 33053); var _month = __webpack_require__( /*! ./month */ 6076); exports.calculateStartViewDate = (currentDate, startDayHour, startDate, intervalCount) => { const firstViewDate = _date.default.getFirstMonthDate((0, _month.getViewStartByOptions)(startDate, currentDate, intervalCount, _date.default.getFirstMonthDate(startDate))); return (0, _base.setOptionHour)(firstViewDate, startDayHour) } }, 15311: /*!********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/utils/timeline_week.js ***! \********************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.getDateForHeaderText = void 0; var _base = __webpack_require__( /*! ./base */ 33053); exports.getDateForHeaderText = (index, date, _ref) => { let { startDayHour: startDayHour, startViewDate: startViewDate, cellCountInDay: cellCountInDay, interval: interval, viewOffset: viewOffset } = _ref; return (0, _base.getValidCellDateForLocalTimeFormat)(date, { startViewDate: startViewDate, startDayHour: startDayHour, cellIndexShift: index % cellCountInDay * interval, viewOffset: viewOffset }) } }, 62556: /*!************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/utils/views.js ***! \************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.getCurrentView = void 0; var _type = __webpack_require__( /*! ../../../../core/utils/type */ 35922); var _const = __webpack_require__( /*! ../const */ 4907); exports.getCurrentView = (currentView, views) => { let currentViewProps = views.find((view => { const names = (0, _type.isObject)(view) ? [view.name, view.type] : [view]; if (names.includes(currentView)) { return true } return false })); if (void 0 === currentViewProps) { if (_const.VIEW_TYPES.includes(currentView)) { currentViewProps = currentView } else { [currentViewProps] = views } } return currentViewProps } }, 47085: /*!***********************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/utils/week.js ***! \***********************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.getValidStartDate = exports.getTimePanelCellText = exports.getIntervalDuration = exports.calculateViewStartDate = exports.calculateStartViewDate = void 0; var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198)); var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/date */ 91500)); var _base = __webpack_require__( /*! ./base */ 33053); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } exports.getTimePanelCellText = (rowIndex, date, startViewDate, cellDuration, startDayHour, viewOffset) => { if (rowIndex % 2 !== 0) { return "" } const validTimeDate = (0, _base.getValidCellDateForLocalTimeFormat)(date, { startViewDate: startViewDate, startDayHour: startDayHour, cellIndexShift: Math.round(cellDuration) * rowIndex, viewOffset: viewOffset }); return _date2.default.format(validTimeDate, "shorttime") }; exports.getIntervalDuration = intervalCount => 7 * _date.default.dateToMilliseconds("day") * intervalCount; const getValidStartDate = (startDate, firstDayOfWeek) => startDate ? _date.default.getFirstWeekDate(startDate, firstDayOfWeek) : void 0; exports.getValidStartDate = getValidStartDate; exports.calculateStartViewDate = (currentDate, startDayHour, startDate, intervalDuration, firstDayOfWeekOption) => { const firstDayOfWeek = (0, _base.getCalculatedFirstDayOfWeek)(firstDayOfWeekOption); const viewStart = (0, _base.getViewStartByOptions)(startDate, currentDate, intervalDuration, getValidStartDate(startDate, firstDayOfWeek)); const firstViewDate = _date.default.getFirstWeekDate(viewStart, firstDayOfWeek); return (0, _base.setOptionHour)(firstViewDate, startDayHour) }; exports.calculateViewStartDate = (startDateOption, firstDayOfWeek) => { const validFirstDayOfWeek = firstDayOfWeek ?? _date2.default.firstDayOfWeekIndex(); return _date.default.getFirstWeekDate(startDateOption, validFirstDayOfWeek) } }, 92637: /*!****************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/r1/utils/work_week.js ***! \****************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.calculateStartViewDate = void 0; var _date = (obj = __webpack_require__( /*! ../../../../core/utils/date */ 91198), obj && obj.__esModule ? obj : { default: obj }); var obj; var _base = __webpack_require__( /*! ./base */ 33053); var _week = __webpack_require__( /*! ./week */ 47085); exports.calculateStartViewDate = (currentDate, startDayHour, startDate, intervalDuration, firstDayOfWeek) => { const viewStart = (0, _base.getViewStartByOptions)(startDate, currentDate, intervalDuration, (0, _week.getValidStartDate)(startDate, firstDayOfWeek)); const firstViewDate = _date.default.getFirstWeekDate(viewStart, firstDayOfWeek); if ((0, _base.isDataOnWeekend)(firstViewDate)) { const currentDay = firstViewDate.getDay(); const distance = (8 - currentDay) % 7; firstViewDate.setDate(firstViewDate.getDate() + distance) } return (0, _base.setOptionHour)(firstViewDate, startDayHour) } }, 547: /*!***********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/resources/m_agenda_resource_processor.js ***! \***********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.AgendaResourceProcessor = void 0; var _array = __webpack_require__( /*! ../../../core/utils/array */ 89386); var _deferred = __webpack_require__( /*! ../../../core/utils/deferred */ 62754); var _m_utils = __webpack_require__( /*! ./m_utils */ 31359); class PromiseItem { constructor(rawAppointment, promise) { this.rawAppointment = rawAppointment; this.promise = promise } } exports.AgendaResourceProcessor = class { get resourceDeclarations() { return this._resourceDeclarations } set resourceDeclarations(value) { this._resourceDeclarations = value; this.isLoaded = false; this.isLoading = false; this.resourceMap.clear(); this.appointmentPromiseQueue = [] } constructor() { let resourceDeclarations = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : []; this._resourceDeclarations = resourceDeclarations; this.isLoaded = false; this.isLoading = false; this.resourceMap = new Map; this.appointmentPromiseQueue = [] } _pushAllResources() { this.appointmentPromiseQueue.forEach((_ref => { let { promise: promise, rawAppointment: rawAppointment } = _ref; const result = []; this.resourceMap.forEach(((resource, fieldName) => { const item = { label: resource.label, values: [] }; if (fieldName in rawAppointment) { (0, _array.wrapToArray)(rawAppointment[fieldName]).forEach((value => item.values.push(resource.map.get(value)))) } if (item.values.length) { result.push(item) } })); promise.resolve(result) })); this.appointmentPromiseQueue = [] } _onPullResource(fieldName, valueName, displayName, label, items) { const map = new Map; items.forEach((item => map.set(item[valueName], item[displayName]))); this.resourceMap.set(fieldName, { label: label, map: map }) } _hasResourceDeclarations(resources) { if (0 === resources.length) { this.appointmentPromiseQueue.forEach((_ref2 => { let { promise: promise } = _ref2; return promise.resolve([]) })); this.appointmentPromiseQueue = []; return false } return true } _tryPullResources(resources, resultAsync) { if (!this.isLoading) { this.isLoading = true; const promises = []; resources.forEach((resource => { const promise = (new _deferred.Deferred).done((items => this._onPullResource((0, _m_utils.getFieldExpr)(resource), (0, _m_utils.getValueExpr)(resource), (0, _m_utils.getDisplayExpr)(resource), resource.label, items))); promises.push(promise); const dataSource = (0, _m_utils.getWrappedDataSource)(resource.dataSource); if (dataSource.isLoaded()) { promise.resolve(dataSource.items()) } else { dataSource.load().done((list => promise.resolve(list))).fail((() => promise.reject())) } })); _deferred.when.apply(null, promises).done((() => { this.isLoaded = true; this.isLoading = false; this._pushAllResources() })).fail((() => resultAsync.reject())) } } initializeState() { let resourceDeclarations = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : []; this.resourceDeclarations = resourceDeclarations } createListAsync(rawAppointment) { const resultAsync = new _deferred.Deferred; this.appointmentPromiseQueue.push(new PromiseItem(rawAppointment, resultAsync)); if (this._hasResourceDeclarations(this.resourceDeclarations)) { if (this.isLoaded) { this._pushAllResources() } else { this._tryPullResources(this.resourceDeclarations, resultAsync) } } return resultAsync.promise() } } }, 31359: /*!***************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/resources/m_utils.js ***! \***************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.setResourceToAppointment = exports.reduceResourcesTree = exports.loadResources = exports.isResourceMultiple = exports.groupAppointmentsByResourcesCore = exports.groupAppointmentsByResources = exports.getWrappedDataSource = exports.getValueExpr = exports.getResourcesDataByGroups = exports.getResourceTreeLeaves = exports.getResourceColor = exports.getResourceByField = exports.getPathToLeaf = exports.getPaintedResources = exports.getOrLoadResourceItem = exports.getNormalizedResources = exports.getGroupsObjectFromGroupsArray = exports.getFieldExpr = exports.getDisplayExpr = exports.getDataAccessors = exports.getCellGroups = exports.getAppointmentColor = exports.getAllGroups = exports.filterResources = exports.createResourcesTree = exports.createResourceEditorModel = exports.createReducedResourcesTree = exports.createExpressions = void 0; var _array = __webpack_require__( /*! ../../../core/utils/array */ 89386); var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576); var _data = __webpack_require__( /*! ../../../core/utils/data */ 47617); var _deferred = __webpack_require__( /*! ../../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 95479); var _object = __webpack_require__( /*! ../../../core/utils/object */ 48013); var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922); var _data_source = __webpack_require__( /*! ../../../data/data_source/data_source */ 85273); var _utils = __webpack_require__( /*! ../../../data/data_source/utils */ 9234); var _themes = __webpack_require__( /*! ../../../ui/themes */ 75811); var _index = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084); function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const getValueExpr = resource => resource.valueExpr || "id"; exports.getValueExpr = getValueExpr; const getDisplayExpr = resource => resource.displayExpr || "text"; exports.getDisplayExpr = getDisplayExpr; const getFieldExpr = resource => resource.fieldExpr || resource.field; exports.getFieldExpr = getFieldExpr; const getWrappedDataSource = dataSource => { if (dataSource instanceof _data_source.DataSource) { return dataSource } const result = _extends({}, (0, _utils.normalizeDataSourceOptions)(dataSource), { pageSize: 0 }); if (!Array.isArray(dataSource)) { result.filter = dataSource.filter } return new _data_source.DataSource(result) }; exports.getWrappedDataSource = getWrappedDataSource; const createResourcesTree = groups => { let leafIndex = 0; const make = (group, groupIndex, result, parent) => { result = result || []; for (let itemIndex = 0; itemIndex < group.items.length; itemIndex++) { var _group$data; const currentGroupItem = group.items[itemIndex]; const resultItem = { name: group.name, value: currentGroupItem.id, title: currentGroupItem.text, data: null === (_group$data = group.data) || void 0 === _group$data ? void 0 : _group$data[itemIndex], children: [], parent: parent || null }; const nextGroupIndex = groupIndex + 1; if (groups[nextGroupIndex]) { make(groups[nextGroupIndex], nextGroupIndex, resultItem.children, resultItem) } if (!resultItem.children.length) { resultItem.leafIndex = leafIndex; leafIndex++ } result.push(resultItem) } return result }; return make(groups[0], 0) }; exports.createResourcesTree = createResourcesTree; const getPathToLeaf = (leafIndex, groups) => { const tree = createResourcesTree(groups); const findLeafByIndex = (data, index) => { for (let i = 0; i < data.length; i++) { if (data[i].leafIndex === index) { return data[i] } const leaf = findLeafByIndex(data[i].children, index); if (leaf) { return leaf } } }; const makeBranch = (leaf, result) => { result = result || []; result.push(leaf.value); if (leaf.parent) { makeBranch(leaf.parent, result) } return result }; const leaf = findLeafByIndex(tree, leafIndex); return makeBranch(leaf).reverse() }; exports.getPathToLeaf = getPathToLeaf; const getCellGroups = (groupIndex, groups) => { const result = []; if ((0, _index.getGroupCount)(groups)) { if (groupIndex < 0) { return } const path = getPathToLeaf(groupIndex, groups); for (let i = 0; i < groups.length; i++) { result.push({ name: groups[i].name, id: path[i] }) } } return result }; exports.getCellGroups = getCellGroups; const getGroupsObjectFromGroupsArray = groupsArray => groupsArray.reduce(((currentGroups, _ref) => { let { name: name, id: id } = _ref; return _extends({}, currentGroups, { [name]: id }) }), {}); exports.getGroupsObjectFromGroupsArray = getGroupsObjectFromGroupsArray; exports.getAllGroups = groups => { const groupCount = (0, _index.getGroupCount)(groups); return [...new Array(groupCount)].map(((_, groupIndex) => { const groupsArray = getCellGroups(groupIndex, groups); return getGroupsObjectFromGroupsArray(groupsArray) })) }; const getResourceByField = (fieldName, loadedResources) => { for (let i = 0; i < loadedResources.length; i++) { const resource = loadedResources[i]; if (resource.name === fieldName) { return resource.data } } return [] }; exports.getResourceByField = getResourceByField; exports.createResourceEditorModel = (resources, loadedResources) => resources.map((resource => { const dataField = getFieldExpr(resource); const dataSource = getResourceByField(dataField, loadedResources); return { editorOptions: { dataSource: dataSource.length ? dataSource : getWrappedDataSource(resource.dataSource), displayExpr: getDisplayExpr(resource), valueExpr: getValueExpr(resource), stylingMode: (0, _themes.isFluent)((0, _themes.current)()) ? "filled" : "outlined" }, dataField: dataField, editorType: resource.allowMultiple ? "dxTagBox" : "dxSelectBox", label: { text: resource.label || dataField } } })); const isResourceMultiple = (resources, resourceField) => { const resource = resources.find((resource => { const field = getFieldExpr(resource); return field === resourceField })); return !!(null !== resource && void 0 !== resource && resource.allowMultiple) }; exports.isResourceMultiple = isResourceMultiple; const filterResources = (resources, fields) => resources.filter((resource => { const field = getFieldExpr(resource); return fields.indexOf(field) > -1 })); exports.filterResources = filterResources; const getPaintedResources = (resources, groups) => { const newGroups = groups || []; const result = resources.find((resource => resource.useColorAsDefault)); if (result) { return result } const newResources = newGroups.length ? filterResources(resources, newGroups) : resources; return newResources[newResources.length - 1] }; exports.getPaintedResources = getPaintedResources; const getOrLoadResourceItem = (resources, resourceLoaderMap, field, value) => { const result = new _deferred.Deferred; resources.filter((resource => getFieldExpr(resource) === field && (0, _type.isDefined)(resource.dataSource))).forEach((resource => { const wrappedDataSource = getWrappedDataSource(resource.dataSource); const valueExpr = getValueExpr(resource); if (!resourceLoaderMap.has(field)) { resourceLoaderMap.set(field, wrappedDataSource.load()) } resourceLoaderMap.get(field).done((data => { const getter = (0, _data.compileGetter)(valueExpr); const filteredData = data.filter((resource => (0, _common.equalByValue)(getter(resource), value))); result.resolve(filteredData[0]) })).fail((() => { resourceLoaderMap.delete(field); result.reject() })) })); return result.promise() }; exports.getOrLoadResourceItem = getOrLoadResourceItem; const getDataAccessors = (dataAccessors, fieldName, type) => { const actions = dataAccessors[type]; return actions[fieldName] }; exports.getDataAccessors = getDataAccessors; exports.groupAppointmentsByResources = function(config, appointments) { let groups = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : []; let result = { 0: appointments }; if (groups.length && config.loadedResources.length) { result = groupAppointmentsByResourcesCore(config, appointments, config.loadedResources) } let totalResourceCount = 0; config.loadedResources.forEach(((resource, index) => { if (!index) { totalResourceCount = resource.items.length } else { totalResourceCount *= resource.items.length } })); for (let index = 0; index < totalResourceCount; index++) { const key = index.toString(); if (result[key]) { continue } result[key] = [] } return result }; const groupAppointmentsByResourcesCore = (config, appointments, resources) => { const tree = createResourcesTree(resources); const result = {}; appointments.forEach((appointment => { const treeLeaves = getResourceTreeLeaves(((field, action) => getDataAccessors(config.dataAccessors, field, action)), tree, appointment); for (let i = 0; i < treeLeaves.length; i++) { if (!result[treeLeaves[i]]) { result[treeLeaves[i]] = [] } result[treeLeaves[i]].push((0, _object.deepExtendArraySafe)({}, appointment, true)) } })); return result }; exports.groupAppointmentsByResourcesCore = groupAppointmentsByResourcesCore; const getResourceTreeLeaves = (getDataAccessors, tree, rawAppointment, result) => { result = result || []; for (let i = 0; i < tree.length; i++) { if (!hasGroupItem(getDataAccessors, rawAppointment, tree[i].name, tree[i].value)) { continue } if ((0, _type.isDefined)(tree[i].leafIndex)) { result.push(tree[i].leafIndex) } if (tree[i].children) { getResourceTreeLeaves(getDataAccessors, tree[i].children, rawAppointment, result) } } return result }; exports.getResourceTreeLeaves = getResourceTreeLeaves; const hasGroupItem = (getDataAccessors, rawAppointment, groupName, itemValue) => { const resourceValue = getDataAccessors(groupName, "getter")(rawAppointment); return (0, _index.hasResourceValue)((0, _array.wrapToArray)(resourceValue), itemValue) }; exports.createReducedResourcesTree = (loadedResources, getDataAccessors, appointments) => { const tree = createResourcesTree(loadedResources); return reduceResourcesTree(getDataAccessors, tree, appointments) }; const reduceResourcesTree = (getDataAccessors, tree, existingAppointments, _result) => { _result = _result ? _result.children : []; tree.forEach(((node, index) => { let ok = false; const resourceName = node.name; const resourceValue = node.value; const resourceTitle = node.title; const resourceData = node.data; const resourceGetter = getDataAccessors(resourceName, "getter"); existingAppointments.forEach((appointment => { if (!ok) { const resourceFromAppointment = resourceGetter(appointment); if (Array.isArray(resourceFromAppointment)) { if (resourceFromAppointment.includes(resourceValue)) { _result.push({ name: resourceName, value: resourceValue, title: resourceTitle, data: resourceData, children: [] }); ok = true } } else if (resourceFromAppointment === resourceValue) { _result.push({ name: resourceName, value: resourceValue, title: resourceTitle, data: resourceData, children: [] }); ok = true } } })); if (ok && node.children && node.children.length) { reduceResourcesTree(getDataAccessors, node.children, existingAppointments, _result[index]) } })); return _result }; exports.reduceResourcesTree = reduceResourcesTree; exports.getResourcesDataByGroups = (loadedResources, resources, groups) => { if (!groups || !groups.length) { return loadedResources } const fieldNames = {}; const currentResourcesData = []; groups.forEach((group => { (0, _iterator.each)(group, ((name, value) => { fieldNames[name] = value })) })); const resourceData = loadedResources.filter((_ref2 => { let { name: name } = _ref2; return (0, _type.isDefined)(fieldNames[name]) })); resourceData.forEach((data => currentResourcesData.push((0, _extend.extend)({}, data)))); currentResourcesData.forEach((currentResource => { const { items: items, data: data, name: resourceName } = currentResource; const resource = filterResources(resources, [resourceName])[0] || {}; const valueExpr = getValueExpr(resource); const filteredItems = []; const filteredData = []; groups.filter((group => (0, _type.isDefined)(group[resourceName]))).forEach((group => { (0, _iterator.each)(group, ((name, value) => { if (!filteredItems.filter((item => item.id === value && item[valueExpr] === name)).length) { const currentItems = items.filter((item => item.id === value)); const currentData = data.filter((item => item[valueExpr] === value)); filteredItems.push(...currentItems); filteredData.push(...currentData) } })) })); currentResource.items = filteredItems; currentResource.data = filteredData })); return currentResourcesData }; exports.setResourceToAppointment = (resources, dataAccessors, appointment, groups) => { const resourcesSetter = dataAccessors.setter; for (const name in groups) { const resourceData = groups[name]; const value = isResourceMultiple(resources, name) ? (0, _array.wrapToArray)(resourceData) : resourceData; resourcesSetter[name](appointment, value) } }; const getResourceColor = (resources, resourceLoaderMap, field, value) => { const result = new _deferred.Deferred; const resource = filterResources(resources, [field])[0] || {}; const colorExpr = resource.colorExpr || "color"; const colorGetter = (0, _data.compileGetter)(colorExpr); getOrLoadResourceItem(resources, resourceLoaderMap, field, value).done((resource => result.resolve(colorGetter(resource)))).fail((() => result.reject())); return result.promise() }; exports.getResourceColor = getResourceColor; exports.getAppointmentColor = (resourceConfig, appointmentConfig) => { const { resources: resources, dataAccessors: dataAccessors, loadedResources: loadedResources, resourceLoaderMap: resourceLoaderMap } = resourceConfig; const { groupIndex: groupIndex, groups: groups, itemData: itemData } = appointmentConfig; const paintedResources = getPaintedResources(resources || [], groups); if (paintedResources) { const field = getFieldExpr(paintedResources); const cellGroups = getCellGroups(groupIndex, loadedResources); const resourcesDataAccessors = getDataAccessors(dataAccessors, field, "getter"); const resourceValues = (0, _array.wrapToArray)(resourcesDataAccessors(itemData)); let groupId = resourceValues[0]; for (let i = 0; i < cellGroups.length; i++) { if (cellGroups[i].name === field) { groupId = cellGroups[i].id; break } } return getResourceColor(resources, resourceLoaderMap, field, groupId) } return (new _deferred.Deferred).resolve().promise() }; exports.createExpressions = function() { let resources = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : []; const result = { getter: {}, setter: {} }; resources.forEach((resource => { const field = getFieldExpr(resource); result.getter[field] = (0, _data.compileGetter)(field); result.setter[field] = (0, _data.compileSetter)(field) })); return result }; exports.loadResources = (groups, resources, resourceLoaderMap) => { const result = new _deferred.Deferred; const deferreds = []; const newGroups = groups || []; const newResources = resources || []; let loadedResources = []; filterResources(newResources, newGroups).forEach((resource => { const deferred = new _deferred.Deferred; const name = getFieldExpr(resource); deferreds.push(deferred); const dataSourcePromise = getWrappedDataSource(resource.dataSource).load(); resourceLoaderMap.set(name, dataSourcePromise); dataSourcePromise.done((data => { const items = ((resource, data) => { const valueGetter = (0, _data.compileGetter)(getValueExpr(resource)); const displayGetter = (0, _data.compileGetter)(getDisplayExpr(resource)); return data.map((item => { const result = { id: valueGetter(item), text: displayGetter(item) }; if (item.color) { result.color = item.color } return result })) })(resource, data); deferred.resolve({ name: name, items: items, data: data }) })).fail((() => deferred.reject())) })); if (!deferreds.length) { return result.resolve(loadedResources) } _deferred.when.apply(null, deferreds).done((function() { for (var _len = arguments.length, resources = new Array(_len), _key = 0; _key < _len; _key++) { resources[_key] = arguments[_key] } const hasEmpty = resources.some((r => 0 === r.items.length)); loadedResources = hasEmpty ? [] : resources; result.resolve(loadedResources) })).fail((() => result.reject())); return result.promise() }; exports.getNormalizedResources = (rawAppointment, dataAccessors, resources) => { const result = {}; (0, _iterator.each)(dataAccessors.resources.getter, (fieldName => { const value = dataAccessors.resources.getter[fieldName](rawAppointment); if ((0, _type.isDefined)(value)) { const isMultiple = isResourceMultiple(resources, fieldName); const resourceValue = isMultiple ? (0, _array.wrapToArray)(value) : value; result[fieldName] = resourceValue } })); return result } }, 60544: /*!***************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/shaders/m_current_time_shader.js ***! \***************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _renderer = (obj = __webpack_require__( /*! ../../../core/renderer */ 68374), obj && obj.__esModule ? obj : { default: obj }); var obj; exports.default = class { constructor(_workSpace) { this._workSpace = _workSpace; this._$container = this._workSpace._dateTableScrollable.$content() } render() { this.initShaderElements(); this.renderShader(); this._shader.forEach((shader => { this._$container.append(shader) })) } initShaderElements() { this._$shader = this.createShader(); this._shader = []; this._shader.push(this._$shader) } renderShader() {} createShader() { return (0, _renderer.default)("
").addClass("dx-scheduler-date-time-shader") } clean() { this._$container && this._$container.find(".dx-scheduler-date-time-shader").remove() } } }, 65295: /*!**************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/shaders/m_current_time_shader_horizontal.js ***! \**************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _position = __webpack_require__( /*! ../../../core/utils/position */ 37518); var _size = __webpack_require__( /*! ../../../core/utils/size */ 58664); var _m_current_time_shader = (obj = __webpack_require__( /*! ./m_current_time_shader */ 60544), obj && obj.__esModule ? obj : { default: obj }); var obj; class HorizontalCurrentTimeShader extends _m_current_time_shader.default { renderShader() { const groupCount = this._workSpace._isHorizontalGroupedWorkSpace() ? this._workSpace._getGroupCount() : 1; for (let i = 0; i < groupCount; i += 1) { const isFirstShader = 0 === i; const $shader = isFirstShader ? this._$shader : this.createShader(); if (this._workSpace.isGroupedByDate()) { this._customizeGroupedByDateShader($shader, i) } else { this._customizeShader($shader, i) }!isFirstShader && this._shader.push($shader) } } _customizeShader($shader, groupIndex) { const shaderWidth = this._workSpace.getIndicationWidth(); this._applyShaderWidth($shader, shaderWidth); if (groupIndex >= 1) { const workSpace = this._workSpace; const indicationWidth = workSpace._getCellCount() * workSpace.getCellWidth(); $shader.css("left", indicationWidth) } else { $shader.css("left", 0) } } _applyShaderWidth($shader, width) { const maxWidth = (0, _position.getBoundingRect)(this._$container.get(0)).width; if (width > maxWidth) { width = maxWidth } if (width > 0) { (0, _size.setWidth)($shader, width) } } _customizeGroupedByDateShader($shader, groupIndex) { const cellCount = this._workSpace.getIndicationCellCount(); const integerPart = Math.floor(cellCount); const fractionPart = cellCount - integerPart; const isFirstShaderPart = 0 === groupIndex; const workSpace = this._workSpace; const shaderWidth = isFirstShaderPart ? workSpace.getIndicationWidth() : fractionPart * workSpace.getCellWidth(); let shaderLeft; this._applyShaderWidth($shader, shaderWidth); if (isFirstShaderPart) { shaderLeft = workSpace._getCellCount() * workSpace.getCellWidth() * groupIndex } else { shaderLeft = workSpace.getCellWidth() * integerPart * workSpace._getGroupCount() + groupIndex * workSpace.getCellWidth() } $shader.css("left", shaderLeft) } } exports.default = HorizontalCurrentTimeShader }, 11029: /*!************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/shaders/m_current_time_shader_vertical.js ***! \************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374)); var _size = __webpack_require__( /*! ../../../core/utils/size */ 58664); var _m_current_time_shader = _interopRequireDefault(__webpack_require__( /*! ./m_current_time_shader */ 60544)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } class VerticalCurrentTimeShader extends _m_current_time_shader.default { renderShader() { let shaderHeight = this._getShaderHeight(); const maxHeight = this._getShaderMaxHeight(); const isSolidShader = shaderHeight > maxHeight; if (shaderHeight > maxHeight) { shaderHeight = maxHeight }(0, _size.setHeight)(this._$shader, shaderHeight); const groupCount = this._workSpace._getGroupCount() || 1; if (this._workSpace.isGroupedByDate()) { this._renderGroupedByDateShaderParts(groupCount, shaderHeight, maxHeight, isSolidShader) } else { this._renderShaderParts(groupCount, shaderHeight, maxHeight, isSolidShader) } } _renderShaderParts(groupCount, shaderHeight, maxHeight, isSolidShader) { for (let i = 0; i < groupCount; i++) { const shaderWidth = this._getShaderWidth(i); this._renderTopShader(this._$shader, shaderHeight, shaderWidth, i); !isSolidShader && this._renderBottomShader(this._$shader, maxHeight, shaderHeight, shaderWidth, i); this._renderAllDayShader(shaderWidth, i) } } _renderGroupedByDateShaderParts(groupCount, shaderHeight, maxHeight, isSolidShader) { const shaderWidth = this._getShaderWidth(0); let bottomShaderWidth = shaderWidth - this._workSpace.getCellWidth(); if (shaderHeight < 0) { shaderHeight = 0; bottomShaderWidth = shaderWidth } this._renderTopShader(this._$shader, shaderHeight, shaderWidth * groupCount, 0); !isSolidShader && this._renderBottomShader(this._$shader, maxHeight, shaderHeight, bottomShaderWidth * groupCount + this._workSpace.getCellWidth(), 0); this._renderAllDayShader(shaderWidth * groupCount, 0) } _renderTopShader($shader, height, width, i) { this._$topShader = (0, _renderer.default)("
").addClass("dx-scheduler-date-time-shader-top"); if (width) { (0, _size.setWidth)(this._$topShader, width) } if (height) { (0, _size.setHeight)(this._$topShader, height) } this._$topShader.css("marginTop", this._getShaderTopOffset(i)); this._$topShader.css("left", this._getShaderOffset(i, width)); $shader.append(this._$topShader) } _renderBottomShader($shader, maxHeight, height, width, i) { this._$bottomShader = (0, _renderer.default)("
").addClass("dx-scheduler-date-time-shader-bottom"); const shaderWidth = height < 0 ? width : width - this._workSpace.getCellWidth(); const shaderHeight = height < 0 ? maxHeight : maxHeight - height; (0, _size.setWidth)(this._$bottomShader, shaderWidth); (0, _size.setHeight)(this._$bottomShader, shaderHeight); this._$bottomShader.css("left", this._getShaderOffset(i, width - this._workSpace.getCellWidth())); $shader.append(this._$bottomShader) } _renderAllDayShader(shaderWidth, i) { if (this._workSpace.option("showAllDayPanel")) { this._$allDayIndicator = (0, _renderer.default)("
").addClass("dx-scheduler-date-time-shader-all-day"); (0, _size.setHeight)(this._$allDayIndicator, this._workSpace.getAllDayHeight()); (0, _size.setWidth)(this._$allDayIndicator, shaderWidth); this._$allDayIndicator.css("left", this._getShaderOffset(i, shaderWidth)); this._workSpace._$allDayPanel.prepend(this._$allDayIndicator) } } _getShaderOffset(i, width) { return this._workSpace.getGroupedStrategy().getShaderOffset(i, width) } _getShaderTopOffset(i) { return this._workSpace.getGroupedStrategy().getShaderTopOffset(i) } _getShaderHeight() { return this._workSpace.getGroupedStrategy().getShaderHeight() } _getShaderMaxHeight() { return this._workSpace.getGroupedStrategy().getShaderMaxHeight() } _getShaderWidth(i) { return this._workSpace.getGroupedStrategy().getShaderWidth(i) } clean() { super.clean(); this._workSpace && this._workSpace._$allDayPanel && this._workSpace._$allDayPanel.find(".dx-scheduler-date-time-shader-all-day").remove() } } exports.default = VerticalCurrentTimeShader }, 23778: /*!******************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/timezones/m_utils_timezones_data.js ***! \******************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _math = __webpack_require__( /*! ../../../core/utils/math */ 60810); var _config = (obj = __webpack_require__( /*! ../../../core/config */ 80209), obj && obj.__esModule ? obj : { default: obj }); var obj; const parseTimezone = timeZoneConfig => { const { offsets: offsets } = timeZoneConfig; const { offsetIndices: offsetIndices } = timeZoneConfig; const { untils: untils } = timeZoneConfig; const offsetList = offsets.split("|").map((value => parseInt(value))); const offsetIndexList = offsetIndices.split("").map((value => parseInt(value))); const dateList = (value = untils, value.split("|").map((until => { if ("Infinity" === until) { return null } return 1e3 * parseInt(until, 36) }))).map((accumulator = 0, value => accumulator += value)); var accumulator; var value; return { offsetList: offsetList, offsetIndexList: offsetIndexList, dateList: dateList } }; const tzCache = new class { constructor() { this.map = new Map } tryGet(id) { if (!this.map.get(id)) { const config = timeZoneDataUtils.getTimezoneById(id); if (!config) { return false } const timeZoneInfo = parseTimezone(config); this.map.set(id, timeZoneInfo) } return this.map.get(id) } }; const timeZoneDataUtils = { _tzCache: tzCache, getTimeZonesOld: () => (0, _config.default)().timezones ?? [], formatOffset(offset) { const hours = Math.floor(offset); const minutesInDecimal = offset - hours; const signString = (0, _math.sign)(offset) >= 0 ? "+" : "-"; const hoursString = `0${Math.abs(hours)}`.slice(-2); const minutesString = minutesInDecimal > 0 ? ":" + 60 * minutesInDecimal : ":00"; return signString + hoursString + minutesString }, formatId: id => id.split("/").join(" - ").split("_").join(" "), getTimezoneById(id) { if (!id) { return } const tzList = this.getTimeZonesOld(); for (let i = 0; i < tzList.length; i++) { const currentId = tzList[i].id; if (currentId === id) { return tzList[i] } } return }, getTimeZoneOffsetById(id, timestamp) { const timeZoneInfo = tzCache.tryGet(id); return timeZoneInfo ? this.getUtcOffset(timeZoneInfo, timestamp) : void 0 }, getTimeZoneDeclarationTuple(id, year) { const timeZoneInfo = tzCache.tryGet(id); return timeZoneInfo ? this.getTimeZoneDeclarationTupleCore(timeZoneInfo, year) : [] }, getTimeZoneDeclarationTupleCore(timeZoneInfo, year) { const { offsetList: offsetList } = timeZoneInfo; const { offsetIndexList: offsetIndexList } = timeZoneInfo; const { dateList: dateList } = timeZoneInfo; const tupleResult = []; for (let i = 0; i < dateList.length; i++) { const currentDate = dateList[i]; const currentYear = new Date(currentDate).getFullYear(); if (currentYear === year) { const offset = offsetList[offsetIndexList[i + 1]]; tupleResult.push({ date: currentDate, offset: -offset / 60 }) } if (currentYear > year) { break } } return tupleResult }, getUtcOffset(timeZoneInfo, dateTimeStamp) { const { offsetList: offsetList } = timeZoneInfo; const { offsetIndexList: offsetIndexList } = timeZoneInfo; const { dateList: dateList } = timeZoneInfo; const lastIntervalStartIndex = dateList.length - 1 - 1; let index = lastIntervalStartIndex; while (index >= 0 && dateTimeStamp < dateList[index]) { index-- } const offset = offsetList[offsetIndexList[index + 1]]; return -offset / 60 || offset } }; exports.default = timeZoneDataUtils }, 99740: /*!*********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/timezones/timezone_list.js ***! \*********************************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; exports.default = { value: ["Etc/GMT+12", "Etc/GMT+11", "Pacific/Midway", "Pacific/Niue", "Pacific/Pago_Pago", "Pacific/Samoa", "US/Samoa", "Etc/GMT+10", "HST", "Pacific/Honolulu", "Pacific/Johnston", "Pacific/Rarotonga", "Pacific/Tahiti", "US/Hawaii", "Pacific/Marquesas", "America/Adak", "America/Atka", "Etc/GMT+9", "Pacific/Gambier", "US/Aleutian", "America/Anchorage", "America/Juneau", "America/Metlakatla", "America/Nome", "America/Sitka", "America/Yakutat", "Etc/GMT+8", "Pacific/Pitcairn", "US/Alaska", "America/Creston", "America/Dawson_Creek", "America/Dawson", "America/Ensenada", "America/Fort_Nelson", "America/Hermosillo", "America/Los_Angeles", "America/Phoenix", "America/Santa_Isabel", "America/Tijuana", "America/Vancouver", "America/Whitehorse", "Canada/Pacific", "Canada/Yukon", "Etc/GMT+7", "Mexico/BajaNorte", "MST", "PST8PDT", "US/Arizona", "US/Pacific", "America/Belize", "America/Boise", "America/Cambridge_Bay", "America/Chihuahua", "America/Costa_Rica", "America/Denver", "America/Edmonton", "America/El_Salvador", "America/Guatemala", "America/Inuvik", "America/Managua", "America/Mazatlan", "America/Monterrey", "America/Ojinaga", "America/Regina", "America/Shiprock", "America/Swift_Current", "America/Tegucigalpa", "America/Yellowknife", "Canada/Mountain", "Canada/Saskatchewan", "Chile/EasterIsland", "Etc/GMT+6", "Mexico/BajaSur", "MST7MDT", "Navajo", "Pacific/Easter", "Pacific/Galapagos", "US/Mountain", "America/Atikokan", "America/Bahia_Banderas", "America/Bogota", "America/Cancun", "America/Cayman", "America/Chicago", "America/Coral_Harbour", "America/Eirunepe", "America/Guayaquil", "America/Indiana/Knox", "America/Indiana/Tell_City", "America/Jamaica", "America/Knox_IN", "America/Lima", "America/Matamoros", "America/Menominee", "America/Merida", "America/Mexico_City", "America/North_Dakota/Beulah", "America/North_Dakota/Center", "America/North_Dakota/New_Salem", "America/Panama", "America/Porto_Acre", "America/Rainy_River", "America/Rankin_Inlet", "America/Resolute", "America/Rio_Branco", "America/Winnipeg", "Brazil/Acre", "Canada/Central", "CST6CDT", "EST", "Etc/GMT+5", "Jamaica", "Mexico/General", "US/Central", "US/Indiana-Starke", "America/Anguilla", "America/Antigua", "America/Aruba", "America/Asuncion", "America/Barbados", "America/Blanc-Sablon", "America/Boa_Vista", "America/Campo_Grande", "America/Caracas", "America/Cuiaba", "America/Curacao", "America/Detroit", "America/Dominica", "America/Fort_Wayne", "America/Grand_Turk", "America/Grenada", "America/Guadeloupe", "America/Guyana", "America/Havana", "America/Indiana/Indianapolis", "America/Indiana/Marengo", "America/Indiana/Petersburg", "America/Indiana/Vevay", "America/Indiana/Vincennes", "America/Indiana/Winamac", "America/Indianapolis", "America/Iqaluit", "America/Kentucky/Louisville", "America/Kentucky/Monticello", "America/Kralendijk", "America/La_Paz", "America/Louisville", "America/Lower_Princes", "America/Manaus", "America/Marigot", "America/Martinique", "America/Montreal", "America/Montserrat", "America/Nassau", "America/New_York", "America/Nipigon", "America/Pangnirtung", "America/Port_of_Spain", "America/Port-au-Prince", "America/Porto_Velho", "America/Puerto_Rico", "America/Santiago", "America/Santo_Domingo", "America/St_Barthelemy", "America/St_Kitts", "America/St_Lucia", "America/St_Thomas", "America/St_Vincent", "America/Thunder_Bay", "America/Toronto", "America/Tortola", "America/Virgin", "Brazil/West", "Canada/Eastern", "Chile/Continental", "Cuba", "EST5EDT", "Etc/GMT+4", "US/East-Indiana", "US/Eastern", "US/Michigan", "America/Araguaina", "America/Argentina/Buenos_Aires", "America/Argentina/Catamarca", "America/Argentina/ComodRivadavia", "America/Argentina/Cordoba", "America/Argentina/Jujuy", "America/Argentina/La_Rioja", "America/Argentina/Mendoza", "America/Argentina/Rio_Gallegos", "America/Argentina/Salta", "America/Argentina/San_Juan", "America/Argentina/San_Luis", "America/Argentina/Tucuman", "America/Argentina/Ushuaia", "America/Bahia", "America/Belem", "America/Buenos_Aires", "America/Catamarca", "America/Cayenne", "America/Cordoba", "America/Fortaleza", "America/Glace_Bay", "America/Goose_Bay", "America/Halifax", "America/Jujuy", "America/Maceio", "America/Mendoza", "America/Moncton", "America/Montevideo", "America/Paramaribo", "America/Punta_Arenas", "America/Recife", "America/Rosario", "America/Santarem", "America/Sao_Paulo", "America/Thule", "Antarctica/Palmer", "Antarctica/Rothera", "Atlantic/Bermuda", "Atlantic/Stanley", "Brazil/East", "Canada/Atlantic", "Etc/GMT+3", "America/St_Johns", "Canada/Newfoundland", "America/Godthab", "America/Miquelon", "America/Noronha", "America/Nuuk", "Atlantic/South_Georgia", "Brazil/DeNoronha", "Etc/GMT+2", "Atlantic/Cape_Verde", "Etc/GMT+1", "Africa/Abidjan", "Africa/Accra", "Africa/Bamako", "Africa/Banjul", "Africa/Bissau", "Africa/Conakry", "Africa/Dakar", "Africa/Freetown", "Africa/Lome", "Africa/Monrovia", "Africa/Nouakchott", "Africa/Ouagadougou", "Africa/Sao_Tome", "Africa/Timbuktu", "America/Danmarkshavn", "America/Scoresbysund", "Atlantic/Azores", "Atlantic/Reykjavik", "Atlantic/St_Helena", "Etc/GMT-0", "Etc/GMT", "Etc/GMT+0", "Etc/GMT0", "Etc/Greenwich", "Etc/UCT", "Etc/Universal", "Etc/UTC", "Etc/Zulu", "GMT-0", "GMT", "GMT+0", "GMT0", "Greenwich", "Iceland", "UCT", "Universal", "UTC", "Zulu", "Africa/Algiers", "Africa/Bangui", "Africa/Brazzaville", "Africa/Casablanca", "Africa/Douala", "Africa/El_Aaiun", "Africa/Kinshasa", "Africa/Lagos", "Africa/Libreville", "Africa/Luanda", "Africa/Malabo", "Africa/Ndjamena", "Africa/Niamey", "Africa/Porto-Novo", "Africa/Tunis", "Atlantic/Canary", "Atlantic/Faeroe", "Atlantic/Faroe", "Atlantic/Madeira", "Eire", "Etc/GMT-1", "Europe/Belfast", "Europe/Dublin", "Europe/Guernsey", "Europe/Isle_of_Man", "Europe/Jersey", "Europe/Lisbon", "Europe/London", "GB-Eire", "GB", "Portugal", "WET", "Africa/Blantyre", "Africa/Bujumbura", "Africa/Cairo", "Africa/Ceuta", "Africa/Gaborone", "Africa/Harare", "Africa/Johannesburg", "Africa/Khartoum", "Africa/Kigali", "Africa/Lubumbashi", "Africa/Lusaka", "Africa/Maputo", "Africa/Maseru", "Africa/Mbabane", "Africa/Tripoli", "Africa/Windhoek", "Antarctica/Troll", "Arctic/Longyearbyen", "Atlantic/Jan_Mayen", "CET", "Egypt", "Etc/GMT-2", "Europe/Amsterdam", "Europe/Andorra", "Europe/Belgrade", "Europe/Berlin", "Europe/Bratislava", "Europe/Brussels", "Europe/Budapest", "Europe/Busingen", "Europe/Copenhagen", "Europe/Gibraltar", "Europe/Kaliningrad", "Europe/Ljubljana", "Europe/Luxembourg", "Europe/Madrid", "Europe/Malta", "Europe/Monaco", "Europe/Oslo", "Europe/Paris", "Europe/Podgorica", "Europe/Prague", "Europe/Rome", "Europe/San_Marino", "Europe/Sarajevo", "Europe/Skopje", "Europe/Stockholm", "Europe/Tirane", "Europe/Vaduz", "Europe/Vatican", "Europe/Vienna", "Europe/Warsaw", "Europe/Zagreb", "Europe/Zurich", "Libya", "MET", "Poland", "Africa/Addis_Ababa", "Africa/Asmara", "Africa/Asmera", "Africa/Dar_es_Salaam", "Africa/Djibouti", "Africa/Juba", "Africa/Kampala", "Africa/Mogadishu", "Africa/Nairobi", "Antarctica/Syowa", "Asia/Aden", "Asia/Amman", "Asia/Baghdad", "Asia/Bahrain", "Asia/Beirut", "Asia/Damascus", "Asia/Famagusta", "Asia/Gaza", "Asia/Hebron", "Asia/Istanbul", "Asia/Jerusalem", "Asia/Kuwait", "Asia/Nicosia", "Asia/Qatar", "Asia/Riyadh", "Asia/Tel_Aviv", "EET", "Etc/GMT-3", "Europe/Athens", "Europe/Bucharest", "Europe/Chisinau", "Europe/Helsinki", "Europe/Istanbul", "Europe/Kiev", "Europe/Kirov", "Europe/Mariehamn", "Europe/Minsk", "Europe/Moscow", "Europe/Nicosia", "Europe/Riga", "Europe/Simferopol", "Europe/Sofia", "Europe/Tallinn", "Europe/Tiraspol", "Europe/Uzhgorod", "Europe/Vilnius", "Europe/Zaporozhye", "Indian/Antananarivo", "Indian/Comoro", "Indian/Mayotte", "Israel", "Turkey", "W-SU", "Asia/Baku", "Asia/Dubai", "Asia/Muscat", "Asia/Tbilisi", "Asia/Yerevan", "Etc/GMT-4", "Europe/Astrakhan", "Europe/Samara", "Europe/Saratov", "Europe/Ulyanovsk", "Europe/Volgograd", "Indian/Mahe", "Indian/Mauritius", "Indian/Reunion", "Asia/Kabul", "Asia/Tehran", "Iran", "Antarctica/Mawson", "Asia/Aqtau", "Asia/Aqtobe", "Asia/Ashgabat", "Asia/Ashkhabad", "Asia/Atyrau", "Asia/Dushanbe", "Asia/Karachi", "Asia/Oral", "Asia/Qyzylorda", "Asia/Samarkand", "Asia/Tashkent", "Asia/Yekaterinburg", "Etc/GMT-5", "Indian/Kerguelen", "Indian/Maldives", "Asia/Calcutta", "Asia/Colombo", "Asia/Kolkata", "Asia/Kathmandu", "Asia/Katmandu", "Antarctica/Vostok", "Asia/Almaty", "Asia/Bishkek", "Asia/Dacca", "Asia/Dhaka", "Asia/Kashgar", "Asia/Omsk", "Asia/Qostanay", "Asia/Thimbu", "Asia/Thimphu", "Asia/Urumqi", "Etc/GMT-6", "Indian/Chagos", "Asia/Rangoon", "Asia/Yangon", "Indian/Cocos", "Antarctica/Davis", "Asia/Bangkok", "Asia/Barnaul", "Asia/Ho_Chi_Minh", "Asia/Hovd", "Asia/Jakarta", "Asia/Krasnoyarsk", "Asia/Novokuznetsk", "Asia/Novosibirsk", "Asia/Phnom_Penh", "Asia/Pontianak", "Asia/Saigon", "Asia/Tomsk", "Asia/Vientiane", "Etc/GMT-7", "Indian/Christmas", "Antarctica/Casey", "Asia/Brunei", "Asia/Choibalsan", "Asia/Chongqing", "Asia/Chungking", "Asia/Harbin", "Asia/Hong_Kong", "Asia/Irkutsk", "Asia/Kuala_Lumpur", "Asia/Kuching", "Asia/Macao", "Asia/Macau", "Asia/Makassar", "Asia/Manila", "Asia/Shanghai", "Asia/Singapore", "Asia/Taipei", "Asia/Ujung_Pandang", "Asia/Ulaanbaatar", "Asia/Ulan_Bator", "Australia/Perth", "Australia/West", "Etc/GMT-8", "Hongkong", "PRC", "ROC", "Singapore", "Australia/Eucla", "Asia/Chita", "Asia/Dili", "Asia/Jayapura", "Asia/Khandyga", "Asia/Pyongyang", "Asia/Seoul", "Asia/Tokyo", "Asia/Yakutsk", "Etc/GMT-9", "Japan", "Pacific/Palau", "ROK", "Australia/Adelaide", "Australia/Broken_Hill", "Australia/Darwin", "Australia/North", "Australia/South", "Australia/Yancowinna", "Antarctica/DumontDUrville", "Asia/Ust-Nera", "Asia/Vladivostok", "Australia/ACT", "Australia/Brisbane", "Australia/Canberra", "Australia/Currie", "Australia/Hobart", "Australia/Lindeman", "Australia/Melbourne", "Australia/NSW", "Australia/Queensland", "Australia/Sydney", "Australia/Tasmania", "Australia/Victoria", "Etc/GMT-10", "Pacific/Chuuk", "Pacific/Guam", "Pacific/Port_Moresby", "Pacific/Saipan", "Pacific/Truk", "Pacific/Yap", "Australia/LHI", "Australia/Lord_Howe", "Antarctica/Macquarie", "Asia/Magadan", "Asia/Sakhalin", "Asia/Srednekolymsk", "Etc/GMT-11", "Pacific/Bougainville", "Pacific/Efate", "Pacific/Guadalcanal", "Pacific/Kosrae", "Pacific/Norfolk", "Pacific/Noumea", "Pacific/Pohnpei", "Pacific/Ponape", "Antarctica/McMurdo", "Antarctica/South_Pole", "Asia/Anadyr", "Asia/Kamchatka", "Etc/GMT-12", "Kwajalein", "NZ", "Pacific/Auckland", "Pacific/Fiji", "Pacific/Funafuti", "Pacific/Kwajalein", "Pacific/Majuro", "Pacific/Nauru", "Pacific/Tarawa", "Pacific/Wake", "Pacific/Wallis", "NZ-CHAT", "Pacific/Chatham", "Etc/GMT-13", "Pacific/Apia", "Pacific/Enderbury", "Pacific/Fakaofo", "Pacific/Tongatapu", "Etc/GMT-14", "Pacific/Kiritimati"] } }, 48158: /*!*******************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/tooltip_strategies/m_desktop_tooltip_strategy.js ***! \*******************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.DesktopTooltipStrategy = void 0; var _support = __webpack_require__( /*! ../../../core/utils/support */ 60137); var _m_tooltip = (obj = __webpack_require__( /*! ../../ui/m_tooltip */ 58933), obj && obj.__esModule ? obj : { default: obj }); var obj; var _m_tooltip_strategy_base = __webpack_require__( /*! ./m_tooltip_strategy_base */ 98558); class DesktopTooltipStrategy extends _m_tooltip_strategy_base.TooltipStrategyBase { _prepareBeforeVisibleChanged(dataList) { this._tooltip.option("position", { my: "bottom", at: "top", boundary: this._getBoundary(dataList), offset: this._extraOptions.offset, collision: "fit flipfit" }) } _getBoundary(dataList) { return this._options.isAppointmentInAllDayPanel(dataList[0].appointment) ? this._options.container : this._options.getScrollableContainer() } _onShown() { super._onShown(); if (this._extraOptions.isButtonClick) { this._list.focus(); this._list.option("focusedElement", null) } } _createListOption(target, dataList) { const result = super._createListOption(target, dataList); result.showScrollbar = _support.touch ? "always" : "onHover"; return result } _createTooltip(target, dataList) { const tooltip = this._createTooltipElement("dx-scheduler-appointment-tooltip-wrapper"); return this._options.createComponent(tooltip, _m_tooltip.default, { target: target, maxHeight: 200, rtlEnabled: this._extraOptions.rtlEnabled, onShown: this._onShown.bind(this), contentTemplate: this._getContentTemplate(dataList), wrapperAttr: { class: "dx-scheduler-appointment-tooltip-wrapper" } }) } _onListRender(e) { return this._extraOptions.dragBehavior && this._extraOptions.dragBehavior(e) } _onListItemContextMenu(e) { const contextMenuEventArgs = this._options.createEventArgs(e); this._options.onItemContextMenu(contextMenuEventArgs) } } exports.DesktopTooltipStrategy = DesktopTooltipStrategy }, 60737: /*!******************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/tooltip_strategies/m_mobile_tooltip_strategy.js ***! \******************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.MobileTooltipStrategy = void 0; var _size = __webpack_require__( /*! ../../../core/utils/size */ 58664); var _window = __webpack_require__( /*! ../../../core/utils/window */ 58201); var _ui = (obj = __webpack_require__( /*! ../../../ui/overlay/ui.overlay */ 89799), obj && obj.__esModule ? obj : { default: obj }); var obj; var _m_tooltip_strategy_base = __webpack_require__( /*! ./m_tooltip_strategy_base */ 98558); const CLASS_slidePanel = "dx-scheduler-overlay-panel", CLASS_scrollableContent = ".dx-scrollable-content"; const MAX_HEIGHT_PHONE = 250, MAX_HEIGHT_TABLET = "90%", MAX_HEIGHT_DEFAULT = "auto"; const MAX_WIDTH_PHONE = "100%", MAX_WIDTH_TABLET = "80%"; const animationConfig = { show: { type: "slide", duration: 300, from: { position: { my: "top", at: "bottom", of: (0, _window.getWindow)() } }, to: { position: { my: "center", at: "center", of: (0, _window.getWindow)() } } }, hide: { type: "slide", duration: 300, to: { position: { my: "top", at: "bottom", of: (0, _window.getWindow)() } }, from: { position: { my: "center", at: "center", of: (0, _window.getWindow)() } } } }; class MobileTooltipStrategy extends _m_tooltip_strategy_base.TooltipStrategyBase { _shouldUseTarget() { return false } setTooltipConfig() { const isTabletWidth = (0, _size.getWidth)((0, _window.getWindow)()) > 700; const listHeight = (0, _size.getOuterHeight)(this._list.$element().find(CLASS_scrollableContent)); this._tooltip.option(isTabletWidth ? (listHeight => { const currentMaxHeight = .9 * (0, _size.getHeight)((0, _window.getWindow)()); return { shading: true, width: MAX_WIDTH_TABLET, height: listHeight > currentMaxHeight ? MAX_HEIGHT_TABLET : MAX_HEIGHT_DEFAULT, position: { my: "center", at: "center", of: (0, _window.getWindow)() } } })(listHeight) : (listHeight => ({ shading: false, width: MAX_WIDTH_PHONE, height: listHeight > MAX_HEIGHT_PHONE ? MAX_HEIGHT_PHONE : MAX_HEIGHT_DEFAULT, position: { my: "bottom", at: "bottom", of: (0, _window.getWindow)() } }))(listHeight)) } async _onShowing() { this._tooltip.option("height", MAX_HEIGHT_DEFAULT); this.setTooltipConfig(); await Promise.all([...this.asyncTemplatePromises]); this.setTooltipConfig() } _createTooltip(target, dataList) { const element = this._createTooltipElement(CLASS_slidePanel); return this._options.createComponent(element, _ui.default, { target: (0, _window.getWindow)(), hideOnOutsideClick: true, animation: animationConfig, onShowing: () => this._onShowing(), onShown: this._onShown.bind(this), contentTemplate: this._getContentTemplate(dataList), wrapperAttr: { class: CLASS_slidePanel } }) } } exports.MobileTooltipStrategy = MobileTooltipStrategy }, 98558: /*!****************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/tooltip_strategies/m_tooltip_strategy_base.js ***! \****************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.TooltipStrategyBase = void 0; var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374)); var _function_template = __webpack_require__( /*! ../../../core/templates/function_template */ 68494); var _button = _interopRequireDefault(__webpack_require__( /*! ../../../ui/button */ 63008)); var _promise = __webpack_require__( /*! ../../core/utils/promise */ 17301); var _m_list = _interopRequireDefault(__webpack_require__( /*! ../../ui/list/m_list.edit */ 36646)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } exports.TooltipStrategyBase = class { constructor(options) { this.asyncTemplatePromises = new Set; this._tooltip = null; this._options = options; this._extraOptions = null } show(target, dataList, extraOptions) { if (this._canShowTooltip(dataList)) { this.hide(); this._extraOptions = extraOptions; this._showCore(target, dataList) } } _showCore(target, dataList) { if (!this._tooltip) { this._tooltip = this._createTooltip(target, dataList) } else { this._shouldUseTarget() && this._tooltip.option("target", target); this._list.option("dataSource", dataList) } this._prepareBeforeVisibleChanged(dataList); this._tooltip.option("visible", true) } _prepareBeforeVisibleChanged(dataList) {} _getContentTemplate(dataList) { return container => { const listElement = (0, _renderer.default)("
"); (0, _renderer.default)(container).append(listElement); this._list = this._createList(listElement, dataList) } } isAlreadyShown(target) { if (this._tooltip && this._tooltip.option("visible")) { return this._tooltip.option("target")[0] === target[0] } return } _onShown() { this._list.option("focusStateEnabled", this._extraOptions.focusStateEnabled) } dispose() {} hide() { if (this._tooltip) { this._tooltip.option("visible", false) } } _shouldUseTarget() { return true } _createTooltip(target, dataList) {} _canShowTooltip(dataList) { if (!dataList.length) { return false } return true } _createListOption(dataList) { return { dataSource: dataList, onContentReady: this._onListRender.bind(this), onItemClick: e => this._onListItemClick(e), onItemContextMenu: this._onListItemContextMenu.bind(this), itemTemplate: (item, index) => this._renderTemplate(item.appointment, item.targetedAppointment, index, item.color), _swipeEnabled: false, pageLoadMode: "scrollBottom" } } _onListRender(e) {} _createTooltipElement(wrapperClass) { return (0, _renderer.default)("
").appendTo(this._options.container).addClass(wrapperClass) } _createList(listElement, dataList) { return this._options.createComponent(listElement, _m_list.default, this._createListOption(dataList)) } _renderTemplate(appointment, targetedAppointment, index, color) { const itemListContent = this._createItemListContent(appointment, targetedAppointment, color); this._options.addDefaultTemplates({ [this._getItemListTemplateName()]: new _function_template.FunctionTemplate((options => { const $container = (0, _renderer.default)(options.container); $container.append(itemListContent); return $container })) }); const template = this._options.getAppointmentTemplate(`${this._getItemListTemplateName()}Template`); return this._createFunctionTemplate(template, appointment, targetedAppointment, index) } _createFunctionTemplate(template, appointmentData, targetedAppointmentData, index) { const isButtonClicked = !!this._extraOptions.isButtonClick; const isEmptyDropDownAppointmentTemplate = this._isEmptyDropDownAppointmentTemplate(); return new _function_template.FunctionTemplate((options => { const { promise: promise, resolve: resolve } = (0, _promise.createPromise)(); this.asyncTemplatePromises.add(promise); return template.render({ model: isEmptyDropDownAppointmentTemplate ? { appointmentData: appointmentData, targetedAppointmentData: targetedAppointmentData, isButtonClicked: isButtonClicked } : appointmentData, container: options.container, index: index, onRendered: () => { this.asyncTemplatePromises.delete(promise); resolve() } }) })) } _getItemListTemplateName() { return this._isEmptyDropDownAppointmentTemplate() ? "appointmentTooltip" : "dropDownAppointment" } _isEmptyDropDownAppointmentTemplate() { return !this._extraOptions.dropDownAppointmentTemplate || "dropDownAppointment" === this._extraOptions.dropDownAppointmentTemplate } _onListItemClick(e) { this.hide(); this._extraOptions.clickEvent && this._extraOptions.clickEvent(e); this._options.showAppointmentPopup(e.itemData.appointment, false, e.itemData.targetedAppointment) } _onListItemContextMenu(e) {} _createItemListContent(appointment, targetedAppointment, color) { const { editing: editing } = this._extraOptions; const $itemElement = (0, _renderer.default)("
").addClass("dx-tooltip-appointment-item"); $itemElement.append(this._createItemListMarker(color)); $itemElement.append(this._createItemListInfo(this._options.createFormattedDateText(appointment, targetedAppointment))); const disabled = this._options.getAppointmentDisabled(appointment); if (!disabled && (editing && true === editing.allowDeleting || true === editing)) { $itemElement.append(this._createDeleteButton(appointment, targetedAppointment)) } return $itemElement } _createItemListMarker(color) { const $marker = (0, _renderer.default)("
").addClass("dx-tooltip-appointment-item-marker"); const $markerBody = (0, _renderer.default)("
").addClass("dx-tooltip-appointment-item-marker-body"); $marker.append($markerBody); color && color.done((value => $markerBody.css("background", value))); return $marker } _createItemListInfo(object) { const result = (0, _renderer.default)("
").addClass("dx-tooltip-appointment-item-content"); const $title = (0, _renderer.default)("
").addClass("dx-tooltip-appointment-item-content-subject").text(object.text); const $date = (0, _renderer.default)("
").addClass("dx-tooltip-appointment-item-content-date").text(object.formatDate); return result.append($title).append($date) } _createDeleteButton(appointment, targetedAppointment) { const $container = (0, _renderer.default)("
").addClass("dx-tooltip-appointment-item-delete-button-container"); const $deleteButton = (0, _renderer.default)("
").addClass("dx-tooltip-appointment-item-delete-button"); $container.append($deleteButton); this._options.createComponent($deleteButton, _button.default, { icon: "trash", stylingMode: "text", onClick: e => { this.hide(); e.event.stopPropagation(); this._options.checkAndDeleteAppointment(appointment, targetedAppointment) } }); return $container } } }, 79456: /*!**************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/utils/is_scheduler_component.js ***! \**************************************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.isSchedulerComponent = function(component) { return component.NAME === schedulerComponentName }; const schedulerComponentName = "dxScheduler" }, 7836: /*!**************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/const.js ***! \**************************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.WORK_SPACE_BORDER_PX = void 0; exports.WORK_SPACE_BORDER_PX = 1 }, 94654: /*!**********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/helpers/m_position_helper.js ***! \**********************************************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.getMaxAllowedPosition = exports.getGroupWidth = exports.getCellWidth = exports.getCellHeight = exports.getAllDayHeight = exports.PositionHelper = void 0; function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const getCellSize = DOMMetaData => { const { dateTableCellsMeta: dateTableCellsMeta } = DOMMetaData; const length = null === dateTableCellsMeta || void 0 === dateTableCellsMeta ? void 0 : dateTableCellsMeta.length; if (!length) { return { width: 0, height: 0 } } const cellIndex = length > 1 ? 1 : 0; const cellSize = dateTableCellsMeta[cellIndex][0]; return { width: cellSize.width, height: cellSize.height } }; const getCellHeight = DOMMetaData => getCellSize(DOMMetaData).height; exports.getCellHeight = getCellHeight; const getCellWidth = DOMMetaData => getCellSize(DOMMetaData).width; exports.getCellWidth = getCellWidth; const getAllDayHeight = (showAllDayPanel, isVerticalGrouping, DOMMetaData) => { if (!showAllDayPanel) { return 0 } if (isVerticalGrouping) { const { dateTableCellsMeta: dateTableCellsMeta } = DOMMetaData; const length = null === dateTableCellsMeta || void 0 === dateTableCellsMeta ? void 0 : dateTableCellsMeta.length; return length ? dateTableCellsMeta[0][0].height : 0 } const { allDayPanelCellsMeta: allDayPanelCellsMeta } = DOMMetaData; return null !== allDayPanelCellsMeta && void 0 !== allDayPanelCellsMeta && allDayPanelCellsMeta.length ? allDayPanelCellsMeta[0].height : 0 }; exports.getAllDayHeight = getAllDayHeight; const getMaxAllowedPosition = (groupIndex, viewDataProvider, rtlEnabled, DOMMetaData) => { const validGroupIndex = groupIndex || 0; return ((groupIndex, viewDataProvider, rtlEnabled, DOMMetaData) => { const { dateTableCellsMeta: dateTableCellsMeta } = DOMMetaData; const firstRow = dateTableCellsMeta[0]; if (!firstRow) { return 0 } const { columnIndex: columnIndex } = viewDataProvider.getLastGroupCellPosition(groupIndex); const cellPosition = firstRow[columnIndex]; if (!cellPosition) { return 0 } return !rtlEnabled ? cellPosition.left + cellPosition.width : cellPosition.left })(validGroupIndex, viewDataProvider, rtlEnabled, DOMMetaData) }; exports.getMaxAllowedPosition = getMaxAllowedPosition; exports.getGroupWidth = (groupIndex, viewDataProvider, options) => { const { isVirtualScrolling: isVirtualScrolling, rtlEnabled: rtlEnabled, DOMMetaData: DOMMetaData } = options; const cellWidth = getCellWidth(DOMMetaData); let result = viewDataProvider.getCellCount(options) * cellWidth; if (isVirtualScrolling) { const groupedData = viewDataProvider.groupedDataMap.dateTableGroupedMap; const groupLength = groupedData[groupIndex][0].length; result = groupLength * cellWidth } const position = getMaxAllowedPosition(groupIndex, viewDataProvider, rtlEnabled, DOMMetaData); const currentPosition = position[groupIndex]; if (currentPosition) { if (rtlEnabled) { result = currentPosition - position[groupIndex + 1] } else if (0 === groupIndex) { result = currentPosition } else { result = currentPosition - position[groupIndex - 1] } } return result }; exports.PositionHelper = class { get viewDataProvider() { return this.options.viewDataProvider } get rtlEnabled() { return this.options.rtlEnabled } get isGroupedByDate() { return this.options.isGroupedByDate } get groupCount() { return this.options.groupCount } get DOMMetaData() { return this.options.getDOMMetaDataCallback() } constructor(options) { this.options = options; this.groupStrategy = this.options.isVerticalGrouping ? new GroupStrategyBase(this.options) : new GroupStrategyHorizontal(this.options) } getHorizontalMax(groupIndex) { const getMaxPosition = groupIndex => getMaxAllowedPosition(groupIndex, this.viewDataProvider, this.rtlEnabled, this.DOMMetaData); if (this.isGroupedByDate) { const viewPortGroupCount = this.viewDataProvider.getViewPortGroupCount(); return Math.max(getMaxPosition(groupIndex), getMaxPosition(viewPortGroupCount - 1)) } return getMaxPosition(groupIndex) } getResizableStep() { const cellWidth = getCellWidth(this.DOMMetaData); if (this.isGroupedByDate) { return this.groupCount * cellWidth } return cellWidth } getVerticalMax(options) { return this.groupStrategy.getVerticalMax(options) } getOffsetByAllDayPanel(options) { return this.groupStrategy.getOffsetByAllDayPanel(options) } getGroupTop(options) { return this.groupStrategy.getGroupTop(options) } }; class GroupStrategyBase { constructor(options) { this.options = options } get viewDataProvider() { return this.options.viewDataProvider } get isGroupedByDate() { return this.options.isGroupedByDate } get rtlEnabled() { return this.options.rtlEnabled } get groupCount() { return this.options.groupCount } get DOMMetaData() { return this.options.getDOMMetaDataCallback() } getOffsetByAllDayPanel(_ref) { let { groupIndex: groupIndex, supportAllDayRow: supportAllDayRow, showAllDayPanel: showAllDayPanel } = _ref; let result = 0; if (supportAllDayRow && showAllDayPanel) { const allDayPanelHeight = getAllDayHeight(showAllDayPanel, true, this.DOMMetaData); result = allDayPanelHeight * (groupIndex + 1) } return result } getVerticalMax(options) { let maxAllowedPosition = this._getMaxAllowedVerticalPosition(_extends({}, options, { viewDataProvider: this.viewDataProvider, rtlEnabled: this.rtlEnabled, DOMMetaData: this.DOMMetaData })); maxAllowedPosition += this.getOffsetByAllDayPanel(options); return maxAllowedPosition } getGroupTop(_ref2) { let { groupIndex: groupIndex, showAllDayPanel: showAllDayPanel, isGroupedAllDayPanel: isGroupedAllDayPanel } = _ref2; const rowCount = this.viewDataProvider.getRowCountInGroup(groupIndex); const maxVerticalPosition = this._getMaxAllowedVerticalPosition({ groupIndex: groupIndex, viewDataProvider: this.viewDataProvider, showAllDayPanel: showAllDayPanel, isGroupedAllDayPanel: isGroupedAllDayPanel, isVerticalGrouping: true, DOMMetaData: this.DOMMetaData }); return maxVerticalPosition - getCellHeight(this.DOMMetaData) * rowCount } _getAllDayHeight(showAllDayPanel) { return getAllDayHeight(showAllDayPanel, true, this.DOMMetaData) } _getMaxAllowedVerticalPosition(_ref3) { let { groupIndex: groupIndex, showAllDayPanel: showAllDayPanel, isGroupedAllDayPanel: isGroupedAllDayPanel } = _ref3; const { rowIndex: rowIndex } = this.viewDataProvider.getLastGroupCellPosition(groupIndex); const { dateTableCellsMeta: dateTableCellsMeta } = this.DOMMetaData; const lastGroupRow = dateTableCellsMeta[rowIndex]; if (!lastGroupRow) { return 0 } let result = lastGroupRow[0].top + lastGroupRow[0].height; if (isGroupedAllDayPanel) { result -= (groupIndex + 1) * this._getAllDayHeight(showAllDayPanel) } return result } } class GroupStrategyHorizontal extends GroupStrategyBase { getOffsetByAllDayPanel() { return 0 } getVerticalMax(options) { const { isVirtualScrolling: isVirtualScrolling, groupIndex: groupIndex } = options; const correctedGroupIndex = isVirtualScrolling ? groupIndex : 0; return this._getMaxAllowedVerticalPosition(_extends({}, options, { groupIndex: correctedGroupIndex })) } getGroupTop() { return 0 } _getAllDayHeight(showAllDayPanel) { return getAllDayHeight(showAllDayPanel, false, this.DOMMetaData) } } }, 32316: /*!*****************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_agenda.js ***! \*****************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 99393)); var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../core/dom_adapter */ 73349)); var _element = __webpack_require__( /*! ../../../core/element */ 6415); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374)); var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576); var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198)); var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 95479); var _size = __webpack_require__( /*! ../../../core/utils/size */ 58664); var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../../localization/date */ 91500)); var _index = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084); var _m_classes = __webpack_require__( /*! ../m_classes */ 43600); var _m_constants = __webpack_require__( /*! ../m_constants */ 6324); var _m_table_creator = _interopRequireDefault(__webpack_require__( /*! ../m_table_creator */ 82215)); var _m_utils = __webpack_require__( /*! ../resources/m_utils */ 31359); var _m_work_space = _interopRequireDefault(__webpack_require__( /*! ./m_work_space */ 48377)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const { tableCreator: tableCreator } = _m_table_creator.default; class SchedulerAgenda extends _m_work_space.default { get type() { return _m_constants.VIEWS.AGENDA } get renderingStrategy() { return this.invoke("getLayoutManager").getRenderingStrategyInstance() } get appointmentDataProvider() { return this.option("getAppointmentDataProvider")() } getStartViewDate() { return this._startViewDate } _init() { super._init(); this._activeStateUnit = void 0 } _getDefaultOptions() { return (0, _extend.extend)(super._getDefaultOptions(), { agendaDuration: 7, rowHeight: 60, noDataText: "" }) } _optionChanged(args) { const { name: name } = args; const { value: value } = args; switch (name) { case "agendaDuration": break; case "noDataText": case "rowHeight": this._recalculateAgenda(this._rows); break; case "groups": if (!value || !value.length) { if (this._$groupTable) { this._$groupTable.remove(); this._$groupTable = null; this._detachGroupCountClass() } } else if (!this._$groupTable) { this._initGroupTable(); this._dateTableScrollable.$content().prepend(this._$groupTable) } super._optionChanged(args); break; default: super._optionChanged(args) } } _renderFocusState() { return (0, _common.noop)() } _renderFocusTarget() { return (0, _common.noop)() } _cleanFocusState() { return (0, _common.noop)() } supportAllDayRow() { return false } _isVerticalGroupedWorkSpace() { return false } _getElementClass() { return "dx-scheduler-agenda" } _calculateStartViewDate() { return _index.agendaUtils.calculateStartViewDate(this.option("currentDate"), this.option("startDayHour")) } _getRowCount() { return this.option("agendaDuration") } _getCellCount() { return 1 } _getTimePanelRowCount() { return this.option("agendaDuration") } _renderAllDayPanel() { return (0, _common.noop)() } _toggleAllDayVisibility() { return (0, _common.noop)() } _initWorkSpaceUnits() { this._initGroupTable(); this._$timePanel = (0, _renderer.default)("").addClass(_m_classes.TIME_PANEL_CLASS); this._$dateTable = (0, _renderer.default)("
").addClass(_m_classes.DATE_TABLE_CLASS); this._$dateTableScrollableContent = (0, _renderer.default)("
").addClass("dx-scheduler-date-table-scrollable-content"); this._$dateTableContainer = (0, _renderer.default)("
").addClass("dx-scheduler-date-table-container") } _initGroupTable() { const groups = this.option("groups"); if (groups && groups.length) { this._$groupTable = (0, _renderer.default)("
").addClass("dx-scheduler-group-table") } } _renderView() { this._startViewDate = this._calculateStartViewDate(); this._rows = []; this._initPositionHelper() } _recalculateAgenda(rows) { let cellTemplates = []; this._cleanView(); if (this._rowsIsEmpty(rows)) { this._renderNoData(); return } this._rows = rows; if (this._$groupTable) { cellTemplates = this._renderGroupHeader(); this._setGroupHeaderCellsHeight() } this._renderTimePanel(); this._renderDateTable(); this.invoke("onAgendaReady", rows); this._applyCellTemplates(cellTemplates); this._dateTableScrollable.update() } _renderNoData() { this._$noDataContainer = (0, _renderer.default)("
").addClass("dx-scheduler-agenda-nodata").html(this.option("noDataText")); this._dateTableScrollable.$content().append(this._$noDataContainer) } _setTableSizes() { return (0, _common.noop)() } _toggleHorizontalScrollClass() { return (0, _common.noop)() } _createCrossScrollingConfig(argument) { return (0, _common.noop)() } _setGroupHeaderCellsHeight() { const $cells = this._getGroupHeaderCells().filter(((_, element) => !element.getAttribute("rowSpan"))); const rows = this._removeEmptyRows(this._rows); if (!rows.length) { return } for (let i = 0; i < $cells.length; i++) { const $cellContent = $cells.eq(i).find(".dx-scheduler-group-header-content"); (0, _size.setOuterHeight)($cellContent, this._getGroupRowHeight(rows[i])) } } _rowsIsEmpty(rows) { let result = true; for (let i = 0; i < rows.length; i++) { const groupRow = rows[i]; for (let j = 0; j < groupRow.length; j++) { if (groupRow[j]) { result = false; break } } } return result } _attachGroupCountClass() { const className = (0, _index.getVerticalGroupCountClass)(this.option("groups")); this.$element().addClass(className) } _removeEmptyRows(rows) { const result = []; for (let i = 0; i < rows.length; i++) { if (rows[i].length && !(data = rows[i], !data.some((value => value > 0)))) { result.push(rows[i]) } } var data; return result } _getGroupHeaderContainer() { return this._$groupTable } _makeGroupRows() { const tree = (0, _m_utils.createReducedResourcesTree)(this.option("loadedResources"), ((field, action) => (0, _m_utils.getDataAccessors)(this.option("getResourceDataAccessors")(), field, action)), this.option("getFilteredItems")()); const cellTemplate = this.option("resourceCellTemplate"); const getGroupHeaderContentClass = _m_classes.GROUP_HEADER_CONTENT_CLASS; const cellTemplates = []; const table = tableCreator.makeGroupedTableFromJSON(tableCreator.VERTICAL, tree, { cellTag: "th", groupTableClass: "dx-scheduler-group-table", groupRowClass: _m_classes.GROUP_ROW_CLASS, groupCellClass: this._getGroupHeaderClass(), groupCellCustomContent(cell, cellTextElement, index, data) { const container = _dom_adapter.default.createElement("div"); container.className = getGroupHeaderContentClass; if (cellTemplate && cellTemplate.render) { cellTemplates.push(cellTemplate.render.bind(cellTemplate, { model: { data: data.data, id: data.value, color: data.color, text: cellTextElement.textContent }, container: (0, _element.getPublicElement)((0, _renderer.default)(container)), index: index })) } else { const contentWrapper = _dom_adapter.default.createElement("div"); contentWrapper.appendChild(cellTextElement); container.appendChild(contentWrapper) } cell.appendChild(container) }, cellTemplate: cellTemplate }); return { elements: (0, _renderer.default)(table).find(`.${_m_classes.GROUP_ROW_CLASS}`), cellTemplates: cellTemplates } } _cleanView() { this._$dateTable.empty(); this._$timePanel.empty(); if (this._$groupTable) { this._$groupTable.empty() } if (this._$noDataContainer) { this._$noDataContainer.empty(); this._$noDataContainer.remove(); delete this._$noDataContainer } } _createWorkSpaceElements() { this._createWorkSpaceStaticElements() } _createWorkSpaceStaticElements() { this._$dateTableContainer.append(this._$dateTable); this._dateTableScrollable.$content().append(this._$dateTableScrollableContent); if (this._$groupTable) { this._$dateTableScrollableContent.prepend(this._$groupTable) } this._$dateTableScrollableContent.append(this._$timePanel, this._$dateTableContainer); this.$element().append(this._dateTableScrollable.$element()) } _renderDateTable() { this._renderTableBody({ container: (0, _element.getPublicElement)(this._$dateTable), rowClass: _m_classes.DATE_TABLE_ROW_CLASS, cellClass: this._getDateTableCellClass() }) } _attachTablesEvents() { return (0, _common.noop)() } _attachEvents() { return (0, _common.noop)() } _cleanCellDataCache() { return (0, _common.noop)() } isIndicationAvailable() { return false } _prepareCellTemplateOptions(text, date, rowIndex, $cell) { const groupsOpt = this.option("groups"); const groups = {}; const isGroupedView = !!groupsOpt.length; const path = isGroupedView && (0, _m_utils.getPathToLeaf)(rowIndex, groupsOpt) || []; path.forEach(((resourceValue, resourceIndex) => { const resourceName = groupsOpt[resourceIndex].name; groups[resourceName] = resourceValue })); const groupIndex = isGroupedView ? this._getGroupIndexByResourceId(groups) : void 0; return { model: { text: text, date: date, groups: groups, groupIndex: groupIndex }, container: (0, _element.getPublicElement)($cell), index: rowIndex } } _renderTableBody(options, delayCellTemplateRendering) { const cellTemplates = []; const cellTemplateOpt = options.cellTemplate; this._$rows = []; let i; const fillTableBody = function(rowIndex, rowSize) { if (rowSize) { let date; let cellDateNumber; let cellDayName; const $row = (0, _renderer.default)("
"); const $td = (0, _renderer.default)("").append(this._$rows)); this._applyCellTemplates(cellTemplates) } _setLastRowClass() { if (this._rows.length > 1 && this._$rows.length) { const $lastRow = this._$rows[this._$rows.length - 1]; $lastRow.addClass("dx-scheduler-date-table-last-row") } } _renderTimePanel() { this._renderTableBody({ container: (0, _element.getPublicElement)(this._$timePanel), rowCount: this._getTimePanelRowCount(), cellCount: 1, rowClass: "dx-scheduler-time-panel-row", cellClass: "dx-scheduler-time-panel-cell", cellTemplate: this.option("dateCellTemplate"), getStartDate: this._getTimePanelStartDate.bind(this) }) } _getTimePanelStartDate(rowIndex) { const current = new Date(this.option("currentDate")); const cellDate = new Date(current.setDate(current.getDate() + rowIndex)); return cellDate } _getRowHeight(rowSize) { const baseHeight = this.option("rowHeight"); const innerOffset = 5 * (rowSize - 1); return rowSize ? baseHeight * rowSize + innerOffset + 20 : 0 } _getGroupRowHeight(groupRows) { if (!groupRows) { return } let result = 0; for (let i = 0; i < groupRows.length; i++) { result += this._getRowHeight(groupRows[i]) } return result } _calculateRows(appointments) { return this.renderingStrategy.calculateRows(appointments, this.option("agendaDuration"), this.option("currentDate")) } onDataSourceChanged(appointments) { super.onDataSourceChanged(); this._renderView(); const rows = this._calculateRows(appointments); this._recalculateAgenda(rows) } getAgendaVerticalStepHeight() { return this.option("rowHeight") } getEndViewDate() { const currentDate = new Date(this.option("currentDate")); const agendaDuration = this.option("agendaDuration"); currentDate.setHours(this.option("endDayHour")); const result = currentDate.setDate(currentDate.getDate() + agendaDuration - 1) - 6e4; return new Date(result) } getEndViewDateByEndDayHour() { return this.getEndViewDate() } getCellDataByCoordinates() { return { startDate: null, endDate: null } } updateScrollPosition(date) { const newDate = this.timeZoneCalculator.createDate(date, { path: "toGrid" }); const bounds = this.getVisibleBounds(); const startDateHour = newDate.getHours(); const startDateMinutes = newDate.getMinutes(); if (this.needUpdateScrollPosition(startDateHour, startDateMinutes, bounds, newDate)) { this.scrollToTime(startDateHour, startDateMinutes, newDate) } } needUpdateScrollPosition(hours, minutes, bounds, newData) { let isUpdateNeeded = false; if (hours < bounds.top.hours || hours > bounds.bottom.hours) { isUpdateNeeded = true } if (hours === bounds.top.hours && minutes < bounds.top.minutes) { isUpdateNeeded = true } if (hours === bounds.bottom.hours && minutes > bounds.top.minutes) { isUpdateNeeded = true } return isUpdateNeeded } renovatedRenderSupported() { return false } _setSelectedCellsByCellData() {} _getIntervalDuration() { return _date.default.dateToMilliseconds("day") * this.option("intervalCount") } getDOMElementsMetaData() { return { dateTableCellsMeta: [ [{}] ], allDayPanelCellsMeta: [{}] } } }(0, _component_registrator.default)("dxSchedulerAgenda", SchedulerAgenda); exports.default = SchedulerAgenda }, 14553: /*!****************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_cache.js ***! \****************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.Cache = void 0; var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922); exports.Cache = class { constructor() { this._cache = new Map } get size() { return this._cache.size } clear() { this._cache.clear() } get(name, callback) { if (!this._cache.has(name) && callback) { this.set(name, callback()) } return this._cache.get(name) } set(name, value) { (0, _type.isDefined)(value) && this._cache.set(name, value) } } }, 78151: /*!*************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_cells_selection_controller.js ***! \*************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.CellsSelectionController = void 0; var _index = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084); function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } exports.CellsSelectionController = class { handleArrowClick(options) { const { key: key, focusedCellPosition: focusedCellPosition, edgeIndices: edgeIndices, getCellDataByPosition: getCellDataByPosition, isAllDayPanelCell: isAllDayPanelCell } = options; let nextCellIndices; switch (key) { case "down": nextCellIndices = this.getCellFromNextRowPosition(focusedCellPosition, "next", edgeIndices); break; case "up": nextCellIndices = this.getCellFromNextRowPosition(focusedCellPosition, "prev", edgeIndices); break; case "left": nextCellIndices = this.getCellFromNextColumnPosition(_extends({}, options, { direction: "prev" })); break; case "right": nextCellIndices = this.getCellFromNextColumnPosition(_extends({}, options, { direction: "next" })) } const currentCellData = getCellDataByPosition(nextCellIndices.rowIndex, nextCellIndices.columnIndex, isAllDayPanelCell); return this.moveToCell(_extends({}, options, { currentCellData: currentCellData })) } getCellFromNextRowPosition(focusedCellPosition, direction, edgeIndices) { const { columnIndex: columnIndex, rowIndex: rowIndex } = focusedCellPosition; const deltaPosition = "next" === direction ? 1 : -1; const nextRowIndex = rowIndex + deltaPosition; const validRowIndex = nextRowIndex >= 0 && nextRowIndex <= edgeIndices.lastRowIndex ? nextRowIndex : rowIndex; return { columnIndex: columnIndex, rowIndex: validRowIndex } } getCellFromNextColumnPosition(options) { const { focusedCellPosition: focusedCellPosition, direction: direction, edgeIndices: edgeIndices, isRTL: isRTL, isGroupedByDate: isGroupedByDate, groupCount: groupCount, isMultiSelection: isMultiSelection, viewType: viewType } = options; const { columnIndex: columnIndex, rowIndex: rowIndex } = focusedCellPosition; const { firstColumnIndex: firstColumnIndex, lastColumnIndex: lastColumnIndex, firstRowIndex: firstRowIndex, lastRowIndex: lastRowIndex } = edgeIndices; const step = isGroupedByDate && isMultiSelection ? groupCount : 1; const sign = isRTL ? -1 : 1; const deltaColumnIndex = "next" === direction ? sign * step : -1 * sign * step; const nextColumnIndex = columnIndex + deltaColumnIndex; const isValidColumnIndex = nextColumnIndex >= firstColumnIndex && nextColumnIndex <= lastColumnIndex; if (isValidColumnIndex) { return { columnIndex: nextColumnIndex, rowIndex: rowIndex } } return (0, _index.isDateAndTimeView)(viewType) ? focusedCellPosition : this._processEdgeCell({ nextColumnIndex: nextColumnIndex, rowIndex: rowIndex, columnIndex: columnIndex, firstColumnIndex: firstColumnIndex, lastColumnIndex: lastColumnIndex, firstRowIndex: firstRowIndex, lastRowIndex: lastRowIndex, step: step }) } _processEdgeCell(options) { const { nextColumnIndex: nextColumnIndex, rowIndex: rowIndex, columnIndex: columnIndex, firstColumnIndex: firstColumnIndex, lastColumnIndex: lastColumnIndex, firstRowIndex: firstRowIndex, lastRowIndex: lastRowIndex, step: step } = options; let validColumnIndex = nextColumnIndex; let validRowIndex = rowIndex; const isLeftEdgeCell = nextColumnIndex < firstColumnIndex; const isRightEdgeCell = nextColumnIndex > lastColumnIndex; if (isLeftEdgeCell) { const columnIndexInNextRow = lastColumnIndex - (step - columnIndex % step - 1); const nextRowIndex = rowIndex - 1; const isValidRowIndex = nextRowIndex >= firstRowIndex; validRowIndex = isValidRowIndex ? nextRowIndex : rowIndex; validColumnIndex = isValidRowIndex ? columnIndexInNextRow : columnIndex } if (isRightEdgeCell) { const columnIndexInNextRow = firstColumnIndex + columnIndex % step; const nextRowIndex = rowIndex + 1; const isValidRowIndex = nextRowIndex <= lastRowIndex; validRowIndex = isValidRowIndex ? nextRowIndex : rowIndex; validColumnIndex = isValidRowIndex ? columnIndexInNextRow : columnIndex } return { columnIndex: validColumnIndex, rowIndex: validRowIndex } } moveToCell(options) { const { isMultiSelection: isMultiSelection, isMultiSelectionAllowed: isMultiSelectionAllowed, focusedCellData: focusedCellData, currentCellData: currentCellData } = options; const isValidMultiSelection = isMultiSelection && isMultiSelectionAllowed; const nextFocusedCellData = isValidMultiSelection ? this._getNextCellData(currentCellData, focusedCellData) : currentCellData; return nextFocusedCellData } _getNextCellData(nextFocusedCellData, focusedCellData, isVirtualCell) { if (isVirtualCell) { return focusedCellData } const isValidNextFocusedCell = this._isValidNextFocusedCell(nextFocusedCellData, focusedCellData); return isValidNextFocusedCell ? nextFocusedCellData : focusedCellData } _isValidNextFocusedCell(nextFocusedCellData, focusedCellData) { if (!focusedCellData) { return true } const { groupIndex: groupIndex, allDay: allDay } = focusedCellData; const { groupIndex: nextGroupIndex, allDay: nextAllDay } = nextFocusedCellData; return groupIndex === nextGroupIndex && allDay === nextAllDay } } }, 20191: /*!********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_cells_selection_state.js ***! \********************************************************************************************************/ function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; exports.default = class { constructor(_viewDataProvider) { this._viewDataProvider = _viewDataProvider; this._focusedCell = null; this._selectedCells = null; this._firstSelectedCell = null; this._prevFocusedCell = null; this._prevSelectedCells = null } get viewDataProvider() { return this._viewDataProvider } get focusedCell() { const focusedCell = this._focusedCell; if (!focusedCell) { return } const { groupIndex: groupIndex, startDate: startDate, allDay: allDay } = focusedCell; const cellInfo = { groupIndex: groupIndex, startDate: startDate, isAllDay: allDay, index: focusedCell.index }; const cellPosition = this.viewDataProvider.findCellPositionInMap(cellInfo); return { coordinates: cellPosition, cellData: focusedCell } } setFocusedCell(rowIndex, columnIndex, isAllDay) { if (rowIndex >= 0) { const cell = this._viewDataProvider.getCellData(rowIndex, columnIndex, isAllDay); this._focusedCell = cell } } setSelectedCells(lastCellCoordinates) { let firstCellCoordinates = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : void 0; const viewDataProvider = this._viewDataProvider; const { rowIndex: lastRowIndex, columnIndex: lastColumnIndex, allDay: isLastCellAllDay } = lastCellCoordinates; if (lastRowIndex < 0) { return } const firstCell = firstCellCoordinates ? viewDataProvider.getCellData(firstCellCoordinates.rowIndex, firstCellCoordinates.columnIndex, firstCellCoordinates.allDay) : this._firstSelectedCell; const lastCell = viewDataProvider.getCellData(lastRowIndex, lastColumnIndex, isLastCellAllDay); this._firstSelectedCell = firstCell; this._selectedCells = this._viewDataProvider.getCellsBetween(firstCell, lastCell) } setSelectedCellsByData(selectedCellsData) { this._selectedCells = selectedCellsData } getSelectedCells() { return this._selectedCells } releaseSelectedAndFocusedCells() { this.releaseSelectedCells(); this.releaseFocusedCell() } releaseSelectedCells() { this._prevSelectedCells = this._selectedCells; this._prevFirstSelectedCell = this._firstSelectedCell; this._selectedCells = null; this._firstSelectedCell = null } releaseFocusedCell() { this._prevFocusedCell = this._focusedCell; this._focusedCell = null } restoreSelectedAndFocusedCells() { this._selectedCells = this._selectedCells || this._prevSelectedCells; this._focusedCell = this._focusedCell || this._prevFocusedCell; this._firstSelectedCell = this._firstSelectedCell || this._prevFirstSelectedCell; this._prevSelectedCells = null; this._prevFirstSelectedCell = null; this._prevFocusedCell = null } clearSelectedAndFocusedCells() { this._prevSelectedCells = null; this._selectedCells = null; this._prevFocusedCell = null; this._focusedCell = null } } }, 92297: /*!*******************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_timeline.js ***! \*******************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 99393)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374)); var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576); var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198)); var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306); var _position = __webpack_require__( /*! ../../../core/utils/position */ 37518); var _size = __webpack_require__( /*! ../../../core/utils/size */ 58664); var _window = __webpack_require__( /*! ../../../core/utils/window */ 58201); var _index = __webpack_require__( /*! ../../scheduler/r1/components/index */ 42515); var _index2 = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084); var _m_classes = __webpack_require__( /*! ../m_classes */ 43600); var _m_table_creator = _interopRequireDefault(__webpack_require__( /*! ../m_table_creator */ 82215)); var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../m_utils_time_zone */ 57880)); var _m_current_time_shader_horizontal = _interopRequireDefault(__webpack_require__( /*! ../shaders/m_current_time_shader_horizontal */ 65295)); var _m_work_space_indicator = _interopRequireDefault(__webpack_require__( /*! ./m_work_space_indicator */ 34623)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const { tableCreator: tableCreator } = _m_table_creator.default; const toMs = _date.default.dateToMilliseconds; class SchedulerTimeline extends _m_work_space_indicator.default { constructor() { super(...arguments); this.viewDirection = "horizontal" } get verticalGroupTableClass() { return "dx-scheduler-group-table" } get renovatedHeaderPanelComponent() { return _index.HeaderPanelTimelineComponent } getGroupTableWidth() { return this._$sidebarTable ? (0, _size.getOuterWidth)(this._$sidebarTable) : 0 } _getTotalRowCount(groupCount) { if (this._isHorizontalGroupedWorkSpace()) { return this._getRowCount() } groupCount = groupCount || 1; return this._getRowCount() * groupCount } _getFormat() { return "shorttime" } _getWorkSpaceHeight() { if (this.option("crossScrollingEnabled") && (0, _window.hasWindow)()) { return (0, _position.getBoundingRect)(this._$dateTable.get(0)).height } return (0, _position.getBoundingRect)(this.$element().get(0)).height } _dateTableScrollableConfig() { const config = super._dateTableScrollableConfig(); const timelineConfig = { direction: "horizontal" }; return this.option("crossScrollingEnabled") ? config : (0, _extend.extend)(config, timelineConfig) } _needCreateCrossScrolling() { return true } _headerScrollableConfig() { const config = super._headerScrollableConfig(); return (0, _extend.extend)(config, { scrollByContent: true }) } supportAllDayRow() { return false } _getGroupHeaderContainer() { if (this._isHorizontalGroupedWorkSpace()) { return this._$thead } return this._$sidebarTable } _insertAllDayRowsIntoDateTable() { return false } _needRenderWeekHeader() { return false } _incrementDate(date) { date.setDate(date.getDate() + 1) } getIndicationCellCount() { const timeDiff = this._getTimeDiff(); return this._calculateDurationInCells(timeDiff) } _getTimeDiff() { let today = this._getToday(); const date = this._getIndicationFirstViewDate(); const startViewDate = this.getStartViewDate(); const dayLightOffset = _m_utils_time_zone.default.getDaylightOffsetInMs(startViewDate, today); if (dayLightOffset) { today = new Date(today.getTime() + dayLightOffset) } return today.getTime() - date.getTime() } _calculateDurationInCells(timeDiff) { const today = this._getToday(); const differenceInDays = Math.floor(timeDiff / toMs("day")); let duration = (timeDiff - differenceInDays * toMs("day") - this.option("startDayHour") * toMs("hour")) / this.getCellDuration(); if (today.getHours() > this.option("endDayHour")) { duration = this._getCellCountInDay() } if (duration < 0) { duration = 0 } return differenceInDays * this._getCellCountInDay() + duration } getIndicationWidth() { if (this.isGroupedByDate()) { const cellCount = this.getIndicationCellCount(); const integerPart = Math.floor(cellCount); const fractionPart = cellCount - integerPart; return this.getCellWidth() * (integerPart * this._getGroupCount() + fractionPart) } return this.getIndicationCellCount() * this.getCellWidth() } _isVerticalShader() { return false } _isCurrentTimeHeaderCell() { return false } _setTableSizes() { super._setTableSizes(); const minHeight = this._getWorkSpaceMinHeight(); (0, _size.setHeight)(this._$sidebarTable, minHeight); (0, _size.setHeight)(this._$dateTable, minHeight); this.virtualScrollingDispatcher.updateDimensions() } _getWorkSpaceMinHeight() { let minHeight = this._getWorkSpaceHeight(); const workspaceContainerHeight = (0, _size.getOuterHeight)(this._$flexContainer, true); if (minHeight < workspaceContainerHeight) { minHeight = workspaceContainerHeight } return minHeight } _getCellCoordinatesByIndex(index) { return { columnIndex: index % this._getCellCount(), rowIndex: 0 } } _getCellByCoordinates(cellCoordinates, groupIndex) { const indexes = this._groupedStrategy.prepareCellIndexes(cellCoordinates, groupIndex); return this._$dateTable.find("tr").eq(indexes.rowIndex).find("td").eq(indexes.columnIndex) } _getWorkSpaceWidth() { return (0, _size.getOuterWidth)(this._$dateTable, true) } _getIndicationFirstViewDate() { return _date.default.trimTime(new Date(this.getStartViewDate())) } _getIntervalBetween(currentDate, allDay) { const startDayHour = this.option("startDayHour"); const endDayHour = this.option("endDayHour"); const firstViewDate = this.getStartViewDate(); const firstViewDateTime = firstViewDate.getTime(); const hiddenInterval = (24 - endDayHour + startDayHour) * toMs("hour"); const timeZoneOffset = _date.default.getTimezonesDifference(firstViewDate, currentDate); const apptStart = currentDate.getTime(); const fullInterval = apptStart - firstViewDateTime - timeZoneOffset; const fullDays = Math.floor(fullInterval / toMs("day")); const tailDuration = fullInterval - fullDays * toMs("day"); let tailDelta = 0; const cellCount = this._getCellCountInDay() * (fullDays - this._getWeekendsCount(fullDays)); const gapBeforeAppt = apptStart - _date.default.trimTime(new Date(currentDate)).getTime(); let 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(argument) { return 0 } getAllDayContainer() { return null } getTimePanelWidth() { return 0 } getIntervalDuration(allDay) { return this.getCellDuration() } getCellMinWidth() { return 0 } getWorkSpaceLeftOffset() { return 0 } scrollToTime(hours, minutes, date) { const coordinates = this._getScrollCoordinates(hours, minutes, date); const scrollable = this.getScrollable(); const offset = this.option("rtlEnabled") ? (0, _position.getBoundingRect)(this.getScrollableContainer().get(0)).width : 0; if (this.option("templatesRenderAsynchronously")) { setTimeout((() => { scrollable.scrollBy({ left: coordinates.left - scrollable.scrollLeft() - offset, top: 0 }) })) } else { scrollable.scrollBy({ left: coordinates.left - scrollable.scrollLeft() - offset, top: 0 }) } } renderRAllDayPanel() {} renderRTimeTable() {} _renderGroupAllDayPanel() {} generateRenderOptions(argument) { const options = super.generateRenderOptions(true); return _extends({}, options, { isGenerateWeekDaysHeaderData: this._needRenderWeekHeader(), getDateForHeaderText: _index2.timelineWeekUtils.getDateForHeaderText }) } _init() { super._init(); this.$element().addClass("dx-scheduler-timeline"); this._$sidebarTable = (0, _renderer.default)("
").addClass("dx-scheduler-group-table") } _getDefaultGroupStrategy() { return "vertical" } _toggleGroupingDirectionClass() { this.$element().toggleClass("dx-scheduler-work-space-horizontal-grouped", this._isHorizontalGroupedWorkSpace()) } _getDefaultOptions() { return (0, _extend.extend)(super._getDefaultOptions(), { groupOrientation: "vertical" }) } _createWorkSpaceElements() { this._createWorkSpaceScrollableElements() } _toggleAllDayVisibility() { return (0, _common.noop)() } _changeAllDayVisibility() { return (0, _common.noop)() } _getDateHeaderTemplate() { return this.option("timeCellTemplate") } _renderView() { let groupCellTemplates; if (!this.isRenovatedRender()) { groupCellTemplates = this._renderGroupHeader() } this.renderWorkSpace(); if (this.isRenovatedRender()) { this.virtualScrollingDispatcher.updateDimensions() } this._shader = new _m_current_time_shader_horizontal.default(this); this._$sidebarTable.appendTo(this._sidebarScrollable.$content()); if (this.isRenovatedRender() && this._isVerticalGroupedWorkSpace()) { this.renderRGroupPanel() } this.updateHeaderEmptyCellWidth(); this._applyCellTemplates(groupCellTemplates) } _setHorizontalGroupHeaderCellsHeight() { return (0, _common.noop)() } _getTimePanelCells() { return this.$element().find(".dx-scheduler-header-panel-cell:not(.dx-scheduler-header-panel-week-cell)") } _getCurrentTimePanelCellIndices() { const columnCountPerGroup = this._getCellCount(); const today = this._getToday(); const index = this.getCellIndexByDate(today); const { columnIndex: currentTimeColumnIndex } = this._getCellCoordinatesByIndex(index); if (void 0 === currentTimeColumnIndex) { return [] } const horizontalGroupCount = this._isHorizontalGroupedWorkSpace() && !this.isGroupedByDate() ? this._getGroupCount() : 1; return [...new Array(horizontalGroupCount)].map(((_, groupIndex) => columnCountPerGroup * groupIndex + currentTimeColumnIndex)) } _renderTimePanel() { return (0, _common.noop)() } _renderAllDayPanel() { return (0, _common.noop)() } _createAllDayPanelElements() { return (0, _common.noop)() } _renderDateHeader() { const $headerRow = super._renderDateHeader(); if (this._needRenderWeekHeader()) { const firstViewDate = new Date(this.getStartViewDate()); let currentDate = new Date(firstViewDate); const $cells = []; const groupCount = this._getGroupCount(); const cellCountInDay = this._getCellCountInDay(); const colSpan = this.isGroupedByDate() ? cellCountInDay * groupCount : cellCountInDay; const cellTemplate = this.option("dateCellTemplate"); const horizontalGroupCount = this._isHorizontalGroupedWorkSpace() && !this.isGroupedByDate() ? groupCount : 1; const cellsInGroup = this.viewDataProvider.viewDataGenerator.daysInInterval * this.option("intervalCount"); const cellsCount = cellsInGroup * horizontalGroupCount; for (let templateIndex = 0; templateIndex < cellsCount; templateIndex++) { const $th = (0, _renderer.default)("
").addClass("dx-scheduler-header-row").append($cells); $headerRow.before($row) } } _renderIndicator(height, rtlOffset, $container, groupCount) { let $indicator; const width = this.getIndicationWidth(); if ("vertical" === this.option("groupOrientation")) { $indicator = this._createIndicator($container); (0, _size.setHeight)($indicator, (0, _position.getBoundingRect)($container.get(0)).height); $indicator.css("left", rtlOffset ? rtlOffset - width : width) } else { for (let i = 0; i < groupCount; i++) { const offset = this.isGroupedByDate() ? i * this.getCellWidth() : this._getCellCount() * this.getCellWidth() * i; $indicator = this._createIndicator($container); (0, _size.setHeight)($indicator, (0, _position.getBoundingRect)($container.get(0)).height); $indicator.css("left", rtlOffset ? rtlOffset - width - offset : width + offset) } } } _makeGroupRows(groups, groupByDate) { const tableCreatorStrategy = "vertical" === this.option("groupOrientation") ? tableCreator.VERTICAL : tableCreator.HORIZONTAL; return tableCreator.makeGroupedTable(tableCreatorStrategy, groups, { groupRowClass: _m_classes.GROUP_ROW_CLASS, groupHeaderRowClass: _m_classes.GROUP_ROW_CLASS, groupHeaderClass: this._getGroupHeaderClass.bind(this), groupHeaderContentClass: _m_classes.GROUP_HEADER_CONTENT_CLASS }, this._getCellCount() || 1, this.option("resourceCellTemplate"), this._getTotalRowCount(this._getGroupCount()), groupByDate) } _setCurrentTimeCells() { const timePanelCells = this._getTimePanelCells(); const currentTimeCellIndices = this._getCurrentTimePanelCellIndices(); currentTimeCellIndices.forEach((timePanelCellIndex => { timePanelCells.eq(timePanelCellIndex).addClass(_m_classes.HEADER_CURRENT_TIME_CELL_CLASS) })) } _cleanCurrentTimeCells() { this.$element().find(`.${_m_classes.HEADER_CURRENT_TIME_CELL_CLASS}`).removeClass(_m_classes.HEADER_CURRENT_TIME_CELL_CLASS) } }(0, _component_registrator.default)("dxSchedulerTimeline", SchedulerTimeline); exports.default = SchedulerTimeline }, 10356: /*!***********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_timeline_day.js ***! \***********************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 99393)); var _m_constants = __webpack_require__( /*! ../m_constants */ 6324); var _m_timeline = _interopRequireDefault(__webpack_require__( /*! ./m_timeline */ 92297)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } class SchedulerTimelineDay extends _m_timeline.default { get type() { return _m_constants.VIEWS.TIMELINE_DAY } _getElementClass() { return "dx-scheduler-timeline-day" } _needRenderWeekHeader() { return this._isWorkSpaceWithCount() } }(0, _component_registrator.default)("dxSchedulerTimelineDay", SchedulerTimelineDay); exports.default = SchedulerTimelineDay }, 91274: /*!*************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_timeline_month.js ***! \*************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 99393)); var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198)); var _index = __webpack_require__( /*! ../../scheduler/r1/components/index */ 42515); var _index2 = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084); var _m_constants = __webpack_require__( /*! ../m_constants */ 6324); var _m_timeline = _interopRequireDefault(__webpack_require__( /*! ./m_timeline */ 92297)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } class SchedulerTimelineMonth extends _m_timeline.default { constructor() { super(...arguments); this.viewDirection = "horizontal" } get type() { return _m_constants.VIEWS.TIMELINE_MONTH } get renovatedHeaderPanelComponent() { return _index.HeaderPanelComponent } _renderView() { super._renderView(); this._updateScrollable() } _getElementClass() { return "dx-scheduler-timeline-month" } _getDateHeaderTemplate() { return this.option("dateCellTemplate") } _calculateDurationInCells(timeDiff) { return timeDiff / this.getCellDuration() } isIndicatorVisible() { return true } _getFormat() { return _index2.formatWeekdayAndDay } _getIntervalBetween(currentDate) { const firstViewDate = this.getStartViewDate(); const timeZoneOffset = _date.default.getTimezonesDifference(firstViewDate, currentDate); return currentDate.getTime() - (firstViewDate.getTime() - 36e5 * this.option("startDayHour")) - timeZoneOffset } _getViewStartByOptions() { return _index2.monthUtils.getViewStartByOptions(this.option("startDate"), this.option("currentDate"), this.option("intervalCount"), _date.default.getFirstMonthDate(this.option("startDate"))) } generateRenderOptions() { const options = super.generateRenderOptions(true); return _extends({}, options, { getDateForHeaderText: (_, date) => date }) } keepOriginalHours() { return true } }(0, _component_registrator.default)("dxSchedulerTimelineMonth", SchedulerTimelineMonth); exports.default = SchedulerTimelineMonth }, 32414: /*!************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_timeline_week.js ***! \************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 99393)); var _position = __webpack_require__( /*! ../../../core/utils/position */ 37518); var _m_constants = __webpack_require__( /*! ../m_constants */ 6324); var _m_timeline = _interopRequireDefault(__webpack_require__( /*! ./m_timeline */ 92297)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } class SchedulerTimelineWeek extends _m_timeline.default { get type() { return _m_constants.VIEWS.TIMELINE_WEEK } _getElementClass() { return "dx-scheduler-timeline-week" } _getHeaderPanelCellWidth($headerRow) { return (0, _position.getBoundingRect)($headerRow.children().first().get(0)).width } _needRenderWeekHeader() { return true } _incrementDate(date) { date.setDate(date.getDate() + 1) } } exports.default = SchedulerTimelineWeek; (0, _component_registrator.default)("dxSchedulerTimelineWeek", SchedulerTimelineWeek) }, 23855: /*!*****************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_timeline_work_week.js ***! \*****************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 99393)); var _index = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084); var _m_constants = __webpack_require__( /*! ../m_constants */ 6324); var _m_timeline_week = _interopRequireDefault(__webpack_require__( /*! ./m_timeline_week */ 32414)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } class SchedulerTimelineWorkWeek extends _m_timeline_week.default { get type() { return _m_constants.VIEWS.TIMELINE_WORK_WEEK } constructor() { super(...arguments); this._getWeekendsCount = _index.getWeekendsCount } _getElementClass() { return "dx-scheduler-timeline-work-week" } _incrementDate(date) { const day = date.getDay(); if (5 === day) { date.setDate(date.getDate() + 2) } super._incrementDate(date) } }(0, _component_registrator.default)("dxSchedulerTimelineWorkWeek", SchedulerTimelineWorkWeek); exports.default = SchedulerTimelineWorkWeek }, 33350: /*!****************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_virtual_scrolling.js ***! \****************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.VirtualScrollingRenderer = exports.VirtualScrollingDispatcher = void 0; var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../core/dom_adapter */ 73349)); var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922); var _window = __webpack_require__( /*! ../../../core/utils/window */ 58201); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../events/core/events_engine */ 55994)); var _index = __webpack_require__( /*! ../../../events/utils/index */ 39611); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const DOCUMENT_SCROLL_EVENT_NAMESPACE = (0, _index.addNamespace)("scroll", "dxSchedulerVirtualScrolling"); const scrollingOrientations_vertical = "vertical", scrollingOrientations_horizontal = "horizontal", scrollingOrientations_both = "both", scrollingOrientations_none = "none"; const DefaultScrollingOrientation = scrollingOrientations_both; exports.VirtualScrollingDispatcher = class { constructor(options) { this.options = options; if (options) { this._rowHeight = this.getCellHeight(); this._cellWidth = this.getCellWidth(); this._createVirtualScrollingBase() } } get isRTL() { return this.options.isRTL() } get verticalVirtualScrolling() { return this._verticalVirtualScrolling } set verticalVirtualScrolling(value) { this._verticalVirtualScrolling = value } get horizontalVirtualScrolling() { return this._horizontalVirtualScrolling } set horizontalVirtualScrolling(value) { this._horizontalVirtualScrolling = value } get document() { return _dom_adapter.default.getDocument() } get height() { return this.options.getSchedulerHeight() } get width() { return this.options.getSchedulerWidth() } get rowHeight() { return this._rowHeight } set rowHeight(value) { this._rowHeight = value } get outlineCount() { return this.options.getScrolling().outlineCount } get cellWidth() { return this._cellWidth } set cellWidth(value) { this._cellWidth = value } get viewportWidth() { const width = this.width && this.options.getViewWidth(); return width > 0 ? width : this.options.getWindowWidth() } get viewportHeight() { const height = this.height && this.options.getViewHeight(); return height > 0 ? height : this.options.getWindowHeight() } get cellCountInsideTopVirtualRow() { var _this$verticalScrolli; return (null === (_this$verticalScrolli = this.verticalScrollingState) || void 0 === _this$verticalScrolli ? void 0 : _this$verticalScrolli.virtualItemCountBefore) || 0 } get cellCountInsideLeftVirtualCell() { var _this$horizontalScrol; return (null === (_this$horizontalScrol = this.horizontalScrollingState) || void 0 === _this$horizontalScrol ? void 0 : _this$horizontalScrol.virtualItemCountBefore) || 0 } get cellCountInsideRightVirtualCell() { var _this$horizontalScrol2; return (null === (_this$horizontalScrol2 = this.horizontalScrollingState) || void 0 === _this$horizontalScrol2 ? void 0 : _this$horizontalScrol2.virtualItemCountAfter) || 0 } get topVirtualRowsCount() { return this.cellCountInsideTopVirtualRow > 0 ? 1 : 0 } get leftVirtualCellsCount() { const virtualItemsCount = !this.isRTL ? this.cellCountInsideLeftVirtualCell : this.cellCountInsideRightVirtualCell; return Math.ceil(virtualItemsCount / 1e3) } get virtualRowOffset() { var _this$verticalScrolli2; return (null === (_this$verticalScrolli2 = this.verticalScrollingState) || void 0 === _this$verticalScrolli2 ? void 0 : _this$verticalScrolli2.virtualItemSizeBefore) || 0 } get virtualCellOffset() { var _this$horizontalScrol3; return (null === (_this$horizontalScrol3 = this.horizontalScrollingState) || void 0 === _this$horizontalScrol3 ? void 0 : _this$horizontalScrol3.virtualItemSizeBefore) || 0 } get scrollingState() { var _this$verticalVirtual, _this$horizontalVirtu; return { vertical: null === (_this$verticalVirtual = this.verticalVirtualScrolling) || void 0 === _this$verticalVirtual ? void 0 : _this$verticalVirtual.state, horizontal: null === (_this$horizontalVirtu = this.horizontalVirtualScrolling) || void 0 === _this$horizontalVirtu ? void 0 : _this$horizontalVirtu.state } } get verticalScrollingState() { return this.scrollingState.vertical } get horizontalScrollingState() { return this.scrollingState.horizontal } get scrollingOrientation() { const scrolling = this.options.getScrolling(); if ("standard" === scrolling.mode) { return scrollingOrientations_none } return scrolling.orientation || DefaultScrollingOrientation } get verticalScrollingAllowed() { return this.scrollingOrientation === scrollingOrientations_vertical || this.scrollingOrientation === scrollingOrientations_both } get horizontalScrollingAllowed() { return this.scrollingOrientation === scrollingOrientations_horizontal || this.scrollingOrientation === scrollingOrientations_both } setViewOptions(options) { this.options = options; if (this.verticalVirtualScrolling) { this.verticalVirtualScrolling.options = options; this.verticalVirtualScrolling.itemSize = this.rowHeight; this.verticalVirtualScrolling.viewportSize = this.viewportHeight } if (this.horizontalVirtualScrolling) { this.horizontalVirtualScrolling.options = options; this.verticalVirtualScrolling.itemSize = this.cellWidth; this.verticalVirtualScrolling.viewportSize = this.viewportWidth } } getRenderState() { var _this$verticalVirtual2, _this$horizontalVirtu2; const verticalRenderState = (null === (_this$verticalVirtual2 = this.verticalVirtualScrolling) || void 0 === _this$verticalVirtual2 ? void 0 : _this$verticalVirtual2.getRenderState()) || {}; const horizontalRenderState = (null === (_this$horizontalVirtu2 = this.horizontalVirtualScrolling) || void 0 === _this$horizontalVirtu2 ? void 0 : _this$horizontalVirtu2.getRenderState()) || {}; return _extends({}, verticalRenderState, horizontalRenderState) } getCellHeight() { const cellHeight = this.options.getCellHeight(); const result = cellHeight > 0 ? cellHeight : 50; return Math.floor(result) } getCellWidth() { let cellWidth = this.options.getCellWidth(); const minCellWidth = this.options.getCellMinWidth(); if (!cellWidth || cellWidth < minCellWidth) { cellWidth = minCellWidth } const result = cellWidth > 0 ? cellWidth : 1; return Math.floor(result) } calculateCoordinatesByDataAndPosition(cellData, position, date, isCalculateTime, isVerticalDirectionView) { const { rowIndex: rowIndex, columnIndex: columnIndex } = position; const { startDate: startDate, endDate: endDate, allDay: allDay } = cellData; const timeToScroll = date.getTime(); const cellStartTime = startDate.getTime(); const cellEndTime = endDate.getTime(); const scrollInCell = allDay || !isCalculateTime ? 0 : (timeToScroll - cellStartTime) / (cellEndTime - cellStartTime); const cellWidth = this.getCellWidth(); const rowHeight = this.getCellHeight(); const top = isVerticalDirectionView ? (rowIndex + scrollInCell) * rowHeight : rowIndex * rowHeight; let left = isVerticalDirectionView ? columnIndex * cellWidth : (columnIndex + scrollInCell) * cellWidth; if (this.isRTL) { left = this.options.getScrollableOuterWidth() - left } return { top: top, left: left } } dispose() { if (this._onScrollHandler) { _events_engine.default.off(this.document, DOCUMENT_SCROLL_EVENT_NAMESPACE, this._onScrollHandler) } } createVirtualScrolling() { const isVerticalVirtualScrollingCreated = !!this.verticalVirtualScrolling; const isHorizontalVirtualScrollingCreated = !!this.horizontalVirtualScrolling; if (this.verticalScrollingAllowed !== isVerticalVirtualScrollingCreated || this.horizontalScrollingAllowed !== isHorizontalVirtualScrollingCreated) { this._rowHeight = this.getCellHeight(); this._cellWidth = this.getCellWidth(); this._createVirtualScrollingBase() } } _createVirtualScrollingBase() { if (this.verticalScrollingAllowed) { this.verticalVirtualScrolling = new VerticalVirtualScrolling(_extends({}, this.options, { viewportHeight: this.viewportHeight, rowHeight: this.rowHeight, outlineCount: this.outlineCount })) } if (this.horizontalScrollingAllowed) { this.horizontalVirtualScrolling = new HorizontalVirtualScrolling(_extends({}, this.options, { viewportWidth: this.viewportWidth, cellWidth: this.cellWidth, outlineCount: this.outlineCount })) } } isAttachWindowScrollEvent() { return (this.horizontalScrollingAllowed || this.verticalScrollingAllowed) && !this.height } attachScrollableEvents() { if (this.isAttachWindowScrollEvent()) { this._attachWindowScroll() } } _attachWindowScroll() { const window = (0, _window.getWindow)(); this._onScrollHandler = this.options.createAction((() => { const { scrollX: scrollX, scrollY: scrollY } = window; if (scrollX >= 10 || scrollY >= 10) { this.handleOnScrollEvent({ left: scrollX, top: scrollY }) } })); _events_engine.default.on(this.document, DOCUMENT_SCROLL_EVENT_NAMESPACE, this._onScrollHandler) } handleOnScrollEvent(scrollPosition) { if (scrollPosition) { var _this$verticalVirtual3, _this$horizontalVirtu3; const { left: left, top: top } = scrollPosition; const verticalStateChanged = (0, _type.isDefined)(top) && (null === (_this$verticalVirtual3 = this.verticalVirtualScrolling) || void 0 === _this$verticalVirtual3 ? void 0 : _this$verticalVirtual3.updateState(top)); const horizontalStateChanged = (0, _type.isDefined)(left) && (null === (_this$horizontalVirtu3 = this.horizontalVirtualScrolling) || void 0 === _this$horizontalVirtu3 ? void 0 : _this$horizontalVirtu3.updateState(left)); if (verticalStateChanged || horizontalStateChanged) { var _this$options$updateR, _this$options; null === (_this$options$updateR = (_this$options = this.options).updateRender) || void 0 === _this$options$updateR || _this$options$updateR.call(_this$options) } } } updateDimensions(isForce) { const cellHeight = this.getCellHeight(); const needUpdateVertical = this.verticalScrollingAllowed && cellHeight !== this.rowHeight; if ((needUpdateVertical || isForce) && this.verticalVirtualScrolling) { this.rowHeight = cellHeight; this.verticalVirtualScrolling.viewportSize = this.viewportHeight; this.verticalVirtualScrolling.reinitState(cellHeight, isForce) } const cellWidth = this.getCellWidth(); const needUpdateHorizontal = this.horizontalScrollingAllowed && cellWidth !== this.cellWidth; if ((needUpdateHorizontal || isForce) && this.horizontalVirtualScrolling) { this.cellWidth = cellWidth; this.horizontalVirtualScrolling.viewportSize = this.viewportWidth; this.horizontalVirtualScrolling.reinitState(cellWidth, isForce) } if (needUpdateVertical || needUpdateHorizontal) { var _this$options$updateG, _this$options2; null === (_this$options$updateG = (_this$options2 = this.options).updateGrid) || void 0 === _this$options$updateG || _this$options$updateG.call(_this$options2) } } }; class VirtualScrollingBase { constructor(options) { this.options = options; this._state = this.defaultState; this.viewportSize = this.options.viewportSize; this._itemSize = this.options.itemSize; this._position = -1; this._itemSizeChanged = false; this.updateState(0) } get itemSize() { return this._itemSize } set itemSize(value) { this._itemSizeChanged = this._itemSize !== value; this._itemSize = value } get state() { return this._state } set state(value) { this._state = value } get startIndex() { return this.state.startIndex } get pageSize() { return Math.ceil(this.viewportSize / this.itemSize) } get outlineCount() { return (0, _type.isDefined)(this.options.outlineCount) ? this.options.outlineCount : Math.floor(this.pageSize / 2) } get groupCount() { return this.options.getGroupCount() } get isVerticalGrouping() { return this.options.isVerticalGrouping() } get defaultState() { return { prevPosition: 0, startIndex: -1, itemCount: 0, virtualItemCountBefore: 0, virtualItemCountAfter: 0, outlineCountBefore: 0, outlineCountAfter: 0, virtualItemSizeBefore: 0, virtualItemSizeAfter: 0, outlineSizeBefore: 0, outlineSizeAfter: 0 } } get maxScrollPosition() { return this.getTotalItemCount() * this.itemSize - this.viewportSize } get position() { return this._position } set position(value) { this._position = value } needUpdateState(position) { const { prevPosition: prevPosition, startIndex: startIndex } = this.state; const isFirstInitialization = startIndex < 0; if (isFirstInitialization) { return true } let isStartIndexChanged = false; if (this._validateAndSavePosition(position)) { if (0 === position || position === this.maxScrollPosition) { return true } const currentPosition = prevPosition; const currentItemsCount = Math.floor(currentPosition / this.itemSize); const itemsCount = Math.floor(position / this.itemSize); isStartIndexChanged = Math.abs(currentItemsCount - itemsCount) >= this.outlineCount } return isStartIndexChanged } _validateAndSavePosition(position) { if (!(0, _type.isDefined)(position)) { return false } const result = this.position !== position; this.position = position; return result } _correctPosition(position) { return position >= 0 ? Math.min(position, this.maxScrollPosition) : -1 } updateState(position, isForce) { position = this._correctPosition(position); if (!this.needUpdateState(position) && !isForce) { return false } const itemsInfoBefore = this._calcItemInfoBefore(position); const itemsDeltaBefore = this._calcItemDeltaBefore(itemsInfoBefore); const { outlineCountAfter: outlineCountAfter, virtualItemCountAfter: virtualItemCountAfter, itemCountWithAfter: itemCountWithAfter } = this._calcItemInfoAfter(itemsDeltaBefore); const { virtualItemCountBefore: virtualItemCountBefore, outlineCountBefore: outlineCountBefore } = itemsInfoBefore; const itemCount = outlineCountBefore + itemCountWithAfter + outlineCountAfter; const itemCountBefore = Math.floor(position / this.itemSize); this.state.prevPosition = itemCountBefore * this.itemSize; this.state.startIndex = itemCountBefore - outlineCountBefore; this.state.virtualItemCountBefore = virtualItemCountBefore; this.state.outlineCountBefore = outlineCountBefore; this.state.itemCount = itemCount; this.state.outlineCountAfter = outlineCountAfter; this.state.virtualItemCountAfter = virtualItemCountAfter; this._updateStateCore(); return true } reinitState(itemSize, isForceUpdate) { const { position: position } = this; this.itemSize = itemSize; this.updateState(0, isForceUpdate); if (position > 0) { this.updateState(position, isForceUpdate) } } _calcItemInfoBefore(position) { let virtualItemCountBefore = Math.floor(position / this.itemSize); const outlineCountBefore = Math.min(virtualItemCountBefore, this.outlineCount); virtualItemCountBefore -= outlineCountBefore; return { virtualItemCountBefore: virtualItemCountBefore, outlineCountBefore: outlineCountBefore } } _calcItemDeltaBefore(itemInfoBefore) { const { virtualItemCountBefore: virtualItemCountBefore, outlineCountBefore: outlineCountBefore } = itemInfoBefore; const totalItemCount = this.getTotalItemCount(); return totalItemCount - virtualItemCountBefore - outlineCountBefore } getTotalItemCount() { throw "getTotalItemCount method should be implemented" } getRenderState() { throw "getRenderState method should be implemented" } _calcItemInfoAfter(itemsDeltaBefore) { const itemCountWithAfter = itemsDeltaBefore >= this.pageSize ? this.pageSize : itemsDeltaBefore; let virtualItemCountAfter = itemsDeltaBefore - itemCountWithAfter; const outlineCountAfter = virtualItemCountAfter > 0 ? Math.min(virtualItemCountAfter, this.outlineCount) : 0; if (virtualItemCountAfter > 0) { virtualItemCountAfter -= outlineCountAfter } return { virtualItemCountAfter: virtualItemCountAfter, outlineCountAfter: outlineCountAfter, itemCountWithAfter: itemCountWithAfter } } _updateStateCore() { const { state: state } = this; const { virtualItemCountBefore: virtualItemCountBefore } = state; const { virtualItemCountAfter: virtualItemCountAfter } = state; const { outlineCountBefore: outlineCountBefore } = state; const { outlineCountAfter: outlineCountAfter } = state; const prevVirtualItemSizeBefore = state.virtualItemSizeBefore; const prevVirtualItemSizeAfter = state.virtualItemSizeAfter; const prevOutlineSizeBefore = state.outlineSizeBefore; const prevOutlineSizeAfter = state.outlineSizeAfter; const virtualItemSizeBefore = this.itemSize * virtualItemCountBefore; const virtualItemSizeAfter = this.itemSize * virtualItemCountAfter; const outlineSizeBefore = this.itemSize * outlineCountBefore; const outlineSizeAfter = this.itemSize * outlineCountAfter; const prevVirtualSizeBefore = prevVirtualItemSizeBefore + prevOutlineSizeBefore; const virtualSizeBefore = virtualItemSizeBefore + outlineSizeBefore; const prevVirtualSizeAfter = prevVirtualItemSizeAfter + prevOutlineSizeAfter; const virtualSizeAfter = virtualItemSizeAfter + outlineSizeAfter; const isAppend = prevVirtualSizeBefore < virtualSizeBefore; const isPrepend = prevVirtualSizeAfter < virtualSizeAfter; const needAddItems = this._itemSizeChanged || isAppend || isPrepend; if (needAddItems) { this._updateStateVirtualItems(virtualItemSizeBefore, virtualItemSizeAfter) } } _updateStateVirtualItems(virtualItemSizeBefore, virtualItemSizeAfter) { const { state: state } = this; state.virtualItemSizeBefore = virtualItemSizeBefore; state.virtualItemSizeAfter = virtualItemSizeAfter } } class VerticalVirtualScrolling extends VirtualScrollingBase { constructor(options) { super(_extends({}, options, { itemSize: options.rowHeight, viewportSize: options.viewportHeight })) } get prevTopPosition() { return this.state.prevPosition } get rowCount() { return this.state.itemCount } get topVirtualRowCount() { return this.state.virtualItemCountBefore } get bottomVirtualRowCount() { return this.state.virtualItemCountAfter } getTotalItemCount() { return this.options.getTotalRowCount(this.groupCount, this.isVerticalGrouping) } getRenderState() { return { topVirtualRowHeight: this.state.virtualItemSizeBefore, bottomVirtualRowHeight: this.state.virtualItemSizeAfter, startRowIndex: this.state.startIndex, rowCount: this.state.itemCount, startIndex: this.state.startIndex } } } class HorizontalVirtualScrolling extends VirtualScrollingBase { constructor(options) { super(_extends({}, options, { itemSize: options.cellWidth, viewportSize: options.viewportWidth })) } get isRTL() { return this.options.isRTL() } getTotalItemCount() { return this.options.getTotalCellCount(this.groupCount, this.isVerticalGrouping) } getRenderState() { return { leftVirtualCellWidth: this.state.virtualItemSizeBefore, rightVirtualCellWidth: this.state.virtualItemSizeAfter, startCellIndex: this.state.startIndex, cellCount: this.state.itemCount, cellWidth: this.itemSize } } _updateStateVirtualItems(virtualItemSizeBefore, virtualItemSizeAfter) { if (!this.isRTL) { super._updateStateVirtualItems(virtualItemSizeBefore, virtualItemSizeAfter) } else { const { state: state } = this; state.virtualItemSizeAfter = virtualItemSizeBefore; state.virtualItemSizeBefore = virtualItemSizeAfter; state.startIndex = this.getTotalItemCount() - this.startIndex - this.state.itemCount } } } exports.VirtualScrollingRenderer = class { constructor(_workspace) { this._workspace = _workspace; this._renderAppointmentTimeoutID = null } getRenderTimeout() { return 15 } get workspace() { return this._workspace } updateRender() { this._renderGrid(); this._renderAppointments() } _renderGrid() { this.workspace.renderWorkSpace(false) } _renderAppointments() { const renderTimeout = this.getRenderTimeout(); if (renderTimeout >= 0) { clearTimeout(this._renderAppointmentTimeoutID); this._renderAppointmentTimeoutID = setTimeout((() => this.workspace.updateAppointments()), renderTimeout) } else { this.workspace.updateAppointments() } } } }, 48377: /*!*********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_work_space.js ***! \*********************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _translator = __webpack_require__( /*! ../../../animation/translator */ 31648); var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../core/dom_adapter */ 73349)); var _element = __webpack_require__( /*! ../../../core/element */ 6415); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374)); var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576); var _data = __webpack_require__( /*! ../../../core/utils/data */ 47617); var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198)); var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306); var _position = __webpack_require__( /*! ../../../core/utils/position */ 37518); var _size = __webpack_require__( /*! ../../../core/utils/size */ 58664); var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922); var _window = __webpack_require__( /*! ../../../core/utils/window */ 58201); var _click = __webpack_require__( /*! ../../../events/click */ 95429); var _contextmenu = __webpack_require__( /*! ../../../events/contextmenu */ 49166); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../events/core/events_engine */ 55994)); var _drag = __webpack_require__( /*! ../../../events/drag */ 23174); var _pointer = _interopRequireDefault(__webpack_require__( /*! ../../../events/pointer */ 93786)); var _index = __webpack_require__( /*! ../../../events/utils/index */ 39611); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../localization/message */ 28109)); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../ui/scroll_view/ui.scrollable */ 41183)); var _ui2 = _interopRequireDefault(__webpack_require__( /*! ../../../ui/widget/ui.errors */ 96688)); var _scroll = __webpack_require__( /*! ../../core/utils/scroll */ 97944); var _index2 = __webpack_require__( /*! ../../scheduler/r1/components/index */ 42515); var _index3 = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084); var _m_widget_observer = _interopRequireDefault(__webpack_require__( /*! ../base/m_widget_observer */ 79427)); var _m_appointment_drag_behavior = _interopRequireDefault(__webpack_require__( /*! ../m_appointment_drag_behavior */ 54915)); var _m_classes = __webpack_require__( /*! ../m_classes */ 43600); var _m_constants = __webpack_require__( /*! ../m_constants */ 6324); var _m_table_creator = _interopRequireDefault(__webpack_require__( /*! ../m_table_creator */ 82215)); var _m_utils = __webpack_require__( /*! ../m_utils */ 84110); var _m_utils2 = __webpack_require__( /*! ../resources/m_utils */ 31359); var _m_current_time_shader_vertical = _interopRequireDefault(__webpack_require__( /*! ../shaders/m_current_time_shader_vertical */ 11029)); var _m_position_helper = __webpack_require__( /*! ./helpers/m_position_helper */ 94654); var _m_cache = __webpack_require__( /*! ./m_cache */ 14553); var _m_cells_selection_controller = __webpack_require__( /*! ./m_cells_selection_controller */ 78151); var _m_cells_selection_state = _interopRequireDefault(__webpack_require__( /*! ./m_cells_selection_state */ 20191)); var _m_virtual_scrolling = __webpack_require__( /*! ./m_virtual_scrolling */ 33350); var _m_work_space_grouped_strategy_horizontal = _interopRequireDefault(__webpack_require__( /*! ./m_work_space_grouped_strategy_horizontal */ 48854)); var _m_work_space_grouped_strategy_vertical = _interopRequireDefault(__webpack_require__( /*! ./m_work_space_grouped_strategy_vertical */ 2862)); var _m_view_data_provider = _interopRequireDefault(__webpack_require__( /*! ./view_model/m_view_data_provider */ 52974)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const { tableCreator: tableCreator } = _m_table_creator.default; const { abstract: abstract } = _m_widget_observer.default; const toMs = _date.default.dateToMilliseconds; const ALL_DAY_TABLE_CELL_CLASS = "dx-scheduler-all-day-table-cell"; const DATE_TABLE_CELL_CLASS = "dx-scheduler-date-table-cell"; const SCHEDULER_WORKSPACE_DXPOINTERDOWN_EVENT_NAME = (0, _index.addNamespace)(_pointer.default.down, "dxSchedulerWorkSpace"); const DragEventNames = { ENTER: (0, _index.addNamespace)(_drag.enter, "dxSchedulerDateTable"), DROP: (0, _index.addNamespace)(_drag.drop, "dxSchedulerDateTable"), LEAVE: (0, _index.addNamespace)(_drag.leave, "dxSchedulerDateTable") }; const SCHEDULER_CELL_DXCLICK_EVENT_NAME = (0, _index.addNamespace)(_click.name, "dxSchedulerDateTable"); const SCHEDULER_CELL_DXPOINTERDOWN_EVENT_NAME = (0, _index.addNamespace)(_pointer.default.down, "dxSchedulerDateTable"); const SCHEDULER_CELL_DXPOINTERUP_EVENT_NAME = (0, _index.addNamespace)(_pointer.default.up, "dxSchedulerDateTable"); const SCHEDULER_CELL_DXPOINTERMOVE_EVENT_NAME = (0, _index.addNamespace)(_pointer.default.move, "dxSchedulerDateTable"); const DAY_MS = toMs("day"); const HOUR_MS = toMs("hour"); const DRAG_AND_DROP_SELECTOR = `.${_m_classes.DATE_TABLE_CLASS} td, .dx-scheduler-all-day-table td`; const CELL_SELECTOR = `.${DATE_TABLE_CELL_CLASS}, .${ALL_DAY_TABLE_CELL_CLASS}`; const DEFAULT_WORKSPACE_RENDER_OPTIONS = { renderComponents: { header: true, timePanel: true, dateTable: true, allDayPanel: true }, generateNewData: true }; class SchedulerWorkSpace extends _m_widget_observer.default { constructor() { super(...arguments); this.viewDirection = "vertical" } get type() { return "" } get viewDataProvider() { if (!this._viewDataProvider) { this._viewDataProvider = new _m_view_data_provider.default(this.type) } return this._viewDataProvider } get cache() { if (!this._cache) { this._cache = new _m_cache.Cache } return this._cache } get cellsSelectionState() { if (!this._cellsSelectionState) { this._cellsSelectionState = new _m_cells_selection_state.default(this.viewDataProvider); const selectedCellsOption = this.option("selectedCellData"); if ((null === selectedCellsOption || void 0 === selectedCellsOption ? void 0 : selectedCellsOption.length) > 0) { const validSelectedCells = selectedCellsOption.map((selectedCell => { const { groups: groups } = selectedCell; if (!groups || 0 === this._getGroupCount()) { return _extends({}, selectedCell, { groupIndex: 0 }) } const groupIndex = this._getGroupIndexByResourceId(groups); return _extends({}, selectedCell, { groupIndex: groupIndex }) })); this._cellsSelectionState.setSelectedCellsByData(validSelectedCells) } } return this._cellsSelectionState } get cellsSelectionController() { if (!this._cellsSelectionController) { this._cellsSelectionController = new _m_cells_selection_controller.CellsSelectionController } return this._cellsSelectionController } get isAllDayPanelVisible() { return this._isShowAllDayPanel() && this.supportAllDayRow() } get verticalGroupTableClass() { return "dx-scheduler-work-space-vertical-group-table" } get renovatedHeaderPanelComponent() { return _index2.HeaderPanelComponent } get timeZoneCalculator() { return this.option("timeZoneCalculator") } get isDefaultDraggingMode() { return "default" === this.option("draggingMode") } _supportedKeys() { const clickHandler = function(e) { e.preventDefault(); e.stopPropagation(); const selectedCells = this.cellsSelectionState.getSelectedCells(); if (null !== selectedCells && void 0 !== selectedCells && selectedCells.length) { const selectedCellsElement = selectedCells.map((cellData => this._getCellByData(cellData))).filter((cell => !!cell)); e.target = selectedCellsElement; this._showPopup = true; this._cellClickAction({ event: e, cellElement: (0, _renderer.default)(selectedCellsElement), cellData: selectedCells[0] }) } }; const onArrowPressed = (e, key) => { var _this$cellsSelectionS; e.preventDefault(); e.stopPropagation(); const focusedCellData = null === (_this$cellsSelectionS = this.cellsSelectionState.focusedCell) || void 0 === _this$cellsSelectionS ? void 0 : _this$cellsSelectionS.cellData; if (focusedCellData) { const isAllDayPanelCell = focusedCellData.allDay && !this._isVerticalGroupedWorkSpace(); const isMultiSelection = e.shiftKey; const isMultiSelectionAllowed = this.option("allowMultipleCellSelection"); const isRTL = this._isRTL(); const groupCount = this._getGroupCount(); const isGroupedByDate = this.isGroupedByDate(); const isHorizontalGrouping = this._isHorizontalGroupedWorkSpace(); const focusedCellPosition = this.viewDataProvider.findCellPositionInMap(_extends({}, focusedCellData, { isAllDay: focusedCellData.allDay })); const edgeIndices = isHorizontalGrouping && isMultiSelection && !isGroupedByDate ? this.viewDataProvider.getGroupEdgeIndices(focusedCellData.groupIndex, isAllDayPanelCell) : this.viewDataProvider.getViewEdgeIndices(isAllDayPanelCell); const nextCellData = this.cellsSelectionController.handleArrowClick({ focusedCellPosition: focusedCellPosition, edgeIndices: edgeIndices, isRTL: isRTL, isGroupedByDate: isGroupedByDate, groupCount: groupCount, isMultiSelection: isMultiSelection, isMultiSelectionAllowed: isMultiSelectionAllowed, viewType: this.type, key: key, getCellDataByPosition: this.viewDataProvider.getCellData.bind(this.viewDataProvider), isAllDayPanelCell: isAllDayPanelCell, focusedCellData: focusedCellData }); this._processNextSelectedCell(nextCellData, focusedCellData, isMultiSelection && isMultiSelectionAllowed) } }; return (0, _extend.extend)(super._supportedKeys(), { enter: clickHandler, space: clickHandler, downArrow: e => { onArrowPressed(e, "down") }, upArrow: e => { onArrowPressed(e, "up") }, rightArrow: e => { onArrowPressed(e, "right") }, leftArrow: e => { onArrowPressed(e, "left") } }) } _isRTL() { return this.option("rtlEnabled") } _moveToCell($cell, isMultiSelection) { if (!(0, _type.isDefined)($cell) || !$cell.length) { return } const isMultiSelectionAllowed = this.option("allowMultipleCellSelection"); const currentCellData = this._getFullCellData($cell); const focusedCellData = this.cellsSelectionState.focusedCell.cellData; const nextFocusedCellData = this.cellsSelectionController.moveToCell({ isMultiSelection: isMultiSelection, isMultiSelectionAllowed: isMultiSelectionAllowed, currentCellData: currentCellData, focusedCellData: focusedCellData, isVirtualCell: $cell.hasClass(_m_classes.VIRTUAL_CELL_CLASS) }); this._processNextSelectedCell(nextFocusedCellData, focusedCellData, isMultiSelectionAllowed && isMultiSelection) } _processNextSelectedCell(nextCellData, focusedCellData, isMultiSelection) { const nextCellPosition = this.viewDataProvider.findCellPositionInMap({ startDate: nextCellData.startDate, groupIndex: nextCellData.groupIndex, isAllDay: nextCellData.allDay, index: nextCellData.index }); if (!this.viewDataProvider.isSameCell(focusedCellData, nextCellData)) { const $cell = nextCellData.allDay && !this._isVerticalGroupedWorkSpace() ? this._dom_getAllDayPanelCell(nextCellPosition.columnIndex) : this._dom_getDateCell(nextCellPosition); const isNextCellAllDay = nextCellData.allDay; this._setSelectedCellsStateAndUpdateSelection(isNextCellAllDay, nextCellPosition, isMultiSelection, $cell); this._dateTableScrollable.scrollToElement($cell) } } _setSelectedCellsStateAndUpdateSelection(isAllDay, cellPosition, isMultiSelection, $nextFocusedCell) { const nextCellCoordinates = { rowIndex: cellPosition.rowIndex, columnIndex: cellPosition.columnIndex, allDay: isAllDay }; this.cellsSelectionState.setFocusedCell(nextCellCoordinates.rowIndex, nextCellCoordinates.columnIndex, isAllDay); if (isMultiSelection) { this.cellsSelectionState.setSelectedCells(nextCellCoordinates) } else { this.cellsSelectionState.setSelectedCells(nextCellCoordinates, nextCellCoordinates) } this.updateCellsSelection(); this._updateSelectedCellDataOption(this.cellsSelectionState.getSelectedCells(), $nextFocusedCell) } _hasAllDayClass($cell) { return $cell.hasClass(ALL_DAY_TABLE_CELL_CLASS) } _focusInHandler(e) { if ((0, _renderer.default)(e.target).is(this._focusTarget()) && false !== this._isCellClick) { delete this._isCellClick; delete this._contextMenuHandled; super._focusInHandler.apply(this, arguments); this.cellsSelectionState.restoreSelectedAndFocusedCells(); if (!this.cellsSelectionState.focusedCell) { const cellCoordinates = { columnIndex: 0, rowIndex: 0, allDay: this._isVerticalGroupedWorkSpace() && this.isAllDayPanelVisible }; this.cellsSelectionState.setFocusedCell(cellCoordinates.rowIndex, cellCoordinates.columnIndex, cellCoordinates.allDay); this.cellsSelectionState.setSelectedCells(cellCoordinates, cellCoordinates) } this.updateCellsSelection(); this._updateSelectedCellDataOption(this.cellsSelectionState.getSelectedCells()) } } _focusOutHandler() { super._focusOutHandler.apply(this, arguments); if (!this._contextMenuHandled && !this._disposed) { this.cellsSelectionState.releaseSelectedAndFocusedCells(); this.viewDataProvider.updateViewData(this.generateRenderOptions()); this.updateCellsSelection() } } _focusTarget() { return this.$element() } _isVerticalGroupedWorkSpace() { var _this$option; return !!(null !== (_this$option = this.option("groups")) && void 0 !== _this$option && _this$option.length) && "vertical" === this.option("groupOrientation") } _isHorizontalGroupedWorkSpace() { var _this$option2; return !!(null !== (_this$option2 = this.option("groups")) && void 0 !== _this$option2 && _this$option2.length) && "horizontal" === this.option("groupOrientation") } _isWorkSpaceWithCount() { return this.option("intervalCount") > 1 } _isWorkspaceWithOddCells() { return .5 === this.option("hoursInterval") && !this.isVirtualScrolling() } _getRealGroupOrientation() { return this._isVerticalGroupedWorkSpace() ? "vertical" : "horizontal" } createRAllDayPanelElements() { this._$allDayPanel = (0, _renderer.default)("
").addClass("dx-scheduler-all-day-panel"); this._$allDayTitle = (0, _renderer.default)("
").appendTo(this._$headerPanelEmptyCell) } _dateTableScrollableConfig() { let config = { useKeyboard: false, bounceEnabled: false, updateManually: true, onScroll: () => { var _this$_groupedStrateg; null === (_this$_groupedStrateg = this._groupedStrategy.cache) || void 0 === _this$_groupedStrateg || _this$_groupedStrateg.clear() } }; if (this._needCreateCrossScrolling()) { config = (0, _extend.extend)(config, this._createCrossScrollingConfig(config)) } if (this.isVirtualScrolling() && (this.virtualScrollingDispatcher.horizontalScrollingAllowed || this.virtualScrollingDispatcher.height)) { const currentOnScroll = config.onScroll; config = _extends({}, config, { onScroll: e => { null === currentOnScroll || void 0 === currentOnScroll || currentOnScroll(e); this.virtualScrollingDispatcher.handleOnScrollEvent(null === e || void 0 === e ? void 0 : e.scrollOffset) } }) } return config } _createCrossScrollingConfig(_ref) { let { onScroll: onScroll } = _ref; return { direction: "both", onScroll: event => { null === onScroll || void 0 === onScroll || onScroll(); this._scrollSync.sidebar({ top: event.scrollOffset.top }); this._scrollSync.header({ left: event.scrollOffset.left }) }, onEnd: () => { this.option("onScrollEnd")() } } } _headerScrollableConfig() { return { useKeyboard: false, showScrollbar: "never", direction: "horizontal", useNative: false, updateManually: true, bounceEnabled: false, onScroll: event => { this._scrollSync.dateTable({ left: event.scrollOffset.left }) } } } _visibilityChanged(visible) { this.cache.clear(); if (visible) { this._updateGroupTableHeight() } if (visible && this._needCreateCrossScrolling()) { this._setTableSizes() } } _setTableSizes() { this.cache.clear(); this._attachTableClasses(); let cellWidth = this.getCellWidth(); if (cellWidth < this.getCellMinWidth()) { cellWidth = this.getCellMinWidth() } const minWidth = this.getWorkSpaceMinWidth(); const groupCount = this._getGroupCount(); const totalCellCount = this._getTotalCellCount(groupCount); let width = cellWidth * totalCellCount; if (width < minWidth) { width = minWidth }(0, _size.setWidth)(this._$headerPanel, width); (0, _size.setWidth)(this._$dateTable, width); if (this._$allDayTable) { (0, _size.setWidth)(this._$allDayTable, width) } this._attachHeaderTableClasses(); this._updateGroupTableHeight(); this._updateScrollable() } getWorkSpaceMinWidth() { return this._groupedStrategy.getWorkSpaceMinWidth() } _dimensionChanged() { if (!this._isVisible()) { return } if (this.option("crossScrollingEnabled")) { this._setTableSizes() } this.updateHeaderEmptyCellWidth(); this._updateScrollable(); this.cache.clear() } _needCreateCrossScrolling() { return this.option("crossScrollingEnabled") } _getElementClass() { return (0, _common.noop)() } _getRowCount() { return this.viewDataProvider.getRowCount({ intervalCount: this.option("intervalCount"), currentDate: this.option("currentDate"), viewType: this.type, hoursInterval: this.option("hoursInterval"), startDayHour: this.option("startDayHour"), endDayHour: this.option("endDayHour") }) } _getCellCount() { return this.viewDataProvider.getCellCount({ intervalCount: this.option("intervalCount"), currentDate: this.option("currentDate"), viewType: this.type, hoursInterval: this.option("hoursInterval"), startDayHour: this.option("startDayHour"), endDayHour: this.option("endDayHour") }) } isRenovatedRender() { return this.renovatedRenderSupported() && this.option("renovateRender") } _isVirtualModeOn() { return "virtual" === this.option("scrolling.mode") } isVirtualScrolling() { return this.isRenovatedRender() && this._isVirtualModeOn() } _initVirtualScrolling() { if (this.virtualScrollingDispatcher) { this.virtualScrollingDispatcher.dispose(); this.virtualScrollingDispatcher = null } this.virtualScrollingDispatcher = new _m_virtual_scrolling.VirtualScrollingDispatcher(this._getVirtualScrollingDispatcherOptions()); this.virtualScrollingDispatcher.attachScrollableEvents(); this.renderer = new _m_virtual_scrolling.VirtualScrollingRenderer(this) } onDataSourceChanged(argument) {} isGroupedAllDayPanel() { return (0, _index3.calculateIsGroupedAllDayPanel)(this.option("groups"), this.option("groupOrientation"), this.isAllDayPanelVisible) } generateRenderOptions(isProvideVirtualCellsWidth) { var _this$_getToday; const groupCount = this._getGroupCount(); const groupOrientation = groupCount > 0 ? this.option("groupOrientation") : this._getDefaultGroupStrategy(); const options = _extends({ groupByDate: this.option("groupByDate"), startRowIndex: 0, startCellIndex: 0, groupOrientation: groupOrientation, today: null === (_this$_getToday = this._getToday) || void 0 === _this$_getToday ? void 0 : _this$_getToday.call(this), groups: this.option("groups"), isProvideVirtualCellsWidth: isProvideVirtualCellsWidth, isAllDayPanelVisible: this.isAllDayPanelVisible, selectedCells: this.cellsSelectionState.getSelectedCells(), focusedCell: this.cellsSelectionState.focusedCell, headerCellTextFormat: this._getFormat(), getDateForHeaderText: (_, date) => date, viewOffset: this.option("viewOffset"), startDayHour: this.option("startDayHour"), endDayHour: this.option("endDayHour"), cellDuration: this.getCellDuration(), viewType: this.type, intervalCount: this.option("intervalCount"), hoursInterval: this.option("hoursInterval"), currentDate: this.option("currentDate"), startDate: this.option("startDate"), firstDayOfWeek: this.option("firstDayOfWeek"), showCurrentTimeIndicator: this.option("showCurrentTimeIndicator") }, this.virtualScrollingDispatcher.getRenderState()); return options } renovatedRenderSupported() { return true } _updateGroupTableHeight() { if (this._isVerticalGroupedWorkSpace() && (0, _window.hasWindow)()) { this._setHorizontalGroupHeaderCellsHeight() } } updateHeaderEmptyCellWidth() { if ((0, _window.hasWindow)() && this._isRenderHeaderPanelEmptyCell()) { const timePanelWidth = this.getTimePanelWidth(); const groupPanelWidth = this.getGroupTableWidth(); this._$headerPanelEmptyCell.css("width", timePanelWidth + groupPanelWidth) } } _isGroupsSpecified(resources) { var _this$option3; return (null === (_this$option3 = this.option("groups")) || void 0 === _this$option3 ? void 0 : _this$option3.length) && resources } _getGroupIndexByResourceId(id) { const groups = this.option("groups"); const resourceTree = (0, _m_utils2.createResourcesTree)(groups); if (!resourceTree.length) { return 0 } return this._getGroupIndexRecursively(resourceTree, id) } _getGroupIndexRecursively(resourceTree, id) { const currentKey = resourceTree[0].name; const currentValue = id[currentKey]; return resourceTree.reduce(((prevIndex, _ref2) => { let { leafIndex: leafIndex, value: value, children: children } = _ref2; const areValuesEqual = currentValue === value; if (areValuesEqual && void 0 !== leafIndex) { return leafIndex } if (areValuesEqual) { return this._getGroupIndexRecursively(children, id) } return prevIndex }), 0) } _getViewStartByOptions() { return (0, _index3.getViewStartByOptions)(this.option("startDate"), this.option("currentDate"), this._getIntervalDuration(), this.option("startDate") ? this._calculateViewStartDate() : void 0) } _getIntervalDuration() { return this.viewDataProvider.getIntervalDuration(this.option("intervalCount")) } _getHeaderDate() { return this.getStartViewDate() } _calculateViewStartDate() { return (0, _index3.calculateViewStartDate)(this.option("startDate")) } _firstDayOfWeek() { return this.viewDataProvider.getFirstDayOfWeek(this.option("firstDayOfWeek")) } _attachEvents() { this._createSelectionChangedAction(); this._attachClickEvent(); this._attachContextMenuEvent() } _attachClickEvent() { const that = this; const pointerDownAction = this._createAction((e => { that._pointerDownHandler(e.event) })); this._createCellClickAction(); const cellSelector = `.${DATE_TABLE_CELL_CLASS},.${ALL_DAY_TABLE_CELL_CLASS}`; const $element = this.$element(); _events_engine.default.off($element, SCHEDULER_WORKSPACE_DXPOINTERDOWN_EVENT_NAME); _events_engine.default.off($element, SCHEDULER_CELL_DXCLICK_EVENT_NAME); _events_engine.default.on($element, SCHEDULER_WORKSPACE_DXPOINTERDOWN_EVENT_NAME, (e => { if ((0, _index.isMouseEvent)(e) && e.which > 1) { e.preventDefault(); return } pointerDownAction({ event: e }) })); _events_engine.default.on($element, SCHEDULER_CELL_DXCLICK_EVENT_NAME, cellSelector, (e => { const $cell = (0, _renderer.default)(e.target); that._cellClickAction({ event: e, cellElement: (0, _element.getPublicElement)($cell), cellData: that.getCellData($cell) }) })) } _createCellClickAction() { this._cellClickAction = this._createActionByOption("onCellClick", { afterExecute: e => this._cellClickHandler(e.args[0].event) }) } _createSelectionChangedAction() { this._selectionChangedAction = this._createActionByOption("onSelectionChanged") } _cellClickHandler(argument) { if (this._showPopup) { delete this._showPopup; this._handleSelectedCellsClick() } } _pointerDownHandler(e) { const $target = (0, _renderer.default)(e.target); if (!$target.hasClass(DATE_TABLE_CELL_CLASS) && !$target.hasClass(ALL_DAY_TABLE_CELL_CLASS)) { this._isCellClick = false; return } this._isCellClick = true; if ($target.hasClass("dx-scheduler-focused-cell")) { this._showPopup = true } else { const cellCoordinates = this._getCoordinatesByCell($target); const isAllDayCell = this._hasAllDayClass($target); this._setSelectedCellsStateAndUpdateSelection(isAllDayCell, cellCoordinates, false, $target) } } _handleSelectedCellsClick() { const selectedCells = this.cellsSelectionState.getSelectedCells(); const firstCellData = selectedCells[0]; const lastCellData = selectedCells[selectedCells.length - 1]; const result = { startDate: firstCellData.startDate, endDate: lastCellData.endDate }; if (void 0 !== lastCellData.allDay) { result.allDay = lastCellData.allDay } this.option("onSelectedCellsClick")(result, lastCellData.groups) } _attachContextMenuEvent() { this._createContextMenuAction(); const cellSelector = `.${DATE_TABLE_CELL_CLASS},.${ALL_DAY_TABLE_CELL_CLASS}`; const $element = this.$element(); const eventName = (0, _index.addNamespace)(_contextmenu.name, this.NAME); _events_engine.default.off($element, eventName, cellSelector); _events_engine.default.on($element, eventName, cellSelector, this._contextMenuHandler.bind(this)) } _contextMenuHandler(e) { const $cell = (0, _renderer.default)(e.target); this._contextMenuAction({ event: e, cellElement: (0, _element.getPublicElement)($cell), cellData: this.getCellData($cell) }); this._contextMenuHandled = true } _createContextMenuAction() { this._contextMenuAction = this._createActionByOption("onCellContextMenu") } _getGroupHeaderContainer() { if (this._isVerticalGroupedWorkSpace()) { return this._$groupTable } return this._$thead } _getDateHeaderContainer() { return this._$thead } _getCalculateHeaderCellRepeatCount() { return this._groupedStrategy.calculateHeaderCellRepeatCount() } _updateScrollable() { var _this$_headerScrollab, _this$_sidebarScrolla; this._dateTableScrollable.update(); null === (_this$_headerScrollab = this._headerScrollable) || void 0 === _this$_headerScrollab || _this$_headerScrollab.update(); null === (_this$_sidebarScrolla = this._sidebarScrollable) || void 0 === _this$_sidebarScrolla || _this$_sidebarScrolla.update() } _getTimePanelRowCount() { return this._getCellCountInDay() } _getCellCountInDay() { const hoursInterval = this.option("hoursInterval"); const startDayHour = this.option("startDayHour"); const endDayHour = this.option("endDayHour"); return this.viewDataProvider.getCellCountInDay(startDayHour, endDayHour, hoursInterval) } _getTotalCellCount(groupCount) { return this._groupedStrategy.getTotalCellCount(groupCount) } _getTotalRowCount(groupCount, includeAllDayPanelRows) { let result = this._groupedStrategy.getTotalRowCount(groupCount); if (includeAllDayPanelRows && this.isAllDayPanelVisible) { result += groupCount } return result } _getGroupIndex(rowIndex, columnIndex) { return this._groupedStrategy.getGroupIndex(rowIndex, columnIndex) } calculateEndDate(startDate) { const { viewDataGenerator: viewDataGenerator } = this.viewDataProvider; return viewDataGenerator.calculateEndDate(startDate, viewDataGenerator.getInterval(this.option("hoursInterval")), this.option("endDayHour")) } _getGroupCount() { return (0, _index3.getGroupCount)(this.option("groups")) } _attachTablesEvents() { const element = this.$element(); this._attachDragEvents(element); this._attachPointerEvents(element) } _detachDragEvents(element) { _events_engine.default.off(element, DragEventNames.ENTER); _events_engine.default.off(element, DragEventNames.LEAVE); _events_engine.default.off(element, DragEventNames.DROP) } _attachDragEvents(element) { this._detachDragEvents(element); _events_engine.default.on(element, DragEventNames.ENTER, DRAG_AND_DROP_SELECTOR, { checkDropTarget: (target, event) => !this._isOutsideScrollable(target, event) }, (e => { if (!this.preventDefaultDragging) { this.removeDroppableCellClass(); (0, _renderer.default)(e.target).addClass("dx-scheduler-date-table-droppable-cell") } })); _events_engine.default.on(element, DragEventNames.LEAVE, (() => { if (!this.preventDefaultDragging) { this.removeDroppableCellClass() } })); _events_engine.default.on(element, DragEventNames.DROP, DRAG_AND_DROP_SELECTOR, (() => { var _this$dragBehavior, _this$dragBehavior$dr; if (!this.dragBehavior) { return } if (!(null !== (_this$dragBehavior = this.dragBehavior) && void 0 !== _this$dragBehavior && _this$dragBehavior.dragBetweenComponentsPromise)) { this.dragBehavior.removeDroppableClasses(); return } null === (_this$dragBehavior$dr = this.dragBehavior.dragBetweenComponentsPromise) || void 0 === _this$dragBehavior$dr || _this$dragBehavior$dr.then((() => { this.dragBehavior.removeDroppableClasses() })) })) } _attachPointerEvents(element) { let isPointerDown = false; _events_engine.default.off(element, SCHEDULER_CELL_DXPOINTERMOVE_EVENT_NAME); _events_engine.default.off(element, SCHEDULER_CELL_DXPOINTERDOWN_EVENT_NAME); _events_engine.default.on(element, SCHEDULER_CELL_DXPOINTERDOWN_EVENT_NAME, DRAG_AND_DROP_SELECTOR, (e => { if ((0, _index.isMouseEvent)(e) && 1 === e.which) { isPointerDown = true; this.$element().addClass("dx-scheduler-work-space-mouse-selection"); _events_engine.default.off(_dom_adapter.default.getDocument(), SCHEDULER_CELL_DXPOINTERUP_EVENT_NAME); _events_engine.default.on(_dom_adapter.default.getDocument(), SCHEDULER_CELL_DXPOINTERUP_EVENT_NAME, (() => { isPointerDown = false; this.$element().removeClass("dx-scheduler-work-space-mouse-selection") })) } })); _events_engine.default.on(element, SCHEDULER_CELL_DXPOINTERMOVE_EVENT_NAME, DRAG_AND_DROP_SELECTOR, (e => { if (isPointerDown && this._dateTableScrollable && !this._dateTableScrollable.option("scrollByContent")) { e.preventDefault(); e.stopPropagation(); this._moveToCell((0, _renderer.default)(e.target), true) } })) } _getFormat() { return abstract() } getWorkArea() { return this._$dateTableContainer } getScrollable() { return this._dateTableScrollable } getScrollableScrollTop() { return this._dateTableScrollable.scrollTop() } getGroupedScrollableScrollTop(allDay) { return this._groupedStrategy.getScrollableScrollTop(allDay) } getScrollableScrollLeft() { return this._dateTableScrollable.scrollLeft() } getScrollableOuterWidth() { return this._dateTableScrollable.scrollWidth() } getScrollableContainer() { return (0, _renderer.default)(this._dateTableScrollable.container()) } getHeaderPanelHeight() { return this._$headerPanel && (0, _size.getOuterHeight)(this._$headerPanel, true) } getTimePanelWidth() { return this._$timePanel && (0, _position.getBoundingRect)(this._$timePanel.get(0)).width } getGroupTableWidth() { return this._$groupTable ? (0, _size.getOuterWidth)(this._$groupTable) : 0 } getWorkSpaceLeftOffset() { return this._groupedStrategy.getLeftOffset() } _getCellCoordinatesByIndex(index) { const columnIndex = Math.floor(index / this._getRowCount()); const rowIndex = index - this._getRowCount() * columnIndex; return { columnIndex: columnIndex, rowIndex: rowIndex } } _getDateGenerationOptions() { var _this$viewDataProvide; return { startDayHour: this.option("startDayHour"), endDayHour: this.option("endDayHour"), isWorkView: this.viewDataProvider.viewDataGenerator.isWorkView, interval: null === (_this$viewDataProvide = this.viewDataProvider.viewDataGenerator) || void 0 === _this$viewDataProvide ? void 0 : _this$viewDataProvide.getInterval(this.option("hoursInterval")), startViewDate: this.getStartViewDate(), firstDayOfWeek: this._firstDayOfWeek() } } _getIntervalBetween(currentDate, allDay) { const firstViewDate = this.getStartViewDate(); const startDayTime = this.option("startDayHour") * HOUR_MS; const timeZoneOffset = _date.default.getTimezonesDifference(firstViewDate, currentDate); const fullInterval = currentDate.getTime() - firstViewDate.getTime() - timeZoneOffset; const days = this._getDaysOfInterval(fullInterval, startDayTime); const weekendsCount = this._getWeekendsCount(days); let result = (days - weekendsCount) * DAY_MS; if (!allDay) { const { hiddenInterval: hiddenInterval } = this.viewDataProvider; const visibleDayDuration = this.getVisibleDayDuration(); result = fullInterval - days * hiddenInterval - weekendsCount * visibleDayDuration } return result } _getWeekendsCount(argument) { return 0 } _getDaysOfInterval(fullInterval, startDayTime) { return Math.floor((fullInterval + startDayTime) / DAY_MS) } _updateIndex(index) { return index * this._getRowCount() } _getDroppableCell() { return this._getDateTables().find(".dx-scheduler-date-table-droppable-cell") } _getWorkSpaceWidth() { return this.cache.get("workspaceWidth", (() => { if (this._needCreateCrossScrolling()) { return (0, _position.getBoundingRect)(this._$dateTable.get(0)).width } const totalWidth = (0, _position.getBoundingRect)(this.$element().get(0)).width; const timePanelWidth = this.getTimePanelWidth(); const groupTableWidth = this.getGroupTableWidth(); return totalWidth - timePanelWidth - groupTableWidth })) } _getCellByCoordinates(cellCoordinates, groupIndex, inAllDayRow) { const indexes = this._groupedStrategy.prepareCellIndexes(cellCoordinates, groupIndex, inAllDayRow); return this._dom_getDateCell(indexes) } _dom_getDateCell(position) { return this._$dateTable.find("tr:not(.dx-scheduler-virtual-row)").eq(position.rowIndex).find(`td:not(.${_m_classes.VIRTUAL_CELL_CLASS})`).eq(position.columnIndex) } _dom_getAllDayPanelCell(columnIndex) { return this._$allDayPanel.find("tr").eq(0).find("td").eq(columnIndex) } _getCells(allDay, direction) { const cellClass = allDay ? ALL_DAY_TABLE_CELL_CLASS : DATE_TABLE_CELL_CLASS; if ("vertical" === direction) { let result = []; for (let i = 1;; i++) { const cells = this.$element().find(`tr .${cellClass}:nth-child(${i})`); if (!cells.length) { break } result = result.concat(cells.toArray()) } return (0, _renderer.default)(result) } return this.$element().find(`.${cellClass}`) } _getFirstAndLastDataTableCell() { const selector = this.isVirtualScrolling() ? `.${DATE_TABLE_CELL_CLASS}, .${_m_classes.VIRTUAL_CELL_CLASS}` : `.${DATE_TABLE_CELL_CLASS}`; const $cells = this.$element().find(selector); return [$cells[0], $cells[$cells.length - 1]] } _getAllCells(allDay) { if (this._isVerticalGroupedWorkSpace()) { return this._$dateTable.find(`td:not(.${_m_classes.VIRTUAL_CELL_CLASS})`) } const cellClass = allDay && this.supportAllDayRow() ? ALL_DAY_TABLE_CELL_CLASS : DATE_TABLE_CELL_CLASS; return this.$element().find(`.${cellClass}`) } _setHorizontalGroupHeaderCellsHeight() { const { height: height } = (0, _position.getBoundingRect)(this._$dateTable.get(0)); (0, _size.setOuterHeight)(this._$groupTable, height) } _getGroupHeaderCells() { return this.$element().find(".dx-scheduler-group-header") } _getScrollCoordinates(hours, minutes, date, groupIndex, allDay) { const currentDate = date || new Date(this.option("currentDate")); const startDayHour = this.option("startDayHour"); const endDayHour = this.option("endDayHour"); if (hours < startDayHour) { hours = startDayHour } if (hours >= endDayHour) { hours = endDayHour - 1 } currentDate.setHours(hours, minutes, 0, 0); const cell = this.viewDataProvider.findGlobalCellPosition(currentDate, groupIndex, allDay); const { position: position, cellData: cellData } = cell; return this.virtualScrollingDispatcher.calculateCoordinatesByDataAndPosition(cellData, position, currentDate, (0, _index3.isDateAndTimeView)(this.type), "vertical" === this.viewDirection) } _isOutsideScrollable(target, event) { const $dateTableScrollableElement = this._dateTableScrollable.$element(); const scrollableSize = (0, _position.getBoundingRect)($dateTableScrollableElement.get(0)); const window = (0, _window.getWindow)(); const isTargetInAllDayPanel = !(0, _renderer.default)(target).closest($dateTableScrollableElement).length; const isOutsideHorizontalScrollable = event.pageX < scrollableSize.left || event.pageX > scrollableSize.left + scrollableSize.width + (window.scrollX || 0); const isOutsideVerticalScrollable = event.pageY < scrollableSize.top || event.pageY > scrollableSize.top + scrollableSize.height + (window.scrollY || 0); if (isTargetInAllDayPanel && !isOutsideHorizontalScrollable) { return false } return isOutsideVerticalScrollable || isOutsideHorizontalScrollable } setCellDataCache(cellCoordinates, groupIndex, $cell) { const key = JSON.stringify({ rowIndex: cellCoordinates.rowIndex, columnIndex: cellCoordinates.columnIndex, groupIndex: groupIndex }); this.cache.set(key, this.getCellData($cell)) } setCellDataCacheAlias(appointment, geometry) { const key = JSON.stringify({ rowIndex: appointment.rowIndex, columnIndex: appointment.columnIndex, groupIndex: appointment.groupIndex }); const aliasKey = JSON.stringify({ top: geometry.top, left: geometry.left }); this.cache.set(aliasKey, this.cache.get(key)) } supportAllDayRow() { return true } keepOriginalHours() { return false } _filterCellDataFields(cellData) { return (0, _extend.extend)(true, {}, { startDate: cellData.startDate, endDate: cellData.endDate, groups: cellData.groups, groupIndex: cellData.groupIndex, allDay: cellData.allDay }) } getCellData($cell) { const cellData = this._getFullCellData($cell) || {}; return this._filterCellDataFields(cellData) } _getFullCellData($cell) { const currentCell = $cell[0]; if (currentCell) { return this._getDataByCell($cell) } return } _getVirtualRowOffset() { return this.virtualScrollingDispatcher.virtualRowOffset } _getVirtualCellOffset() { return this.virtualScrollingDispatcher.virtualCellOffset } _getDataByCell($cell) { const rowIndex = $cell.parent().index() - this.virtualScrollingDispatcher.topVirtualRowsCount; const columnIndex = $cell.index() - this.virtualScrollingDispatcher.leftVirtualCellsCount; const { viewDataProvider: viewDataProvider } = this; const isAllDayCell = this._hasAllDayClass($cell); const cellData = viewDataProvider.getCellData(rowIndex, columnIndex, isAllDayCell); return cellData || void 0 } isGroupedByDate() { return this.option("groupByDate") && this._isHorizontalGroupedWorkSpace() && this._getGroupCount() > 0 } getCellIndexByDate(date, inAllDayRow) { const { viewDataGenerator: viewDataGenerator } = this.viewDataProvider; const timeInterval = inAllDayRow ? 864e5 : viewDataGenerator.getInterval(this.option("hoursInterval")); const startViewDateOffset = (0, _index3.getStartViewDateTimeOffset)(this.getStartViewDate(), this.option("startDayHour")); const dateTimeStamp = this._getIntervalBetween(date, inAllDayRow) + startViewDateOffset; let index = Math.floor(dateTimeStamp / timeInterval); if (inAllDayRow) { index = this._updateIndex(index) } if (index < 0) { index = 0 } return index } getDroppableCellIndex() { const $droppableCell = this._getDroppableCell(); const $row = $droppableCell.parent(); const rowIndex = $row.index(); return rowIndex * $row.find("td").length + $droppableCell.index() } getDataByDroppableCell() { const cellData = this.getCellData((0, _renderer.default)(this._getDroppableCell())); const { allDay: allDay } = cellData; const { startDate: startDate } = cellData; const { endDate: endDate } = cellData; return { startDate: startDate, endDate: endDate, allDay: allDay, groups: cellData.groups } } getDateRange() { return [this.getStartViewDate(), this.getEndViewDateByEndDayHour()] } getCellMinWidth() { return 75 } getRoundedCellWidth(groupIndex, startIndex, cellCount) { if (groupIndex < 0 || !(0, _window.hasWindow)()) { return 0 } const $row = this.$element().find(`.${_m_classes.DATE_TABLE_ROW_CLASS}`).eq(0); let width = 0; const $cells = $row.find(`.${DATE_TABLE_CELL_CLASS}`); const totalCellCount = this._getCellCount() * groupIndex; cellCount = cellCount || this._getCellCount(); if (!(0, _type.isDefined)(startIndex)) { startIndex = totalCellCount } for (let i = startIndex; i < totalCellCount + cellCount; i++) { const element = (0, _renderer.default)($cells).eq(i).get(0); const elementWidth = element ? (0, _position.getBoundingRect)(element).width : 0; width += elementWidth } return width / (totalCellCount + cellCount - startIndex) } getCellWidth() { return (0, _m_position_helper.getCellWidth)(this.getDOMElementsMetaData()) } getCellHeight() { return (0, _m_position_helper.getCellHeight)(this.getDOMElementsMetaData()) } getAllDayHeight() { return (0, _m_position_helper.getAllDayHeight)(this.option("showAllDayPanel"), this._isVerticalGroupedWorkSpace(), this.getDOMElementsMetaData()) } getMaxAllowedPosition(groupIndex) { return (0, _m_position_helper.getMaxAllowedPosition)(groupIndex, this.viewDataProvider, this.option("rtlEnabled"), this.getDOMElementsMetaData()) } getAllDayOffset() { return this._groupedStrategy.getAllDayOffset() } getCellIndexByCoordinates(coordinates, allDay) { const { horizontalScrollingState: horizontalScrollingState, verticalScrollingState: verticalScrollingState } = this.virtualScrollingDispatcher; const cellCount = (null === horizontalScrollingState || void 0 === horizontalScrollingState ? void 0 : horizontalScrollingState.itemCount) ?? this._getTotalCellCount(this._getGroupCount()); const cellWidth = this.getCellWidth(); const cellHeight = allDay ? this.getAllDayHeight() : this.getCellHeight(); const leftCoordinateOffset = (null === horizontalScrollingState || void 0 === horizontalScrollingState ? void 0 : horizontalScrollingState.virtualItemSizeBefore) ?? 0; const topCoordinateOffset = (null === verticalScrollingState || void 0 === verticalScrollingState ? void 0 : verticalScrollingState.virtualItemSizeBefore) ?? 0; const topIndex = Math.floor(Math.floor(coordinates.top - topCoordinateOffset) / Math.floor(cellHeight)); let leftIndex = (coordinates.left - leftCoordinateOffset) / cellWidth; leftIndex = Math.floor(leftIndex + .05); if (this._isRTL()) { leftIndex = cellCount - leftIndex - 1 } return cellCount * topIndex + leftIndex } getStartViewDate() { return this.viewDataProvider.getStartViewDate() } getEndViewDate() { return this.viewDataProvider.getLastCellEndDate() } getEndViewDateByEndDayHour() { return this.viewDataProvider.getLastViewDateByEndDayHour(this.option("endDayHour")) } getCellDuration() { return (0, _index3.getCellDuration)(this.type, this.option("startDayHour"), this.option("endDayHour"), this.option("hoursInterval")) } getIntervalDuration(allDay) { return allDay ? toMs("day") : this.getCellDuration() } getVisibleDayDuration() { const startDayHour = this.option("startDayHour"); const endDayHour = this.option("endDayHour"); const hoursInterval = this.option("hoursInterval"); return this.viewDataProvider.getVisibleDayDuration(startDayHour, endDayHour, hoursInterval) } getGroupBounds(coordinates) { const groupBounds = this._groupedStrategy instanceof _m_work_space_grouped_strategy_vertical.default ? this.getGroupBoundsVertical(coordinates.groupIndex) : this.getGroupBoundsHorizontal(coordinates); return this._isRTL() ? this.getGroupBoundsRtlCorrection(groupBounds) : groupBounds } getGroupBoundsVertical(groupIndex) { const $firstAndLastCells = this._getFirstAndLastDataTableCell(); return this._groupedStrategy.getGroupBoundsOffset(groupIndex, $firstAndLastCells) } getGroupBoundsHorizontal(coordinates) { const cellCount = this._getCellCount(); const $cells = this._getCells(); const cellWidth = this.getCellWidth(); const { groupedDataMap: groupedDataMap } = this.viewDataProvider; return this._groupedStrategy.getGroupBoundsOffset(cellCount, $cells, cellWidth, coordinates, groupedDataMap) } getGroupBoundsRtlCorrection(groupBounds) { const cellWidth = this.getCellWidth(); return _extends({}, groupBounds, { left: groupBounds.right - 2 * cellWidth, right: groupBounds.left + 2 * cellWidth }) } needRecalculateResizableArea() { return this._isVerticalGroupedWorkSpace() && 0 !== this.getScrollable().scrollTop() } getCellDataByCoordinates(coordinates, allDay) { const key = JSON.stringify({ top: coordinates.top, left: coordinates.left }); return this.cache.get(key, (() => { const $cells = this._getCells(allDay); const cellIndex = this.getCellIndexByCoordinates(coordinates, allDay); const $cell = $cells.eq(cellIndex); return this.getCellData($cell) })) } getVisibleBounds() { const result = {}; const $scrollable = this.getScrollable().$element(); const cellHeight = this.getCellHeight(); const scrolledCellCount = this.getScrollableScrollTop() / cellHeight; const totalCellCount = scrolledCellCount + (0, _size.getHeight)($scrollable) / cellHeight; result.top = { hours: Math.floor(scrolledCellCount * this.option("hoursInterval")) + this.option("startDayHour"), minutes: scrolledCellCount % 2 ? 30 : 0 }; result.bottom = { hours: Math.floor(totalCellCount * this.option("hoursInterval")) + this.option("startDayHour"), minutes: Math.floor(totalCellCount) % 2 ? 30 : 0 }; return result } updateScrollPosition(date, groups) { let allDay = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : false; const newDate = this.timeZoneCalculator.createDate(date, { path: "toGrid" }); const inAllDayRow = allDay && this.isAllDayPanelVisible; if (this.needUpdateScrollPosition(newDate, groups, inAllDayRow)) { this.scrollTo(newDate, groups, inAllDayRow, false) } } needUpdateScrollPosition(date, groups, inAllDayRow) { const cells = this._getCellsInViewport(inAllDayRow); const groupIndex = this._isGroupsSpecified(groups) ? this._getGroupIndexByResourceId(groups) : 0; const time = date.getTime(); const trimmedTime = _date.default.trimTime(date).getTime(); return cells.reduce(((currentResult, cell) => { const { startDate: cellStartDate, endDate: cellEndDate, groupIndex: cellGroupIndex } = this.getCellData(cell); const cellStartTime = cellStartDate.getTime(); const cellEndTime = cellEndDate.getTime(); if ((!inAllDayRow && cellStartTime <= time && time < cellEndTime || inAllDayRow && trimmedTime === cellStartTime) && groupIndex === cellGroupIndex) { return false } return currentResult }), true) } _getCellsInViewport(inAllDayRow) { const $scrollable = this.getScrollable().$element(); const cellHeight = this.getCellHeight(); const cellWidth = this.getCellWidth(); const totalColumnCount = this._getTotalCellCount(this._getGroupCount()); const scrollableScrollTop = this.getScrollableScrollTop(); const scrollableScrollLeft = this.getScrollableScrollLeft(); const fullScrolledRowCount = scrollableScrollTop / cellHeight - this.virtualScrollingDispatcher.topVirtualRowsCount; let scrolledRowCount = Math.floor(fullScrolledRowCount); if (scrollableScrollTop % cellHeight !== 0) { scrolledRowCount += 1 } const fullScrolledColumnCount = scrollableScrollLeft / cellWidth; let scrolledColumnCount = Math.floor(fullScrolledColumnCount); if (scrollableScrollLeft % cellWidth !== 0) { scrolledColumnCount += 1 } const rowCount = Math.floor(fullScrolledRowCount + (0, _size.getHeight)($scrollable) / cellHeight); const columnCount = Math.floor(fullScrolledColumnCount + (0, _size.getWidth)($scrollable) / cellWidth); const $cells = this._getAllCells(inAllDayRow); const result = []; $cells.each((function(index) { const $cell = (0, _renderer.default)(this); const columnIndex = index % totalColumnCount; const rowIndex = index / totalColumnCount; if (scrolledColumnCount <= columnIndex && columnIndex < columnCount && scrolledRowCount <= rowIndex && rowIndex < rowCount) { result.push($cell) } })); return result } scrollToTime(hours, minutes, date) { if (!this._isValidScrollDate(date)) { return } const coordinates = this._getScrollCoordinates(hours, minutes, date); const scrollable = this.getScrollable(); scrollable.scrollBy({ top: coordinates.top - scrollable.scrollTop(), left: 0 }) } scrollTo(date, groups) { let allDay = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : false; let throwWarning = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : true; if (!this._isValidScrollDate(date, throwWarning)) { return } const groupIndex = this._getGroupCount() && groups ? this._getGroupIndexByResourceId(groups) : 0; const isScrollToAllDay = allDay && this.isAllDayPanelVisible; const coordinates = this._getScrollCoordinates(date.getHours(), date.getMinutes(), date, groupIndex, isScrollToAllDay); const scrollable = this.getScrollable(); const $scrollable = scrollable.$element(); const cellWidth = this.getCellWidth(); const offset = this.option("rtlEnabled") ? cellWidth : 0; const scrollableHeight = (0, _size.getHeight)($scrollable); const scrollableWidth = (0, _size.getWidth)($scrollable); const cellHeight = this.getCellHeight(); const xShift = (scrollableWidth - cellWidth) / 2; const yShift = (scrollableHeight - cellHeight) / 2; const left = coordinates.left - scrollable.scrollLeft() - xShift - offset; let top = coordinates.top - scrollable.scrollTop() - yShift; if (isScrollToAllDay && !this._isVerticalGroupedWorkSpace()) { top = 0 } if (this.option("templatesRenderAsynchronously")) { setTimeout((() => { scrollable.scrollBy({ left: left, top: top }) })) } else { scrollable.scrollBy({ left: left, top: top }) } } _isValidScrollDate(date) { let throwWarning = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : true; const min = this.getStartViewDate(); const max = this.getEndViewDate(); if (date < min || date > max) { throwWarning && _ui2.default.log("W1008", date); return false } return true } needApplyCollectorOffset() { return false } removeDroppableCellClass($cellElement) { const $cell = $cellElement || this._getDroppableCell(); null === $cell || void 0 === $cell || $cell.removeClass("dx-scheduler-date-table-droppable-cell") } _getCoordinatesByCell($cell) { const columnIndex = $cell.index() - this.virtualScrollingDispatcher.leftVirtualCellsCount; let rowIndex = $cell.parent().index(); const isAllDayCell = this._hasAllDayClass($cell); const isVerticalGrouping = this._isVerticalGroupedWorkSpace(); if (!(isAllDayCell && !isVerticalGrouping)) { rowIndex -= this.virtualScrollingDispatcher.topVirtualRowsCount } return { rowIndex: rowIndex, columnIndex: columnIndex } } _isShowAllDayPanel() { return this.option("showAllDayPanel") } _getTimePanelCells() { return this.$element().find(".dx-scheduler-time-panel-cell") } _getRDateTableProps() { return { viewData: this.viewDataProvider.viewData, viewContext: this.getR1ComponentsViewContext(), dataCellTemplate: this.option("dataCellTemplate"), addDateTableClass: !this.option("crossScrollingEnabled") || this.isVirtualScrolling(), groupOrientation: this.option("groupOrientation"), addVerticalSizesClassToRows: false } } getR1ComponentsViewContext() { return { view: { type: this.type }, crossScrollingEnabled: !!this.option("crossScrollingEnabled") } } _updateSelectedCellDataOption(selectedCellData, $nextFocusedCell) { const correctedSelectedCellData = selectedCellData.map((_ref3 => { let { startDate: startDate, endDate: endDate, allDay: allDay, groupIndex: groupIndex, groups: groups } = _ref3; return { startDate: startDate, endDate: endDate, allDay: allDay, groupIndex: groupIndex, groups: groups } })); this.option("selectedCellData", correctedSelectedCellData); this._selectionChangedAction({ selectedCellData: correctedSelectedCellData }) } _getCellByData(cellData) { const { startDate: startDate, groupIndex: groupIndex, allDay: allDay, index: index } = cellData; const position = this.viewDataProvider.findCellPositionInMap({ startDate: startDate, groupIndex: groupIndex, isAllDay: allDay, index: index }); if (!position) { return } return allDay && !this._isVerticalGroupedWorkSpace() ? this._dom_getAllDayPanelCell(position.columnIndex) : this._dom_getDateCell(position) } getDOMElementsMetaData() { return this.cache.get("cellElementsMeta", (() => ({ dateTableCellsMeta: this._getDateTableDOMElementsInfo(), allDayPanelCellsMeta: this._getAllDayPanelDOMElementsInfo() }))) } _getDateTableDOMElementsInfo() { const dateTableCells = this._getAllCells(false); if (!dateTableCells.length || !(0, _window.hasWindow)()) { return [ [{}] ] } const dateTable = this._getDateTable(); const dateTableRect = (0, _position.getBoundingRect)(dateTable.get(0)); const columnsCount = this.viewDataProvider.getColumnsCount(); const result = []; dateTableCells.each(((index, cell) => { const rowIndex = Math.floor(index / columnsCount); if (result.length === rowIndex) { result.push([]) } this._addCellMetaData(result[rowIndex], cell, dateTableRect) })); return result } _getAllDayPanelDOMElementsInfo() { const result = []; if (this.isAllDayPanelVisible && !this._isVerticalGroupedWorkSpace() && (0, _window.hasWindow)()) { const allDayCells = this._getAllCells(true); if (!allDayCells.length) { return [{}] } const allDayAppointmentContainer = this._$allDayPanel; const allDayPanelRect = (0, _position.getBoundingRect)(allDayAppointmentContainer.get(0)); allDayCells.each(((_, cell) => { this._addCellMetaData(result, cell, allDayPanelRect) })) } return result } _addCellMetaData(cellMetaDataArray, cell, parentRect) { const cellRect = (0, _position.getBoundingRect)(cell); cellMetaDataArray.push({ left: cellRect.left - parentRect.left, top: cellRect.top - parentRect.top, width: cellRect.width, height: cellRect.height }) } _oldRender_getAllDayCellData(groupIndex) { return (cell, rowIndex, columnIndex) => { const validColumnIndex = columnIndex % this._getCellCount(); const options = this._getDateGenerationOptions(true); let startDate = this.viewDataProvider.viewDataGenerator.getDateByCellIndices(options, rowIndex, validColumnIndex, this._getCellCountInDay()); startDate = _date.default.trimTime(startDate); let validGroupIndex = groupIndex || 0; if (this.isGroupedByDate()) { validGroupIndex = Math.floor(columnIndex % this._getGroupCount()) } else if (this._isHorizontalGroupedWorkSpace()) { validGroupIndex = Math.floor(columnIndex / this._getCellCount()) } const data = { startDate: startDate, endDate: startDate, allDay: true, groupIndex: validGroupIndex }; const groupsArray = (0, _m_utils2.getCellGroups)(validGroupIndex, this.option("groups")); if (groupsArray.length) { data.groups = (0, _m_utils2.getGroupsObjectFromGroupsArray)(groupsArray) } return { key: "dxCellData", value: data } } } renderRWorkSpace() { let { header: header, timePanel: timePanel, dateTable: dateTable, allDayPanel: allDayPanel } = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : DEFAULT_WORKSPACE_RENDER_OPTIONS.renderComponents; if (header) { this.renderRHeaderPanel() } if (timePanel) { this.renderRTimeTable() } if (dateTable) { this.renderRDateTable() } if (allDayPanel) { this.renderRAllDayPanel() } } renderRDateTable() { _m_utils.utils.renovation.renderComponent(this, this._$dateTable, _index2.DateTableComponent, "renovatedDateTable", this._getRDateTableProps()) } renderRGroupPanel() { var _this$option4; const options = { viewContext: this.getR1ComponentsViewContext(), groups: this.option("groups"), groupOrientation: this.option("groupOrientation"), groupByDate: this.isGroupedByDate(), resourceCellTemplate: this.option("resourceCellTemplate"), className: this.verticalGroupTableClass, groupPanelData: this.viewDataProvider.getGroupPanelData(this.generateRenderOptions()) }; if (null !== (_this$option4 = this.option("groups")) && void 0 !== _this$option4 && _this$option4.length) { this._attachGroupCountClass(); _m_utils.utils.renovation.renderComponent(this, this._getGroupHeaderContainer(), _index2.GroupPanelComponent, "renovatedGroupPanel", options) } else { this._detachGroupCountClass() } } renderRAllDayPanel() { const visible = this.isAllDayPanelVisible && !this.isGroupedAllDayPanel(); if (visible) { var _this$virtualScrollin; this._toggleAllDayVisibility(false); const options = _extends({ viewData: this.viewDataProvider.viewData, viewContext: this.getR1ComponentsViewContext(), dataCellTemplate: this.option("dataCellTemplate"), startCellIndex: 0 }, (null === (_this$virtualScrollin = this.virtualScrollingDispatcher.horizontalVirtualScrolling) || void 0 === _this$virtualScrollin ? void 0 : _this$virtualScrollin.getRenderState()) || {}); _m_utils.utils.renovation.renderComponent(this, this._$allDayTable, _index2.AllDayTableComponent, "renovatedAllDayPanel", options); _m_utils.utils.renovation.renderComponent(this, this._$allDayTitle, _index2.AllDayPanelTitleComponent, "renovatedAllDayPanelTitle", {}) } this._toggleAllDayVisibility(true) } renderRTimeTable() { _m_utils.utils.renovation.renderComponent(this, this._$timePanel, _index2.TimePanelComponent, "renovatedTimePanel", { viewContext: this.getR1ComponentsViewContext(), timePanelData: this.viewDataProvider.timePanelData, timeCellTemplate: this.option("timeCellTemplate"), groupOrientation: this.option("groupOrientation") }) } renderRHeaderPanel() { var _this$option5; let isRenderDateHeader = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : true; if (null !== (_this$option5 = this.option("groups")) && void 0 !== _this$option5 && _this$option5.length) { this._attachGroupCountClass() } else { this._detachGroupCountClass() } _m_utils.utils.renovation.renderComponent(this, this._$thead, this.renovatedHeaderPanelComponent, "renovatedHeaderPanel", { viewContext: this.getR1ComponentsViewContext(), dateHeaderData: this.viewDataProvider.dateHeaderData, groupPanelData: this.viewDataProvider.getGroupPanelData(this.generateRenderOptions()), dateCellTemplate: this.option("dateCellTemplate"), timeCellTemplate: this.option("timeCellTemplate"), groups: this.option("groups"), groupByDate: this.isGroupedByDate(), groupOrientation: this.option("groupOrientation"), resourceCellTemplate: this.option("resourceCellTemplate"), isRenderDateHeader: isRenderDateHeader }) } initDragBehavior(scheduler) { if (!this.dragBehavior && scheduler) { this.dragBehavior = new _m_appointment_drag_behavior.default(scheduler); const $rootElement = (0, _renderer.default)(scheduler.element()); this._createDragBehavior(this.getWorkArea(), $rootElement); if (!this._isVerticalGroupedWorkSpace()) { this._createDragBehavior(this._$allDayPanel, $rootElement) } } } _createDragBehavior($targetElement, $rootElement) { const options = { getItemData: (itemElement, appointments) => appointments._getItemData(itemElement), getItemSettings: $itemElement => $itemElement.data(_m_constants.APPOINTMENT_SETTINGS_KEY) }; this._createDragBehaviorBase($targetElement, $rootElement, options) } _createDragBehaviorBase(targetElement, rootElement, options) { const container = this.$element().find(`.${_m_classes.FIXED_CONTAINER_CLASS}`); this.dragBehavior.addTo(targetElement, createDragBehaviorConfig(container, rootElement, this.isDefaultDraggingMode, this.dragBehavior, (() => { if (!this.isDefaultDraggingMode) { this.preventDefaultDragging = false } }), (() => { if (!this.isDefaultDraggingMode) { this.preventDefaultDragging = true } }), (() => this._getDroppableCell()), (() => this._getDateTables()), (() => this.removeDroppableCellClass()), (() => this.getCellWidth()), options)) } _isRenderHeaderPanelEmptyCell() { return this._isVerticalGroupedWorkSpace() } _dispose() { super._dispose(); this.virtualScrollingDispatcher.dispose() } _getDefaultOptions() { return (0, _extend.extend)(super._getDefaultOptions(), { currentDate: new Date, intervalCount: 1, startDate: null, firstDayOfWeek: void 0, startDayHour: 0, endDayHour: 24, viewOffset: 0, hoursInterval: .5, activeStateEnabled: true, hoverStateEnabled: true, groups: [], showAllDayPanel: true, allDayExpanded: false, onCellClick: null, crossScrollingEnabled: false, dataCellTemplate: null, timeCellTemplate: null, resourceCellTemplate: null, dateCellTemplate: null, allowMultipleCellSelection: true, indicatorTime: new Date, indicatorUpdateInterval: 5 * toMs("minute"), shadeUntilCurrentTime: true, groupOrientation: "horizontal", selectedCellData: [], groupByDate: false, scrolling: { mode: "standard" }, allDayPanelMode: "all", renovateRender: true, height: void 0, draggingMode: "outlook", onScrollEnd: () => {}, getHeaderHeight: void 0, onRenderAppointments: () => {}, onShowAllDayPanel: () => {}, onSelectedCellsClick: () => {}, timeZoneCalculator: void 0, schedulerHeight: void 0, schedulerWidth: void 0 }) } _optionChanged(args) { switch (args.name) { case "startDayHour": case "endDayHour": case "viewOffset": case "dateCellTemplate": case "resourceCellTemplate": case "dataCellTemplate": case "timeCellTemplate": case "hoursInterval": case "firstDayOfWeek": case "currentDate": case "startDate": this._cleanWorkSpace(); break; case "groups": this._cleanView(); this._removeAllDayElements(); this._initGrouping(); this.repaint(); break; case "groupOrientation": this._initGroupedStrategy(); this._createAllDayPanelElements(); this._removeAllDayElements(); this._cleanWorkSpace(); this._toggleGroupByDateClass(); break; case "showAllDayPanel": if (this._isVerticalGroupedWorkSpace()) { this._cleanView(); this._removeAllDayElements(); this._initGrouping(); this.repaint() } else if (!this.isRenovatedRender()) { this._toggleAllDayVisibility(true) } else { this.renderWorkSpace() } break; case "allDayExpanded": this._changeAllDayVisibility(); this._attachTablesEvents(); this._updateScrollable(); break; case "onSelectionChanged": this._createSelectionChangedAction(); break; case "onCellClick": this._createCellClickAction(); break; case "onCellContextMenu": this._attachContextMenuEvent(); break; case "intervalCount": this._cleanWorkSpace(); this._toggleWorkSpaceCountClass(); break; case "groupByDate": this._cleanWorkSpace(); this._toggleGroupByDateClass(); break; case "crossScrollingEnabled": this._toggleHorizontalScrollClass(); this._dateTableScrollable.option(this._dateTableScrollableConfig()); break; case "allDayPanelMode": this.updateShowAllDayPanel(); this.updateAppointments(); break; case "width": super._optionChanged(args); this._dimensionChanged(); break; case "timeZoneCalculator": case "allowMultipleCellSelection": case "selectedCellData": break; case "renovateRender": case "scrolling": this.repaint(); break; case "schedulerHeight": case "schedulerWidth": this.virtualScrollingDispatcher.updateDimensions(true); break; default: super._optionChanged(args) } } updateShowAllDayPanel() { const isHiddenAllDayPanel = "hidden" === this.option("allDayPanelMode"); this.option("onShowAllDayPanel")(!isHiddenAllDayPanel) } _getVirtualScrollingDispatcherOptions() { return { getCellHeight: this.getCellHeight.bind(this), getCellWidth: this.getCellWidth.bind(this), getCellMinWidth: this.getCellMinWidth.bind(this), isRTL: this._isRTL.bind(this), getSchedulerHeight: () => this.option("schedulerHeight"), getSchedulerWidth: () => this.option("schedulerWidth"), getViewHeight: () => this.$element().height ? this.$element().height() : (0, _size.getHeight)(this.$element()), getViewWidth: () => this.$element().width ? this.$element().width() : (0, _size.getWidth)(this.$element()), getWindowHeight: () => (0, _window.getWindow)().innerHeight, getWindowWidth: () => (0, _window.getWindow)().innerWidth, getScrolling: () => this.option("scrolling"), getScrollableOuterWidth: this.getScrollableOuterWidth.bind(this), getScrollable: this.getScrollable.bind(this), createAction: this._createAction.bind(this), updateRender: this.updateRender.bind(this), updateGrid: this.updateGrid.bind(this), getGroupCount: this._getGroupCount.bind(this), isVerticalGrouping: this._isVerticalGroupedWorkSpace.bind(this), getTotalRowCount: this._getTotalRowCount.bind(this), getTotalCellCount: this._getTotalCellCount.bind(this) } } _cleanWorkSpace() { this._cleanView(); this._toggleGroupedClass(); this._toggleWorkSpaceWithOddCells(); this.virtualScrollingDispatcher.updateDimensions(true); this._renderView(); this.option("crossScrollingEnabled") && this._setTableSizes(); this.cache.clear() } _init() { this._scrollSync = {}; this._viewDataProvider = null; this._cellsSelectionState = null; this._activeStateUnit = CELL_SELECTOR; super._init(); this._initGrouping(); this._toggleHorizontalScrollClass(); this._toggleWorkSpaceCountClass(); this._toggleGroupByDateClass(); this._toggleWorkSpaceWithOddCells(); this.$element().addClass("dx-scheduler-work-space").addClass(this._getElementClass()) } _initPositionHelper() { this.positionHelper = new _m_position_helper.PositionHelper({ key: this.option("key"), viewDataProvider: this.viewDataProvider, viewStartDayHour: this.option("startDayHour"), viewEndDayHour: this.option("endDayHour"), cellDuration: this.getCellDuration(), groupedStrategy: this._groupedStrategy, isGroupedByDate: this.isGroupedByDate(), rtlEnabled: this.option("rtlEnabled"), startViewDate: this.getStartViewDate(), isVerticalGrouping: this._isVerticalGroupedWorkSpace(), groupCount: this._getGroupCount(), isVirtualScrolling: this.isVirtualScrolling(), getDOMMetaDataCallback: this.getDOMElementsMetaData.bind(this) }) } _initGrouping() { this._initGroupedStrategy(); this._toggleGroupingDirectionClass(); this._toggleGroupByDateClass() } isVerticalOrientation() { var _this$option6; const orientation = null !== (_this$option6 = this.option("groups")) && void 0 !== _this$option6 && _this$option6.length ? this.option("groupOrientation") : this._getDefaultGroupStrategy(); return "vertical" === orientation } _initGroupedStrategy() { const Strategy = this.isVerticalOrientation() ? _m_work_space_grouped_strategy_vertical.default : _m_work_space_grouped_strategy_horizontal.default; this._groupedStrategy = new Strategy(this) } _getDefaultGroupStrategy() { return "horizontal" } _toggleHorizontalScrollClass() { this.$element().toggleClass("dx-scheduler-work-space-both-scrollbar", this.option("crossScrollingEnabled")) } _toggleGroupByDateClass() { this.$element().toggleClass("dx-scheduler-work-space-group-by-date", this.isGroupedByDate()) } _toggleWorkSpaceCountClass() { this.$element().toggleClass("dx-scheduler-work-space-count", this._isWorkSpaceWithCount()) } _toggleWorkSpaceWithOddCells() { this.$element().toggleClass("dx-scheduler-work-space-odd-cells", this._isWorkspaceWithOddCells()) } _toggleGroupingDirectionClass() { this.$element().toggleClass("dx-scheduler-work-space-vertical-grouped", this._isVerticalGroupedWorkSpace()) } _getDateTableCellClass(rowIndex, columnIndex) { const cellClass = `${DATE_TABLE_CELL_CLASS} dx-scheduler-cell-sizes-horizontal dx-scheduler-cell-sizes-vertical`; return this._groupedStrategy.addAdditionalGroupCellClasses(cellClass, columnIndex + 1, rowIndex, columnIndex) } _getGroupHeaderClass(i) { return this._groupedStrategy.addAdditionalGroupCellClasses("dx-scheduler-group-header", i + 1) } _initWorkSpaceUnits() { this._$headerPanelContainer = (0, _renderer.default)("
").addClass("dx-scheduler-header-panel-container"); this._$headerTablesContainer = (0, _renderer.default)("
").addClass("dx-scheduler-header-tables-container"); this._$headerPanel = (0, _renderer.default)("
"); (0, _size.setHeight)($td, this._getRowHeight(rowSize)); if (options.getStartDate) { date = options.getStartDate && options.getStartDate(rowIndex); cellDateNumber = _date2.default.format(date, "d"); cellDayName = _date2.default.format(date, _index.formatWeekday) } if (cellTemplateOpt && cellTemplateOpt.render) { const templateOptions = this._prepareCellTemplateOptions(`${cellDateNumber} ${cellDayName}`, date, i, $td); cellTemplates.push(cellTemplateOpt.render.bind(cellTemplateOpt, templateOptions)) } else if (cellDateNumber && cellDayName) { $td.addClass("dx-scheduler-agenda-date").text(`${cellDateNumber} ${cellDayName}`) } if (options.rowClass) { $row.addClass(options.rowClass) } if (options.cellClass) { $td.addClass(options.cellClass) } $row.append($td); this._$rows.push($row) } }.bind(this); for (i = 0; i < this._rows.length; i++) { (0, _iterator.each)(this._rows[i], fillTableBody); this._setLastRowClass() }(0, _renderer.default)(options.container).append((0, _renderer.default)("
"); const text = (0, _index2.formatWeekdayAndDay)(currentDate); if (cellTemplate) { const templateOptions = { model: _extends({ text: text, date: new Date(currentDate) }, this._getGroupsForDateHeaderTemplate(templateIndex, colSpan)), container: $th, index: templateIndex }; cellTemplate.render(templateOptions) } else { $th.text(text) } $th.addClass("dx-scheduler-header-panel-cell").addClass("dx-scheduler-header-panel-week-cell").attr("colSpan", colSpan); $cells.push($th); if (templateIndex % cellsInGroup === cellsInGroup - 1) { currentDate = new Date(firstViewDate) } else { this._incrementDate(currentDate) } } const $row = (0, _renderer.default)("
"); this._$thead = (0, _renderer.default)("").appendTo(this._$headerPanel); this._$headerPanelEmptyCell = (0, _renderer.default)("
").addClass("dx-scheduler-header-panel-empty-cell"); this._$allDayTable = (0, _renderer.default)("
"); this._$fixedContainer = (0, _renderer.default)("
").addClass(_m_classes.FIXED_CONTAINER_CLASS); this._$allDayContainer = (0, _renderer.default)("
").addClass("dx-scheduler-all-day-appointments"); this._$dateTableScrollableContent = (0, _renderer.default)("
").addClass("dx-scheduler-date-table-scrollable-content"); this._$sidebarScrollableContent = (0, _renderer.default)("
").addClass("dx-scheduler-side-bar-scrollable-content"); this._initAllDayPanelElements(); if (this.isRenovatedRender()) { this.createRAllDayPanelElements() } else { this._createAllDayPanelElements() } this._$timePanel = (0, _renderer.default)("
").addClass(_m_classes.TIME_PANEL_CLASS); this._$dateTable = (0, _renderer.default)("
"); this._$dateTableContainer = (0, _renderer.default)("
").addClass("dx-scheduler-date-table-container"); this._$groupTable = (0, _renderer.default)("
").addClass("dx-scheduler-work-space-vertical-group-table") } _initAllDayPanelElements() { this._allDayTitles = []; this._allDayTables = []; this._allDayPanels = [] } _initDateTableScrollable() { const $dateTableScrollable = (0, _renderer.default)("
").addClass("dx-scheduler-date-table-scrollable"); this._dateTableScrollable = this._createComponent($dateTableScrollable, _ui.default, this._dateTableScrollableConfig()); this._scrollSync.dateTable = (0, _scroll.getMemoizeScrollTo)((() => this._dateTableScrollable)) } _createWorkSpaceElements() { if (this.option("crossScrollingEnabled")) { this._createWorkSpaceScrollableElements() } else { this._createWorkSpaceStaticElements() } } _createWorkSpaceStaticElements() { this._$dateTableContainer.append(this._$dateTable); if (this._isVerticalGroupedWorkSpace()) { this._$dateTableContainer.append(this._$allDayContainer); this._$dateTableScrollableContent.append(this._$groupTable, this._$timePanel, this._$dateTableContainer); this._dateTableScrollable.$content().append(this._$dateTableScrollableContent); this._$headerTablesContainer.append(this._$headerPanel) } else { var _this$_$allDayPanel; this._$dateTableScrollableContent.append(this._$timePanel, this._$dateTableContainer); this._dateTableScrollable.$content().append(this._$dateTableScrollableContent); this._$headerTablesContainer.append(this._$headerPanel, this._$allDayPanel); null === (_this$_$allDayPanel = this._$allDayPanel) || void 0 === _this$_$allDayPanel || _this$_$allDayPanel.append(this._$allDayContainer, this._$allDayTable) } this._appendHeaderPanelEmptyCellIfNecessary(); this._$headerPanelContainer.append(this._$headerTablesContainer); this.$element().append(this._$fixedContainer, this._$headerPanelContainer, this._dateTableScrollable.$element()) } _createWorkSpaceScrollableElements() { this.$element().append(this._$fixedContainer); this._$flexContainer = (0, _renderer.default)("
").addClass("dx-scheduler-work-space-flex-container"); this._createHeaderScrollable(); this._headerScrollable.$content().append(this._$headerPanel); this._appendHeaderPanelEmptyCellIfNecessary(); this._$headerPanelContainer.append(this._$headerTablesContainer); this.$element().append(this._$headerPanelContainer); this.$element().append(this._$flexContainer); this._createSidebarScrollable(); this._$flexContainer.append(this._dateTableScrollable.$element()); this._$dateTableContainer.append(this._$dateTable); this._$dateTableScrollableContent.append(this._$dateTableContainer); this._dateTableScrollable.$content().append(this._$dateTableScrollableContent); if (this._isVerticalGroupedWorkSpace()) { this._$dateTableContainer.append(this._$allDayContainer); this._$sidebarScrollableContent.append(this._$groupTable, this._$timePanel) } else { var _this$_$allDayPanel2; this._headerScrollable.$content().append(this._$allDayPanel); null === (_this$_$allDayPanel2 = this._$allDayPanel) || void 0 === _this$_$allDayPanel2 || _this$_$allDayPanel2.append(this._$allDayContainer, this._$allDayTable); this._$sidebarScrollableContent.append(this._$timePanel) } this._sidebarScrollable.$content().append(this._$sidebarScrollableContent) } _appendHeaderPanelEmptyCellIfNecessary() { this._isRenderHeaderPanelEmptyCell() && this._$headerPanelContainer.append(this._$headerPanelEmptyCell) } _createHeaderScrollable() { const $headerScrollable = (0, _renderer.default)("
").addClass("dx-scheduler-header-scrollable").appendTo(this._$headerTablesContainer); this._headerScrollable = this._createComponent($headerScrollable, _ui.default, this._headerScrollableConfig()); this._scrollSync.header = (0, _scroll.getMemoizeScrollTo)((() => this._headerScrollable)) } _createSidebarScrollable() { const $timePanelScrollable = (0, _renderer.default)("
").addClass("dx-scheduler-sidebar-scrollable").appendTo(this._$flexContainer); this._sidebarScrollable = this._createComponent($timePanelScrollable, _ui.default, { useKeyboard: false, showScrollbar: "never", direction: "vertical", useNative: false, updateManually: true, bounceEnabled: false, onScroll: event => { this._scrollSync.dateTable({ top: event.scrollOffset.top }) } }); this._scrollSync.sidebar = (0, _scroll.getMemoizeScrollTo)((() => this._sidebarScrollable)) } _attachTableClasses() { this._addTableClass(this._$dateTable, _m_classes.DATE_TABLE_CLASS); if (this._isVerticalGroupedWorkSpace()) { const groupCount = this._getGroupCount(); for (let i = 0; i < groupCount; i++) { this._addTableClass(this._allDayTables[i], "dx-scheduler-all-day-table") } } else if (!this.isRenovatedRender()) { this._addTableClass(this._$allDayTable, "dx-scheduler-all-day-table") } } _attachHeaderTableClasses() { this._addTableClass(this._$headerPanel, "dx-scheduler-header-panel") } _addTableClass($el, className) { $el && !$el.hasClass(className) && $el.addClass(className) } _initMarkup() { this.cache.clear(); this._initWorkSpaceUnits(); this._initVirtualScrolling(); this._initDateTableScrollable(); this._createWorkSpaceElements(); super._initMarkup(); if (!this.option("crossScrollingEnabled")) { this._attachTableClasses(); this._attachHeaderTableClasses() } this._toggleGroupedClass(); this._renderView(); this._attachEvents() } _render() { super._render(); this._renderDateTimeIndication(); this._setIndicationUpdateInterval() } _toggleGroupedClass() { this.$element().toggleClass("dx-scheduler-work-space-grouped", this._getGroupCount() > 0) } _renderView() { if (this.isRenovatedRender()) { if (this._isVerticalGroupedWorkSpace()) { this.renderRGroupPanel() } } else { this._applyCellTemplates(this._renderGroupHeader()) } this.renderWorkSpace(); if (this.isRenovatedRender()) { this.virtualScrollingDispatcher.updateDimensions() } this._updateGroupTableHeight(); this.updateHeaderEmptyCellWidth(); this._shader = new _m_current_time_shader_vertical.default(this) } updateCellsSelection() { const renderOptions = this.generateRenderOptions(); this.viewDataProvider.updateViewData(renderOptions); this.renderRWorkSpace({ timePanel: true, dateTable: true, allDayPanel: true }) } _renderDateTimeIndication() { return (0, _common.noop)() } renderCurrentDateTimeLineAndShader() { return (0, _common.noop)() } renderCurrentDateTimeIndication() { return (0, _common.noop)() } _setIndicationUpdateInterval() { return (0, _common.noop)() } _detachGroupCountClass() { [..._m_classes.VERTICAL_GROUP_COUNT_CLASSES].forEach((className => { this.$element().removeClass(className) })) } _attachGroupCountClass() { const className = this._groupedStrategy.getGroupCountClass(this.option("groups")); this.$element().addClass(className) } _getDateHeaderTemplate() { return this.option("dateCellTemplate") } _toggleAllDayVisibility(isUpdateScrollable) { const showAllDayPanel = this._isShowAllDayPanel(); this.$element().toggleClass("dx-scheduler-work-space-all-day", showAllDayPanel); this._changeAllDayVisibility(); isUpdateScrollable && this._updateScrollable() } _changeAllDayVisibility() { this.cache.clear(); this.$element().toggleClass("dx-scheduler-work-space-all-day-collapsed", !this.option("allDayExpanded") && this._isShowAllDayPanel()) } _getDateTables() { return this._$dateTable.add(this._$allDayTable) } _getDateTable() { return this._$dateTable } _removeAllDayElements() { this._$allDayTable && this._$allDayTable.remove(); this._$allDayTitle && this._$allDayTitle.remove() } _cleanView() { var _this$_shader; this.cache.clear(); this._cleanTableWidths(); this.cellsSelectionState.clearSelectedAndFocusedCells(); if (!this.isRenovatedRender()) { var _this$_$allDayTable, _this$_$sidebarTable; this._$thead.empty(); this._$dateTable.empty(); this._$timePanel.empty(); this._$groupTable.empty(); null === (_this$_$allDayTable = this._$allDayTable) || void 0 === _this$_$allDayTable || _this$_$allDayTable.empty(); null === (_this$_$sidebarTable = this._$sidebarTable) || void 0 === _this$_$sidebarTable || _this$_$sidebarTable.empty() } null === (_this$_shader = this._shader) || void 0 === _this$_shader || _this$_shader.clean(); delete this._interval } _clean() { _events_engine.default.off(_dom_adapter.default.getDocument(), SCHEDULER_CELL_DXPOINTERUP_EVENT_NAME); this._disposeRenovatedComponents(); super._clean() } _cleanTableWidths() { this._$headerPanel.css("width", ""); this._$dateTable.css("width", ""); this._$allDayTable && this._$allDayTable.css("width", "") } _disposeRenovatedComponents() { var _this$renovatedAllDay, _this$renovatedDateTa, _this$renovatedTimePa, _this$renovatedGroupP, _this$renovatedHeader; null === (_this$renovatedAllDay = this.renovatedAllDayPanel) || void 0 === _this$renovatedAllDay || _this$renovatedAllDay.dispose(); this.renovatedAllDayPanel = void 0; null === (_this$renovatedDateTa = this.renovatedDateTable) || void 0 === _this$renovatedDateTa || _this$renovatedDateTa.dispose(); this.renovatedDateTable = void 0; null === (_this$renovatedTimePa = this.renovatedTimePanel) || void 0 === _this$renovatedTimePa || _this$renovatedTimePa.dispose(); this.renovatedTimePanel = void 0; null === (_this$renovatedGroupP = this.renovatedGroupPanel) || void 0 === _this$renovatedGroupP || _this$renovatedGroupP.dispose(); this.renovatedGroupPanel = void 0; null === (_this$renovatedHeader = this.renovatedHeaderPanel) || void 0 === _this$renovatedHeader || _this$renovatedHeader.dispose(); this.renovatedHeaderPanel = void 0 } getGroupedStrategy() { return this._groupedStrategy } getFixedContainer() { return this._$fixedContainer } getAllDayContainer() { return this._$allDayContainer } updateRender() { this.renderer.updateRender() } updateGrid() { this.renderer._renderGrid() } updateAppointments() { var _this$dragBehavior2; this.option("onRenderAppointments")(); null === (_this$dragBehavior2 = this.dragBehavior) || void 0 === _this$dragBehavior2 || _this$dragBehavior2.updateDragSource() } _createAllDayPanelElements() { const groupCount = this._getGroupCount(); if (this._isVerticalGroupedWorkSpace() && 0 !== groupCount) { for (let i = 0; i < groupCount; i++) { const $allDayTitle = (0, _renderer.default)("
").addClass("dx-scheduler-all-day-title").text(_message.default.format("dxScheduler-allDay")); this._allDayTitles.push($allDayTitle); this._$allDayTable = (0, _renderer.default)("
"); this._allDayTables.push(this._$allDayTable); this._$allDayPanel = (0, _renderer.default)("
").addClass("dx-scheduler-all-day-panel").append(this._$allDayTable); this._allDayPanels.push(this._$allDayPanel) } } else { this._$allDayTitle = (0, _renderer.default)("
").addClass("dx-scheduler-all-day-title").text(_message.default.format("dxScheduler-allDay")).appendTo(this.$element()); this._$allDayTable = (0, _renderer.default)("
"); this._$allDayPanel = (0, _renderer.default)("
").addClass("dx-scheduler-all-day-panel").append(this._$allDayTable) } } renderWorkSpace() { let { generateNewData: generateNewData, renderComponents: renderComponents } = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : DEFAULT_WORKSPACE_RENDER_OPTIONS; this.cache.clear(); this.viewDataProvider.update(this.generateRenderOptions(), generateNewData); if (this.isRenovatedRender()) { this.renderRWorkSpace(renderComponents) } else { this._renderDateHeader(); this._renderTimePanel(); this._renderGroupAllDayPanel(); this._renderDateTable(); this._renderAllDayPanel() } this._initPositionHelper() } _renderGroupHeader() { const $container = this._getGroupHeaderContainer(); const groupCount = this._getGroupCount(); let cellTemplates = []; if (groupCount) { const groupRows = this._makeGroupRows(this.option("groups"), this.option("groupByDate")); this._attachGroupCountClass(); $container.append(groupRows.elements); cellTemplates = groupRows.cellTemplates } else { this._detachGroupCountClass() } return cellTemplates } _applyCellTemplates(templates) { null === templates || void 0 === templates || templates.forEach((template => { template() })) } _makeGroupRows(groups, groupByDate) { const tableCreatorStrategy = this._isVerticalGroupedWorkSpace() ? tableCreator.VERTICAL : tableCreator.HORIZONTAL; return tableCreator.makeGroupedTable(tableCreatorStrategy, groups, { groupHeaderRowClass: _m_classes.GROUP_ROW_CLASS, groupRowClass: _m_classes.GROUP_ROW_CLASS, groupHeaderClass: this._getGroupHeaderClass.bind(this), groupHeaderContentClass: _m_classes.GROUP_HEADER_CONTENT_CLASS }, this._getCellCount() || 1, this.option("resourceCellTemplate"), this._getGroupCount(), groupByDate) } _renderDateHeader() { const container = this._getDateHeaderContainer(); const $headerRow = (0, _renderer.default)("
").addClass("dx-scheduler-header-row"); const count = this._getCellCount(); const cellTemplate = this._getDateHeaderTemplate(); const repeatCount = this._getCalculateHeaderCellRepeatCount(); const templateCallbacks = []; const groupByDate = this.isGroupedByDate(); if (!groupByDate) { for (let rowIndex = 0; rowIndex < repeatCount; rowIndex++) { for (let columnIndex = 0; columnIndex < count; columnIndex++) { const templateIndex = rowIndex * count + columnIndex; this._renderDateHeaderTemplate($headerRow, columnIndex, templateIndex, cellTemplate, templateCallbacks) } } container.append($headerRow) } else { const colSpan = groupByDate ? this._getGroupCount() : 1; for (let columnIndex = 0; columnIndex < count; columnIndex++) { const templateIndex = columnIndex * repeatCount; const cellElement = this._renderDateHeaderTemplate($headerRow, columnIndex, templateIndex, cellTemplate, templateCallbacks); cellElement.attr("colSpan", colSpan) } container.prepend($headerRow) } this._applyCellTemplates(templateCallbacks); return $headerRow } _renderDateHeaderTemplate(container, panelCellIndex, templateIndex, cellTemplate, templateCallbacks) { const validTemplateIndex = this.isGroupedByDate() ? Math.floor(templateIndex / this._getGroupCount()) : templateIndex; const { completeDateHeaderMap: completeDateHeaderMap } = this.viewDataProvider; const { text: text, startDate: date } = completeDateHeaderMap[completeDateHeaderMap.length - 1][validTemplateIndex]; const $cell = (0, _renderer.default)("
").addClass(this._getHeaderPanelCellClass(panelCellIndex)).attr("title", text); if (null !== cellTemplate && void 0 !== cellTemplate && cellTemplate.render) { templateCallbacks.push(cellTemplate.render.bind(cellTemplate, { model: _extends({ text: text, date: date }, this._getGroupsForDateHeaderTemplate(templateIndex)), index: templateIndex, container: (0, _element.getPublicElement)($cell) })) } else { $cell.text(text) } container.append($cell); return $cell } _getGroupsForDateHeaderTemplate(templateIndex) { let indexMultiplier = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1; let groupIndex; let groups; if (this._isHorizontalGroupedWorkSpace() && !this.isGroupedByDate()) { groupIndex = this._getGroupIndex(0, templateIndex * indexMultiplier); const groupsArray = (0, _m_utils2.getCellGroups)(groupIndex, this.option("groups")); groups = (0, _m_utils2.getGroupsObjectFromGroupsArray)(groupsArray) } return { groups: groups, groupIndex: groupIndex } } _getHeaderPanelCellClass(i) { return this._groupedStrategy.addAdditionalGroupCellClasses("dx-scheduler-header-panel-cell dx-scheduler-cell-sizes-horizontal", i + 1, void 0, void 0, this.isGroupedByDate()) } _renderAllDayPanel(index) { let cellCount = this._getCellCount(); if (!this._isVerticalGroupedWorkSpace()) { cellCount *= this._getGroupCount() || 1 } const cellTemplates = this._renderTableBody({ container: this._allDayPanels.length ? (0, _element.getPublicElement)(this._allDayTables[index]) : (0, _element.getPublicElement)(this._$allDayTable), rowCount: 1, cellCount: cellCount, cellClass: this._getAllDayPanelCellClass.bind(this), rowClass: "dx-scheduler-all-day-table-row", cellTemplate: this.option("dataCellTemplate"), getCellData: this._oldRender_getAllDayCellData(index), groupIndex: index }, true); this._toggleAllDayVisibility(true); this._applyCellTemplates(cellTemplates) } _renderGroupAllDayPanel() { if (this._isVerticalGroupedWorkSpace()) { const groupCount = this._getGroupCount(); for (let i = 0; i < groupCount; i++) { this._renderAllDayPanel(i) } } } _getAllDayPanelCellClass(i, j) { const cellClass = `${ALL_DAY_TABLE_CELL_CLASS} dx-scheduler-cell-sizes-horizontal`; return this._groupedStrategy.addAdditionalGroupCellClasses(cellClass, j + 1) } _renderTimePanel() { const repeatCount = this._groupedStrategy.calculateTimeCellRepeatCount(); const getData = (rowIndex, field) => { let allDayPanelsCount = 0; if (this.isAllDayPanelVisible) { allDayPanelsCount = 1 } if (this.isGroupedAllDayPanel()) { allDayPanelsCount = Math.ceil((rowIndex + 1) / this._getRowCount()) } const validRowIndex = rowIndex + allDayPanelsCount; return this.viewDataProvider.completeTimePanelMap[validRowIndex][field] }; this._renderTableBody({ container: (0, _element.getPublicElement)(this._$timePanel), rowCount: this._getTimePanelRowCount() * repeatCount, cellCount: 1, cellClass: this._getTimeCellClass.bind(this), rowClass: "dx-scheduler-time-panel-row", cellTemplate: this.option("timeCellTemplate"), getCellText: rowIndex => getData(rowIndex, "text"), getCellDate: rowIndex => getData(rowIndex, "startDate"), groupCount: this._getGroupCount(), allDayElements: this._insertAllDayRowsIntoDateTable() ? this._allDayTitles : void 0, getTemplateData: (rowIndex => { if (!this._isVerticalGroupedWorkSpace()) { return {} } const groupIndex = this._getGroupIndex(rowIndex, 0); const groupsArray = (0, _m_utils2.getCellGroups)(groupIndex, this.option("groups")); const groups = (0, _m_utils2.getGroupsObjectFromGroupsArray)(groupsArray); return { groupIndex: groupIndex, groups: groups } }).bind(this) }) } _getTimeCellClass(i) { const cellClass = "dx-scheduler-time-panel-cell dx-scheduler-cell-sizes-vertical"; return this._isVerticalGroupedWorkSpace() ? this._groupedStrategy.addAdditionalGroupCellClasses(cellClass, i, i) : cellClass } _renderDateTable() { const groupCount = this._getGroupCount(); this._renderTableBody({ container: (0, _element.getPublicElement)(this._$dateTable), rowCount: this._getTotalRowCount(groupCount), cellCount: this._getTotalCellCount(groupCount), cellClass: this._getDateTableCellClass.bind(this), rowClass: _m_classes.DATE_TABLE_ROW_CLASS, cellTemplate: this.option("dataCellTemplate"), getCellData: (_, rowIndex, columnIndex) => { const isGroupedAllDayPanel = this.isGroupedAllDayPanel(); let validRowIndex = rowIndex; if (isGroupedAllDayPanel) { const rowCount = this._getRowCount(); const allDayPanelsCount = Math.ceil(rowIndex / rowCount); validRowIndex += allDayPanelsCount } const { cellData: cellData } = this.viewDataProvider.viewDataMap.dateTableMap[validRowIndex][columnIndex]; return { value: this._filterCellDataFields(cellData), fullValue: cellData, key: "dxCellData" } }, allDayElements: this._insertAllDayRowsIntoDateTable() ? this._allDayPanels : void 0, groupCount: groupCount, groupByDate: this.option("groupByDate") }) } _insertAllDayRowsIntoDateTable() { return this._groupedStrategy.insertAllDayRowsIntoDateTable() } _renderTableBody(options, delayCellTemplateRendering) { let result = []; if (!delayCellTemplateRendering) { this._applyCellTemplates(tableCreator.makeTable(options)) } else { result = tableCreator.makeTable(options) } return result } } const createDragBehaviorConfig = (container, rootElement, isDefaultDraggingMode, dragBehavior, enableDefaultDragging, disableDefaultDragging, getDroppableCell, getDateTables, removeDroppableCellClass, getCellWidth, options) => { const state = { dragElement: void 0, itemData: void 0 }; const isItemDisabled = () => { const { itemData: itemData } = state; if (itemData) { const getter = (0, _data.compileGetter)("disabled"); return getter(itemData) } return true }; const cursorOffset = options.isSetCursorOffset ? () => { const $dragElement = (0, _renderer.default)(state.dragElement); return { x: (0, _size.getWidth)($dragElement) / 2, y: (0, _size.getHeight)($dragElement) / 2 } } : void 0; return { container: container, dragTemplate: () => state.dragElement, onDragStart: e => { if (!isDefaultDraggingMode) { disableDefaultDragging() } const canceled = e.cancel; const { event: event } = e; const $itemElement = (0, _renderer.default)(e.itemElement); const appointments = e.component._appointments; state.itemData = options.getItemData(e.itemElement, appointments); const settings = options.getItemSettings($itemElement, e); const { initialPosition: initialPosition } = options; if (!isItemDisabled()) { event.data = event.data || {}; if (!canceled) { if (!settings.isCompact) { dragBehavior.updateDragSource(state.itemData, settings) } state.dragElement = ((itemData, settings, appointments) => { const appointmentIndex = appointments.option("items").length; settings.isCompact = false; settings.virtual = false; const items = appointments._renderItem(appointmentIndex, { itemData: itemData, settings: [settings] }); return items[0] })(state.itemData, settings, appointments); event.data.itemElement = state.dragElement; event.data.initialPosition = initialPosition ?? (0, _translator.locate)((0, _renderer.default)(state.dragElement)); event.data.itemData = state.itemData; event.data.itemSettings = settings; dragBehavior.onDragStart(event.data); (0, _translator.resetPosition)((0, _renderer.default)(state.dragElement)) } } }, onDragMove: () => { if (isDefaultDraggingMode) { return } const elements = (() => { const appointmentWidth = (0, _size.getWidth)(state.dragElement); const cellWidth = getCellWidth(); const isWideAppointment = appointmentWidth > cellWidth; const isNarrowAppointment = appointmentWidth <= 10; const dragElementContainer = (0, _renderer.default)(state.dragElement).parent().get(0); const boundingRect = (0, _position.getBoundingRect)(dragElementContainer); const newX = boundingRect.left; const newY = boundingRect.top; if (isWideAppointment) { return _dom_adapter.default.elementsFromPoint(newX + 10, newY + 10, dragElementContainer) } if (isNarrowAppointment) { return _dom_adapter.default.elementsFromPoint(newX, newY, dragElementContainer) } return _dom_adapter.default.elementsFromPoint(newX + appointmentWidth / 2, newY + 10, dragElementContainer) })(); const isMoveUnderControl = !!elements.find((el => el === rootElement.get(0))); const dateTables = getDateTables(); const droppableCell = elements.find((el => { const { classList: classList } = el; const isCurrentSchedulerElement = 1 === dateTables.find(el).length; return isCurrentSchedulerElement && (classList.contains(DATE_TABLE_CELL_CLASS) || classList.contains(ALL_DAY_TABLE_CELL_CLASS)) })); if (droppableCell) { if (!getDroppableCell().is(droppableCell)) { removeDroppableCellClass() }(0, _renderer.default)(droppableCell).addClass("dx-scheduler-date-table-droppable-cell") } else if (!isMoveUnderControl) { removeDroppableCellClass() } }, onDragEnd: e => { var _state$dragElement; if (!isDefaultDraggingMode) { enableDefaultDragging() } if (!isItemDisabled()) { dragBehavior.onDragEnd(e) } null === (_state$dragElement = state.dragElement) || void 0 === _state$dragElement || _state$dragElement.remove(); removeDroppableCellClass() }, cursorOffset: cursorOffset, filter: options.filter } }; exports.default = SchedulerWorkSpace }, 74228: /*!*************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_work_space_day.js ***! \*************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 99393)); var _m_constants = __webpack_require__( /*! ../m_constants */ 6324); var _m_work_space_vertical = _interopRequireDefault(__webpack_require__( /*! ./m_work_space_vertical */ 2986)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } class SchedulerWorkSpaceDay extends _m_work_space_vertical.default { get type() { return _m_constants.VIEWS.DAY } _getElementClass() { return "dx-scheduler-work-space-day" } _renderDateHeader() { return 1 === this.option("intervalCount") ? null : super._renderDateHeader() } renderRHeaderPanel() { if (1 === this.option("intervalCount")) { super.renderRHeaderPanel(false) } else { super.renderRHeaderPanel(true) } } }(0, _component_registrator.default)("dxSchedulerWorkSpaceDay", SchedulerWorkSpaceDay); exports.default = SchedulerWorkSpaceDay }, 48854: /*!*************************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_work_space_grouped_strategy_horizontal.js ***! \*************************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _position = __webpack_require__( /*! ../../../core/utils/position */ 37518); var _const = __webpack_require__( /*! ../../scheduler/workspaces/const */ 7836); var _m_classes = __webpack_require__( /*! ../m_classes */ 43600); exports.default = class { constructor(_workSpace) { this._workSpace = _workSpace } prepareCellIndexes(cellCoordinates, groupIndex, inAllDay) { const groupByDay = this._workSpace.isGroupedByDate(); if (!groupByDay) { return { rowIndex: cellCoordinates.rowIndex, columnIndex: cellCoordinates.columnIndex + groupIndex * this._workSpace._getCellCount() } } return { rowIndex: cellCoordinates.rowIndex, columnIndex: cellCoordinates.columnIndex * this._workSpace._getGroupCount() + groupIndex } } getGroupIndex(rowIndex, columnIndex) { const groupByDay = this._workSpace.isGroupedByDate(); const groupCount = this._workSpace._getGroupCount(); if (groupByDay) { return columnIndex % groupCount } return Math.floor(columnIndex / this._workSpace._getCellCount()) } calculateHeaderCellRepeatCount() { return this._workSpace._getGroupCount() || 1 } insertAllDayRowsIntoDateTable() { return false } getTotalCellCount(groupCount) { groupCount = groupCount || 1; return this._workSpace._getCellCount() * groupCount } getTotalRowCount() { return this._workSpace._getRowCount() } calculateTimeCellRepeatCount() { return 1 } getWorkSpaceMinWidth() { const workSpaceElementWidth = (0, _position.getBoundingRect)(this._workSpace.$element().get(0)).width; return workSpaceElementWidth - this._workSpace.getTimePanelWidth() - 2 * _const.WORK_SPACE_BORDER_PX } getAllDayOffset() { return this._workSpace.getAllDayHeight() } getGroupCountClass(groups) { return } getLeftOffset() { return this._workSpace.getTimePanelWidth() } _createGroupBoundOffset(startCell, endCell, cellWidth) { const extraOffset = cellWidth / 2; const startOffset = startCell ? startCell.offset().left - extraOffset : 0; const endOffset = endCell ? endCell.offset().left + cellWidth + extraOffset : 0; return { left: startOffset, right: endOffset, top: 0, bottom: 0 } } _getGroupedByDateBoundOffset($cells, cellWidth) { const lastCellIndex = $cells.length - 1; const startCell = $cells.eq(0); const endCell = $cells.eq(lastCellIndex); return this._createGroupBoundOffset(startCell, endCell, cellWidth) } getGroupBoundsOffset(cellCount, $cells, cellWidth, coordinates, groupedDataMap) { if (this._workSpace.isGroupedByDate()) { return this._getGroupedByDateBoundOffset($cells, cellWidth) } let startCell; let endCell; const cellIndex = this._workSpace.getCellIndexByCoordinates(coordinates); const groupIndex = coordinates.groupIndex || Math.floor(cellIndex / cellCount); const currentCellGroup = groupedDataMap.dateTableGroupedMap[groupIndex]; if (currentCellGroup) { const groupRowLength = currentCellGroup[0].length; const groupStartPosition = currentCellGroup[0][0].position; const groupEndPosition = currentCellGroup[0][groupRowLength - 1].position; startCell = $cells.eq(groupStartPosition.columnIndex); endCell = $cells.eq(groupEndPosition.columnIndex) } return this._createGroupBoundOffset(startCell, endCell, cellWidth) } shiftIndicator($indicator, height, rtlOffset, groupIndex) { const offset = this._getIndicatorOffset(groupIndex); const horizontalOffset = rtlOffset ? rtlOffset - offset : offset; $indicator.css("left", horizontalOffset); $indicator.css("top", height) } _getIndicatorOffset(groupIndex) { const groupByDay = this._workSpace.isGroupedByDate(); return groupByDay ? this._calculateGroupByDateOffset(groupIndex) : this._calculateOffset(groupIndex) } _calculateOffset(groupIndex) { const indicatorStartPosition = this._workSpace.getIndicatorOffset(groupIndex); const offset = this._workSpace._getCellCount() * this._workSpace.getRoundedCellWidth(groupIndex - 1, 0) * groupIndex; return indicatorStartPosition + offset } _calculateGroupByDateOffset(groupIndex) { return this._workSpace.getIndicatorOffset(0) * this._workSpace._getGroupCount() + this._workSpace.getRoundedCellWidth(groupIndex - 1, 0) * groupIndex } getShaderOffset(i, width) { const offset = this._workSpace._getCellCount() * this._workSpace.getRoundedCellWidth(i - 1) * i; return this._workSpace.option("rtlEnabled") ? (0, _position.getBoundingRect)(this._workSpace._dateTableScrollable.$content().get(0)).width - offset - this._workSpace.getTimePanelWidth() - width : offset } getShaderTopOffset(i) { return -this.getShaderMaxHeight() * (i > 0 ? 1 : 0) } getShaderHeight() { const height = this._workSpace.getIndicationHeight(); return height } getShaderMaxHeight() { return (0, _position.getBoundingRect)(this._workSpace._dateTableScrollable.$content().get(0)).height } getShaderWidth(i) { return this._workSpace.getIndicationWidth(i) } getScrollableScrollTop(allDay) { return !allDay ? this._workSpace.getScrollable().scrollTop() : 0 } addAdditionalGroupCellClasses(cellClass, index, i, j) { let applyUnconditionally = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : false; cellClass = this._addLastGroupCellClass(cellClass, index, applyUnconditionally); return this._addFirstGroupCellClass(cellClass, index, applyUnconditionally) } _addLastGroupCellClass(cellClass, index, applyUnconditionally) { if (applyUnconditionally) { return `${cellClass} ${_m_classes.LAST_GROUP_CELL_CLASS}` } const groupByDate = this._workSpace.isGroupedByDate(); if (groupByDate) { if (index % this._workSpace._getGroupCount() === 0) { return `${cellClass} ${_m_classes.LAST_GROUP_CELL_CLASS}` } } else if (index % this._workSpace._getCellCount() === 0) { return `${cellClass} ${_m_classes.LAST_GROUP_CELL_CLASS}` } return cellClass } _addFirstGroupCellClass(cellClass, index, applyUnconditionally) { if (applyUnconditionally) { return `${cellClass} ${_m_classes.FIRST_GROUP_CELL_CLASS}` } const groupByDate = this._workSpace.isGroupedByDate(); if (groupByDate) { if ((index - 1) % this._workSpace._getGroupCount() === 0) { return `${cellClass} ${_m_classes.FIRST_GROUP_CELL_CLASS}` } } else if ((index - 1) % this._workSpace._getCellCount() === 0) { return `${cellClass} ${_m_classes.FIRST_GROUP_CELL_CLASS}` } return cellClass } } }, 2862: /*!***********************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_work_space_grouped_strategy_vertical.js ***! \***********************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _position = __webpack_require__( /*! ../../../core/utils/position */ 37518); var _index = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084); var _const = __webpack_require__( /*! ../../scheduler/workspaces/const */ 7836); var _m_classes = __webpack_require__( /*! ../m_classes */ 43600); var _m_cache = __webpack_require__( /*! ./m_cache */ 14553); exports.default = class { constructor(_workSpace) { this._workSpace = _workSpace; this.cache = new _m_cache.Cache } prepareCellIndexes(cellCoordinates, groupIndex, inAllDayRow) { let rowIndex = cellCoordinates.rowIndex + groupIndex * this._workSpace._getRowCount(); if (this._workSpace.supportAllDayRow() && this._workSpace.option("showAllDayPanel")) { rowIndex += groupIndex; if (!inAllDayRow) { rowIndex += 1 } } return { rowIndex: rowIndex, columnIndex: cellCoordinates.columnIndex } } getGroupIndex(rowIndex) { return Math.floor(rowIndex / this._workSpace._getRowCount()) } calculateHeaderCellRepeatCount() { return 1 } insertAllDayRowsIntoDateTable() { return this._workSpace.option("showAllDayPanel") } getTotalCellCount() { return this._workSpace._getCellCount() } getTotalRowCount() { return this._workSpace._getRowCount() * this._workSpace._getGroupCount() } calculateTimeCellRepeatCount() { return this._workSpace._getGroupCount() || 1 } getWorkSpaceMinWidth() { let minWidth = this._workSpace._getWorkSpaceWidth(); const workSpaceElementWidth = (0, _position.getBoundingRect)(this._workSpace.$element().get(0)).width; const workspaceContainerWidth = workSpaceElementWidth - this._workSpace.getTimePanelWidth() - this._workSpace.getGroupTableWidth() - 2 * _const.WORK_SPACE_BORDER_PX; if (minWidth < workspaceContainerWidth) { minWidth = workspaceContainerWidth } return minWidth } getAllDayOffset() { return 0 } getGroupCountClass(groups) { return (0, _index.getVerticalGroupCountClass)(groups) } getLeftOffset() { return this._workSpace.getTimePanelWidth() + this._workSpace.getGroupTableWidth() } getGroupBoundsOffset(groupIndex, _ref) { let [$firstCell, $lastCell] = _ref; return this.cache.get(`groupBoundsOffset${groupIndex}`, (() => { const startDayHour = this._workSpace.option("startDayHour"); const endDayHour = this._workSpace.option("endDayHour"); const hoursInterval = this._workSpace.option("hoursInterval"); const dayHeight = (0, _index.calculateDayDuration)(startDayHour, endDayHour) / hoursInterval * this._workSpace.getCellHeight(); const scrollTop = this.getScrollableScrollTop(); const headerRowHeight = (0, _position.getBoundingRect)(this._workSpace._$headerPanelContainer.get(0)).height; let topOffset = groupIndex * dayHeight + headerRowHeight + this._workSpace.option("getHeaderHeight")() - scrollTop; if (this._workSpace.option("showAllDayPanel") && this._workSpace.supportAllDayRow()) { topOffset += this._workSpace.getCellHeight() * (groupIndex + 1) } const bottomOffset = topOffset + dayHeight; const { left: left } = $firstCell.getBoundingClientRect(); const { right: right } = $lastCell.getBoundingClientRect(); this._groupBoundsOffset = { left: left, right: right, top: topOffset, bottom: bottomOffset }; return this._groupBoundsOffset })) } shiftIndicator($indicator, height, rtlOffset, i) { const offset = this._workSpace.getIndicatorOffset(0); const tableOffset = this._workSpace.option("crossScrollingEnabled") ? 0 : this._workSpace.getGroupTableWidth(); const horizontalOffset = rtlOffset ? rtlOffset - offset : offset; let verticalOffset = this._workSpace._getRowCount() * this._workSpace.getCellHeight() * i; if (this._workSpace.supportAllDayRow() && this._workSpace.option("showAllDayPanel")) { verticalOffset += this._workSpace.getAllDayHeight() * (i + 1) } $indicator.css("left", horizontalOffset + tableOffset); $indicator.css("top", height + verticalOffset) } getShaderOffset(i, width) { const offset = this._workSpace.option("crossScrollingEnabled") ? 0 : this._workSpace.getGroupTableWidth(); return this._workSpace.option("rtlEnabled") ? (0, _position.getBoundingRect)(this._$container.get(0)).width - offset - this._workSpace.getWorkSpaceLeftOffset() - width : offset } getShaderTopOffset(i) { return 0 } getShaderHeight() { let height = this._workSpace.getIndicationHeight(); if (this._workSpace.supportAllDayRow() && this._workSpace.option("showAllDayPanel")) { height += this._workSpace.getCellHeight() } return height } getShaderMaxHeight() { let height = this._workSpace._getRowCount() * this._workSpace.getCellHeight(); if (this._workSpace.supportAllDayRow() && this._workSpace.option("showAllDayPanel")) { height += this._workSpace.getCellHeight() } return height } getShaderWidth() { return this._workSpace.getIndicationWidth(0) } getScrollableScrollTop() { return this._workSpace.getScrollable().scrollTop() } addAdditionalGroupCellClasses(cellClass, index, i, j) { cellClass = this._addLastGroupCellClass(cellClass, i + 1); return this._addFirstGroupCellClass(cellClass, i + 1) } _addLastGroupCellClass(cellClass, index) { if (index % this._workSpace._getRowCount() === 0) { return `${cellClass} ${_m_classes.LAST_GROUP_CELL_CLASS}` } return cellClass } _addFirstGroupCellClass(cellClass, index) { if ((index - 1) % this._workSpace._getRowCount() === 0) { return `${cellClass} ${_m_classes.FIRST_GROUP_CELL_CLASS}` } return cellClass } } }, 34623: /*!*******************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_work_space_indicator.js ***! \*******************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 99393)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374)); var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198)); var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306); var _position = __webpack_require__( /*! ../../../core/utils/position */ 37518); var _size = __webpack_require__( /*! ../../../core/utils/size */ 58664); var _window = __webpack_require__( /*! ../../../core/utils/window */ 58201); var _date2 = __webpack_require__( /*! ../../core/utils/date */ 24321); var _index = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084); var _m_classes = __webpack_require__( /*! ../m_classes */ 43600); var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../m_utils_time_zone */ 57880)); var _m_work_space = _interopRequireDefault(__webpack_require__( /*! ./m_work_space */ 48377)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const toMs = _date.default.dateToMilliseconds; class SchedulerWorkSpaceIndicator extends _m_work_space.default { _getToday() { const viewOffset = this.option("viewOffset"); const today = (0, _index.getToday)(this.option("indicatorTime"), this.timeZoneCalculator); return _date2.dateUtilsTs.addOffsets(today, [-viewOffset]) } isIndicationOnView() { if (this.option("showCurrentTimeIndicator")) { const today = this._getToday(); const endViewDate = _date.default.trimTime(this.getEndViewDate()); return _date.default.dateInRange(today, this.getStartViewDate(), new Date(endViewDate.getTime() + toMs("day"))) } return false } isIndicationAvailable() { if (!(0, _window.hasWindow)()) { return false } const today = this._getToday(); return today >= _date.default.trimTime(new Date(this.getStartViewDate())) } isIndicatorVisible() { const today = this._getToday(); const endViewDate = new Date(this.getEndViewDate().getTime() + toMs("minute") - 1); const firstViewDate = new Date(this.getStartViewDate()); firstViewDate.setFullYear(today.getFullYear(), today.getMonth(), today.getDate()); endViewDate.setFullYear(today.getFullYear(), today.getMonth(), today.getDate()); return _date.default.dateInRange(today, firstViewDate, endViewDate) } _renderIndicator(height, rtlOffset, $container, groupCount) { const groupedByDate = this.isGroupedByDate(); const repeatCount = groupedByDate ? 1 : groupCount; for (let i = 0; i < repeatCount; i++) { const $indicator = this._createIndicator($container); (0, _size.setWidth)($indicator, groupedByDate ? this.getCellWidth() * groupCount : this.getCellWidth()); this._groupedStrategy.shiftIndicator($indicator, height, rtlOffset, i) } } _createIndicator($container) { const $indicator = (0, _renderer.default)("
").addClass("dx-scheduler-date-time-indicator"); $container.append($indicator); return $indicator } _getRtlOffset(width) { return this.option("rtlEnabled") ? (0, _position.getBoundingRect)(this._dateTableScrollable.$content().get(0)).width - this.getTimePanelWidth() - width : 0 } _setIndicationUpdateInterval() { if (!this.option("showCurrentTimeIndicator") || 0 === this.option("indicatorUpdateInterval")) { return } this._clearIndicatorUpdateInterval(); this._indicatorInterval = setInterval((() => { this.renderCurrentDateTimeIndication() }), this.option("indicatorUpdateInterval")) } _clearIndicatorUpdateInterval() { if (this._indicatorInterval) { clearInterval(this._indicatorInterval); delete this._indicatorInterval } } _isVerticalShader() { return true } getIndicationWidth(groupIndex) { const maxWidth = this.getCellWidth() * this._getCellCount(); let difference = this._getIndicatorDuration(); if (difference > this._getCellCount()) { difference = this._getCellCount() } const width = difference * this.getRoundedCellWidth(groupIndex, groupIndex * this._getCellCount(), difference); return maxWidth < width ? maxWidth : width } getIndicatorOffset(groupIndex) { const difference = this._getIndicatorDuration() - 1; const offset = difference * this.getRoundedCellWidth(groupIndex, groupIndex * this._getCellCount(), difference); return offset } _getIndicatorDuration() { const today = this._getToday(); const firstViewDate = new Date(this.getStartViewDate()); let 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() { const today = _m_utils_time_zone.default.getDateWithoutTimezoneChange(this._getToday()); const cellHeight = this.getCellHeight(); const date = new Date(this.getStartViewDate()); if (this.isIndicationOnView()) { date.setFullYear(today.getFullYear(), today.getMonth(), today.getDate()) } const duration = today.getTime() - date.getTime(); const cellCount = duration / this.getCellDuration(); return cellCount * cellHeight } _dispose() { this._clearIndicatorUpdateInterval(); super._dispose.apply(this, arguments) } renderCurrentDateTimeIndication() { this.renderCurrentDateTimeLineAndShader(); if (this.isRenovatedRender()) { this.renderWorkSpace({ generateNewData: true, renderComponents: { header: true, timePanel: true } }) } } renderCurrentDateTimeLineAndShader() { var _this$_shader; this._cleanDateTimeIndicator(); null === (_this$_shader = this._shader) || void 0 === _this$_shader || _this$_shader.clean(); this._renderDateTimeIndication() } _isCurrentTimeHeaderCell(headerIndex) { if (this.isIndicationOnView()) { const { completeDateHeaderMap: completeDateHeaderMap } = this.viewDataProvider; const date = completeDateHeaderMap[completeDateHeaderMap.length - 1][headerIndex].startDate; return _date.default.sameDate(date, this._getToday()) } return false } _getHeaderPanelCellClass(i) { const cellClass = super._getHeaderPanelCellClass(i); if (this._isCurrentTimeHeaderCell(i)) { return `${cellClass} ${_m_classes.HEADER_CURRENT_TIME_CELL_CLASS}` } return cellClass } _cleanView() { super._cleanView(); this._cleanDateTimeIndicator() } _dimensionChanged() { super._dimensionChanged(); this.renderCurrentDateTimeLineAndShader() } _cleanDateTimeIndicator() { this.$element().find(".dx-scheduler-date-time-indicator").remove() } _cleanWorkSpace() { super._cleanWorkSpace(); this._renderDateTimeIndication(); this._setIndicationUpdateInterval() } _optionChanged(args) { switch (args.name) { case "showCurrentTimeIndicator": case "indicatorTime": this._cleanWorkSpace(); break; case "indicatorUpdateInterval": this._setIndicationUpdateInterval(); break; case "showAllDayPanel": case "allDayExpanded": case "crossScrollingEnabled": super._optionChanged(args); this.renderCurrentDateTimeIndication(); break; case "shadeUntilCurrentTime": this.renderCurrentDateTimeIndication(); break; default: super._optionChanged(args) } } _getDefaultOptions() { return (0, _extend.extend)(super._getDefaultOptions(), { showCurrentTimeIndicator: true, indicatorTime: new Date, indicatorUpdateInterval: 5 * toMs("minute"), shadeUntilCurrentTime: true }) } _getCurrentTimePanelCellIndices() { const rowCountPerGroup = this._getTimePanelRowCount(); const today = this._getToday(); const index = this.getCellIndexByDate(today); const { rowIndex: currentTimeRowIndex } = this._getCellCoordinatesByIndex(index); if (void 0 === currentTimeRowIndex) { return [] } let cellIndices; if (0 === currentTimeRowIndex) { cellIndices = [currentTimeRowIndex] } else { cellIndices = currentTimeRowIndex % 2 === 0 ? [currentTimeRowIndex - 1, currentTimeRowIndex] : [currentTimeRowIndex, currentTimeRowIndex + 1] } const verticalGroupCount = this._isVerticalGroupedWorkSpace() ? this._getGroupCount() : 1; return [...new Array(verticalGroupCount)].reduce(((currentIndices, _, groupIndex) => [...currentIndices, ...cellIndices.map((cellIndex => rowCountPerGroup * groupIndex + cellIndex))]), []) } _renderDateTimeIndication() { if (!this.isIndicationAvailable()) { return } if (this.option("shadeUntilCurrentTime")) { this._shader.render() } if (!this.isIndicationOnView() || !this.isIndicatorVisible()) { return } const groupCount = this._getGroupCount() || 1; const $container = this._dateTableScrollable.$content(); const height = this.getIndicationHeight(); const rtlOffset = this._getRtlOffset(this.getCellWidth()); this._renderIndicator(height, rtlOffset, $container, groupCount); if (!this.isRenovatedRender()) { this._setCurrentTimeCells() } } _setCurrentTimeCells() { const timePanelCells = this._getTimePanelCells(); const currentTimeCellIndices = this._getCurrentTimePanelCellIndices(); currentTimeCellIndices.forEach((timePanelCellIndex => { timePanelCells.eq(timePanelCellIndex).addClass("dx-scheduler-time-panel-current-time-cell") })) } _cleanCurrentTimeCells() { this.$element().find(".dx-scheduler-time-panel-current-time-cell").removeClass("dx-scheduler-time-panel-current-time-cell") } }(0, _component_registrator.default)("dxSchedulerWorkSpace", SchedulerWorkSpaceIndicator); exports.default = SchedulerWorkSpaceIndicator }, 50011: /*!***************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_work_space_month.js ***! \***************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 99393)); var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576); var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198)); var _position = __webpack_require__( /*! ../../../core/utils/position */ 37518); var _window = __webpack_require__( /*! ../../../core/utils/window */ 58201); var _index = __webpack_require__( /*! ../../scheduler/r1/components/index */ 42515); var _index2 = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084); var _m_constants = __webpack_require__( /*! ../m_constants */ 6324); var _m_utils = __webpack_require__( /*! ../m_utils */ 84110); var _m_work_space_indicator = _interopRequireDefault(__webpack_require__( /*! ./m_work_space_indicator */ 34623)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const toMs = _date.default.dateToMilliseconds; class SchedulerWorkSpaceMonth extends _m_work_space_indicator.default { get type() { return _m_constants.VIEWS.MONTH } _getElementClass() { return "dx-scheduler-work-space-month" } _getFormat() { return _index2.formatWeekday } _getIntervalBetween(currentDate) { const firstViewDate = this.getStartViewDate(); const timeZoneOffset = _date.default.getTimezonesDifference(firstViewDate, currentDate); return currentDate.getTime() - (firstViewDate.getTime() - 36e5 * this.option("startDayHour")) - timeZoneOffset } _getDateGenerationOptions() { return _extends({}, super._getDateGenerationOptions(), { cellCountInDay: 1 }) } getCellWidth() { return this.cache.get("cellWidth", (() => { let averageWidth = 0; const cells = this._getCells().slice(0, 7); cells.each(((index, element) => { averageWidth += (0, _window.hasWindow)() ? (0, _position.getBoundingRect)(element).width : 0 })); return 0 === cells.length ? void 0 : averageWidth / 7 })) } _insertAllDayRowsIntoDateTable() { return false } _getCellCoordinatesByIndex(index) { const rowIndex = Math.floor(index / this._getCellCount()); const columnIndex = index - this._getCellCount() * rowIndex; return { rowIndex: rowIndex, columnIndex: columnIndex } } _needCreateCrossScrolling() { return this.option("crossScrollingEnabled") || this._isVerticalGroupedWorkSpace() } _getViewStartByOptions() { return _index2.monthUtils.getViewStartByOptions(this.option("startDate"), this.option("currentDate"), this.option("intervalCount"), _date.default.getFirstMonthDate(this.option("startDate"))) } _updateIndex(index) { return index } isIndicationAvailable() { return false } getIntervalDuration() { return toMs("day") } getTimePanelWidth() { return 0 } supportAllDayRow() { return false } keepOriginalHours() { return true } getWorkSpaceLeftOffset() { return 0 } needApplyCollectorOffset() { return true } _getHeaderDate() { return this._getViewStartByOptions() } scrollToTime() { return (0, _common.noop)() } renderRAllDayPanel() {} renderRTimeTable() {} renderRDateTable() { _m_utils.utils.renovation.renderComponent(this, this._$dateTable, _index.DateTableMonthComponent, "renovatedDateTable", this._getRDateTableProps()) } _createWorkSpaceElements() { if (this._isVerticalGroupedWorkSpace()) { this._createWorkSpaceScrollableElements() } else { super._createWorkSpaceElements() } } _toggleAllDayVisibility() { return (0, _common.noop)() } _changeAllDayVisibility() { return (0, _common.noop)() } _renderTimePanel() { return (0, _common.noop)() } _renderAllDayPanel() { return (0, _common.noop)() } _setMonthClassesToCell($cell, data) { $cell.toggleClass("dx-scheduler-date-table-current-date", data.isCurrentDate).toggleClass("dx-scheduler-date-table-first-of-month", data.firstDayOfMonth).toggleClass("dx-scheduler-date-table-other-month", data.otherMonth) } _createAllDayPanelElements() {} _renderTableBody(options) { options.getCellText = (rowIndex, columnIndex) => { const date = this.viewDataProvider.completeViewDataMap[rowIndex][columnIndex].startDate; return _index2.monthUtils.getCellText(date, this.option("intervalCount")) }; options.getCellTextClass = "dx-scheduler-date-table-cell-text"; options.setAdditionalClasses = this._setMonthClassesToCell.bind(this); super._renderTableBody(options) } }(0, _component_registrator.default)("dxSchedulerWorkSpaceMonth", SchedulerWorkSpaceMonth); exports.default = SchedulerWorkSpaceMonth }, 2986: /*!******************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_work_space_vertical.js ***! \******************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _index = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084); var _m_work_space_indicator = (obj = __webpack_require__( /*! ./m_work_space_indicator */ 34623), obj && obj.__esModule ? obj : { default: obj }); var obj; function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } class SchedulerWorkspaceVertical extends _m_work_space_indicator.default { _getFormat() { return _index.formatWeekdayAndDay } generateRenderOptions() { const options = super.generateRenderOptions(); return _extends({}, options, { isGenerateTimePanelData: true }) } _isRenderHeaderPanelEmptyCell() { return true } } exports.default = SchedulerWorkspaceVertical }, 36828: /*!**************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_work_space_week.js ***! \**************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 99393)); var _index = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084); var _m_constants = __webpack_require__( /*! ../m_constants */ 6324); var _m_work_space_vertical = _interopRequireDefault(__webpack_require__( /*! ./m_work_space_vertical */ 2986)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } class SchedulerWorkSpaceWeek extends _m_work_space_vertical.default { get type() { return _m_constants.VIEWS.WEEK } _getElementClass() { return "dx-scheduler-work-space-week" } _calculateViewStartDate() { return _index.weekUtils.calculateViewStartDate(this.option("startDate"), this._firstDayOfWeek()) } }(0, _component_registrator.default)("dxSchedulerWorkSpaceWeek", SchedulerWorkSpaceWeek); exports.default = SchedulerWorkSpaceWeek }, 29544: /*!*******************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/m_work_space_work_week.js ***! \*******************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 99393)); var _index = __webpack_require__( /*! ../../scheduler/r1/utils/index */ 94084); var _m_constants = __webpack_require__( /*! ../m_constants */ 6324); var _m_work_space_week = _interopRequireDefault(__webpack_require__( /*! ./m_work_space_week */ 36828)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } class SchedulerWorkSpaceWorkWeek extends _m_work_space_week.default { get type() { return _m_constants.VIEWS.WORK_WEEK } constructor() { super(...arguments); this._getWeekendsCount = _index.getWeekendsCount } _getElementClass() { return "dx-scheduler-work-space-work-week" } }(0, _component_registrator.default)("dxSchedulerWorkSpaceWorkWeek", SchedulerWorkSpaceWorkWeek); exports.default = SchedulerWorkSpaceWorkWeek }, 11706: /*!************************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/view_model/m_date_header_data_generator.js ***! \************************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.DateHeaderDataGenerator = void 0; var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198)); var _m_constants = __webpack_require__( /*! ../../../scheduler/m_constants */ 6324); var _index = __webpack_require__( /*! ../../../scheduler/r1/utils/index */ 94084); var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../../m_utils_time_zone */ 57880)); const _excluded = ["startDate", "endDate", "isFirstGroupCell", "isLastGroupCell"]; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } exports.DateHeaderDataGenerator = class { constructor(_viewDataGenerator) { this._viewDataGenerator = _viewDataGenerator } getCompleteDateHeaderMap(options, completeViewDataMap) { const { isGenerateWeekDaysHeaderData: isGenerateWeekDaysHeaderData } = options; const result = []; if (isGenerateWeekDaysHeaderData) { const weekDaysRow = this._generateWeekDaysHeaderRowMap(options, completeViewDataMap); result.push(weekDaysRow) } const dateRow = this._generateHeaderDateRow(options, completeViewDataMap); result.push(dateRow); return result } _generateWeekDaysHeaderRowMap(options, completeViewDataMap) { const { isGroupedByDate: isGroupedByDate, groups: groups, groupOrientation: groupOrientation, startDayHour: startDayHour, endDayHour: endDayHour, hoursInterval: hoursInterval, isHorizontalGrouping: isHorizontalGrouping, intervalCount: intervalCount, viewOffset: viewOffset } = options; const cellCountInDay = this._viewDataGenerator.getCellCountInDay(startDayHour, endDayHour, hoursInterval); const horizontalGroupCount = (0, _index.getHorizontalGroupCount)(groups, groupOrientation); const index = completeViewDataMap[0][0].allDay ? 1 : 0; const colSpan = isGroupedByDate ? horizontalGroupCount * cellCountInDay : cellCountInDay; const groupCount = (0, _index.getGroupCount)(groups); const datesRepeatCount = isHorizontalGrouping && !isGroupedByDate ? groupCount : 1; const daysInGroup = this._viewDataGenerator.daysInInterval * intervalCount; const daysInView = daysInGroup * datesRepeatCount; const weekDaysRow = []; for (let dayIndex = 0; dayIndex < daysInView; dayIndex += 1) { const cell = completeViewDataMap[index][dayIndex * colSpan]; const shiftedStartDate = _m_utils_time_zone.default.addOffsetsWithoutDST(cell.startDate, -viewOffset); weekDaysRow.push(_extends({}, cell, { colSpan: colSpan, text: (0, _index.formatWeekdayAndDay)(shiftedStartDate), isFirstGroupCell: false, isLastGroupCell: false })) } return weekDaysRow } _generateHeaderDateRow(options, completeViewDataMap) { const { today: today, isGroupedByDate: isGroupedByDate, groupOrientation: groupOrientation, groups: groups, headerCellTextFormat: headerCellTextFormat, getDateForHeaderText: getDateForHeaderText, interval: interval, startViewDate: startViewDate, startDayHour: startDayHour, endDayHour: endDayHour, hoursInterval: hoursInterval, intervalCount: intervalCount, currentDate: currentDate, viewType: viewType, viewOffset: viewOffset } = options; const horizontalGroupCount = (0, _index.getHorizontalGroupCount)(groups, groupOrientation); const index = completeViewDataMap[0][0].allDay ? 1 : 0; const colSpan = isGroupedByDate ? horizontalGroupCount : 1; const isVerticalGrouping = "vertical" === groupOrientation; const cellCountInGroupRow = this._viewDataGenerator.getCellCount({ intervalCount: intervalCount, currentDate: currentDate, viewType: viewType, hoursInterval: hoursInterval, startDayHour: startDayHour, endDayHour: endDayHour }); const cellCountInDay = this._viewDataGenerator.getCellCountInDay(startDayHour, endDayHour, hoursInterval); const slicedByColumnsData = isGroupedByDate ? completeViewDataMap[index].filter(((_, columnIndex) => columnIndex % horizontalGroupCount === 0)) : completeViewDataMap[index]; const shouldShiftDatesForHeaderText = !(0, _index.isTimelineView)(viewType) || viewType === _m_constants.VIEWS.TIMELINE_MONTH; return slicedByColumnsData.map(((_ref, idx) => { let { startDate: startDate, isFirstGroupCell: isFirstGroupCell, isLastGroupCell: isLastGroupCell } = _ref, restProps = function(source, excluded) { if (null == source) { return {} } var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) { continue } target[key] = source[key] } } return target }(_ref, _excluded); const shiftedStartDate = _m_utils_time_zone.default.addOffsetsWithoutDST(startDate, -viewOffset); const shiftedStartDateForHeaderText = shouldShiftDatesForHeaderText ? shiftedStartDate : startDate; const text = (0, _index.getHeaderCellText)(idx % cellCountInGroupRow, shiftedStartDateForHeaderText, headerCellTextFormat, getDateForHeaderText, { interval: interval, startViewDate: startViewDate, startDayHour: startDayHour, cellCountInDay: cellCountInDay, viewOffset: viewOffset }); return _extends({}, restProps, { startDate: startDate, text: text, today: _date.default.sameDate(shiftedStartDate, today), colSpan: colSpan, isFirstGroupCell: isGroupedByDate || isFirstGroupCell && !isVerticalGrouping, isLastGroupCell: isGroupedByDate || isLastGroupCell && !isVerticalGrouping }) })) } generateDateHeaderData(completeDateHeaderMap, completeViewDataMap, options) { const { isGenerateWeekDaysHeaderData: isGenerateWeekDaysHeaderData, cellWidth: cellWidth, isProvideVirtualCellsWidth: isProvideVirtualCellsWidth, startDayHour: startDayHour, endDayHour: endDayHour, hoursInterval: hoursInterval, isMonthDateHeader: isMonthDateHeader } = options; const dataMap = []; let weekDayRowConfig = {}; const validCellWidth = cellWidth || 0; if (isGenerateWeekDaysHeaderData) { weekDayRowConfig = this._generateDateHeaderDataRow(options, completeDateHeaderMap, completeViewDataMap, this._viewDataGenerator.getCellCountInDay(startDayHour, endDayHour, hoursInterval), 0, validCellWidth); dataMap.push(weekDayRowConfig.dateRow) } const datesRowConfig = this._generateDateHeaderDataRow(options, completeDateHeaderMap, completeViewDataMap, 1, isGenerateWeekDaysHeaderData ? 1 : 0, validCellWidth); dataMap.push(datesRowConfig.dateRow); return { dataMap: dataMap, leftVirtualCellWidth: isProvideVirtualCellsWidth ? datesRowConfig.leftVirtualCellWidth : void 0, rightVirtualCellWidth: isProvideVirtualCellsWidth ? datesRowConfig.rightVirtualCellWidth : void 0, leftVirtualCellCount: datesRowConfig.leftVirtualCellCount, rightVirtualCellCount: datesRowConfig.rightVirtualCellCount, weekDayLeftVirtualCellWidth: weekDayRowConfig.leftVirtualCellWidth, weekDayRightVirtualCellWidth: weekDayRowConfig.rightVirtualCellWidth, weekDayLeftVirtualCellCount: weekDayRowConfig.leftVirtualCellCount, weekDayRightVirtualCellCount: weekDayRowConfig.rightVirtualCellCount, isMonthDateHeader: isMonthDateHeader } } _generateDateHeaderDataRow(options, completeDateHeaderMap, completeViewDataMap, baseColSpan, rowIndex, cellWidth) { const { startCellIndex: startCellIndex, cellCount: cellCount, isProvideVirtualCellsWidth: isProvideVirtualCellsWidth, groups: groups, groupOrientation: groupOrientation, isGroupedByDate: isGroupedByDate } = options; const horizontalGroupCount = (0, _index.getHorizontalGroupCount)(groups, groupOrientation); const colSpan = isGroupedByDate ? horizontalGroupCount * baseColSpan : baseColSpan; const leftVirtualCellCount = Math.floor(startCellIndex / colSpan); const displayedCellCount = (0, _index.getDisplayedCellCount)(cellCount, completeViewDataMap); const actualCellCount = Math.ceil((startCellIndex + displayedCellCount) / colSpan); const totalCellCount = (0, _index.getTotalCellCountByCompleteData)(completeViewDataMap); const dateRow = completeDateHeaderMap[rowIndex].slice(leftVirtualCellCount, actualCellCount); const finalLeftVirtualCellCount = leftVirtualCellCount * colSpan; const finalLeftVirtualCellWidth = finalLeftVirtualCellCount * cellWidth; const finalRightVirtualCellCount = totalCellCount - actualCellCount * colSpan; const finalRightVirtualCellWidth = finalRightVirtualCellCount * cellWidth; return { dateRow: dateRow, leftVirtualCellCount: finalLeftVirtualCellCount, leftVirtualCellWidth: isProvideVirtualCellsWidth ? finalLeftVirtualCellWidth : void 0, rightVirtualCellCount: finalRightVirtualCellCount, rightVirtualCellWidth: isProvideVirtualCellsWidth ? finalRightVirtualCellWidth : void 0 } } } }, 69033: /*!***********************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/view_model/m_grouped_data_map_provider.js ***! \***********************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.GroupedDataMapProvider = void 0; var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198)); var _date2 = __webpack_require__( /*! ../../../core/utils/date */ 24321); var _index = __webpack_require__( /*! ../../../scheduler/r1/utils/index */ 94084); var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../../m_utils_time_zone */ 57880)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const toMs = _date.default.dateToMilliseconds; exports.GroupedDataMapProvider = class { constructor(viewDataGenerator, viewDataMap, completeViewDataMap, viewOptions) { this.groupedDataMap = viewDataGenerator.generateGroupedDataMap(viewDataMap); this.completeViewDataMap = completeViewDataMap; this._viewOptions = viewOptions } getGroupStartDate(groupIndex) { var _firstRow$; const firstRow = this.getFirstGroupRow(groupIndex); return (null === firstRow || void 0 === firstRow || null === (_firstRow$ = firstRow[0]) || void 0 === _firstRow$ || null === (_firstRow$ = _firstRow$.cellData) || void 0 === _firstRow$ ? void 0 : _firstRow$.startDate) ?? null } getGroupEndDate(groupIndex) { const lastRow = this.getLastGroupRow(groupIndex); if (lastRow) { const lastColumnIndex = lastRow.length - 1; const { cellData: cellData } = lastRow[lastColumnIndex]; const { endDate: endDate } = cellData; return endDate } } findGroupCellStartDate(groupIndex, startDate, endDate, isFindByDate) { const groupData = this.getGroupFromDateTableGroupMap(groupIndex); const checkCellStartDate = (rowIndex, columnIndex) => { const { cellData: cellData } = groupData[rowIndex][columnIndex]; let { startDate: secondMin, endDate: secondMax } = cellData; if (isFindByDate) { secondMin = _date.default.trimTime(secondMin); secondMax = _date.default.setToDayEnd(secondMin) } if (_date.default.intervalsOverlap({ firstMin: startDate, firstMax: endDate, secondMin: secondMin, secondMax: secondMax })) { return secondMin } }; const startDateVerticalSearch = (() => { const cellCount = groupData[0].length; for (let columnIndex = 0; columnIndex < cellCount; ++columnIndex) { for (let rowIndex = 0; rowIndex < groupData.length; ++rowIndex) { const result = checkCellStartDate(rowIndex, columnIndex); if (result) { return result } } } })(); const startDateHorizontalSearch = (() => { for (let rowIndex = 0; rowIndex < groupData.length; ++rowIndex) { const row = groupData[rowIndex]; for (let columnIndex = 0; columnIndex < row.length; ++columnIndex) { const result = checkCellStartDate(rowIndex, columnIndex); if (result) { return result } } } })(); return startDateVerticalSearch > startDateHorizontalSearch ? startDateHorizontalSearch : startDateVerticalSearch } findAllDayGroupCellStartDate(groupIndex) { var _groupedData$; const groupedData = this.getGroupFromDateTableGroupMap(groupIndex); const cellData = null === groupedData || void 0 === groupedData || null === (_groupedData$ = groupedData[0]) || void 0 === _groupedData$ || null === (_groupedData$ = _groupedData$[0]) || void 0 === _groupedData$ ? void 0 : _groupedData$.cellData; return (null === cellData || void 0 === cellData ? void 0 : cellData.startDate) ?? null } findCellPositionInMap(cellInfo, isAppointmentRender) { const { groupIndex: groupIndex, startDate: startDate, isAllDay: isAllDay, index: index } = cellInfo; const { allDayPanelGroupedMap: allDayPanelGroupedMap, dateTableGroupedMap: dateTableGroupedMap } = this.groupedDataMap; const { viewOffset: viewOffset } = this._viewOptions; const rows = isAllDay && !this._viewOptions.isVerticalGrouping ? allDayPanelGroupedMap[groupIndex] ? [allDayPanelGroupedMap[groupIndex]] : [] : dateTableGroupedMap[groupIndex] || []; for (let rowIndex = 0; rowIndex < rows.length; rowIndex += 1) { const row = rows[rowIndex]; for (let columnIndex = 0; columnIndex < row.length; columnIndex += 1) { const cell = row[columnIndex]; const originCellData = cell.cellData; const cellData = isAppointmentRender ? _extends({}, originCellData, { startDate: _date2.dateUtilsTs.addOffsets(cell.cellData.startDate, [-viewOffset]), endDate: _date2.dateUtilsTs.addOffsets(cell.cellData.endDate, [-viewOffset]) }) : originCellData; if (this._isSameGroupIndexAndIndex(cellData, groupIndex, index)) { if (this.isStartDateInCell(startDate, isAllDay, cellData, originCellData)) { return cell.position } } } } return } isStartDateInCell(startDate, inAllDayRow, _ref, _ref2) { let { startDate: cellStartDate, endDate: cellEndDate, allDay: cellAllDay } = _ref; let { startDate: originCellStartDate, endDate: originCellEndDate } = _ref2; const { viewType: viewType } = this._viewOptions; const cellSecondIntervalOffset = this.getCellSecondIntervalOffset(originCellStartDate, originCellEndDate); const isCellCoversTwoIntervals = 0 !== cellSecondIntervalOffset; switch (true) { case !(0, _index.isDateAndTimeView)(viewType): case inAllDayRow && cellAllDay: return _date.default.sameDate(startDate, cellStartDate); case !inAllDayRow && !isCellCoversTwoIntervals: return startDate >= cellStartDate && startDate < cellEndDate; case !inAllDayRow && isCellCoversTwoIntervals: return this.isStartDateInTwoIntervalsCell(startDate, cellSecondIntervalOffset, cellStartDate, cellEndDate); default: return false } } getCellSecondIntervalOffset(cellStartDate, cellEndDate) { const nextHourCellStartDate = _date2.dateUtilsTs.addOffsets(cellStartDate, [toMs("hour")]); const cellTimezoneDiff = _m_utils_time_zone.default.getDaylightOffset(cellStartDate, cellEndDate); const cellNextHourTimezoneDiff = _m_utils_time_zone.default.getDaylightOffset(cellStartDate, nextHourCellStartDate); const isDSTInsideCell = 0 !== cellTimezoneDiff; const isWinterTimezoneNextHour = cellNextHourTimezoneDiff < 0; return !isDSTInsideCell && isWinterTimezoneNextHour ? Math.abs(cellNextHourTimezoneDiff * toMs("minute")) : 0 } isStartDateInTwoIntervalsCell(startDate, secondIntervalOffset, cellStartDate, cellEndDate) { const nextIntervalCellStartDate = _date2.dateUtilsTs.addOffsets(cellStartDate, [secondIntervalOffset]); const nextIntervalCellEndDate = _date2.dateUtilsTs.addOffsets(cellEndDate, [secondIntervalOffset]); const isInOriginInterval = startDate >= cellStartDate && startDate < cellEndDate; const isInSecondInterval = startDate >= nextIntervalCellStartDate && startDate < nextIntervalCellEndDate; return isInOriginInterval || isInSecondInterval } _isSameGroupIndexAndIndex(cellData, groupIndex, index) { return cellData.groupIndex === groupIndex && (void 0 === index || cellData.index === index) } getCellsGroup(groupIndex) { const { dateTableGroupedMap: dateTableGroupedMap } = this.groupedDataMap; const groupData = dateTableGroupedMap[groupIndex]; if (groupData) { const { cellData: cellData } = groupData[0][0]; return cellData.groups } } getCompletedGroupsInfo() { const { dateTableGroupedMap: dateTableGroupedMap } = this.groupedDataMap; return dateTableGroupedMap.map((groupData => { const firstCell = groupData[0][0]; const { allDay: allDay, groupIndex: groupIndex } = firstCell.cellData; return { allDay: allDay, groupIndex: groupIndex, startDate: this.getGroupStartDate(groupIndex), endDate: this.getGroupEndDate(groupIndex) } })).filter((_ref3 => { let { startDate: startDate } = _ref3; return !!startDate })) } getGroupIndices() { return this.getCompletedGroupsInfo().map((_ref4 => { let { groupIndex: groupIndex } = _ref4; return groupIndex })) } getGroupFromDateTableGroupMap(groupIndex) { const { dateTableGroupedMap: dateTableGroupedMap } = this.groupedDataMap; return dateTableGroupedMap[groupIndex] } getFirstGroupRow(groupIndex) { const groupedData = this.getGroupFromDateTableGroupMap(groupIndex); if (groupedData) { const { cellData: cellData } = groupedData[0][0]; return !cellData.allDay ? groupedData[0] : groupedData[1] } } getLastGroupRow(groupIndex) { const { dateTableGroupedMap: dateTableGroupedMap } = this.groupedDataMap; const groupedData = dateTableGroupedMap[groupIndex]; if (groupedData) { const lastRowIndex = groupedData.length - 1; return groupedData[lastRowIndex] } } getLastGroupCellPosition(groupIndex) { const groupRow = this.getLastGroupRow(groupIndex); return null === groupRow || void 0 === groupRow ? void 0 : groupRow[(null === groupRow || void 0 === groupRow ? void 0 : groupRow.length) - 1].position } getRowCountInGroup(groupIndex) { const groupRow = this.getLastGroupRow(groupIndex); const cellAmount = groupRow.length; const lastCellData = groupRow[cellAmount - 1].cellData; const lastCellIndex = lastCellData.index; return (lastCellIndex + 1) / groupRow.length } } }, 45512: /*!***********************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/view_model/m_time_panel_data_generator.js ***! \***********************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.TimePanelDataGenerator = void 0; var _date = (obj = __webpack_require__( /*! ../../../../core/utils/date */ 91198), obj && obj.__esModule ? obj : { default: obj }); var obj; var _date2 = __webpack_require__( /*! ../../../core/utils/date */ 24321); var _math = __webpack_require__( /*! ../../../core/utils/math */ 11390); var _index = __webpack_require__( /*! ../../../scheduler/r1/utils/index */ 94084); const _excluded = ["allDay", "startDate", "endDate", "groups", "groupIndex", "isFirstGroupCell", "isLastGroupCell", "index"]; function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const toMs = _date.default.dateToMilliseconds; exports.TimePanelDataGenerator = class { constructor(_viewDataGenerator) { this._viewDataGenerator = _viewDataGenerator } getCompleteTimePanelMap(options, completeViewDataMap) { const { startViewDate: startViewDate, cellDuration: cellDuration, startDayHour: startDayHour, isVerticalGrouping: isVerticalGrouping, intervalCount: intervalCount, currentDate: currentDate, viewType: viewType, hoursInterval: hoursInterval, endDayHour: endDayHour, viewOffset: viewOffset, today: today, showCurrentTimeIndicator: showCurrentTimeIndicator } = options; const rowsCount = completeViewDataMap.length - 1; const realEndViewDate = completeViewDataMap[rowsCount][completeViewDataMap[rowsCount].length - 1].endDate; const rowCountInGroup = this._viewDataGenerator.getRowCount({ intervalCount: intervalCount, currentDate: currentDate, viewType: viewType, hoursInterval: hoursInterval, startDayHour: startDayHour, endDayHour: endDayHour }); const cellCountInGroupRow = this._viewDataGenerator.getCellCount({ intervalCount: intervalCount, currentDate: currentDate, viewType: viewType, hoursInterval: hoursInterval, startDayHour: startDayHour, endDayHour: endDayHour }); let allDayRowsCount = 0; let usualCellIndex = 0; return completeViewDataMap.map(((row, index) => { const _row$ = row[0], { allDay: allDay, startDate: startDate, groups: groups, groupIndex: groupIndex, isFirstGroupCell: isFirstGroupCell, isLastGroupCell: isLastGroupCell, index: cellIndex } = _row$, restCellProps = function(source, excluded) { if (null == source) { return {} } var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) { continue } target[key] = source[key] } } return target }(_row$, _excluded); const highlighted = allDay ? false : this.isTimeCellShouldBeHighlighted(today, viewOffset, { startViewDate: startViewDate, realEndViewDate: realEndViewDate, showCurrentTimeIndicator: showCurrentTimeIndicator }, { date: startDate, index: usualCellIndex, duration: Math.round(cellDuration), isFirst: 0 === usualCellIndex, isLast: this.isLastCellInGroup(completeViewDataMap, index) }); if (allDay) { allDayRowsCount += 1; usualCellIndex = 0 } else { usualCellIndex += 1 } const timeIndex = (index - allDayRowsCount) % rowCountInGroup; return _extends({}, restCellProps, { startDate: startDate, allDay: allDay, highlighted: highlighted, text: _index.weekUtils.getTimePanelCellText(timeIndex, startDate, startViewDate, cellDuration, startDayHour, viewOffset), groups: isVerticalGrouping ? groups : void 0, groupIndex: isVerticalGrouping ? groupIndex : void 0, isFirstGroupCell: isVerticalGrouping && isFirstGroupCell, isLastGroupCell: isVerticalGrouping && isLastGroupCell, index: Math.floor(cellIndex / cellCountInGroupRow) }) })) } generateTimePanelData(completeTimePanelMap, options) { const { startRowIndex: startRowIndex, rowCount: rowCount, topVirtualRowHeight: topVirtualRowHeight, bottomVirtualRowHeight: bottomVirtualRowHeight, isGroupedAllDayPanel: isGroupedAllDayPanel, isVerticalGrouping: isVerticalGrouping, isAllDayPanelVisible: isAllDayPanelVisible } = options; const indexDifference = isVerticalGrouping || !isAllDayPanelVisible ? 0 : 1; const correctedStartRowIndex = startRowIndex + indexDifference; const displayedRowCount = (0, _index.getDisplayedRowCount)(rowCount, completeTimePanelMap); const timePanelMap = completeTimePanelMap.slice(correctedStartRowIndex, correctedStartRowIndex + displayedRowCount); const timePanelData = { topVirtualRowHeight: topVirtualRowHeight, bottomVirtualRowHeight: bottomVirtualRowHeight, isGroupedAllDayPanel: isGroupedAllDayPanel }; const { previousGroupedData: groupedData } = this._generateTimePanelDataFromMap(timePanelMap, isVerticalGrouping); timePanelData.groupedData = groupedData; return timePanelData } _generateTimePanelDataFromMap(timePanelMap, isVerticalGrouping) { return timePanelMap.reduce(((_ref, cellData) => { let { previousGroupIndex: previousGroupIndex, previousGroupedData: previousGroupedData } = _ref; const currentGroupIndex = cellData.groupIndex; if (currentGroupIndex !== previousGroupIndex) { previousGroupedData.push({ dateTable: [], isGroupedAllDayPanel: (0, _index.getIsGroupedAllDayPanel)(!!cellData.allDay, isVerticalGrouping), groupIndex: currentGroupIndex, key: (0, _index.getKeyByGroup)(currentGroupIndex, isVerticalGrouping) }) } if (cellData.allDay) { previousGroupedData[previousGroupedData.length - 1].allDayPanel = cellData } else { previousGroupedData[previousGroupedData.length - 1].dateTable.push(cellData) } return { previousGroupIndex: currentGroupIndex, previousGroupedData: previousGroupedData } }), { previousGroupIndex: -1, previousGroupedData: [] }) } isTimeCellShouldBeHighlighted(today, viewOffset, _ref2, cellData) { let { startViewDate: startViewDate, realEndViewDate: realEndViewDate, showCurrentTimeIndicator: showCurrentTimeIndicator } = _ref2; const realToday = _date2.dateUtilsTs.addOffsets(today, [viewOffset]); const realStartViewDate = _date2.dateUtilsTs.addOffsets(startViewDate, [viewOffset]); if (!showCurrentTimeIndicator || realToday < realStartViewDate || realToday >= realEndViewDate) { return false } const realTodayTimeMs = this.getLocalDateTimeInMs(realToday); const [startMs, endMs] = this.getHighlightedInterval(cellData); return startMs < endMs ? realTodayTimeMs >= startMs && realTodayTimeMs < endMs : realTodayTimeMs >= startMs && realTodayTimeMs < toMs("day") || realTodayTimeMs >= 0 && realTodayTimeMs < endMs } getHighlightedInterval(_ref3) { let { date: date, index: index, duration: duration, isFirst: isFirst, isLast: isLast } = _ref3; const cellTimeMs = this.getLocalDateTimeInMs(date); const isEvenCell = index % 2 === 0; switch (true) { case isFirst || isLast && !isEvenCell: return [cellTimeMs, (0, _math.shiftIntegerByModule)(cellTimeMs + duration, toMs("day"))]; case isEvenCell: return [(0, _math.shiftIntegerByModule)(cellTimeMs - duration, toMs("day")), (0, _math.shiftIntegerByModule)(cellTimeMs + duration, toMs("day"))]; default: return [cellTimeMs, (0, _math.shiftIntegerByModule)(cellTimeMs + 2 * duration, toMs("day"))] } } getLocalDateTimeInMs(date) { const dateUtcMs = date.getTime() - date.getTimezoneOffset() * toMs("minute"); return (0, _math.shiftIntegerByModule)(dateUtcMs, toMs("day")) } isLastCellInGroup(completeViewDataMap, index) { if (index === completeViewDataMap.length - 1) { return true } const { groupIndex: currentGroupIndex } = completeViewDataMap[index][0]; const { groupIndex: nextGroupIndex, allDay: nextAllDay } = completeViewDataMap[index + 1][0]; return nextAllDay || nextGroupIndex !== currentGroupIndex } } }, 29964: /*!***************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/view_model/m_utils.js ***! \***************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.alignToFirstDayOfWeek = alignToFirstDayOfWeek; exports.alignToLastDayOfWeek = alignToLastDayOfWeek; exports.calculateAlignedWeeksBetweenDates = function(fromDate, toDate, firstDayOfWeek) { const alignedFromDate = alignToFirstDayOfWeek(fromDate, firstDayOfWeek); const alignedToDate = alignToLastDayOfWeek(toDate, firstDayOfWeek); const weekCount = calculateDaysBetweenDates(alignedFromDate, alignedToDate) / DAYS_IN_WEEK; return Math.max(weekCount, 6) }; exports.calculateDaysBetweenDates = calculateDaysBetweenDates; exports.getViewDataGeneratorByViewType = void 0; var _date = (obj = __webpack_require__( /*! ../../../../core/utils/date */ 91198), obj && obj.__esModule ? obj : { default: obj }); var obj; var _m_constants = __webpack_require__( /*! ../../m_constants */ 6324); var _m_view_data_generator = __webpack_require__( /*! ./m_view_data_generator */ 31407); var _m_view_data_generator_day = __webpack_require__( /*! ./m_view_data_generator_day */ 54947); var _m_view_data_generator_month = __webpack_require__( /*! ./m_view_data_generator_month */ 24562); var _m_view_data_generator_timeline_month = __webpack_require__( /*! ./m_view_data_generator_timeline_month */ 49738); var _m_view_data_generator_week = __webpack_require__( /*! ./m_view_data_generator_week */ 98097); var _m_view_data_generator_work_week = __webpack_require__( /*! ./m_view_data_generator_work_week */ 4277); const DAYS_IN_WEEK = 7; const MS_IN_DAY = 864e5; exports.getViewDataGeneratorByViewType = viewType => { switch (viewType) { case _m_constants.VIEWS.MONTH: return new _m_view_data_generator_month.ViewDataGeneratorMonth; case _m_constants.VIEWS.TIMELINE_MONTH: return new _m_view_data_generator_timeline_month.ViewDataGeneratorTimelineMonth; case _m_constants.VIEWS.DAY: case _m_constants.VIEWS.TIMELINE_DAY: return new _m_view_data_generator_day.ViewDataGeneratorDay; case _m_constants.VIEWS.WEEK: case _m_constants.VIEWS.TIMELINE_WEEK: return new _m_view_data_generator_week.ViewDataGeneratorWeek; case _m_constants.VIEWS.WORK_WEEK: case _m_constants.VIEWS.TIMELINE_WORK_WEEK: return new _m_view_data_generator_work_week.ViewDataGeneratorWorkWeek; default: return new _m_view_data_generator.ViewDataGenerator } }; function alignToFirstDayOfWeek(date, firstDayOfWeek) { const newDate = new Date(date); let dayDiff = newDate.getDay() - firstDayOfWeek; if (dayDiff < 0) { dayDiff += DAYS_IN_WEEK } newDate.setDate(newDate.getDate() - dayDiff); return newDate } function alignToLastDayOfWeek(date, firstDayOfWeek) { const newDate = alignToFirstDayOfWeek(date, firstDayOfWeek); newDate.setDate(newDate.getDate() + DAYS_IN_WEEK - 1); return newDate } function calculateDaysBetweenDates(fromDate, toDate) { const msDiff = _date.default.trimTime(toDate).getTime() - _date.default.trimTime(fromDate).getTime(); return Math.round(msDiff / MS_IN_DAY) + 1 } }, 31407: /*!*****************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/view_model/m_view_data_generator.js ***! \*****************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.ViewDataGenerator = void 0; var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198)); var _date2 = __webpack_require__( /*! ../../../core/utils/date */ 24321); var _index = __webpack_require__( /*! ../../../scheduler/r1/utils/index */ 94084); var _m_constants = __webpack_require__( /*! ../../m_constants */ 6324); var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../../m_utils_time_zone */ 57880)); var _m_utils = __webpack_require__( /*! ../../resources/m_utils */ 31359); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const toMs = _date.default.dateToMilliseconds; exports.ViewDataGenerator = class { constructor() { this.daysInInterval = 1; this.isWorkView = false; this.tableAllDay = false } isSkippedDate(date) { return false } _calculateStartViewDate(options) {} getStartViewDate(options) { return this._calculateStartViewDate(options) } getCompleteViewDataMap(options) { const { groups: groups, isGroupedByDate: isGroupedByDate, isHorizontalGrouping: isHorizontalGrouping, isVerticalGrouping: isVerticalGrouping, intervalCount: intervalCount, currentDate: currentDate, viewType: viewType, startDayHour: startDayHour, endDayHour: endDayHour, hoursInterval: hoursInterval } = options; this._setVisibilityDates(options); this.setHiddenInterval(startDayHour, endDayHour, hoursInterval); const groupsList = (0, _m_utils.getAllGroups)(groups); const cellCountInGroupRow = this.getCellCount({ intervalCount: intervalCount, currentDate: currentDate, viewType: viewType, startDayHour: startDayHour, endDayHour: endDayHour, hoursInterval: hoursInterval }); const rowCountInGroup = this.getRowCount({ intervalCount: intervalCount, currentDate: currentDate, viewType: viewType, hoursInterval: hoursInterval, startDayHour: startDayHour, endDayHour: endDayHour }); let viewDataMap = []; const allDayPanelData = this._generateAllDayPanelData(options, rowCountInGroup, cellCountInGroupRow); const viewCellsData = this._generateViewCellsData(options, rowCountInGroup, cellCountInGroupRow); if (allDayPanelData) { viewDataMap.push(allDayPanelData) } viewDataMap.push(...viewCellsData); if (isHorizontalGrouping && !isGroupedByDate) { viewDataMap = this._transformViewDataMapForHorizontalGrouping(viewDataMap, groupsList) } if (isVerticalGrouping) { viewDataMap = this._transformViewDataMapForVerticalGrouping(viewDataMap, groupsList) } if (isGroupedByDate) { viewDataMap = this._transformViewDataMapForGroupingByDate(viewDataMap, groupsList) } return this._addKeysToCells(viewDataMap) } _transformViewDataMapForHorizontalGrouping(viewDataMap, groupsList) { const result = viewDataMap.map((row => row.slice())); groupsList.slice(1).forEach(((groups, index) => { const groupIndex = index + 1; viewDataMap.forEach(((row, rowIndex) => { const nextGroupRow = row.map((cellData => _extends({}, cellData, { groups: groups, groupIndex: groupIndex }))); result[rowIndex].push(...nextGroupRow) })) })); return result } _transformViewDataMapForVerticalGrouping(viewDataMap, groupsList) { const result = viewDataMap.map((row => row.slice())); groupsList.slice(1).forEach(((groups, index) => { const groupIndex = index + 1; const nextGroupMap = viewDataMap.map((cellsRow => { const nextRow = cellsRow.map((cellData => _extends({}, cellData, { groupIndex: groupIndex, groups: groups }))); return nextRow })); result.push(...nextGroupMap) })); return result } _transformViewDataMapForGroupingByDate(viewDataMap, groupsList) { const correctedGroupList = groupsList.slice(1); const correctedGroupCount = correctedGroupList.length; const result = viewDataMap.map((cellsRow => { const groupedByDateCellsRow = cellsRow.reduce(((currentRow, cell) => { const rowWithCurrentCell = [...currentRow, _extends({}, cell, { isFirstGroupCell: true, isLastGroupCell: 0 === correctedGroupCount }), ...correctedGroupList.map(((groups, index) => _extends({}, cell, { groups: groups, groupIndex: index + 1, isFirstGroupCell: false, isLastGroupCell: index === correctedGroupCount - 1 })))]; return rowWithCurrentCell }), []); return groupedByDateCellsRow })); return result } _addKeysToCells(viewDataMap) { const totalColumnCount = viewDataMap[0].length; const { currentViewDataMap: result } = viewDataMap.reduce(((_ref, row, rowIndex) => { let { allDayPanelsCount: allDayPanelsCount, currentViewDataMap: currentViewDataMap } = _ref; const isAllDay = row[0].allDay; const keyBase = (rowIndex - allDayPanelsCount) * totalColumnCount; const currentAllDayPanelsCount = isAllDay ? allDayPanelsCount + 1 : allDayPanelsCount; currentViewDataMap[rowIndex].forEach(((cell, columnIndex) => { cell.key = keyBase + columnIndex })); return { allDayPanelsCount: currentAllDayPanelsCount, currentViewDataMap: currentViewDataMap } }), { allDayPanelsCount: 0, currentViewDataMap: viewDataMap }); return result } generateViewDataMap(completeViewDataMap, options) { const { rowCount: rowCount, startCellIndex: startCellIndex, startRowIndex: startRowIndex, cellCount: cellCount, isVerticalGrouping: isVerticalGrouping, isAllDayPanelVisible: isAllDayPanelVisible } = options; const sliceCells = (row, rowIndex, startIndex, count) => { const sliceToIndex = void 0 !== count ? startIndex + count : void 0; return row.slice(startIndex, sliceToIndex).map(((cellData, columnIndex) => ({ cellData: cellData, position: { rowIndex: rowIndex, columnIndex: columnIndex } }))) }; let correctedStartRowIndex = startRowIndex; let allDayPanelMap = []; if (this._isStandaloneAllDayPanel(isVerticalGrouping, isAllDayPanelVisible)) { correctedStartRowIndex++; allDayPanelMap = sliceCells(completeViewDataMap[0], 0, startCellIndex, cellCount) } const displayedRowCount = (0, _index.getDisplayedRowCount)(rowCount, completeViewDataMap); const dateTableMap = completeViewDataMap.slice(correctedStartRowIndex, correctedStartRowIndex + displayedRowCount).map(((row, rowIndex) => sliceCells(row, rowIndex, startCellIndex, cellCount))); return { allDayPanelMap: allDayPanelMap, dateTableMap: dateTableMap } } _isStandaloneAllDayPanel(isVerticalGrouping, isAllDayPanelVisible) { return !isVerticalGrouping && isAllDayPanelVisible } getViewDataFromMap(completeViewDataMap, viewDataMap, options) { const { topVirtualRowHeight: topVirtualRowHeight, bottomVirtualRowHeight: bottomVirtualRowHeight, leftVirtualCellWidth: leftVirtualCellWidth, rightVirtualCellWidth: rightVirtualCellWidth, cellCount: cellCount, rowCount: rowCount, startRowIndex: startRowIndex, startCellIndex: startCellIndex, isProvideVirtualCellsWidth: isProvideVirtualCellsWidth, isGroupedAllDayPanel: isGroupedAllDayPanel, isVerticalGrouping: isVerticalGrouping, isAllDayPanelVisible: isAllDayPanelVisible } = options; const { allDayPanelMap: allDayPanelMap, dateTableMap: dateTableMap } = viewDataMap; const { groupedData: groupedData } = dateTableMap.reduce(((_ref2, cellsRow) => { let { previousGroupIndex: previousGroupIndex, groupedData: groupedData } = _ref2; const cellDataRow = cellsRow.map((_ref3 => { let { cellData: cellData } = _ref3; return cellData })); const firstCell = cellDataRow[0]; const isAllDayRow = firstCell.allDay; const currentGroupIndex = firstCell.groupIndex; if (currentGroupIndex !== previousGroupIndex) { groupedData.push({ dateTable: [], isGroupedAllDayPanel: (0, _index.getIsGroupedAllDayPanel)(!!isAllDayRow, isVerticalGrouping), groupIndex: currentGroupIndex, key: (0, _index.getKeyByGroup)(currentGroupIndex, isVerticalGrouping) }) } if (isAllDayRow) { groupedData[groupedData.length - 1].allDayPanel = cellDataRow } else { groupedData[groupedData.length - 1].dateTable.push({ cells: cellDataRow, key: cellDataRow[0].key - startCellIndex }) } return { groupedData: groupedData, previousGroupIndex: currentGroupIndex } }), { previousGroupIndex: -1, groupedData: [] }); if (this._isStandaloneAllDayPanel(isVerticalGrouping, isAllDayPanelVisible)) { groupedData[0].allDayPanel = allDayPanelMap.map((_ref4 => { let { cellData: cellData } = _ref4; return cellData })) } const totalCellCount = (0, _index.getTotalCellCountByCompleteData)(completeViewDataMap); const totalRowCount = (0, _index.getTotalRowCountByCompleteData)(completeViewDataMap); const displayedCellCount = (0, _index.getDisplayedCellCount)(cellCount, completeViewDataMap); const displayedRowCount = (0, _index.getDisplayedRowCount)(rowCount, completeViewDataMap); return { groupedData: groupedData, topVirtualRowHeight: topVirtualRowHeight, bottomVirtualRowHeight: bottomVirtualRowHeight, leftVirtualCellWidth: isProvideVirtualCellsWidth ? leftVirtualCellWidth : void 0, rightVirtualCellWidth: isProvideVirtualCellsWidth ? rightVirtualCellWidth : void 0, isGroupedAllDayPanel: isGroupedAllDayPanel, leftVirtualCellCount: startCellIndex, rightVirtualCellCount: void 0 === cellCount ? 0 : totalCellCount - startCellIndex - displayedCellCount, topVirtualRowCount: startRowIndex, bottomVirtualRowCount: totalRowCount - startRowIndex - displayedRowCount } } _generateViewCellsData(options, rowCount, cellCountInGroupRow) { const viewCellsData = []; for (let rowIndex = 0; rowIndex < rowCount; rowIndex += 1) { viewCellsData.push(this._generateCellsRow(options, false, rowIndex, rowCount, cellCountInGroupRow)) } return viewCellsData } _generateAllDayPanelData(options, rowCount, columnCount) { if (!options.isAllDayPanelVisible) { return null } return this._generateCellsRow(options, true, 0, rowCount, columnCount) } _generateCellsRow(options, allDay, rowIndex, rowCount, columnCount) { const cellsRow = []; for (let columnIndex = 0; columnIndex < columnCount; ++columnIndex) { const cellDataValue = this.getCellData(rowIndex, columnIndex, options, allDay); cellDataValue.index = rowIndex * columnCount + columnIndex; cellDataValue.isFirstGroupCell = this._isFirstGroupCell(rowIndex, columnIndex, options, rowCount, columnCount); cellDataValue.isLastGroupCell = this._isLastGroupCell(rowIndex, columnIndex, options, rowCount, columnCount); cellsRow.push(cellDataValue) } return cellsRow } getCellData(rowIndex, columnIndex, options, allDay) { return allDay ? this.prepareAllDayCellData(options, rowIndex, columnIndex) : this.prepareCellData(options, rowIndex, columnIndex) } prepareCellData(options, rowIndex, columnIndex) { const { groups: groups, startDayHour: startDayHour, endDayHour: endDayHour, hoursInterval: hoursInterval } = options; const groupsList = (0, _m_utils.getAllGroups)(groups); const startDate = this.getDateByCellIndices(options, rowIndex, columnIndex, this.getCellCountInDay(startDayHour, endDayHour, hoursInterval)); const endDate = this.getCellEndDate(startDate, options); const data = { startDate: startDate, endDate: endDate, allDay: this.tableAllDay, groupIndex: 0 }; if (groupsList.length > 0) { data.groups = groupsList[0] } return data } prepareAllDayCellData(options, rowIndex, columnIndex) { const data = this.prepareCellData(_extends({}, options, { viewOffset: 0 }), rowIndex, columnIndex); const { viewOffset: viewOffset } = options; const startDate = _date.default.trimTime(data.startDate); const shiftedStartDate = _date2.dateUtilsTs.addOffsets(startDate, [viewOffset]); return _extends({}, data, { startDate: shiftedStartDate, endDate: shiftedStartDate, allDay: true }) } getDateByCellIndices(options, rowIndex, columnIndex, cellCountInDay) { let { startViewDate: startViewDate } = options; const { startDayHour: startDayHour, interval: interval, firstDayOfWeek: firstDayOfWeek, intervalCount: intervalCount, viewOffset: viewOffset } = options; const isStartViewDateDuringDST = startViewDate.getHours() !== Math.floor(startDayHour); if (isStartViewDateDuringDST) { const dateWithCorrectHours = (0, _index.getStartViewDateWithoutDST)(startViewDate, startDayHour); startViewDate = new Date(dateWithCorrectHours.getTime() - toMs("day")) } const columnCountBase = this.getCellCount(options); const rowCountBase = this.getRowCount(options); const cellIndex = this._calculateCellIndex(rowIndex, columnIndex, rowCountBase, columnCountBase); const millisecondsOffset = this.getMillisecondsOffset(cellIndex, interval, cellCountInDay); const offsetByCount = this.isWorkView ? this.getTimeOffsetByColumnIndex(columnIndex, this.getFirstDayOfWeek(firstDayOfWeek), columnCountBase, intervalCount) : 0; const startViewDateTime = startViewDate.getTime(); const currentDate = new Date(startViewDateTime + millisecondsOffset + offsetByCount + viewOffset); const timeZoneDifference = isStartViewDateDuringDST ? 0 : _date.default.getTimezonesDifference(startViewDate, currentDate); currentDate.setTime(currentDate.getTime() + timeZoneDifference); return currentDate } getMillisecondsOffset(cellIndex, interval, cellCountInDay) { const dayIndex = Math.floor(cellIndex / cellCountInDay); const realHiddenInterval = dayIndex * this.hiddenInterval; return interval * cellIndex + realHiddenInterval } getTimeOffsetByColumnIndex(columnIndex, firstDayOfWeek, columnCount, intervalCount) { const firstDayOfWeekDiff = Math.max(0, firstDayOfWeek - 1); const columnsInWeek = columnCount / intervalCount; const weekendCount = Math.floor((columnIndex + firstDayOfWeekDiff) / columnsInWeek); return 2 * weekendCount * toMs("day") } calculateEndDate(startDate, interval, endDayHour) { return this.getCellEndDate(startDate, { interval: interval }) } _calculateCellIndex(rowIndex, columnIndex, rowCount, columnCountBase) { return (0, _index.calculateCellIndex)(rowIndex, columnIndex, rowCount) } generateGroupedDataMap(viewDataMap) { const { allDayPanelMap: allDayPanelMap, dateTableMap: dateTableMap } = viewDataMap; const { previousGroupedDataMap: dateTableGroupedMap } = dateTableMap.reduce(((previousOptions, cellsRow) => { const { previousGroupedDataMap: previousGroupedDataMap, previousRowIndex: previousRowIndex, previousGroupIndex: previousGroupIndex } = previousOptions; const { groupIndex: currentGroupIndex } = cellsRow[0].cellData; const currentRowIndex = currentGroupIndex === previousGroupIndex ? previousRowIndex + 1 : 0; cellsRow.forEach((cell => { const { groupIndex: groupIndex } = cell.cellData; if (!previousGroupedDataMap[groupIndex]) { previousGroupedDataMap[groupIndex] = [] } if (!previousGroupedDataMap[groupIndex][currentRowIndex]) { previousGroupedDataMap[groupIndex][currentRowIndex] = [] } previousGroupedDataMap[groupIndex][currentRowIndex].push(cell) })); return { previousGroupedDataMap: previousGroupedDataMap, previousRowIndex: currentRowIndex, previousGroupIndex: currentGroupIndex } }), { previousGroupedDataMap: [], previousRowIndex: -1, previousGroupIndex: -1 }); const allDayPanelGroupedMap = []; null === allDayPanelMap || void 0 === allDayPanelMap || allDayPanelMap.forEach((cell => { const { groupIndex: groupIndex } = cell.cellData; if (!allDayPanelGroupedMap[groupIndex]) { allDayPanelGroupedMap[groupIndex] = [] } allDayPanelGroupedMap[groupIndex].push(cell) })); return { allDayPanelGroupedMap: allDayPanelGroupedMap, dateTableGroupedMap: dateTableGroupedMap } } _isFirstGroupCell(rowIndex, columnIndex, options, rowCount, columnCount) { const { groupOrientation: groupOrientation, groups: groups, isGroupedByDate: isGroupedByDate } = options; const groupCount = (0, _index.getGroupCount)(groups); if (isGroupedByDate) { return columnIndex % groupCount === 0 } if (groupOrientation === _m_constants.HORIZONTAL_GROUP_ORIENTATION) { return columnIndex % columnCount === 0 } return rowIndex % rowCount === 0 } _isLastGroupCell(rowIndex, columnIndex, options, rowCount, columnCount) { const { groupOrientation: groupOrientation, groups: groups, isGroupedByDate: isGroupedByDate } = options; const groupCount = (0, _index.getGroupCount)(groups); if (isGroupedByDate) { return (columnIndex + 1) % groupCount === 0 } if (groupOrientation === _m_constants.HORIZONTAL_GROUP_ORIENTATION) { return (columnIndex + 1) % columnCount === 0 } return (rowIndex + 1) % rowCount === 0 } markSelectedAndFocusedCells(viewDataMap, renderOptions) { const { selectedCells: selectedCells, focusedCell: focusedCell } = renderOptions; if (!selectedCells && !focusedCell) { return viewDataMap } const { allDayPanelMap: allDayPanelMap, dateTableMap: dateTableMap } = viewDataMap; const nextDateTableMap = dateTableMap.map((row => this._markSelectedAndFocusedCellsInRow(row, selectedCells, focusedCell))); const nextAllDayMap = this._markSelectedAndFocusedCellsInRow(allDayPanelMap, selectedCells, focusedCell); return { allDayPanelMap: nextAllDayMap, dateTableMap: nextDateTableMap } } _markSelectedAndFocusedCellsInRow(dataRow, selectedCells, focusedCell) { return dataRow.map((cell => { const { index: index, groupIndex: groupIndex, allDay: allDay, startDate: startDate } = cell.cellData; const indexInSelectedCells = selectedCells.findIndex((_ref5 => { let { index: selectedCellIndex, groupIndex: selectedCellGroupIndex, allDay: selectedCellAllDay, startDate: selectedCellStartDate } = _ref5; return groupIndex === selectedCellGroupIndex && (index === selectedCellIndex || void 0 === selectedCellIndex && startDate.getTime() === selectedCellStartDate.getTime()) && !!allDay === !!selectedCellAllDay })); const isFocused = !!focusedCell && index === focusedCell.cellData.index && groupIndex === focusedCell.cellData.groupIndex && allDay === focusedCell.cellData.allDay; if (!isFocused && -1 === indexInSelectedCells) { return cell } return _extends({}, cell, { cellData: _extends({}, cell.cellData, { isSelected: indexInSelectedCells > -1, isFocused: isFocused }) }) })) } getInterval(hoursInterval) { return hoursInterval * toMs("hour") } _getIntervalDuration(intervalCount) { return toMs("day") * intervalCount } _setVisibilityDates(options) {} getCellCountInDay(startDayHour, endDayHour, hoursInterval) { const result = (0, _index.calculateDayDuration)(startDayHour, endDayHour) / hoursInterval; return Math.ceil(result) } getCellCount(options) { const { intervalCount: intervalCount, viewType: viewType, startDayHour: startDayHour, endDayHour: endDayHour, hoursInterval: hoursInterval } = options; const cellCountInDay = this.getCellCountInDay(startDayHour, endDayHour, hoursInterval); const columnCountInDay = (0, _index.isHorizontalView)(viewType) ? cellCountInDay : 1; return this.daysInInterval * intervalCount * columnCountInDay } getRowCount(options) { const { viewType: viewType, startDayHour: startDayHour, endDayHour: endDayHour, hoursInterval: hoursInterval } = options; const cellCountInDay = this.getCellCountInDay(startDayHour, endDayHour, hoursInterval); const rowCountInDay = !(0, _index.isHorizontalView)(viewType) ? cellCountInDay : 1; return rowCountInDay } setHiddenInterval(startDayHour, endDayHour, hoursInterval) { this.hiddenInterval = toMs("day") - this.getVisibleDayDuration(startDayHour, endDayHour, hoursInterval) } getVisibleDayDuration(startDayHour, endDayHour, hoursInterval) { const cellCountInDay = this.getCellCountInDay(startDayHour, endDayHour, hoursInterval); return hoursInterval * cellCountInDay * toMs("hour") } getFirstDayOfWeek(firstDayOfWeekOption) { return firstDayOfWeekOption } getCellEndDate(cellStartDate, options) { const durationMs = Math.round(options.interval); return _m_utils_time_zone.default.addOffsetsWithoutDST(cellStartDate, durationMs) } } }, 54947: /*!*********************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/view_model/m_view_data_generator_day.js ***! \*********************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.ViewDataGeneratorDay = void 0; var _index = __webpack_require__( /*! ../../../scheduler/r1/utils/index */ 94084); var _m_view_data_generator = __webpack_require__( /*! ./m_view_data_generator */ 31407); class ViewDataGeneratorDay extends _m_view_data_generator.ViewDataGenerator { _calculateStartViewDate(options) { return _index.dayUtils.calculateStartViewDate(options.currentDate, options.startDayHour, options.startDate, this._getIntervalDuration(options.intervalCount)) } } exports.ViewDataGeneratorDay = ViewDataGeneratorDay }, 24562: /*!***********************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/view_model/m_view_data_generator_month.js ***! \***********************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.ViewDataGeneratorMonth = void 0; var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198)); var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../../../localization/date */ 91500)); var _index = __webpack_require__( /*! ../../../scheduler/r1/utils/index */ 94084); var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../../m_utils_time_zone */ 57880)); var _m_utils = __webpack_require__( /*! ./m_utils */ 29964); var _m_view_data_generator = __webpack_require__( /*! ./m_view_data_generator */ 31407); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const toMs = _date.default.dateToMilliseconds; class ViewDataGeneratorMonth extends _m_view_data_generator.ViewDataGenerator { constructor() { super(...arguments); this.tableAllDay = void 0 } getCellData(rowIndex, columnIndex, options, allDay) { const { indicatorTime: indicatorTime, timeZoneCalculator: timeZoneCalculator, intervalCount: intervalCount, viewOffset: viewOffset } = options; const data = super.getCellData(rowIndex, columnIndex, options, false); const startDate = _m_utils_time_zone.default.addOffsetsWithoutDST(data.startDate, -viewOffset); data.today = this.isCurrentDate(startDate, indicatorTime, timeZoneCalculator); data.otherMonth = this.isOtherMonth(startDate, this._minVisibleDate, this._maxVisibleDate); data.firstDayOfMonth = (0, _index.isFirstCellInMonthWithIntervalCount)(startDate, intervalCount); data.text = _index.monthUtils.getCellText(startDate, intervalCount); return data } isCurrentDate(date, indicatorTime, timeZoneCalculator) { return _date.default.sameDate(date, (0, _index.getToday)(indicatorTime, timeZoneCalculator)) } isOtherMonth(cellDate, minDate, maxDate) { return !_date.default.dateInRange(cellDate, minDate, maxDate, "date") } _calculateCellIndex(rowIndex, columnIndex, rowCount, columnCount) { return _index.monthUtils.calculateCellIndex(rowIndex, columnIndex, rowCount, columnCount) } calculateEndDate(startDate, interval, endDayHour) { return (0, _index.setOptionHour)(startDate, endDayHour) } getInterval() { return toMs("day") } _calculateStartViewDate(options) { return _index.monthUtils.calculateStartViewDate(options.currentDate, options.startDayHour, options.startDate, options.intervalCount, this.getFirstDayOfWeek(options.firstDayOfWeek)) } _setVisibilityDates(options) { const { intervalCount: intervalCount, startDate: startDate, currentDate: currentDate } = options; const firstMonthDate = _date.default.getFirstMonthDate(startDate); const viewStart = _index.monthUtils.getViewStartByOptions(startDate, currentDate, intervalCount, firstMonthDate); this._minVisibleDate = new Date(viewStart.setDate(1)); const nextMonthDate = new Date(viewStart.setMonth(viewStart.getMonth() + intervalCount)); this._maxVisibleDate = new Date(nextMonthDate.setDate(0)) } getCellCount() { return 7 } getRowCount(options) { const startDate = new Date(options.currentDate); startDate.setDate(1); const endDate = new Date(startDate); endDate.setMonth(endDate.getMonth() + options.intervalCount); endDate.setDate(0); return (0, _m_utils.calculateAlignedWeeksBetweenDates)(startDate, endDate, options.firstDayOfWeek ?? _date2.default.firstDayOfWeekIndex()) } getCellCountInDay() { return 1 } setHiddenInterval() { this.hiddenInterval = 0 } getCellEndDate(cellStartDate, options) { const { startDayHour: startDayHour, endDayHour: endDayHour } = options; const durationMs = (endDayHour - startDayHour) * toMs("hour"); return _m_utils_time_zone.default.addOffsetsWithoutDST(cellStartDate, durationMs) } } exports.ViewDataGeneratorMonth = ViewDataGeneratorMonth }, 49738: /*!********************************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/view_model/m_view_data_generator_timeline_month.js ***! \********************************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.ViewDataGeneratorTimelineMonth = void 0; var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198)); var _index = __webpack_require__( /*! ../../../scheduler/r1/utils/index */ 94084); var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../../m_utils_time_zone */ 57880)); var _m_view_data_generator = __webpack_require__( /*! ./m_view_data_generator */ 31407); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const toMs = _date.default.dateToMilliseconds; class ViewDataGeneratorTimelineMonth extends _m_view_data_generator.ViewDataGenerator { _calculateCellIndex(rowIndex, columnIndex, rowCount, columnCount) { return _index.monthUtils.calculateCellIndex(rowIndex, columnIndex, rowCount, columnCount) } calculateEndDate(startDate, interval, endDayHour) { return (0, _index.setOptionHour)(startDate, endDayHour) } getInterval() { return toMs("day") } _calculateStartViewDate(options) { return _index.timelineMonthUtils.calculateStartViewDate(options.currentDate, options.startDayHour, options.startDate, options.intervalCount) } getCellCount(options) { const { intervalCount: intervalCount } = options; const currentDate = new Date(options.currentDate); let cellCount = 0; for (let i = 1; i <= intervalCount; i++) { cellCount += new Date(currentDate.getFullYear(), currentDate.getMonth() + i, 0).getDate() } return cellCount } setHiddenInterval() { this.hiddenInterval = 0 } getCellEndDate(cellStartDate, options) { const { startDayHour: startDayHour, endDayHour: endDayHour } = options; const durationMs = (endDayHour - startDayHour) * toMs("hour"); return _m_utils_time_zone.default.addOffsetsWithoutDST(cellStartDate, durationMs) } } exports.ViewDataGeneratorTimelineMonth = ViewDataGeneratorTimelineMonth }, 98097: /*!**********************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/view_model/m_view_data_generator_week.js ***! \**********************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.ViewDataGeneratorWeek = void 0; var _index = __webpack_require__( /*! ../../../scheduler/r1/utils/index */ 94084); var _m_view_data_generator = __webpack_require__( /*! ./m_view_data_generator */ 31407); class ViewDataGeneratorWeek extends _m_view_data_generator.ViewDataGenerator { constructor() { super(...arguments); this.daysInInterval = 7 } _getIntervalDuration(intervalCount) { return _index.weekUtils.getIntervalDuration(intervalCount) } _calculateStartViewDate(options) { return _index.weekUtils.calculateStartViewDate(options.currentDate, options.startDayHour, options.startDate, this._getIntervalDuration(options.intervalCount), this.getFirstDayOfWeek(options.firstDayOfWeek)) } } exports.ViewDataGeneratorWeek = ViewDataGeneratorWeek }, 4277: /*!***************************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/view_model/m_view_data_generator_work_week.js ***! \***************************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.ViewDataGeneratorWorkWeek = void 0; var _index = __webpack_require__( /*! ../../../scheduler/r1/utils/index */ 94084); var _m_view_data_generator_week = __webpack_require__( /*! ./m_view_data_generator_week */ 98097); class ViewDataGeneratorWorkWeek extends _m_view_data_generator_week.ViewDataGeneratorWeek { constructor() { super(...arguments); this.daysInInterval = 5; this.isWorkView = true } isSkippedDate(date) { return (0, _index.isDataOnWeekend)(date) } _calculateStartViewDate(options) { return _index.workWeekUtils.calculateStartViewDate(options.currentDate, options.startDayHour, options.startDate, this._getIntervalDuration(options.intervalCount), this.getFirstDayOfWeek(options.firstDayOfWeek)) } getFirstDayOfWeek(firstDayOfWeekOption) { return firstDayOfWeekOption || 0 } } exports.ViewDataGeneratorWorkWeek = ViewDataGeneratorWorkWeek }, 52974: /*!****************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/scheduler/workspaces/view_model/m_view_data_provider.js ***! \****************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _date = _interopRequireDefault(__webpack_require__( /*! ../../../../core/utils/date */ 91198)); var _date2 = __webpack_require__( /*! ../../../core/utils/date */ 24321); var _index = __webpack_require__( /*! ../../../scheduler/r1/utils/index */ 94084); var _m_utils_time_zone = _interopRequireDefault(__webpack_require__( /*! ../../m_utils_time_zone */ 57880)); var _m_date_header_data_generator = __webpack_require__( /*! ./m_date_header_data_generator */ 11706); var _m_grouped_data_map_provider = __webpack_require__( /*! ./m_grouped_data_map_provider */ 69033); var _m_time_panel_data_generator = __webpack_require__( /*! ./m_time_panel_data_generator */ 45512); var _m_utils = __webpack_require__( /*! ./m_utils */ 29964); const _excluded = ["groups", "groupOrientation", "groupByDate", "isAllDayPanelVisible", "viewOffset"]; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } exports.default = class { constructor(viewType) { this.viewType = viewType; this.viewDataGenerator = (0, _m_utils.getViewDataGeneratorByViewType)(viewType); this.viewData = {}; this.completeViewDataMap = []; this.completeDateHeaderMap = []; this.viewDataMap = {}; this._groupedDataMapProvider = null } get groupedDataMap() { return this._groupedDataMapProvider.groupedDataMap } get hiddenInterval() { return this.viewDataGenerator.hiddenInterval } isSkippedDate(date) { return this.viewDataGenerator.isSkippedDate(date) } update(options, isGenerateNewViewData) { this.viewDataGenerator = (0, _m_utils.getViewDataGeneratorByViewType)(options.viewType); const { viewDataGenerator: viewDataGenerator } = this; const dateHeaderDataGenerator = new _m_date_header_data_generator.DateHeaderDataGenerator(viewDataGenerator); const timePanelDataGenerator = new _m_time_panel_data_generator.TimePanelDataGenerator(viewDataGenerator); const renderOptions = this._transformRenderOptions(options); renderOptions.interval = this.viewDataGenerator.getInterval(renderOptions.hoursInterval); this._options = renderOptions; if (isGenerateNewViewData) { this.completeViewDataMap = viewDataGenerator.getCompleteViewDataMap(renderOptions); this.completeDateHeaderMap = dateHeaderDataGenerator.getCompleteDateHeaderMap(renderOptions, this.completeViewDataMap); if (renderOptions.isGenerateTimePanelData) { this.completeTimePanelMap = timePanelDataGenerator.getCompleteTimePanelMap(renderOptions, this.completeViewDataMap) } } this.viewDataMap = viewDataGenerator.generateViewDataMap(this.completeViewDataMap, renderOptions); this.updateViewData(renderOptions); this._groupedDataMapProvider = new _m_grouped_data_map_provider.GroupedDataMapProvider(this.viewDataGenerator, this.viewDataMap, this.completeViewDataMap, { isVerticalGrouping: renderOptions.isVerticalGrouping, viewType: renderOptions.viewType, viewOffset: options.viewOffset }); this.dateHeaderData = dateHeaderDataGenerator.generateDateHeaderData(this.completeDateHeaderMap, this.completeViewDataMap, renderOptions); if (renderOptions.isGenerateTimePanelData) { this.timePanelData = timePanelDataGenerator.generateTimePanelData(this.completeTimePanelMap, renderOptions) } } createGroupedDataMapProvider() { this._groupedDataMapProvider = new _m_grouped_data_map_provider.GroupedDataMapProvider(this.viewDataGenerator, this.viewDataMap, this.completeViewDataMap, { isVerticalGrouping: this._options.isVerticalGrouping, viewType: this._options.viewType }) } updateViewData(options) { const renderOptions = this._transformRenderOptions(options); this.viewDataMapWithSelection = this.viewDataGenerator.markSelectedAndFocusedCells(this.viewDataMap, renderOptions); this.viewData = this.viewDataGenerator.getViewDataFromMap(this.completeViewDataMap, this.viewDataMapWithSelection, renderOptions) } _transformRenderOptions(renderOptions) { const { groups: groups, groupOrientation: groupOrientation, groupByDate: groupByDate, isAllDayPanelVisible: isAllDayPanelVisible, viewOffset: viewOffset } = renderOptions, restOptions = function(source, excluded) { if (null == source) { return {} } var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) { continue } target[key] = source[key] } } return target }(renderOptions, _excluded); return _extends({}, restOptions, { startViewDate: this.viewDataGenerator._calculateStartViewDate(renderOptions), isVerticalGrouping: (0, _index.isVerticalGroupingApplied)(groups, groupOrientation), isHorizontalGrouping: (0, _index.isHorizontalGroupingApplied)(groups, groupOrientation), isGroupedByDate: (0, _index.isGroupingByDate)(groups, groupOrientation, groupByDate), isGroupedAllDayPanel: (0, _index.calculateIsGroupedAllDayPanel)(groups, groupOrientation, isAllDayPanelVisible), groups: groups, groupOrientation: groupOrientation, isAllDayPanelVisible: isAllDayPanelVisible, viewOffset: viewOffset }) } getGroupPanelData(options) { const renderOptions = this._transformRenderOptions(options); if (renderOptions.groups.length > 0) { const cellCount = this.getCellCount(renderOptions); return (0, _index.getGroupPanelData)(renderOptions.groups, cellCount, renderOptions.isGroupedByDate, renderOptions.isGroupedByDate ? 1 : cellCount) } return } getGroupStartDate(groupIndex) { return this._groupedDataMapProvider.getGroupStartDate(groupIndex) } getGroupEndDate(groupIndex) { return this._groupedDataMapProvider.getGroupEndDate(groupIndex) } findGroupCellStartDate(groupIndex, startDate, endDate) { let isFindByDate = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : false; return this._groupedDataMapProvider.findGroupCellStartDate(groupIndex, startDate, endDate, isFindByDate) } findAllDayGroupCellStartDate(groupIndex) { return this._groupedDataMapProvider.findAllDayGroupCellStartDate(groupIndex) } findCellPositionInMap(cellInfo) { let isAppointmentRender = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : false; return this._groupedDataMapProvider.findCellPositionInMap(cellInfo, isAppointmentRender) } hasAllDayPanel() { const { viewData: viewData } = this.viewDataMap; const { allDayPanel: allDayPanel } = viewData.groupedData[0]; return !viewData.isGroupedAllDayPanel && (null === allDayPanel || void 0 === allDayPanel ? void 0 : allDayPanel.length) > 0 } getCellsGroup(groupIndex) { return this._groupedDataMapProvider.getCellsGroup(groupIndex) } getCompletedGroupsInfo() { return this._groupedDataMapProvider.getCompletedGroupsInfo() } getGroupIndices() { return this._groupedDataMapProvider.getGroupIndices() } getLastGroupCellPosition(groupIndex) { return this._groupedDataMapProvider.getLastGroupCellPosition(groupIndex) } getRowCountInGroup(groupIndex) { return this._groupedDataMapProvider.getRowCountInGroup(groupIndex) } getCellData(rowIndex, columnIndex, isAllDay, rtlEnabled) { const row = isAllDay && !this._options.isVerticalGrouping ? this.viewDataMap.allDayPanelMap : this.viewDataMap.dateTableMap[rowIndex]; const actualColumnIndex = !rtlEnabled ? columnIndex : row.length - 1 - columnIndex; const { cellData: cellData } = row[actualColumnIndex]; return cellData } getCellsByGroupIndexAndAllDay(groupIndex, allDay) { const rowsPerGroup = this._getRowCountWithAllDayRows(); const isShowAllDayPanel = this._options.isAllDayPanelVisible; const firstRowInGroup = this._options.isVerticalGrouping ? groupIndex * rowsPerGroup : 0; const lastRowInGroup = this._options.isVerticalGrouping ? (groupIndex + 1) * rowsPerGroup - 1 : rowsPerGroup; const correctedFirstRow = isShowAllDayPanel && !allDay ? firstRowInGroup + 1 : firstRowInGroup; const correctedLastRow = allDay ? correctedFirstRow : lastRowInGroup; return this.completeViewDataMap.slice(correctedFirstRow, correctedLastRow + 1).map((row => row.filter((_ref => { let { groupIndex: currentGroupIndex } = _ref; return groupIndex === currentGroupIndex })))) } getCellCountWithGroup(groupIndex) { let rowIndex = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0; const { dateTableGroupedMap: dateTableGroupedMap } = this.groupedDataMap; return dateTableGroupedMap.filter(((_, index) => index <= groupIndex)).reduce(((previous, row) => previous + row[rowIndex].length), 0) } hasGroupAllDayPanel(groupIndex) { var _this$groupedDataMap$2; if (this._options.isVerticalGrouping) { var _this$groupedDataMap$; return !!(null !== (_this$groupedDataMap$ = this.groupedDataMap.dateTableGroupedMap[groupIndex]) && void 0 !== _this$groupedDataMap$ && _this$groupedDataMap$[0][0].cellData.allDay) } return (null === (_this$groupedDataMap$2 = this.groupedDataMap.allDayPanelGroupedMap[groupIndex]) || void 0 === _this$groupedDataMap$2 ? void 0 : _this$groupedDataMap$2.length) > 0 } isGroupIntersectDateInterval(groupIndex, startDate, endDate) { const groupStartDate = this.getGroupStartDate(groupIndex); const groupEndDate = this.getGroupEndDate(groupIndex); return startDate < groupEndDate && endDate > groupStartDate } findGlobalCellPosition(date) { let groupIndex = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0; let allDay = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : false; const { completeViewDataMap: completeViewDataMap } = this; const showAllDayPanel = this._options.isAllDayPanelVisible; for (let rowIndex = 0; rowIndex < completeViewDataMap.length; rowIndex += 1) { const currentRow = completeViewDataMap[rowIndex]; for (let columnIndex = 0; columnIndex < currentRow.length; columnIndex += 1) { const cellData = currentRow[columnIndex]; const { startDate: currentStartDate, endDate: currentEndDate, groupIndex: currentGroupIndex, allDay: currentAllDay } = cellData; if (groupIndex === currentGroupIndex && allDay === !!currentAllDay && this._compareDatesAndAllDay(date, currentStartDate, currentEndDate, allDay)) { return { position: { columnIndex: columnIndex, rowIndex: showAllDayPanel && !this._options.isVerticalGrouping ? rowIndex - 1 : rowIndex }, cellData: cellData } } } } return } _compareDatesAndAllDay(date, cellStartDate, cellEndDate, allDay) { return allDay ? _date.default.sameDate(date, cellStartDate) : date >= cellStartDate && date < cellEndDate } getSkippedDaysCount(groupIndex, startDate, endDate, daysCount) { const { dateTableGroupedMap: dateTableGroupedMap } = this._groupedDataMapProvider.groupedDataMap; const groupedData = dateTableGroupedMap[groupIndex]; let includedDays = 0; for (let rowIndex = 0; rowIndex < groupedData.length; rowIndex += 1) { for (let columnIndex = 0; columnIndex < groupedData[rowIndex].length; columnIndex += 1) { const cell = groupedData[rowIndex][columnIndex].cellData; if (startDate.getTime() < cell.endDate.getTime() && endDate.getTime() > cell.startDate.getTime()) { includedDays += 1 } } } const lastCell = groupedData[groupedData.length - 1][groupedData[0].length - 1].cellData; const lastCellStart = _date.default.trimTime(lastCell.startDate); const daysAfterView = Math.floor((endDate.getTime() - lastCellStart.getTime()) / _date.default.dateToMilliseconds("day")); const deltaDays = daysAfterView > 0 ? daysAfterView : 0; return daysCount - includedDays - deltaDays } getColumnsCount() { const { dateTableMap: dateTableMap } = this.viewDataMap; return dateTableMap ? dateTableMap[0].length : 0 } getViewEdgeIndices(isAllDayPanel) { if (isAllDayPanel) { return { firstColumnIndex: 0, lastColumnIndex: this.viewDataMap.allDayPanelMap.length - 1, firstRowIndex: 0, lastRowIndex: 0 } } return { firstColumnIndex: 0, lastColumnIndex: this.viewDataMap.dateTableMap[0].length - 1, firstRowIndex: 0, lastRowIndex: this.viewDataMap.dateTableMap.length - 1 } } getGroupEdgeIndices(groupIndex, isAllDay) { const groupedDataMap = this.groupedDataMap.dateTableGroupedMap[groupIndex]; const cellsCount = groupedDataMap[0].length; const rowsCount = groupedDataMap.length; const firstColumnIndex = groupedDataMap[0][0].position.columnIndex; const lastColumnIndex = groupedDataMap[0][cellsCount - 1].position.columnIndex; if (isAllDay) { return { firstColumnIndex: firstColumnIndex, lastColumnIndex: lastColumnIndex, firstRowIndex: 0, lastRowIndex: 0 } } return { firstColumnIndex: firstColumnIndex, lastColumnIndex: lastColumnIndex, firstRowIndex: groupedDataMap[0][0].position.rowIndex, lastRowIndex: groupedDataMap[rowsCount - 1][0].position.rowIndex } } isSameCell(firstCellData, secondCellData) { const { startDate: firstStartDate, groupIndex: firstGroupIndex, allDay: firstAllDay, index: firstIndex } = firstCellData; const { startDate: secondStartDate, groupIndex: secondGroupIndex, allDay: secondAllDay, index: secondIndex } = secondCellData; return firstStartDate.getTime() === secondStartDate.getTime() && firstGroupIndex === secondGroupIndex && firstAllDay === secondAllDay && firstIndex === secondIndex } getLastViewDate() { const { completeViewDataMap: completeViewDataMap } = this; const rowsCount = completeViewDataMap.length - 1; return completeViewDataMap[rowsCount][completeViewDataMap[rowsCount].length - 1].endDate } getStartViewDate() { return this._options.startViewDate } getIntervalDuration(intervalCount) { return this.viewDataGenerator._getIntervalDuration(intervalCount) } getLastCellEndDate() { const lastEndDate = new Date(this.getLastViewDate().getTime() - _date.default.dateToMilliseconds("minute")); return _date2.dateUtilsTs.addOffsets(lastEndDate, [-this._options.viewOffset]) } getLastViewDateByEndDayHour(endDayHour) { const lastCellEndDate = this.getLastCellEndDate(); const endTime = _date.default.dateTimeFromDecimal(endDayHour); const endDateOfLastViewCell = new Date(lastCellEndDate.setHours(endTime.hours, endTime.minutes)); return this._adjustEndDateByDaylightDiff(lastCellEndDate, endDateOfLastViewCell) } _adjustEndDateByDaylightDiff(startDate, endDate) { const daylightDiff = _m_utils_time_zone.default.getDaylightOffsetInMs(startDate, endDate); const endDateOfLastViewCell = new Date(endDate.getTime() - daylightDiff); return new Date(endDateOfLastViewCell.getTime() - _date.default.dateToMilliseconds("minute")) } getCellCountInDay(startDayHour, endDayHour, hoursInterval) { return this.viewDataGenerator.getCellCountInDay(startDayHour, endDayHour, hoursInterval) } getCellCount(options) { return this.viewDataGenerator.getCellCount(options) } getRowCount(options) { return this.viewDataGenerator.getRowCount(options) } getVisibleDayDuration(startDayHour, endDayHour, hoursInterval) { return this.viewDataGenerator.getVisibleDayDuration(startDayHour, endDayHour, hoursInterval) } _getRowCountWithAllDayRows() { const allDayRowCount = this._options.isAllDayPanelVisible ? 1 : 0; return this.getRowCount(this._options) + allDayRowCount } getFirstDayOfWeek(firstDayOfWeekOption) { return this.viewDataGenerator.getFirstDayOfWeek(firstDayOfWeekOption) } setViewOptions(options) { this._options = this._transformRenderOptions(options) } getViewOptions() { return this._options } getViewPortGroupCount() { const { dateTableGroupedMap: dateTableGroupedMap } = this.groupedDataMap; return (null === dateTableGroupedMap || void 0 === dateTableGroupedMap ? void 0 : dateTableGroupedMap.length) || 0 } getCellsBetween(first, last) { const [firstCell, lastCell] = this.normalizeCellsOrder(first, last); const { index: firstIdx } = firstCell; const { index: lastIdx } = lastCell; const cellMatrix = this.getCellsByGroupIndexAndAllDay(firstCell.groupIndex ?? 0, lastCell.allDay ?? false); return (0, _index.isHorizontalView)(this.viewType) ? this.getCellsBetweenHorizontalView(cellMatrix, firstIdx, lastIdx) : this.getCellsBetweenVerticalView(cellMatrix, firstIdx, lastIdx) } getCellsBetweenHorizontalView(cellMatrix, firstIdx, lastIdx) { return cellMatrix.reduce(((result, row) => result.concat(row.filter((_ref2 => { let { index: index } = _ref2; return firstIdx <= index && index <= lastIdx })))), []) } getCellsBetweenVerticalView(cellMatrix, firstIdx, lastIdx) { var _cellMatrix$; const result = []; const matrixHeight = cellMatrix.length; const matrixWidth = (null === (_cellMatrix$ = cellMatrix[0]) || void 0 === _cellMatrix$ ? void 0 : _cellMatrix$.length) ?? 0; let inSegment = false; for (let columnIdx = 0; columnIdx < matrixWidth; columnIdx += 1) { for (let rowIdx = 0; rowIdx < matrixHeight; rowIdx += 1) { const cell = cellMatrix[rowIdx][columnIdx]; const { index: cellIdx } = cell; if (cellIdx === firstIdx) { inSegment = true } if (inSegment) { result.push(cell) } if (cellIdx === lastIdx) { return result } } } return result } normalizeCellsOrder(firstSelectedCell, lastSelectedCell) { return firstSelectedCell.startDate > lastSelectedCell.startDate ? [lastSelectedCell, firstSelectedCell] : [firstSelectedCell, lastSelectedCell] } } }, 69505: /*!********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/ui/calendar/m_calendar.base_view.js ***! \********************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../core/dom_adapter */ 73349)); var _element = __webpack_require__( /*! ../../../core/element */ 6415); var _element_data = __webpack_require__( /*! ../../../core/element_data */ 97906); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374)); var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576); var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198)); var _date_serialization = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date_serialization */ 69434)); var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306); var _click = __webpack_require__( /*! ../../../events/click */ 95429); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../events/core/events_engine */ 55994)); var _hover = __webpack_require__( /*! ../../../events/hover */ 24028); var _index = __webpack_require__( /*! ../../../events/utils/index */ 39611); var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../../localization/date */ 91500)); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../localization/message */ 28109)); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../ui/widget/ui.widget */ 14390)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const { abstract: abstract } = _ui.default; const CALENDAR_DXCLICK_EVENT_NAME = (0, _index.addNamespace)(_click.name, "dxCalendar"); const CALENDAR_DXHOVERSTART_EVENT_NAME = (0, _index.addNamespace)(_hover.start, "dxCalendar"); const CURRENT_DATE_TEXT = { month: _message.default.format("dxCalendar-currentDay"), year: _message.default.format("dxCalendar-currentMonth"), decade: _message.default.format("dxCalendar-currentYear"), century: _message.default.format("dxCalendar-currentYearRange") }; const SELECTION_MODE_single = "single", SELECTION_MODE_multiple = "multiple", SELECTION_MODE_range = "range"; const BaseView = _ui.default.inherit({ _getViewName: () => "base", _getDefaultOptions() { return (0, _extend.extend)(this.callBase(), { date: new Date, focusStateEnabled: false, cellTemplate: null, disabledDates: null, onCellClick: null, onCellHover: null, onWeekNumberClick: null, rowCount: 3, colCount: 4, allowValueSelection: true, _todayDate: () => new Date }) }, _initMarkup() { this.callBase(); this._renderImpl() }, _renderImpl() { this.$element().append(this._createTable()); this._createDisabledDatesHandler(); this._renderBody(); this._renderContouredDate(); this._renderValue(); this._renderRange(); this._renderEvents(); this._updateTableAriaLabel() }, _getLocalizedWidgetName() { const localizedWidgetName = _message.default.format("dxCalendar-ariaWidgetName"); return localizedWidgetName }, _getSingleModeAriaLabel() { const { value: value } = this.option(); const localizedWidgetName = this._getLocalizedWidgetName(); const formattedDate = _date2.default.format(value, "date"); const selectedDatesText = _message.default.format("dxCalendar-selectedDate", formattedDate); const ariaLabel = `${localizedWidgetName}. ${selectedDatesText}`; return ariaLabel }, _getRangeModeAriaLabel() { const { value: value } = this.option(); const localizedWidgetName = this._getLocalizedWidgetName(); const [startDate, endDate] = value; const formattedStartDate = _date2.default.format(startDate, "date"); const formattedEndDate = _date2.default.format(endDate, "date"); const selectedDatesText = startDate && endDate ? _message.default.format("dxCalendar-selectedDateRange", formattedStartDate, formattedEndDate) : _message.default.format("dxCalendar-selectedDate", formattedStartDate ?? formattedEndDate); const ariaLabel = `${localizedWidgetName}. ${selectedDatesText}`; return ariaLabel }, _getMultipleModeAriaLabel() { const ariaLabel = this._getLocalizedWidgetName(); return ariaLabel }, _getTableAriaLabel() { const { value: value, selectionMode: selectionMode } = this.option(); const isValueEmpty = !value || Array.isArray(value) && !value.filter(Boolean).length; if (isValueEmpty) { return this._getLocalizedWidgetName() } switch (selectionMode) { case SELECTION_MODE_single: return this._getSingleModeAriaLabel(); case SELECTION_MODE_range: return this._getRangeModeAriaLabel(); case SELECTION_MODE_multiple: return this._getMultipleModeAriaLabel() } }, _updateTableAriaLabel() { const label = this._getTableAriaLabel(); this.setAria({ label: label }, this._$table) }, _createTable() { this._$table = (0, _renderer.default)(""); this.setAria({ role: "grid" }, this._$table); return this._$table }, _renderBody() { this.$body = (0, _renderer.default)("").appendTo(this._$table); const rowData = { cellDate: this._getFirstCellData(), prevCellDate: null }; for (let rowIndex = 0, rowCount = this.option("rowCount"); rowIndex < rowCount; rowIndex++) { rowData.row = this._createRow(); for (let colIndex = 0, colCount = this.option("colCount"); colIndex < colCount; colIndex++) { this._renderCell(rowData, colIndex) } this._renderWeekNumberCell(rowData) } }, _createRow() { const row = _dom_adapter.default.createElement("tr"); this.setAria("role", "row", (0, _renderer.default)(row)); this.$body.get(0).appendChild(row); return row }, _createCell(cellDate, cellIndex) { const cell = _dom_adapter.default.createElement("td"); const $cell = (0, _renderer.default)(cell); cell.className = this._getClassNameByDate(cellDate, cellIndex); cell.setAttribute("data-value", _date_serialization.default.serializeDate(cellDate, _date.default.getShortDateFormat())); (0, _element_data.data)(cell, "dxDateValueKey", cellDate); this.setAria({ role: "gridcell", selected: false, label: this.getCellAriaLabel(cellDate) }, $cell); return { cell: cell, $cell: $cell } }, _renderCell(params, cellIndex) { const { cellDate: cellDate, prevCellDate: prevCellDate, row: row } = params; if (prevCellDate) { _date.default.fixTimezoneGap(prevCellDate, cellDate) } params.prevCellDate = cellDate; const { cell: cell, $cell: $cell } = this._createCell(cellDate, cellIndex); const cellTemplate = this.option("cellTemplate"); (0, _renderer.default)(row).append(cell); if (cellTemplate) { cellTemplate.render(this._prepareCellTemplateData(cellDate, cellIndex, $cell)) } else { cell.innerHTML = this._getCellText(cellDate) } params.cellDate = this._getNextCellData(cellDate) }, _getClassNameByDate(cellDate, cellIndex) { let className = "dx-calendar-cell"; if (this._isTodayCell(cellDate)) { className += " dx-calendar-today" } if (this._isDateOutOfRange(cellDate) || this.isDateDisabled(cellDate)) { className += " dx-calendar-empty-cell" } if (this._isOtherView(cellDate)) { className += " dx-calendar-other-view" } if (this.option("selectionMode") === SELECTION_MODE_range) { if (0 === cellIndex) { className += " dx-calendar-cell-start-in-row" } if (cellIndex === this.option("colCount") - 1) { className += " dx-calendar-cell-end-in-row" } if (this._isStartDayOfMonth(cellDate)) { className += " dx-calendar-cell-start" } if (this._isEndDayOfMonth(cellDate)) { className += " dx-calendar-cell-end" } } return className }, _prepareCellTemplateData(cellDate, cellIndex, $cell) { const isDateCell = cellDate instanceof Date; const text = isDateCell ? this._getCellText(cellDate) : cellDate; const date = isDateCell ? cellDate : void 0; const view = this._getViewName(); return { model: { text: text, date: date, view: view }, container: (0, _element.getPublicElement)($cell), index: cellIndex } }, _renderEvents() { this._createCellClickAction(); _events_engine.default.off(this._$table, CALENDAR_DXCLICK_EVENT_NAME); _events_engine.default.on(this._$table, CALENDAR_DXCLICK_EVENT_NAME, "td:not(.dx-calendar-week-number-cell)", (e => { if (!(0, _renderer.default)(e.currentTarget).hasClass("dx-calendar-empty-cell")) { this._cellClickAction({ event: e, value: (0, _renderer.default)(e.currentTarget).data("dxDateValueKey") }) } })); const { selectionMode: selectionMode } = this.option(); _events_engine.default.off(this._$table, CALENDAR_DXHOVERSTART_EVENT_NAME); if (selectionMode === SELECTION_MODE_range) { this._createCellHoverAction(); _events_engine.default.on(this._$table, CALENDAR_DXHOVERSTART_EVENT_NAME, "td:not(.dx-calendar-week-number-cell)", (e => { if (!(0, _renderer.default)(e.currentTarget).hasClass("dx-calendar-empty-cell")) { this._cellHoverAction({ event: e, value: (0, _renderer.default)(e.currentTarget).data("dxDateValueKey") }) } })) } if (selectionMode !== SELECTION_MODE_single) { this._createWeekNumberCellClickAction(); _events_engine.default.on(this._$table, CALENDAR_DXCLICK_EVENT_NAME, ".dx-calendar-week-number-cell", (e => { const $row = (0, _renderer.default)(e.currentTarget).closest("tr"); const firstDateInRow = $row.find(".dx-calendar-cell").first().data("dxDateValueKey"); const lastDateInRow = $row.find(".dx-calendar-cell").last().data("dxDateValueKey"); const rowDates = [..._date.default.getDatesOfInterval(firstDateInRow, lastDateInRow, 864e5), lastDateInRow]; this._weekNumberCellClickAction({ event: e, rowDates: rowDates }) })) } }, _createCellClickAction() { this._cellClickAction = this._createActionByOption("onCellClick") }, _createCellHoverAction() { this._cellHoverAction = this._createActionByOption("onCellHover") }, _createWeekNumberCellClickAction() { this._weekNumberCellClickAction = this._createActionByOption("onWeekNumberClick") }, _createDisabledDatesHandler() { const disabledDates = this.option("disabledDates"); this._disabledDatesHandler = Array.isArray(disabledDates) ? this._getDefaultDisabledDatesHandler(disabledDates) : disabledDates || _common.noop }, _getDefaultDisabledDatesHandler: () => _common.noop, _isTodayCell: abstract, _isDateOutOfRange: abstract, isDateDisabled(cellDate) { const dateParts = { date: cellDate, view: this._getViewName() }; return this._disabledDatesHandler(dateParts) }, _isOtherView: abstract, _isStartDayOfMonth: abstract, _isEndDayOfMonth: abstract, _getCellText: abstract, _getFirstCellData: abstract, _getNextCellData: abstract, _renderContouredDate(contouredDate) { if (!this.option("focusStateEnabled")) { return } contouredDate = contouredDate || this.option("contouredDate"); const $oldContouredCell = this._getContouredCell(); const $newContouredCell = this._getCellByDate(contouredDate); $oldContouredCell.removeClass("dx-calendar-contoured-date"); if (contouredDate) { $newContouredCell.addClass("dx-calendar-contoured-date") } }, _getContouredCell() { return this._$table.find(".dx-calendar-contoured-date") }, _renderValue() { if (!this.option("allowValueSelection")) { return } let value = this.option("value"); if (!Array.isArray(value)) { value = [value] } this._updateSelectedClass(value) }, _updateSelectedClass(value) { var _this$_$selectedCells; if (this._isRangeMode() && !this._isMonthView()) { return } null === (_this$_$selectedCells = this._$selectedCells) || void 0 === _this$_$selectedCells || _this$_$selectedCells.forEach(($cell => { $cell.removeClass("dx-calendar-selected-date") })); this._$selectedCells = value.map((value => this._getCellByDate(value))); this._$selectedCells.forEach(($cell => { $cell.addClass("dx-calendar-selected-date") })) }, _renderRange() { var _this$_$rangeCells, _this$_$hoveredRangeC, _this$_$rangeStartHov, _this$_$rangeEndHover, _this$_$rangeStartDat, _this$_$rangeEndDateC, _this$_$rangeStartDat2, _this$_$rangeEndDateC2; const { allowValueSelection: allowValueSelection, value: value, range: range } = this.option(); if (!allowValueSelection || !this._isRangeMode() || !this._isMonthView()) { return } null === (_this$_$rangeCells = this._$rangeCells) || void 0 === _this$_$rangeCells || _this$_$rangeCells.forEach(($cell => { $cell.removeClass("dx-calendar-cell-in-range") })); null === (_this$_$hoveredRangeC = this._$hoveredRangeCells) || void 0 === _this$_$hoveredRangeC || _this$_$hoveredRangeC.forEach(($cell => { $cell.removeClass("dx-calendar-cell-range-hover") })); null === (_this$_$rangeStartHov = this._$rangeStartHoverCell) || void 0 === _this$_$rangeStartHov || _this$_$rangeStartHov.removeClass("dx-calendar-cell-range-hover-start"); null === (_this$_$rangeEndHover = this._$rangeEndHoverCell) || void 0 === _this$_$rangeEndHover || _this$_$rangeEndHover.removeClass("dx-calendar-cell-range-hover-end"); null === (_this$_$rangeStartDat = this._$rangeStartDateCell) || void 0 === _this$_$rangeStartDat || _this$_$rangeStartDat.removeClass("dx-calendar-range-start-date"); null === (_this$_$rangeEndDateC = this._$rangeEndDateCell) || void 0 === _this$_$rangeEndDateC || _this$_$rangeEndDateC.removeClass("dx-calendar-range-end-date"); this._$rangeCells = range.map((value => this._getCellByDate(value))); this._$rangeStartDateCell = this._getCellByDate(value[0]); this._$rangeEndDateCell = this._getCellByDate(value[1]); this._$rangeCells.forEach(($cell => { $cell.addClass("dx-calendar-cell-in-range") })); null === (_this$_$rangeStartDat2 = this._$rangeStartDateCell) || void 0 === _this$_$rangeStartDat2 || _this$_$rangeStartDat2.addClass("dx-calendar-range-start-date"); null === (_this$_$rangeEndDateC2 = this._$rangeEndDateCell) || void 0 === _this$_$rangeEndDateC2 || _this$_$rangeEndDateC2.addClass("dx-calendar-range-end-date") }, _renderHoveredRange() { var _this$_$hoveredRangeC2, _this$_$rangeStartHov2, _this$_$rangeEndHover2, _this$_$rangeStartHov3, _this$_$rangeEndHover3; const { allowValueSelection: allowValueSelection, hoveredRange: hoveredRange } = this.option(); if (!allowValueSelection || !this._isRangeMode() || !this._isMonthView()) { return } null === (_this$_$hoveredRangeC2 = this._$hoveredRangeCells) || void 0 === _this$_$hoveredRangeC2 || _this$_$hoveredRangeC2.forEach(($cell => { $cell.removeClass("dx-calendar-cell-range-hover") })); null === (_this$_$rangeStartHov2 = this._$rangeStartHoverCell) || void 0 === _this$_$rangeStartHov2 || _this$_$rangeStartHov2.removeClass("dx-calendar-cell-range-hover-start"); null === (_this$_$rangeEndHover2 = this._$rangeEndHoverCell) || void 0 === _this$_$rangeEndHover2 || _this$_$rangeEndHover2.removeClass("dx-calendar-cell-range-hover-end"); this._$hoveredRangeCells = hoveredRange.map((value => this._getCellByDate(value))); this._$rangeStartHoverCell = this._getCellByDate(hoveredRange[0]); this._$rangeEndHoverCell = this._getCellByDate(hoveredRange[hoveredRange.length - 1]); this._$hoveredRangeCells.forEach(($cell => { $cell.addClass("dx-calendar-cell-range-hover") })); null === (_this$_$rangeStartHov3 = this._$rangeStartHoverCell) || void 0 === _this$_$rangeStartHov3 || _this$_$rangeStartHov3.addClass("dx-calendar-cell-range-hover-start"); null === (_this$_$rangeEndHover3 = this._$rangeEndHoverCell) || void 0 === _this$_$rangeEndHover3 || _this$_$rangeEndHover3.addClass("dx-calendar-cell-range-hover-end") }, _isMonthView() { return "month" === this.option("zoomLevel") }, _isRangeMode() { return this.option("selectionMode") === SELECTION_MODE_range }, _getCurrentDateFormat: () => null, getCellAriaLabel(date) { const viewName = this._getViewName(); const isToday = this._isTodayCell(date); const format = this._getCurrentDateFormat(); const dateRangeText = format ? _date2.default.format(date, format) : this._getCellText(date); const ariaLabel = isToday ? `${dateRangeText}. ${CURRENT_DATE_TEXT[viewName]}` : dateRangeText; return ariaLabel }, _getFirstAvailableDate() { let date = this.option("date"); const min = this.option("min"); date = _date.default.getViewFirstCellDate(this._getViewName(), date); return new Date(min && date < min ? min : date) }, _getCellByDate: abstract, isBoundary: abstract, _optionChanged(args) { const { name: name, value: value } = args; switch (name) { case "value": this._renderValue(); this._updateTableAriaLabel(); break; case "range": this._renderRange(); break; case "hoveredRange": this._renderHoveredRange(); break; case "contouredDate": this._renderContouredDate(value); break; case "onCellClick": this._createCellClickAction(); break; case "onCellHover": this._createCellHoverAction(); break; case "min": case "max": case "disabledDates": case "cellTemplate": case "selectionMode": this._invalidate(); break; case "_todayDate": this._renderBody(); break; default: this.callBase(args) } } }); exports.default = BaseView }, 49782: /*!**********************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/ui/calendar/m_calendar.js ***! \**********************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _fx = _interopRequireDefault(__webpack_require__( /*! ../../../animation/fx */ 87209)); var _translator = __webpack_require__( /*! ../../../animation/translator */ 31648); var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 99393)); var _devices = _interopRequireDefault(__webpack_require__( /*! ../../../core/devices */ 20530)); var _guid = _interopRequireDefault(__webpack_require__( /*! ../../../core/guid */ 73176)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374)); var _function_template = __webpack_require__( /*! ../../../core/templates/function_template */ 68494); var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576); var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198)); var _date_serialization = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date_serialization */ 69434)); var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306); var _math = __webpack_require__( /*! ../../../core/utils/math */ 60810); var _size = __webpack_require__( /*! ../../../core/utils/size */ 58664); var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922); var _window = __webpack_require__( /*! ../../../core/utils/window */ 58201); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../events/core/events_engine */ 55994)); var _swipeable = _interopRequireDefault(__webpack_require__( /*! ../../../events/gesture/swipeable */ 66894)); var _hover = __webpack_require__( /*! ../../../events/hover */ 24028); var _index = __webpack_require__( /*! ../../../events/utils/index */ 39611); var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../../localization/date */ 91500)); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../localization/message */ 28109)); var _button = _interopRequireDefault(__webpack_require__( /*! ../../../ui/button */ 63008)); var _editor = _interopRequireDefault(__webpack_require__( /*! ../../../ui/editor/editor */ 96452)); var _themes = __webpack_require__( /*! ../../../ui/themes */ 75811); var _m_calendarMultipleSelection = _interopRequireDefault(__webpack_require__( /*! ./m_calendar.multiple.selection.strategy */ 37427)); var _m_calendar = _interopRequireDefault(__webpack_require__( /*! ./m_calendar.navigator */ 35506)); var _m_calendarRangeSelection = _interopRequireDefault(__webpack_require__( /*! ./m_calendar.range.selection.strategy */ 96218)); var _m_calendarSingleSelection = _interopRequireDefault(__webpack_require__( /*! ./m_calendar.single.selection.strategy */ 99324)); var _m_calendar2 = _interopRequireDefault(__webpack_require__( /*! ./m_calendar.views */ 48928)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const CALENDAR_DXHOVEREND_EVENT_NAME = (0, _index.addNamespace)(_hover.end, "dxCalendar"); const LEVEL_COMPARE_MAP = { month: 3, year: 2, decade: 1, century: 0 }; const ZOOM_LEVEL_MONTH = "month", ZOOM_LEVEL_YEAR = "year", ZOOM_LEVEL_DECADE = "decade", ZOOM_LEVEL_CENTURY = "century"; const SELECTION_STRATEGIES = { SingleSelection: _m_calendarSingleSelection.default, MultipleSelection: _m_calendarMultipleSelection.default, RangeSelection: _m_calendarRangeSelection.default }; const Calendar = _editor.default.inherit({ _activeStateUnit: ".dx-calendar-cell", _getDefaultOptions() { return (0, _extend.extend)(this.callBase(), { hoverStateEnabled: true, activeStateEnabled: true, currentDate: new Date, value: null, dateSerializationFormat: void 0, min: new Date(1e3, 0), max: new Date(3e3, 0), firstDayOfWeek: void 0, viewsCount: 1, zoomLevel: ZOOM_LEVEL_MONTH, maxZoomLevel: ZOOM_LEVEL_MONTH, minZoomLevel: ZOOM_LEVEL_CENTURY, selectionMode: "single", selectWeekOnClick: true, showTodayButton: false, showWeekNumbers: false, weekNumberRule: "auto", cellTemplate: "cell", disabledDates: null, onCellClick: null, onContouredChanged: null, skipFocusCheck: false, _todayDate: () => new Date }) }, _defaultOptionsRules() { return this.callBase().concat([{ device: () => "desktop" === _devices.default.real().deviceType && !_devices.default.isSimulator(), options: { focusStateEnabled: true } }]) }, _supportedKeys() { return (0, _extend.extend)(this.callBase(), { rightArrow(e) { e.preventDefault(); if ((0, _index.isCommandKeyPressed)(e)) { this._waitRenderView(1) } else { this._moveCurrentDateByOffset(1 * this._getRtlCorrection()) } }, leftArrow(e) { e.preventDefault(); if ((0, _index.isCommandKeyPressed)(e)) { this._waitRenderView(-1) } else { this._moveCurrentDateByOffset(-1 * this._getRtlCorrection()) } }, upArrow(e) { e.preventDefault(); if ((0, _index.isCommandKeyPressed)(e)) { this._navigateUp() } else { if (_fx.default.isAnimating(this._view.$element())) { return } this._moveCurrentDateByOffset(-1 * this._view.option("colCount")) } }, downArrow(e) { e.preventDefault(); if ((0, _index.isCommandKeyPressed)(e)) { this._navigateDown() } else { if (_fx.default.isAnimating(this._view.$element())) { return } this._moveCurrentDateByOffset(1 * this._view.option("colCount")) } }, home(e) { e.preventDefault(); const zoomLevel = this.option("zoomLevel"); const currentDate = this.option("currentDate"); const min = this._dateOption("min"); if (this._view.isDateDisabled(currentDate)) { return } const date = _date.default.sameView(zoomLevel, currentDate, min) ? min : _date.default.getViewFirstCellDate(zoomLevel, currentDate); this._moveToClosestAvailableDate(date) }, end(e) { e.preventDefault(); const zoomLevel = this.option("zoomLevel"); const currentDate = this.option("currentDate"); const max = this._dateOption("max"); if (this._view.isDateDisabled(currentDate)) { return } const date = _date.default.sameView(zoomLevel, currentDate, max) ? max : _date.default.getViewLastCellDate(zoomLevel, currentDate); this._moveToClosestAvailableDate(date) }, pageUp(e) { e.preventDefault(); this._waitRenderView(-1 * this._getRtlCorrection()) }, pageDown(e) { e.preventDefault(); this._waitRenderView(1 * this._getRtlCorrection()) }, tab: _common.noop, enter: this._enterKeyHandler }) }, _enterKeyHandler(e) { if (!this._isMaxZoomLevel()) { this._navigateDown() } else if (!this._view.isDateDisabled(this.option("currentDate"))) { const value = this._updateTimeComponent(this.option("currentDate")); this._selectionStrategy.selectValue(value, e) } }, _getSerializationFormat(optionName) { const value = this.option(optionName || "value"); if (this.option("dateSerializationFormat")) { return this.option("dateSerializationFormat") } if ((0, _type.isNumeric)(value)) { return "number" } if (!(0, _type.isString)(value)) { return } return _date_serialization.default.getDateSerializationFormat(value) }, _convertToDate: value => _date_serialization.default.deserializeDate(value), _dateValue(value, event) { if (event) { if ("keydown" === event.type) { const cellElement = this._view._getContouredCell().get(0); event.target = cellElement } this._saveValueChangeEvent(event) } this._dateOption("value", value) }, _dateOption(optionName, optionValue) { const isArray = "value" === optionName && !this._isSingleMode(); const value = this.option("value"); if (1 === arguments.length) { return isArray ? (value ?? []).map((value => this._convertToDate(value))) : this._convertToDate(this.option(optionName)) } const serializationFormat = this._getSerializationFormat(optionName); const serializedValue = isArray ? (null === optionValue || void 0 === optionValue ? void 0 : optionValue.map((value => _date_serialization.default.serializeDate(value, serializationFormat)))) || [] : _date_serialization.default.serializeDate(optionValue, serializationFormat); this.option(optionName, serializedValue) }, _isSingleMode() { return "single" === this.option("selectionMode") }, _shiftDate(zoomLevel, date, offset, reverse) { switch (zoomLevel) { case ZOOM_LEVEL_MONTH: date.setDate(date.getDate() + offset * reverse); break; case ZOOM_LEVEL_YEAR: date.setMonth(date.getMonth() + offset * reverse); break; case ZOOM_LEVEL_DECADE: date.setFullYear(date.getFullYear() + offset * reverse); break; case ZOOM_LEVEL_CENTURY: date.setFullYear(date.getFullYear() + 10 * offset * reverse) } }, _moveCurrentDateByOffset(offset) { const baseDate = this.option("currentDate"); let currentDate = new Date(baseDate); const zoomLevel = this.option("zoomLevel"); this._shiftDate(zoomLevel, currentDate, offset, 1); const maxDate = this._getMaxDate(); const minDate = this._getMinDate(); let isDateForwardInNeighborView = this._areDatesInNeighborView(zoomLevel, currentDate, baseDate); let isDateForwardInRange = (0, _math.inRange)(currentDate, minDate, maxDate) && isDateForwardInNeighborView; const dateForward = new Date(currentDate); while (isDateForwardInRange) { if (!this._view.isDateDisabled(dateForward)) { currentDate = dateForward; break } this._shiftDate(zoomLevel, dateForward, offset, 1); isDateForwardInNeighborView = this._areDatesInNeighborView(zoomLevel, dateForward, baseDate); isDateForwardInRange = (0, _math.inRange)(dateForward, minDate, maxDate) && isDateForwardInNeighborView } if (this._view.isDateDisabled(baseDate) || this._view.isDateDisabled(currentDate)) { const direction = offset > 0 ? 1 : -1; const isViewDisabled = 1 === direction ? this._isNextViewDisabled() : this._isPrevViewDisabled(); if (!isViewDisabled) { this._waitRenderView(direction) } else { this._moveToClosestAvailableDate(currentDate) } } else { this._skipNavigate = true; this.option("currentDate", currentDate) } }, _isNextViewDisabled() { return this._navigator._nextButton.option("disabled") }, _isPrevViewDisabled() { return this._navigator._prevButton.option("disabled") }, _areDatesInSameView(zoomLevel, date1, date2) { switch (zoomLevel) { case ZOOM_LEVEL_MONTH: return date1.getMonth() === date2.getMonth(); case ZOOM_LEVEL_YEAR: return date1.getYear() === date2.getYear(); case ZOOM_LEVEL_DECADE: return parseInt(date1.getYear() / 10) === parseInt(date2.getYear() / 10); case ZOOM_LEVEL_CENTURY: return parseInt(date1.getYear() / 100) === parseInt(date2.getYear() / 100) } }, _areDatesInNeighborView(zoomLevel, date1, date2) { switch (zoomLevel) { case ZOOM_LEVEL_MONTH: return ((a, b) => { const abs = Math.abs(a - b); return Math.min(abs, 12 - abs) })(date1.getMonth(), date2.getMonth()) <= 1; case ZOOM_LEVEL_YEAR: return Math.abs(date1.getYear() - date2.getYear()) <= 1; case ZOOM_LEVEL_DECADE: return Math.abs(date1.getYear() - date2.getYear()) <= 10; case ZOOM_LEVEL_CENTURY: return Math.abs(date1.getYear() - date2.getYear()) <= 100 } }, _moveToClosestAvailableDate() { let baseDate = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.option("currentDate"); let currentDate = new Date(baseDate); const zoomLevel = this.option("zoomLevel"); const isCurrentDateAvailable = !this._isDateNotAvailable(currentDate); let isDateForwardAvailable = isCurrentDateAvailable; let isDateBackwardAvailable = isCurrentDateAvailable; let isDateForwardInStartView; let isDateBackwardInStartView; const dateForward = new Date(currentDate); const dateBackward = new Date(currentDate); do { if (isDateForwardAvailable) { currentDate = dateForward; break } if (isDateBackwardAvailable) { currentDate = dateBackward; break } this._shiftDate(zoomLevel, dateForward, 1, 1); this._shiftDate(zoomLevel, dateBackward, 1, -1); isDateForwardInStartView = this._areDatesInSameView(zoomLevel, dateForward, baseDate); isDateBackwardInStartView = this._areDatesInSameView(zoomLevel, dateBackward, baseDate); isDateForwardAvailable = isDateForwardInStartView && !this._isDateNotAvailable(dateForward); isDateBackwardAvailable = isDateBackwardInStartView && !this._isDateNotAvailable(dateBackward) } while (isDateForwardInStartView || isDateBackwardInStartView); this.option("currentDate", currentDate) }, _isDateNotAvailable(date) { const maxDate = this._getMaxDate(); const minDate = this._getMinDate(); return !(0, _math.inRange)(date, minDate, maxDate) || this._view.isDateDisabled(date) }, _init() { this.callBase(); this._initSelectionStrategy(); this._correctZoomLevel(); this._initCurrentDate(); this._initActions() }, _initSelectionStrategy() { const strategyName = this._getSelectionStrategyName(); const strategy = SELECTION_STRATEGIES[strategyName]; if (!this._selectionStrategy || this._selectionStrategy.NAME !== strategyName) { this._selectionStrategy = new strategy(this) } }, _refreshSelectionStrategy() { this._initSelectionStrategy(); this._selectionStrategy.restoreValue(); this._refresh() }, _getSelectionStrategyName() { const selectionMode = this.option("selectionMode"); switch (selectionMode) { case "multiple": return "MultipleSelection"; case "range": return "RangeSelection"; default: return "SingleSelection" } }, _correctZoomLevel() { const minZoomLevel = this.option("minZoomLevel"); const maxZoomLevel = this.option("maxZoomLevel"); const zoomLevel = this.option("zoomLevel"); if (LEVEL_COMPARE_MAP[maxZoomLevel] < LEVEL_COMPARE_MAP[minZoomLevel]) { return } if (LEVEL_COMPARE_MAP[zoomLevel] > LEVEL_COMPARE_MAP[maxZoomLevel]) { this.option("zoomLevel", maxZoomLevel) } else if (LEVEL_COMPARE_MAP[zoomLevel] < LEVEL_COMPARE_MAP[minZoomLevel]) { this.option("zoomLevel", minZoomLevel) } }, _initCurrentDate() { const currentDate = this._getNormalizedDate(this._selectionStrategy.getDefaultCurrentDate()) ?? this._getNormalizedDate(this.option("currentDate")); this.option("currentDate", currentDate) }, _getNormalizedDate(date) { date = _date.default.normalizeDate(date, this._getMinDate(), this._getMaxDate()); return (0, _type.isDefined)(date) ? this._getDate(date) : date }, _initActions() { this._cellClickAction = this._createActionByOption("onCellClick"); this._onContouredChanged = this._createActionByOption("onContouredChanged") }, _initTemplates() { this._templateManager.addDefaultTemplates({ cell: new _function_template.FunctionTemplate((options => { const data = options.model; (0, _renderer.default)(options.container).append((0, _renderer.default)("").text(data && data.text || String(data))) })) }); this.callBase() }, _updateCurrentDate(date) { if (_fx.default.isAnimating(this._$viewsWrapper)) { _fx.default.stop(this._$viewsWrapper, true) } const min = this._getMinDate(); const max = this._getMaxDate(); if (min > max) { this.option("currentDate", new Date); return } const normalizedDate = this._getNormalizedDate(date); if (date.getTime() !== normalizedDate.getTime()) { this.option("currentDate", new Date(normalizedDate)); return } let offset = this._getViewsOffset(this._view.option("date"), normalizedDate); if (0 !== offset && !this._isMaxZoomLevel() && this._isOtherViewCellClicked) { offset = 0 } if (this._view && 0 !== offset && !this._suppressNavigation) { if (this._additionalView) { if (offset > 2 || offset < -1) { this._refreshViews(); this._setViewContoured(normalizedDate); this._updateAriaId(normalizedDate); this._renderNavigator() } else if (1 === offset && this._skipNavigate) { this._setViewContoured(normalizedDate); this._updateAriaId(normalizedDate) } else { this._navigate(offset, normalizedDate) } } else { this._navigate(offset, normalizedDate) } } else { this._renderNavigator(); this._setViewContoured(normalizedDate); this._updateAriaId(normalizedDate) } this._skipNavigate = false }, _isAdditionalViewDate(date) { if (!this._additionalView) { return false } return date >= this._additionalView._getFirstAvailableDate() }, _getActiveView(date) { return this._isAdditionalViewDate(date) ? this._additionalView : this._view }, _setViewContoured(date) { if (this.option("skipFocusCheck") || (0, _renderer.default)(this._$viewsWrapper).is(":focus")) { var _this$_additionalView; this._view.option("contouredDate", null); null === (_this$_additionalView = this._additionalView) || void 0 === _this$_additionalView || _this$_additionalView.option("contouredDate", null); const view = this._isAdditionalViewDate(date) ? this._additionalView : this._view; view.option("contouredDate", date) } }, _getMinDate() { const _rangeMin = this.option("_rangeMin"); if (_rangeMin) { return _rangeMin } if (this.min) { return this.min } this.min = this._dateOption("min") || new Date(1e3, 0); return this.min }, _getMaxDate() { const _rangeMax = this.option("_rangeMax"); if (_rangeMax) { return _rangeMax } if (this.max) { return this.max } this.max = this._dateOption("max") || new Date(3e3, 0); return this.max }, _getViewsOffset(startDate, endDate) { const zoomLevel = this.option("zoomLevel"); if (zoomLevel === ZOOM_LEVEL_MONTH) { return this._getMonthsOffset(startDate, endDate) } let zoomCorrection; switch (zoomLevel) { case ZOOM_LEVEL_CENTURY: zoomCorrection = 100; break; case ZOOM_LEVEL_DECADE: zoomCorrection = 10; break; default: zoomCorrection = 1 } return parseInt(endDate.getFullYear() / zoomCorrection) - parseInt(startDate.getFullYear() / zoomCorrection) }, _getMonthsOffset(startDate, endDate) { const yearOffset = endDate.getFullYear() - startDate.getFullYear(); const monthOffset = endDate.getMonth() - startDate.getMonth(); return 12 * yearOffset + monthOffset }, _waitRenderView(offset) { if (this._alreadyViewRender) { return } this._alreadyViewRender = true; const date = this._getDateByOffset(offset * this._getRtlCorrection()); this._moveToClosestAvailableDate(date); this._waitRenderViewTimeout = setTimeout((() => { this._alreadyViewRender = false })) }, _getRtlCorrection() { return this.option("rtlEnabled") ? -1 : 1 }, _getDateByOffset(offset, date) { date = this._getDate(date ?? this.option("currentDate")); const currentDay = date.getDate(); const difference = _date.default.getDifferenceInMonth(this.option("zoomLevel")) * offset; date.setDate(1); date.setMonth(date.getMonth() + difference); const lastDay = _date.default.getLastMonthDate(date).getDate(); date.setDate(currentDay > lastDay ? lastDay : currentDay); return date }, _focusTarget() { return this._$viewsWrapper }, _focusEventTarget() { return this.$element() }, _initMarkup() { this._renderSubmitElement(); const $element = this.$element(); $element.addClass("dx-calendar"); $element.toggleClass("dx-calendar-range", "range" === this.option("selectionMode")); this._renderBody(); $element.append(this.$body); this._renderViews(); this._renderNavigator(); this.callBase(); this._renderEvents(); $element.prepend(this._navigator.$element()); this._renderSwipeable(); this._renderFooter(); this._selectionStrategy.updateAriaSelected(); this._updateAriaId(); this._updateNavigatorLabels(); this.setAria("role", "application"); this._moveToClosestAvailableDate() }, _render() { this.callBase(); this._setViewContoured(this.option("currentDate")) }, _renderBody() { if (!this._$viewsWrapper) { this.$body = (0, _renderer.default)("
").addClass("dx-calendar-body"); this._$viewsWrapper = (0, _renderer.default)("
").addClass("dx-calendar-views-wrapper"); this.$body.append(this._$viewsWrapper) } }, _setAriaReadonly: _common.noop, _getKeyboardListeners() { return this.callBase().concat([this._view]) }, _renderViews() { this.$element().addClass(`dx-calendar-view-${this.option("zoomLevel")}`); const { currentDate: currentDate, viewsCount: viewsCount } = this.option(); this.$element().toggleClass("dx-calendar-multiview", viewsCount > 1); this._view = this._renderSpecificView(currentDate); if ((0, _window.hasWindow)()) { const beforeDate = this._getDateByOffset(-1, currentDate); this._beforeView = this._isViewAvailable(beforeDate) ? this._renderSpecificView(beforeDate) : null; const afterDate = this._getDateByOffset(viewsCount, currentDate); afterDate.setDate(1); this._afterView = this._isViewAvailable(afterDate) ? this._renderSpecificView(afterDate) : null } if (viewsCount > 1) { this._additionalView = this._renderSpecificView(this._getDateByOffset(1, currentDate)) } this._translateViews() }, _renderSpecificView(date) { const { zoomLevel: zoomLevel } = this.option(); const specificView = _m_calendar2.default[zoomLevel]; const $view = (0, _renderer.default)("
").appendTo(this._$viewsWrapper); const config = this._viewConfig(date); const view = this._createComponent($view, specificView, config); return view }, _viewConfig(date) { let disabledDates = this.option("disabledDates"); disabledDates = (0, _type.isFunction)(disabledDates) ? this._injectComponent(disabledDates.bind(this)) : disabledDates; return _extends({}, this._selectionStrategy.getViewOptions(), { date: date, min: this._getMinDate(), max: this._getMaxDate(), firstDayOfWeek: this.option("firstDayOfWeek") ?? _date2.default.firstDayOfWeekIndex(), showWeekNumbers: this.option("showWeekNumbers"), selectWeekOnClick: this.option("selectWeekOnClick"), weekNumberRule: this.option("weekNumberRule"), zoomLevel: this.option("zoomLevel"), tabIndex: void 0, focusStateEnabled: this.option("focusStateEnabled"), hoverStateEnabled: this.option("hoverStateEnabled"), disabledDates: disabledDates, onCellClick: this._cellClickHandler.bind(this), cellTemplate: this._getTemplateByOption("cellTemplate"), allowValueSelection: this._isMaxZoomLevel(), _todayDate: this.option("_todayDate") }) }, _renderEvents() { _events_engine.default.off(this._$viewsWrapper, CALENDAR_DXHOVEREND_EVENT_NAME); if ("range" === this.option("selectionMode")) { _events_engine.default.on(this._$viewsWrapper, CALENDAR_DXHOVEREND_EVENT_NAME, null, (() => { this._updateViewsOption("hoveredRange", []) })) } }, _injectComponent(func) { const that = this; return function(params) { (0, _extend.extend)(params, { component: that }); return func(params) } }, _isViewAvailable(date) { const zoomLevel = this.option("zoomLevel"); const min = _date.default.getViewMinBoundaryDate(zoomLevel, this._getMinDate()); const max = _date.default.getViewMaxBoundaryDate(zoomLevel, this._getMaxDate()); return _date.default.dateInRange(date, min, max) }, _translateViews() { const { viewsCount: viewsCount } = this.option(); (0, _translator.move)(this._view.$element(), { left: 0, top: 0 }); this._moveViewElement(this._beforeView, -1); this._moveViewElement(this._afterView, viewsCount); this._moveViewElement(this._additionalView, 1) }, _moveViewElement(view, coefficient) { view && (0, _translator.move)(view.$element(), { left: this._getViewPosition(coefficient), top: 0 }) }, _getViewPosition(coefficient) { const rtlCorrection = this.option("rtlEnabled") ? -1 : 1; return 100 * coefficient * rtlCorrection + "%" }, _cellClickHandler(e) { const zoomLevel = this.option("zoomLevel"); const nextView = _date.default.getViewDown(zoomLevel); const isMaxZoomLevel = this._isMaxZoomLevel(); if (nextView && !isMaxZoomLevel) { this._navigateDown(e.event.currentTarget) } else { const newValue = this._updateTimeComponent(e.value); this._selectionStrategy.selectValue(newValue, e.event); this._cellClickAction(e) } }, _updateTimeComponent(date) { const result = new Date(date); const currentValue = this._dateOption("value"); if (currentValue && this._isSingleMode()) { result.setHours(currentValue.getHours()); result.setMinutes(currentValue.getMinutes()); result.setSeconds(currentValue.getSeconds()); result.setMilliseconds(currentValue.getMilliseconds()) } return result }, _isMaxZoomLevel() { return this.option("zoomLevel") === this.option("maxZoomLevel") }, _navigateDown(cell) { const zoomLevel = this.option("zoomLevel"); if (this._isMaxZoomLevel()) { return } const nextView = _date.default.getViewDown(zoomLevel); if (!nextView) { return } let newCurrentDate = this._view.option("contouredDate") || this._view.option("date"); if (cell) { newCurrentDate = (0, _renderer.default)(cell).data("dxDateValueKey") } this._isOtherViewCellClicked = true; this.option("currentDate", newCurrentDate); this.option("zoomLevel", nextView); this._isOtherViewCellClicked = false; this._renderNavigator(); this._animateShowView(); this._moveToClosestAvailableDate(); this._setViewContoured(this._getNormalizedDate(this.option("currentDate"))) }, _renderNavigator() { if (!this._navigator) { this._navigator = new _m_calendar.default((0, _renderer.default)("
"), this._navigatorConfig()) } this._navigator.option("text", this._getViewsCaption(this._view, this._additionalView)); this._updateButtonsVisibility() }, _navigatorConfig() { const { focusStateEnabled: focusStateEnabled, rtlEnabled: rtlEnabled } = this.option(); return { text: this._getViewsCaption(this._view, this._additionalView), onClick: this._navigatorClickHandler.bind(this), onCaptionClick: this._navigateUp.bind(this), focusStateEnabled: focusStateEnabled, rtlEnabled: rtlEnabled, tabIndex: void 0 } }, _navigatorClickHandler(e) { const { currentDate: currentDate, viewsCount: viewsCount } = this.option(); let offset = e.direction; if (viewsCount > 1) { const additionalViewActive = this._isAdditionalViewDate(currentDate); const shouldDoubleOffset = additionalViewActive && offset < 0 || !additionalViewActive && offset > 0; if (shouldDoubleOffset) { offset *= 2 } } const newCurrentDate = this._getDateByOffset(offset, currentDate); this._moveToClosestAvailableDate(newCurrentDate) }, _navigateUp() { const zoomLevel = this.option("zoomLevel"); const nextView = _date.default.getViewUp(zoomLevel); if (!nextView || this._isMinZoomLevel(zoomLevel)) { return } this.option("zoomLevel", nextView); this._renderNavigator(); this._animateShowView(); this._moveToClosestAvailableDate(); this._setViewContoured(this._getNormalizedDate(this.option("currentDate"))) }, _isMinZoomLevel(zoomLevel) { const min = this._getMinDate(); const max = this._getMaxDate(); return _date.default.sameView(zoomLevel, min, max) || this.option("minZoomLevel") === zoomLevel }, _updateButtonsVisibility() { this._navigator.toggleButton("next", !(0, _type.isDefined)(this._afterView)); this._navigator.toggleButton("prev", !(0, _type.isDefined)(this._beforeView)) }, _renderSwipeable() { if (!this._swipeable) { this._swipeable = this._createComponent(this.$element(), _swipeable.default, { onStart: this._swipeStartHandler.bind(this), onUpdated: this._swipeUpdateHandler.bind(this), onEnd: this._swipeEndHandler.bind(this), itemSizeFunc: this._viewWidth.bind(this) }) } }, _swipeStartHandler(e) { _fx.default.stop(this._$viewsWrapper, true); const { viewsCount: viewsCount } = this.option(); this._toggleGestureCoverCursor("grabbing"); e.event.maxLeftOffset = this._getRequiredView("next") ? 1 / viewsCount : 0; e.event.maxRightOffset = this._getRequiredView("prev") ? 1 / viewsCount : 0 }, _toggleGestureCoverCursor(cursor) { (0, _renderer.default)(".dx-gesture-cover").css("cursor", cursor) }, _getRequiredView(name) { let view; const isRtl = this.option("rtlEnabled"); if ("next" === name) { view = isRtl ? this._beforeView : this._afterView } else if ("prev" === name) { view = isRtl ? this._afterView : this._beforeView } return view }, _swipeUpdateHandler(e) { const { offset: offset } = e.event; (0, _translator.move)(this._$viewsWrapper, { left: offset * this._viewWidth(), top: 0 }); this._updateNavigatorCaption(offset) }, _swipeEndHandler(e) { this._toggleGestureCoverCursor("auto"); const { currentDate: currentDate, rtlEnabled: rtlEnabled } = this.option(); const { targetOffset: targetOffset } = e.event; const moveOffset = !targetOffset ? 0 : targetOffset / Math.abs(targetOffset); const isAdditionalViewActive = this._isAdditionalViewDate(currentDate); const shouldDoubleOffset = isAdditionalViewActive && (rtlEnabled ? -1 === moveOffset : 1 === moveOffset); if (0 === moveOffset) { this._animateWrapper(0, 250); return } const offset = -moveOffset * this._getRtlCorrection() * (shouldDoubleOffset ? 2 : 1); let date = this._getDateByOffset(offset); if (this._isDateInInvalidRange(date)) { if (moveOffset >= 0) { date = new Date(this._getMinDate()) } else { date = new Date(this._getMaxDate()) } } this.option("currentDate", date) }, _viewWidth() { if (!this._viewWidthValue) { this._viewWidthValue = (0, _size.getWidth)(this.$element()) / this.option("viewsCount") } return this._viewWidthValue }, _updateNavigatorCaption(offset) { offset *= this._getRtlCorrection(); const isMultiView = this.option("viewsCount") > 1; let view; let additionalView; if (offset > .5 && this._beforeView) { view = this._beforeView; additionalView = isMultiView && this._view } else if (offset < -.5 && this._afterView) { view = isMultiView ? this._additionalView : this._afterView; additionalView = isMultiView ? this._afterView : null } else { view = this._view; additionalView = isMultiView ? this._additionalView : null } this._navigator.option("text", this._getViewsCaption(view, additionalView)) }, _getViewsCaption(view, additionalView) { let caption = view.getNavigatorCaption(); const { viewsCount: viewsCount } = this.option(); if (viewsCount > 1 && additionalView) { const additionalViewCaption = additionalView.getNavigatorCaption(); caption = `${caption} - ${additionalViewCaption}` } return caption }, _isDateInInvalidRange(date) { if (this._view.isBoundary(date)) { return } const min = this._getMinDate(); const max = this._getMaxDate(); const normalizedDate = _date.default.normalizeDate(date, min, max); return normalizedDate === min || normalizedDate === max }, _renderFooter() { const showTodayButton = this.option("showTodayButton"); if (showTodayButton) { const $todayButton = this._createComponent((0, _renderer.default)("
"), _button.default, { focusStateEnabled: this.option("focusStateEnabled"), text: _message.default.format("dxCalendar-todayButtonText"), onClick: args => { this._toTodayView(args) }, type: (0, _themes.isFluent)() ? "normal" : "default", stylingMode: (0, _themes.isFluent)() ? "outlined" : "text", integrationOptions: {} }).$element().addClass("dx-calendar-today-button"); this._$footer = (0, _renderer.default)("
").addClass("dx-calendar-footer").append($todayButton); this.$element().append(this._$footer) } this.$element().toggleClass("dx-calendar-with-footer", showTodayButton) }, _renderSubmitElement() { this._$submitElement = (0, _renderer.default)("").attr("type", "hidden").appendTo(this.$element()); this._setSubmitValue(this.option("value")) }, _setSubmitValue(value) { const dateValue = this._convertToDate(value); this._getSubmitElement().val(_date_serialization.default.serializeDate(dateValue, "yyyy-MM-dd")) }, _getSubmitElement() { return this._$submitElement }, _animateShowView() { _fx.default.stop(this._view.$element(), true); this._popAnimationView(this._view, .6, 1, 250); if (this.option("viewsCount") > 1) { _fx.default.stop(this._additionalView.$element(), true); this._popAnimationView(this._additionalView, .6, 1, 250) } }, _popAnimationView: (view, from, to, duration) => _fx.default.animate(view.$element(), { type: "pop", from: { scale: from, opacity: from }, to: { scale: to, opacity: to }, duration: duration }), _navigate(offset, value) { if (0 !== offset && 1 !== Math.abs(offset) && this._isViewAvailable(value)) { const newView = this._renderSpecificView(value); if (offset > 0) { this._afterView && this._afterView.$element().remove(); this._afterView = newView } else { this._beforeView && this._beforeView.$element().remove(); this._beforeView = newView } this._translateViews() } const rtlCorrection = this._getRtlCorrection(); const offsetSign = offset > 0 ? 1 : offset < 0 ? -1 : 0; const endPosition = -rtlCorrection * offsetSign * this._viewWidth(); const viewsWrapperPosition = this._$viewsWrapper.position().left; if (viewsWrapperPosition !== endPosition) { if (this._preventViewChangeAnimation) { this._wrapperAnimationEndHandler(offset, value) } else { this._animateWrapper(endPosition, 250).done(this._wrapperAnimationEndHandler.bind(this, offset, value)) } } }, _animateWrapper(to, duration) { return _fx.default.animate(this._$viewsWrapper, { type: "slide", from: { left: this._$viewsWrapper.position().left }, to: { left: to }, duration: duration }) }, _getDate: value => new Date(value), _toTodayView(args) { const today = new Date; if (this._isMaxZoomLevel()) { this._selectionStrategy.selectValue(today, args.event); return } this._preventViewChangeAnimation = true; this.option("zoomLevel", this.option("maxZoomLevel")); this._selectionStrategy.selectValue(today, args.event); this._animateShowView(); this._preventViewChangeAnimation = false }, _wrapperAnimationEndHandler(offset, newDate) { this._rearrangeViews(offset); this._translateViews(); this._resetLocation(); this._renderNavigator(); this._setViewContoured(newDate); this._updateAriaId(newDate); this._selectionStrategy.updateAriaSelected() }, _rearrangeViews(offset) { var _this$viewToRemoveKey; if (0 === offset) { return } const { viewsCount: viewsCount } = this.option(); let viewOffset; let viewToCreateKey; let viewToRemoveKey; let viewBeforeCreateKey; let viewAfterRemoveKey; if (offset < 0) { viewOffset = 1; viewToCreateKey = "_beforeView"; viewToRemoveKey = "_afterView"; viewBeforeCreateKey = "_view"; viewAfterRemoveKey = 1 === viewsCount ? "_view" : "_additionalView" } else { viewOffset = -1; viewToCreateKey = "_afterView"; viewToRemoveKey = "_beforeView"; viewBeforeCreateKey = 1 === viewsCount ? "_view" : "_additionalView"; viewAfterRemoveKey = "_view" } if (!this[viewToCreateKey]) { return } const destinationDate = this[viewToCreateKey].option("date"); null === (_this$viewToRemoveKey = this[viewToRemoveKey]) || void 0 === _this$viewToRemoveKey || _this$viewToRemoveKey.$element().remove(); this[viewToRemoveKey] = this._renderSpecificView(this._getDateByOffset(viewOffset * viewsCount, destinationDate)); this[viewAfterRemoveKey].$element().remove(); if (1 === viewsCount) { this[viewAfterRemoveKey] = this[viewToCreateKey] } else { this[viewAfterRemoveKey] = this[viewBeforeCreateKey]; this[viewBeforeCreateKey] = this[viewToCreateKey] } const dateByOffset = this._getDateByOffset(-viewOffset, destinationDate); this[viewToCreateKey] = this._isViewAvailable(dateByOffset) ? this._renderSpecificView(dateByOffset) : null }, _resetLocation() { (0, _translator.move)(this._$viewsWrapper, { left: 0, top: 0 }) }, _clean() { this.callBase(); this._clearViewWidthCache(); delete this._$viewsWrapper; delete this._navigator; delete this._$footer }, _clearViewWidthCache() { delete this._viewWidthValue }, _disposeViews() { this._view.$element().remove(); this._beforeView && this._beforeView.$element().remove(); this._additionalView && this._additionalView.$element().remove(); this._afterView && this._afterView.$element().remove(); delete this._view; delete this._additionalView; delete this._beforeView; delete this._afterView; delete this._skipNavigate }, _dispose() { clearTimeout(this._waitRenderViewTimeout); this.callBase() }, _refreshViews() { this._resetActiveState(); this._disposeViews(); this._renderViews() }, _visibilityChanged() { this._translateViews() }, _shouldSkipFocusEvent(event) { const { target: target, relatedTarget: relatedTarget } = event; return (0, _renderer.default)(target).parents(".dx-calendar").length && (0, _renderer.default)(relatedTarget).parents(".dx-calendar").length }, _focusInHandler(event) { if ((0, _renderer.default)(event.target).is(this._$viewsWrapper)) { this._setViewContoured(this.option("currentDate")) } if (this._shouldSkipFocusEvent(event)) { return } this.callBase.apply(this, arguments); this._toggleFocusClass(true, this.$element()) }, _focusOutHandler(event) { if ((0, _renderer.default)(event.target).is(this._$viewsWrapper)) { var _this$_additionalView2; this._view.option("contouredDate", null); null === (_this$_additionalView2 = this._additionalView) || void 0 === _this$_additionalView2 || _this$_additionalView2.option("contouredDate", null) } if (this._shouldSkipFocusEvent(event)) { return } this.callBase.apply(this, arguments); this._toggleFocusClass(false, this.$element()) }, _updateViewsOption(optionName, newValue) { var _this$_additionalView3, _this$_beforeView, _this$_afterView; this._view.option(optionName, newValue); null === (_this$_additionalView3 = this._additionalView) || void 0 === _this$_additionalView3 || _this$_additionalView3.option(optionName, newValue); null === (_this$_beforeView = this._beforeView) || void 0 === _this$_beforeView || _this$_beforeView.option(optionName, newValue); null === (_this$_afterView = this._afterView) || void 0 === _this$_afterView || _this$_afterView.option(optionName, newValue) }, _setViewsMinOption(min) { this._restoreViewsMinMaxOptions(); this.option("_rangeMin", this._convertToDate(min)); this._updateViewsOption("min", this._getMinDate()) }, _setViewsMaxOption(max) { this._restoreViewsMinMaxOptions(); this.option("_rangeMax", this._convertToDate(max)); this._updateViewsOption("max", this._getMaxDate()) }, _restoreViewsMinMaxOptions() { this._resetActiveState(); this.option({ _rangeMin: null, _rangeMax: null }); this._updateViewsOption("min", this._getMinDate()); this._updateViewsOption("max", this._getMaxDate()) }, _updateNavigatorLabels() { let zoomLevel = this.option("zoomLevel"); zoomLevel = zoomLevel.charAt(0).toUpperCase() + zoomLevel.slice(1); const captionButtonText = this._navigator._caption.option("text"); const localizedPrevButtonLabel = _message.default.format(`dxCalendar-previous${zoomLevel}ButtonLabel`); const localizedCaptionLabel = _message.default.format(`dxCalendar-caption${zoomLevel}Label`); const localizedNextButtonLabel = _message.default.format(`dxCalendar-next${zoomLevel}ButtonLabel`); this.setAria("label", localizedPrevButtonLabel, this._navigator._prevButton.$element()); this.setAria("label", `${captionButtonText}. ${localizedCaptionLabel}`, this._navigator._caption.$element()); this.setAria("label", localizedNextButtonLabel, this._navigator._nextButton.$element()) }, _updateAriaSelected(value, previousValue) { previousValue.forEach((item => { this.setAria("selected", false, this._view._getCellByDate(item)) })); value.forEach((item => { this.setAria("selected", true, this._view._getCellByDate(item)) })); if (this.option("viewsCount") > 1) { previousValue.forEach((item => { this.setAria("selected", false, this._additionalView._getCellByDate(item)) })); value.forEach((item => { this.setAria("selected", true, this._additionalView._getCellByDate(item)) })) } }, _updateAriaId(value) { value = value ?? this.option("currentDate"); const ariaId = `dx-${new _guid.default}`; const view = this._getActiveView(value); const $newCell = view._getCellByDate(value); this.setAria("id", ariaId, $newCell); this.setAria("activedescendant", ariaId); this._onContouredChanged(ariaId) }, _suppressingNavigation(callback, args) { this._suppressNavigation = true; callback.apply(this, args); delete this._suppressNavigation }, _optionChanged(args) { const { value: value, previousValue: previousValue } = args; switch (args.name) { case "width": this.callBase(args); this._clearViewWidthCache(); break; case "min": case "max": this.min = void 0; this.max = void 0; this._suppressingNavigation(this._updateCurrentDate, [this.option("currentDate")]); this._refreshViews(); this._renderNavigator(); break; case "selectionMode": this._refreshSelectionStrategy(); this._initCurrentDate(); break; case "selectWeekOnClick": case "_todayDate": case "showWeekNumbers": case "weekNumberRule": this._refreshViews(); break; case "firstDayOfWeek": this._refreshViews(); this._updateButtonsVisibility(); break; case "focusStateEnabled": case "disabledDates": case "dateSerializationFormat": case "cellTemplate": case "showTodayButton": this._invalidate(); break; case "currentDate": this.setAria("id", void 0, this._view._getCellByDate(previousValue)); this._updateCurrentDate(value); break; case "zoomLevel": this.$element().removeClass(`dx-calendar-view-${previousValue}`); this._correctZoomLevel(); this._refreshViews(); this._renderNavigator(); this._updateAriaId(); this._updateNavigatorLabels(); break; case "minZoomLevel": case "maxZoomLevel": this._correctZoomLevel(); this._updateButtonsVisibility(); break; case "value": this._selectionStrategy.processValueChanged(value, previousValue); this._setSubmitValue(value); this.callBase(args); break; case "viewsCount": this._refreshViews(); this._renderNavigator(); break; case "onCellClick": this._view.option("onCellClick", value); break; case "onContouredChanged": this._onContouredChanged = this._createActionByOption("onContouredChanged"); break; case "skipFocusCheck": break; default: this.callBase(args) } }, getContouredDate() { return this._view.option("contouredDate") } }); (0, _component_registrator.default)("dxCalendar", Calendar); exports.default = Calendar }, 37427: /*!**************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/ui/calendar/m_calendar.multiple.selection.strategy.js ***! \**************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _m_calendarSelection = (obj = __webpack_require__( /*! ./m_calendar.selection.strategy */ 49427), obj && obj.__esModule ? obj : { default: obj }); var obj; class CalendarMultiSelectionStrategy extends _m_calendarSelection.default { constructor(component) { super(component); this.NAME = "MultiSelection" } getViewOptions() { return { value: this.dateOption("value"), range: [], selectionMode: "multiple", onWeekNumberClick: this._shouldHandleWeekNumberClick() ? this._weekNumberClickHandler.bind(this) : null } } selectValue(selectedValue, e) { const value = [...this.dateOption("value")]; const alreadySelectedIndex = value.findIndex((date => (null === date || void 0 === date ? void 0 : date.toDateString()) === selectedValue.toDateString())); if (alreadySelectedIndex > -1) { value.splice(alreadySelectedIndex, 1) } else { value.push(selectedValue) } this.skipNavigate(); this._updateCurrentDate(selectedValue); this._currentDateChanged = true; this.dateValue(value, e) } updateAriaSelected(value, previousValue) { value ?? (value = this.dateOption("value")); previousValue ?? (previousValue = []); super.updateAriaSelected(value, previousValue) } getDefaultCurrentDate() { const dates = this.dateOption("value").filter((value => value)); return this._getLowestDateInArray(dates) } restoreValue() { this.calendar.option("value", []) } _weekNumberClickHandler(_ref) { let { rowDates: rowDates, event: event } = _ref; const selectedDates = rowDates.filter((date => !this._isDateDisabled(date))); this.dateValue(selectedDates, event) } } exports.default = CalendarMultiSelectionStrategy }, 35506: /*!********************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/ui/calendar/m_calendar.navigator.js ***! \********************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374)); var _button = _interopRequireDefault(__webpack_require__( /*! ../../../ui/button */ 63008)); var _themes = __webpack_require__( /*! ../../../ui/themes */ 75811); var _widget = _interopRequireDefault(__webpack_require__( /*! ../widget */ 79371)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } class Navigator extends _widget.default { _getDefaultOptions() { return _extends({}, super._getDefaultOptions(), { onClick: void 0, onCaptionClick: void 0, type: "normal", stylingMode: "outlined", text: "" }) } _defaultOptionsRules() { return super._defaultOptionsRules().concat([{ device: () => (0, _themes.isMaterial)(), options: { type: "default", stylingMode: "text" } }, { device: () => (0, _themes.isFluent)(), options: { type: "normal", stylingMode: "text" } }]) } _init() { super._init(); this._initActions() } _initActions() { this._clickAction = this._createActionByOption("onClick"); this._captionClickAction = this._createActionByOption("onCaptionClick") } _initMarkup() { super._initMarkup(); (0, _renderer.default)(this.element()).addClass("dx-calendar-navigator"); this._renderButtons(); this._renderCaption() } _renderButtons() { const { rtlEnabled: rtlEnabled, type: type, stylingMode: stylingMode, focusStateEnabled: focusStateEnabled } = this.option(); this._prevButton = this._createComponent((0, _renderer.default)("
"), _button.default, { focusStateEnabled: focusStateEnabled, icon: rtlEnabled ? "chevronright" : "chevronleft", onClick: e => { this._clickAction({ direction: -1, event: e }) }, type: type, stylingMode: stylingMode, integrationOptions: {} }); const $prevButton = (0, _renderer.default)(this._prevButton.element()).addClass("dx-calendar-navigator-previous-view").addClass("dx-calendar-navigator-previous-month"); this._nextButton = this._createComponent((0, _renderer.default)("
"), _button.default, { focusStateEnabled: focusStateEnabled, icon: rtlEnabled ? "chevronleft" : "chevronright", onClick: e => { this._clickAction({ direction: 1, event: e }) }, type: type, stylingMode: stylingMode, integrationOptions: {} }); const $nextButton = (0, _renderer.default)(this._nextButton.element()).addClass("dx-calendar-navigator-next-view").addClass("dx-calendar-navigator-next-month"); this._caption = this._createComponent((0, _renderer.default)("
").addClass("dx-calendar-caption-button"), _button.default, { focusStateEnabled: focusStateEnabled, onClick: e => { this._captionClickAction({ event: e }) }, type: type, stylingMode: stylingMode, template: (_, content) => { const { text: text } = this.option(); const viewCaptionTexts = text.split(" - "); viewCaptionTexts.forEach((captionText => { (0, _renderer.default)(content).append((0, _renderer.default)("").addClass("dx-button-text").text(captionText)) })) }, integrationOptions: {} }); const $caption = this._caption.$element(); this.$element().append($prevButton, $caption, $nextButton) } _renderCaption() { var _this$_caption; null === (_this$_caption = this._caption) || void 0 === _this$_caption || _this$_caption.option("text", this.option("text")) } toggleButton(buttonPrefix, value) { const buttonName = `_${buttonPrefix}Button`; const button = this[buttonName]; if (button) { button.option("disabled", value); button.$element().toggleClass("dx-calendar-disabled-navigator-link", value) } } _optionChanged(args) { if ("text" === args.name) { this._renderCaption() } else { super._optionChanged(args) } } } exports.default = Navigator }, 96218: /*!***********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/ui/calendar/m_calendar.range.selection.strategy.js ***! \***********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198)); var _m_calendarSelection = _interopRequireDefault(__webpack_require__( /*! ./m_calendar.selection.strategy */ 49427)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } class CalendarRangeSelectionStrategy extends _m_calendarSelection.default { constructor(component) { super(component); this.NAME = "RangeSelection" } getViewOptions() { const value = this._getValue(); const range = this._getDaysInRange(value[0], value[1]); return { value: value, range: range, selectionMode: "range", onCellHover: this._cellHoverHandler.bind(this), onWeekNumberClick: this._shouldHandleWeekNumberClick() ? this._weekNumberClickHandler.bind(this) : null } } selectValue(selectedValue, e) { const [startDate, endDate] = this._getValue(); this.skipNavigate(); this._updateCurrentDate(selectedValue); this._currentDateChanged = true; if (true === this.calendar.option("_allowChangeSelectionOrder")) { this.calendar._valueSelected = true; if ("startDate" === this.calendar.option("_currentSelection")) { if (this.calendar._convertToDate(selectedValue) > this.calendar._convertToDate(endDate)) { this.dateValue([selectedValue, null], e) } else { this.dateValue([selectedValue, endDate], e) } } else if (this.calendar._convertToDate(selectedValue) >= this.calendar._convertToDate(startDate)) { this.dateValue([startDate, selectedValue], e) } else { this.dateValue([selectedValue, null], e) } } else if (!startDate || endDate) { this.dateValue([selectedValue, null], e) } else { this.dateValue(startDate < selectedValue ? [startDate, selectedValue] : [selectedValue, startDate], e) } } updateAriaSelected(value, previousValue) { value ?? (value = this._getValue()); previousValue ?? (previousValue = []); super.updateAriaSelected(value, previousValue) } processValueChanged(value, previousValue) { super.processValueChanged(value, previousValue); const range = this._getRange(); this._updateViewsOption("range", range) } getDefaultCurrentDate() { const { _allowChangeSelectionOrder: _allowChangeSelectionOrder, _currentSelection: _currentSelection } = this.calendar.option(); const value = this.dateOption("value"); if (_allowChangeSelectionOrder) { if ("startDate" === _currentSelection && value[0]) { return value[0] } if ("endDate" === _currentSelection && value[1]) { return value[1] } } const dates = value.filter((value => value)); return this._getLowestDateInArray(dates) } restoreValue() { this.calendar.option("value", [null, null]) } _getValue() { const value = this.dateOption("value"); if (!value.length) { return value } let [startDate, endDate] = value; if (startDate && endDate && startDate > endDate) { [startDate, endDate] = [endDate, startDate] } return [startDate, endDate] } _getRange() { const [startDate, endDate] = this._getValue(); return this._getDaysInRange(startDate, endDate) } _getDaysInRange(startDate, endDate) { if (!startDate || !endDate) { return [] } const { currentDate: currentDate, viewsCount: viewsCount } = this.calendar.option(); const isAdditionalViewDate = this.calendar._isAdditionalViewDate(currentDate); const firstDateInViews = _date.default.getFirstMonthDate(_date.default.addDateInterval(currentDate, "month", isAdditionalViewDate ? -2 : -1)); const lastDateInViews = _date.default.getLastMonthDate(_date.default.addDateInterval(currentDate, "month", isAdditionalViewDate ? 1 : viewsCount)); const rangeStartDate = new Date(Math.max(firstDateInViews, startDate)); const rangeEndDate = new Date(Math.min(lastDateInViews, endDate)); return [..._date.default.getDatesOfInterval(rangeStartDate, rangeEndDate, 864e5), rangeEndDate] } _cellHoverHandler(e) { const isMaxZoomLevel = this._isMaxZoomLevel(); const [startDate, endDate] = this._getValue(); const { _allowChangeSelectionOrder: _allowChangeSelectionOrder, _currentSelection: _currentSelection } = this.calendar.option(); if (isMaxZoomLevel) { const skipHoveredRange = _allowChangeSelectionOrder && "startDate" === _currentSelection; if (startDate && !endDate && !skipHoveredRange) { if (e.value > startDate) { this._updateViewsOption("hoveredRange", this._getDaysInRange(startDate, e.value)); return } } else if (!startDate && endDate && !(_allowChangeSelectionOrder && "endDate" === _currentSelection)) { if (e.value < endDate) { this._updateViewsOption("hoveredRange", this._getDaysInRange(e.value, endDate)); return } } else if (startDate && endDate) { if ("startDate" === _currentSelection && e.value < startDate) { this._updateViewsOption("hoveredRange", this._getDaysInRange(e.value, startDate)); return } if ("endDate" === _currentSelection && e.value > endDate) { this._updateViewsOption("hoveredRange", this._getDaysInRange(endDate, e.value)); return } } this._updateViewsOption("hoveredRange", []) } } _weekNumberClickHandler(_ref) { let { rowDates: rowDates, event: event } = _ref; const selectedDates = rowDates.filter((date => !this._isDateDisabled(date))); const value = selectedDates.length ? [selectedDates[0], selectedDates[selectedDates.length - 1]] : [null, null]; this.dateValue(value, event) } } exports.default = CalendarRangeSelectionStrategy }, 49427: /*!*****************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/ui/calendar/m_calendar.selection.strategy.js ***! \*****************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _date = (obj = __webpack_require__( /*! ../../../core/utils/date */ 91198), obj && obj.__esModule ? obj : { default: obj }); var obj; var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922); exports.default = class { constructor(component) { this.calendar = component } dateOption(optionName) { return this.calendar._dateOption(optionName) } dateValue(value, e) { this.calendar._dateValue(value, e) } skipNavigate() { this.calendar._skipNavigate = true } updateAriaSelected(value, previousValue) { this.calendar._updateAriaSelected(value, previousValue); if (value[0] && this.calendar.option("currentDate").getTime() === value[0].getTime()) { this.calendar._updateAriaId(value[0]) } } processValueChanged(value, previousValue) { var _value, _previousValue; if ((0, _type.isDefined)(value) && !Array.isArray(value)) { value = [value] } if ((0, _type.isDefined)(previousValue) && !Array.isArray(previousValue)) { previousValue = [previousValue] } value = (null === (_value = value) || void 0 === _value ? void 0 : _value.map((item => this._convertToDate(item)))) || []; previousValue = (null === (_previousValue = previousValue) || void 0 === _previousValue ? void 0 : _previousValue.map((item => this._convertToDate(item)))) || []; this._updateViewsValue(value); this.updateAriaSelected(value, previousValue); if (!this._currentDateChanged) { this.calendar._initCurrentDate() } this._currentDateChanged = false } _isDateDisabled(date) { const min = this.calendar._dateOption("min"); const max = this.calendar._dateOption("max"); const isLessThanMin = (0, _type.isDefined)(min) && date < min && !_date.default.sameDate(min, date); const isBiggerThanMax = (0, _type.isDefined)(max) && date > max && !_date.default.sameDate(max, date); return this.calendar._view.isDateDisabled(date) || isLessThanMin || isBiggerThanMax } _getLowestDateInArray(dates) { if (dates.length) { return new Date(Math.min(...dates)) } } _convertToDate(value) { return this.calendar._convertToDate(value) } _isMaxZoomLevel() { return this.calendar._isMaxZoomLevel() } _updateViewsOption(optionName, optionValue) { this.calendar._updateViewsOption(optionName, optionValue) } _updateViewsValue(value) { this._updateViewsOption("value", value) } _updateCurrentDate(value) { this.calendar.option("currentDate", value ?? new Date) } _shouldHandleWeekNumberClick() { const { selectionMode: selectionMode, selectWeekOnClick: selectWeekOnClick } = this.calendar.option(); return selectWeekOnClick && "single" !== selectionMode } } }, 99324: /*!************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/ui/calendar/m_calendar.single.selection.strategy.js ***! \************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _m_calendarSelection = (obj = __webpack_require__( /*! ./m_calendar.selection.strategy */ 49427), obj && obj.__esModule ? obj : { default: obj }); var obj; class CalendarSingleSelectionStrategy extends _m_calendarSelection.default { constructor(component) { super(component); this.NAME = "SingleSelection" } getViewOptions() { return { value: this.dateOption("value"), range: [], selectionMode: "single" } } selectValue(selectedValue, e) { this.skipNavigate(); this.dateValue(selectedValue, e) } updateAriaSelected(value, previousValue) { value ?? (value = [this.dateOption("value")]); previousValue ?? (previousValue = []); super.updateAriaSelected(value, previousValue) } getDefaultCurrentDate() { return this.dateOption("value") } restoreValue() { this.calendar.option("value", null) } _updateViewsValue(value) { this._updateViewsOption("value", value[0]) } } exports.default = CalendarSingleSelectionStrategy }, 48928: /*!****************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/ui/calendar/m_calendar.views.js ***! \****************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../core/dom_adapter */ 73349)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374)); var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576); var _date = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date */ 91198)); var _date_serialization = _interopRequireDefault(__webpack_require__( /*! ../../../core/utils/date_serialization */ 69434)); var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306); var _date2 = _interopRequireDefault(__webpack_require__( /*! ../../../localization/date */ 91500)); var _m_calendar = _interopRequireDefault(__webpack_require__( /*! ./m_calendar.base_view */ 69505)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const Views = { month: _m_calendar.default.inherit({ _getViewName: () => "month", _getCurrentDateFormat: () => "longdate", _getDefaultOptions() { return (0, _extend.extend)(this.callBase(), { firstDayOfWeek: 0, rowCount: 6, colCount: 7 }) }, _renderImpl() { this.callBase(); this._renderHeader() }, _renderBody() { this.callBase(); this._$table.find(".dx-calendar-other-view").addClass("dx-calendar-other-month") }, _renderFocusTarget: _common.noop, _renderHeader() { const $headerRow = (0, _renderer.default)("
"); const $header = (0, _renderer.default)("").append($headerRow); this._$table.prepend($header); for (let colIndex = 0, colCount = this.option("colCount"); colIndex < colCount; colIndex++) { this._renderHeaderCell(colIndex, $headerRow) } if (this.option("showWeekNumbers")) { this._renderWeekHeaderCell($headerRow) } }, _renderHeaderCell(cellIndex, $headerRow) { const { firstDayOfWeek: firstDayOfWeek } = this.option(); const { full: fullCaption, abbreviated: abbrCaption } = this._getDayCaption(firstDayOfWeek + cellIndex); const $cell = (0, _renderer.default)("
").attr({ scope: "col", abbr: fullCaption }).text(abbrCaption); $headerRow.append($cell) }, _renderWeekHeaderCell($headerRow) { const $weekNumberHeaderCell = (0, _renderer.default)("").attr({ scope: "col", abbr: "WeekNumber", class: "dx-week-number-header" }); $headerRow.prepend($weekNumberHeaderCell) }, _renderWeekNumberCell(rowData) { const { showWeekNumbers: showWeekNumbers, cellTemplate: cellTemplate, selectionMode: selectionMode, selectWeekOnClick: selectWeekOnClick } = this.option(); if (!showWeekNumbers) { return } const weekNumber = this._getWeekNumber(rowData.prevCellDate); const cell = _dom_adapter.default.createElement("td"); const $cell = (0, _renderer.default)(cell); cell.className = "dx-calendar-week-number-cell"; if ("single" !== selectionMode && selectWeekOnClick) { $cell.addClass("dx-calendar-week-selection") } if (cellTemplate) { cellTemplate.render(this._prepareCellTemplateData(weekNumber, -1, $cell)) } else { cell.innerHTML = weekNumber } rowData.row.prepend(cell); this.setAria({ role: "gridcell", label: `Week ${weekNumber}` }, $cell) }, _getWeekNumber(date) { const { weekNumberRule: weekNumberRule, firstDayOfWeek: firstDayOfWeek } = this.option(); if ("auto" === weekNumberRule) { return _date.default.getWeekNumber(date, firstDayOfWeek, 1 === firstDayOfWeek ? "firstFourDays" : "firstDay") } return _date.default.getWeekNumber(date, firstDayOfWeek, weekNumberRule) }, getNavigatorCaption() { return _date2.default.format(this.option("date"), "monthandyear") }, _isTodayCell(cellDate) { const today = this.option("_todayDate")(); return _date.default.sameDate(cellDate, today) }, _isDateOutOfRange(cellDate) { const minDate = this.option("min"); const maxDate = this.option("max"); return !_date.default.dateInRange(cellDate, minDate, maxDate, "date") }, _isOtherView(cellDate) { return cellDate.getMonth() !== this.option("date").getMonth() }, _isStartDayOfMonth(cellDate) { return _date.default.sameDate(cellDate, _date.default.getFirstMonthDate(this.option("date"))) }, _isEndDayOfMonth(cellDate) { return _date.default.sameDate(cellDate, _date.default.getLastMonthDate(this.option("date"))) }, _getCellText: cellDate => _date2.default.format(cellDate, "d"), _getDayCaption(day) { const daysInWeek = this.option("colCount"); const dayIndex = day % daysInWeek; return { full: _date2.default.getDayNames()[dayIndex], abbreviated: _date2.default.getDayNames("abbreviated")[dayIndex] } }, _getFirstCellData() { const { firstDayOfWeek: firstDayOfWeek } = this.option(); const firstDay = _date.default.getFirstMonthDate(this.option("date")); let firstMonthDayOffset = firstDayOfWeek - firstDay.getDay(); const daysInWeek = this.option("colCount"); if (firstMonthDayOffset >= 0) { firstMonthDayOffset -= daysInWeek } firstDay.setDate(firstDay.getDate() + firstMonthDayOffset); return firstDay }, _getNextCellData(date) { date = new Date(date); date.setDate(date.getDate() + 1); return date }, _getCellByDate(date) { return this._$table.find(`td[data-value='${_date_serialization.default.serializeDate(date,_date.default.getShortDateFormat())}']`) }, isBoundary(date) { return _date.default.sameMonthAndYear(date, this.option("min")) || _date.default.sameMonthAndYear(date, this.option("max")) }, _getDefaultDisabledDatesHandler: disabledDates => function(args) { const isDisabledDate = disabledDates.some((item => _date.default.sameDate(item, args.date))); if (isDisabledDate) { return true } } }), year: _m_calendar.default.inherit({ _getViewName: () => "year", _getCurrentDateFormat: () => "monthandyear", _isTodayCell(cellDate) { const today = this.option("_todayDate")(); return _date.default.sameMonthAndYear(cellDate, today) }, _isDateOutOfRange(cellDate) { return !_date.default.dateInRange(cellDate, _date.default.getFirstMonthDate(this.option("min")), _date.default.getLastMonthDate(this.option("max"))) }, _isOtherView: () => false, _isStartDayOfMonth: () => false, _isEndDayOfMonth: () => false, _getCellText: cellDate => _date2.default.getMonthNames("abbreviated")[cellDate.getMonth()], _getFirstCellData() { const currentDate = this.option("date"); const data = new Date(currentDate); data.setDate(1); data.setMonth(0); return data }, _getNextCellData(date) { date = new Date(date); date.setMonth(date.getMonth() + 1); return date }, _getCellByDate(date) { const foundDate = new Date(date); foundDate.setDate(1); return this._$table.find(`td[data-value='${_date_serialization.default.serializeDate(foundDate,_date.default.getShortDateFormat())}']`) }, getNavigatorCaption() { return _date2.default.format(this.option("date"), "yyyy") }, isBoundary(date) { return _date.default.sameYear(date, this.option("min")) || _date.default.sameYear(date, this.option("max")) }, _renderWeekNumberCell: _common.noop }), decade: _m_calendar.default.inherit({ _getViewName: () => "decade", _isTodayCell(cellDate) { const today = this.option("_todayDate")(); return _date.default.sameYear(cellDate, today) }, _isDateOutOfRange(cellDate) { const min = this.option("min"); const max = this.option("max"); return !_date.default.dateInRange(cellDate.getFullYear(), min && min.getFullYear(), max && max.getFullYear()) }, _isOtherView(cellDate) { const date = new Date(cellDate); date.setMonth(1); return !_date.default.sameDecade(date, this.option("date")) }, _isStartDayOfMonth: () => false, _isEndDayOfMonth: () => false, _getCellText: cellDate => _date2.default.format(cellDate, "yyyy"), _getFirstCellData() { const year = _date.default.getFirstYearInDecade(this.option("date")) - 1; return _date.default.createDateWithFullYear(year, 0, 1) }, _getNextCellData(date) { date = new Date(date); date.setFullYear(date.getFullYear() + 1); return date }, getNavigatorCaption() { const currentDate = this.option("date"); const firstYearInDecade = _date.default.getFirstYearInDecade(currentDate); const startDate = new Date(currentDate); const endDate = new Date(currentDate); startDate.setFullYear(firstYearInDecade); endDate.setFullYear(firstYearInDecade + 9); return `${_date2.default.format(startDate,"yyyy")}-${_date2.default.format(endDate,"yyyy")}` }, _isValueOnCurrentView: (currentDate, value) => _date.default.sameDecade(currentDate, value), _getCellByDate(date) { const foundDate = new Date(date); foundDate.setDate(1); foundDate.setMonth(0); return this._$table.find(`td[data-value='${_date_serialization.default.serializeDate(foundDate,_date.default.getShortDateFormat())}']`) }, isBoundary(date) { return _date.default.sameDecade(date, this.option("min")) || _date.default.sameDecade(date, this.option("max")) }, _renderWeekNumberCell: _common.noop }), century: _m_calendar.default.inherit({ _getViewName: () => "century", _isTodayCell(cellDate) { const today = this.option("_todayDate")(); return _date.default.sameDecade(cellDate, today) }, _isDateOutOfRange(cellDate) { const decade = _date.default.getFirstYearInDecade(cellDate); const minDecade = _date.default.getFirstYearInDecade(this.option("min")); const maxDecade = _date.default.getFirstYearInDecade(this.option("max")); return !_date.default.dateInRange(decade, minDecade, maxDecade) }, _isOtherView(cellDate) { const date = new Date(cellDate); date.setMonth(1); return !_date.default.sameCentury(date, this.option("date")) }, _isStartDayOfMonth: () => false, _isEndDayOfMonth: () => false, _getCellText(cellDate) { const startDate = _date2.default.format(cellDate, "yyyy"); const endDate = new Date(cellDate); endDate.setFullYear(endDate.getFullYear() + 9); return `${startDate} - ${_date2.default.format(endDate,"yyyy")}` }, _getFirstCellData() { const decade = _date.default.getFirstDecadeInCentury(this.option("date")) - 10; return _date.default.createDateWithFullYear(decade, 0, 1) }, _getNextCellData(date) { date = new Date(date); date.setFullYear(date.getFullYear() + 10); return date }, _getCellByDate(date) { const foundDate = new Date(date); foundDate.setDate(1); foundDate.setMonth(0); foundDate.setFullYear(_date.default.getFirstYearInDecade(foundDate)); return this._$table.find(`td[data-value='${_date_serialization.default.serializeDate(foundDate,_date.default.getShortDateFormat())}']`) }, getNavigatorCaption() { const currentDate = this.option("date"); const firstDecadeInCentury = _date.default.getFirstDecadeInCentury(currentDate); const startDate = new Date(currentDate); const endDate = new Date(currentDate); startDate.setFullYear(firstDecadeInCentury); endDate.setFullYear(firstDecadeInCentury + 99); return `${_date2.default.format(startDate,"yyyy")}-${_date2.default.format(endDate,"yyyy")}` }, isBoundary(date) { return _date.default.sameCentury(date, this.option("min")) || _date.default.sameCentury(date, this.option("max")) }, _renderWeekNumberCell: _common.noop }) }; exports.default = Views }, 12825: /*!*******************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/ui/collection/async.js ***! \*******************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _uiCollection_widget = _interopRequireDefault(__webpack_require__( /*! ../../../ui/collection/ui.collection_widget.async */ 25970)); _interopRequireDefault(__webpack_require__( /*! ./edit */ 48302)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const TypedCollectionWidget = _uiCollection_widget.default; exports.default = TypedCollectionWidget }, 24924: /*!******************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/ui/collection/base.js ***! \******************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _uiCollection_widget = _interopRequireDefault(__webpack_require__( /*! ../../../ui/collection/ui.collection_widget.base */ 19982)); _interopRequireDefault(__webpack_require__( /*! ../widget */ 79371)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const TypedCollectionWidget = _uiCollection_widget.default; exports.default = TypedCollectionWidget }, 48302: /*!******************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/ui/collection/edit.js ***! \******************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _uiCollection_widget = _interopRequireDefault(__webpack_require__( /*! ../../../ui/collection/ui.collection_widget.edit */ 11050)); _interopRequireDefault(__webpack_require__( /*! ./base */ 24924)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const TypedCollectionWidget = _uiCollection_widget.default; exports.default = TypedCollectionWidget }, 16200: /*!**************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/ui/collection/hierarchical.js ***! \**************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../ui/hierarchical_collection/ui.hierarchical_collection_widget */ 65810)); _interopRequireDefault(__webpack_require__( /*! ./edit */ 48302)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const TypedCollectionWidget = _ui.default; exports.default = TypedCollectionWidget }, 11803: /*!*************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/ui/collection/live_update.js ***! \*************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _uiCollection_widget = _interopRequireDefault(__webpack_require__( /*! ../../../ui/collection/ui.collection_widget.live_update */ 69010)); _interopRequireDefault(__webpack_require__( /*! ./edit */ 48302)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const TypedCollectionWidget = _uiCollection_widget.default; exports.default = TypedCollectionWidget }, 88895: /*!***************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/ui/collection/m_collection_widget.async.js ***! \***************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576); var _deferred = __webpack_require__( /*! ../../../core/utils/deferred */ 62754); var _m_collection_widget = (obj = __webpack_require__( /*! ./m_collection_widget.edit */ 61032), obj && obj.__esModule ? obj : { default: obj }); var obj; const AsyncCollectionWidget = _m_collection_widget.default.inherit({ _initMarkup() { this._deferredItems = []; this.callBase() }, _renderItemContent(args) { const renderContentDeferred = (0, _deferred.Deferred)(); const itemDeferred = (0, _deferred.Deferred)(); this._deferredItems[args.index] = itemDeferred; const $itemContent = this.callBase.call(this, args); itemDeferred.done((() => { renderContentDeferred.resolve($itemContent) })); return renderContentDeferred.promise() }, _onItemTemplateRendered(itemTemplate, renderArgs) { return () => { this._deferredItems[renderArgs.index].resolve() } }, _postProcessRenderItems: _common.noop, _renderItemsAsync() { const d = (0, _deferred.Deferred)(); _deferred.when.apply(this, this._deferredItems).done((() => { this._postProcessRenderItems(); d.resolve() })); return d.promise() }, _clean() { this.callBase(); this._deferredItems = [] } }); exports.default = AsyncCollectionWidget }, 75900: /*!**************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/ui/collection/m_collection_widget.base.js ***! \**************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _action = _interopRequireDefault(__webpack_require__( /*! ../../../core/action */ 62414)); var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../core/dom_adapter */ 73349)); var _element = __webpack_require__( /*! ../../../core/element */ 6415); var _guid = _interopRequireDefault(__webpack_require__( /*! ../../../core/guid */ 73176)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374)); var _bindable_template = __webpack_require__( /*! ../../../core/templates/bindable_template */ 93280); var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576); var _data = __webpack_require__( /*! ../../../core/utils/data */ 47617); var _deferred = __webpack_require__( /*! ../../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 95479); var _size = __webpack_require__( /*! ../../../core/utils/size */ 58664); var _template_manager = __webpack_require__( /*! ../../../core/utils/template_manager */ 69697); var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922); var _data_helper = _interopRequireDefault(__webpack_require__( /*! ../../../data_helper */ 53305)); var _click = __webpack_require__( /*! ../../../events/click */ 95429); var _contextmenu = __webpack_require__( /*! ../../../events/contextmenu */ 49166); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../events/core/events_engine */ 55994)); var _hold = _interopRequireDefault(__webpack_require__( /*! ../../../events/hold */ 11699)); var _pointer = _interopRequireDefault(__webpack_require__( /*! ../../../events/pointer */ 93786)); var _index = __webpack_require__( /*! ../../../events/utils/index */ 39611); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../localization/message */ 28109)); var _selectors = __webpack_require__( /*! ../../../ui/widget/selectors */ 31421); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../ui/widget/ui.widget */ 14390)); var _m_item = _interopRequireDefault(__webpack_require__( /*! ./m_item */ 1893)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target }; return _extends.apply(this, arguments) } const ITEM_CLASS = "dx-item"; const ITEM_PATH_REGEX = /^([^.]+\[\d+\]\.)+([\w.]+)$/; const CollectionWidget = _ui.default.inherit({ _activeStateUnit: `.${ITEM_CLASS}`, _supportedKeys() { const move = function(location, e) { if (!(0, _index.isCommandKeyPressed)(e)) { e.preventDefault(); e.stopPropagation(); this._moveFocus(location, e) } }; return (0, _extend.extend)(this.callBase(), { space: function(e) { e.preventDefault(); this._enterKeyHandler(e) }, enter: this._enterKeyHandler, leftArrow: move.bind(this, "left"), rightArrow: move.bind(this, "right"), upArrow: move.bind(this, "up"), downArrow: move.bind(this, "down"), pageUp: move.bind(this, "up"), pageDown: move.bind(this, "down"), home: move.bind(this, "first"), end: move.bind(this, "last") }) }, _enterKeyHandler(e) { const $itemElement = (0, _renderer.default)(this.option("focusedElement")); if (!$itemElement.length) { return } const itemData = this._getItemData($itemElement); if (null !== itemData && void 0 !== itemData && itemData.onClick) { this._itemEventHandlerByHandler($itemElement, itemData.onClick, { event: e }) } this._itemClickHandler((0, _extend.extend)({}, e, { target: $itemElement.get(0), currentTarget: $itemElement.get(0) })) }, _getDefaultOptions() { return (0, _extend.extend)(this.callBase(), { selectOnFocus: false, loopItemFocus: true, items: [], itemTemplate: "item", onItemRendered: null, onItemClick: null, onItemHold: null, itemHoldTimeout: 750, onItemContextMenu: null, onFocusedItemChanged: null, noDataText: _message.default.format("dxCollectionWidget-noDataText"), encodeNoDataText: false, dataSource: null, _dataController: null, _itemAttributes: {}, itemTemplateProperty: "template", focusOnSelectedItem: true, focusedElement: null, displayExpr: void 0, disabledExpr: data => data ? data.disabled : void 0, visibleExpr: data => data ? data.visible : void 0 }) }, _init() { this._compileDisplayGetter(); this._initDataController(); this.callBase(); this._cleanRenderedItems(); this._refreshDataSource() }, _compileDisplayGetter() { const displayExpr = this.option("displayExpr"); this._displayGetter = displayExpr ? (0, _data.compileGetter)(this.option("displayExpr")) : void 0 }, _initTemplates() { this._initItemsFromMarkup(); this._initDefaultItemTemplate(); this.callBase() }, _getAnonymousTemplateName: () => "item", _initDefaultItemTemplate() { const fieldsMap = this._getFieldsMap(); this._templateManager.addDefaultTemplates({ item: new _bindable_template.BindableTemplate((($container, data) => { if ((0, _type.isPlainObject)(data)) { this._prepareDefaultItemTemplate(data, $container) } else { if (fieldsMap && (0, _type.isFunction)(fieldsMap.text)) { data = fieldsMap.text(data) } $container.text(String((0, _common.ensureDefined)(data, ""))) } }), this._getBindableFields(), this.option("integrationOptions.watchMethod"), fieldsMap) }) }, _getBindableFields: () => ["text", "html"], _getFieldsMap() { if (this._displayGetter) { return { text: this._displayGetter } } }, _prepareDefaultItemTemplate(data, $container) { if ((0, _type.isDefined)(data.text)) { $container.text(data.text) } if ((0, _type.isDefined)(data.html)) { $container.html(data.html) } }, _initItemsFromMarkup() { const rawItems = (0, _template_manager.findTemplates)(this.$element(), "dxItem"); if (!rawItems.length || this.option("items").length) { return } const items = rawItems.map((_ref => { let { element: element, options: options } = _ref; const isTemplateRequired = /\S/.test(element.innerHTML) && !options.template; if (isTemplateRequired) { options.template = this._prepareItemTemplate(element) } else { (0, _renderer.default)(element).remove() } return options })); this.option("items", items) }, _prepareItemTemplate(item) { const templateId = "tmpl-" + new _guid.default; const $template = (0, _renderer.default)(item).detach().clone().removeAttr("data-options").addClass("dx-template-wrapper"); this._saveTemplate(templateId, $template); return templateId }, _dataSourceOptions: () => ({ paginate: false }), _cleanRenderedItems() { this._renderedItemsCount = 0 }, _focusTarget() { return this.$element() }, _focusInHandler(e) { this.callBase.apply(this, arguments); if (!this._isFocusTarget(e.target)) { return } const $focusedElement = (0, _renderer.default)(this.option("focusedElement")); if ($focusedElement.length) { this._setFocusedItem($focusedElement) } else { const $activeItem = this._getActiveItem(); if ($activeItem.length) { this.option("focusedElement", (0, _element.getPublicElement)($activeItem)) } } }, _focusOutHandler() { this.callBase.apply(this, arguments); const $target = (0, _renderer.default)(this.option("focusedElement")); this._updateFocusedItemState($target, false) }, _findActiveTarget($element) { return $element.find(this._activeStateUnit) }, _getActiveItem(last) { const $focusedElement = (0, _renderer.default)(this.option("focusedElement")); if ($focusedElement.length) { return $focusedElement } let index = this.option("focusOnSelectedItem") ? this.option("selectedIndex") : 0; const activeElements = this._getActiveElement(); const lastIndex = activeElements.length - 1; if (index < 0) { index = last ? lastIndex : 0 } return activeElements.eq(index) }, _moveFocus(location) { const $items = this._getAvailableItems(); let $newTarget; switch (location) { case "pageup": case "up": $newTarget = this._prevItem($items); break; case "pagedown": case "down": $newTarget = this._nextItem($items); break; case "right": $newTarget = this.option("rtlEnabled") ? this._prevItem($items) : this._nextItem($items); break; case "left": $newTarget = this.option("rtlEnabled") ? this._nextItem($items) : this._prevItem($items); break; case "first": $newTarget = $items.first(); break; case "last": $newTarget = $items.last(); break; default: return false } if (0 !== $newTarget.length) { this.option("focusedElement", (0, _element.getPublicElement)($newTarget)) } }, _getVisibleItems($itemElements) { $itemElements = $itemElements || this._itemElements(); return $itemElements.filter(":visible") }, _getAvailableItems($itemElements) { return this._getVisibleItems($itemElements) }, _prevItem($items) { const $target = this._getActiveItem(); const targetIndex = $items.index($target); const $last = $items.last(); let $item = (0, _renderer.default)($items[targetIndex - 1]); const loop = this.option("loopItemFocus"); if (0 === $item.length && loop) { $item = $last } return $item }, _nextItem($items) { const $target = this._getActiveItem(true); const targetIndex = $items.index($target); const $first = $items.first(); let $item = (0, _renderer.default)($items[targetIndex + 1]); const loop = this.option("loopItemFocus"); if (0 === $item.length && loop) { $item = $first } return $item }, _selectFocusedItem($target) { this.selectItem($target) }, _updateFocusedItemState(target, isFocused, needCleanItemId) { const $target = (0, _renderer.default)(target); if ($target.length) { this._refreshActiveDescendant(); this._refreshItemId($target, needCleanItemId); this._toggleFocusClass(isFocused, $target) } this._updateParentActiveDescendant() }, _refreshActiveDescendant($target) { this.setAria("activedescendant", (0, _type.isDefined)(this.option("focusedElement")) ? this.getFocusedItemId() : null, $target) }, _refreshItemId($target, needCleanItemId) { if (!needCleanItemId && this.option("focusedElement")) { this.setAria("id", this.getFocusedItemId(), $target) } else { this.setAria("id", null, $target) } }, _isDisabled: $element => $element && "true" === (0, _renderer.default)($element).attr("aria-disabled"), _setFocusedItem($target) { if (!$target || !$target.length) { return } this._updateFocusedItemState($target, true); this.onFocusedItemChanged(this.getFocusedItemId()); const { selectOnFocus: selectOnFocus } = this.option(); const isTargetDisabled = this._isDisabled($target); if (selectOnFocus && !isTargetDisabled) { this._selectFocusedItem($target) } }, _findItemElementByItem(item) { let result = (0, _renderer.default)(); const that = this; this.itemElements().each((function() { const $item = (0, _renderer.default)(this); if ($item.data(that._itemDataKey()) === item) { result = $item; return false } })); return result }, _getIndexByItem(item) { return this.option("items").indexOf(item) }, _itemOptionChanged(item, property, value, oldValue) { const $item = this._findItemElementByItem(item); if (!$item.length) { return } if (!this.constructor.ItemClass.getInstance($item).setDataField(property, value)) { this._refreshItem($item, item) } const isDisabling = "disabled" === property && value; if (isDisabling) { this._resetItemFocus($item) } }, _resetItemFocus($item) { if ($item.is(this.option("focusedElement"))) { this.option("focusedElement", null) } }, _refreshItem($item) { const itemData = this._getItemData($item); const index = $item.data(this._itemIndexKey()); this._renderItem(this._renderedItemsCount + index, itemData, null, $item) }, _updateParentActiveDescendant: _common.noop, _optionChanged(args) { if ("items" === args.name) { const matches = args.fullName.match(ITEM_PATH_REGEX); if (matches && matches.length) { const property = matches[matches.length - 1]; const itemPath = args.fullName.replace(`.${property}`, ""); const item = this.option(itemPath); this._itemOptionChanged(item, property, args.value, args.previousValue); return } } switch (args.name) { case "items": case "_itemAttributes": case "itemTemplateProperty": case "useItemTextAsTitle": this._cleanRenderedItems(); this._invalidate(); break; case "dataSource": this._refreshDataSource(); this._renderEmptyMessage(); break; case "noDataText": case "encodeNoDataText": this._renderEmptyMessage(); break; case "itemTemplate": case "visibleExpr": case "disabledExpr": this._invalidate(); break; case "onItemRendered": this._createItemRenderAction(); break; case "onItemClick": case "selectOnFocus": case "loopItemFocus": case "focusOnSelectedItem": break; case "onItemHold": case "itemHoldTimeout": this._attachHoldEvent(); break; case "onItemContextMenu": this._attachContextMenuEvent(); break; case "onFocusedItemChanged": this.onFocusedItemChanged = this._createActionByOption("onFocusedItemChanged"); break; case "focusedElement": this._updateFocusedItemState(args.previousValue, false, true); this._setFocusedItem((0, _renderer.default)(args.value)); break; case "displayExpr": this._compileDisplayGetter(); this._initDefaultItemTemplate(); this._invalidate(); break; default: this.callBase(args) } }, _invalidate() { this.option("focusedElement", null); return this.callBase.apply(this, arguments) }, _loadNextPage() { this._expectNextPageLoading(); return this._dataController.loadNextPage() }, _expectNextPageLoading() { this._startIndexForAppendedItems = 0 }, _expectLastItemLoading() { this._startIndexForAppendedItems = -1 }, _forgetNextPageLoading() { this._startIndexForAppendedItems = null }, _dataSourceChangedHandler(newItems) { const items = this.option("items"); if (this._initialized && items && this._shouldAppendItems()) { this._renderedItemsCount = items.length; if (!this._isLastPage() || -1 !== this._startIndexForAppendedItems) { this.option().items = items.concat(newItems.slice(this._startIndexForAppendedItems)) } this._forgetNextPageLoading(); this._refreshContent() } else { this.option("items", newItems.slice()) } }, _refreshContent() { this._prepareContent(); this._renderContent() }, _dataSourceLoadErrorHandler() { this._forgetNextPageLoading(); this.option("items", this.option("items")) }, _shouldAppendItems() { return null != this._startIndexForAppendedItems && this._allowDynamicItemsAppend() }, _allowDynamicItemsAppend: () => false, _clean() { this._cleanFocusState(); this._cleanItemContainer(); this._inkRipple && delete this._inkRipple; this._resetActiveState() }, _cleanItemContainer() { (0, _renderer.default)(this._itemContainer()).empty() }, _dispose() { this.callBase(); clearTimeout(this._itemFocusTimeout) }, _refresh() { this._cleanRenderedItems(); this.callBase.apply(this, arguments) }, _itemContainer() { return this.$element() }, _itemClass: () => ITEM_CLASS, _itemContentClass() { return this._itemClass() + "-content" }, _selectedItemClass: () => "dx-item-selected", _itemResponseWaitClass: () => "dx-item-response-wait", _itemSelector() { return `.${this._itemClass()}` }, _itemDataKey: () => "dxItemData", _itemIndexKey: () => "dxItemIndex", _itemElements() { return this._itemContainer().find(this._itemSelector()) }, _initMarkup() { this.callBase(); this.onFocusedItemChanged = this._createActionByOption("onFocusedItemChanged"); this.$element().addClass("dx-collection"); this._prepareContent() }, _prepareContent: (0, _common.deferRenderer)((function() { this._renderContentImpl() })), _renderContent() { this._fireContentReadyAction() }, _render() { this.callBase(); this._attachClickEvent(); this._attachHoldEvent(); this._attachContextMenuEvent() }, _getPointerEvent: () => _pointer.default.down, _attachClickEvent() { const itemSelector = this._itemSelector(); const pointerEvent = this._getPointerEvent(); const clickEventNamespace = (0, _index.addNamespace)(_click.name, this.NAME); const pointerEventNamespace = (0, _index.addNamespace)(pointerEvent, this.NAME); const pointerAction = new _action.default((args => { const { event: event } = args; this._itemPointerDownHandler(event) })); _events_engine.default.off(this._itemContainer(), clickEventNamespace, itemSelector); _events_engine.default.off(this._itemContainer(), pointerEventNamespace, itemSelector); _events_engine.default.on(this._itemContainer(), clickEventNamespace, itemSelector, (e => this._itemClickHandler(e))); _events_engine.default.on(this._itemContainer(), pointerEventNamespace, itemSelector, (e => { pointerAction.execute({ element: (0, _renderer.default)(e.target), event: e }) })) }, _itemClickHandler(e, args, config) { this._itemDXEventHandler(e, "onItemClick", args, config) }, _itemPointerDownHandler(e) { if (!this.option("focusStateEnabled")) { return } this._itemFocusHandler = function() { clearTimeout(this._itemFocusTimeout); this._itemFocusHandler = null; if (e.isDefaultPrevented()) { return } const $target = (0, _renderer.default)(e.target); const $closestItem = $target.closest(this._itemElements()); const $closestFocusable = this._closestFocusable($target); if ($closestItem.length && this._isFocusTarget(null === $closestFocusable || void 0 === $closestFocusable ? void 0 : $closestFocusable.get(0))) { this.option("focusedElement", (0, _element.getPublicElement)($closestItem)) } }.bind(this); this._itemFocusTimeout = setTimeout(this._forcePointerDownFocus.bind(this)) }, _closestFocusable($target) { if ($target.is(_selectors.focusable)) { return $target } $target = $target.parent(); while ($target.length && !_dom_adapter.default.isDocument($target.get(0)) && !_dom_adapter.default.isDocumentFragment($target.get(0))) { if ($target.is(_selectors.focusable)) { return $target } $target = $target.parent() } }, _forcePointerDownFocus() { this._itemFocusHandler && this._itemFocusHandler() }, _updateFocusState() { this.callBase.apply(this, arguments); this._forcePointerDownFocus() }, _attachHoldEvent() { const $itemContainer = this._itemContainer(); const itemSelector = this._itemSelector(); const eventName = (0, _index.addNamespace)(_hold.default.name, this.NAME); _events_engine.default.off($itemContainer, eventName, itemSelector); _events_engine.default.on($itemContainer, eventName, itemSelector, { timeout: this._getHoldTimeout() }, this._itemHoldHandler.bind(this)) }, _getHoldTimeout() { return this.option("itemHoldTimeout") }, _shouldFireHoldEvent() { return this.hasActionSubscription("onItemHold") }, _itemHoldHandler(e) { if (this._shouldFireHoldEvent()) { this._itemDXEventHandler(e, "onItemHold") } else { e.cancel = true } }, _attachContextMenuEvent() { const $itemContainer = this._itemContainer(); const itemSelector = this._itemSelector(); const eventName = (0, _index.addNamespace)(_contextmenu.name, this.NAME); _events_engine.default.off($itemContainer, eventName, itemSelector); _events_engine.default.on($itemContainer, eventName, itemSelector, this._itemContextMenuHandler.bind(this)) }, _shouldFireContextMenuEvent() { return this.hasActionSubscription("onItemContextMenu") }, _itemContextMenuHandler(e) { if (this._shouldFireContextMenuEvent()) { this._itemDXEventHandler(e, "onItemContextMenu") } else { e.cancel = true } }, _renderContentImpl() { const items = this.option("items") || []; if (this._renderedItemsCount) { this._renderItems(items.slice(this._renderedItemsCount)) } else { this._renderItems(items) } }, _renderItems(items) { if (items.length) { (0, _iterator.each)(items, ((index, itemData) => { this._renderItem(this._renderedItemsCount + index, itemData) })) } this._renderEmptyMessage() }, _getItemsContainer() { return this._itemContainer() }, _setAttributes($element) { const attributes = _extends({}, this.option("_itemAttributes")); const { class: customClassValue } = attributes; if (customClassValue) { const currentClassValue = $element.get(0).className; attributes.class = [currentClassValue, customClassValue].join(" ") } $element.attr(attributes) }, _renderItem(index, itemData, $container, $itemToReplace) { const itemIndex = (null === index || void 0 === index ? void 0 : index.item) ?? index; $container = $container || this._getItemsContainer(); const $itemFrame = this._renderItemFrame(itemIndex, itemData, $container, $itemToReplace); this._setElementData($itemFrame, itemData, itemIndex); this._setAttributes($itemFrame); this._attachItemClickEvent(itemData, $itemFrame); const $itemContent = this._getItemContent($itemFrame); const renderContentPromise = this._renderItemContent({ index: itemIndex, itemData: itemData, container: (0, _element.getPublicElement)($itemContent), contentClass: this._itemContentClass(), defaultTemplateName: this.option("itemTemplate") }); const that = this; (0, _deferred.when)(renderContentPromise).done(($itemContent => { that._postprocessRenderItem({ itemElement: $itemFrame, itemContent: $itemContent, itemData: itemData, itemIndex: itemIndex }); that._executeItemRenderAction(index, itemData, (0, _element.getPublicElement)($itemFrame)) })); return $itemFrame }, _getItemContent($itemFrame) { const $itemContent = $itemFrame.find(".dx-item-content-placeholder"); $itemContent.removeClass("dx-item-content-placeholder"); return $itemContent }, _attachItemClickEvent(itemData, $itemElement) { if (!itemData || !itemData.onClick) { return } _events_engine.default.on($itemElement, _click.name, (e => { this._itemEventHandlerByHandler($itemElement, itemData.onClick, { event: e }) })) }, _renderItemContent(args) { const itemTemplateName = this._getItemTemplateName(args); const itemTemplate = this._getTemplate(itemTemplateName); this._addItemContentClasses(args); const $templateResult = (0, _renderer.default)(this._createItemByTemplate(itemTemplate, args)); if (!$templateResult.hasClass("dx-template-wrapper")) { return args.container } return this._renderItemContentByNode(args, $templateResult) }, _renderItemContentByNode(args, $node) { (0, _renderer.default)(args.container).replaceWith($node); args.container = (0, _element.getPublicElement)($node); this._addItemContentClasses(args); return $node }, _addItemContentClasses(args) { const classes = [ITEM_CLASS + "-content", args.contentClass]; (0, _renderer.default)(args.container).addClass(classes.join(" ")) }, _appendItemToContainer($container, $itemFrame, index) { $itemFrame.appendTo($container) }, _renderItemFrame(index, itemData, $container, $itemToReplace) { const $itemFrame = (0, _renderer.default)("
"); new this.constructor.ItemClass($itemFrame, this._itemOptions(), itemData || {}); if ($itemToReplace && $itemToReplace.length) { $itemToReplace.replaceWith($itemFrame) } else { this._appendItemToContainer.call(this, $container, $itemFrame, index) } if (this.option("useItemTextAsTitle")) { const displayValue = this._displayGetter ? this._displayGetter(itemData) : itemData; $itemFrame.attr("title", displayValue) } return $itemFrame }, _itemOptions() { const that = this; return { watchMethod: () => that.option("integrationOptions.watchMethod"), owner: that, fieldGetter(field) { const expr = that.option(`${field}Expr`); const getter = (0, _data.compileGetter)(expr); return getter } } }, _postprocessRenderItem: _common.noop, _executeItemRenderAction(index, itemData, itemElement) { this._getItemRenderAction()({ itemElement: itemElement, itemIndex: index, itemData: itemData }) }, _setElementData(element, data, index) { element.addClass([ITEM_CLASS, this._itemClass()].join(" ")).data(this._itemDataKey(), data).data(this._itemIndexKey(), index) }, _createItemRenderAction() { return this._itemRenderAction = this._createActionByOption("onItemRendered", { element: this.element(), excludeValidators: ["disabled", "readOnly"], category: "rendering" }) }, _getItemRenderAction() { return this._itemRenderAction || this._createItemRenderAction() }, _getItemTemplateName(args) { const data = args.itemData; const templateProperty = args.templateProperty || this.option("itemTemplateProperty"); const template = data && data[templateProperty]; return template || args.defaultTemplateName }, _createItemByTemplate(itemTemplate, renderArgs) { return itemTemplate.render({ model: renderArgs.itemData, container: renderArgs.container, index: renderArgs.index, onRendered: this._onItemTemplateRendered(itemTemplate, renderArgs) }) }, _onItemTemplateRendered: () => _common.noop, _emptyMessageContainer() { return this._itemContainer() }, _renderEmptyMessage(items) { items = items || this.option("items"); const noDataText = this.option("noDataText"); const hideNoData = !noDataText || items && items.length || this._dataController.isLoading(); if (hideNoData && this._$noData) { this._$noData.remove(); this._$noData = null; this.setAria("label", void 0) } if (!hideNoData) { this._$noData = this._$noData || (0, _renderer.default)("
").addClass("dx-empty-message"); this._$noData.appendTo(this._emptyMessageContainer()); if (this.option("encodeNoDataText")) { this._$noData.text(noDataText) } else { this._$noData.html(noDataText) } } this.$element().toggleClass("dx-empty-collection", !hideNoData) }, _itemDXEventHandler(dxEvent, handlerOptionName, actionArgs, actionConfig) { this._itemEventHandler(dxEvent.target, handlerOptionName, (0, _extend.extend)(actionArgs, { event: dxEvent }), actionConfig) }, _itemEventHandler(initiator, handlerOptionName, actionArgs, actionConfig) { const action = this._createActionByOption(handlerOptionName, (0, _extend.extend)({ validatingTargetName: "itemElement" }, actionConfig)); return this._itemEventHandlerImpl(initiator, action, actionArgs) }, _itemEventHandlerByHandler(initiator, handler, actionArgs, actionConfig) { const action = this._createAction(handler, (0, _extend.extend)({ validatingTargetName: "itemElement" }, actionConfig)); return this._itemEventHandlerImpl(initiator, action, actionArgs) }, _itemEventHandlerImpl(initiator, action, actionArgs) { const $itemElement = this._closestItemElement((0, _renderer.default)(initiator)); const args = (0, _extend.extend)({}, actionArgs); return action((0, _extend.extend)(actionArgs, this._extendActionArgs($itemElement), args)) }, _extendActionArgs($itemElement) { return { itemElement: (0, _element.getPublicElement)($itemElement), itemIndex: this._itemElements().index($itemElement), itemData: this._getItemData($itemElement) } }, _closestItemElement($element) { return (0, _renderer.default)($element).closest(this._itemSelector()) }, _getItemData(itemElement) { return (0, _renderer.default)(itemElement).data(this._itemDataKey()) }, _getSummaryItemsSize(dimension, items, includeMargin) { let result = 0; if (items) { (0, _iterator.each)(items, ((_, item) => { if ("width" === dimension) { result += (0, _size.getOuterWidth)(item, includeMargin || false) } else if ("height" === dimension) { result += (0, _size.getOuterHeight)(item, includeMargin || false) } })) } return result }, getFocusedItemId() { if (!this._focusedItemId) { this._focusedItemId = `dx-${new _guid.default}` } return this._focusedItemId }, itemElements() { return this._itemElements() }, itemsContainer() { return this._itemContainer() } }).include(_data_helper.default); CollectionWidget.ItemClass = _m_item.default; exports.default = CollectionWidget }, 61032: /*!**************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/ui/collection/m_collection_widget.edit.js ***! \**************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374)); var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576); var _data = __webpack_require__( /*! ../../../core/utils/data */ 47617); var _deferred = __webpack_require__( /*! ../../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 95479); var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922); var _data_source = __webpack_require__( /*! ../../../data/data_source/data_source */ 85273); var _utils = __webpack_require__( /*! ../../../data/data_source/utils */ 9234); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../events/core/events_engine */ 55994)); var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../ui/widget/ui.errors */ 96688)); var _m_selection = _interopRequireDefault(__webpack_require__( /*! ../../ui/selection/m_selection */ 23397)); var _m_collection_widget = _interopRequireDefault(__webpack_require__( /*! ./m_collection_widget.base */ 75900)); var _m_collection_widgetEditStrategy = _interopRequireDefault(__webpack_require__( /*! ./m_collection_widget.edit.strategy.plain */ 42464)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const indexExists = function(index) { return -1 !== index }; const CollectionWidget = _m_collection_widget.default.inherit({ _setOptionsByReference() { this.callBase(); (0, _extend.extend)(this._optionsByReference, { selectedItem: true }) }, _getDefaultOptions() { return (0, _extend.extend)(this.callBase(), { selectionMode: "none", selectionRequired: false, selectByClick: true, selectedItems: [], selectedItemKeys: [], maxFilterLengthInRequest: 1500, keyExpr: null, selectedIndex: -1, selectedItem: null, onSelectionChanged: null, onItemReordered: null, onItemDeleting: null, onItemDeleted: null }) }, ctor(element, options) { this._userOptions = options || {}; this.callBase(element, options) }, _init() { this._initEditStrategy(); this.callBase(); this._initKeyGetter(); this._initSelectionModule() }, _initKeyGetter() { this._keyGetter = (0, _data.compileGetter)(this.option("keyExpr")) }, _getKeysByItems(selectedItems) { return this._editStrategy.getKeysByItems(selectedItems) }, _getItemsByKeys(selectedItemKeys, selectedItems) { return this._editStrategy.getItemsByKeys(selectedItemKeys, selectedItems) }, _getKeyByIndex(index) { return this._editStrategy.getKeyByIndex(index) }, _getIndexByKey(key) { return this._editStrategy.getIndexByKey(key) }, _getIndexByItemData(itemData) { return this._editStrategy.getIndexByItemData(itemData) }, _isKeySpecified() { return !!this._dataController.key() }, _getCombinedFilter() { return this._dataController.filter() }, key() { if (this.option("keyExpr")) { return this.option("keyExpr") } return this._dataController.key() }, keyOf(item) { let key = item; if (this.option("keyExpr")) { key = this._keyGetter(item) } else if (this._dataController.store()) { key = this._dataController.keyOf(item) } return key }, _nullValueSelectionSupported: () => false, _initSelectionModule() { const that = this; const { itemsGetter: itemsGetter } = that._editStrategy; this._selection = new _m_selection.default({ allowNullValue: this._nullValueSelectionSupported(), mode: this.option("selectionMode"), maxFilterLengthInRequest: this.option("maxFilterLengthInRequest"), equalByReference: !this._isKeySpecified(), onSelectionChanged(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() { const items = that.option("items"); const totalCount = that._dataController.totalCount(); return totalCount >= 0 ? totalCount : that._getItemsCount(items) }, key: that.key.bind(that), keyOf: that.keyOf.bind(that), load(options) { var _dataController$loadO; const dataController = that._dataController; options.customQueryParams = null === (_dataController$loadO = dataController.loadOptions()) || void 0 === _dataController$loadO ? void 0 : _dataController$loadO.customQueryParams; options.userData = dataController.userData(); if (dataController.store()) { return dataController.loadFromStore(options).done((loadResult => { if (that._disposed) { return } const items = (0, _utils.normalizeLoadResult)(loadResult).data; dataController.applyMapFunction(items) })) } return (0, _deferred.Deferred)().resolve(this.plainItems()) }, dataFields: () => that._dataController.select(), plainItems: itemsGetter.bind(that._editStrategy) }) }, _getItemsCount(items) { return items.reduce(((itemsCount, item) => itemsCount + (item.items ? this._getItemsCount(item.items) : 1)), 0) }, _initEditStrategy() { const Strategy = _m_collection_widgetEditStrategy.default; this._editStrategy = new Strategy(this) }, _getSelectedItemIndices(keys) { const that = this; const indices = []; keys = keys || this._selection.getSelectedItemKeys(); that._editStrategy.beginCache(); (0, _iterator.each)(keys, ((_, key) => { const selectedIndex = that._getIndexByKey(key); if (indexExists(selectedIndex)) { indices.push(selectedIndex) } })); that._editStrategy.endCache(); return indices }, _initMarkup() { this._rendering = true; if (!this._dataController.isLoading()) { this._syncSelectionOptions().done((() => this._normalizeSelectedItems())) } this.callBase() }, _render() { this.callBase(); this._rendering = false }, _fireContentReadyAction() { this._rendering = false; this._rendered = true; this.callBase.apply(this, arguments) }, _syncSelectionOptions(byOption) { byOption = byOption || this._chooseSelectOption(); let selectedItem; let selectedIndex; let selectedItemKeys; let selectedItems; switch (byOption) { case "selectedIndex": selectedItem = this._editStrategy.getItemDataByIndex(this.option("selectedIndex")); if ((0, _type.isDefined)(selectedItem)) { this._setOptionWithoutOptionChange("selectedItems", [selectedItem]); this._setOptionWithoutOptionChange("selectedItem", selectedItem); this._setOptionWithoutOptionChange("selectedItemKeys", this._editStrategy.getKeysByItems([selectedItem])) } else { this._setOptionWithoutOptionChange("selectedItems", []); this._setOptionWithoutOptionChange("selectedItemKeys", []); this._setOptionWithoutOptionChange("selectedItem", null) } break; case "selectedItems": selectedItems = this.option("selectedItems") || []; selectedIndex = selectedItems.length ? this._editStrategy.getIndexByItemData(selectedItems[0]) : -1; if (this.option("selectionRequired") && !indexExists(selectedIndex)) { return this._syncSelectionOptions("selectedIndex") } this._setOptionWithoutOptionChange("selectedItem", selectedItems[0]); this._setOptionWithoutOptionChange("selectedIndex", selectedIndex); this._setOptionWithoutOptionChange("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._setOptionWithoutOptionChange("selectedItems", [selectedItem]); this._setOptionWithoutOptionChange("selectedIndex", selectedIndex); this._setOptionWithoutOptionChange("selectedItemKeys", this._editStrategy.getKeysByItems([selectedItem])) } else { this._setOptionWithoutOptionChange("selectedItems", []); this._setOptionWithoutOptionChange("selectedItemKeys", []); this._setOptionWithoutOptionChange("selectedIndex", -1) } break; case "selectedItemKeys": selectedItemKeys = this.option("selectedItemKeys"); if (this.option("selectionRequired")) { const selectedItemIndex = this._getIndexByKey(selectedItemKeys[0]); if (!indexExists(selectedItemIndex)) { return this._syncSelectionOptions("selectedIndex") } } return this._selection.setSelection(selectedItemKeys) } return (0, _deferred.Deferred)().resolve().promise() }, _chooseSelectOption() { let optionName = "selectedIndex"; const isOptionDefined = function(optionName) { const optionValue = this.option(optionName); const 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(oldKeys, newKeys) { if (oldKeys.length !== newKeys.length) { return false } for (let i = 0; i < newKeys.length; i++) { if (oldKeys[i] !== newKeys[i]) { return false } } return true }, _normalizeSelectedItems() { if ("none" === this.option("selectionMode")) { this._setOptionWithoutOptionChange("selectedItems", []); this._syncSelectionOptions("selectedItems") } else if ("single" === this.option("selectionMode")) { const newSelection = this.option("selectedItems"); if (newSelection.length > 1 || !newSelection.length && this.option("selectionRequired") && this.option("items") && this.option("items").length) { const currentSelection = this._selection.getSelectedItems(); let 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._setOptionWithoutOptionChange("selectedItems", [normalizedSelection]); return this._syncSelectionOptions("selectedItems") } this._selection.setSelection(this._getKeysByItems(newSelection)) } else { const newKeys = this._getKeysByItems(this.option("selectedItems")); const oldKeys = this._selection.getSelectedItemKeys(); if (!this._compareKeys(oldKeys, newKeys)) { this._selection.setSelection(newKeys) } } return (0, _deferred.Deferred)().resolve().promise() }, _itemClickHandler(e) { let itemSelectPromise = (0, _deferred.Deferred)().resolve(); const { callBase: callBase } = this; this._createAction((e => { itemSelectPromise = this._itemSelectHandler(e.event) ?? itemSelectPromise }), { validatingTargetName: "itemElement" })({ itemElement: (0, _renderer.default)(e.currentTarget), event: e }); itemSelectPromise.always((() => { callBase.apply(this, arguments) })) }, _itemSelectHandler(e) { var _itemSelectPromise; let itemSelectPromise; if (!this.option("selectByClick")) { return } const $itemElement = e.currentTarget; if (this.isItemSelected($itemElement)) { this.unselectItem(e.currentTarget) } else { itemSelectPromise = this.selectItem(e.currentTarget) } return null === (_itemSelectPromise = itemSelectPromise) || void 0 === _itemSelectPromise ? void 0 : _itemSelectPromise.promise() }, _selectedItemElement(index) { return this._itemElements().eq(index) }, _postprocessRenderItem(args) { if ("none" !== this.option("selectionMode")) { const $itemElement = (0, _renderer.default)(args.itemElement); const normalizedItemIndex = this._editStrategy.getNormalizedIndex($itemElement); const isItemSelected = this._isItemSelected(normalizedItemIndex); this._processSelectableItem($itemElement, isItemSelected) } }, _processSelectableItem($itemElement, isSelected) { $itemElement.toggleClass(this._selectedItemClass(), isSelected); this._setAriaSelectionAttribute($itemElement, String(isSelected)) }, _updateSelectedItems(args) { const that = this; const { addedItemKeys: addedItemKeys } = args; const { removedItemKeys: removedItemKeys } = args; if (that._rendered && (addedItemKeys.length || removedItemKeys.length)) { const selectionChangePromise = that._selectionChangePromise; if (!that._rendering) { const addedSelection = []; let normalizedIndex; const removedSelection = []; that._editStrategy.beginCache(); for (let i = 0; i < addedItemKeys.length; i++) { normalizedIndex = that._getIndexByKey(addedItemKeys[i]); addedSelection.push(normalizedIndex); that._addSelection(normalizedIndex) } for (let 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((() => { that._fireSelectionChangeEvent(args.addedItems, args.removedItems) })) } }, _fireSelectionChangeEvent(addedItems, removedItems) { this._createActionByOption("onSelectionChanged", { excludeValidators: ["disabled", "readOnly"] })({ addedItems: addedItems, removedItems: removedItems }) }, _updateSelection: _common.noop, _setAriaSelectionAttribute($target, value) { this.setAria("selected", value, $target) }, _removeSelection(normalizedIndex) { const $itemElement = this._editStrategy.getItemElement(normalizedIndex); if (indexExists(normalizedIndex)) { this._processSelectableItem($itemElement, false); _events_engine.default.triggerHandler($itemElement, "stateChanged", false) } }, _addSelection(normalizedIndex) { const $itemElement = this._editStrategy.getItemElement(normalizedIndex); if (indexExists(normalizedIndex)) { this._processSelectableItem($itemElement, true); _events_engine.default.triggerHandler($itemElement, "stateChanged", true) } }, _isItemSelected(index) { const key = this._getKeyByIndex(index); return this._selection.isItemSelected(key, { checkPending: true }) }, _optionChanged(args) { switch (args.name) { case "selectionMode": 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((() => this._normalizeSelectedItems())); break; case "keyExpr": this._initKeyGetter(); break; case "selectionRequired": this._normalizeSelectedItems(); break; case "selectByClick": case "onSelectionChanged": case "onItemDeleting": case "onItemDeleted": case "onItemReordered": case "maxFilterLengthInRequest": break; default: this.callBase(args) } }, _clearSelectedItems() { this._setOptionWithoutOptionChange("selectedItems", []); this._syncSelectionOptions("selectedItems") }, _waitDeletingPrepare($itemElement) { if ($itemElement.data("dxItemDeleting")) { return (0, _deferred.Deferred)().resolve().promise() } $itemElement.data("dxItemDeleting", true); const deferred = (0, _deferred.Deferred)(); const deletingActionArgs = { cancel: false }; const deletePromise = this._itemEventHandler($itemElement, "onItemDeleting", deletingActionArgs, { excludeValidators: ["disabled", "readOnly"] }); (0, _deferred.when)(deletePromise).always((function(value) { const deletePromiseExists = !deletePromise; const deletePromiseResolved = !deletePromiseExists && "resolved" === deletePromise.state(); const argumentsSpecified = !!arguments.length; const shouldDelete = deletePromiseExists || deletePromiseResolved && !argumentsSpecified || deletePromiseResolved && value; (0, _deferred.when)((0, _deferred.fromPromise)(deletingActionArgs.cancel)).always((() => { $itemElement.data("dxItemDeleting", false) })).done((cancel => { shouldDelete && !cancel ? deferred.resolve() : deferred.reject() })).fail(deferred.reject) })); return deferred.promise() }, _deleteItemFromDS($item) { const dataController = this._dataController; const deferred = (0, _deferred.Deferred)(); const disabledState = this.option("disabled"); const dataStore = dataController.store(); if (!dataStore) { return (0, _deferred.Deferred)().resolve().promise() } if (!dataStore.remove) { throw _ui.default.Error("E1011") } this.option("disabled", true); dataStore.remove(dataController.keyOf(this._getItemData($item))).done((key => { if (void 0 !== key) { deferred.resolve() } else { deferred.reject() } })).fail((() => { deferred.reject() })); deferred.always((() => { this.option("disabled", disabledState) })); return deferred }, _tryRefreshLastPage() { const deferred = (0, _deferred.Deferred)(); if (this._isLastPage() || this.option("grouped")) { deferred.resolve() } else { this._refreshLastPage().done((() => { deferred.resolve() })) } return deferred.promise() }, _refreshLastPage() { this._expectLastItemLoading(); return this._dataController.load() }, _updateSelectionAfterDelete(index) { const key = this._getKeyByIndex(index); this._selection.deselect([key]) }, _updateIndicesAfterIndex(index) { const itemElements = this._itemElements(); for (let i = index + 1; i < itemElements.length; i++) { (0, _renderer.default)(itemElements[i]).data(this._itemIndexKey(), i - 1) } }, _simulateOptionChange(optionName) { const optionValue = this.option(optionName); if (optionValue instanceof _data_source.DataSource) { return } this._optionChangedAction({ name: optionName, fullName: optionName, value: optionValue }) }, isItemSelected(itemElement) { return this._isItemSelected(this._editStrategy.getNormalizedIndex(itemElement)) }, selectItem(itemElement) { if ("none" === this.option("selectionMode")) { return } const itemIndex = this._editStrategy.getNormalizedIndex(itemElement); if (!indexExists(itemIndex)) { return } const key = this._getKeyByIndex(itemIndex); if (this._selection.isItemSelected(key)) { return } if ("single" === this.option("selectionMode")) { return this._selection.setSelection([key]) } const selectedItemKeys = this.option("selectedItemKeys") || []; return this._selection.setSelection([...selectedItemKeys, key], [key]) }, unselectItem(itemElement) { const itemIndex = this._editStrategy.getNormalizedIndex(itemElement); if (!indexExists(itemIndex)) { return } const selectedItemKeys = this._selection.getSelectedItemKeys(); if (this.option("selectionRequired") && selectedItemKeys.length <= 1) { return } const key = this._getKeyByIndex(itemIndex); if (!this._selection.isItemSelected(key, { checkPending: true })) { return } this._selection.deselect([key]) }, _deleteItemElementByIndex(index) { this._updateSelectionAfterDelete(index); this._updateIndicesAfterIndex(index); this._editStrategy.deleteItemAtIndex(index) }, _afterItemElementDeleted($item, deletedActionArgs) { const changingOption = this._dataController.getDataSource() ? "dataSource" : "items"; this._simulateOptionChange(changingOption); this._itemEventHandler($item, "onItemDeleted", deletedActionArgs, { beforeExecute() { $item.remove() }, excludeValidators: ["disabled", "readOnly"] }); this._renderEmptyMessage() }, deleteItem(itemElement) { const that = this; const deferred = (0, _deferred.Deferred)(); const $item = this._editStrategy.getItemElement(itemElement); const index = this._editStrategy.getNormalizedIndex(itemElement); const itemResponseWaitClass = this._itemResponseWaitClass(); if (indexExists(index)) { this._waitDeletingPrepare($item).done((() => { $item.addClass(itemResponseWaitClass); const deletedActionArgs = that._extendActionArgs($item); that._deleteItemFromDS($item).done((() => { that._deleteItemElementByIndex(index); that._afterItemElementDeleted($item, deletedActionArgs); that._tryRefreshLastPage().done((() => { deferred.resolveWith(that) })) })).fail((() => { $item.removeClass(itemResponseWaitClass); deferred.rejectWith(that) })) })).fail((() => { deferred.rejectWith(that) })) } else { deferred.rejectWith(that) } return deferred.promise() }, reorderItem(itemElement, toItemElement) { const deferred = (0, _deferred.Deferred)(); const that = this; const strategy = this._editStrategy; const $movingItem = strategy.getItemElement(itemElement); const $destinationItem = strategy.getItemElement(toItemElement); const movingIndex = strategy.getNormalizedIndex(itemElement); const destinationIndex = strategy.getNormalizedIndex(toItemElement); const changingOption = this._dataController.getDataSource() ? "dataSource" : "items"; const 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"] }) })) } }); exports.default = CollectionWidget }, 91889: /*!***********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/ui/collection/m_collection_widget.edit.strategy.js ***! \***********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _class = _interopRequireDefault(__webpack_require__( /*! ../../../core/class */ 38377)); var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../core/dom_adapter */ 73349)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374)); var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576); var _type = __webpack_require__( /*! ../../../core/utils/type */ 35922); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const { abstract: abstract } = _class.default; const EditStrategy = _class.default.inherit({ ctor(collectionWidget) { this._collectionWidget = collectionWidget }, getIndexByItemData: abstract, getItemDataByIndex: abstract, getKeysByItems: abstract, getItemsByKeys: abstract, itemsGetter: abstract, getKeyByIndex(index) { const resultIndex = this._denormalizeItemIndex(index); return this.getKeysByItems([this.getItemDataByIndex(resultIndex)])[0] }, _equalKeys(key1, key2) { if (this._collectionWidget._isKeySpecified()) { return (0, _common.equalByValue)(key1, key2) } return key1 === key2 }, beginCache() { this._cache = {} }, endCache() { this._cache = null }, getIndexByKey: abstract, getNormalizedIndex(value) { if (this._isNormalizedItemIndex(value)) { return value } if (this._isItemIndex(value)) { return this._normalizeItemIndex(value) } if (this._isNode(value)) { return this._getNormalizedItemIndex(value) } return this._normalizeItemIndex(this.getIndexByItemData(value)) }, getIndex(value) { if (this._isNormalizedItemIndex(value)) { return this._denormalizeItemIndex(value) } if (this._isItemIndex(value)) { return value } if (this._isNode(value)) { return this._denormalizeItemIndex(this._getNormalizedItemIndex(value)) } return this.getIndexByItemData(value) }, getItemElement(value) { if (this._isNormalizedItemIndex(value)) { return this._getItemByNormalizedIndex(value) } if (this._isItemIndex(value)) { return this._getItemByNormalizedIndex(this._normalizeItemIndex(value)) } if (this._isNode(value)) { return (0, _renderer.default)(value) } const normalizedItemIndex = this._normalizeItemIndex(this.getIndexByItemData(value)); return this._getItemByNormalizedIndex(normalizedItemIndex) }, _isNode: el => _dom_adapter.default.isNode(el && (0, _type.isRenderer)(el) ? el.get(0) : el), deleteItemAtIndex: abstract, itemPlacementFunc(movingIndex, destinationIndex) { return this._itemsFromSameParent(movingIndex, destinationIndex) && movingIndex < destinationIndex ? "after" : "before" }, moveItemAtIndexToIndex: abstract, _isNormalizedItemIndex: index => "number" === typeof index && Math.round(index) === index, _isItemIndex: abstract, _getNormalizedItemIndex: abstract, _normalizeItemIndex: abstract, _denormalizeItemIndex: abstract, _getItemByNormalizedIndex: abstract, _itemsFromSameParent: abstract }); exports.default = EditStrategy }, 42464: /*!*****************************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/ui/collection/m_collection_widget.edit.strategy.plain.js ***! \*****************************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _m_collection_widgetEdit = (obj = __webpack_require__( /*! ./m_collection_widget.edit.strategy */ 91889), obj && obj.__esModule ? obj : { default: obj }); var obj; const PlainEditStrategy = _m_collection_widgetEdit.default.inherit({ _getPlainItems() { return this._collectionWidget.option("items") || [] }, getIndexByItemData(itemData) { const keyOf = this._collectionWidget.keyOf.bind(this._collectionWidget); if (keyOf) { return this.getIndexByKey(keyOf(itemData)) } return this._getPlainItems().indexOf(itemData) }, getItemDataByIndex(index) { return this._getPlainItems()[index] }, deleteItemAtIndex(index) { this._getPlainItems().splice(index, 1) }, itemsGetter() { return this._getPlainItems() }, getKeysByItems(items) { const keyOf = this._collectionWidget.keyOf.bind(this._collectionWidget); let result = items; if (keyOf) { result = []; for (let i = 0; i < items.length; i++) { result.push(keyOf(items[i])) } } return result }, getIndexByKey(key) { const cache = this._cache; const keys = cache && cache.keys || this.getKeysByItems(this._getPlainItems()); if (cache && !cache.keys) { cache.keys = keys } if ("object" === typeof key) { for (let i = 0, { length: length } = keys; i < length; i++) { if (this._equalKeys(key, keys[i])) { return i } } } else { return keys.indexOf(key) } return -1 }, getItemsByKeys: (keys, items) => (items || keys).slice(), moveItemAtIndexToIndex(movingIndex, destinationIndex) { const items = this._getPlainItems(); const movedItemData = items[movingIndex]; items.splice(movingIndex, 1); items.splice(destinationIndex, 0, movedItemData) }, _isItemIndex: index => "number" === typeof index && Math.round(index) === index, _getNormalizedItemIndex(itemElement) { return this._collectionWidget._itemElements().index(itemElement) }, _normalizeItemIndex: index => index, _denormalizeItemIndex: index => index, _getItemByNormalizedIndex(index) { return index > -1 ? this._collectionWidget._itemElements().eq(index) : null }, _itemsFromSameParent: () => true }); exports.default = PlainEditStrategy }, 85736: /*!*********************************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/ui/collection/m_collection_widget.live_update.js ***! \*********************************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _dom_adapter = _interopRequireDefault(__webpack_require__( /*! ../../../core/dom_adapter */ 73349)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374)); var _array_compare = __webpack_require__( /*! ../../../core/utils/array_compare */ 34671); var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576); var _deferred = __webpack_require__( /*! ../../../core/utils/deferred */ 62754); var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306); var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 95479); var _array_utils = __webpack_require__( /*! ../../../data/array_utils */ 60637); var _utils = __webpack_require__( /*! ../../../data/utils */ 16454); var _m_collection_widget = _interopRequireDefault(__webpack_require__( /*! ./m_collection_widget.edit */ 61032)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const PRIVATE_KEY_FIELD = "__dx_key__"; exports.default = _m_collection_widget.default.inherit({ _getDefaultOptions() { return (0, _extend.extend)(this.callBase(), { repaintChangesOnly: false }) }, ctor() { var _this$_dataController; this.callBase.apply(this, arguments); this._customizeStoreLoadOptions = e => { const dataController = this._dataController; if (dataController.getDataSource() && !this._dataController.isLoaded()) { this._correctionIndex = 0 } if (this._correctionIndex && e.storeLoadOptions) { e.storeLoadOptions.skip += this._correctionIndex } }; null === (_this$_dataController = this._dataController) || void 0 === _this$_dataController || _this$_dataController.on("customizeStoreLoadOptions", this._customizeStoreLoadOptions) }, reload() { this._correctionIndex = 0 }, _init() { this.callBase(); this._refreshItemsCache(); this._correctionIndex = 0 }, _findItemElementByKey(key) { let result = (0, _renderer.default)(); const keyExpr = this.key(); this.itemElements().each(((_, item) => { const $item = (0, _renderer.default)(item); const itemData = this._getItemData($item); if (keyExpr ? (0, _utils.keysEqual)(keyExpr, this.keyOf(itemData), key) : this._isItemEquals(itemData, key)) { result = $item; return false } })); return result }, _dataSourceChangedHandler(newItems, e) { if (null !== e && void 0 !== e && e.changes) { this._modifyByChanges(e.changes) } else { this.callBase(newItems, e); this._refreshItemsCache() } }, _isItemEquals(item1, item2) { if (item1 && item1.__dx_key__) { item1 = item1.data } try { return JSON.stringify(item1) === JSON.stringify(item2) } catch (e) { return item1 === item2 } }, _isItemStrictEquals(item1, item2) { return this._isItemEquals(item1, item2) }, _shouldAddNewGroup(changes, items) { let result = false; if (this.option("grouped")) { if (!changes.length) { result = true }(0, _iterator.each)(changes, ((i, change) => { if ("insert" === change.type) { result = true; (0, _iterator.each)(items, ((_, item) => { if (void 0 !== change.data.key && change.data.key === item.key) { result = false; return false } })) } })) } return result }, _partialRefresh() { if (this.option("repaintChangesOnly")) { const keyOf = data => { if (data && void 0 !== data.__dx_key__) { return data.__dx_key__ } return this.keyOf(data) }; const result = (0, _array_compare.findChanges)(this._itemsCache, this._editStrategy.itemsGetter(), keyOf, this._isItemStrictEquals.bind(this)); if (result && this._itemsCache.length && !this._shouldAddNewGroup(result, this._itemsCache)) { this._modifyByChanges(result, true); this._renderEmptyMessage(); return true } this._refreshItemsCache() } return false }, _refreshItemsCache() { if (this.option("repaintChangesOnly")) { const items = this._editStrategy.itemsGetter(); try { this._itemsCache = (0, _extend.extend)(true, [], items); if (!this.key()) { this._itemsCache = this._itemsCache.map(((itemCache, index) => ({ [PRIVATE_KEY_FIELD]: items[index], data: itemCache }))) } } catch (e) { this._itemsCache = (0, _extend.extend)([], items) } } }, _dispose() { this._dataController.off("customizeStoreLoadOptions", this._customizeStoreLoadOptions); this.callBase() }, _updateByChange(keyInfo, items, change, isPartialRefresh) { if (isPartialRefresh) { this._renderItem(change.index, change.data, null, this._findItemElementByKey(change.key)) } else { const changedItem = items[(0, _array_utils.indexByKey)(keyInfo, items, change.key)]; if (changedItem) { (0, _array_utils.update)(keyInfo, items, change.key, change.data).done((() => { this._renderItem(items.indexOf(changedItem), changedItem, null, this._findItemElementByKey(change.key)) })) } } }, _insertByChange(keyInfo, items, change, isPartialRefresh) { (0, _deferred.when)(isPartialRefresh || (0, _array_utils.insert)(keyInfo, items, change.data, change.index)).done((() => { this._beforeItemElementInserted(change); this._renderItem(change.index ?? items.length, change.data); this._afterItemElementInserted(); this._correctionIndex++ })) }, _updateSelectionAfterRemoveByChange(removeIndex) { const 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(change) { const selectedIndex = this.option("selectedIndex"); if (change.index <= selectedIndex) { this.option("selectedIndex", selectedIndex + 1) } }, _afterItemElementInserted: _common.noop, _removeByChange(keyInfo, items, change, isPartialRefresh) { const index = isPartialRefresh ? change.index : (0, _array_utils.indexByKey)(keyInfo, items, change.key); const removedItem = isPartialRefresh ? change.oldItem : items[index]; if (removedItem) { const $removedItemElement = this._findItemElementByKey(change.key); const deletedActionArgs = this._extendActionArgs($removedItemElement); this._waitDeletingPrepare($removedItemElement).done((() => { if (isPartialRefresh) { this._updateIndicesAfterIndex(index - 1); this._afterItemElementDeleted($removedItemElement, deletedActionArgs); this._updateSelectionAfterRemoveByChange(index) } else { this._deleteItemElementByIndex(index); this._afterItemElementDeleted($removedItemElement, deletedActionArgs) } })); this._correctionIndex-- } }, _modifyByChanges(changes, isPartialRefresh) { const items = this._editStrategy.itemsGetter(); const keyInfo = { key: this.key.bind(this), keyOf: this.keyOf.bind(this) }; const dataController = this._dataController; const paginate = dataController.paginate(); const group = dataController.group(); if (paginate || group) { changes = changes.filter((item => "insert" !== item.type || void 0 !== item.index)) } changes.forEach((change => this[`_${change.type}ByChange`](keyInfo, items, change, isPartialRefresh))); this._renderedItemsCount = items.length; this._refreshItemsCache(); this._fireContentReadyAction() }, _appendItemToContainer($container, $itemFrame, index) { const nextSiblingElement = $container.children(this._itemSelector()).get(index); _dom_adapter.default.insertElement($container.get(0), $itemFrame.get(0), nextSiblingElement) }, _optionChanged(args) { switch (args.name) { case "items": { const 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) } } }) }, 30136: /*!*******************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/ui/collection/m_data_controller.js ***! \*******************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _common = __webpack_require__( /*! ../../../core/utils/common */ 20576); var _deferred = __webpack_require__( /*! ../../../core/utils/deferred */ 62754); const DataControllerMock = { load: () => (0, _deferred.Deferred)().reject(), loadSingle: () => (0, _deferred.Deferred)().reject(), loadFromStore: () => (0, _deferred.Deferred)().reject(), loadNextPage: () => (0, _deferred.Deferred)().reject(), loadOptions: _common.noop, userData: _common.noop, cancel: _common.noop, cancelAll: _common.noop, filter: _common.noop, addSearchFilter: _common.noop, group: _common.noop, paginate: _common.noop, pageSize: _common.noop, pageIndex: _common.noop, resetDataSourcePageIndex: _common.noop, totalCount: _common.noop, isLastPage: _common.noop, isLoading: _common.noop, isLoaded: _common.noop, searchValue: _common.noop, searchOperation: _common.noop, searchExpr: _common.noop, select: _common.noop, key: _common.noop, keyOf: _common.noop, store: _common.noop, items: _common.noop, applyMapFunction: _common.noop, getDataSource: _common.noop, reload: _common.noop, on: _common.noop, off: _common.noop }; exports.default = class { constructor(dataSource) { if (!dataSource) { return DataControllerMock } this._dataSource = dataSource } load() { return this._dataSource.load() } loadSingle(propName, propValue) { if (arguments.length < 2) { propValue = propName; propName = this.key() } return this._dataSource.loadSingle(propName, propValue) } loadFromStore(loadOptions) { return this.store().load(loadOptions) } loadNextPage() { this.pageIndex(1 + this.pageIndex()); return this.load() } loadOptions() { return this._dataSource.loadOptions() } userData() { return this._dataSource._userData } cancel(operationId) { this._dataSource.cancel(operationId) } cancelAll() { this._dataSource.cancelAll() } filter(filter) { return this._dataSource.filter(filter) } addSearchFilter(storeLoadOptions) { this._dataSource._addSearchFilter(storeLoadOptions) } group(group) { return this._dataSource.group(group) } paginate() { return this._dataSource.paginate() } pageSize() { return this._dataSource._pageSize } pageIndex(pageIndex) { return this._dataSource.pageIndex(pageIndex) } resetDataSourcePageIndex() { if (this.pageIndex()) { this.pageIndex(0); this.load() } } totalCount() { return this._dataSource.totalCount() } isLastPage() { return this._dataSource.isLastPage() || !this._dataSource._pageSize } isLoading() { return this._dataSource.isLoading() } isLoaded() { return this._dataSource.isLoaded() } searchValue(value) { if (!arguments.length) { return this._dataSource.searchValue() } return this._dataSource.searchValue(value) } searchOperation(operation) { return this._dataSource.searchOperation(operation) } searchExpr(expr) { if (!arguments.length) { return this._dataSource.searchExpr() } return this._dataSource.searchExpr(expr) } select() { return this._dataSource.select(...arguments) } key() { return this._dataSource.key() } keyOf(item) { return this.store().keyOf(item) } store() { return this._dataSource.store() } items() { return this._dataSource.items() } applyMapFunction(data) { return this._dataSource._applyMapFunction(data) } getDataSource() { return this._dataSource || null } reload() { return this._dataSource.reload() } on(event, handler) { this._dataSource.on(event, handler) } off(event, handler) { this._dataSource.off(event, handler) } } }, 1893: /*!********************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/ui/collection/m_item.js ***! \********************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _class = _interopRequireDefault(__webpack_require__( /*! ../../../core/class */ 38377)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374)); var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 95479); var _public_component = __webpack_require__( /*! ../../../core/utils/public_component */ 9321); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const CollectionItem = _class.default.inherit({ ctor($element, options, rawData) { this._$element = $element; this._options = options; this._rawData = rawData; (0, _public_component.attachInstanceToElement)($element, this, this._dispose); this._render() }, _render() { const $placeholder = (0, _renderer.default)("
").addClass("dx-item-content-placeholder"); this._$element.append($placeholder); this._watchers = []; this._renderWatchers() }, _renderWatchers() { this._startWatcher("disabled", this._renderDisabled.bind(this)); this._startWatcher("visible", this._renderVisible.bind(this)) }, _startWatcher(field, render) { const rawData = this._rawData; const exprGetter = this._options.fieldGetter(field); const watcher = function(watchMethod, fn, callback) { const filteredCallback = function() { let oldValue; return function(value) { if (oldValue !== value) { callback(value, oldValue); oldValue = value } } }(); return { dispose: watchMethod(fn, filteredCallback), force() { filteredCallback(fn()) } } }(this._options.watchMethod(), (() => exprGetter(rawData)), ((value, oldValue) => { this._dirty = true; render(value, oldValue) })); this._watchers.push(watcher) }, setDataField() { this._dirty = false; (0, _iterator.each)(this._watchers, ((_, watcher) => { watcher.force() })); if (this._dirty) { return true } }, _renderDisabled(value, oldValue) { this._$element.toggleClass("dx-state-disabled", !!value); this._$element.attr("aria-disabled", !!value); this._updateOwnerFocus(value) }, _updateOwnerFocus(isDisabled) { const ownerComponent = this._options.owner; if (ownerComponent && isDisabled) { ownerComponent._resetItemFocus(this._$element) } }, _renderVisible(value, oldValue) { this._$element.toggleClass("dx-state-invisible", void 0 !== value && !value) }, _dispose() { (0, _iterator.each)(this._watchers, ((_, watcher) => { watcher.dispose() })) } }); CollectionItem.getInstance = function($element) { return (0, _public_component.getInstanceByElement)($element, this) }; exports.default = CollectionItem }, 29844: /*!************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/ui/color_box/m_color_box.js ***! \************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _color = _interopRequireDefault(__webpack_require__( /*! ../../../color */ 52752)); var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 99393)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374)); var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306); var _m_drop_down_editor = _interopRequireDefault(__webpack_require__( /*! ../../ui/drop_down_editor/m_drop_down_editor */ 81605)); var _m_color_view = _interopRequireDefault(__webpack_require__( /*! ./m_color_view */ 6522)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const colorEditorPrototype = _m_color_view.default.prototype; const colorUtils = { makeTransparentBackground: colorEditorPrototype._makeTransparentBackground.bind(colorEditorPrototype), makeRgba: colorEditorPrototype._makeRgba.bind(colorEditorPrototype) }; const ColorBox = _m_drop_down_editor.default.inherit({ _supportedKeys() { const arrowHandler = function(e) { e.stopPropagation(); if (this.option("opened")) { e.preventDefault(); return true } }; return (0, _extend.extend)(this.callBase(), { enter: this._enterKeyHandler, leftArrow: arrowHandler, rightArrow: arrowHandler, upArrow: function(e) { if (!this.option("opened")) { e.preventDefault(); return false } if (e.altKey) { this.close(); return false } return true }, downArrow: function(e) { if (!this.option("opened") && !e.altKey) { e.preventDefault(); return false } if (!this.option("opened") && e.altKey) { this._validatedOpening(); return false } return true } }) }, _getDefaultOptions() { return (0, _extend.extend)(this.callBase(), { editAlphaChannel: false, applyValueMode: "useButtons", keyStep: 1, fieldTemplate: null, buttonsLocation: "bottom after" }) }, _popupHidingHandler() { this.callBase(); if ("useButtons" === this.option("applyValueMode")) { this._updateColorViewValue(this.option("value")) } }, _popupConfig() { return (0, _extend.extend)(this.callBase(), { width: "" }) }, _contentReadyHandler() { this._createColorView(); this._addPopupBottomClasses() }, _addPopupBottomClasses() { const $popupBottom = this._popup.bottomToolbar(); if ($popupBottom) { $popupBottom.addClass("dx-colorview-container-cell").addClass("dx-colorview-button-cell").find(".dx-toolbar-items-container").addClass("dx-colorview-buttons-container"); $popupBottom.find(".dx-popup-done").addClass("dx-colorview-apply-button"); $popupBottom.find(".dx-popup-cancel").addClass("dx-colorview-cancel-button") } }, _createColorView() { this._popup.$overlayContent().addClass("dx-colorbox-overlay"); const $colorView = (0, _renderer.default)("
").appendTo(this._popup.$content()); this._colorView = this._createComponent($colorView, _m_color_view.default, this._colorViewConfig()) }, _applyNewColor(value) { this.option("value", value); if (value) { colorUtils.makeTransparentBackground(this._$colorResultPreview, value) } if (this._colorViewEnterKeyPressed) { this.close(); this._colorViewEnterKeyPressed = false } }, _colorViewConfig() { const that = this; return { value: that.option("value"), matchValue: that.option("value"), editAlphaChannel: that.option("editAlphaChannel"), applyValueMode: that.option("applyValueMode"), focusStateEnabled: that.option("focusStateEnabled"), stylingMode: this.option("stylingMode"), target: this._input(), onEnterKeyPressed(_ref) { let { event: event } = _ref; that._colorViewEnterKeyPressed = true; if (that._colorView.option("value") !== that.option("value")) { that._saveValueChangeEvent(event); that._applyNewColor(that._colorView.option("value")); that.close() } }, onValueChanged(_ref2) { let { event: event, value: value, previousValue: previousValue } = _ref2; const instantlyMode = "instantly" === that.option("applyValueMode"); const isOldValue = colorUtils.makeRgba(value) === previousValue; const changesApplied = instantlyMode || that._colorViewEnterKeyPressed; const valueCleared = that._shouldSaveEmptyValue; if (isOldValue || !changesApplied || valueCleared) { return } if (event) { that._saveValueChangeEvent(event) } that._applyNewColor(value) } } }, _enterKeyHandler(e) { const newValue = this._input().val(); const { value: value, editAlphaChannel: editAlphaChannel } = this.option(); const oldValue = value && editAlphaChannel ? colorUtils.makeRgba(value) : value; if (!newValue) { return false } const color = new _color.default(newValue); if (color.colorIsInvalid) { this._input().val(oldValue); return } if (newValue !== oldValue) { this._applyColorFromInput(newValue); this._saveValueChangeEvent(e); this.option("value", this.option("editAlphaChannel") ? colorUtils.makeRgba(newValue) : newValue) } if (this._colorView) { const colorViewValue = this._colorView.option("value"); if (value !== colorViewValue) { this._saveValueChangeEvent(e); this.option("value", colorViewValue) } } this.close(); return false }, _applyButtonHandler(e) { this._saveValueChangeEvent(e.event); this._applyNewColor(this._colorView.option("value")); this.callBase() }, _cancelButtonHandler() { this._resetInputValue(); this.callBase() }, _getKeyboardListeners() { return this.callBase().concat([this._colorView]) }, _init() { this.callBase() }, _initMarkup() { this.$element().addClass("dx-colorbox"); this.callBase() }, _renderInput() { this.callBase(); this._input().addClass("dx-colorbox-input"); this._renderColorPreview() }, _renderColorPreview() { this.$element().wrapInner((0, _renderer.default)("
").addClass("dx-colorbox-input-container")); this._$colorBoxInputContainer = this.$element().children().eq(0); this._$colorResultPreview = (0, _renderer.default)("
").addClass("dx-colorbox-color-result-preview").appendTo(this._$textEditorInputContainer); if (!this.option("value")) { this._$colorBoxInputContainer.addClass("dx-colorbox-color-is-not-defined") } else { colorUtils.makeTransparentBackground(this._$colorResultPreview, this.option("value")) } }, _renderValue() { const { value: value, editAlphaChannel: editAlphaChannel } = this.option(); const shouldConvertToColor = value && editAlphaChannel; const text = shouldConvertToColor ? colorUtils.makeRgba(value) : value; this.option("text", text); return this.callBase() }, _resetInputValue() { const $input = this._input(); const value = this.option("value"); $input.val(value); this._updateColorViewValue(value) }, _updateColorViewValue(value) { if (this._colorView) { this._colorView.option({ value: value, matchValue: value }) } }, _valueChangeEventHandler(e) { let value = this._input().val(); if (value) { value = this._applyColorFromInput(value); this._updateColorViewValue(value) } this.callBase(e, value) }, _applyColorFromInput(value) { const { editAlphaChannel: editAlphaChannel } = this.option(); const newColor = new _color.default(value); if (newColor.colorIsInvalid) { this._resetInputValue(); return this.option("value") } if (editAlphaChannel) { return colorUtils.makeRgba(value) } return value }, _clean() { this.callBase(); delete this._shouldSaveEmptyValue }, _optionChanged(args) { const { value: value } = args; const { name: name } = args; switch (name) { case "value": this._$colorBoxInputContainer.toggleClass("dx-colorbox-color-is-not-defined", !value); if (value) { colorUtils.makeTransparentBackground(this._$colorResultPreview, value) } else { this._$colorResultPreview.removeAttr("style") } if (null === value) { this._shouldSaveEmptyValue = true } this._updateColorViewValue(value); this._shouldSaveEmptyValue = false; this.callBase(args); break; case "applyButtonText": case "cancelButtonText": this.callBase(args); this._popup && this._addPopupBottomClasses(); break; case "editAlphaChannel": case "keyStep": if (this._colorView) { this._colorView.option(name, value) } break; default: this.callBase(args) } } }); (0, _component_registrator.default)("dxColorBox", ColorBox); exports.default = ColorBox }, 6522: /*!*************************************************************************************!*\ !*** ./artifacts/transpiled-renovation-npm/__internal/ui/color_box/m_color_view.js ***! \*************************************************************************************/ function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _translator = __webpack_require__( /*! ../../../animation/translator */ 31648); var _color = _interopRequireDefault(__webpack_require__( /*! ../../../color */ 52752)); var _component_registrator = _interopRequireDefault(__webpack_require__( /*! ../../../core/component_registrator */ 99393)); var _devices = _interopRequireDefault(__webpack_require__( /*! ../../../core/devices */ 20530)); var _guid = _interopRequireDefault(__webpack_require__( /*! ../../../core/guid */ 73176)); var _renderer = _interopRequireDefault(__webpack_require__( /*! ../../../core/renderer */ 68374)); var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 13306); var _size = __webpack_require__( /*! ../../../core/utils/size */ 58664); var _click = __webpack_require__( /*! ../../../events/click */ 95429); var _events_engine = _interopRequireDefault(__webpack_require__( /*! ../../../events/core/events_engine */ 55994)); var _index = __webpack_require__( /*! ../../../events/utils/index */ 39611); var _message = _interopRequireDefault(__webpack_require__( /*! ../../../localization/message */ 28109)); var _draggable = _interopRequireDefault(__webpack_require__( /*! ../../../ui/draggable */ 42160)); var _editor = _interopRequireDefault(__webpack_require__( /*! ../../../ui/editor/editor */ 96452)); var _number_box = _interopRequireDefault(__webpack_require__( /*! ../../../ui/number_box */ 34171)); var _text_box = _interopRequireDefault(__webpack_require__( /*! ../../../ui/text_box */ 29837)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj } } const COLOR_VIEW_PALETTE_GRADIENT_CLASS = "dx-colorview-palette-gradient"; const COLOR_VIEW_PALETTE_GRADIENT_WHITE_CLASS = "dx-colorview-palette-gradient-white"; const COLOR_VIEW_PALETTE_GRADIENT_BLACK_CLASS = "dx-colorview-palette-gradient-black"; const COLOR_VIEW_COLOR_PREVIEW = "dx-colorview-color-preview"; const COLOR_VIEW_COLOR_PREVIEW_COLOR_CURRENT = "dx-colorview-color-preview-color-current"; const COLOR_VIEW_COLOR_PREVIEW_COLOR_NEW = "dx-colorview-color-preview-color-new"; const ColorView = _editor.default.inherit({ _supportedKeys() { const isRTL = this.option("rtlEnabled"); const that = this; const getHorizontalPaletteStep = function(e) { let step = 100 / that._paletteWidth; if (e.shiftKey) { step *= that.option("keyStep") } step = step > 1 ? step : 1; return Math.round(step) }; const updateHorizontalPaletteValue = function(step) { let value = that._currentColor.hsv.s + step; if (value > 100) { value = 100 } else if (value < 0) { value = 0 } that._currentColor.hsv.s = value; updatePaletteValue() }; const getVerticalPaletteStep = function(e) { let step = 100 / that._paletteHeight; if (e.shiftKey) { step *= that.option("keyStep") } step = step > 1 ? step : 1; return Math.round(step) }; const updateVerticalPaletteValue = function(step) { let value = that._currentColor.hsv.v + step; if (value > 100) { value = 100 } else if (value < 0) { value = 0 } that._currentColor.hsv.v = value; updatePaletteValue() }; function updatePaletteValue() { that._placePaletteHandle(); that._updateColorFromHsv(that._currentColor.hsv.h, that._currentColor.hsv.s, that._currentColor.hsv.v) } const getHueScaleStep = function(e) { let step = 360 / (that._hueScaleWrapperHeight - that._hueScaleHandleHeight); if (e.shiftKey) { step *= that.option("keyStep") } step = step > 1 ? step : 1; return step }; const updateHueScaleValue = function(step) { that._currentColor.hsv.h += step; that._placeHueScaleHandle(); const handleLocation = (0, _translator.locate)(that._$hueScaleHandle); that._updateColorHue(handleLocation.top + that._hueScaleHandleHeight / 2) }; const getAlphaScaleStep = function(e) { let step = 1 / that._alphaChannelScaleWorkWidth; if (e.shiftKey) { step *= that.option("keyStep") } step = step > .01 ? step : .01; step = isRTL ? -step : step; return step }; const updateAlphaScaleValue = function(step) { that._currentColor.a += step; that._placeAlphaChannelHandle(); const handleLocation = (0, _translator.locate)(that._$alphaChannelHandle); that._calculateColorTransparencyByScaleWidth(handleLocation.left + that._alphaChannelHandleWidth / 2) }; return (0, _extend.extend)(this.callBase(), { upArrow(e) { e.preventDefault(); e.stopPropagation(); if ((0, _index.isCommandKeyPressed)(e)) { if (this._currentColor.hsv.h <= 360 && !this._isTopColorHue) { this._saveValueChangeEvent(e); updateHueScaleValue(getHueScaleStep(e)) } } else if (this._currentColor.hsv.v < 100) { this._saveValueChangeEvent(e); updateVerticalPaletteValue(getVerticalPaletteStep(e)) } }, downArrow(e) { e.preventDefault(); e.stopPropagation(); if ((0, _index.isCommandKeyPressed)(e)) { if (this._currentColor.hsv.h >= 0) { if (this._isTopColorHue) { this._currentColor.hsv.h = 360 } this._saveValueChangeEvent(e); updateHueScaleValue(-getHueScaleStep(e)) } } else if (this._currentColor.hsv.v > 0) { this._saveValueChangeEvent(e); updateVerticalPaletteValue(-getVerticalPaletteStep(e)) } }, rightArrow(e) { e.preventDefault(); e.stopPropagation(); if ((0, _index.isCommandKeyPressed)(e)) { if (isRTL ? this._currentColor.a < 1 : this._currentColor.a > 0 && this.option("editAlphaChannel")) { this._saveValueChangeEvent(e); updateAlphaScaleValue(-getAlphaScaleStep(e)) } } else if (this._currentColor.hsv.s < 100) { this._saveValueChangeEvent(e); updateHorizontalPaletteValue(getHorizontalPaletteStep(e)) } }, leftArrow(e) { e.preventDefault(); e.stopPropagation(); if ((0, _index.isCommandKeyPressed)(e)) { if (isRTL ? this._currentColor.a > 0 : this._currentColor.a < 1 && this.option("editAlphaChannel")) { this._saveValueChangeEvent(e); updateAlphaScaleValue(getAlphaScaleStep(e)) } } else if (this._currentColor.hsv.s > 0) { this._saveValueChangeEvent(e); updateHorizontalPaletteValue(-getHorizontalPaletteStep(e)) } }, enter(e) { this._fireEnterKeyPressed(e) } }) }, _getDefaultOptions() { return (0, _extend.extend)(this.callBase(), { value: null, matchValue: null, onEnterKeyPressed: void 0, editAlphaChannel: false, keyStep: 1, stylingMode: void 0 }) }, _defaultOptionsRules() { return this.callBase().concat([{ device: () => "desktop" === _devices.default.real().deviceType && !_devices.default.isSimulator(), options: { focusStateEnabled: true } }]) }, _init() { this.callBase(); this._initColorAndOpacity(); this._initEnterKeyPressedAction() }, _initEnterKeyPressedAction() { this._onEnterKeyPressedAction = this._createActionByOption("onEnterKeyPressed") }, _fireEnterKeyPressed(e) { if (!this._onEnterKeyPressedAction) { return } this._onEnterKeyPressedAction({ event: e }) }, _initColorAndOpacity() { this._setCurrentColor(this.option("value")) }, _setCurrentColor(value) { value = value || "#000000"; const newColor = new _color.default(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 { if (!this._currentColor) { this._currentColor = new _color.default("#000000") } this.option("value", this._currentColor.baseColor) } }, _setBaseColor(value) { const color = value || "#000000"; const newColor = new _color.default(color); if (!newColor.colorIsInvalid) { const isBaseColorChanged = this._makeRgba(this.option("matchValue") !== this._makeRgba(newColor)); if (isBaseColorChanged) { if (this._$baseColor) { this._makeTransparentBackground(this._$baseColor, newColor) } } } }, _initMarkup() { this.callBase(); this.$element().addClass("dx-colorview"); this._renderColorPickerContainer() }, _render() { this.callBase(); this._renderPalette(); this._renderHueScale(); this._renderControlsContainer(); this._renderControls(); this._renderAlphaChannelElements() }, _makeTransparentBackground($el, color) { if (!(color instanceof _color.default)) { color = new _color.default(color) } $el.css("backgroundColor", this._makeRgba(color)) }, _makeRgba(color) { if (!(color instanceof _color.default)) { color = new _color.default(color) } return `rgba(${[color.r,color.g,color.b,color.a].join(", ")})` }, _renderValue() { this.callBase(this.option("editAlphaChannel") ? this._makeRgba(this._currentColor) : this.option("value")) }, _renderColorPickerContainer() { const $parent = this.$element(); this._$colorPickerContainer = (0, _renderer.default)("
").addClass("dx-colorview-container").appendTo($parent); this._renderHtmlRows() }, _renderHtmlRows(updatedOption) { const $renderedRows = this._$colorPickerContainer.find(".dx-colorview-container-row"); const renderedRowsCount = $renderedRows.length; const rowCount = this.option("editAlphaChannel") ? 2 : 1; let delta = renderedRowsCount - rowCount; if (delta > 0) { $renderedRows.eq(-1).remove() } if (delta < 0) { delta = Math.abs(delta); const rows = []; let i; for (i = 0; i < delta; i++) { rows.push((0, _renderer.default)("
").addClass("dx-colorview-container-row")) } if (renderedRowsCount) { for (i = 0; i < rows.length; i++) { $renderedRows.eq(0).after(rows[i]) } } else { this._$colorPickerContainer.append(rows) } } }, _renderHtmlCellInsideRow: (index, $rowParent, additionalClass) => (0, _renderer.default)("
").addClass("dx-colorview-container-cell").addClass(additionalClass).appendTo($rowParent.find(".dx-colorview-container-row").eq(index)), _renderPalette() { const $paletteCell = this._renderHtmlCellInsideRow(0, this._$colorPickerContainer, "dx-colorview-palette-cell"); const $paletteGradientWhite = (0, _renderer.default)("
").addClass([COLOR_VIEW_PALETTE_GRADIENT_CLASS, COLOR_VIEW_PALETTE_GRADIENT_WHITE_CLASS].join(" ")); const $paletteGradientBlack = (0, _renderer.default)("
").addClass([COLOR_VIEW_PALETTE_GRADIENT_CLASS, COLOR_VIEW_PALETTE_GRADIENT_BLACK_CLASS].join(" ")); this._$palette = (0, _renderer.default)("
").addClass("dx-colorview-palette").css("backgroundColor", this._currentColor.getPureColor().toHex()).appendTo($paletteCell); this._paletteHeight = (0, _size.getHeight)(this._$palette); this._paletteWidth = (0, _size.getWidth)(this._$palette); this._renderPaletteHandle(); this._$palette.append([$paletteGradientWhite, $paletteGradientBlack]) }, _renderPaletteHandle() { this._$paletteHandle = (0, _renderer.default)("
").addClass("dx-colorview-palette-handle").appendTo(this._$palette); const ariaId = `dx-${new _guid.default}`; const handleAria = { id: ariaId, role: "application" }; this.setAria(handleAria, this._$paletteHandle); this.setAria("activedescendant", ariaId, this.option("target")); this._createComponent(this._$paletteHandle, _draggable.default, { contentTemplate: null, boundary: this._$palette, allowMoveByClick: true, boundOffset: function() { return -this._paletteHandleHeight / 2 }.bind(this), onDragMove: _ref => { let { event: event } = _ref; const paletteHandlePosition = (0, _translator.locate)(this._$paletteHandle); this._updateByDrag = true; this._saveValueChangeEvent(event); this._updateColorFromHsv(this._currentColor.hsv.h, this._calculateColorSaturation(paletteHandlePosition), this._calculateColorValue(paletteHandlePosition)) } }); this._paletteHandleWidth = (0, _size.getWidth)(this._$paletteHandle); this._paletteHandleHeight = (0, _size.getHeight)(this._$paletteHandle); this._placePaletteHandle() }, _placePaletteHandle() { (0, _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(paletteHandlePosition) { const value = Math.floor(paletteHandlePosition.top + this._paletteHandleHeight / 2); return 100 - Math.round(100 * value / this._paletteHeight) }, _calculateColorSaturation(paletteHandlePosition) { const saturation = Math.floor(paletteHandlePosition.left + this._paletteHandleWidth / 2); return Math.round(100 * saturation / this._paletteWidth) }, _updateColorFromHsv(hue, saturation, value) { const { a: a } = this._currentColor; this._currentColor = new _color.default(`hsv(${[hue,saturation,value].join(",")})`); this._currentColor.a = a; this._updateColorParamsAndColorPreview(); this.applyColor() }, _renderHueScale() { const $hueScaleCell = this._renderHtmlCellInsideRow(0, this._$colorPickerContainer, "dx-colorview-hue-scale-cell"); this._$hueScaleWrapper = (0, _renderer.default)("
").addClass("dx-colorview-hue-scale-wrapper").appendTo($hueScaleCell); this._$hueScale = (0, _renderer.default)("
").addClass("dx-colorview-hue-scale").appendTo(this._$hueScaleWrapper); this._hueScaleHeight = (0, _size.getHeight)(this._$hueScale); this._hueScaleWrapperHeight = (0, _size.getOuterHeight)(this._$hueScaleWrapper); this._renderHueScaleHandle() }, _renderHueScaleHandle() { this._$hueScaleHandle = (0, _renderer.default)("
").addClass("dx-colorview-hue-scale-handle").appendTo(this._$hueScaleWrapper); this._createComponent(this._$hueScaleHandle, _draggable.default, { contentTemplate: null, boundary: this._$hueScaleWrapper, allowMoveByClick: true, dragDirection: "vertical", onDragMove: _ref2 => { let { event: event } = _ref2; this._updateByDrag = true; this._saveValueChangeEvent(event); this._updateColorHue((0, _translator.locate)(this._$hueScaleHandle).top + this._hueScaleHandleHeight / 2) } }); this._hueScaleHandleHeight = (0, _size.getHeight)(this._$hueScaleHandle); this._placeHueScaleHandle() }, _placeHueScaleHandle() { const hueScaleHeight = this._hueScaleWrapperHeight; const handleHeight = this._hueScaleHandleHeight; let top = (hueScaleHeight - handleHeight) * (360 - this._currentColor.hsv.h) / 360; if (hueScaleHeight < top + handleHeight) { top = hueScaleHeight - handleHeight } if (top < 0) { top = 0 }(0, _translator.move)(this._$hueScaleHandle, { top: Math.round(top) }) }, _updateColorHue(handlePosition) { let hue = 360 - Math.round(360 * (handlePosition - this._hueScaleHandleHeight / 2) / (this._hueScaleWrapperHeight - this._hueScaleHandleHeight)); const saturation = this._currentColor.hsv.s; const 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() { const $controlsContainerCell = this._renderHtmlCellInsideRow(0, this._$colorPickerContainer); this._$controlsContainer = (0, _renderer.default)("
").addClass("dx-colorview-controls-container").appendTo($controlsContainerCell) }, _renderControls() { this._renderColorsPreview(); this._renderRgbInputs(); this._renderHexInput() }, _renderColorsPreview() { const $colorsPreviewContainer = (0, _renderer.default)("
").addClass("dx-colorview-color-preview-container").appendTo(this._$controlsContainer); const $colorsPreviewContainerInner = (0, _renderer.default)("
").addClass("dx-colorview-color-preview-container-inner").appendTo($colorsPreviewContainer); this._$currentColor = (0, _renderer.default)("
").addClass([COLOR_VIEW_COLOR_PREVIEW, COLOR_VIEW_COLOR_PREVIEW_COLOR_NEW].join(" ")); this._$baseColor = (0, _renderer.default)("
").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() { if (this.option("editAlphaChannel")) { this._$colorPickerContainer.find(".dx-colorview-container-row").eq(1).addClass("dx-colorview-alpha-channel-row"); this._renderAlphaChannelScale(); this._renderAlphaChannelInput() } }, _renderRgbInputs() { this._rgbInputsWithLabels = [this._renderEditorWithLabel({ editorType: _number_box.default, value: this._currentColor.r, onValueChanged: this._updateColor.bind(this, false), labelText: "R", labelAriaText: _message.default.format("dxColorView-ariaRed"), labelClass: "dx-colorview-label-red" }), this._renderEditorWithLabel({ editorType: _number_box.default, value: this._currentColor.g, onValueChanged: this._updateColor.bind(this, false), labelText: "G", labelAriaText: _message.default.format("dxColorView-ariaGreen"), labelClass: "dx-colorview-label-green" }), this._renderEditorWithLabel({ editorType: _number_box.default, value: this._currentColor.b, onValueChanged: this._updateColor.bind(this, false), labelText: "B", labelAriaText: _message.default.format("dxColorView-ariaBlue"), labelClass: "dx-colorview-label-blue" })]; 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(options) { const $editor = (0, _renderer.default)("
"); const $label = (0, _renderer.default)("