From 7b89376208a95b713824cd0ce5f233c7c138a8cd Mon Sep 17 00:00:00 2001 From: Hyyan Abo Fakher Date: Mon, 4 May 2020 15:36:45 +0200 Subject: [PATCH] feat: add `getRow` api method --- BBjGridExWidget.bbj | 21 + client/dist/bbj-grid-widget.js | 26576 +++++++++++++----------- client/dist/bbj-grid-widget.min.js | 288 +- client/dist/report.html | 4 +- client/src/api/rows.js | 15 + test/BBjGridExWidget/RowsAPITest.bbjt | 15 + 6 files changed, 15146 insertions(+), 11773 deletions(-) diff --git a/BBjGridExWidget.bbj b/BBjGridExWidget.bbj index c4fa5b17..4101e3c5 100644 --- a/BBjGridExWidget.bbj +++ b/BBjGridExWidget.bbj @@ -2433,6 +2433,27 @@ class public BBjGridExWidget extends BBjWidget implements GxColumnsManagerInterf methodret rows! methodend rem /** + rem * Returns the row with the given key from the grid. + rem * + rem * Note : if you only need to get the row and + rem * you don't care about other meta data like parent(when grouping) , isSelected,... then use the + rem * ResultSet API (ex ResultSet.getItem(BBjString key!) ) + rem * + rem * @param BBjString key! the row's key + rem * + rem * @return GxClientRowModel the grid's row model + rem * + rem * @see ResultSet.getItem + rem */ + method public GxClientRowModel getRow(BBjString key!) + returnedRow! = #getExecutor().execute("$wnd.gw_getRow('" + #GRIDID$ + "','" + key! + "')" , 0) + if returnedRow! <> null() and len(returnedRow!) > 0 then + methodret #getClientJsonFactory().getRow(returnedRow!) + FI + + methodret null() + methodend + rem /** rem * Get the rows from grid in the given phase after applying the given rem * filter expression. rem * diff --git a/client/dist/bbj-grid-widget.js b/client/dist/bbj-grid-widget.js index 909eb65a..bd2088a6 100644 --- a/client/dist/bbj-grid-widget.js +++ b/client/dist/bbj-grid-widget.js @@ -87,14 +87,26 @@ /******/ ({ /***/ "../../basis-input-masking/node_modules/bbj-masks/src/NumberMask/NumberMask.js": -/*!*********************************************************************************************!*\ - !*** /mnt/d/Github/basis-input-masking/node_modules/bbj-masks/src/NumberMask/NumberMask.js ***! - \*********************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/*!*****************************************************************************************!*\ + !*** D:/Github/basis-input-masking/node_modules/bbj-masks/src/NumberMask/NumberMask.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + /* * This file is part of bbj-masks lib. * (c) Basis Europe @@ -110,379 +122,393 @@ __webpack_require__.r(__webpack_exports__); * * @author Hyyan Abo Fakher */ -class NumberMask { - /** - * Mask the given number with the given mask according to BBj rules - * - * @param {Number} number the number to format - * @param {String} mask the mask to use for formatting - * @param {String} [groupingSeparator=,] - a char which will be used as a grouping separator - * @param {String} [decimalSeparator=.] - a char which will be used as a decimal separator - * @param {Boolean} [forceTrailingZeros=false] - Affects the output by switching the way a mask with "#" characters in the trailing positions is filled. - * for example, the function `NumberMask.mask(.10:"#.##")` returns ` .10` instead of ` .1 ` - * @param {Boolean} [loose=true] when true , errors will be ignored and the method will try at apply the mask - * anyway , otherwise it will stop at first error and throw it. - * - * @throws {MaskError} only if loose is disabled - * - * @returns {String} the masked number - */ - static mask( - number, - mask, - groupingSeparator = ',', - decimalSeparator = '.', - forceTrailingZeros = false, - loose = true - ) { - const maskLen = mask.length - if (0 === maskLen) { - if (loose) return str - // friendly silent fail - else - throw { - name: 'MaskError', - message: `MaskError: Mask is empty` - } - } +var NumberMask = /*#__PURE__*/function () { + function NumberMask() { + _classCallCheck(this, NumberMask); + } - // Get magnitude and precision of MASK - let maskBeforeDecimal = 0 - let maskAfterDecimal = 0 - let foundDecimal = false - for (let i = 0; i < maskLen; ++i) { - const m = mask.charAt(i) - if (m == '0' || m == '#') { - if (foundDecimal) ++maskAfterDecimal - else ++maskBeforeDecimal - } else if (m == '.') foundDecimal = true - } + _createClass(NumberMask, null, [{ + key: "mask", + + /** + * Mask the given number with the given mask according to BBj rules + * + * @param {Number} number the number to format + * @param {String} mask the mask to use for formatting + * @param {String} [groupingSeparator=,] - a char which will be used as a grouping separator + * @param {String} [decimalSeparator=.] - a char which will be used as a decimal separator + * @param {Boolean} [forceTrailingZeros=false] - Affects the output by switching the way a mask with "#" characters in the trailing positions is filled. + * for example, the function `NumberMask.mask(.10:"#.##")` returns ` .10` instead of ` .1 ` + * @param {Boolean} [loose=true] when true , errors will be ignored and the method will try at apply the mask + * anyway , otherwise it will stop at first error and throw it. + * + * @throws {MaskError} only if loose is disabled + * + * @returns {String} the masked number + */ + value: function mask(number, _mask) { + var groupingSeparator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ','; + var decimalSeparator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '.'; + var forceTrailingZeros = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; + var loose = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true; + var maskLen = _mask.length; + + if (0 === maskLen) { + if (loose) return str; // friendly silent fail + else throw { + name: 'MaskError', + message: "MaskError: Mask is empty" + }; + } // Get magnitude and precision of MASK + + + var maskBeforeDecimal = 0; + var maskAfterDecimal = 0; + var foundDecimal = false; - let num = NumberMask._round(number, maskAfterDecimal) - let bytes = NumberMask._toCharArray(num) + for (var i = 0; i < maskLen; ++i) { + var m = _mask.charAt(i); - // Get magnitude and precision of NUMBER - let inLen = bytes.length - let numBeforeDecimal = 0 - let numAfterDecimal = 0 - foundDecimal = false - for (let i = 0; i < inLen; ++i) { - if (bytes[i] == '.') foundDecimal = true - else { - if (foundDecimal) ++numAfterDecimal - else ++numBeforeDecimal + if (m == '0' || m == '#') { + if (foundDecimal) ++maskAfterDecimal;else ++maskBeforeDecimal; + } else if (m == '.') foundDecimal = true; } - } - // always ignore mask overflow - if (numBeforeDecimal > maskBeforeDecimal) { - if (loose) return number.toString() - // friendly silent fail - else - throw { - name: 'MaskError', - message: `MaskError: Number is too large for mask` - } - } + var num = NumberMask._round(number, maskAfterDecimal); + + var bytes = NumberMask._toCharArray(num); // Get magnitude and precision of NUMBER - // round if mask is for a lower precision number - if (numAfterDecimal > maskAfterDecimal) { - num = NumberMask._round(num, maskAfterDecimal) - bytes = NumberMask._toCharArray(num) - inLen = bytes.length - // Get new magnitude and precision of NUMBER - numBeforeDecimal = 0 - numAfterDecimal = 0 - foundDecimal = false - for (let i = 0; i < inLen; ++i) { - if (bytes[i] == '.') foundDecimal = true - else { - if (foundDecimal) ++numAfterDecimal - else ++numBeforeDecimal + var inLen = bytes.length; + var numBeforeDecimal = 0; + var numAfterDecimal = 0; + foundDecimal = false; + + for (var _i = 0; _i < inLen; ++_i) { + if (bytes[_i] == '.') foundDecimal = true;else { + if (foundDecimal) ++numAfterDecimal;else ++numBeforeDecimal; } - } + } // always ignore mask overflow + - // always ignore mask overflow if (numBeforeDecimal > maskBeforeDecimal) { - if (loose) return number.toString() - // friendly silent fail - else - throw { + if (loose) return number.toString(); // friendly silent fail + else throw { name: 'MaskError', - message: `MaskError: Number is too large for mask` + message: "MaskError: Number is too large for mask" + }; + } // round if mask is for a lower precision number + + + if (numAfterDecimal > maskAfterDecimal) { + num = NumberMask._round(num, maskAfterDecimal); + bytes = NumberMask._toCharArray(num); + inLen = bytes.length; // Get new magnitude and precision of NUMBER + + numBeforeDecimal = 0; + numAfterDecimal = 0; + foundDecimal = false; + + for (var _i2 = 0; _i2 < inLen; ++_i2) { + if (bytes[_i2] == '.') foundDecimal = true;else { + if (foundDecimal) ++numAfterDecimal;else ++numBeforeDecimal; } + } // always ignore mask overflow + + + if (numBeforeDecimal > maskBeforeDecimal) { + if (loose) return number.toString(); // friendly silent fail + else throw { + name: 'MaskError', + message: "MaskError: Number is too large for mask" + }; + } } - } - let fillByte = ' ', - floatByte = ' ' - let inPos = 0, - outPos = 0, - floatPos = 0 - if (mask.charAt(0) == '*') fillByte = '*' - - const fillInit = fillByte - const isNegative = NumberMask._getSign(num) < 0 - let emitDecimal = inLen > 0 || mask.indexOf('0') >= 0 - let foundZero = false - let foundDigit = false - let currency = false - foundDecimal = false - - let ret = new Array(maskLen) - - for (let maskPos = 0; maskPos < maskLen; ++maskPos) { - let m = mask.charAt(maskPos) - switch (m) { - case '0': - --maskBeforeDecimal - if (maskBeforeDecimal < numBeforeDecimal && inPos < inLen) { - ret[outPos] = bytes[inPos] - ++inPos - foundDigit = true - } else { - ret[outPos] = '0' - foundZero = true - } - ++outPos - break - - case '#': - --maskBeforeDecimal - if (maskBeforeDecimal < numBeforeDecimal && inPos < inLen) { - ret[outPos] = bytes[inPos] - ++inPos - foundDigit = true - } else { - ret[outPos] = - foundDecimal && - forceTrailingZeros && - NumberMask._getSign(num) != 0 - ? '0' - : fillByte - if (!foundDecimal) floatPos = maskPos - } - ++outPos - break - - case ',': - if (foundZero || inPos > 0) ret[outPos] = groupingSeparator - else { - ret[outPos] = fillByte - if (!foundDecimal) floatPos = maskPos - } - ++outPos - break - - case '-': - if (!foundDigit && floatByte == ' ') { - if (isNegative) floatByte = '-' - ret[outPos] = fillByte - floatPos = foundDecimal ? -1 : maskPos - } else ret[outPos] = isNegative ? '-' : fillByte - ++outPos - break - - case '+': - if (!foundDigit && floatByte == ' ') { - floatByte = isNegative ? '-' : '+' - ret[outPos] = fillByte - floatPos = foundDecimal ? -1 : maskPos - } else ret[outPos] = isNegative ? '-' : '+' - ++outPos - break - - case '$': - if (!foundDigit && floatByte == ' ') { - floatByte = '$' - ret[outPos] = fillByte - floatPos = foundDecimal ? -1 : maskPos - } else { - ret[outPos] = '$' - } - ++outPos - break - - // case '&': - // currency = true - // if (!foundDigit && floatByte == ' ') { - // floatByte = '&' - // ret[outPos] = fillByte - // floatPos = foundDecimal ? -1 : maskPos - // } else { - // ret[outPos] = '&' - // } - // ++outPos - // break - - // case '@': - // currency = true - // if (!foundDigit && floatByte == ' ') { - // floatByte = '@' - // ret[outPos] = fillByte - // floatPos = foundDecimal ? -1 : maskPos - // } else { - // ret[outPos] = '@' - // } - // ++outPos - // break - - case '(': - if (!foundDigit && floatByte == ' ') { - if (isNegative) floatByte = '(' - ret[outPos] = fillByte - floatPos = foundDecimal ? -1 : maskPos - } else { - if (isNegative) { - ret[outPos] = '(' + var fillByte = ' ', + floatByte = ' '; + var inPos = 0, + outPos = 0, + floatPos = 0; + if (_mask.charAt(0) == '*') fillByte = '*'; + var fillInit = fillByte; + var isNegative = NumberMask._getSign(num) < 0; + var emitDecimal = inLen > 0 || _mask.indexOf('0') >= 0; + var foundZero = false; + var foundDigit = false; + var currency = false; + foundDecimal = false; + var ret = new Array(maskLen); + + for (var maskPos = 0; maskPos < maskLen; ++maskPos) { + var _m = _mask.charAt(maskPos); + + switch (_m) { + case '0': + --maskBeforeDecimal; + + if (maskBeforeDecimal < numBeforeDecimal && inPos < inLen) { + ret[outPos] = bytes[inPos]; + ++inPos; + foundDigit = true; } else { - ret[outPos] = foundDecimal ? ' ' : fillByte + ret[outPos] = '0'; + foundZero = true; } - } - ++outPos - break - case ')': - if (isNegative) { - ret[outPos] = ')' - } else { - ret[outPos] = foundDecimal ? ' ' : fillByte - } - ++outPos - break + ++outPos; + break; - case 'C': - if (maskPos < maskLen - 1 && mask.charAt(maskPos + 1) == 'R') { - if (isNegative) { - ret[outPos] = 'C' - ret[outPos + 1] = 'R' + case '#': + --maskBeforeDecimal; + + if (maskBeforeDecimal < numBeforeDecimal && inPos < inLen) { + ret[outPos] = bytes[inPos]; + ++inPos; + foundDigit = true; } else { - ret[outPos] = ' ' - ret[outPos + 1] = ' ' + ret[outPos] = foundDecimal && forceTrailingZeros && NumberMask._getSign(num) != 0 ? '0' : fillByte; + if (!foundDecimal) floatPos = maskPos; } - outPos += 2 - ++maskPos - } else { - ret[outPos] = 'C' - ++outPos - } - break - case 'D': - if (maskPos < maskLen - 1 && mask.charAt(maskPos + 1) == 'R') { + + ++outPos; + break; + + case ',': + if (foundZero || inPos > 0) ret[outPos] = groupingSeparator;else { + ret[outPos] = fillByte; + if (!foundDecimal) floatPos = maskPos; + } + ++outPos; + break; + + case '-': + if (!foundDigit && floatByte == ' ') { + if (isNegative) floatByte = '-'; + ret[outPos] = fillByte; + floatPos = foundDecimal ? -1 : maskPos; + } else ret[outPos] = isNegative ? '-' : fillByte; + + ++outPos; + break; + + case '+': + if (!foundDigit && floatByte == ' ') { + floatByte = isNegative ? '-' : '+'; + ret[outPos] = fillByte; + floatPos = foundDecimal ? -1 : maskPos; + } else ret[outPos] = isNegative ? '-' : '+'; + + ++outPos; + break; + + case '$': + if (!foundDigit && floatByte == ' ') { + floatByte = '$'; + ret[outPos] = fillByte; + floatPos = foundDecimal ? -1 : maskPos; + } else { + ret[outPos] = '$'; + } + + ++outPos; + break; + // case '&': + // currency = true + // if (!foundDigit && floatByte == ' ') { + // floatByte = '&' + // ret[outPos] = fillByte + // floatPos = foundDecimal ? -1 : maskPos + // } else { + // ret[outPos] = '&' + // } + // ++outPos + // break + // case '@': + // currency = true + // if (!foundDigit && floatByte == ' ') { + // floatByte = '@' + // ret[outPos] = fillByte + // floatPos = foundDecimal ? -1 : maskPos + // } else { + // ret[outPos] = '@' + // } + // ++outPos + // break + + case '(': + if (!foundDigit && floatByte == ' ') { + if (isNegative) floatByte = '('; + ret[outPos] = fillByte; + floatPos = foundDecimal ? -1 : maskPos; + } else { + if (isNegative) { + ret[outPos] = '('; + } else { + ret[outPos] = foundDecimal ? ' ' : fillByte; + } + } + + ++outPos; + break; + + case ')': if (isNegative) { - ret[outPos] = 'C' - ret[outPos + 1] = 'R' + ret[outPos] = ')'; } else { - ret[outPos] = 'D' - ret[outPos + 1] = 'R' + ret[outPos] = foundDecimal ? ' ' : fillByte; } - outPos += 2 - ++maskPos - } else { - ret[outPos] = 'D' - ++outPos - } - break - case '*': - ret[outPos] = '*' - ++outPos - break + ++outPos; + break; + + case 'C': + if (maskPos < maskLen - 1 && _mask.charAt(maskPos + 1) == 'R') { + if (isNegative) { + ret[outPos] = 'C'; + ret[outPos + 1] = 'R'; + } else { + ret[outPos] = ' '; + ret[outPos + 1] = ' '; + } + + outPos += 2; + ++maskPos; + } else { + ret[outPos] = 'C'; + ++outPos; + } - case '.': - ret[outPos] = emitDecimal ? decimalSeparator : fillByte - fillByte = ' ' - foundDecimal = true - ++inPos - ++outPos - break + break; - case 'B': - ret[outPos] = ' ' - ++outPos - break + case 'D': + if (maskPos < maskLen - 1 && _mask.charAt(maskPos + 1) == 'R') { + if (isNegative) { + ret[outPos] = 'C'; + ret[outPos + 1] = 'R'; + } else { + ret[outPos] = 'D'; + ret[outPos + 1] = 'R'; + } - default: - ret[outPos] = m - ++outPos - break - } - } + outPos += 2; + ++maskPos; + } else { + ret[outPos] = 'D'; + ++outPos; + } - if (floatByte != ' ') { - if (floatPos < 0) floatPos = outPos - while (floatPos >= maskLen) --floatPos - if (ret[floatPos] == fillInit) ret[floatPos] = floatByte - } + break; - return ret.join('') - } + case '*': + ret[outPos] = '*'; + ++outPos; + break; - static _shift(number, precision, reverseShift) { - if (reverseShift) precision = -precision - var numArray = ('' + number).split('e') - return +( - numArray[0] + - 'e' + - (numArray[1] ? +numArray[1] + precision : precision) - ) - } + case '.': + ret[outPos] = emitDecimal ? decimalSeparator : fillByte; + fillByte = ' '; + foundDecimal = true; + ++inPos; + ++outPos; + break; - static _round(number, precision) { - return NumberMask._shift( - Math.round(NumberMask._shift(number, precision, false)), - precision, - true - ) - } + case 'B': + ret[outPos] = ' '; + ++outPos; + break; + + default: + ret[outPos] = _m; + ++outPos; + break; + } + } - static _toCharArray(number) { - const signum = NumberMask._getSign(number) - let chars = [] + if (floatByte != ' ') { + if (floatPos < 0) floatPos = outPos; - if (signum !== 0) { - let string = signum < 0 ? `${-1 * number.toString()}` : number.toString() + while (floatPos >= maskLen) { + --floatPos; + } - if (string.length > 1 && string.charAt(0) == '0') - string = string.substring(1) + if (ret[floatPos] == fillInit) ret[floatPos] = floatByte; + } - // The string contains only [0-9] and '.' - chars = string.split('') + return ret.join(''); + } + }, { + key: "_shift", + value: function _shift(number, precision, reverseShift) { + if (reverseShift) precision = -precision; + var numArray = ('' + number).split('e'); + return +(numArray[0] + 'e' + (numArray[1] ? +numArray[1] + precision : precision)); + } + }, { + key: "_round", + value: function _round(number, precision) { + return NumberMask._shift(Math.round(NumberMask._shift(number, precision, false)), precision, true); } + }, { + key: "_toCharArray", + value: function _toCharArray(number) { + var signum = NumberMask._getSign(number); - return chars - } + var chars = []; - /** - * Returns the sign of a number - * - * @param {Number} x number - * @returns {Number} A number representing the sign of the given argument. - * If the argument is a positive number, negative number, positive zero - * or negative zero, the function will return 1, -1, 0 or -0 respectively. - * Otherwise, NaN is returned. - */ - static _getSign(x) { - return (x > 0) - (x < 0) || +x - } -} + if (signum !== 0) { + var string = signum < 0 ? "".concat(-1 * number.toString()) : number.toString(); + if (string.length > 1 && string.charAt(0) == '0') string = string.substring(1); // The string contains only [0-9] and '.' + + chars = string.split(''); + } -/* harmony default export */ __webpack_exports__["default"] = (NumberMask); + return chars; + } + /** + * Returns the sign of a number + * + * @param {Number} x number + * @returns {Number} A number representing the sign of the given argument. + * If the argument is a positive number, negative number, positive zero + * or negative zero, the function will return 1, -1, 0 or -0 respectively. + * Otherwise, NaN is returned. + */ + + }, { + key: "_getSign", + value: function _getSign(x) { + return (x > 0) - (x < 0) || +x; + } + }]); + return NumberMask; +}(); + +var _default = NumberMask; +exports.default = _default; /***/ }), /***/ "../../basis-input-masking/node_modules/bbj-masks/src/NumberMask/index.js": -/*!****************************************************************************************!*\ - !*** /mnt/d/Github/basis-input-masking/node_modules/bbj-masks/src/NumberMask/index.js ***! - \****************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/*!************************************************************************************!*\ + !*** D:/Github/basis-input-masking/node_modules/bbj-masks/src/NumberMask/index.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _NumberMask__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./NumberMask */ "../../basis-input-masking/node_modules/bbj-masks/src/NumberMask/NumberMask.js"); + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _NumberMask = _interopRequireDefault(__webpack_require__(/*! ./NumberMask */ "../../basis-input-masking/node_modules/bbj-masks/src/NumberMask/NumberMask.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + /* * This file is part of bbj-masks lib. * (c) Basis Europe @@ -490,23 +516,32 @@ __webpack_require__.r(__webpack_exports__); * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +var _default = _NumberMask.default; +exports.default = _default; +/***/ }), +/***/ "../../basis-input-masking/node_modules/bbj-masks/src/StringMask/StringMask.js": +/*!*****************************************************************************************!*\ + !*** D:/Github/basis-input-masking/node_modules/bbj-masks/src/StringMask/StringMask.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { -/* harmony default export */ __webpack_exports__["default"] = (_NumberMask__WEBPACK_IMPORTED_MODULE_0__["default"]); +"use strict"; -/***/ }), +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; -/***/ "../../basis-input-masking/node_modules/bbj-masks/src/StringMask/StringMask.js": -/*!*********************************************************************************************!*\ - !*** /mnt/d/Github/basis-input-masking/node_modules/bbj-masks/src/StringMask/StringMask.js ***! - \*********************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } -"use strict"; -__webpack_require__.r(__webpack_exports__); /* * This file is part of bbj-masks lib. * (c) Basis Europe @@ -514,42 +549,41 @@ __webpack_require__.r(__webpack_exports__); * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - -const isNumberRegex = /^\d+$/ -const isWhitespaceRegex = /\s/ -const punctuationList = '!"#$%&\'()*+,-./:;<=>?@[]^_`{|}~' - +var isNumberRegex = /^\d+$/; +var isWhitespaceRegex = /\s/; +var punctuationList = '!"#$%&\'()*+,-./:;<=>?@[]^_`{|}~'; /** * Check if the given string is in lower case * * @param {String} str */ -const isLowerCase = str => { - return str == str.toLowerCase() && str != str.toUpperCase() -} +var isLowerCase = function isLowerCase(str) { + return str == str.toLowerCase() && str != str.toUpperCase(); +}; /** * Check if the given string is in upper case * * @param {String} str */ -const isUpperCase = str => { - return str == str.toUpperCase() && str != str.toLowerCase() -} -const passOrThrowError = (loose, ret, i, str) => { + +var isUpperCase = function isUpperCase(str) { + return str == str.toUpperCase() && str != str.toLowerCase(); +}; + +var passOrThrowError = function passOrThrowError(loose, ret, i, str) { if (!loose) { - const char = str.charAt(i) - const pos = i + 1 + var char = str.charAt(i); + var pos = i + 1; throw { name: 'StringMaskError', - message: `StringMaskError: error applying mask at position "${pos}" , char "${char}"`, - pos, - char - } - } else ret[i] = ' ' -} - + message: "StringMaskError: error applying mask at position \"".concat(pos, "\" , char \"").concat(char, "\""), + pos: pos, + char: char + }; + } else ret[i] = ' '; +}; /** * NumberMask * @@ -557,145 +591,172 @@ const passOrThrowError = (loose, ret, i, str) => { * * @author Hyyan Abo Fakher */ -class StringMask { - /** - * Mask the given string with the given mask according to BBj rules - * - * @param {String} str the string to mask - * @param {String} mask the mask to use for formatting - * @param {Boolean} [loose=true] when true , errors will be ignored and the method will try at apply the mask - * anyway , otherwise it will stop at first error and throw it. - * - * @throws {MaskIsTooShortError} - * @throws {StringMaskError} - * @throws {MaskError} - * - * @returns {String} the masked string - */ - static mask(str, mask, loose = true) { - str = String(str) - mask = String(mask) - const maskLen = mask.length - const strLen = str.length - - if (strLen > maskLen) { - if (loose) return str - // friendly silent fail - else - throw { - name: 'MaskIsTooShortError', - message: `MaskIsTooShortError: Mask is shorter than the passed string` - } - } - const ret = new Array(maskLen) - let pos = 0 // to keep track of the current position in the str - let maskByte = '' - - for (let i = 0; i < maskLen; i++) { - maskByte = mask.charAt(i) - switch (maskByte) { - case 'X': // match any character - ret[i] = pos < strLen ? str.charAt(pos) : ' ' - ++pos - break - - case 'A': // match letter; force upper case - if (pos < strLen) { - const byte = str.charAt(pos) - if (isUpperCase(byte)) ret[i] = byte - else if (isLowerCase(byte)) ret[i] = byte.toUpperCase() - else passOrThrowError(loose, ret, i, str) - } else ret[i] = ' ' - ++pos - break - - case 'a': // match letter - if (pos < strLen) { - const byte = str.charAt(pos) - if (isUpperCase(byte) || isLowerCase(byte)) ret[i] = byte - else passOrThrowError(loose, ret, i, str) - } else ret[i] = ' ' - ++pos - break - case '0': // match digit - if (pos < strLen) { - const byte = str.charAt(pos) - if (isNumberRegex.test(byte)) ret[i] = byte - else passOrThrowError(loose, ret, i, str) - } else ret[i] = ' ' - ++pos - break - case 'Z': // match letter or digit; force upper case - if (pos < strLen) { - const byte = str.charAt(pos) - if (isUpperCase(byte) || isNumberRegex.test(byte)) ret[i] = byte - else if (isLowerCase(byte)) ret[i] = byte.toUpperCase() - else passOrThrowError(loose, ret, i, str) - } else ret[i] = ' ' - ++pos - break - case 'z': // match letter or digit - if (pos < strLen) { - const byte = str.charAt(pos) - if ( - isUpperCase(byte) || - isLowerCase(byte) || - isNumberRegex.test(byte) - ) - ret[i] = byte - else passOrThrowError(loose, ret, i, str) - } else ret[i] = ' ' - ++pos - break - - break - case 'U': // match letter (force upper case), digit, whitespace or punctuation. - if (pos < strLen) { - const byte = str.charAt(pos) - if (isLowerCase(byte)) ret[i] = byte.toUpperCase() - else if ( - isUpperCase(byte) || - isNumberRegex.test(byte) || - isWhitespaceRegex.test(byte) || - punctuationList.indexOf(byte) > -1 - ) - ret[i] = byte - else passOrThrowError(loose, ret, i, str) - } else ret[i] = ' ' - ++pos - break - default: - ret[i] = maskByte - break + +var StringMask = /*#__PURE__*/function () { + function StringMask() { + _classCallCheck(this, StringMask); + } + + _createClass(StringMask, null, [{ + key: "mask", + + /** + * Mask the given string with the given mask according to BBj rules + * + * @param {String} str the string to mask + * @param {String} mask the mask to use for formatting + * @param {Boolean} [loose=true] when true , errors will be ignored and the method will try at apply the mask + * anyway , otherwise it will stop at first error and throw it. + * + * @throws {MaskIsTooShortError} + * @throws {StringMaskError} + * @throws {MaskError} + * + * @returns {String} the masked string + */ + value: function mask(str, _mask) { + var loose = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; + str = String(str); + _mask = String(_mask); + var maskLen = _mask.length; + var strLen = str.length; + + if (strLen > maskLen) { + if (loose) return str; // friendly silent fail + else throw { + name: 'MaskIsTooShortError', + message: "MaskIsTooShortError: Mask is shorter than the passed string" + }; } - } - if (pos < strLen) { - if (!loose) { - throw { name: 'MaskError', message: 'Mask cannot be applied' } + var ret = new Array(maskLen); + var pos = 0; // to keep track of the current position in the str + + var maskByte = ''; + + for (var i = 0; i < maskLen; i++) { + maskByte = _mask.charAt(i); + + switch (maskByte) { + case 'X': + // match any character + ret[i] = pos < strLen ? str.charAt(pos) : ' '; + ++pos; + break; + + case 'A': + // match letter; force upper case + if (pos < strLen) { + var byte = str.charAt(pos); + if (isUpperCase(byte)) ret[i] = byte;else if (isLowerCase(byte)) ret[i] = byte.toUpperCase();else passOrThrowError(loose, ret, i, str); + } else ret[i] = ' '; + + ++pos; + break; + + case 'a': + // match letter + if (pos < strLen) { + var _byte = str.charAt(pos); + + if (isUpperCase(_byte) || isLowerCase(_byte)) ret[i] = _byte;else passOrThrowError(loose, ret, i, str); + } else ret[i] = ' '; + + ++pos; + break; + + case '0': + // match digit + if (pos < strLen) { + var _byte2 = str.charAt(pos); + + if (isNumberRegex.test(_byte2)) ret[i] = _byte2;else passOrThrowError(loose, ret, i, str); + } else ret[i] = ' '; + + ++pos; + break; + + case 'Z': + // match letter or digit; force upper case + if (pos < strLen) { + var _byte3 = str.charAt(pos); + + if (isUpperCase(_byte3) || isNumberRegex.test(_byte3)) ret[i] = _byte3;else if (isLowerCase(_byte3)) ret[i] = _byte3.toUpperCase();else passOrThrowError(loose, ret, i, str); + } else ret[i] = ' '; + + ++pos; + break; + + case 'z': + // match letter or digit + if (pos < strLen) { + var _byte4 = str.charAt(pos); + + if (isUpperCase(_byte4) || isLowerCase(_byte4) || isNumberRegex.test(_byte4)) ret[i] = _byte4;else passOrThrowError(loose, ret, i, str); + } else ret[i] = ' '; + + ++pos; + break; + break; + + case 'U': + // match letter (force upper case), digit, whitespace or punctuation. + if (pos < strLen) { + var _byte5 = str.charAt(pos); + + if (isLowerCase(_byte5)) ret[i] = _byte5.toUpperCase();else if (isUpperCase(_byte5) || isNumberRegex.test(_byte5) || isWhitespaceRegex.test(_byte5) || punctuationList.indexOf(_byte5) > -1) ret[i] = _byte5;else passOrThrowError(loose, ret, i, str); + } else ret[i] = ' '; + + ++pos; + break; + + default: + ret[i] = maskByte; + break; + } } - } - return ret.join('') - } -} + if (pos < strLen) { + if (!loose) { + throw { + name: 'MaskError', + message: 'Mask cannot be applied' + }; + } + } + + return ret.join(''); + } + }]); -/* harmony default export */ __webpack_exports__["default"] = (StringMask); + return StringMask; +}(); +var _default = StringMask; +exports.default = _default; /***/ }), /***/ "../../basis-input-masking/node_modules/bbj-masks/src/StringMask/index.js": -/*!****************************************************************************************!*\ - !*** /mnt/d/Github/basis-input-masking/node_modules/bbj-masks/src/StringMask/index.js ***! - \****************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/*!************************************************************************************!*\ + !*** D:/Github/basis-input-masking/node_modules/bbj-masks/src/StringMask/index.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _StringMask__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./StringMask */ "../../basis-input-masking/node_modules/bbj-masks/src/StringMask/StringMask.js"); + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _StringMask = _interopRequireDefault(__webpack_require__(/*! ./StringMask */ "../../basis-input-masking/node_modules/bbj-masks/src/StringMask/StringMask.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + /* * This file is part of bbj-masks lib. * (c) Basis Europe @@ -703,11 +764,8 @@ __webpack_require__.r(__webpack_exports__); * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - - - -/* harmony default export */ __webpack_exports__["default"] = (_StringMask__WEBPACK_IMPORTED_MODULE_0__["default"]); - +var _default = _StringMask.default; +exports.default = _default; /***/ }), @@ -840,9 +898,9 @@ if(false) {} /***/ }), /***/ "./node_modules/babel-loader/lib/index.js?!../../basis-input-masking/dist/basis-input-masking.js": -/*!*************************************************************************************************************!*\ - !*** ./node_modules/babel-loader/lib??ref--4!/mnt/d/Github/basis-input-masking/dist/basis-input-masking.js ***! - \*************************************************************************************************************/ +/*!*********************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4!D:/Github/basis-input-masking/dist/basis-input-masking.js ***! + \*********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -2484,9 +2542,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi /***/ }), /***/ "./node_modules/babel-loader/lib/index.js?!../../bbj-masks/dist/bbj-masks.js": -/*!*****************************************************************************************!*\ - !*** ./node_modules/babel-loader/lib??ref--4!/mnt/d/Github/bbj-masks/dist/bbj-masks.js ***! - \*****************************************************************************************/ +/*!*************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4!D:/Github/bbj-masks/dist/bbj-masks.js ***! + \*************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -5443,12072 +5501,14910 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi /***/ }), -/***/ "./node_modules/basis-aggrid-components/dist/basis-aggrid-components.js": -/*!******************************************************************************!*\ - !*** ./node_modules/basis-aggrid-components/dist/basis-aggrid-components.js ***! - \******************************************************************************/ +/***/ "./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__; + +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 webpackUniversalModuleDefinition(root, factory) { - if(true) - module.exports = factory(); - else {} -})(typeof self !== 'undefined' ? self : this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 42); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + 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 -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Component__ = __webpack_require__(45); -/* - * This file is part of basis-aggrid-components lib. - * (c) Basis Europe - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ + /******/ + // The module cache -/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__Component__["a" /* default */]); + /******/ + var installedModules = {}; + /******/ -/***/ }), -/* 1 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + /******/ + // The require function -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = autobind; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__private_utils__ = __webpack_require__(7); -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } + /******/ -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } + function __webpack_require__(moduleId) { + /******/ -function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } + /******/ + // Check if module is in cache -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } + /******/ + if (installedModules[moduleId]) { + /******/ + return installedModules[moduleId].exports; + /******/ + } + /******/ + // Create a new module (and put it into the cache) + /******/ -var defineProperty = Object.defineProperty, - getPrototypeOf = Object.getPrototypeOf; -var mapStore; -function getBoundSuper(obj, fn) { - if (typeof WeakMap === 'undefined') { - throw new Error("Using @autobind on ".concat(fn.name, "() requires WeakMap support due to its use of super.").concat(fn.name, "()\n See https://github.com/jayphelps/core-decorators.js/issues/20")); - } + var module = installedModules[moduleId] = { + /******/ + i: moduleId, - if (!mapStore) { - mapStore = new WeakMap(); - } + /******/ + l: false, - if (mapStore.has(obj) === false) { - mapStore.set(obj, new WeakMap()); - } + /******/ + exports: {} + /******/ - var superStore = mapStore.get(obj); + }; + /******/ - if (superStore.has(fn) === false) { - superStore.set(fn, Object(__WEBPACK_IMPORTED_MODULE_0__private_utils__["a" /* bind */])(fn, obj)); - } + /******/ + // Execute the module function - return superStore.get(fn); -} + /******/ -function autobindClass(klass) { - var descs = Object(__WEBPACK_IMPORTED_MODULE_0__private_utils__["e" /* getOwnPropertyDescriptors */])(klass.prototype); - var keys = Object(__WEBPACK_IMPORTED_MODULE_0__private_utils__["d" /* getOwnKeys */])(descs); + modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + /******/ - for (var i = 0, l = keys.length; i < l; i++) { - var key = keys[i]; - var desc = descs[key]; + /******/ + // Flag the module as loaded - if (typeof desc.value !== 'function' || key === 'constructor') { - continue; - } + /******/ - defineProperty(klass.prototype, key, autobindMethod(klass.prototype, key, desc)); - } -} + module.l = true; + /******/ -function autobindMethod(target, key, _ref) { - var fn = _ref.value, - configurable = _ref.configurable, - enumerable = _ref.enumerable; + /******/ + // Return the exports of the module - if (typeof fn !== 'function') { - throw new SyntaxError("@autobind can only be used on functions, not: ".concat(fn)); - } + /******/ - var constructor = target.constructor; - return { - configurable: configurable, - enumerable: enumerable, - get: function get() { - // Class.prototype.key lookup - // Someone accesses the property directly on the prototype on which it is - // actually defined on, i.e. Class.prototype.hasOwnProperty(key) - if (this === target) { - return fn; - } // Class.prototype.key lookup - // Someone accesses the property directly on a prototype but it was found - // up the chain, not defined directly on it - // i.e. Class.prototype.hasOwnProperty(key) == false && key in Class.prototype + return module.exports; + /******/ + } + /******/ + /******/ - if (this.constructor !== constructor && getPrototypeOf(this).constructor === constructor) { - return fn; - } // Autobound method calling super.sameMethod() which is also autobound and so on. + /******/ + // expose the modules object (__webpack_modules__) + /******/ - if (this.constructor !== constructor && key in this.constructor.prototype) { - return getBoundSuper(this, fn); - } - var boundFn = Object(__WEBPACK_IMPORTED_MODULE_0__private_utils__["a" /* bind */])(fn, this); - defineProperty(this, key, { - configurable: true, - writable: true, - // NOT enumerable when it's a bound method - enumerable: false, - value: boundFn - }); - return boundFn; - }, - set: Object(__WEBPACK_IMPORTED_MODULE_0__private_utils__["b" /* createDefaultSetter */])(key) - }; -} + __webpack_require__.m = modules; + /******/ -function handle(args) { - if (args.length === 1) { - return autobindClass.apply(void 0, _toConsumableArray(args)); - } else { - return autobindMethod.apply(void 0, _toConsumableArray(args)); - } -} + /******/ + // expose the module cache -function autobind() { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } + /******/ - if (args.length === 0) { - return function () { - return handle(arguments); - }; - } else { - return handle(args); - } -} + __webpack_require__.c = installedModules; + /******/ -/***/ }), -/* 2 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + /******/ + // define getter function for harmony exports -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = override; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__private_utils__ = __webpack_require__(7); -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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + __webpack_require__.d = function (exports, name, getter) { + /******/ + if (!__webpack_require__.o(exports, name)) { + /******/ + Object.defineProperty(exports, name, { + /******/ + configurable: false, -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + /******/ + enumerable: true, -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + /******/ + get: getter + /******/ + }); + /******/ + } + /******/ -var GENERIC_FUNCTION_ERROR = '{child} does not properly override {parent}'; -var FUNCTION_REGEXP = /^function ([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?(\([^\)]*\))[\s\S]+$/; + }; + /******/ -var SyntaxErrorReporter = /*#__PURE__*/function () { - _createClass(SyntaxErrorReporter, [{ - key: "_getTopic", - value: function _getTopic(descriptor) { - if (descriptor === undefined) { - return null; - } + /******/ + // getDefaultExport function for compatibility with non-harmony modules - if ('value' in descriptor) { - return descriptor.value; - } + /******/ - if ('get' in descriptor) { - return descriptor.get; - } - if ('set' in descriptor) { - return descriptor.set; - } - } - }, { - key: "_extractTopicSignature", - value: function _extractTopicSignature(topic) { - switch (_typeof(topic)) { - case 'function': - return this._extractFunctionSignature(topic); + __webpack_require__.n = function (module) { + /******/ + var getter = module && module.__esModule ? + /******/ + function getDefault() { + return module['default']; + } : + /******/ + function getModuleExports() { + return module; + }; + /******/ - default: - return this.key; - } - } - }, { - key: "_extractFunctionSignature", - value: function _extractFunctionSignature(fn) { - var _this = this; - - return fn.toString().replace(FUNCTION_REGEXP, function (match) { - var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _this.key; - var params = arguments.length > 2 ? arguments[2] : undefined; - return name + params; - }); - } - }, { - key: "key", - get: function get() { - return this.childDescriptor.key; - } - }, { - key: "parentNotation", - get: function get() { - return "".concat(this.parentKlass.constructor.name, "#").concat(this.parentPropertySignature); - } - }, { - key: "childNotation", - get: function get() { - return "".concat(this.childKlass.constructor.name, "#").concat(this.childPropertySignature); - } - }, { - key: "parentTopic", - get: function get() { - return this._getTopic(this.parentDescriptor); - } - }, { - key: "childTopic", - get: function get() { - return this._getTopic(this.childDescriptor); - } - }, { - key: "parentPropertySignature", - get: function get() { - return this._extractTopicSignature(this.parentTopic); - } - }, { - key: "childPropertySignature", - get: function get() { - return this._extractTopicSignature(this.childTopic); - } - }]); + __webpack_require__.d(getter, 'a', getter); + /******/ - function SyntaxErrorReporter(parentKlass, childKlass, parentDescriptor, childDescriptor) { - _classCallCheck(this, SyntaxErrorReporter); - - this.parentKlass = void 0; - this.childKlass = void 0; - this.parentDescriptor = void 0; - this.childDescriptor = void 0; - this.parentKlass = parentKlass; - this.childKlass = childKlass; - this.parentDescriptor = parentDescriptor; - this.childDescriptor = childDescriptor; - } - _createClass(SyntaxErrorReporter, [{ - key: "assert", - value: function assert(condition) { - var msg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + return getter; + /******/ + }; + /******/ - if (condition !== true) { - this.error(GENERIC_FUNCTION_ERROR + msg); - } - } - }, { - key: "error", - value: function error(msg) { - var _this2 = this; - - msg = msg // Replace lazily, because they actually might not - // be available in all cases - .replace('{parent}', function (m) { - return _this2.parentNotation; - }).replace('{child}', function (m) { - return _this2.childNotation; - }); - throw new SyntaxError(msg); - } - }]); + /******/ + // Object.prototype.hasOwnProperty.call - return SyntaxErrorReporter; -}(); + /******/ -function getDescriptorType(descriptor) { - if (descriptor.hasOwnProperty('value')) { - return 'data'; - } - if (descriptor.hasOwnProperty('get') || descriptor.hasOwnProperty('set')) { - return 'accessor'; - } // If none of them exist, browsers treat it as - // a data descriptor with a value of `undefined` + __webpack_require__.o = function (object, property) { + return Object.prototype.hasOwnProperty.call(object, property); + }; + /******/ + /******/ + // __webpack_public_path__ - return 'data'; -} + /******/ -function checkFunctionSignatures(parent, child, reporter) { - reporter.assert(parent.length === child.length); -} -function checkDataDescriptors(parent, child, reporter) { - var parentValueType = _typeof(parent.value); + __webpack_require__.p = ""; + /******/ - var childValueType = _typeof(child.value); + /******/ + // Load entry module and return exports - if (parentValueType === 'undefined' && childValueType === 'undefined') { - // class properties can be any expression, which isn't ran until the - // the instance is created, so we can't reliably get type information - // for them yet (per spec). Perhaps when Babel includes flow-type info - // in runtime? Tried regex solutions, but super hacky and only feasible - // on primitives, which is confusing for usage... - reporter.error("descriptor values are both undefined. (class properties are are not currently supported)'"); - } + /******/ - if (parentValueType !== childValueType) { - var isFunctionOverUndefined = childValueType === 'function' && parentValueType === undefined; // Even though we don't support class properties, this - // will still handle more than just functions, just in case. - // Shadowing an undefined value is an error if the inherited - // value was undefined (usually a class property, not a method) + return __webpack_require__(__webpack_require__.s = 42); + /******/ + }( + /************************************************************************/ - if (isFunctionOverUndefined || parentValueType !== undefined) { - reporter.error("value types do not match. {parent} is \"".concat(parentValueType, "\", {child} is \"").concat(childValueType, "\"")); - } - } // Switch, in preparation for supporting more types + /******/ + [ + /* 0 */ + /***/ + function (module, __webpack_exports__, __webpack_require__) { + "use strict"; + /* harmony import */ - switch (childValueType) { - case 'function': - checkFunctionSignatures(parent.value, child.value, reporter); - break; + var __WEBPACK_IMPORTED_MODULE_0__Component__ = __webpack_require__(45); + /* + * This file is part of basis-aggrid-components lib. + * (c) Basis Europe + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ - default: - reporter.error("Unexpected error. Please file a bug with: {parent} is \"".concat(parentValueType, "\", {child} is \"").concat(childValueType, "\"")); - break; - } -} + /* harmony default export */ -function checkAccessorDescriptors(parent, child, reporter) { - var parentHasGetter = typeof parent.get === 'function'; - var childHasGetter = typeof child.get === 'function'; - var parentHasSetter = typeof parent.set === 'function'; - var childHasSetter = typeof child.set === 'function'; - if (parentHasGetter || childHasGetter) { - if (!parentHasGetter && parentHasSetter) { - reporter.error("{parent} is setter but {child} is getter"); - } + __webpack_exports__["a"] = __WEBPACK_IMPORTED_MODULE_0__Component__["a" + /* default */ + ]; + /***/ + }, + /* 1 */ - if (!childHasGetter && childHasSetter) { - reporter.error("{parent} is getter but {child} is setter"); - } + /***/ + function (module, __webpack_exports__, __webpack_require__) { + "use strict"; + /* harmony export (immutable) */ - checkFunctionSignatures(parent.get, child.get, reporter); - } + __webpack_exports__["a"] = autobind; + /* harmony import */ - if (parentHasSetter || childHasSetter) { - if (!parentHasSetter && parentHasGetter) { - reporter.error("{parent} is getter but {child} is setter"); - } + var __WEBPACK_IMPORTED_MODULE_0__private_utils__ = __webpack_require__(7); - if (!childHasSetter && childHasGetter) { - reporter.error("{parent} is setter but {child} is getter"); - } + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); + } - checkFunctionSignatures(parent.set, child.set, reporter); - } -} + function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance"); + } -function checkDescriptors(parent, child, reporter) { - var parentType = getDescriptorType(parent); - var childType = getDescriptorType(child); + function _iterableToArray(iter) { + if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); + } - if (parentType !== childType) { - reporter.error("descriptor types do not match. {parent} is \"".concat(parentType, "\", {child} is \"").concat(childType, "\"")); - } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { + arr2[i] = arr[i]; + } - switch (childType) { - case 'data': - checkDataDescriptors(parent, child, reporter); - break; + return arr2; + } + } - case 'accessor': - checkAccessorDescriptors(parent, child, reporter); - break; - } -} + var defineProperty = Object.defineProperty, + getPrototypeOf = Object.getPrototypeOf; + var mapStore; -var suggestionTransforms = [function (key) { - return key.toLowerCase(); -}, function (key) { - return key.toUpperCase(); -}, function (key) { - return key + 's'; -}, function (key) { - return key.slice(0, -1); -}, function (key) { - return key.slice(1, key.length); -}]; - -function findPossibleAlternatives(superKlass, key) { - for (var i = 0, l = suggestionTransforms.length; i < l; i++) { - var fn = suggestionTransforms[i]; - var suggestion = fn(key); - - if (suggestion in superKlass) { - return suggestion; - } - } + function getBoundSuper(obj, fn) { + if (typeof WeakMap === 'undefined') { + throw new Error("Using @autobind on ".concat(fn.name, "() requires WeakMap support due to its use of super.").concat(fn.name, "()\n See https://github.com/jayphelps/core-decorators.js/issues/20")); + } - return null; -} + if (!mapStore) { + mapStore = new WeakMap(); + } -function handleDescriptor(target, key, descriptor) { - descriptor.key = key; - var superKlass = Object.getPrototypeOf(target); - var superDescriptor = Object.getOwnPropertyDescriptor(superKlass, key); - var reporter = new SyntaxErrorReporter(superKlass, target, superDescriptor, descriptor); + if (mapStore.has(obj) === false) { + mapStore.set(obj, new WeakMap()); + } - if (superDescriptor === undefined) { - var suggestedKey = findPossibleAlternatives(superKlass, key); - var suggestion = suggestedKey ? "\n\n Did you mean \"".concat(suggestedKey, "\"?") : ''; - reporter.error("No descriptor matching {child} was found on the prototype chain.".concat(suggestion)); - } + var superStore = mapStore.get(obj); - checkDescriptors(superDescriptor, descriptor, reporter); - return descriptor; -} + if (superStore.has(fn) === false) { + superStore.set(fn, Object(__WEBPACK_IMPORTED_MODULE_0__private_utils__["a" + /* bind */ + ])(fn, obj)); + } -function override() { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } + return superStore.get(fn); + } - return Object(__WEBPACK_IMPORTED_MODULE_0__private_utils__["c" /* decorate */])(handleDescriptor, args); -} + function autobindClass(klass) { + var descs = Object(__WEBPACK_IMPORTED_MODULE_0__private_utils__["e" + /* getOwnPropertyDescriptors */ + ])(klass.prototype); + var keys = Object(__WEBPACK_IMPORTED_MODULE_0__private_utils__["d" + /* getOwnKeys */ + ])(descs); -/***/ }), -/* 3 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + for (var i = 0, l = keys.length; i < l; i++) { + var key = keys[i]; + var desc = descs[key]; -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(9); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getRawTag_js__ = __webpack_require__(72); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__objectToString_js__ = __webpack_require__(73); + if (typeof desc.value !== 'function' || key === 'constructor') { + continue; + } + defineProperty(klass.prototype, key, autobindMethod(klass.prototype, key, desc)); + } + } + function autobindMethod(target, key, _ref) { + var fn = _ref.value, + configurable = _ref.configurable, + enumerable = _ref.enumerable; -/** `Object#toString` result references. */ + if (typeof fn !== 'function') { + throw new SyntaxError("@autobind can only be used on functions, not: ".concat(fn)); + } -var nullTag = '[object Null]', - undefinedTag = '[object Undefined]'; -/** Built-in value references. */ + var constructor = target.constructor; + return { + configurable: configurable, + enumerable: enumerable, + get: function get() { + // Class.prototype.key lookup + // Someone accesses the property directly on the prototype on which it is + // actually defined on, i.e. Class.prototype.hasOwnProperty(key) + if (this === target) { + return fn; + } // Class.prototype.key lookup + // Someone accesses the property directly on a prototype but it was found + // up the chain, not defined directly on it + // i.e. Class.prototype.hasOwnProperty(key) == false && key in Class.prototype + + + if (this.constructor !== constructor && getPrototypeOf(this).constructor === constructor) { + return fn; + } // Autobound method calling super.sameMethod() which is also autobound and so on. + + + if (this.constructor !== constructor && key in this.constructor.prototype) { + return getBoundSuper(this, fn); + } -var symToStringTag = __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */] ? __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* 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`. - */ + var boundFn = Object(__WEBPACK_IMPORTED_MODULE_0__private_utils__["a" + /* bind */ + ])(fn, this); + defineProperty(this, key, { + configurable: true, + writable: true, + // NOT enumerable when it's a bound method + enumerable: false, + value: boundFn + }); + return boundFn; + }, + set: Object(__WEBPACK_IMPORTED_MODULE_0__private_utils__["b" + /* createDefaultSetter */ + ])(key) + }; + } -function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; - } + function handle(args) { + if (args.length === 1) { + return autobindClass.apply(void 0, _toConsumableArray(args)); + } else { + return autobindMethod.apply(void 0, _toConsumableArray(args)); + } + } - return symToStringTag && symToStringTag in Object(value) ? Object(__WEBPACK_IMPORTED_MODULE_1__getRawTag_js__["a" /* default */])(value) : Object(__WEBPACK_IMPORTED_MODULE_2__objectToString_js__["a" /* default */])(value); -} + function autobind() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } -/* harmony default export */ __webpack_exports__["a"] = (baseGetTag); + if (args.length === 0) { + return function () { + return handle(arguments); + }; + } else { + return handle(args); + } + } + /***/ -/***/ }), -/* 4 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + }, + /* 2 */ -"use strict"; -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 (module, __webpack_exports__, __webpack_require__) { + "use strict"; + /* harmony export (immutable) */ -/** - * 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'; -} + __webpack_exports__["a"] = override; + /* harmony import */ -/* harmony default export */ __webpack_exports__["a"] = (isObjectLike); + var __WEBPACK_IMPORTED_MODULE_0__private_utils__ = __webpack_require__(7); -/***/ }), -/* 5 */ -/***/ (function(module, exports) { + function _typeof(obj) { + "@babel/helpers - typeof"; -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -// css base code, injected by the css-loader -module.exports = function (useSourceMap) { - var list = []; // return the list of modules as css string + 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); + } - list.toString = function toString() { - return this.map(function (item) { - var content = cssWithMappingToString(item, useSourceMap); + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } - if (item[2]) { - return "@media " + item[2] + "{" + content + "}"; - } else { - return content; + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; } - }).join(""); - }; // import a list of modules into the list + var GENERIC_FUNCTION_ERROR = '{child} does not properly override {parent}'; + var FUNCTION_REGEXP = /^function ([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?(\([^\)]*\))[\s\S]+$/; - list.i = function (modules, mediaQuery) { - if (typeof modules === "string") modules = [[null, modules, ""]]; - var alreadyImportedModules = {}; + var SyntaxErrorReporter = /*#__PURE__*/function () { + _createClass(SyntaxErrorReporter, [{ + key: "_getTopic", + value: function _getTopic(descriptor) { + if (descriptor === undefined) { + return null; + } - for (var i = 0; i < this.length; i++) { - var id = this[i][0]; - if (typeof id === "number") alreadyImportedModules[id] = true; - } + if ('value' in descriptor) { + return descriptor.value; + } - for (i = 0; i < modules.length; i++) { - var item = modules[i]; // skip already imported module - // this implementation is not 100% perfect for weird media query combinations - // when a module is imported multiple times with different media queries. - // I hope this will never occur (Hey this way we have smaller bundles) + if ('get' in descriptor) { + return descriptor.get; + } + + if ('set' in descriptor) { + return descriptor.set; + } + } + }, { + key: "_extractTopicSignature", + value: function _extractTopicSignature(topic) { + switch (_typeof(topic)) { + case 'function': + return this._extractFunctionSignature(topic); + + default: + return this.key; + } + } + }, { + key: "_extractFunctionSignature", + value: function _extractFunctionSignature(fn) { + var _this = this; + + return fn.toString().replace(FUNCTION_REGEXP, function (match) { + var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _this.key; + var params = arguments.length > 2 ? arguments[2] : undefined; + return name + params; + }); + } + }, { + key: "key", + get: function get() { + return this.childDescriptor.key; + } + }, { + key: "parentNotation", + get: function get() { + return "".concat(this.parentKlass.constructor.name, "#").concat(this.parentPropertySignature); + } + }, { + key: "childNotation", + get: function get() { + return "".concat(this.childKlass.constructor.name, "#").concat(this.childPropertySignature); + } + }, { + key: "parentTopic", + get: function get() { + return this._getTopic(this.parentDescriptor); + } + }, { + key: "childTopic", + get: function get() { + return this._getTopic(this.childDescriptor); + } + }, { + key: "parentPropertySignature", + get: function get() { + return this._extractTopicSignature(this.parentTopic); + } + }, { + key: "childPropertySignature", + get: function get() { + return this._extractTopicSignature(this.childTopic); + } + }]); - if (typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { - if (mediaQuery && !item[2]) { - item[2] = mediaQuery; - } else if (mediaQuery) { - item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; + function SyntaxErrorReporter(parentKlass, childKlass, parentDescriptor, childDescriptor) { + _classCallCheck(this, SyntaxErrorReporter); + + this.parentKlass = void 0; + this.childKlass = void 0; + this.parentDescriptor = void 0; + this.childDescriptor = void 0; + this.parentKlass = parentKlass; + this.childKlass = childKlass; + this.parentDescriptor = parentDescriptor; + this.childDescriptor = childDescriptor; } - list.push(item); - } - } - }; + _createClass(SyntaxErrorReporter, [{ + key: "assert", + value: function assert(condition) { + var msg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; - return list; -}; + if (condition !== true) { + this.error(GENERIC_FUNCTION_ERROR + msg); + } + } + }, { + key: "error", + value: function error(msg) { + var _this2 = this; + + msg = msg // Replace lazily, because they actually might not + // be available in all cases + .replace('{parent}', function (m) { + return _this2.parentNotation; + }).replace('{child}', function (m) { + return _this2.childNotation; + }); + throw new SyntaxError(msg); + } + }]); -function cssWithMappingToString(item, useSourceMap) { - var content = item[1] || ''; - var cssMapping = item[3]; + return SyntaxErrorReporter; + }(); - if (!cssMapping) { - return content; - } + function getDescriptorType(descriptor) { + if (descriptor.hasOwnProperty('value')) { + return 'data'; + } - if (useSourceMap && typeof btoa === 'function') { - var sourceMapping = toComment(cssMapping); - var sourceURLs = cssMapping.sources.map(function (source) { - return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'; - }); - return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); - } + if (descriptor.hasOwnProperty('get') || descriptor.hasOwnProperty('set')) { + return 'accessor'; + } // If none of them exist, browsers treat it as + // a data descriptor with a value of `undefined` - return [content].join('\n'); -} // Adapted from convert-source-map (MIT) + return 'data'; + } -function toComment(sourceMap) { - // eslint-disable-next-line no-undef - var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); - var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; - return '/*# ' + data + ' */'; -} + function checkFunctionSignatures(parent, child, reporter) { + reporter.assert(parent.length === child.length); + } -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { + function checkDataDescriptors(parent, child, reporter) { + var parentValueType = _typeof(parent.value); -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ + var childValueType = _typeof(child.value); -var stylesInDom = {}; + if (parentValueType === 'undefined' && childValueType === 'undefined') { + // class properties can be any expression, which isn't ran until the + // the instance is created, so we can't reliably get type information + // for them yet (per spec). Perhaps when Babel includes flow-type info + // in runtime? Tried regex solutions, but super hacky and only feasible + // on primitives, which is confusing for usage... + reporter.error("descriptor values are both undefined. (class properties are are not currently supported)'"); + } -var memoize = function (fn) { - var memo; + if (parentValueType !== childValueType) { + var isFunctionOverUndefined = childValueType === 'function' && parentValueType === undefined; // Even though we don't support class properties, this + // will still handle more than just functions, just in case. + // Shadowing an undefined value is an error if the inherited + // value was undefined (usually a class property, not a method) - return function () { - if (typeof memo === "undefined") memo = fn.apply(this, arguments); - return memo; - }; -}; + if (isFunctionOverUndefined || parentValueType !== undefined) { + reporter.error("value types do not match. {parent} is \"".concat(parentValueType, "\", {child} is \"").concat(childValueType, "\"")); + } + } // Switch, in preparation for supporting more types -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); -}; + switch (childValueType) { + case 'function': + checkFunctionSignatures(parent.value, child.value, reporter); + break; -var getElement = (function (fn) { - var memo = {}; + default: + reporter.error("Unexpected error. Please file a bug with: {parent} is \"".concat(parentValueType, "\", {child} is \"").concat(childValueType, "\"")); + break; + } + } - 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] - }; -})(); + function checkAccessorDescriptors(parent, child, reporter) { + var parentHasGetter = typeof parent.get === 'function'; + var childHasGetter = typeof child.get === 'function'; + var parentHasSetter = typeof parent.set === 'function'; + var childHasSetter = typeof child.set === 'function'; -var singleton = null; -var singletonCounter = 0; -var stylesInsertedAtTop = []; + if (parentHasGetter || childHasGetter) { + if (!parentHasGetter && parentHasSetter) { + reporter.error("{parent} is setter but {child} is getter"); + } -var fixUrls = __webpack_require__(50); + if (!childHasGetter && childHasSetter) { + reporter.error("{parent} is getter but {child} is setter"); + } -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"); - } + checkFunctionSignatures(parent.get, child.get, reporter); + } - options = options || {}; + if (parentHasSetter || childHasSetter) { + if (!parentHasSetter && parentHasGetter) { + reporter.error("{parent} is getter but {child} is setter"); + } - options.attrs = typeof options.attrs === "object" ? options.attrs : {}; + if (!childHasSetter && childHasGetter) { + reporter.error("{parent} is setter but {child} is getter"); + } - // Force single-tag solution on IE6-9, which has a hard limit on the # of