ably-ui 5.0.0.dev.bf26560 → 5.0.0.dev.d3162ab
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ably_ui/core/code/component.css +0 -2
- data/lib/ably_ui/core/code/component.js +1 -7468
- data/lib/ably_ui/core/connect_state_wrapper/component.js +1 -22
- data/lib/ably_ui/core/contact_footer/component.css +0 -2
- data/lib/ably_ui/core/contact_footer/component.js +1 -211
- data/lib/ably_ui/core/cookie_message/component.css +0 -2
- data/lib/ably_ui/core/cookie_message/component.js +1 -82
- data/lib/ably_ui/core/feature_footer/component.css +0 -2
- data/lib/ably_ui/core/feature_footer/component.js +1 -211
- data/lib/ably_ui/core/featured_link/component.css +0 -2
- data/lib/ably_ui/core/featured_link/component.js +1 -82
- data/lib/ably_ui/core/flash/component.css +0 -2
- data/lib/ably_ui/core/flash/component.js +1 -82
- data/lib/ably_ui/core/footer/component.css +0 -2
- data/lib/ably_ui/core/footer/component.js +1 -82
- data/lib/ably_ui/core/icon/component.js +1 -22
- data/lib/ably_ui/core/logo/component.js +1 -22
- data/lib/ably_ui/core/meganav/component.css +0 -2
- data/lib/ably_ui/core/meganav/component.js +1 -1857
- data/lib/ably_ui/core/meganav_blog_posts_list/component.js +1 -1934
- data/lib/ably_ui/core/meganav_content_developers/component.js +1 -22
- data/lib/ably_ui/core/meganav_content_platform/component.js +1 -22
- data/lib/ably_ui/core/meganav_content_use_cases/component.js +1 -22
- data/lib/ably_ui/core/meganav_content_why_ably/component.js +1 -22
- data/lib/ably_ui/core/meganav_control/component.js +1 -208
- data/lib/ably_ui/core/meganav_control_mobile_dropdown/component.js +1 -975
- data/lib/ably_ui/core/meganav_control_mobile_panel_close/component.js +1 -142
- data/lib/ably_ui/core/meganav_control_mobile_panel_open/component.js +1 -170
- data/lib/ably_ui/core/meganav_items_desktop/component.js +1 -22
- data/lib/ably_ui/core/meganav_items_mobile/component.js +1 -22
- data/lib/ably_ui/core/meganav_items_signed_in/component.js +1 -22
- data/lib/ably_ui/core/notice/component.css +0 -2
- data/lib/ably_ui/core/notice/component.js +2 -4613
- data/lib/ably_ui/core/showcase/component.css +0 -2
- data/lib/ably_ui/core/showcase/component.js +1 -343
- data/lib/ably_ui/core/sign_out_link/component.js +1 -22
- data/lib/ably_ui/core/slider/component.css +0 -2
- data/lib/ably_ui/core/slider/component.js +1 -38
- data/lib/ably_ui/core/uptime/component.css +0 -2
- data/lib/ably_ui/core/uptime/component.js +1 -82
- data/lib/ably_ui/version.rb +1 -1
- metadata +1 -1
@@ -1,975 +1 @@
|
|
1
|
-
(function webpackUniversalModuleDefinition(root, factory) {
|
2
|
-
if(typeof exports === 'object' && typeof module === 'object')
|
3
|
-
module.exports = factory();
|
4
|
-
else if(typeof define === 'function' && define.amd)
|
5
|
-
define([], factory);
|
6
|
-
else if(typeof exports === 'object')
|
7
|
-
exports["AblyUi"] = factory();
|
8
|
-
else
|
9
|
-
root["AblyUi"] = root["AblyUi"] || {}, root["AblyUi"]["Core"] = root["AblyUi"]["Core"] || {}, root["AblyUi"]["Core"]["MeganavControlMobileDropdown"] = factory();
|
10
|
-
})(this, function() {
|
11
|
-
return /******/ (() => { // webpackBootstrap
|
12
|
-
/******/ var __webpack_modules__ = ({
|
13
|
-
|
14
|
-
/***/ "./src/core/dom-query.js":
|
15
|
-
/*!*******************************!*\
|
16
|
-
!*** ./src/core/dom-query.js ***!
|
17
|
-
\*******************************/
|
18
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
19
|
-
|
20
|
-
"use strict";
|
21
|
-
__webpack_require__.r(__webpack_exports__);
|
22
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
23
|
-
/* harmony export */ "queryId": () => (/* binding */ queryId),
|
24
|
-
/* harmony export */ "queryIdAll": () => (/* binding */ queryIdAll)
|
25
|
-
/* harmony export */ });
|
26
|
-
var queryId = function queryId(val) {
|
27
|
-
var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;
|
28
|
-
return root.querySelector("[data-id=".concat(val, "]"));
|
29
|
-
};
|
30
|
-
var queryIdAll = function queryIdAll(val) {
|
31
|
-
var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;
|
32
|
-
return root.querySelectorAll("[data-id=".concat(val, "]"));
|
33
|
-
};
|
34
|
-
|
35
|
-
/***/ }),
|
36
|
-
|
37
|
-
/***/ "./node_modules/scroll-lock/dist/scroll-lock.js":
|
38
|
-
/*!******************************************************!*\
|
39
|
-
!*** ./node_modules/scroll-lock/dist/scroll-lock.js ***!
|
40
|
-
\******************************************************/
|
41
|
-
/***/ (function(module) {
|
42
|
-
|
43
|
-
(function webpackUniversalModuleDefinition(root, factory) {
|
44
|
-
if(true)
|
45
|
-
module.exports = factory();
|
46
|
-
else {}
|
47
|
-
})(this, function() {
|
48
|
-
return /******/ (function(modules) { // webpackBootstrap
|
49
|
-
/******/ // The module cache
|
50
|
-
/******/ var installedModules = {};
|
51
|
-
/******/
|
52
|
-
/******/ // The require function
|
53
|
-
/******/ function __nested_webpack_require_543__(moduleId) {
|
54
|
-
/******/
|
55
|
-
/******/ // Check if module is in cache
|
56
|
-
/******/ if(installedModules[moduleId]) {
|
57
|
-
/******/ return installedModules[moduleId].exports;
|
58
|
-
/******/ }
|
59
|
-
/******/ // Create a new module (and put it into the cache)
|
60
|
-
/******/ var module = installedModules[moduleId] = {
|
61
|
-
/******/ i: moduleId,
|
62
|
-
/******/ l: false,
|
63
|
-
/******/ exports: {}
|
64
|
-
/******/ };
|
65
|
-
/******/
|
66
|
-
/******/ // Execute the module function
|
67
|
-
/******/ modules[moduleId].call(module.exports, module, module.exports, __nested_webpack_require_543__);
|
68
|
-
/******/
|
69
|
-
/******/ // Flag the module as loaded
|
70
|
-
/******/ module.l = true;
|
71
|
-
/******/
|
72
|
-
/******/ // Return the exports of the module
|
73
|
-
/******/ return module.exports;
|
74
|
-
/******/ }
|
75
|
-
/******/
|
76
|
-
/******/
|
77
|
-
/******/ // expose the modules object (__webpack_modules__)
|
78
|
-
/******/ __nested_webpack_require_543__.m = modules;
|
79
|
-
/******/
|
80
|
-
/******/ // expose the module cache
|
81
|
-
/******/ __nested_webpack_require_543__.c = installedModules;
|
82
|
-
/******/
|
83
|
-
/******/ // define getter function for harmony exports
|
84
|
-
/******/ __nested_webpack_require_543__.d = function(exports, name, getter) {
|
85
|
-
/******/ if(!__nested_webpack_require_543__.o(exports, name)) {
|
86
|
-
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
87
|
-
/******/ }
|
88
|
-
/******/ };
|
89
|
-
/******/
|
90
|
-
/******/ // define __esModule on exports
|
91
|
-
/******/ __nested_webpack_require_543__.r = function(exports) {
|
92
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
93
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
94
|
-
/******/ }
|
95
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
96
|
-
/******/ };
|
97
|
-
/******/
|
98
|
-
/******/ // create a fake namespace object
|
99
|
-
/******/ // mode & 1: value is a module id, require it
|
100
|
-
/******/ // mode & 2: merge all properties of value into the ns
|
101
|
-
/******/ // mode & 4: return value when already ns object
|
102
|
-
/******/ // mode & 8|1: behave like require
|
103
|
-
/******/ __nested_webpack_require_543__.t = function(value, mode) {
|
104
|
-
/******/ if(mode & 1) value = __nested_webpack_require_543__(value);
|
105
|
-
/******/ if(mode & 8) return value;
|
106
|
-
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
107
|
-
/******/ var ns = Object.create(null);
|
108
|
-
/******/ __nested_webpack_require_543__.r(ns);
|
109
|
-
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
110
|
-
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_543__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
111
|
-
/******/ return ns;
|
112
|
-
/******/ };
|
113
|
-
/******/
|
114
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
115
|
-
/******/ __nested_webpack_require_543__.n = function(module) {
|
116
|
-
/******/ var getter = module && module.__esModule ?
|
117
|
-
/******/ function getDefault() { return module['default']; } :
|
118
|
-
/******/ function getModuleExports() { return module; };
|
119
|
-
/******/ __nested_webpack_require_543__.d(getter, 'a', getter);
|
120
|
-
/******/ return getter;
|
121
|
-
/******/ };
|
122
|
-
/******/
|
123
|
-
/******/ // Object.prototype.hasOwnProperty.call
|
124
|
-
/******/ __nested_webpack_require_543__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
125
|
-
/******/
|
126
|
-
/******/ // __webpack_public_path__
|
127
|
-
/******/ __nested_webpack_require_543__.p = "";
|
128
|
-
/******/
|
129
|
-
/******/
|
130
|
-
/******/ // Load entry module and return exports
|
131
|
-
/******/ return __nested_webpack_require_543__(__nested_webpack_require_543__.s = 0);
|
132
|
-
/******/ })
|
133
|
-
/************************************************************************/
|
134
|
-
/******/ ([
|
135
|
-
/* 0 */
|
136
|
-
/***/ (function(module, __webpack_exports__, __nested_webpack_require_4019__) {
|
137
|
-
|
138
|
-
"use strict";
|
139
|
-
__nested_webpack_require_4019__.r(__webpack_exports__);
|
140
|
-
|
141
|
-
// CONCATENATED MODULE: ./src/tools.js
|
142
|
-
var argumentAsArray = function argumentAsArray(argument) {
|
143
|
-
return Array.isArray(argument) ? argument : [argument];
|
144
|
-
};
|
145
|
-
var isElement = function isElement(target) {
|
146
|
-
return target instanceof Node;
|
147
|
-
};
|
148
|
-
var isElementList = function isElementList(nodeList) {
|
149
|
-
return nodeList instanceof NodeList;
|
150
|
-
};
|
151
|
-
var eachNode = function eachNode(nodeList, callback) {
|
152
|
-
if (nodeList && callback) {
|
153
|
-
nodeList = isElementList(nodeList) ? nodeList : [nodeList];
|
154
|
-
|
155
|
-
for (var i = 0; i < nodeList.length; i++) {
|
156
|
-
if (callback(nodeList[i], i, nodeList.length) === true) {
|
157
|
-
break;
|
158
|
-
}
|
159
|
-
}
|
160
|
-
}
|
161
|
-
};
|
162
|
-
var throwError = function throwError(message) {
|
163
|
-
return console.error("[scroll-lock] ".concat(message));
|
164
|
-
};
|
165
|
-
var arrayAsSelector = function arrayAsSelector(array) {
|
166
|
-
if (Array.isArray(array)) {
|
167
|
-
var selector = array.join(', ');
|
168
|
-
return selector;
|
169
|
-
}
|
170
|
-
};
|
171
|
-
var nodeListAsArray = function nodeListAsArray(nodeList) {
|
172
|
-
var nodes = [];
|
173
|
-
eachNode(nodeList, function (node) {
|
174
|
-
return nodes.push(node);
|
175
|
-
});
|
176
|
-
return nodes;
|
177
|
-
};
|
178
|
-
var findParentBySelector = function findParentBySelector($el, selector) {
|
179
|
-
var self = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
180
|
-
var $root = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : document;
|
181
|
-
|
182
|
-
if (self && nodeListAsArray($root.querySelectorAll(selector)).indexOf($el) !== -1) {
|
183
|
-
return $el;
|
184
|
-
}
|
185
|
-
|
186
|
-
while (($el = $el.parentElement) && nodeListAsArray($root.querySelectorAll(selector)).indexOf($el) === -1) {
|
187
|
-
;
|
188
|
-
}
|
189
|
-
|
190
|
-
return $el;
|
191
|
-
};
|
192
|
-
var elementHasSelector = function elementHasSelector($el, selector) {
|
193
|
-
var $root = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : document;
|
194
|
-
var has = nodeListAsArray($root.querySelectorAll(selector)).indexOf($el) !== -1;
|
195
|
-
return has;
|
196
|
-
};
|
197
|
-
var elementHasOverflowHidden = function elementHasOverflowHidden($el) {
|
198
|
-
if ($el) {
|
199
|
-
var computedStyle = getComputedStyle($el);
|
200
|
-
var overflowIsHidden = computedStyle.overflow === 'hidden';
|
201
|
-
return overflowIsHidden;
|
202
|
-
}
|
203
|
-
};
|
204
|
-
var elementScrollTopOnStart = function elementScrollTopOnStart($el) {
|
205
|
-
if ($el) {
|
206
|
-
if (elementHasOverflowHidden($el)) {
|
207
|
-
return true;
|
208
|
-
}
|
209
|
-
|
210
|
-
var scrollTop = $el.scrollTop;
|
211
|
-
return scrollTop <= 0;
|
212
|
-
}
|
213
|
-
};
|
214
|
-
var elementScrollTopOnEnd = function elementScrollTopOnEnd($el) {
|
215
|
-
if ($el) {
|
216
|
-
if (elementHasOverflowHidden($el)) {
|
217
|
-
return true;
|
218
|
-
}
|
219
|
-
|
220
|
-
var scrollTop = $el.scrollTop;
|
221
|
-
var scrollHeight = $el.scrollHeight;
|
222
|
-
var scrollTopWithHeight = scrollTop + $el.offsetHeight;
|
223
|
-
return scrollTopWithHeight >= scrollHeight;
|
224
|
-
}
|
225
|
-
};
|
226
|
-
var elementScrollLeftOnStart = function elementScrollLeftOnStart($el) {
|
227
|
-
if ($el) {
|
228
|
-
if (elementHasOverflowHidden($el)) {
|
229
|
-
return true;
|
230
|
-
}
|
231
|
-
|
232
|
-
var scrollLeft = $el.scrollLeft;
|
233
|
-
return scrollLeft <= 0;
|
234
|
-
}
|
235
|
-
};
|
236
|
-
var elementScrollLeftOnEnd = function elementScrollLeftOnEnd($el) {
|
237
|
-
if ($el) {
|
238
|
-
if (elementHasOverflowHidden($el)) {
|
239
|
-
return true;
|
240
|
-
}
|
241
|
-
|
242
|
-
var scrollLeft = $el.scrollLeft;
|
243
|
-
var scrollWidth = $el.scrollWidth;
|
244
|
-
var scrollLeftWithWidth = scrollLeft + $el.offsetWidth;
|
245
|
-
return scrollLeftWithWidth >= scrollWidth;
|
246
|
-
}
|
247
|
-
};
|
248
|
-
var elementIsScrollableField = function elementIsScrollableField($el) {
|
249
|
-
var selector = 'textarea, [contenteditable="true"]';
|
250
|
-
return elementHasSelector($el, selector);
|
251
|
-
};
|
252
|
-
var elementIsInputRange = function elementIsInputRange($el) {
|
253
|
-
var selector = 'input[type="range"]';
|
254
|
-
return elementHasSelector($el, selector);
|
255
|
-
};
|
256
|
-
// CONCATENATED MODULE: ./src/scroll-lock.js
|
257
|
-
/* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "disablePageScroll", function() { return disablePageScroll; });
|
258
|
-
/* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "enablePageScroll", function() { return enablePageScroll; });
|
259
|
-
/* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "getScrollState", function() { return getScrollState; });
|
260
|
-
/* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "clearQueueScrollLocks", function() { return clearQueueScrollLocks; });
|
261
|
-
/* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "getTargetScrollBarWidth", function() { return scroll_lock_getTargetScrollBarWidth; });
|
262
|
-
/* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "getCurrentTargetScrollBarWidth", function() { return scroll_lock_getCurrentTargetScrollBarWidth; });
|
263
|
-
/* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "getPageScrollBarWidth", function() { return getPageScrollBarWidth; });
|
264
|
-
/* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "getCurrentPageScrollBarWidth", function() { return getCurrentPageScrollBarWidth; });
|
265
|
-
/* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "addScrollableTarget", function() { return scroll_lock_addScrollableTarget; });
|
266
|
-
/* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "removeScrollableTarget", function() { return scroll_lock_removeScrollableTarget; });
|
267
|
-
/* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "addScrollableSelector", function() { return scroll_lock_addScrollableSelector; });
|
268
|
-
/* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "removeScrollableSelector", function() { return scroll_lock_removeScrollableSelector; });
|
269
|
-
/* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "addLockableTarget", function() { return scroll_lock_addLockableTarget; });
|
270
|
-
/* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "addLockableSelector", function() { return scroll_lock_addLockableSelector; });
|
271
|
-
/* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "setFillGapMethod", function() { return scroll_lock_setFillGapMethod; });
|
272
|
-
/* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "addFillGapTarget", function() { return scroll_lock_addFillGapTarget; });
|
273
|
-
/* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "removeFillGapTarget", function() { return scroll_lock_removeFillGapTarget; });
|
274
|
-
/* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "addFillGapSelector", function() { return scroll_lock_addFillGapSelector; });
|
275
|
-
/* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "removeFillGapSelector", function() { return scroll_lock_removeFillGapSelector; });
|
276
|
-
/* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "refillGaps", function() { return refillGaps; });
|
277
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
|
278
|
-
|
279
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
280
|
-
|
281
|
-
|
282
|
-
var FILL_GAP_AVAILABLE_METHODS = ['padding', 'margin', 'width', 'max-width', 'none'];
|
283
|
-
var TOUCH_DIRECTION_DETECT_OFFSET = 3;
|
284
|
-
var state = {
|
285
|
-
scroll: true,
|
286
|
-
queue: 0,
|
287
|
-
scrollableSelectors: ['[data-scroll-lock-scrollable]'],
|
288
|
-
lockableSelectors: ['body', '[data-scroll-lock-lockable]'],
|
289
|
-
fillGapSelectors: ['body', '[data-scroll-lock-fill-gap]', '[data-scroll-lock-lockable]'],
|
290
|
-
fillGapMethod: FILL_GAP_AVAILABLE_METHODS[0],
|
291
|
-
//
|
292
|
-
startTouchY: 0,
|
293
|
-
startTouchX: 0
|
294
|
-
};
|
295
|
-
var disablePageScroll = function disablePageScroll(target) {
|
296
|
-
if (state.queue <= 0) {
|
297
|
-
state.scroll = false;
|
298
|
-
scroll_lock_hideLockableOverflow();
|
299
|
-
fillGaps();
|
300
|
-
}
|
301
|
-
|
302
|
-
scroll_lock_addScrollableTarget(target);
|
303
|
-
state.queue++;
|
304
|
-
};
|
305
|
-
var enablePageScroll = function enablePageScroll(target) {
|
306
|
-
state.queue > 0 && state.queue--;
|
307
|
-
|
308
|
-
if (state.queue <= 0) {
|
309
|
-
state.scroll = true;
|
310
|
-
scroll_lock_showLockableOverflow();
|
311
|
-
unfillGaps();
|
312
|
-
}
|
313
|
-
|
314
|
-
scroll_lock_removeScrollableTarget(target);
|
315
|
-
};
|
316
|
-
var getScrollState = function getScrollState() {
|
317
|
-
return state.scroll;
|
318
|
-
};
|
319
|
-
var clearQueueScrollLocks = function clearQueueScrollLocks() {
|
320
|
-
state.queue = 0;
|
321
|
-
};
|
322
|
-
var scroll_lock_getTargetScrollBarWidth = function getTargetScrollBarWidth($target) {
|
323
|
-
var onlyExists = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
324
|
-
|
325
|
-
if (isElement($target)) {
|
326
|
-
var currentOverflowYProperty = $target.style.overflowY;
|
327
|
-
|
328
|
-
if (onlyExists) {
|
329
|
-
if (!getScrollState()) {
|
330
|
-
$target.style.overflowY = $target.getAttribute('data-scroll-lock-saved-overflow-y-property');
|
331
|
-
}
|
332
|
-
} else {
|
333
|
-
$target.style.overflowY = 'scroll';
|
334
|
-
}
|
335
|
-
|
336
|
-
var width = scroll_lock_getCurrentTargetScrollBarWidth($target);
|
337
|
-
$target.style.overflowY = currentOverflowYProperty;
|
338
|
-
return width;
|
339
|
-
} else {
|
340
|
-
return 0;
|
341
|
-
}
|
342
|
-
};
|
343
|
-
var scroll_lock_getCurrentTargetScrollBarWidth = function getCurrentTargetScrollBarWidth($target) {
|
344
|
-
if (isElement($target)) {
|
345
|
-
if ($target === document.body) {
|
346
|
-
var documentWidth = document.documentElement.clientWidth;
|
347
|
-
var windowWidth = window.innerWidth;
|
348
|
-
var currentWidth = windowWidth - documentWidth;
|
349
|
-
return currentWidth;
|
350
|
-
} else {
|
351
|
-
var borderLeftWidthCurrentProperty = $target.style.borderLeftWidth;
|
352
|
-
var borderRightWidthCurrentProperty = $target.style.borderRightWidth;
|
353
|
-
$target.style.borderLeftWidth = '0px';
|
354
|
-
$target.style.borderRightWidth = '0px';
|
355
|
-
|
356
|
-
var _currentWidth = $target.offsetWidth - $target.clientWidth;
|
357
|
-
|
358
|
-
$target.style.borderLeftWidth = borderLeftWidthCurrentProperty;
|
359
|
-
$target.style.borderRightWidth = borderRightWidthCurrentProperty;
|
360
|
-
return _currentWidth;
|
361
|
-
}
|
362
|
-
} else {
|
363
|
-
return 0;
|
364
|
-
}
|
365
|
-
};
|
366
|
-
var getPageScrollBarWidth = function getPageScrollBarWidth() {
|
367
|
-
var onlyExists = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
368
|
-
return scroll_lock_getTargetScrollBarWidth(document.body, onlyExists);
|
369
|
-
};
|
370
|
-
var getCurrentPageScrollBarWidth = function getCurrentPageScrollBarWidth() {
|
371
|
-
return scroll_lock_getCurrentTargetScrollBarWidth(document.body);
|
372
|
-
};
|
373
|
-
var scroll_lock_addScrollableTarget = function addScrollableTarget(target) {
|
374
|
-
if (target) {
|
375
|
-
var targets = argumentAsArray(target);
|
376
|
-
targets.map(function ($targets) {
|
377
|
-
eachNode($targets, function ($target) {
|
378
|
-
if (isElement($target)) {
|
379
|
-
$target.setAttribute('data-scroll-lock-scrollable', '');
|
380
|
-
} else {
|
381
|
-
throwError("\"".concat($target, "\" is not a Element."));
|
382
|
-
}
|
383
|
-
});
|
384
|
-
});
|
385
|
-
}
|
386
|
-
};
|
387
|
-
var scroll_lock_removeScrollableTarget = function removeScrollableTarget(target) {
|
388
|
-
if (target) {
|
389
|
-
var targets = argumentAsArray(target);
|
390
|
-
targets.map(function ($targets) {
|
391
|
-
eachNode($targets, function ($target) {
|
392
|
-
if (isElement($target)) {
|
393
|
-
$target.removeAttribute('data-scroll-lock-scrollable');
|
394
|
-
} else {
|
395
|
-
throwError("\"".concat($target, "\" is not a Element."));
|
396
|
-
}
|
397
|
-
});
|
398
|
-
});
|
399
|
-
}
|
400
|
-
};
|
401
|
-
var scroll_lock_addScrollableSelector = function addScrollableSelector(selector) {
|
402
|
-
if (selector) {
|
403
|
-
var selectors = argumentAsArray(selector);
|
404
|
-
selectors.map(function (selector) {
|
405
|
-
state.scrollableSelectors.push(selector);
|
406
|
-
});
|
407
|
-
}
|
408
|
-
};
|
409
|
-
var scroll_lock_removeScrollableSelector = function removeScrollableSelector(selector) {
|
410
|
-
if (selector) {
|
411
|
-
var selectors = argumentAsArray(selector);
|
412
|
-
selectors.map(function (selector) {
|
413
|
-
state.scrollableSelectors = state.scrollableSelectors.filter(function (sSelector) {
|
414
|
-
return sSelector !== selector;
|
415
|
-
});
|
416
|
-
});
|
417
|
-
}
|
418
|
-
};
|
419
|
-
var scroll_lock_addLockableTarget = function addLockableTarget(target) {
|
420
|
-
if (target) {
|
421
|
-
var targets = argumentAsArray(target);
|
422
|
-
targets.map(function ($targets) {
|
423
|
-
eachNode($targets, function ($target) {
|
424
|
-
if (isElement($target)) {
|
425
|
-
$target.setAttribute('data-scroll-lock-lockable', '');
|
426
|
-
} else {
|
427
|
-
throwError("\"".concat($target, "\" is not a Element."));
|
428
|
-
}
|
429
|
-
});
|
430
|
-
});
|
431
|
-
|
432
|
-
if (!getScrollState()) {
|
433
|
-
scroll_lock_hideLockableOverflow();
|
434
|
-
}
|
435
|
-
}
|
436
|
-
};
|
437
|
-
var scroll_lock_addLockableSelector = function addLockableSelector(selector) {
|
438
|
-
if (selector) {
|
439
|
-
var selectors = argumentAsArray(selector);
|
440
|
-
selectors.map(function (selector) {
|
441
|
-
state.lockableSelectors.push(selector);
|
442
|
-
});
|
443
|
-
|
444
|
-
if (!getScrollState()) {
|
445
|
-
scroll_lock_hideLockableOverflow();
|
446
|
-
}
|
447
|
-
|
448
|
-
scroll_lock_addFillGapSelector(selector);
|
449
|
-
}
|
450
|
-
};
|
451
|
-
var scroll_lock_setFillGapMethod = function setFillGapMethod(method) {
|
452
|
-
if (method) {
|
453
|
-
if (FILL_GAP_AVAILABLE_METHODS.indexOf(method) !== -1) {
|
454
|
-
state.fillGapMethod = method;
|
455
|
-
refillGaps();
|
456
|
-
} else {
|
457
|
-
var methods = FILL_GAP_AVAILABLE_METHODS.join(', ');
|
458
|
-
throwError("\"".concat(method, "\" method is not available!\nAvailable fill gap methods: ").concat(methods, "."));
|
459
|
-
}
|
460
|
-
}
|
461
|
-
};
|
462
|
-
var scroll_lock_addFillGapTarget = function addFillGapTarget(target) {
|
463
|
-
if (target) {
|
464
|
-
var targets = argumentAsArray(target);
|
465
|
-
targets.map(function ($targets) {
|
466
|
-
eachNode($targets, function ($target) {
|
467
|
-
if (isElement($target)) {
|
468
|
-
$target.setAttribute('data-scroll-lock-fill-gap', '');
|
469
|
-
|
470
|
-
if (!state.scroll) {
|
471
|
-
scroll_lock_fillGapTarget($target);
|
472
|
-
}
|
473
|
-
} else {
|
474
|
-
throwError("\"".concat($target, "\" is not a Element."));
|
475
|
-
}
|
476
|
-
});
|
477
|
-
});
|
478
|
-
}
|
479
|
-
};
|
480
|
-
var scroll_lock_removeFillGapTarget = function removeFillGapTarget(target) {
|
481
|
-
if (target) {
|
482
|
-
var targets = argumentAsArray(target);
|
483
|
-
targets.map(function ($targets) {
|
484
|
-
eachNode($targets, function ($target) {
|
485
|
-
if (isElement($target)) {
|
486
|
-
$target.removeAttribute('data-scroll-lock-fill-gap');
|
487
|
-
|
488
|
-
if (!state.scroll) {
|
489
|
-
scroll_lock_unfillGapTarget($target);
|
490
|
-
}
|
491
|
-
} else {
|
492
|
-
throwError("\"".concat($target, "\" is not a Element."));
|
493
|
-
}
|
494
|
-
});
|
495
|
-
});
|
496
|
-
}
|
497
|
-
};
|
498
|
-
var scroll_lock_addFillGapSelector = function addFillGapSelector(selector) {
|
499
|
-
if (selector) {
|
500
|
-
var selectors = argumentAsArray(selector);
|
501
|
-
selectors.map(function (selector) {
|
502
|
-
if (state.fillGapSelectors.indexOf(selector) === -1) {
|
503
|
-
state.fillGapSelectors.push(selector);
|
504
|
-
|
505
|
-
if (!state.scroll) {
|
506
|
-
scroll_lock_fillGapSelector(selector);
|
507
|
-
}
|
508
|
-
}
|
509
|
-
});
|
510
|
-
}
|
511
|
-
};
|
512
|
-
var scroll_lock_removeFillGapSelector = function removeFillGapSelector(selector) {
|
513
|
-
if (selector) {
|
514
|
-
var selectors = argumentAsArray(selector);
|
515
|
-
selectors.map(function (selector) {
|
516
|
-
state.fillGapSelectors = state.fillGapSelectors.filter(function (fSelector) {
|
517
|
-
return fSelector !== selector;
|
518
|
-
});
|
519
|
-
|
520
|
-
if (!state.scroll) {
|
521
|
-
scroll_lock_unfillGapSelector(selector);
|
522
|
-
}
|
523
|
-
});
|
524
|
-
}
|
525
|
-
};
|
526
|
-
var refillGaps = function refillGaps() {
|
527
|
-
if (!state.scroll) {
|
528
|
-
fillGaps();
|
529
|
-
}
|
530
|
-
};
|
531
|
-
|
532
|
-
var scroll_lock_hideLockableOverflow = function hideLockableOverflow() {
|
533
|
-
var selector = arrayAsSelector(state.lockableSelectors);
|
534
|
-
scroll_lock_hideLockableOverflowSelector(selector);
|
535
|
-
};
|
536
|
-
|
537
|
-
var scroll_lock_showLockableOverflow = function showLockableOverflow() {
|
538
|
-
var selector = arrayAsSelector(state.lockableSelectors);
|
539
|
-
scroll_lock_showLockableOverflowSelector(selector);
|
540
|
-
};
|
541
|
-
|
542
|
-
var scroll_lock_hideLockableOverflowSelector = function hideLockableOverflowSelector(selector) {
|
543
|
-
var $targets = document.querySelectorAll(selector);
|
544
|
-
eachNode($targets, function ($target) {
|
545
|
-
scroll_lock_hideLockableOverflowTarget($target);
|
546
|
-
});
|
547
|
-
};
|
548
|
-
|
549
|
-
var scroll_lock_showLockableOverflowSelector = function showLockableOverflowSelector(selector) {
|
550
|
-
var $targets = document.querySelectorAll(selector);
|
551
|
-
eachNode($targets, function ($target) {
|
552
|
-
scroll_lock_showLockableOverflowTarget($target);
|
553
|
-
});
|
554
|
-
};
|
555
|
-
|
556
|
-
var scroll_lock_hideLockableOverflowTarget = function hideLockableOverflowTarget($target) {
|
557
|
-
if (isElement($target) && $target.getAttribute('data-scroll-lock-locked') !== 'true') {
|
558
|
-
var computedStyle = window.getComputedStyle($target);
|
559
|
-
$target.setAttribute('data-scroll-lock-saved-overflow-y-property', computedStyle.overflowY);
|
560
|
-
$target.setAttribute('data-scroll-lock-saved-inline-overflow-property', $target.style.overflow);
|
561
|
-
$target.setAttribute('data-scroll-lock-saved-inline-overflow-y-property', $target.style.overflowY);
|
562
|
-
$target.style.overflow = 'hidden';
|
563
|
-
$target.setAttribute('data-scroll-lock-locked', 'true');
|
564
|
-
}
|
565
|
-
};
|
566
|
-
|
567
|
-
var scroll_lock_showLockableOverflowTarget = function showLockableOverflowTarget($target) {
|
568
|
-
if (isElement($target) && $target.getAttribute('data-scroll-lock-locked') === 'true') {
|
569
|
-
$target.style.overflow = $target.getAttribute('data-scroll-lock-saved-inline-overflow-property');
|
570
|
-
$target.style.overflowY = $target.getAttribute('data-scroll-lock-saved-inline-overflow-y-property');
|
571
|
-
$target.removeAttribute('data-scroll-lock-saved-overflow-property');
|
572
|
-
$target.removeAttribute('data-scroll-lock-saved-inline-overflow-property');
|
573
|
-
$target.removeAttribute('data-scroll-lock-saved-inline-overflow-y-property');
|
574
|
-
$target.removeAttribute('data-scroll-lock-locked');
|
575
|
-
}
|
576
|
-
};
|
577
|
-
|
578
|
-
var fillGaps = function fillGaps() {
|
579
|
-
state.fillGapSelectors.map(function (selector) {
|
580
|
-
scroll_lock_fillGapSelector(selector);
|
581
|
-
});
|
582
|
-
};
|
583
|
-
|
584
|
-
var unfillGaps = function unfillGaps() {
|
585
|
-
state.fillGapSelectors.map(function (selector) {
|
586
|
-
scroll_lock_unfillGapSelector(selector);
|
587
|
-
});
|
588
|
-
};
|
589
|
-
|
590
|
-
var scroll_lock_fillGapSelector = function fillGapSelector(selector) {
|
591
|
-
var $targets = document.querySelectorAll(selector);
|
592
|
-
var isLockable = state.lockableSelectors.indexOf(selector) !== -1;
|
593
|
-
eachNode($targets, function ($target) {
|
594
|
-
scroll_lock_fillGapTarget($target, isLockable);
|
595
|
-
});
|
596
|
-
};
|
597
|
-
|
598
|
-
var scroll_lock_fillGapTarget = function fillGapTarget($target) {
|
599
|
-
var isLockable = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
600
|
-
|
601
|
-
if (isElement($target)) {
|
602
|
-
var scrollBarWidth;
|
603
|
-
|
604
|
-
if ($target.getAttribute('data-scroll-lock-lockable') === '' || isLockable) {
|
605
|
-
scrollBarWidth = scroll_lock_getTargetScrollBarWidth($target, true);
|
606
|
-
} else {
|
607
|
-
var $lockableParent = findParentBySelector($target, arrayAsSelector(state.lockableSelectors));
|
608
|
-
scrollBarWidth = scroll_lock_getTargetScrollBarWidth($lockableParent, true);
|
609
|
-
}
|
610
|
-
|
611
|
-
if ($target.getAttribute('data-scroll-lock-filled-gap') === 'true') {
|
612
|
-
scroll_lock_unfillGapTarget($target);
|
613
|
-
}
|
614
|
-
|
615
|
-
var computedStyle = window.getComputedStyle($target);
|
616
|
-
$target.setAttribute('data-scroll-lock-filled-gap', 'true');
|
617
|
-
$target.setAttribute('data-scroll-lock-current-fill-gap-method', state.fillGapMethod);
|
618
|
-
|
619
|
-
if (state.fillGapMethod === 'margin') {
|
620
|
-
var currentMargin = parseFloat(computedStyle.marginRight);
|
621
|
-
$target.style.marginRight = "".concat(currentMargin + scrollBarWidth, "px");
|
622
|
-
} else if (state.fillGapMethod === 'width') {
|
623
|
-
$target.style.width = "calc(100% - ".concat(scrollBarWidth, "px)");
|
624
|
-
} else if (state.fillGapMethod === 'max-width') {
|
625
|
-
$target.style.maxWidth = "calc(100% - ".concat(scrollBarWidth, "px)");
|
626
|
-
} else if (state.fillGapMethod === 'padding') {
|
627
|
-
var currentPadding = parseFloat(computedStyle.paddingRight);
|
628
|
-
$target.style.paddingRight = "".concat(currentPadding + scrollBarWidth, "px");
|
629
|
-
}
|
630
|
-
}
|
631
|
-
};
|
632
|
-
|
633
|
-
var scroll_lock_unfillGapSelector = function unfillGapSelector(selector) {
|
634
|
-
var $targets = document.querySelectorAll(selector);
|
635
|
-
eachNode($targets, function ($target) {
|
636
|
-
scroll_lock_unfillGapTarget($target);
|
637
|
-
});
|
638
|
-
};
|
639
|
-
|
640
|
-
var scroll_lock_unfillGapTarget = function unfillGapTarget($target) {
|
641
|
-
if (isElement($target)) {
|
642
|
-
if ($target.getAttribute('data-scroll-lock-filled-gap') === 'true') {
|
643
|
-
var currentFillGapMethod = $target.getAttribute('data-scroll-lock-current-fill-gap-method');
|
644
|
-
$target.removeAttribute('data-scroll-lock-filled-gap');
|
645
|
-
$target.removeAttribute('data-scroll-lock-current-fill-gap-method');
|
646
|
-
|
647
|
-
if (currentFillGapMethod === 'margin') {
|
648
|
-
$target.style.marginRight = "";
|
649
|
-
} else if (currentFillGapMethod === 'width') {
|
650
|
-
$target.style.width = "";
|
651
|
-
} else if (currentFillGapMethod === 'max-width') {
|
652
|
-
$target.style.maxWidth = "";
|
653
|
-
} else if (currentFillGapMethod === 'padding') {
|
654
|
-
$target.style.paddingRight = "";
|
655
|
-
}
|
656
|
-
}
|
657
|
-
}
|
658
|
-
};
|
659
|
-
|
660
|
-
var onResize = function onResize(e) {
|
661
|
-
refillGaps();
|
662
|
-
};
|
663
|
-
|
664
|
-
var onTouchStart = function onTouchStart(e) {
|
665
|
-
if (!state.scroll) {
|
666
|
-
state.startTouchY = e.touches[0].clientY;
|
667
|
-
state.startTouchX = e.touches[0].clientX;
|
668
|
-
}
|
669
|
-
};
|
670
|
-
|
671
|
-
var scroll_lock_onTouchMove = function onTouchMove(e) {
|
672
|
-
if (!state.scroll) {
|
673
|
-
var startTouchY = state.startTouchY,
|
674
|
-
startTouchX = state.startTouchX;
|
675
|
-
var currentClientY = e.touches[0].clientY;
|
676
|
-
var currentClientX = e.touches[0].clientX;
|
677
|
-
|
678
|
-
if (e.touches.length < 2) {
|
679
|
-
var selector = arrayAsSelector(state.scrollableSelectors);
|
680
|
-
var direction = {
|
681
|
-
up: startTouchY < currentClientY,
|
682
|
-
down: startTouchY > currentClientY,
|
683
|
-
left: startTouchX < currentClientX,
|
684
|
-
right: startTouchX > currentClientX
|
685
|
-
};
|
686
|
-
var directionWithOffset = {
|
687
|
-
up: startTouchY + TOUCH_DIRECTION_DETECT_OFFSET < currentClientY,
|
688
|
-
down: startTouchY - TOUCH_DIRECTION_DETECT_OFFSET > currentClientY,
|
689
|
-
left: startTouchX + TOUCH_DIRECTION_DETECT_OFFSET < currentClientX,
|
690
|
-
right: startTouchX - TOUCH_DIRECTION_DETECT_OFFSET > currentClientX
|
691
|
-
};
|
692
|
-
|
693
|
-
var handle = function handle($el) {
|
694
|
-
var skip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
695
|
-
|
696
|
-
if ($el) {
|
697
|
-
var parentScrollableEl = findParentBySelector($el, selector, false);
|
698
|
-
|
699
|
-
if (elementIsInputRange($el)) {
|
700
|
-
return false;
|
701
|
-
}
|
702
|
-
|
703
|
-
if (skip || elementIsScrollableField($el) && findParentBySelector($el, selector) || elementHasSelector($el, selector)) {
|
704
|
-
var prevent = false;
|
705
|
-
|
706
|
-
if (elementScrollLeftOnStart($el) && elementScrollLeftOnEnd($el)) {
|
707
|
-
if (direction.up && elementScrollTopOnStart($el) || direction.down && elementScrollTopOnEnd($el)) {
|
708
|
-
prevent = true;
|
709
|
-
}
|
710
|
-
} else if (elementScrollTopOnStart($el) && elementScrollTopOnEnd($el)) {
|
711
|
-
if (direction.left && elementScrollLeftOnStart($el) || direction.right && elementScrollLeftOnEnd($el)) {
|
712
|
-
prevent = true;
|
713
|
-
}
|
714
|
-
} else if (directionWithOffset.up && elementScrollTopOnStart($el) || directionWithOffset.down && elementScrollTopOnEnd($el) || directionWithOffset.left && elementScrollLeftOnStart($el) || directionWithOffset.right && elementScrollLeftOnEnd($el)) {
|
715
|
-
prevent = true;
|
716
|
-
}
|
717
|
-
|
718
|
-
if (prevent) {
|
719
|
-
if (parentScrollableEl) {
|
720
|
-
handle(parentScrollableEl, true);
|
721
|
-
} else {
|
722
|
-
if (e.cancelable) {
|
723
|
-
e.preventDefault();
|
724
|
-
}
|
725
|
-
}
|
726
|
-
}
|
727
|
-
} else {
|
728
|
-
handle(parentScrollableEl);
|
729
|
-
}
|
730
|
-
} else {
|
731
|
-
if (e.cancelable) {
|
732
|
-
e.preventDefault();
|
733
|
-
}
|
734
|
-
}
|
735
|
-
};
|
736
|
-
|
737
|
-
handle(e.target);
|
738
|
-
}
|
739
|
-
}
|
740
|
-
};
|
741
|
-
|
742
|
-
var onTouchEnd = function onTouchEnd(e) {
|
743
|
-
if (!state.scroll) {
|
744
|
-
state.startTouchY = 0;
|
745
|
-
state.startTouchX = 0;
|
746
|
-
}
|
747
|
-
};
|
748
|
-
|
749
|
-
if (typeof window !== 'undefined') {
|
750
|
-
window.addEventListener('resize', onResize);
|
751
|
-
}
|
752
|
-
|
753
|
-
if (typeof document !== 'undefined') {
|
754
|
-
document.addEventListener('touchstart', onTouchStart);
|
755
|
-
document.addEventListener('touchmove', scroll_lock_onTouchMove, {
|
756
|
-
passive: false
|
757
|
-
});
|
758
|
-
document.addEventListener('touchend', onTouchEnd);
|
759
|
-
}
|
760
|
-
|
761
|
-
var deprecatedMethods = {
|
762
|
-
hide: function hide(target) {
|
763
|
-
throwError('"hide" is deprecated! Use "disablePageScroll" instead. \n https://github.com/FL3NKEY/scroll-lock#disablepagescrollscrollabletarget');
|
764
|
-
disablePageScroll(target);
|
765
|
-
},
|
766
|
-
show: function show(target) {
|
767
|
-
throwError('"show" is deprecated! Use "enablePageScroll" instead. \n https://github.com/FL3NKEY/scroll-lock#enablepagescrollscrollabletarget');
|
768
|
-
enablePageScroll(target);
|
769
|
-
},
|
770
|
-
toggle: function toggle(target) {
|
771
|
-
throwError('"toggle" is deprecated! Do not use it.');
|
772
|
-
|
773
|
-
if (getScrollState()) {
|
774
|
-
disablePageScroll();
|
775
|
-
} else {
|
776
|
-
enablePageScroll(target);
|
777
|
-
}
|
778
|
-
},
|
779
|
-
getState: function getState() {
|
780
|
-
throwError('"getState" is deprecated! Use "getScrollState" instead. \n https://github.com/FL3NKEY/scroll-lock#getscrollstate');
|
781
|
-
return getScrollState();
|
782
|
-
},
|
783
|
-
getWidth: function getWidth() {
|
784
|
-
throwError('"getWidth" is deprecated! Use "getPageScrollBarWidth" instead. \n https://github.com/FL3NKEY/scroll-lock#getpagescrollbarwidth');
|
785
|
-
return getPageScrollBarWidth();
|
786
|
-
},
|
787
|
-
getCurrentWidth: function getCurrentWidth() {
|
788
|
-
throwError('"getCurrentWidth" is deprecated! Use "getCurrentPageScrollBarWidth" instead. \n https://github.com/FL3NKEY/scroll-lock#getcurrentpagescrollbarwidth');
|
789
|
-
return getCurrentPageScrollBarWidth();
|
790
|
-
},
|
791
|
-
setScrollableTargets: function setScrollableTargets(target) {
|
792
|
-
throwError('"setScrollableTargets" is deprecated! Use "addScrollableTarget" instead. \n https://github.com/FL3NKEY/scroll-lock#addscrollabletargetscrollabletarget');
|
793
|
-
scroll_lock_addScrollableTarget(target);
|
794
|
-
},
|
795
|
-
setFillGapSelectors: function setFillGapSelectors(selector) {
|
796
|
-
throwError('"setFillGapSelectors" is deprecated! Use "addFillGapSelector" instead. \n https://github.com/FL3NKEY/scroll-lock#addfillgapselectorfillgapselector');
|
797
|
-
scroll_lock_addFillGapSelector(selector);
|
798
|
-
},
|
799
|
-
setFillGapTargets: function setFillGapTargets(target) {
|
800
|
-
throwError('"setFillGapTargets" is deprecated! Use "addFillGapTarget" instead. \n https://github.com/FL3NKEY/scroll-lock#addfillgaptargetfillgaptarget');
|
801
|
-
scroll_lock_addFillGapTarget(target);
|
802
|
-
},
|
803
|
-
clearQueue: function clearQueue() {
|
804
|
-
throwError('"clearQueue" is deprecated! Use "clearQueueScrollLocks" instead. \n https://github.com/FL3NKEY/scroll-lock#clearqueuescrolllocks');
|
805
|
-
clearQueueScrollLocks();
|
806
|
-
}
|
807
|
-
};
|
808
|
-
|
809
|
-
var scrollLock = _objectSpread({
|
810
|
-
disablePageScroll: disablePageScroll,
|
811
|
-
enablePageScroll: enablePageScroll,
|
812
|
-
getScrollState: getScrollState,
|
813
|
-
clearQueueScrollLocks: clearQueueScrollLocks,
|
814
|
-
getTargetScrollBarWidth: scroll_lock_getTargetScrollBarWidth,
|
815
|
-
getCurrentTargetScrollBarWidth: scroll_lock_getCurrentTargetScrollBarWidth,
|
816
|
-
getPageScrollBarWidth: getPageScrollBarWidth,
|
817
|
-
getCurrentPageScrollBarWidth: getCurrentPageScrollBarWidth,
|
818
|
-
addScrollableSelector: scroll_lock_addScrollableSelector,
|
819
|
-
removeScrollableSelector: scroll_lock_removeScrollableSelector,
|
820
|
-
addScrollableTarget: scroll_lock_addScrollableTarget,
|
821
|
-
removeScrollableTarget: scroll_lock_removeScrollableTarget,
|
822
|
-
addLockableSelector: scroll_lock_addLockableSelector,
|
823
|
-
addLockableTarget: scroll_lock_addLockableTarget,
|
824
|
-
addFillGapSelector: scroll_lock_addFillGapSelector,
|
825
|
-
removeFillGapSelector: scroll_lock_removeFillGapSelector,
|
826
|
-
addFillGapTarget: scroll_lock_addFillGapTarget,
|
827
|
-
removeFillGapTarget: scroll_lock_removeFillGapTarget,
|
828
|
-
setFillGapMethod: scroll_lock_setFillGapMethod,
|
829
|
-
refillGaps: refillGaps,
|
830
|
-
_state: state
|
831
|
-
}, deprecatedMethods);
|
832
|
-
|
833
|
-
/* harmony default export */ var scroll_lock = __webpack_exports__["default"] = (scrollLock);
|
834
|
-
|
835
|
-
/***/ })
|
836
|
-
/******/ ])["default"];
|
837
|
-
});
|
838
|
-
|
839
|
-
/***/ })
|
840
|
-
|
841
|
-
/******/ });
|
842
|
-
/************************************************************************/
|
843
|
-
/******/ // The module cache
|
844
|
-
/******/ var __webpack_module_cache__ = {};
|
845
|
-
/******/
|
846
|
-
/******/ // The require function
|
847
|
-
/******/ function __webpack_require__(moduleId) {
|
848
|
-
/******/ // Check if module is in cache
|
849
|
-
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
850
|
-
/******/ if (cachedModule !== undefined) {
|
851
|
-
/******/ return cachedModule.exports;
|
852
|
-
/******/ }
|
853
|
-
/******/ // Create a new module (and put it into the cache)
|
854
|
-
/******/ var module = __webpack_module_cache__[moduleId] = {
|
855
|
-
/******/ // no module.id needed
|
856
|
-
/******/ // no module.loaded needed
|
857
|
-
/******/ exports: {}
|
858
|
-
/******/ };
|
859
|
-
/******/
|
860
|
-
/******/ // Execute the module function
|
861
|
-
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
862
|
-
/******/
|
863
|
-
/******/ // Return the exports of the module
|
864
|
-
/******/ return module.exports;
|
865
|
-
/******/ }
|
866
|
-
/******/
|
867
|
-
/************************************************************************/
|
868
|
-
/******/ /* webpack/runtime/compat get default export */
|
869
|
-
/******/ (() => {
|
870
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
871
|
-
/******/ __webpack_require__.n = (module) => {
|
872
|
-
/******/ var getter = module && module.__esModule ?
|
873
|
-
/******/ () => (module['default']) :
|
874
|
-
/******/ () => (module);
|
875
|
-
/******/ __webpack_require__.d(getter, { a: getter });
|
876
|
-
/******/ return getter;
|
877
|
-
/******/ };
|
878
|
-
/******/ })();
|
879
|
-
/******/
|
880
|
-
/******/ /* webpack/runtime/define property getters */
|
881
|
-
/******/ (() => {
|
882
|
-
/******/ // define getter functions for harmony exports
|
883
|
-
/******/ __webpack_require__.d = (exports, definition) => {
|
884
|
-
/******/ for(var key in definition) {
|
885
|
-
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
886
|
-
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
887
|
-
/******/ }
|
888
|
-
/******/ }
|
889
|
-
/******/ };
|
890
|
-
/******/ })();
|
891
|
-
/******/
|
892
|
-
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
893
|
-
/******/ (() => {
|
894
|
-
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
895
|
-
/******/ })();
|
896
|
-
/******/
|
897
|
-
/******/ /* webpack/runtime/make namespace object */
|
898
|
-
/******/ (() => {
|
899
|
-
/******/ // define __esModule on exports
|
900
|
-
/******/ __webpack_require__.r = (exports) => {
|
901
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
902
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
903
|
-
/******/ }
|
904
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
905
|
-
/******/ };
|
906
|
-
/******/ })();
|
907
|
-
/******/
|
908
|
-
/************************************************************************/
|
909
|
-
var __webpack_exports__ = {};
|
910
|
-
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
|
911
|
-
(() => {
|
912
|
-
"use strict";
|
913
|
-
/*!************************************************************!*\
|
914
|
-
!*** ./src/core/MeganavControlMobileDropdown/component.js ***!
|
915
|
-
\************************************************************/
|
916
|
-
__webpack_require__.r(__webpack_exports__);
|
917
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
918
|
-
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
919
|
-
/* harmony export */ });
|
920
|
-
/* harmony import */ var scroll_lock__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! scroll-lock */ "./node_modules/scroll-lock/dist/scroll-lock.js");
|
921
|
-
/* harmony import */ var scroll_lock__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(scroll_lock__WEBPACK_IMPORTED_MODULE_0__);
|
922
|
-
/* harmony import */ var _dom_query__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dom-query */ "./src/core/dom-query.js");
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
var MeganavControlMobileDropdown = function MeganavControlMobileDropdown(_ref) {
|
927
|
-
var clearPanels = _ref.clearPanels;
|
928
|
-
var control = (0,_dom_query__WEBPACK_IMPORTED_MODULE_1__.queryId)("meganav-control-mobile-dropdown");
|
929
|
-
var dropdown = (0,_dom_query__WEBPACK_IMPORTED_MODULE_1__.queryId)("meganav-mobile-dropdown");
|
930
|
-
var menuIcon = (0,_dom_query__WEBPACK_IMPORTED_MODULE_1__.queryId)("meganav-control-mobile-dropdown-menu");
|
931
|
-
var closeIcon = (0,_dom_query__WEBPACK_IMPORTED_MODULE_1__.queryId)("meganav-control-mobile-dropdown-close");
|
932
|
-
|
933
|
-
var clickHandler = function clickHandler() {
|
934
|
-
var ariaExpanded = control.getAttribute("aria-expanded");
|
935
|
-
|
936
|
-
if (ariaExpanded === "false") {
|
937
|
-
dropdown.classList.replace("invisible", "visible");
|
938
|
-
control.setAttribute("aria-expanded", true);
|
939
|
-
scroll_lock__WEBPACK_IMPORTED_MODULE_0___default().disablePageScroll();
|
940
|
-
} else {
|
941
|
-
dropdown.classList.replace("visible", "invisible");
|
942
|
-
control.setAttribute("aria-expanded", false);
|
943
|
-
scroll_lock__WEBPACK_IMPORTED_MODULE_0___default().enablePageScroll();
|
944
|
-
clearPanels();
|
945
|
-
}
|
946
|
-
|
947
|
-
menuIcon.classList.toggle("hidden");
|
948
|
-
closeIcon.classList.toggle("hidden");
|
949
|
-
};
|
950
|
-
|
951
|
-
control.addEventListener("click", clickHandler);
|
952
|
-
return {
|
953
|
-
teardown: function teardown() {
|
954
|
-
control.removeEventListener("click", clickHandler);
|
955
|
-
scroll_lock__WEBPACK_IMPORTED_MODULE_0___default().enablePageScroll();
|
956
|
-
},
|
957
|
-
clear: function clear() {
|
958
|
-
dropdown.classList.replace("visible", "invisible");
|
959
|
-
control.setAttribute("aria-expanded", false);
|
960
|
-
menuIcon.classList.remove("hidden");
|
961
|
-
closeIcon.classList.add("hidden");
|
962
|
-
scroll_lock__WEBPACK_IMPORTED_MODULE_0___default().enablePageScroll();
|
963
|
-
}
|
964
|
-
};
|
965
|
-
};
|
966
|
-
|
967
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MeganavControlMobileDropdown);
|
968
|
-
})();
|
969
|
-
|
970
|
-
__webpack_exports__ = __webpack_exports__.default;
|
971
|
-
/******/ return __webpack_exports__;
|
972
|
-
/******/ })()
|
973
|
-
;
|
974
|
-
});
|
975
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9BYmx5VWkuQ29yZS5bbmFtZV0vd2VicGFjay91bml2ZXJzYWxNb2R1bGVEZWZpbml0aW9uIiwid2VicGFjazovL0FibHlVaS5Db3JlLltuYW1lXS8uL3NyYy9jb3JlL2RvbS1xdWVyeS5qcyIsIndlYnBhY2s6Ly9BYmx5VWkuQ29yZS5bbmFtZV0vLi9ub2RlX21vZHVsZXMvc2Nyb2xsLWxvY2svZGlzdC9zY3JvbGwtbG9jay5qcyIsIndlYnBhY2s6Ly9BYmx5VWkuQ29yZS5bbmFtZV0vd2VicGFjay9ib290c3RyYXAiLCJ3ZWJwYWNrOi8vQWJseVVpLkNvcmUuW25hbWVdL3dlYnBhY2svcnVudGltZS9jb21wYXQgZ2V0IGRlZmF1bHQgZXhwb3J0Iiwid2VicGFjazovL0FibHlVaS5Db3JlLltuYW1lXS93ZWJwYWNrL3J1bnRpbWUvZGVmaW5lIHByb3BlcnR5IGdldHRlcnMiLCJ3ZWJwYWNrOi8vQWJseVV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sZShcImhpZGRlblwiKTtcbiAgICBjbG9zZUljb24uY2xhc3NMaXN0LnRvZ2dsZShcImhpZGRlblwiKTtcbiAgfTtcblxuICBjb250cm9sLmFkZEV2ZW50TGlzdGVuZXIoXCJjbGlja1wiLCBjbGlja0hhbmRsZXIpO1xuXG4gIHJldHVybiB7XG4gICAgdGVhcmRvd246ICgpID0+IHtcbiAgICAgIGNvbnRyb2wucmVtb3ZlRXZlbnRMaXN0ZW5lcihcImNsaWNrXCIsIGNsaWNrSGFuZGxlcik7XG4gICAgICBzY3JvbGxMb2NrLmVuYWJsZVBhZ2VTY3JvbGwoKTtcbiAgICB9LFxuICAgIGNsZWFyOiAoKSA9PiB7XG4gICAgICBkcm9wZG93bi5jbGFzc0xpc3QucmVwbGFjZShcInZpc2libGVcIiwgXCJpbnZpc2libGVcIik7XG4gICAgICBjb250cm9sLnNldEF0dHJpYnV0ZShcImFyaWEtZXhwYW5kZWRcIiwgZmFsc2UpO1xuICAgICAgbWVudUljb24uY2xhc3NMaXN0LnJlbW92ZShcImhpZGRlblwiKTtcbiAgICAgIGNsb3NlSWNvbi5jbGFzc0xpc3QuYWRkKFwiaGlkZGVuXCIpO1xuICAgICAgc2Nyb2xsTG9jay5lbmFibGVQYWdlU2Nyb2xsKCk7XG4gICAgfSxcbiAgfTtcbn07XG5cbmV4cG9ydCBkZWZhdWx0IE1lZ2FuYXZDb250cm9sTW9iaWxlRHJvcGRvd247XG4iXSwic291cmNlUm9vdCI6IiJ9
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.AblyUi=t():(e.AblyUi=e.AblyUi||{},e.AblyUi.Core=e.AblyUi.Core||{},e.AblyUi.Core.MeganavControlMobileDropdown=t())}(this,(function(){return(()=>{var e={9581:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return t.querySelector("[data-id=".concat(e,"]"))}},6265:function(e){var t;t=function(){return function(e){var t={};function r(l){if(t[l])return t[l].exports;var o=t[l]={i:l,l:!1,exports:{}};return e[l].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,l){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:l})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var l=Object.create(null);if(r.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(l,o,function(t){return e[t]}.bind(null,o));return l},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";r.r(t);var l=function(e){return Array.isArray(e)?e:[e]},o=function(e){return e instanceof Node},n=function(e,t){if(e&&t){e=function(e){return e instanceof NodeList}(e)?e:[e];for(var r=0;r<e.length&&!0!==t(e[r],r,e.length);r++);}},c=function(e){return console.error("[scroll-lock] ".concat(e))},a=function(e){if(Array.isArray(e))return e.join(", ")},i=function(e){var t=[];return n(e,(function(e){return t.push(e)})),t},u=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:document;if(r&&-1!==i(l.querySelectorAll(t)).indexOf(e))return e;for(;(e=e.parentElement)&&-1===i(l.querySelectorAll(t)).indexOf(e););return e},d=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,l=-1!==i(r.querySelectorAll(t)).indexOf(e);return l},s=function(e){if(e)return"hidden"===getComputedStyle(e).overflow},f=function(e){if(e)return!!s(e)||e.scrollTop<=0},p=function(e){if(e){if(s(e))return!0;var t=e.scrollTop,r=e.scrollHeight;return t+e.offsetHeight>=r}},g=function(e){if(e)return!!s(e)||e.scrollLeft<=0},b=function(e){if(e){if(s(e))return!0;var t=e.scrollLeft,r=e.scrollWidth;return t+e.offsetWidth>=r}},v=function(e){return d(e,'textarea, [contenteditable="true"]')},h=function(e){return d(e,'input[type="range"]')};function m(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,"disablePageScroll",(function(){return k})),r.d(t,"enablePageScroll",(function(){return w})),r.d(t,"getScrollState",(function(){return A})),r.d(t,"clearQueueScrollLocks",(function(){return x})),r.d(t,"getTargetScrollBarWidth",(function(){return L})),r.d(t,"getCurrentTargetScrollBarWidth",(function(){return G})),r.d(t,"getPageScrollBarWidth",(function(){return T})),r.d(t,"getCurrentPageScrollBarWidth",(function(){return P})),r.d(t,"addScrollableTarget",(function(){return W})),r.d(t,"removeScrollableTarget",(function(){return F})),r.d(t,"addScrollableSelector",(function(){return O})),r.d(t,"removeScrollableSelector",(function(){return E})),r.d(t,"addLockableTarget",(function(){return Y})),r.d(t,"addLockableSelector",(function(){return j})),r.d(t,"setFillGapMethod",(function(){return q})),r.d(t,"addFillGapTarget",(function(){return M})),r.d(t,"removeFillGapTarget",(function(){return U})),r.d(t,"addFillGapSelector",(function(){return C})),r.d(t,"removeFillGapSelector",(function(){return N})),r.d(t,"refillGaps",(function(){return B}));var y=["padding","margin","width","max-width","none"],S={scroll:!0,queue:0,scrollableSelectors:["[data-scroll-lock-scrollable]"],lockableSelectors:["body","[data-scroll-lock-lockable]"],fillGapSelectors:["body","[data-scroll-lock-fill-gap]","[data-scroll-lock-lockable]"],fillGapMethod:y[0],startTouchY:0,startTouchX:0},k=function(e){S.queue<=0&&(S.scroll=!1,K(),H()),W(e),S.queue++},w=function(e){S.queue>0&&S.queue--,S.queue<=0&&(S.scroll=!0,R(),z()),F(e)},A=function(){return S.scroll},x=function(){S.queue=0},L=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(o(e)){var r=e.style.overflowY;t?A()||(e.style.overflowY=e.getAttribute("data-scroll-lock-saved-overflow-y-property")):e.style.overflowY="scroll";var l=G(e);return e.style.overflowY=r,l}return 0},G=function(e){if(o(e)){if(e===document.body){var t=document.documentElement.clientWidth;return window.innerWidth-t}var r=e.style.borderLeftWidth,l=e.style.borderRightWidth;e.style.borderLeftWidth="0px",e.style.borderRightWidth="0px";var n=e.offsetWidth-e.clientWidth;return e.style.borderLeftWidth=r,e.style.borderRightWidth=l,n}return 0},T=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return L(document.body,e)},P=function(){return G(document.body)},W=function(e){e&&l(e).map((function(e){n(e,(function(e){o(e)?e.setAttribute("data-scroll-lock-scrollable",""):c('"'.concat(e,'" is not a Element.'))}))}))},F=function(e){e&&l(e).map((function(e){n(e,(function(e){o(e)?e.removeAttribute("data-scroll-lock-scrollable"):c('"'.concat(e,'" is not a Element.'))}))}))},O=function(e){e&&l(e).map((function(e){S.scrollableSelectors.push(e)}))},E=function(e){e&&l(e).map((function(e){S.scrollableSelectors=S.scrollableSelectors.filter((function(t){return t!==e}))}))},Y=function(e){e&&(l(e).map((function(e){n(e,(function(e){o(e)?e.setAttribute("data-scroll-lock-lockable",""):c('"'.concat(e,'" is not a Element.'))}))})),A()||K())},j=function(e){e&&(l(e).map((function(e){S.lockableSelectors.push(e)})),A()||K(),C(e))},q=function(e){if(e)if(-1!==y.indexOf(e))S.fillGapMethod=e,B();else{var t=y.join(", ");c('"'.concat(e,'" method is not available!\nAvailable fill gap methods: ').concat(t,"."))}},M=function(e){e&&l(e).map((function(e){n(e,(function(e){o(e)?(e.setAttribute("data-scroll-lock-fill-gap",""),S.scroll||J(e)):c('"'.concat(e,'" is not a Element.'))}))}))},U=function(e){e&&l(e).map((function(e){n(e,(function(e){o(e)?(e.removeAttribute("data-scroll-lock-fill-gap"),S.scroll||Z(e)):c('"'.concat(e,'" is not a Element.'))}))}))},C=function(e){e&&l(e).map((function(e){-1===S.fillGapSelectors.indexOf(e)&&(S.fillGapSelectors.push(e),S.scroll||I(e))}))},N=function(e){e&&l(e).map((function(e){S.fillGapSelectors=S.fillGapSelectors.filter((function(t){return t!==e})),S.scroll||V(e)}))},B=function(){S.scroll||H()},K=function(){var e=a(S.lockableSelectors);_(e)},R=function(){var e=a(S.lockableSelectors);X(e)},_=function(e){var t=document.querySelectorAll(e);n(t,(function(e){D(e)}))},X=function(e){var t=document.querySelectorAll(e);n(t,(function(e){Q(e)}))},D=function(e){if(o(e)&&"true"!==e.getAttribute("data-scroll-lock-locked")){var t=window.getComputedStyle(e);e.setAttribute("data-scroll-lock-saved-overflow-y-property",t.overflowY),e.setAttribute("data-scroll-lock-saved-inline-overflow-property",e.style.overflow),e.setAttribute("data-scroll-lock-saved-inline-overflow-y-property",e.style.overflowY),e.style.overflow="hidden",e.setAttribute("data-scroll-lock-locked","true")}},Q=function(e){o(e)&&"true"===e.getAttribute("data-scroll-lock-locked")&&(e.style.overflow=e.getAttribute("data-scroll-lock-saved-inline-overflow-property"),e.style.overflowY=e.getAttribute("data-scroll-lock-saved-inline-overflow-y-property"),e.removeAttribute("data-scroll-lock-saved-overflow-property"),e.removeAttribute("data-scroll-lock-saved-inline-overflow-property"),e.removeAttribute("data-scroll-lock-saved-inline-overflow-y-property"),e.removeAttribute("data-scroll-lock-locked"))},H=function(){S.fillGapSelectors.map((function(e){I(e)}))},z=function(){S.fillGapSelectors.map((function(e){V(e)}))},I=function(e){var t=document.querySelectorAll(e),r=-1!==S.lockableSelectors.indexOf(e);n(t,(function(e){J(e,r)}))},J=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(o(e)){var r;if(""===e.getAttribute("data-scroll-lock-lockable")||t)r=L(e,!0);else{var l=u(e,a(S.lockableSelectors));r=L(l,!0)}"true"===e.getAttribute("data-scroll-lock-filled-gap")&&Z(e);var n=window.getComputedStyle(e);if(e.setAttribute("data-scroll-lock-filled-gap","true"),e.setAttribute("data-scroll-lock-current-fill-gap-method",S.fillGapMethod),"margin"===S.fillGapMethod){var c=parseFloat(n.marginRight);e.style.marginRight="".concat(c+r,"px")}else if("width"===S.fillGapMethod)e.style.width="calc(100% - ".concat(r,"px)");else if("max-width"===S.fillGapMethod)e.style.maxWidth="calc(100% - ".concat(r,"px)");else if("padding"===S.fillGapMethod){var i=parseFloat(n.paddingRight);e.style.paddingRight="".concat(i+r,"px")}}},V=function(e){var t=document.querySelectorAll(e);n(t,(function(e){Z(e)}))},Z=function(e){if(o(e)&&"true"===e.getAttribute("data-scroll-lock-filled-gap")){var t=e.getAttribute("data-scroll-lock-current-fill-gap-method");e.removeAttribute("data-scroll-lock-filled-gap"),e.removeAttribute("data-scroll-lock-current-fill-gap-method"),"margin"===t?e.style.marginRight="":"width"===t?e.style.width="":"max-width"===t?e.style.maxWidth="":"padding"===t&&(e.style.paddingRight="")}};"undefined"!=typeof window&&window.addEventListener("resize",(function(e){B()})),"undefined"!=typeof document&&(document.addEventListener("touchstart",(function(e){S.scroll||(S.startTouchY=e.touches[0].clientY,S.startTouchX=e.touches[0].clientX)})),document.addEventListener("touchmove",(function(e){if(!S.scroll){var t=S.startTouchY,r=S.startTouchX,l=e.touches[0].clientY,o=e.touches[0].clientX;if(e.touches.length<2){var n=a(S.scrollableSelectors),c={up:t<l,down:t>l,left:r<o,right:r>o},i={up:t+3<l,down:t-3>l,left:r+3<o,right:r-3>o};!function t(r){var l=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(r){var o=u(r,n,!1);if(h(r))return!1;if(l||v(r)&&u(r,n)||d(r,n)){var a=!1;g(r)&&b(r)?(c.up&&f(r)||c.down&&p(r))&&(a=!0):f(r)&&p(r)?(c.left&&g(r)||c.right&&b(r))&&(a=!0):(i.up&&f(r)||i.down&&p(r)||i.left&&g(r)||i.right&&b(r))&&(a=!0),a&&(o?t(o,!0):e.cancelable&&e.preventDefault())}else t(o)}else e.cancelable&&e.preventDefault()}(e.target)}}}),{passive:!1}),document.addEventListener("touchend",(function(e){S.scroll||(S.startTouchY=0,S.startTouchX=0)})));var $={hide:function(e){c('"hide" is deprecated! Use "disablePageScroll" instead. \n https://github.com/FL3NKEY/scroll-lock#disablepagescrollscrollabletarget'),k(e)},show:function(e){c('"show" is deprecated! Use "enablePageScroll" instead. \n https://github.com/FL3NKEY/scroll-lock#enablepagescrollscrollabletarget'),w(e)},toggle:function(e){c('"toggle" is deprecated! Do not use it.'),A()?k():w(e)},getState:function(){return c('"getState" is deprecated! Use "getScrollState" instead. \n https://github.com/FL3NKEY/scroll-lock#getscrollstate'),A()},getWidth:function(){return c('"getWidth" is deprecated! Use "getPageScrollBarWidth" instead. \n https://github.com/FL3NKEY/scroll-lock#getpagescrollbarwidth'),T()},getCurrentWidth:function(){return c('"getCurrentWidth" is deprecated! Use "getCurrentPageScrollBarWidth" instead. \n https://github.com/FL3NKEY/scroll-lock#getcurrentpagescrollbarwidth'),P()},setScrollableTargets:function(e){c('"setScrollableTargets" is deprecated! Use "addScrollableTarget" instead. \n https://github.com/FL3NKEY/scroll-lock#addscrollabletargetscrollabletarget'),W(e)},setFillGapSelectors:function(e){c('"setFillGapSelectors" is deprecated! Use "addFillGapSelector" instead. \n https://github.com/FL3NKEY/scroll-lock#addfillgapselectorfillgapselector'),C(e)},setFillGapTargets:function(e){c('"setFillGapTargets" is deprecated! Use "addFillGapTarget" instead. \n https://github.com/FL3NKEY/scroll-lock#addfillgaptargetfillgaptarget'),M(e)},clearQueue:function(){c('"clearQueue" is deprecated! Use "clearQueueScrollLocks" instead. \n https://github.com/FL3NKEY/scroll-lock#clearqueuescrolllocks'),x()}},ee=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},l=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(l=l.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),l.forEach((function(t){m(e,t,r[t])}))}return e}({disablePageScroll:k,enablePageScroll:w,getScrollState:A,clearQueueScrollLocks:x,getTargetScrollBarWidth:L,getCurrentTargetScrollBarWidth:G,getPageScrollBarWidth:T,getCurrentPageScrollBarWidth:P,addScrollableSelector:O,removeScrollableSelector:E,addScrollableTarget:W,removeScrollableTarget:F,addLockableSelector:j,addLockableTarget:Y,addFillGapSelector:C,removeFillGapSelector:N,addFillGapTarget:M,removeFillGapTarget:U,setFillGapMethod:q,refillGaps:B,_state:S},$);t.default=ee}]).default},e.exports=t()}},t={};function r(l){var o=t[l];if(void 0!==o)return o.exports;var n=t[l]={exports:{}};return e[l].call(n.exports,n,n.exports,r),n.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var l in t)r.o(t,l)&&!r.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:t[l]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var l={};return(()=>{"use strict";r.d(l,{default:()=>n});var e=r(6265),t=r.n(e),o=r(9581);const n=function(e){var r=e.clearPanels,l=(0,o.A)("meganav-control-mobile-dropdown"),n=(0,o.A)("meganav-mobile-dropdown"),c=(0,o.A)("meganav-control-mobile-dropdown-menu"),a=(0,o.A)("meganav-control-mobile-dropdown-close"),i=function(){"false"===l.getAttribute("aria-expanded")?(n.classList.replace("invisible","visible"),l.setAttribute("aria-expanded",!0),t().disablePageScroll()):(n.classList.replace("visible","invisible"),l.setAttribute("aria-expanded",!1),t().enablePageScroll(),r()),c.classList.toggle("hidden"),a.classList.toggle("hidden")};return l.addEventListener("click",i),{teardown:function(){l.removeEventListener("click",i),t().enablePageScroll()},clear:function(){n.classList.replace("visible","invisible"),l.setAttribute("aria-expanded",!1),c.classList.remove("hidden"),a.classList.add("hidden"),t().enablePageScroll()}}}})(),l.default})()}));
|