UNPKG

funda-ui

Version:

React components using pure Bootstrap 5+ which does not contain any external style and script libraries.

1,210 lines (1,147 loc) 275 kB
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("react"), require("react-dom")); else if(typeof define === 'function' && define.amd) define(["react", "react-dom"], factory); else if(typeof exports === 'object') exports["RPB"] = factory(require("react"), require("react-dom")); else root["RPB"] = factory(root["React"], root["ReactDOM"]); })(this, (__WEBPACK_EXTERNAL_MODULE__787__, __WEBPACK_EXTERNAL_MODULE__156__) => { return /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ 909: /***/ (function(module, exports, __webpack_require__) { /* module decorator */ module = __webpack_require__.nmd(module); var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } (function webpackUniversalModuleDefinition(root, factory) { if (( false ? 0 : _typeof(exports)) === 'object' && ( false ? 0 : _typeof(module)) === 'object') module.exports = factory(__webpack_require__(787), __webpack_require__(156));else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(787), __webpack_require__(156)], __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 {} })(this, function (__WEBPACK_EXTERNAL_MODULE__787__, __WEBPACK_EXTERNAL_MODULE__156__) { return (/******/function () { // webpackBootstrap /******/ "use strict"; /******/ var __webpack_modules__ = { /***/787: /***/function _(module) { module.exports = __WEBPACK_EXTERNAL_MODULE__787__; /***/ }, /***/156: /***/function _(module) { module.exports = __WEBPACK_EXTERNAL_MODULE__156__; /***/ } /******/ }; /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __nested_webpack_require_1708__(moduleId) { /******/ // Check if module is in cache /******/var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_1708__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ /******/ (function () { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/__nested_webpack_require_1708__.n = function (module) { /******/var getter = module && module.__esModule ? /******/function () { return module['default']; } : /******/function () { return module; }; /******/ __nested_webpack_require_1708__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (function () { /******/ // define getter functions for harmony exports /******/__nested_webpack_require_1708__.d = function (exports, definition) { /******/for (var key in definition) { /******/if (__nested_webpack_require_1708__.o(definition, key) && !__nested_webpack_require_1708__.o(exports, key)) { /******/Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (function () { /******/__nested_webpack_require_1708__.o = function (obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }; /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (function () { /******/ // define __esModule on exports /******/__nested_webpack_require_1708__.r = function (exports) { /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. (function () { __nested_webpack_require_1708__.r(__webpack_exports__); /* harmony export */ __nested_webpack_require_1708__.d(__webpack_exports__, { /* harmony export */"default": function _default() { return __WEBPACK_DEFAULT_EXPORT__; } /* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1708__(787); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_1708__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1708__(156); /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_1708__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__); var RootPortal = function RootPortal(props) { var containerClassName = props.containerClassName, show = props.show, children = props.children, _props$usePortal = props.usePortal, usePortal = _props$usePortal === void 0 ? true : _props$usePortal; var containerRef = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)(); // Move HTML templates to tag end body </body> // render() don't use "Fragment", in order to avoid error "Failed to execute 'insertBefore' on 'Node'" // prevent "transform", "filter", "perspective" attribute destruction fixed viewport orientation // ### // ### // Use `containerRef.current` to ensure the correctness of the nextjs framework. It may report an error document as undefined (0, react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { if (usePortal) { containerRef.current = document.createElement('div'); containerRef.current.className = "root-portal-container ".concat(containerClassName || ''); document.body.appendChild(containerRef.current); } return function () { if (usePortal && containerRef.current) { containerRef.current.remove(); } }; }, [usePortal]); if (!usePortal) { return show ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, children) : null; } return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, containerRef.current && show && /*#__PURE__*/(0, react_dom__WEBPACK_IMPORTED_MODULE_1__.createPortal)(children, containerRef.current)); }; /* harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = RootPortal; })(); /******/ return __webpack_exports__; /******/ }() ); }); /***/ }), /***/ 70: /***/ (function(module, exports, __webpack_require__) { /* module decorator */ module = __webpack_require__.nmd(module); var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } (function webpackUniversalModuleDefinition(root, factory) { if (( false ? 0 : _typeof(exports)) === 'object' && ( false ? 0 : _typeof(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 {} })(this, function () { return (/******/function () { // webpackBootstrap /******/ "use strict"; /******/ // The require scope /******/ var __nested_webpack_require_987__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (function () { /******/ // define getter functions for harmony exports /******/__nested_webpack_require_987__.d = function (exports, definition) { /******/for (var key in definition) { /******/if (__nested_webpack_require_987__.o(definition, key) && !__nested_webpack_require_987__.o(exports, key)) { /******/Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (function () { /******/__nested_webpack_require_987__.o = function (obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }; /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (function () { /******/ // define __esModule on exports /******/__nested_webpack_require_987__.r = function (exports) { /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; __nested_webpack_require_987__.r(__webpack_exports__); /* harmony export */ __nested_webpack_require_987__.d(__webpack_exports__, { /* harmony export */"clearAllBodyScrollLocks": function clearAllBodyScrollLocks() { return (/* binding */_clearAllBodyScrollLocks ); }, /* harmony export */"disableBodyScroll": function disableBodyScroll() { return (/* binding */_disableBodyScroll ); }, /* harmony export */"enableBodyScroll": function enableBodyScroll() { return (/* binding */_enableBodyScroll ); } /* harmony export */ }); function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } // ================================================================= // based on https://github.com/willmcpo/body-scroll-lock // ================================================================= // @flow // Adopted and modified solution from Bohdan Didukh (2017) // https://stackoverflow.com/questions/41594997/ios-10-safari-prevent-scrolling-behind-a-fixed-overlay-and-maintain-scroll-posi // Older browsers don't support event options, feature detect it. var hasPassiveEvents = false; if (typeof window !== 'undefined') { var passiveTestOptions = { get passive() { hasPassiveEvents = true; return undefined; } }; window.addEventListener('testPassive', null, passiveTestOptions); window.removeEventListener('testPassive', null, passiveTestOptions); } var isIosDevice = typeof window !== 'undefined' && window.navigator && window.navigator.platform && (/iP(ad|hone|od)/.test(window.navigator.platform) || window.navigator.platform === 'MacIntel' && window.navigator.maxTouchPoints > 1); var locks = []; var documentListenerAdded = false; var initialClientY = -1; var previousBodyOverflowSetting; var previousBodyPosition; var previousBodyPaddingRight; // returns true if `el` should be allowed to receive touchmove events. var allowTouchMove = function allowTouchMove(el) { return locks.some(function (lock) { if (lock.options.allowTouchMove && lock.options.allowTouchMove(el)) { return true; } return false; }); }; var preventDefault = function preventDefault(rawEvent) { var e = rawEvent || window.event; // For the case whereby consumers adds a touchmove event listener to document. // Recall that we do document.addEventListener('touchmove', preventDefault, { passive: false }) // in disableBodyScroll - so if we provide this opportunity to allowTouchMove, then // the touchmove event on document will break. if (allowTouchMove(e.target)) { return true; } // Do not prevent if the event has more than one touch (usually meaning this is a multi touch gesture like pinch to zoom). if (e.touches.length > 1) return true; if (e.preventDefault) e.preventDefault(); return false; }; var setOverflowHidden = function setOverflowHidden(options) { // If previousBodyPaddingRight is already set, don't set it again. if (previousBodyPaddingRight === undefined) { var reserveScrollBarGap = !!options && options.reserveScrollBarGap === true; var scrollBarGap = window.innerWidth - document.documentElement.clientWidth; if (reserveScrollBarGap && scrollBarGap > 0) { var computedBodyPaddingRight = parseInt(window.getComputedStyle(document.body).getPropertyValue('padding-right'), 10); previousBodyPaddingRight = document.body.style.paddingRight; document.body.style.paddingRight = "".concat(computedBodyPaddingRight + scrollBarGap, "px"); } } // If previousBodyOverflowSetting is already set, don't set it again. if (previousBodyOverflowSetting === undefined) { previousBodyOverflowSetting = document.body.style.overflow; document.body.style.overflow = 'hidden'; } }; var restoreOverflowSetting = function restoreOverflowSetting() { if (previousBodyPaddingRight !== undefined) { document.body.style.paddingRight = previousBodyPaddingRight; // Restore previousBodyPaddingRight to undefined so setOverflowHidden knows it // can be set again. previousBodyPaddingRight = undefined; } if (previousBodyOverflowSetting !== undefined) { document.body.style.overflow = previousBodyOverflowSetting; // Restore previousBodyOverflowSetting to undefined // so setOverflowHidden knows it can be set again. previousBodyOverflowSetting = undefined; } }; var setPositionFixed = function setPositionFixed() { return window.requestAnimationFrame(function () { // If previousBodyPosition is already set, don't set it again. if (previousBodyPosition === undefined) { previousBodyPosition = { position: document.body.style.position, top: document.body.style.top, left: document.body.style.left }; // Update the dom inside an animation frame var _window = window, scrollY = _window.scrollY, scrollX = _window.scrollX, innerHeight = _window.innerHeight; document.body.style.position = 'fixed'; document.body.style.top = "".concat(-scrollY, "px"); document.body.style.left = "".concat(-scrollX, "px"); setTimeout(function () { return window.requestAnimationFrame(function () { // Attempt to check if the bottom bar appeared due to the position change var bottomBarHeight = innerHeight - window.innerHeight; if (bottomBarHeight && scrollY >= innerHeight) { // Move the content further up so that the bottom bar doesn't hide it document.body.style.top = "".concat(-(scrollY + bottomBarHeight)); } }); }, 300); } }); }; var restorePositionSetting = function restorePositionSetting() { if (previousBodyPosition !== undefined) { // Convert the position from "px" to Int var y = -parseInt(document.body.style.top, 10); var x = -parseInt(document.body.style.left, 10); // Restore styles document.body.style.position = previousBodyPosition.position; document.body.style.top = previousBodyPosition.top; document.body.style.left = previousBodyPosition.left; // Restore scroll window.scrollTo(x, y); previousBodyPosition = undefined; } }; // https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight#Problems_and_solutions var isTargetElementTotallyScrolled = function isTargetElementTotallyScrolled(targetElement) { return targetElement ? targetElement.scrollHeight - targetElement.scrollTop <= targetElement.clientHeight : false; }; var handleScroll = function handleScroll(event, targetElement) { var clientY = event.targetTouches[0].clientY - initialClientY; if (allowTouchMove(event.target)) { return false; } if (targetElement && targetElement.scrollTop === 0 && clientY > 0) { // element is at the top of its scroll. return preventDefault(event); } if (isTargetElementTotallyScrolled(targetElement) && clientY < 0) { // element is at the bottom of its scroll. return preventDefault(event); } event.stopPropagation(); return true; }; var _disableBodyScroll = function disableBodyScroll(targetElement, options) { // targetElement must be provided if (!targetElement) { // eslint-disable-next-line no-console console.error('disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.'); return; } // disableBodyScroll must not have been called on this targetElement before if (locks.some(function (lock) { return lock.targetElement === targetElement; })) { return; } var lock = { targetElement: targetElement, options: options || {} }; locks = [].concat(_toConsumableArray(locks), [lock]); if (isIosDevice) { setPositionFixed(); } else { setOverflowHidden(options); } if (isIosDevice) { targetElement.ontouchstart = function (event) { if (event.targetTouches.length === 1) { // detect single touch. initialClientY = event.targetTouches[0].clientY; } }; targetElement.ontouchmove = function (event) { if (event.targetTouches.length === 1) { // detect single touch. handleScroll(event, targetElement); } }; if (!documentListenerAdded) { document.addEventListener('touchmove', preventDefault, hasPassiveEvents ? { passive: false } : undefined); documentListenerAdded = true; } } }; var _clearAllBodyScrollLocks = function clearAllBodyScrollLocks() { if (isIosDevice) { // Clear all locks ontouchstart/ontouchmove handlers, and the references. locks.forEach(function (lock) { lock.targetElement.ontouchstart = null; lock.targetElement.ontouchmove = null; }); if (documentListenerAdded) { document.removeEventListener('touchmove', preventDefault, hasPassiveEvents ? { passive: false } : undefined); documentListenerAdded = false; } // Reset initial clientY. initialClientY = -1; } if (isIosDevice) { restorePositionSetting(); } else { restoreOverflowSetting(); } locks = []; }; var _enableBodyScroll = function enableBodyScroll(targetElement) { if (!targetElement) { // eslint-disable-next-line no-console console.error('enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.'); return; } locks = locks.filter(function (lock) { return lock.targetElement !== targetElement; }); if (isIosDevice) { targetElement.ontouchstart = null; targetElement.ontouchmove = null; if (documentListenerAdded && locks.length === 0) { document.removeEventListener('touchmove', preventDefault, hasPassiveEvents ? { passive: false } : undefined); documentListenerAdded = false; } } if (isIosDevice) { restorePositionSetting(); } else { restoreOverflowSetting(); } }; /******/ return __webpack_exports__; /******/ }() ); }); /***/ }), /***/ 188: /***/ (function(module, exports, __webpack_require__) { /* module decorator */ module = __webpack_require__.nmd(module); var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof2(obj) { "@babel/helpers - typeof"; return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof2(obj); } (function webpackUniversalModuleDefinition(root, factory) { if (( false ? 0 : _typeof2(exports)) === 'object' && ( false ? 0 : _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 {} })(this, function () { return (/******/function () { // webpackBootstrap /******/ "use strict"; /******/ // The require scope /******/ var __nested_webpack_require_993__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (function () { /******/ // define getter functions for harmony exports /******/__nested_webpack_require_993__.d = function (exports, definition) { /******/for (var key in definition) { /******/if (__nested_webpack_require_993__.o(definition, key) && !__nested_webpack_require_993__.o(exports, key)) { /******/Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (function () { /******/__nested_webpack_require_993__.o = function (obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }; /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (function () { /******/ // define __esModule on exports /******/__nested_webpack_require_993__.r = function (exports) { /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; __nested_webpack_require_993__.r(__webpack_exports__); /* harmony export */ __nested_webpack_require_993__.d(__webpack_exports__, { /* harmony export */"clsWrite": function clsWrite() { return (/* binding */_clsWrite ); }, /* harmony export */"combinedCls": function combinedCls() { return (/* binding */_combinedCls ); } /* harmony export */ }); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } /** * Output of class name * @param {*} s - Any * @param {String} defaultCls - Default string * @param {?*} targetCls - Any * @returns {*} */ function _clsWrite(s, defaultCls) { var targetCls = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; return s || s === '' ? typeof targetCls === 'undefined' ? s : targetCls : defaultCls; } /** * Combined classnames * @param {*} args * @returns {String|undefined} */ /* Usage: console.log(combinedCls('a-1', 'a-2', 'a-3', { 'p-1': null, 'p-2': undefined, 'p-3': true, 'p-4': false, 'p-5': 'kkk', 'p-6': 0, 'p-7': 1, 'p-8': '', undefined })); // a-1 a-2 a-3 p-3 p-5 p-7 */ function _combinedCls() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } if (args) { var classes = []; for (var i = 0; i < args.length; i++) { var className = args[i]; if (!className) { continue; } var type = _typeof(className); if (type === 'string' || type === 'number') { classes.push(className); } else if (type === 'object') { var _classes = Array.isArray(className) ? className : Object.entries(className).map(function (_ref) { var _ref2 = _slicedToArray(_ref, 2), key = _ref2[0], value = _ref2[1]; return value ? key : null; }); classes = _classes.length ? classes.concat(_classes.filter(function (c) { return !!c; })) : classes; } } return classes.join(' ').trim(); } return undefined; } /******/ return __webpack_exports__; /******/ }() ); }); /***/ }), /***/ 79: /***/ (function(module, exports, __webpack_require__) { /* module decorator */ module = __webpack_require__.nmd(module); var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } (function webpackUniversalModuleDefinition(root, factory) { if (( false ? 0 : _typeof(exports)) === 'object' && ( false ? 0 : _typeof(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 {} })(this, function () { return (/******/function () { // webpackBootstrap /******/ "use strict"; /******/ // The require scope /******/ var __nested_webpack_require_987__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (function () { /******/ // define getter functions for harmony exports /******/__nested_webpack_require_987__.d = function (exports, definition) { /******/for (var key in definition) { /******/if (__nested_webpack_require_987__.o(definition, key) && !__nested_webpack_require_987__.o(exports, key)) { /******/Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (function () { /******/__nested_webpack_require_987__.o = function (obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }; /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (function () { /******/ // define __esModule on exports /******/__nested_webpack_require_987__.r = function (exports) { /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; __nested_webpack_require_987__.r(__webpack_exports__); /* harmony export */ __nested_webpack_require_987__.d(__webpack_exports__, { /* harmony export */"convertArrToValByBraces": function convertArrToValByBraces() { return (/* binding */_convertArrToValByBraces ); }, /* harmony export */"convertArrToValByBrackets": function convertArrToValByBrackets() { return (/* binding */_convertArrToValByBrackets ); }, /* harmony export */"convertStringByCommaToValByBraces": function convertStringByCommaToValByBraces() { return (/* binding */_convertStringByCommaToValByBraces ); }, /* harmony export */"convertStringByCommaToValByBrackets": function convertStringByCommaToValByBrackets() { return (/* binding */_convertStringByCommaToValByBrackets ); } /* harmony export */ }); /** * Convert value to string separated by square brackets * @param {String} str such as: 1,2,3 * @returns {String} such as: [1][2][3] */ function _convertStringByCommaToValByBrackets(str) { if (typeof str === 'undefined' || str === null || str === '') { return ''; } return str.split(',').map(function (v) { return v.toString().includes('[') && v.toString().includes(']') ? "".concat(v) : "[".concat(v, "]"); }).join(''); } /** * Convert array value to string separated by square brackets * @param {String[]} arr such as: ['1','2','3'] * @returns {String} such as: [1][2][3] */ function _convertArrToValByBrackets(arr) { if (!Array.isArray(arr)) return ''; return arr.map(function (v) { return v.toString().includes('[') && v.toString().includes(']') ? "".concat(v) : "[".concat(v, "]"); }).join(''); } /** * Convert value to string separated by curly braces * @param {String} str such as: 1,2,3 * @returns {String} such as: {1}{2}{3} */ function _convertStringByCommaToValByBraces(str) { if (typeof str === 'undefined' || str === null || str === '') { return ''; } return str.split(',').map(function (v) { return v.toString().includes('{') && v.toString().includes('}') ? "".concat(v) : "{".concat(v, "}"); }).join(''); } /** * Convert array value to string separated by curly braces * @param {String[]} arr such as: ['1','2','3'] * @returns {String} such as: {1}{2}{3} */ function _convertArrToValByBraces(arr) { if (!Array.isArray(arr)) return ''; return arr.map(function (v) { return v.toString().includes('{') && v.toString().includes('}') ? "".concat(v) : "{".concat(v, "}"); }).join(''); } /******/ return __webpack_exports__; /******/ }() ); }); /***/ }), /***/ 933: /***/ (function(module, exports, __webpack_require__) { /* module decorator */ module = __webpack_require__.nmd(module); var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } (function webpackUniversalModuleDefinition(root, factory) { if (( false ? 0 : _typeof(exports)) === 'object' && ( false ? 0 : _typeof(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 {} })(this, function () { return (/******/function () { // webpackBootstrap /******/ "use strict"; /******/ // The require scope /******/ var __nested_webpack_require_987__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (function () { /******/ // define getter functions for harmony exports /******/__nested_webpack_require_987__.d = function (exports, definition) { /******/for (var key in definition) { /******/if (__nested_webpack_require_987__.o(definition, key) && !__nested_webpack_require_987__.o(exports, key)) { /******/Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (function () { /******/__nested_webpack_require_987__.o = function (obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }; /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (function () { /******/ // define __esModule on exports /******/__nested_webpack_require_987__.r = function (exports) { /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; __nested_webpack_require_987__.r(__webpack_exports__); /* harmony export */ __nested_webpack_require_987__.d(__webpack_exports__, { /* harmony export */"htmlToPlain": function htmlToPlain() { return (/* binding */_htmlToPlain ); }, /* harmony export */"multiSpacesToSingle": function multiSpacesToSingle() { return (/* binding */_multiSpacesToSingle ); }, /* harmony export */"onlyNumAndLetter": function onlyNumAndLetter() { return (/* binding */_onlyNumAndLetter ); }, /* harmony export */"removeFirstLastSlash": function removeFirstLastSlash() { return (/* binding */_removeFirstLastSlash ); }, /* harmony export */"removeFirstSlash": function removeFirstSlash() { return (/* binding */_removeFirstSlash ); }, /* harmony export */"removeTrailingSlash": function removeTrailingSlash() { return (/* binding */_removeTrailingSlash ); }, /* harmony export */"rmAllSpace": function rmAllSpace() { return (/* binding */_rmAllSpace ); }, /* harmony export */"rmSpec": function rmSpec() { return (/* binding */_rmSpec ); }, /* harmony export */"stripTagsAndContent": function stripTagsAndContent() { return (/* binding */_stripTagsAndContent ); }, /* harmony export */"trimAll": function trimAll() { return (/* binding */_trimAll ); } /* harmony export */ }); /** * String formatting utility functions */ /** * Remove all special characters except space from a string * @param {string} input - The input string to process * @returns {string} The processed string */ function _rmSpec(input) { return input === null || input === void 0 ? void 0 : input.replace(/[^a-zA-Z0-9 \u4E00-\u9FFF]/g, ""); } /** * Allow only numbers and letters in a string * @param {string} input - The input string to process * @returns {string} The processed string */ function _onlyNumAndLetter(input) { return input === null || input === void 0 ? void 0 : input.replace(/[^a-zA-Z0-9 ]/g, ""); } /** * Remove all spaces including those in the middle * @param {string} input - The input string to process * @returns {string} The processed string */ function _rmAllSpace(input) { return input === null || input === void 0 ? void 0 : input.replace(/\s/g, ""); } /** * Remove whitespace from both sides of a string * @param {string} input - The input string to process * @returns {string} The processed string */ function _trimAll(input) { return input === null || input === void 0 ? void 0 : input.replace(/(^\s+)|(\s+$)/g, ""); } /** * Replace multiple spaces with a single space * @param {string} input - The input string to process * @returns {string} The processed string */ function _multiSpacesToSingle(input) { return input === null || input === void 0 ? void 0 : input.replace(/\s+(\W)/g, ' '); } /** * Convert HTML text to plain text (Remove html tag content) * @param {string} input - The input string to process * @returns {string} The processed string */ /* Examples: console.log(htmlToPlain("<p>Hello <b>World</b></p>")); // Hello World */ function _htmlToPlain(input) { return input === null || input === void 0 ? void 0 : input.replace(/(<([^>]+)>)/ig, ''); } /** * Strip HTML tags and their content * !!!Important: It will remove nested tags * @param {string} input - The input string to process * @returns {string} The processed string */ /* Examples: console.log(stripTagsAndContent("<p>Hello <b>World</b></p>")); // World console.log(stripTagsAndContent("Hello <b>World</b>")); // Hello */ function _stripTagsAndContent(input) { return input === null || input === void 0 ? void 0 : input.replace(/<\/?[^>]+(>|$)(.*?)<\/?[^>]+(>|$)/ig, ''); } /** * Remove first and last slash from a URL * @param {string} input - The input URL to process * @returns {string} The processed URL */ function _removeFirstLastSlash(input) { return input === null || input === void 0 ? void 0 : input.replace(/^\/|\/$/g, ''); } /** * Remove trailing slash from a URL * @param {string} input - The input URL to process * @returns {string} The processed URL */ function _removeTrailingSlash(input) { return input === null || input === void 0 ? void 0 : input.replace(/\/+$/, ''); } /** * Remove first slash from a URL * @param {string} input - The input URL to process * @returns {string} The processed URL */ function _removeFirstSlash(input) { return input === null || input === void 0 ? void 0 : input.replace(/\//, ''); } /******/ return __webpack_exports__; /******/ }() ); }); /***/ }), /***/ 767: /***/ (function(module, exports, __webpack_require__) { /* module decorator */ module = __webpack_require__.nmd(module); var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof2(obj) { "@babel/helpers - typeof"; return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof2(obj); } (function webpackUniversalModuleDefinition(root, factory) { if (( false ? 0 : _typeof2(exports)) === 'object' && ( false ? 0 : _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 {} })(this, function () { return (/******/function () { // webpackBootstrap /******/ "use strict"; /******/ // The require scope /******/ var __nested_webpack_require_993__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (function () { /******/ // define getter fun