funda-ui 1.0.272
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BackToTop/index.css +34 -0
- package/BackToTop/index.d.ts +11 -0
- package/BackToTop/index.js +458 -0
- package/CascadingSelect/index.css +159 -0
- package/CascadingSelect/index.d.ts +56 -0
- package/CascadingSelect/index.js +958 -0
- package/CascadingSelectE2E/index.css +159 -0
- package/CascadingSelectE2E/index.d.ts +60 -0
- package/CascadingSelectE2E/index.js +1126 -0
- package/Checkbox/index.d.ts +30 -0
- package/Checkbox/index.js +226 -0
- package/ColorPicker/index.css +38 -0
- package/ColorPicker/index.d.ts +27 -0
- package/ColorPicker/index.js +246 -0
- package/DigitalClock/index.d.ts +7 -0
- package/DigitalClock/index.js +208 -0
- package/DropdownMenu/index.css +127 -0
- package/DropdownMenu/index.d.ts +37 -0
- package/DropdownMenu/index.js +237 -0
- package/DynamicFields/index.d.ts +26 -0
- package/DynamicFields/index.js +412 -0
- package/File/index.d.ts +36 -0
- package/File/index.js +473 -0
- package/Input/index.d.ts +42 -0
- package/Input/index.js +286 -0
- package/LiveSearch/index.d.ts +37 -0
- package/LiveSearch/index.js +1195 -0
- package/ModalDialog/index.d.ts +60 -0
- package/ModalDialog/index.js +725 -0
- package/ModeSwitch/index.d.ts +17 -0
- package/ModeSwitch/index.js +202 -0
- package/MultiFuncSelect/index.css +178 -0
- package/MultiFuncSelect/index.d.ts +67 -0
- package/MultiFuncSelect/index.js +1826 -0
- package/MultilevelDropdownMenu/index.css +35 -0
- package/MultilevelDropdownMenu/index.d.ts +25 -0
- package/MultilevelDropdownMenu/index.js +464 -0
- package/Pagination/index.d.ts +49 -0
- package/Pagination/index.js +341 -0
- package/README.md +108 -0
- package/Radio/index.d.ts +31 -0
- package/Radio/index.js +246 -0
- package/RangeSlider/index.css +149 -0
- package/RangeSlider/index.d.ts +21 -0
- package/RangeSlider/index.js +730 -0
- package/ScrollReveal/index.css +23 -0
- package/ScrollReveal/index.d.ts +21 -0
- package/ScrollReveal/index.js +216 -0
- package/Scrollbar/index.css +168 -0
- package/Scrollbar/index.d.ts +15 -0
- package/Scrollbar/index.js +605 -0
- package/SearchBar/index.d.ts +32 -0
- package/SearchBar/index.js +246 -0
- package/Select/index.d.ts +34 -0
- package/Select/index.js +331 -0
- package/ShowMoreLess/index.css +23 -0
- package/ShowMoreLess/index.d.ts +30 -0
- package/ShowMoreLess/index.js +202 -0
- package/Switch/index.d.ts +29 -0
- package/Switch/index.js +211 -0
- package/Table/index.css +533 -0
- package/Table/index.d.ts +25 -0
- package/Table/index.js +2113 -0
- package/Tabs/index.d.ts +3 -0
- package/Tabs/index.js +323 -0
- package/TagInput/index.css +90 -0
- package/TagInput/index.d.ts +28 -0
- package/TagInput/index.js +370 -0
- package/Textarea/index.d.ts +30 -0
- package/Textarea/index.js +242 -0
- package/Toast/index.css +95 -0
- package/Toast/index.d.ts +35 -0
- package/Toast/index.js +340 -0
- package/Tooltip/index.css +240 -0
- package/Tooltip/index.d.ts +19 -0
- package/Tooltip/index.js +200 -0
- package/Tree/index.css +225 -0
- package/Tree/index.d.ts +37 -0
- package/Tree/index.js +1406 -0
- package/all.d.ts +33 -0
- package/all.js +35 -0
- package/lib/cjs/BackToTop/index.d.ts +11 -0
- package/lib/cjs/BackToTop/index.js +458 -0
- package/lib/cjs/CascadingSelect/index.d.ts +56 -0
- package/lib/cjs/CascadingSelect/index.js +958 -0
- package/lib/cjs/CascadingSelectE2E/index.d.ts +60 -0
- package/lib/cjs/CascadingSelectE2E/index.js +1126 -0
- package/lib/cjs/Checkbox/index.d.ts +30 -0
- package/lib/cjs/Checkbox/index.js +226 -0
- package/lib/cjs/ColorPicker/index.d.ts +27 -0
- package/lib/cjs/ColorPicker/index.js +246 -0
- package/lib/cjs/DigitalClock/index.d.ts +7 -0
- package/lib/cjs/DigitalClock/index.js +208 -0
- package/lib/cjs/DropdownMenu/index.d.ts +37 -0
- package/lib/cjs/DropdownMenu/index.js +237 -0
- package/lib/cjs/DynamicFields/index.d.ts +26 -0
- package/lib/cjs/DynamicFields/index.js +412 -0
- package/lib/cjs/File/index.d.ts +36 -0
- package/lib/cjs/File/index.js +473 -0
- package/lib/cjs/Input/index.d.ts +42 -0
- package/lib/cjs/Input/index.js +286 -0
- package/lib/cjs/LiveSearch/index.d.ts +37 -0
- package/lib/cjs/LiveSearch/index.js +1195 -0
- package/lib/cjs/ModalDialog/index.d.ts +60 -0
- package/lib/cjs/ModalDialog/index.js +725 -0
- package/lib/cjs/ModeSwitch/index.d.ts +17 -0
- package/lib/cjs/ModeSwitch/index.js +202 -0
- package/lib/cjs/MultiFuncSelect/index.d.ts +67 -0
- package/lib/cjs/MultiFuncSelect/index.js +1826 -0
- package/lib/cjs/MultilevelDropdownMenu/index.d.ts +25 -0
- package/lib/cjs/MultilevelDropdownMenu/index.js +464 -0
- package/lib/cjs/Pagination/index.d.ts +49 -0
- package/lib/cjs/Pagination/index.js +341 -0
- package/lib/cjs/Radio/index.d.ts +31 -0
- package/lib/cjs/Radio/index.js +246 -0
- package/lib/cjs/RangeSlider/index.d.ts +21 -0
- package/lib/cjs/RangeSlider/index.js +730 -0
- package/lib/cjs/ScrollReveal/index.d.ts +21 -0
- package/lib/cjs/ScrollReveal/index.js +216 -0
- package/lib/cjs/Scrollbar/index.d.ts +15 -0
- package/lib/cjs/Scrollbar/index.js +605 -0
- package/lib/cjs/SearchBar/index.d.ts +32 -0
- package/lib/cjs/SearchBar/index.js +246 -0
- package/lib/cjs/Select/index.d.ts +34 -0
- package/lib/cjs/Select/index.js +331 -0
- package/lib/cjs/ShowMoreLess/index.d.ts +30 -0
- package/lib/cjs/ShowMoreLess/index.js +202 -0
- package/lib/cjs/Switch/index.d.ts +29 -0
- package/lib/cjs/Switch/index.js +211 -0
- package/lib/cjs/Table/index.d.ts +25 -0
- package/lib/cjs/Table/index.js +2113 -0
- package/lib/cjs/Tabs/index.d.ts +3 -0
- package/lib/cjs/Tabs/index.js +323 -0
- package/lib/cjs/TagInput/index.d.ts +28 -0
- package/lib/cjs/TagInput/index.js +370 -0
- package/lib/cjs/Textarea/index.d.ts +30 -0
- package/lib/cjs/Textarea/index.js +242 -0
- package/lib/cjs/Toast/index.d.ts +35 -0
- package/lib/cjs/Toast/index.js +340 -0
- package/lib/cjs/Tooltip/index.d.ts +19 -0
- package/lib/cjs/Tooltip/index.js +200 -0
- package/lib/cjs/Tree/index.d.ts +37 -0
- package/lib/cjs/Tree/index.js +1406 -0
- package/lib/cjs/index.d.ts +33 -0
- package/lib/cjs/index.js +35 -0
- package/lib/css/BackToTop/index.css +34 -0
- package/lib/css/CascadingSelect/index.css +159 -0
- package/lib/css/CascadingSelectE2E/index.css +159 -0
- package/lib/css/ColorPicker/index.css +38 -0
- package/lib/css/DropdownMenu/index.css +127 -0
- package/lib/css/MultiFuncSelect/index.css +178 -0
- package/lib/css/MultilevelDropdownMenu/index.css +35 -0
- package/lib/css/RangeSlider/index.css +149 -0
- package/lib/css/ScrollReveal/index.css +23 -0
- package/lib/css/Scrollbar/index.css +168 -0
- package/lib/css/ShowMoreLess/index.css +23 -0
- package/lib/css/Table/index.css +533 -0
- package/lib/css/TagInput/index.css +90 -0
- package/lib/css/Toast/index.css +95 -0
- package/lib/css/Tooltip/index.css +240 -0
- package/lib/css/Tree/index.css +225 -0
- package/lib/esm/BackToTop/index.scss +47 -0
- package/lib/esm/BackToTop/index.tsx +182 -0
- package/lib/esm/BackToTop/utils/easing.js +200 -0
- package/lib/esm/BackToTop/utils/performance.js +52 -0
- package/lib/esm/CascadingSelect/Group.tsx +39 -0
- package/lib/esm/CascadingSelect/index.scss +214 -0
- package/lib/esm/CascadingSelect/index.tsx +922 -0
- package/lib/esm/CascadingSelect/utils/performance.js +52 -0
- package/lib/esm/CascadingSelectE2E/Group.tsx +39 -0
- package/lib/esm/CascadingSelectE2E/index.scss +214 -0
- package/lib/esm/CascadingSelectE2E/index.tsx +1091 -0
- package/lib/esm/CascadingSelectE2E/utils/performance.js +52 -0
- package/lib/esm/Checkbox/index.tsx +160 -0
- package/lib/esm/ColorPicker/index.scss +48 -0
- package/lib/esm/ColorPicker/index.tsx +187 -0
- package/lib/esm/DigitalClock/index.tsx +72 -0
- package/lib/esm/DigitalClock/utils/useInterval.js +43 -0
- package/lib/esm/DropdownMenu/Option.tsx +27 -0
- package/lib/esm/DropdownMenu/index.scss +180 -0
- package/lib/esm/DropdownMenu/index.tsx +148 -0
- package/lib/esm/DynamicFields/index.tsx +386 -0
- package/lib/esm/File/index.tsx +302 -0
- package/lib/esm/Input/index.tsx +233 -0
- package/lib/esm/LiveSearch/index.tsx +582 -0
- package/lib/esm/LiveSearch/utils/performance.js +52 -0
- package/lib/esm/LiveSearch/utils/useThrottle.js +36 -0
- package/lib/esm/ModalDialog/index.tsx +479 -0
- package/lib/esm/ModalDialog/plugins/BSL/bodyScrollLock.es6.js +262 -0
- package/lib/esm/ModalDialog/plugins/BSL/index.ts +2 -0
- package/lib/esm/ModeSwitch/index.tsx +82 -0
- package/lib/esm/MultiFuncSelect/index.scss +269 -0
- package/lib/esm/MultiFuncSelect/index.tsx +1597 -0
- package/lib/esm/MultiFuncSelect/utils/performance.js +52 -0
- package/lib/esm/MultiFuncSelect/utils/tree.js +103 -0
- package/lib/esm/MultiFuncSelect/utils/useThrottle.js +36 -0
- package/lib/esm/MultilevelDropdownMenu/MenuList.tsx +230 -0
- package/lib/esm/MultilevelDropdownMenu/index.scss +75 -0
- package/lib/esm/MultilevelDropdownMenu/index.tsx +71 -0
- package/lib/esm/MultilevelDropdownMenu/utils/dom.js +81 -0
- package/lib/esm/Pagination/index.tsx +230 -0
- package/lib/esm/Pagination/pagination-navigators.tsx +60 -0
- package/lib/esm/Radio/index.tsx +201 -0
- package/lib/esm/RangeSlider/index.scss +184 -0
- package/lib/esm/RangeSlider/index.tsx +223 -0
- package/lib/esm/ScrollReveal/index.scss +27 -0
- package/lib/esm/ScrollReveal/index.tsx +146 -0
- package/lib/esm/Scrollbar/index.scss +217 -0
- package/lib/esm/Scrollbar/index.tsx +497 -0
- package/lib/esm/Scrollbar/utils/performance.js +52 -0
- package/lib/esm/SearchBar/index.tsx +181 -0
- package/lib/esm/Select/index.tsx +276 -0
- package/lib/esm/ShowMoreLess/index.scss +27 -0
- package/lib/esm/ShowMoreLess/index.tsx +144 -0
- package/lib/esm/Switch/index.tsx +143 -0
- package/lib/esm/Table/TableColgroup.tsx +29 -0
- package/lib/esm/Table/TableField.tsx +40 -0
- package/lib/esm/Table/TableFieldRow.tsx +212 -0
- package/lib/esm/Table/TableHeaders.tsx +146 -0
- package/lib/esm/Table/TableRow.tsx +127 -0
- package/lib/esm/Table/TableSummaries.tsx +36 -0
- package/lib/esm/Table/index.scss +364 -0
- package/lib/esm/Table/index.tsx +576 -0
- package/lib/esm/Table/table-utils.ts +65 -0
- package/lib/esm/Table/utils/dom.js +81 -0
- package/lib/esm/Table/utils/performance.js +52 -0
- package/lib/esm/Tabs/TabList.tsx +42 -0
- package/lib/esm/Tabs/TabPanel.tsx +34 -0
- package/lib/esm/Tabs/Tabs.tsx +232 -0
- package/lib/esm/Tabs/index.tsx +3 -0
- package/lib/esm/TagInput/index.scss +125 -0
- package/lib/esm/TagInput/index.tsx +314 -0
- package/lib/esm/Textarea/index.tsx +178 -0
- package/lib/esm/Toast/Item.tsx +75 -0
- package/lib/esm/Toast/index.scss +120 -0
- package/lib/esm/Toast/index.tsx +249 -0
- package/lib/esm/Tooltip/index.scss +327 -0
- package/lib/esm/Tooltip/index.tsx +142 -0
- package/lib/esm/Tree/TreeList.tsx +503 -0
- package/lib/esm/Tree/index.scss +375 -0
- package/lib/esm/Tree/index.tsx +301 -0
- package/lib/esm/Tree/init-height.tsx +27 -0
- package/lib/esm/Tree/utils/convert-tree.js +29 -0
- package/lib/esm/Tree/utils/dom.js +81 -0
- package/lib/esm/index.js +31 -0
- package/package.json +40 -0
|
@@ -0,0 +1,725 @@
|
|
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
+
module.exports = factory(require("react"));
|
|
4
|
+
else if(typeof define === 'function' && define.amd)
|
|
5
|
+
define(["react"], factory);
|
|
6
|
+
else if(typeof exports === 'object')
|
|
7
|
+
exports["RPB"] = factory(require("react"));
|
|
8
|
+
else
|
|
9
|
+
root["RPB"] = factory(root["React"]);
|
|
10
|
+
})(this, (__WEBPACK_EXTERNAL_MODULE__787__) => {
|
|
11
|
+
return /******/ (() => { // webpackBootstrap
|
|
12
|
+
/******/ "use strict";
|
|
13
|
+
/******/ var __webpack_modules__ = ({
|
|
14
|
+
|
|
15
|
+
/***/ 787:
|
|
16
|
+
/***/ ((module) => {
|
|
17
|
+
|
|
18
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__787__;
|
|
19
|
+
|
|
20
|
+
/***/ })
|
|
21
|
+
|
|
22
|
+
/******/ });
|
|
23
|
+
/************************************************************************/
|
|
24
|
+
/******/ // The module cache
|
|
25
|
+
/******/ var __webpack_module_cache__ = {};
|
|
26
|
+
/******/
|
|
27
|
+
/******/ // The require function
|
|
28
|
+
/******/ function __webpack_require__(moduleId) {
|
|
29
|
+
/******/ // Check if module is in cache
|
|
30
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
31
|
+
/******/ if (cachedModule !== undefined) {
|
|
32
|
+
/******/ return cachedModule.exports;
|
|
33
|
+
/******/ }
|
|
34
|
+
/******/ // Create a new module (and put it into the cache)
|
|
35
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
36
|
+
/******/ // no module.id needed
|
|
37
|
+
/******/ // no module.loaded needed
|
|
38
|
+
/******/ exports: {}
|
|
39
|
+
/******/ };
|
|
40
|
+
/******/
|
|
41
|
+
/******/ // Execute the module function
|
|
42
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
43
|
+
/******/
|
|
44
|
+
/******/ // Return the exports of the module
|
|
45
|
+
/******/ return module.exports;
|
|
46
|
+
/******/ }
|
|
47
|
+
/******/
|
|
48
|
+
/************************************************************************/
|
|
49
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
50
|
+
/******/ (() => {
|
|
51
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
52
|
+
/******/ __webpack_require__.n = (module) => {
|
|
53
|
+
/******/ var getter = module && module.__esModule ?
|
|
54
|
+
/******/ () => (module['default']) :
|
|
55
|
+
/******/ () => (module);
|
|
56
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
57
|
+
/******/ return getter;
|
|
58
|
+
/******/ };
|
|
59
|
+
/******/ })();
|
|
60
|
+
/******/
|
|
61
|
+
/******/ /* webpack/runtime/define property getters */
|
|
62
|
+
/******/ (() => {
|
|
63
|
+
/******/ // define getter functions for harmony exports
|
|
64
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
65
|
+
/******/ for(var key in definition) {
|
|
66
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
67
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
68
|
+
/******/ }
|
|
69
|
+
/******/ }
|
|
70
|
+
/******/ };
|
|
71
|
+
/******/ })();
|
|
72
|
+
/******/
|
|
73
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
74
|
+
/******/ (() => {
|
|
75
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
76
|
+
/******/ })();
|
|
77
|
+
/******/
|
|
78
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
79
|
+
/******/ (() => {
|
|
80
|
+
/******/ // define __esModule on exports
|
|
81
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
82
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
83
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
84
|
+
/******/ }
|
|
85
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
86
|
+
/******/ };
|
|
87
|
+
/******/ })();
|
|
88
|
+
/******/
|
|
89
|
+
/************************************************************************/
|
|
90
|
+
var __webpack_exports__ = {};
|
|
91
|
+
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
|
92
|
+
(() => {
|
|
93
|
+
// ESM COMPAT FLAG
|
|
94
|
+
__webpack_require__.r(__webpack_exports__);
|
|
95
|
+
|
|
96
|
+
// EXPORTS
|
|
97
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
98
|
+
"default": () => (/* binding */ src)
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
// EXTERNAL MODULE: external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"}
|
|
102
|
+
var external_root_React_commonjs2_react_commonjs_react_amd_react_ = __webpack_require__(787);
|
|
103
|
+
var external_root_React_commonjs2_react_commonjs_react_amd_react_default = /*#__PURE__*/__webpack_require__.n(external_root_React_commonjs2_react_commonjs_react_amd_react_);
|
|
104
|
+
;// CONCATENATED MODULE: ./src/plugins/BSL/bodyScrollLock.es6.js
|
|
105
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
106
|
+
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."); }
|
|
107
|
+
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); }
|
|
108
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
109
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
110
|
+
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; }
|
|
111
|
+
// Older browsers don't support event options, feature detect it.
|
|
112
|
+
|
|
113
|
+
// Adopted and modified solution from Bohdan Didukh (2017)
|
|
114
|
+
// https://stackoverflow.com/questions/41594997/ios-10-safari-prevent-scrolling-behind-a-fixed-overlay-and-maintain-scroll-posi
|
|
115
|
+
|
|
116
|
+
var hasPassiveEvents = false;
|
|
117
|
+
if (typeof window !== 'undefined') {
|
|
118
|
+
var passiveTestOptions = {
|
|
119
|
+
get passive() {
|
|
120
|
+
hasPassiveEvents = true;
|
|
121
|
+
return undefined;
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
window.addEventListener('testPassive', null, passiveTestOptions);
|
|
125
|
+
window.removeEventListener('testPassive', null, passiveTestOptions);
|
|
126
|
+
}
|
|
127
|
+
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);
|
|
128
|
+
var locks = [];
|
|
129
|
+
var documentListenerAdded = false;
|
|
130
|
+
var initialClientY = -1;
|
|
131
|
+
var previousBodyOverflowSetting;
|
|
132
|
+
var previousBodyPosition;
|
|
133
|
+
var previousBodyPaddingRight;
|
|
134
|
+
|
|
135
|
+
// returns true if `el` should be allowed to receive touchmove events.
|
|
136
|
+
var allowTouchMove = function allowTouchMove(el) {
|
|
137
|
+
return locks.some(function (lock) {
|
|
138
|
+
if (lock.options.allowTouchMove && lock.options.allowTouchMove(el)) {
|
|
139
|
+
return true;
|
|
140
|
+
}
|
|
141
|
+
return false;
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
var preventDefault = function preventDefault(rawEvent) {
|
|
145
|
+
var e = rawEvent || window.event;
|
|
146
|
+
|
|
147
|
+
// For the case whereby consumers adds a touchmove event listener to document.
|
|
148
|
+
// Recall that we do document.addEventListener('touchmove', preventDefault, { passive: false })
|
|
149
|
+
// in disableBodyScroll - so if we provide this opportunity to allowTouchMove, then
|
|
150
|
+
// the touchmove event on document will break.
|
|
151
|
+
if (allowTouchMove(e.target)) {
|
|
152
|
+
return true;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Do not prevent if the event has more than one touch (usually meaning this is a multi touch gesture like pinch to zoom).
|
|
156
|
+
if (e.touches.length > 1) return true;
|
|
157
|
+
if (e.preventDefault) e.preventDefault();
|
|
158
|
+
return false;
|
|
159
|
+
};
|
|
160
|
+
var setOverflowHidden = function setOverflowHidden(options) {
|
|
161
|
+
// If previousBodyPaddingRight is already set, don't set it again.
|
|
162
|
+
if (previousBodyPaddingRight === undefined) {
|
|
163
|
+
var reserveScrollBarGap = !!options && options.reserveScrollBarGap === true;
|
|
164
|
+
var scrollBarGap = window.innerWidth - document.documentElement.clientWidth;
|
|
165
|
+
if (reserveScrollBarGap && scrollBarGap > 0) {
|
|
166
|
+
var computedBodyPaddingRight = parseInt(window.getComputedStyle(document.body).getPropertyValue('padding-right'), 10);
|
|
167
|
+
previousBodyPaddingRight = document.body.style.paddingRight;
|
|
168
|
+
document.body.style.paddingRight = "".concat(computedBodyPaddingRight + scrollBarGap, "px");
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// If previousBodyOverflowSetting is already set, don't set it again.
|
|
173
|
+
if (previousBodyOverflowSetting === undefined) {
|
|
174
|
+
previousBodyOverflowSetting = document.body.style.overflow;
|
|
175
|
+
document.body.style.overflow = 'hidden';
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
var restoreOverflowSetting = function restoreOverflowSetting() {
|
|
179
|
+
if (previousBodyPaddingRight !== undefined) {
|
|
180
|
+
document.body.style.paddingRight = previousBodyPaddingRight;
|
|
181
|
+
|
|
182
|
+
// Restore previousBodyPaddingRight to undefined so setOverflowHidden knows it
|
|
183
|
+
// can be set again.
|
|
184
|
+
previousBodyPaddingRight = undefined;
|
|
185
|
+
}
|
|
186
|
+
if (previousBodyOverflowSetting !== undefined) {
|
|
187
|
+
document.body.style.overflow = previousBodyOverflowSetting;
|
|
188
|
+
|
|
189
|
+
// Restore previousBodyOverflowSetting to undefined
|
|
190
|
+
// so setOverflowHidden knows it can be set again.
|
|
191
|
+
previousBodyOverflowSetting = undefined;
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
var setPositionFixed = function setPositionFixed() {
|
|
195
|
+
return window.requestAnimationFrame(function () {
|
|
196
|
+
// If previousBodyPosition is already set, don't set it again.
|
|
197
|
+
if (previousBodyPosition === undefined) {
|
|
198
|
+
previousBodyPosition = {
|
|
199
|
+
position: document.body.style.position,
|
|
200
|
+
top: document.body.style.top,
|
|
201
|
+
left: document.body.style.left
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
// Update the dom inside an animation frame
|
|
205
|
+
var _window = window,
|
|
206
|
+
scrollY = _window.scrollY,
|
|
207
|
+
scrollX = _window.scrollX,
|
|
208
|
+
innerHeight = _window.innerHeight;
|
|
209
|
+
document.body.style.position = 'fixed';
|
|
210
|
+
document.body.style.top = "".concat(-scrollY, "px");
|
|
211
|
+
document.body.style.left = "".concat(-scrollX, "px");
|
|
212
|
+
setTimeout(function () {
|
|
213
|
+
return window.requestAnimationFrame(function () {
|
|
214
|
+
// Attempt to check if the bottom bar appeared due to the position change
|
|
215
|
+
var bottomBarHeight = innerHeight - window.innerHeight;
|
|
216
|
+
if (bottomBarHeight && scrollY >= innerHeight) {
|
|
217
|
+
// Move the content further up so that the bottom bar doesn't hide it
|
|
218
|
+
document.body.style.top = -(scrollY + bottomBarHeight);
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
}, 300);
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
};
|
|
225
|
+
var restorePositionSetting = function restorePositionSetting() {
|
|
226
|
+
if (previousBodyPosition !== undefined) {
|
|
227
|
+
// Convert the position from "px" to Int
|
|
228
|
+
var y = -parseInt(document.body.style.top, 10);
|
|
229
|
+
var x = -parseInt(document.body.style.left, 10);
|
|
230
|
+
|
|
231
|
+
// Restore styles
|
|
232
|
+
document.body.style.position = previousBodyPosition.position;
|
|
233
|
+
document.body.style.top = previousBodyPosition.top;
|
|
234
|
+
document.body.style.left = previousBodyPosition.left;
|
|
235
|
+
|
|
236
|
+
// Restore scroll
|
|
237
|
+
window.scrollTo(x, y);
|
|
238
|
+
previousBodyPosition = undefined;
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight#Problems_and_solutions
|
|
243
|
+
var isTargetElementTotallyScrolled = function isTargetElementTotallyScrolled(targetElement) {
|
|
244
|
+
return targetElement ? targetElement.scrollHeight - targetElement.scrollTop <= targetElement.clientHeight : false;
|
|
245
|
+
};
|
|
246
|
+
var handleScroll = function handleScroll(event, targetElement) {
|
|
247
|
+
var clientY = event.targetTouches[0].clientY - initialClientY;
|
|
248
|
+
if (allowTouchMove(event.target)) {
|
|
249
|
+
return false;
|
|
250
|
+
}
|
|
251
|
+
if (targetElement && targetElement.scrollTop === 0 && clientY > 0) {
|
|
252
|
+
// element is at the top of its scroll.
|
|
253
|
+
return preventDefault(event);
|
|
254
|
+
}
|
|
255
|
+
if (isTargetElementTotallyScrolled(targetElement) && clientY < 0) {
|
|
256
|
+
// element is at the bottom of its scroll.
|
|
257
|
+
return preventDefault(event);
|
|
258
|
+
}
|
|
259
|
+
event.stopPropagation();
|
|
260
|
+
return true;
|
|
261
|
+
};
|
|
262
|
+
var disableBodyScroll = function disableBodyScroll(targetElement, options) {
|
|
263
|
+
// targetElement must be provided
|
|
264
|
+
if (!targetElement) {
|
|
265
|
+
// eslint-disable-next-line no-console
|
|
266
|
+
console.error('disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.');
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// disableBodyScroll must not have been called on this targetElement before
|
|
271
|
+
if (locks.some(function (lock) {
|
|
272
|
+
return lock.targetElement === targetElement;
|
|
273
|
+
})) {
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
var lock = {
|
|
277
|
+
targetElement: targetElement,
|
|
278
|
+
options: options || {}
|
|
279
|
+
};
|
|
280
|
+
locks = [].concat(_toConsumableArray(locks), [lock]);
|
|
281
|
+
if (isIosDevice) {
|
|
282
|
+
setPositionFixed();
|
|
283
|
+
} else {
|
|
284
|
+
setOverflowHidden(options);
|
|
285
|
+
}
|
|
286
|
+
if (isIosDevice) {
|
|
287
|
+
targetElement.ontouchstart = function (event) {
|
|
288
|
+
if (event.targetTouches.length === 1) {
|
|
289
|
+
// detect single touch.
|
|
290
|
+
initialClientY = event.targetTouches[0].clientY;
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
targetElement.ontouchmove = function (event) {
|
|
294
|
+
if (event.targetTouches.length === 1) {
|
|
295
|
+
// detect single touch.
|
|
296
|
+
handleScroll(event, targetElement);
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
if (!documentListenerAdded) {
|
|
300
|
+
document.addEventListener('touchmove', preventDefault, hasPassiveEvents ? {
|
|
301
|
+
passive: false
|
|
302
|
+
} : undefined);
|
|
303
|
+
documentListenerAdded = true;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
var clearAllBodyScrollLocks = function clearAllBodyScrollLocks() {
|
|
308
|
+
if (isIosDevice) {
|
|
309
|
+
// Clear all locks ontouchstart/ontouchmove handlers, and the references.
|
|
310
|
+
locks.forEach(function (lock) {
|
|
311
|
+
lock.targetElement.ontouchstart = null;
|
|
312
|
+
lock.targetElement.ontouchmove = null;
|
|
313
|
+
});
|
|
314
|
+
if (documentListenerAdded) {
|
|
315
|
+
document.removeEventListener('touchmove', preventDefault, hasPassiveEvents ? {
|
|
316
|
+
passive: false
|
|
317
|
+
} : undefined);
|
|
318
|
+
documentListenerAdded = false;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
// Reset initial clientY.
|
|
322
|
+
initialClientY = -1;
|
|
323
|
+
}
|
|
324
|
+
if (isIosDevice) {
|
|
325
|
+
restorePositionSetting();
|
|
326
|
+
} else {
|
|
327
|
+
restoreOverflowSetting();
|
|
328
|
+
}
|
|
329
|
+
locks = [];
|
|
330
|
+
};
|
|
331
|
+
var enableBodyScroll = function enableBodyScroll(targetElement) {
|
|
332
|
+
if (!targetElement) {
|
|
333
|
+
// eslint-disable-next-line no-console
|
|
334
|
+
console.error('enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.');
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
locks = locks.filter(function (lock) {
|
|
338
|
+
return lock.targetElement !== targetElement;
|
|
339
|
+
});
|
|
340
|
+
if (isIosDevice) {
|
|
341
|
+
targetElement.ontouchstart = null;
|
|
342
|
+
targetElement.ontouchmove = null;
|
|
343
|
+
if (documentListenerAdded && locks.length === 0) {
|
|
344
|
+
document.removeEventListener('touchmove', preventDefault, hasPassiveEvents ? {
|
|
345
|
+
passive: false
|
|
346
|
+
} : undefined);
|
|
347
|
+
documentListenerAdded = false;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
if (isIosDevice) {
|
|
351
|
+
restorePositionSetting();
|
|
352
|
+
} else {
|
|
353
|
+
restoreOverflowSetting();
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
;// CONCATENATED MODULE: ./src/plugins/BSL/index.ts
|
|
357
|
+
|
|
358
|
+
;// CONCATENATED MODULE: ./src/index.tsx
|
|
359
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || src_unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
360
|
+
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."); }
|
|
361
|
+
function src_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return src_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 src_arrayLikeToArray(o, minLen); }
|
|
362
|
+
function src_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; }
|
|
363
|
+
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; } }
|
|
364
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
365
|
+
|
|
366
|
+
//Destroys body scroll locking
|
|
367
|
+
|
|
368
|
+
var ModalDialog = function ModalDialog(props) {
|
|
369
|
+
var show = props.show,
|
|
370
|
+
protectFixedViewport = props.protectFixedViewport,
|
|
371
|
+
maxWidth = props.maxWidth,
|
|
372
|
+
minHeight = props.minHeight,
|
|
373
|
+
enableVideo = props.enableVideo,
|
|
374
|
+
heading = props.heading,
|
|
375
|
+
triggerClassName = props.triggerClassName,
|
|
376
|
+
triggerContent = props.triggerContent,
|
|
377
|
+
closeBtnClassName = props.closeBtnClassName,
|
|
378
|
+
closeBtnLabel = props.closeBtnLabel,
|
|
379
|
+
submitBtnClassName = props.submitBtnClassName,
|
|
380
|
+
submitBtnLabel = props.submitBtnLabel,
|
|
381
|
+
autoClose = props.autoClose,
|
|
382
|
+
maskDisabled = props.maskDisabled,
|
|
383
|
+
maskOpacity = props.maskOpacity,
|
|
384
|
+
closeOnlyBtn = props.closeOnlyBtn,
|
|
385
|
+
closeDisabled = props.closeDisabled,
|
|
386
|
+
data = props.data,
|
|
387
|
+
onLoad = props.onLoad,
|
|
388
|
+
onOpen = props.onOpen,
|
|
389
|
+
onClose = props.onClose,
|
|
390
|
+
onSubmit = props.onSubmit,
|
|
391
|
+
id = props.id,
|
|
392
|
+
children = props.children;
|
|
393
|
+
var uniqueID = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useId)().replace(/\:/g, "-");
|
|
394
|
+
var modalRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
395
|
+
var triggerRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
396
|
+
var idRes = id || uniqueID;
|
|
397
|
+
var PROTECT_FIXED_VIEWPORT = typeof protectFixedViewport === 'undefined' ? true : protectFixedViewport;
|
|
398
|
+
var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
|
|
399
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
400
|
+
winShow = _useState2[0],
|
|
401
|
+
setWinShow = _useState2[1];
|
|
402
|
+
var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(null),
|
|
403
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
404
|
+
incomingData = _useState4[0],
|
|
405
|
+
setIncomingData = _useState4[1];
|
|
406
|
+
function handleCloseWin(e) {
|
|
407
|
+
if (typeof e !== 'undefined' && e !== null) e.preventDefault();
|
|
408
|
+
closeAction();
|
|
409
|
+
|
|
410
|
+
//
|
|
411
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(e);
|
|
412
|
+
}
|
|
413
|
+
function handleOpenWin(e) {
|
|
414
|
+
if (typeof e !== 'undefined' && e !== null) e.preventDefault();
|
|
415
|
+
openAction();
|
|
416
|
+
|
|
417
|
+
//
|
|
418
|
+
var callback = function callback(e) {
|
|
419
|
+
return function () {
|
|
420
|
+
handleCloseWin(e);
|
|
421
|
+
};
|
|
422
|
+
};
|
|
423
|
+
onOpen === null || onOpen === void 0 ? void 0 : onOpen(e, callback(e));
|
|
424
|
+
}
|
|
425
|
+
function closeAction() {
|
|
426
|
+
// pause video without controls
|
|
427
|
+
//------------------------------------------
|
|
428
|
+
if (window.curVideo !== null && typeof window.curVideo !== 'undefined') window.curVideo.pause();
|
|
429
|
+
|
|
430
|
+
// close Modal Dialog
|
|
431
|
+
//------------------------------------------
|
|
432
|
+
var $mask = document.querySelector("#mask-".concat(idRes, " > .modal-backdrop"));
|
|
433
|
+
setWinShow(false);
|
|
434
|
+
if ($mask !== null) $mask.classList.remove('show');
|
|
435
|
+
setTimeout(function () {
|
|
436
|
+
if (modalRef.current !== null) modalRef.current.style.display = 'none';
|
|
437
|
+
if ($mask !== null) $mask.style.display = 'none';
|
|
438
|
+
}, 300);
|
|
439
|
+
|
|
440
|
+
// Unlocks the page
|
|
441
|
+
//------------------------------------------
|
|
442
|
+
enableBodyScroll(document.querySelector('body'));
|
|
443
|
+
|
|
444
|
+
// Cancels a timeout previously established by calling setTimeout().
|
|
445
|
+
//------------------------------------------
|
|
446
|
+
clearTimeout(window.setCloseModalDialog);
|
|
447
|
+
}
|
|
448
|
+
function openAction() {
|
|
449
|
+
// Video PopUp Interaction
|
|
450
|
+
//------------------------------------------
|
|
451
|
+
var hasVideo = modalRef.current.classList.contains('is-video') ? true : false;
|
|
452
|
+
if (hasVideo) {
|
|
453
|
+
var windowWidth = window.innerWidth;
|
|
454
|
+
var windowHeight = window.innerHeight;
|
|
455
|
+
var $videoWrapper = modalRef.current.querySelector('.modal-dialog__video');
|
|
456
|
+
var isIframe = $videoWrapper.getElementsByTagName('iframe').length > 0 ? true : false;
|
|
457
|
+
var $video = isIframe ? $videoWrapper.getElementsByTagName('iframe')[0] : $videoWrapper.getElementsByTagName('video')[0];
|
|
458
|
+
|
|
459
|
+
//
|
|
460
|
+
var setVideo = function setVideo(currentWidth, currentHeight, obj) {
|
|
461
|
+
var newMaxW = windowWidth - 80,
|
|
462
|
+
newMaxH = windowHeight - 80;
|
|
463
|
+
var newW = currentWidth,
|
|
464
|
+
newH = currentHeight;
|
|
465
|
+
if (currentHeight > newMaxH) {
|
|
466
|
+
newH = newMaxH;
|
|
467
|
+
|
|
468
|
+
//Scaled/Proportional Content
|
|
469
|
+
newW = currentWidth * (newH / currentHeight);
|
|
470
|
+
}
|
|
471
|
+
if (newW > newMaxW) {
|
|
472
|
+
newW = newMaxW;
|
|
473
|
+
|
|
474
|
+
//Scaled/Proportional Content
|
|
475
|
+
newH = currentHeight * (newW / currentWidth);
|
|
476
|
+
}
|
|
477
|
+
obj.height = newH + 'px';
|
|
478
|
+
obj.width = newW + 'px';
|
|
479
|
+
|
|
480
|
+
//
|
|
481
|
+
modalRef.current.querySelector('.modal-dialog').style.width = newW + 'px';
|
|
482
|
+
};
|
|
483
|
+
if (isIframe) {
|
|
484
|
+
var _w = parseFloat(modalRef.current.querySelector('.modal-dialog').style.maxWidth);
|
|
485
|
+
if (isNaN(_w)) _w = 500;
|
|
486
|
+
var _h = _w * 0.5625;
|
|
487
|
+
setVideo(_w, _h, $video);
|
|
488
|
+
} else {
|
|
489
|
+
var _sources = $video.getElementsByTagName('source');
|
|
490
|
+
var _src = _sources.length > 0 ? _sources[0].src : $video.src;
|
|
491
|
+
getVideoDimensions(_src).then(function (res) {
|
|
492
|
+
setVideo(res.width, res.height, $video);
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
//Set current video when the tag is <video>
|
|
497
|
+
window.curVideo = $video.tagName === 'VIDEO' ? $video : null;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
// fire Modal Dialog
|
|
501
|
+
//------------------------------------------
|
|
502
|
+
var $mask = document.querySelector("#mask-".concat(idRes, " > .modal-backdrop"));
|
|
503
|
+
modalRef.current.style.display = 'block';
|
|
504
|
+
if ($mask !== null) $mask.style.display = 'block';
|
|
505
|
+
setTimeout(function () {
|
|
506
|
+
setWinShow(true);
|
|
507
|
+
if ($mask !== null) $mask.classList.add('show');
|
|
508
|
+
}, 0);
|
|
509
|
+
|
|
510
|
+
// Locks the page
|
|
511
|
+
//------------------------------------------
|
|
512
|
+
//
|
|
513
|
+
// Get a target element that you want to persist scrolling for (such as a modal/lightbox/flyout/nav).
|
|
514
|
+
// Specifically, the target element is the one we would like to allow scroll on (NOT a parent of that element).
|
|
515
|
+
// This is also the element to apply the CSS '-webkit-overflow-scrolling: touch;' if desired.
|
|
516
|
+
disableBodyScroll(document.querySelector('body'));
|
|
517
|
+
|
|
518
|
+
//auto close
|
|
519
|
+
//------------------------------------------
|
|
520
|
+
if (autoClose && !isNaN(autoClose)) {
|
|
521
|
+
window.setCloseModalDialog = setTimeout(function () {
|
|
522
|
+
closeAction();
|
|
523
|
+
|
|
524
|
+
//
|
|
525
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(null);
|
|
526
|
+
}, autoClose);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
//Returns the dimensions of a video asynchrounsly.
|
|
531
|
+
function getVideoDimensions(url) {
|
|
532
|
+
return new Promise(function (resolve) {
|
|
533
|
+
// create the video element
|
|
534
|
+
var video = document.createElement('video');
|
|
535
|
+
|
|
536
|
+
// place a listener on it
|
|
537
|
+
video.addEventListener("loadedmetadata", function () {
|
|
538
|
+
// retrieve dimensions
|
|
539
|
+
var height = this.videoHeight;
|
|
540
|
+
var width = this.videoWidth;
|
|
541
|
+
// send back result
|
|
542
|
+
resolve({
|
|
543
|
+
height: height,
|
|
544
|
+
width: width
|
|
545
|
+
});
|
|
546
|
+
}, false);
|
|
547
|
+
|
|
548
|
+
// start download meta-datas
|
|
549
|
+
video.src = url;
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
553
|
+
// update incoming data
|
|
554
|
+
//--------------
|
|
555
|
+
setIncomingData(data);
|
|
556
|
+
|
|
557
|
+
// Move HTML templates to tag end body </body>
|
|
558
|
+
// render() don't use "Fragment", in order to avoid error "Failed to execute 'insertBefore' on 'Node'"
|
|
559
|
+
// prevent "transform", "filter", "perspective" attribute destruction fixed viewport orientation
|
|
560
|
+
//--------------
|
|
561
|
+
if (PROTECT_FIXED_VIEWPORT) {
|
|
562
|
+
if (document.body !== null) {
|
|
563
|
+
document.body.appendChild(modalRef.current);
|
|
564
|
+
[].slice.call(modalRef.current.querySelectorAll('[data-close]')).forEach(function (node) {
|
|
565
|
+
if (typeof node.dataset.ev === 'undefined') {
|
|
566
|
+
node.dataset.ev = 'true';
|
|
567
|
+
node.addEventListener('pointerdown', function (e) {
|
|
568
|
+
handleCloseWin(e);
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
});
|
|
572
|
+
[].slice.call(modalRef.current.querySelectorAll('[data-confirm]')).forEach(function (node) {
|
|
573
|
+
if (typeof node.dataset.ev === 'undefined') {
|
|
574
|
+
node.dataset.ev = 'true';
|
|
575
|
+
node.addEventListener('pointerdown', function (e) {
|
|
576
|
+
var callback = function callback(e) {
|
|
577
|
+
return function () {
|
|
578
|
+
handleCloseWin(e);
|
|
579
|
+
};
|
|
580
|
+
};
|
|
581
|
+
var _incomingData = node.dataset.incomingData;
|
|
582
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(e, callback(e), _incomingData);
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
});
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
// add mask
|
|
590
|
+
//--------------
|
|
591
|
+
if (document.getElementById("mask-".concat(idRes)) === null && !maskDisabled && document.body !== null) {
|
|
592
|
+
var maskDiv = document.createElement('div');
|
|
593
|
+
maskDiv.id = "mask-".concat(idRes);
|
|
594
|
+
maskDiv.innerHTML = "<div class=\"".concat(winShow ? 'modal-backdrop fade show' : 'modal-backdrop fade', "\" style=\"display:none;").concat(maskOpacity ? "opacity:".concat(maskOpacity, ";") : '', "\"></div>");
|
|
595
|
+
document.body.appendChild(maskDiv);
|
|
596
|
+
if (!closeOnlyBtn) {
|
|
597
|
+
var $mask = document.querySelector("#mask-".concat(idRes, " > .modal-backdrop"));
|
|
598
|
+
if ($mask !== null) $mask.addEventListener('pointerdown', function (e) {
|
|
599
|
+
handleCloseWin(e);
|
|
600
|
+
});
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
// show
|
|
605
|
+
//--------------
|
|
606
|
+
if (show) {
|
|
607
|
+
openAction();
|
|
608
|
+
|
|
609
|
+
//
|
|
610
|
+
var _callback = function _callback(e) {
|
|
611
|
+
return function () {
|
|
612
|
+
handleCloseWin(e);
|
|
613
|
+
};
|
|
614
|
+
};
|
|
615
|
+
onOpen === null || onOpen === void 0 ? void 0 : onOpen(null, _callback(null));
|
|
616
|
+
} else {
|
|
617
|
+
handleCloseWin(null);
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
// Pass the function to be called
|
|
621
|
+
//--------------
|
|
622
|
+
onLoad === null || onLoad === void 0 ? void 0 : onLoad(function () {
|
|
623
|
+
return handleOpenWin;
|
|
624
|
+
}, function () {
|
|
625
|
+
return handleCloseWin;
|
|
626
|
+
});
|
|
627
|
+
|
|
628
|
+
// Remove the global list of events, especially as scroll and interval.
|
|
629
|
+
//--------------
|
|
630
|
+
return function () {
|
|
631
|
+
clearAllBodyScrollLocks();
|
|
632
|
+
|
|
633
|
+
// Cancels a timeout previously established by calling setTimeout().
|
|
634
|
+
clearTimeout(window.setCloseModalDialog);
|
|
635
|
+
|
|
636
|
+
// Remove all masks and modals
|
|
637
|
+
Array.prototype.forEach.call(document.querySelectorAll('.modal'), function (node) {
|
|
638
|
+
if (PROTECT_FIXED_VIEWPORT) {
|
|
639
|
+
// for current actived modal
|
|
640
|
+
if (node.classList.contains('protect-fixed-viewport') && node.classList.contains('show')) {
|
|
641
|
+
node.remove();
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
});
|
|
645
|
+
|
|
646
|
+
// If there is no active modal, hide all masks
|
|
647
|
+
var existingModal = [].slice.call(document.querySelectorAll('.modal')).filter(function (node) {
|
|
648
|
+
return node.classList.contains('show');
|
|
649
|
+
}).length > 0;
|
|
650
|
+
if (!existingModal) {
|
|
651
|
+
Array.prototype.forEach.call(document.querySelectorAll('.modal-backdrop'), function (mask) {
|
|
652
|
+
mask.classList.remove('show');
|
|
653
|
+
mask.style.display = 'none';
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
};
|
|
657
|
+
}, [show, data]);
|
|
658
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", null, triggerContent ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
659
|
+
className: triggerClassName ? triggerClassName : 'd-inline w-auto',
|
|
660
|
+
ref: triggerRef,
|
|
661
|
+
onClick: handleOpenWin
|
|
662
|
+
}, triggerContent)) : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
663
|
+
ref: modalRef,
|
|
664
|
+
className: enableVideo ? "modal ".concat(PROTECT_FIXED_VIEWPORT ? 'protect-fixed-viewport' : '', " fade is-video ").concat(winShow ? 'show' : '') : "modal ".concat(PROTECT_FIXED_VIEWPORT ? 'protect-fixed-viewport' : '', " fade ").concat(winShow ? 'show' : ''),
|
|
665
|
+
tabIndex: -1,
|
|
666
|
+
"aria-hidden": "true",
|
|
667
|
+
style: {
|
|
668
|
+
pointerEvents: 'none'
|
|
669
|
+
},
|
|
670
|
+
"data-mask": "mask-".concat(idRes)
|
|
671
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
672
|
+
className: "modal-dialog modal-dialog-centered modal-dialog-scrollable",
|
|
673
|
+
style: maxWidth ? {
|
|
674
|
+
maxWidth: "".concat(maxWidth)
|
|
675
|
+
} : {}
|
|
676
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
677
|
+
className: enableVideo ? 'modal-content bg-transparent shadow-none border-0' : 'modal-content',
|
|
678
|
+
style: {
|
|
679
|
+
overflow: 'inherit',
|
|
680
|
+
minHeight: minHeight ? minHeight : 'auto'
|
|
681
|
+
}
|
|
682
|
+
}, (!heading || heading === '') && closeDisabled ? null : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
683
|
+
className: enableVideo ? 'modal-header border-0 px-0' : 'modal-header'
|
|
684
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("h5", {
|
|
685
|
+
className: "modal-title"
|
|
686
|
+
}, heading || ''), !closeDisabled ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("button", {
|
|
687
|
+
type: "button",
|
|
688
|
+
className: enableVideo ? 'btn-close btn-close-white' : 'btn-close',
|
|
689
|
+
"data-close": "1",
|
|
690
|
+
onClick: handleCloseWin
|
|
691
|
+
}) : null)), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
692
|
+
className: enableVideo ? 'modal-body m-0 p-0' : 'modal-body'
|
|
693
|
+
}, enableVideo ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
694
|
+
className: "modal-dialog__video"
|
|
695
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
696
|
+
className: "ratio ratio-16x9"
|
|
697
|
+
}, children))) : children), closeBtnLabel || submitBtnLabel ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
698
|
+
className: "modal-footer"
|
|
699
|
+
}, !closeDisabled ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, closeBtnLabel ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("button", {
|
|
700
|
+
"data-close": "1",
|
|
701
|
+
onClick: handleCloseWin,
|
|
702
|
+
type: "button",
|
|
703
|
+
className: closeBtnClassName ? closeBtnClassName : 'btn btn-secondary'
|
|
704
|
+
}, closeBtnLabel) : null) : null, submitBtnLabel ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("button", {
|
|
705
|
+
"data-confirm": "1",
|
|
706
|
+
"data-incoming-data": "".concat(incomingData),
|
|
707
|
+
onClick: function onClick(e) {
|
|
708
|
+
var callback = function callback(e) {
|
|
709
|
+
return function () {
|
|
710
|
+
handleCloseWin(e);
|
|
711
|
+
};
|
|
712
|
+
};
|
|
713
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(e, callback(e), incomingData);
|
|
714
|
+
},
|
|
715
|
+
type: "button",
|
|
716
|
+
className: submitBtnClassName ? submitBtnClassName : 'btn btn-primary'
|
|
717
|
+
}, submitBtnLabel) : null)) : null))));
|
|
718
|
+
};
|
|
719
|
+
/* harmony default export */ const src = (ModalDialog);
|
|
720
|
+
})();
|
|
721
|
+
|
|
722
|
+
/******/ return __webpack_exports__;
|
|
723
|
+
/******/ })()
|
|
724
|
+
;
|
|
725
|
+
});
|