From fc68973f651e10cf20cce1b2d343d7ff72ccb9d9 Mon Sep 17 00:00:00 2001 From: Hyyan Abo Fakher Date: Wed, 13 Jul 2022 11:46:27 +0200 Subject: [PATCH] fix(js): :bug: `gw_setSortModel` does not previous state correctly --- client/dist/bbj-grid-widget.js | 45388 ++++++++++++++------------- client/dist/bbj-grid-widget.min.js | 512 +- client/dist/report.html | 4 +- client/src/api/columns.js | 3 +- 4 files changed, 23535 insertions(+), 22372 deletions(-) diff --git a/client/dist/bbj-grid-widget.js b/client/dist/bbj-grid-widget.js index b4cf683f..f747d921 100644 --- a/client/dist/bbj-grid-widget.js +++ b/client/dist/bbj-grid-widget.js @@ -81,3738 +81,3593 @@ /******/ /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 40); +/******/ return __webpack_require__(__webpack_require__.s = 0); /******/ }) /************************************************************************/ -/******/ ([ -/* 0 */ +/******/ ({ + +/***/ "./node_modules/autocompleter/autocomplete.js": +/*!****************************************************!*\ + !*** ./node_modules/autocompleter/autocomplete.js ***! + \****************************************************/ +/*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__; +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.gw_getDocument = gw_getDocument; -exports.gw_getWindow = gw_getWindow; -exports.gw_escape = gw_escape; -exports.gw_uuid = gw_uuid; -exports.gw_getGrid = gw_getGrid; -exports.gw_addGrid = gw_addGrid; +(function (global, factory) { + ( false ? undefined : _typeof(exports)) === 'object' && typeof module !== 'undefined' ? module.exports = factory() : true ? !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : + __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : (undefined); +})(void 0, function () { + 'use strict'; + /* + * https://github.com/kraaden/autocomplete + * Copyright (c) 2016 Denys Krasnoshchok + * MIT License + */ -/* - * This file is part of the BBjGridExWidget plugin. - * (c) Basis Europe - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ + function autocomplete(settings) { + // just an alias to minimize JS file size + var doc = document; + var container = doc.createElement("div"); + var containerStyle = container.style; + var userAgent = navigator.userAgent; + var mobileFirefox = userAgent.indexOf("Firefox") !== -1 && userAgent.indexOf("Mobile") !== -1; + var debounceWaitMs = settings.debounceWaitMs || 0; + var preventSubmit = settings.preventSubmit || false; // 'keyup' event will not be fired on Mobile Firefox, so we have to use 'input' event instead -/** - * Get document - * - * Get the document instance according to the current BBj env - * - * @return {Object} Document instance - */ -function gw_getDocument() { - return typeof $doc !== 'undefined' ? $doc : document; -} -/** - * Get window - * - * Get the window instance according to the current BBj env - * - * @return {Object} Window instance - */ + var keyUpEventName = mobileFirefox ? "input" : "keyup"; + var items = []; + var inputValue = ""; + var minLen = 2; + var showOnFocus = settings.showOnFocus; + var selected; + var keypressCounter = 0; + var debounceTimer; + if (settings.minLength !== undefined) { + minLen = settings.minLength; + } -function gw_getWindow() { - return typeof $wnd !== 'undefined' ? $wnd : window; -} -/** - * Escape Value - * - * Change null and undefined to empty string - * - * @param {*} value - * - * @return {String} escaped value - */ + if (!settings.input) { + throw new Error("input undefined"); + } + var input = settings.input; + container.className = "autocomplete " + (settings.className || ""); // IOS implementation for fixed positioning has many bugs, so we will use absolute positioning -function gw_escape(value) { - return value !== null && value !== undefined ? value : ''; -} -/** - * Generate a unique uuid - * @see https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript - */ + containerStyle.position = "absolute"; + /** + * Detach the container from DOM + */ + function detach() { + var parent = container.parentNode; -function gw_uuid() { - return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { - var r = Math.random() * 16 | 0, - v = c == 'x' ? r : r & 0x3 | 0x8; - return v.toString(16); - }); -} -/** - * Get Grid - * - * Retrieve the grid instance from `window.BBjGridExWidget` array - * - * @param {String} id The grid's id - * - * @return {Object|null} The grid's instance ofr null - * @throws TypeError when the grid instance is not found - */ + if (parent) { + parent.removeChild(container); + } + } + /** + * Clear debouncing timer if assigned + */ -function gw_getGrid(id) { - window.BBjGridExWidget = window.BBjGridExWidget || {}; - var grid = window.BBjGridExWidget[id] || null; + function clearDebounceTimer() { + if (debounceTimer) { + window.clearTimeout(debounceTimer); + } + } + /** + * Attach the container to DOM + */ - if (!grid) { - var registeredGrids = JSON.stringify(Object.keys(window.BBjGridExWidget)); //getFuncArgs(func).forEach((key, i) => argsObj[key] = args[i]); - throw new TypeError("\n\n[Grid Not Found] The method asked for non-existent grid instance.\n-------------------------------------------------------------------\nRequired Grid Id : ".concat(id, " \nRegistered Grids : ").concat(registeredGrids, "\n")); - } + function attach() { + if (!container.parentNode) { + doc.body.appendChild(container); + } + } + /** + * Check if container for autocomplete is displayed + */ - return grid; -} -/** - * Add Grid - * - * Store a new grid instance by in the `window.BBjGridExWidget` array - * - * @param {String} id The grid's id - * @param {Object} options The grid's options - * - * @return {Object} Stored grid - */ + function containerDisplayed() { + return !!container.parentNode; + } + /** + * Clear autocomplete state and hide container + */ -function gw_addGrid(id, options) { - window.BBjGridExWidget = window.BBjGridExWidget || {}; - window.BBjGridExWidget[id] = options; - return gw_getGrid(id); -} -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { + function clear() { + // prevent the update call if there are pending AJAX requests + keypressCounter++; + items = []; + inputValue = ""; + selected = undefined; + detach(); + } + /** + * Update autocomplete position + */ -"use strict"; + function updatePosition() { + if (!containerDisplayed()) { + return; + } -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.gw_debounce = gw_debounce; -exports.gw_sendEvent = gw_sendEvent; -exports.gw_parseNode = gw_parseNode; -exports.gw_parseNodeFromEvent = gw_parseNodeFromEvent; + containerStyle.height = "auto"; + containerStyle.width = input.offsetWidth + "px"; + var maxHeight = 0; + var inputRect; -var _utilities = __webpack_require__(0); + function calc() { + var docEl = doc.documentElement; + var clientTop = docEl.clientTop || doc.body.clientTop || 0; + var clientLeft = docEl.clientLeft || doc.body.clientLeft || 0; + var scrollTop = window.pageYOffset || docEl.scrollTop; + var scrollLeft = window.pageXOffset || docEl.scrollLeft; + inputRect = input.getBoundingClientRect(); + var top = inputRect.top + input.offsetHeight + scrollTop - clientTop; + var left = inputRect.left + scrollLeft - clientLeft; + containerStyle.top = top + "px"; + containerStyle.left = left + "px"; + maxHeight = window.innerHeight - (inputRect.top + input.offsetHeight); -/* eslint-disable no-prototype-builtins */ + if (maxHeight < 0) { + maxHeight = 0; + } -/* - * This file is part of the BBjGridExWidget plugin. - * (c) Basis Europe - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ + containerStyle.top = top + "px"; + containerStyle.bottom = ""; + containerStyle.left = left + "px"; + containerStyle.maxHeight = maxHeight + "px"; + } // the calc method must be called twice, otherwise the calculation may be wrong on resize event (chrome browser) -/** https://davidwalsh.name/javascript-debounce-function */ -function gw_debounce(func, wait, immediate) { - var timeout; - return function () { - var context = this, - args = arguments; - var later = function later() { - timeout = null; + calc(); + calc(); - if (!immediate) { - func.apply(context, args); + if (settings.customize && inputRect) { + settings.customize(input, inputRect, container, maxHeight); } - }; + } + /** + * Redraw the autocomplete div element with suggestions + */ - var callNow = immediate && !timeout; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) { - func.apply(context, args); - } - }; -} -/** - * Send an event to BBj side - * - * @param {Array} context the grid's context - * @param {*} payload the event payload - * @param {String} eventId the event's id - */ + function update() { + // delete all children from autocomplete DOM container + while (container.firstChild) { + container.removeChild(container.firstChild); + } // function for rendering autocomplete suggestions -function gw_sendEvent(context) { - var payload = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var eventId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; - var registeredInterests = context.interests || []; + var render = function render(item, currentValue) { + var itemElement = doc.createElement("div"); + itemElement.textContent = item.label || ""; + return itemElement; + }; - if (registeredInterests.includes(eventId)) { - var div = (0, _utilities.gw_getDocument)().getElementById("".concat(context.id)); // bui or webapp + if (settings.render) { + render = settings.render; + } // function to render autocomplete groups - if ([5, 6].indexOf(context.platform) > -1) { - var htmlviewId = "htmlview-".concat(context.id); - var container = (0, _utilities.gw_getDocument)().getElementsByClassName(htmlviewId)[0]; - if (typeof container.basisDispatchCustomEvent === 'function') { - container.basisDispatchCustomEvent(div, payload); - } else { - window.basisDispatchCustomEvent(div, payload); + var renderGroup = function renderGroup(groupName, currentValue) { + var groupDiv = doc.createElement("div"); + groupDiv.textContent = groupName; + return groupDiv; + }; + + if (settings.renderGroup) { + renderGroup = settings.renderGroup; } - } else { - window.basisDispatchCustomEvent(div, payload); - } - } -} -/** - * @typedef {Object} BBjGridExWidgetRow - * - * @property {number} id - * @property {number} index - * @property {number} parentKey - * @property {number} childIndex - * @property {boolean} selected - */ -/** - * Parse a node as BBjGridExWidgetRow - * - * @param {Object} node ag grid node - * @param {Object} context ag grid context - * - * @returns {BBjGridExWidgetRow|Boolean} object formatted as BBjGridExWidgetRow. - * false if the node is for group node - */ + var fragment = doc.createDocumentFragment(); + var prevGroup = "#9?$"; + items.forEach(function (item) { + if (item.group && item.group !== prevGroup) { + prevGroup = item.group; + var groupDiv = renderGroup(item.group, inputValue); + if (groupDiv) { + groupDiv.className += " group"; + fragment.appendChild(groupDiv); + } + } -function gw_parseNode(node, context) { - if (true === node.group) { - return false; - } // we do not manage groups + var div = render(item, inputValue); + if (div) { + div.addEventListener("click", function (ev) { + settings.onSelect(item, input); + clear(); + ev.preventDefault(); + ev.stopPropagation(); + }); - var getRowNodeId = node.rowPinned ? '__ROW_INDEX' : context.getRowNodeId; - return { - i: context.hasOwnProperty('getRowNodeId') && node.data[getRowNodeId] ? node.data[getRowNodeId] : node.id, - // id - x: node.rowIndex, - // index - p: node.hasOwnProperty('parent') && node.parent.hasOwnProperty('key') ? node.parent.key : '', - // parent key - c: node.rowPinned ? -1 : node.childIndex, - //childIndex - s: Boolean(node.selected), - // selected - // client row - cr: context.hasOwnProperty('includeClientRowData') && context['includeClientRowData'] === true ? node.data : null, - pp: node.rowPinned // pin position + if (item === selected) { + div.className += " selected"; + } - }; -} -/** - * Parse node from event - * - * Parse node in the paSsed event as BBjGridExWidgetRow - * - * @param {Object} e - * - * @returns {BBjGridExWidgetRow} - */ + fragment.appendChild(div); + } + }); + container.appendChild(fragment); + if (items.length < 1) { + if (settings.emptyMsg) { + var empty = doc.createElement("div"); + empty.className = "empty"; + empty.textContent = settings.emptyMsg; + container.appendChild(empty); + } else { + clear(); + return; + } + } -function gw_parseNodeFromEvent(e) { - return gw_parseNode(e.node, e.context); -} + attach(); + updatePosition(); + updateScroll(); + } -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { + function updateIfDisplayed() { + if (containerDisplayed()) { + update(); + } + } -"use strict"; + function resizeEventHandler() { + updateIfDisplayed(); + } + function scrollEventHandler(e) { + if (e.target !== container) { + updateIfDisplayed(); + } else { + e.preventDefault(); + } + } -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + function keyupEventHandler(ev) { + var keyCode = ev.which || ev.keyCode || 0; + var ignore = [38 + /* Up */ + , 13 + /* Enter */ + , 27 + /* Esc */ + , 39 + /* Right */ + , 37 + /* Left */ + , 16 + /* Shift */ + , 17 + /* Ctrl */ + , 18 + /* Alt */ + , 20 + /* CapsLock */ + , 91 + /* WindowsKey */ + , 9 + /* Tab */ + ]; -var g; // This works in non-strict mode + for (var _i = 0, ignore_1 = ignore; _i < ignore_1.length; _i++) { + var key = ignore_1[_i]; -g = function () { - return this; -}(); + if (keyCode === key) { + return; + } + } -try { - // This works if eval is allowed (see CSP) - g = g || new Function("return this")(); -} catch (e) { - // This works if the window reference is available - if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === "object") g = window; -} // g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} + if (keyCode >= 112 + /* F1 */ + && keyCode <= 123 + /* F12 */ + ) { + return; + } // the down key is used to open autocomplete -module.exports = g; + if (keyCode === 40 + /* Down */ + && containerDisplayed()) { + return; + } -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { + startFetch(0 + /* Keyboard */ + ); + } + /** + * Automatically move scroll bar if selected item is not visible + */ -"use strict"; + function updateScroll() { + var elements = container.getElementsByClassName("selected"); -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.GW_EVENT_READY = exports.GW_EVENT_FILTER_CHANGED = exports.GW_EVENT_KEYPRESS = exports.GW_EVENT_RANGE_SELECTION_CHANGED = exports.GW_EVENT_GRID_STATE_CHANGE = exports.GW_EVENT_ROW_VALUE_CHANGED = exports.GW_EVENT_ROW_EDITING_STOPPED = exports.GW_EVENT_ROW_EDITING_STARTED = exports.GW_EVENT_CELL_VALUE_CHANGED = exports.GW_EVENT_CELL_EDITING_STOPPED = exports.GW_EVENT_CELL_EDITING_STARTED = exports.GW_EVENT_CELL_DOUBLE_CLICK = exports.GW_EVENT_CELL_CLICK = exports.GW_EVENT_ROW_DOUBLE_CLICK = exports.GW_EVENT_ROW_CLICK = exports.GW_EVENT_ROW_SELECT = void 0; + if (elements.length > 0) { + var element = elements[0]; // make group visible -/* - * This file is part of the BBjGridExWidget plugin. - * (c) Basis Europe - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -// selection constants -var GW_EVENT_ROW_SELECT = 69; -exports.GW_EVENT_ROW_SELECT = GW_EVENT_ROW_SELECT; -var GW_EVENT_ROW_CLICK = 5011; -exports.GW_EVENT_ROW_CLICK = GW_EVENT_ROW_CLICK; -var GW_EVENT_ROW_DOUBLE_CLICK = 52; -exports.GW_EVENT_ROW_DOUBLE_CLICK = GW_EVENT_ROW_DOUBLE_CLICK; -var GW_EVENT_CELL_CLICK = 5001; -exports.GW_EVENT_CELL_CLICK = GW_EVENT_CELL_CLICK; -var GW_EVENT_CELL_DOUBLE_CLICK = 5002; // editing constants + var previous = element.previousElementSibling; -exports.GW_EVENT_CELL_DOUBLE_CLICK = GW_EVENT_CELL_DOUBLE_CLICK; -var GW_EVENT_CELL_EDITING_STARTED = 5003; -exports.GW_EVENT_CELL_EDITING_STARTED = GW_EVENT_CELL_EDITING_STARTED; -var GW_EVENT_CELL_EDITING_STOPPED = 5004; -exports.GW_EVENT_CELL_EDITING_STOPPED = GW_EVENT_CELL_EDITING_STOPPED; -var GW_EVENT_CELL_VALUE_CHANGED = 5005; -exports.GW_EVENT_CELL_VALUE_CHANGED = GW_EVENT_CELL_VALUE_CHANGED; -var GW_EVENT_ROW_EDITING_STARTED = 5006; -exports.GW_EVENT_ROW_EDITING_STARTED = GW_EVENT_ROW_EDITING_STARTED; -var GW_EVENT_ROW_EDITING_STOPPED = 5007; -exports.GW_EVENT_ROW_EDITING_STOPPED = GW_EVENT_ROW_EDITING_STOPPED; -var GW_EVENT_ROW_VALUE_CHANGED = 5012; // state constants - -exports.GW_EVENT_ROW_VALUE_CHANGED = GW_EVENT_ROW_VALUE_CHANGED; -var GW_EVENT_GRID_STATE_CHANGE = 5008; // range selection + if (previous && previous.className.indexOf("group") !== -1 && !previous.previousElementSibling) { + element = previous; + } -exports.GW_EVENT_GRID_STATE_CHANGE = GW_EVENT_GRID_STATE_CHANGE; -var GW_EVENT_RANGE_SELECTION_CHANGED = 5009; // keyboard events + if (element.offsetTop < container.scrollTop) { + container.scrollTop = element.offsetTop; + } else { + var selectBottom = element.offsetTop + element.offsetHeight; + var containerBottom = container.scrollTop + container.offsetHeight; -exports.GW_EVENT_RANGE_SELECTION_CHANGED = GW_EVENT_RANGE_SELECTION_CHANGED; -var GW_EVENT_KEYPRESS = 5010; // filters + if (selectBottom > containerBottom) { + container.scrollTop += selectBottom - containerBottom; + } + } + } + } + /** + * Select the previous item in suggestions + */ -exports.GW_EVENT_KEYPRESS = GW_EVENT_KEYPRESS; -var GW_EVENT_FILTER_CHANGED = 5013; // ready -exports.GW_EVENT_FILTER_CHANGED = GW_EVENT_FILTER_CHANGED; -var GW_EVENT_READY = 5014; -exports.GW_EVENT_READY = GW_EVENT_READY; + function selectPrev() { + if (items.length < 1) { + selected = undefined; + } else { + if (selected === items[0]) { + selected = items[items.length - 1]; + } else { + for (var i = items.length - 1; i > 0; i--) { + if (selected === items[i] || i === 1) { + selected = items[i - 1]; + break; + } + } + } + } + } + /** + * Select the next item in suggestions + */ -/***/ }), -/* 4 */ -/***/ (function(module, exports, __webpack_require__) { -"use strict"; + function selectNext() { + if (items.length < 1) { + selected = undefined; + } + if (!selected || selected === items[items.length - 1]) { + selected = items[0]; + return; + } -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; + for (var i = 0; i < items.length - 1; i++) { + if (selected === items[i]) { + selected = items[i + 1]; + break; + } + } + } -var _Symbol2 = _interopRequireDefault(__webpack_require__(9)); + function keydownEventHandler(ev) { + var keyCode = ev.which || ev.keyCode || 0; -var _getRawTag = _interopRequireDefault(__webpack_require__(68)); + if (keyCode === 38 + /* Up */ + || keyCode === 40 + /* Down */ + || keyCode === 27 + /* Esc */ + ) { + var containerIsDisplayed = containerDisplayed(); -var _objectToString = _interopRequireDefault(__webpack_require__(69)); + if (keyCode === 27 + /* Esc */ + ) { + clear(); + } else { + if (!containerDisplayed || items.length < 1) { + return; + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + keyCode === 38 + /* Up */ + ? selectPrev() : selectNext(); + update(); + } -/** `Object#toString` result references. */ -var nullTag = '[object Null]', - undefinedTag = '[object Undefined]'; -/** Built-in value references. */ + ev.preventDefault(); -var symToStringTag = _Symbol2.default ? _Symbol2.default.toStringTag : undefined; -/** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ + if (containerIsDisplayed) { + ev.stopPropagation(); + } -function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; - } + return; + } - return symToStringTag && symToStringTag in Object(value) ? (0, _getRawTag.default)(value) : (0, _objectToString.default)(value); -} + if (keyCode === 13 + /* Enter */ + ) { + if (selected) { + settings.onSelect(selected, input); + clear(); + } -var _default = baseGetTag; -exports.default = _default; + if (preventSubmit) { + ev.preventDefault(); + } + } + } -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { + function focusEventHandler() { + if (showOnFocus) { + startFetch(1 + /* Focus */ + ); + } + } -"use strict"; + function startFetch(trigger) { + // if multiple keys were pressed, before we get update from server, + // this may cause redrawing our autocomplete multiple times after the last key press. + // to avoid this, the number of times keyboard was pressed will be + // saved and checked before redraw our autocomplete box. + var savedKeypressCounter = ++keypressCounter; + var val = input.value; + if (val.length >= minLen || trigger === 1 + /* Focus */ + ) { + clearDebounceTimer(); + debounceTimer = window.setTimeout(function () { + settings.fetch(val, function (elements) { + if (keypressCounter === savedKeypressCounter && elements) { + items = elements; + inputValue = val; + selected = items.length > 0 ? items[0] : undefined; + update(); + } + }, 0 + /* Keyboard */ + ); + }, trigger === 0 + /* Keyboard */ + ? debounceWaitMs : 0); + } else { + clear(); + } + } -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; + function blurEventHandler() { + // we need to delay clear, because when we click on an item, blur will be called before click and remove items from DOM + setTimeout(function () { + if (doc.activeElement !== input) { + clear(); + } + }, 200); + } + /** + * Fixes #26: on long clicks focus will be lost and onSelect method will not be called + */ -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return value != null && _typeof(value) == 'object'; -} + container.addEventListener("mousedown", function (evt) { + evt.stopPropagation(); + evt.preventDefault(); + }); + /** + * Fixes #30: autocomplete closes when scrollbar is clicked in IE + * See: https://stackoverflow.com/a/9210267/13172349 + */ -var _default = isObjectLike; -exports.default = _default; + container.addEventListener("focus", function () { + return input.focus(); + }); + /** + * This function will remove DOM elements and clear event handlers + */ -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { + function destroy() { + input.removeEventListener("focus", focusEventHandler); + input.removeEventListener("keydown", keydownEventHandler); + input.removeEventListener(keyUpEventName, keyupEventHandler); + input.removeEventListener("blur", blurEventHandler); + window.removeEventListener("resize", resizeEventHandler); + doc.removeEventListener("scroll", scrollEventHandler, true); + clearDebounceTimer(); + clear(); + } // setup event handlers -"use strict"; + input.addEventListener("keydown", keydownEventHandler); + input.addEventListener(keyUpEventName, keyupEventHandler); + input.addEventListener("blur", blurEventHandler); + input.addEventListener("focus", focusEventHandler); + window.addEventListener("resize", resizeEventHandler); + doc.addEventListener("scroll", scrollEventHandler, true); + return { + destroy: destroy + }; + } -module.exports = function (module) { - if (!module.webpackPolyfill) { - module.deprecate = function () {}; - - module.paths = []; // module.parent = undefined by default - - if (!module.children) module.children = []; - Object.defineProperty(module, "loaded", { - enumerable: true, - get: function get() { - return module.l; - } - }); - Object.defineProperty(module, "id", { - enumerable: true, - get: function get() { - return module.i; - } - }); - module.webpackPolyfill = 1; - } - - return module; -}; + return autocomplete; +}); /***/ }), -/* 7 */ + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/basis-aggrid-components/dist/basis-aggrid-components.js": +/*!**********************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4!./node_modules/basis-aggrid-components/dist/basis-aggrid-components.js ***! + \**********************************************************************************************************************/ +/*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; +/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; -/** - * [Recursively parses a stringified JSON] - * @param {[type]} jsonString [stringified json to parse] - * @return {[type]} [normalized Javascript object] - */ +function _typeof2(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); } -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } +(function webpackUniversalModuleDefinition(root, factory) { + if (( false ? undefined : _typeof2(exports)) === 'object' && ( false ? undefined : _typeof2(module)) === 'object') module.exports = factory();else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {} +})(typeof self !== 'undefined' ? self : void 0, function () { + return ( + /******/ + function (modules) { + // webpackBootstrap -function deepParseJson(jsonString) { - // if not stringified json rather a simple string value then JSON.parse will throw error - // otherwise continue recursion - if (typeof jsonString === 'string') { - try { - return deepParseJson(JSON.parse(jsonString)); - } catch (err) { - return jsonString; - } - } else if (Array.isArray(jsonString)) { - // if an array is received, map over the array and deepParse each value - return jsonString.map(function (val) { - return deepParseJson(val); - }); - } else if (_typeof(jsonString) === 'object' && jsonString !== null) { - // if an object is received then deepParse each element in the object - // typeof null returns 'object' too, so we have to eliminate that - return Object.keys(jsonString).reduce(function (obj, key) { - obj[key] = deepParseJson(jsonString[key]); - return obj; - }, {}); - } else { - // otherwise return whatever was received - return jsonString; - } -} + /******/ + // The module cache -module.exports = { - deepParseJson: deepParseJson -}; + /******/ + var installedModules = {}; + /******/ -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { + /******/ + // The require function -"use strict"; + /******/ + function __webpack_require__(moduleId) { + /******/ -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; + /******/ + // Check if module is in cache -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + /******/ + if (installedModules[moduleId]) { + /******/ + return installedModules[moduleId].exports; + /******/ + } + /******/ + // Create a new module (and put it into the cache) -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = _typeof(value); + /******/ - return value != null && (type == 'object' || type == 'function'); -} -var _default = isObject; -exports.default = _default; + var module = installedModules[moduleId] = { + /******/ + i: moduleId, -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { + /******/ + l: false, -"use strict"; + /******/ + exports: {} + /******/ + }; + /******/ -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; + /******/ + // Execute the module function -var _root = _interopRequireDefault(__webpack_require__(10)); + /******/ -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + /******/ -/** Built-in value references. */ -var _Symbol = _root.default.Symbol; -var _default = _Symbol; -exports.default = _default; + /******/ + // Flag the module as loaded -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { + /******/ -"use strict"; + module.l = true; + /******/ + /******/ + // Return the exports of the module -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; + /******/ -var _freeGlobal = _interopRequireDefault(__webpack_require__(25)); + return module.exports; + /******/ + } + /******/ -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + /******/ -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + /******/ + // expose the modules object (__webpack_modules__) -/** Detect free variable `self`. */ -var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self; -/** Used as a reference to the global object. */ + /******/ -var root = _freeGlobal.default || freeSelf || Function('return this')(); -var _default = root; -exports.default = _default; -/***/ }), -/* 11 */ -/***/ (function(module, exports, __webpack_require__) { + __webpack_require__.m = modules; + /******/ -"use strict"; + /******/ + // expose the module cache + /******/ -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; + __webpack_require__.c = installedModules; + /******/ -/** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ -function eq(value, other) { - return value === other || value !== value && other !== other; -} + /******/ + // define getter function for harmony exports -var _default = eq; -exports.default = _default; + /******/ -/***/ }), -/* 12 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; + __webpack_require__.d = function (exports, name, getter) { + /******/ + if (!__webpack_require__.o(exports, name)) { + /******/ + Object.defineProperty(exports, name, { + /******/ + configurable: false, + /******/ + enumerable: true, -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; + /******/ + get: getter + /******/ -var _isFunction = _interopRequireDefault(__webpack_require__(24)); + }); + /******/ + } + /******/ -var _isLength = _interopRequireDefault(__webpack_require__(30)); + }; + /******/ -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + /******/ + // getDefaultExport function for compatibility with non-harmony modules -/** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ -function isArrayLike(value) { - return value != null && (0, _isLength.default)(value.length) && !(0, _isFunction.default)(value); -} + /******/ -var _default = isArrayLike; -exports.default = _default; -/***/ }), -/* 13 */ -/***/ (function(module, exports, __webpack_require__) { + __webpack_require__.n = function (module) { + /******/ + var getter = module && module.__esModule ? + /******/ + function getDefault() { + return module['default']; + } : + /******/ + function getModuleExports() { + return module; + }; + /******/ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + __webpack_require__.d(getter, 'a', getter); + /******/ -var stylesInDom = {}; -var memoize = function (fn) { - var memo; + return getter; + /******/ + }; + /******/ - return function () { - if (typeof memo === "undefined") memo = fn.apply(this, arguments); - return memo; - }; -}; + /******/ + // Object.prototype.hasOwnProperty.call -var isOldIE = memoize(function () { - // Test for IE <= 9 as proposed by Browserhacks - // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805 - // Tests for existence of standard globals is to allow style-loader - // to operate correctly into non-standard environments - // @see https://github.com/webpack-contrib/style-loader/issues/177 - return window && document && document.all && !window.atob; -}); + /******/ -var getTarget = function (target) { - return document.querySelector(target); -}; -var getElement = (function (fn) { - var memo = {}; + __webpack_require__.o = function (object, property) { + return Object.prototype.hasOwnProperty.call(object, property); + }; + /******/ - return function(target) { - // If passing function in options, then use it for resolve "head" element. - // Useful for Shadow Root style i.e - // { - // insertInto: function () { return document.querySelector("#foo").shadowRoot } - // } - if (typeof target === 'function') { - return target(); - } - if (typeof memo[target] === "undefined") { - var styleTarget = getTarget.call(this, target); - // Special case to return head of iframe instead of iframe itself - if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) { - try { - // This will throw an exception if access to iframe is blocked - // due to cross-origin restrictions - styleTarget = styleTarget.contentDocument.head; - } catch(e) { - styleTarget = null; - } - } - memo[target] = styleTarget; - } - return memo[target] - }; -})(); + /******/ + // __webpack_public_path__ -var singleton = null; -var singletonCounter = 0; -var stylesInsertedAtTop = []; + /******/ -var fixUrls = __webpack_require__(122); -module.exports = function(list, options) { - if (typeof DEBUG !== "undefined" && DEBUG) { - if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment"); - } + __webpack_require__.p = ""; + /******/ - options = options || {}; + /******/ + // Load entry module and return exports - options.attrs = typeof options.attrs === "object" ? options.attrs : {}; + /******/ - // Force single-tag solution on IE6-9, which has a hard limit on the # of