@ably/ui 5.0.1-dev.baf5b97.0 → 5.3.0-dev.3c981a4
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/core/.gitignore +1 -0
- package/core/Code/component.css +70 -0
- package/core/Code/component.js +1 -0
- package/core/Code.jsx +7578 -0
- package/core/ConnectStateWrapper/component.js +1 -0
- package/core/ConnectStateWrapper.jsx +213 -0
- package/core/ContactFooter/component.css +12 -0
- package/core/ContactFooter/component.js +1 -0
- package/core/ContactFooter.jsx +448 -0
- package/core/CookieMessage/component.css +14 -0
- package/core/CookieMessage/component.js +1 -0
- package/core/CookieMessage.jsx +476 -0
- package/core/CustomerLogos/component.js +1 -0
- package/core/CustomerLogos.jsx +246 -0
- package/core/FeatureFooter/component.css +13 -0
- package/core/FeatureFooter/component.js +1 -0
- package/core/FeatureFooter.jsx +17 -0
- package/core/FeaturedLink/component.css +16 -0
- package/core/FeaturedLink/component.js +1 -0
- package/core/FeaturedLink.jsx +307 -0
- package/core/Flash/component.css +30 -0
- package/core/Flash/component.js +1 -0
- package/core/Flash.jsx +2002 -0
- package/core/Footer/component.css +14 -0
- package/core/Footer/component.js +1 -0
- package/core/Footer.jsx +593 -0
- package/core/Icon/component.css +1 -0
- package/core/Icon/component.js +1 -0
- package/core/Icon.jsx +257 -0
- package/core/Logo/component.js +1 -0
- package/core/Logo.jsx +302 -0
- package/core/Meganav/component.css +103 -0
- package/core/Meganav/component.js +1 -0
- package/core/Meganav/component.json +37 -0
- package/core/Meganav.jsx +6514 -0
- package/core/MeganavBlogPostsList/component.js +1 -0
- package/core/MeganavBlogPostsList.jsx +360 -0
- package/core/MeganavContentDevelopers/component.js +1 -0
- package/core/MeganavContentDevelopers.jsx +418 -0
- package/core/MeganavContentPlatform/component.js +1 -0
- package/core/MeganavContentPlatform.jsx +440 -0
- package/core/MeganavContentUseCases/component.js +1 -0
- package/core/MeganavContentUseCases.jsx +309 -0
- package/core/MeganavContentWhyAbly/component.js +1 -0
- package/core/MeganavContentWhyAbly.jsx +1471 -0
- package/core/MeganavControl/component.js +1 -0
- package/core/MeganavControl.jsx +301 -0
- package/core/MeganavControlMobileDropdown/component.js +1 -0
- package/core/MeganavControlMobileDropdown.jsx +303 -0
- package/core/MeganavControlMobilePanelClose/component.js +1 -0
- package/core/MeganavControlMobilePanelClose.jsx +301 -0
- package/core/MeganavControlMobilePanelOpen/component.js +1 -0
- package/core/MeganavControlMobilePanelOpen.jsx +299 -0
- package/core/MeganavItemsDesktop/component.js +1 -0
- package/core/MeganavItemsDesktop.jsx +377 -0
- package/core/MeganavItemsMobile/component.js +1 -0
- package/core/MeganavItemsMobile.jsx +581 -0
- package/core/MeganavItemsSignedIn/component.js +1 -0
- package/core/MeganavItemsSignedIn.jsx +461 -0
- package/core/Notice/component.css +8 -0
- package/core/Notice/component.js +2 -0
- package/core/Notice/component.js.LICENSE.txt +9 -0
- package/core/Notice.jsx +2915 -0
- package/core/Showcase/component.css +31 -0
- package/core/Showcase/component.js +1 -0
- package/core/Showcase.jsx +17 -0
- package/core/SignOutLink/component.js +1 -0
- package/core/SignOutLink.jsx +262 -0
- package/core/Slider/component.css +9 -0
- package/core/Slider/component.js +1 -0
- package/core/Slider.jsx +957 -0
- package/core/Test/component.js +59 -0
- package/core/Test.jsx +4 -0
- package/core/Uptime/component.css +129 -0
- package/core/Uptime/component.js +1 -0
- package/core/Uptime.jsx +1373 -0
- package/core/core.base.css +1 -0
- package/core/core.components.css +49 -0
- package/core/fonts/.DS_Store +0 -0
- package/core/fonts/NEXT-Book-Light-Italic.eot +0 -0
- package/core/fonts/NEXT-Book-Light-Italic.otf +0 -0
- package/core/fonts/NEXT-Book-Light-Italic.woff +0 -0
- package/core/fonts/NEXT-Book-Light-Italic.woff2 +0 -0
- package/core/fonts/NEXT-Book-Light.eot +0 -0
- package/core/fonts/NEXT-Book-Light.otf +0 -0
- package/core/fonts/NEXT-Book-Light.woff +0 -0
- package/core/fonts/NEXT-Book-Light.woff2 +0 -0
- package/core/fonts/NEXT-Book-Medium-Italic.eot +0 -0
- package/core/fonts/NEXT-Book-Medium-Italic.otf +0 -0
- package/core/fonts/NEXT-Book-Medium-Italic.woff +0 -0
- package/core/fonts/NEXT-Book-Medium-Italic.woff2 +0 -0
- package/core/fonts/NEXT-Book-Medium.eot +0 -0
- package/core/fonts/NEXT-Book-Medium.otf +0 -0
- package/core/fonts/NEXT-Book-Medium.woff +0 -0
- package/core/fonts/NEXT-Book-Medium.woff2 +0 -0
- package/core/fonts/next.css +59 -0
- package/core/images/.DS_Store +0 -0
- package/core/images/ably-logo.svg +15 -0
- package/core/images/ably-stack.svg +14 -0
- package/core/images/blog-thumb1.jpg +0 -0
- package/core/images/blog-thumb2.jpg +0 -0
- package/core/images/blog-thumb3.jpg +0 -0
- package/core/images/cust-logo-ao-col-pos.png +0 -0
- package/core/images/cust-logo-ao-col-pos@2x.png +0 -0
- package/core/images/cust-logo-ausopen-col-pos.png +0 -0
- package/core/images/cust-logo-ausopen-col-pos@2x.png +0 -0
- package/core/images/cust-logo-ausopen-mono-pos.svg +5 -0
- package/core/images/cust-logo-bloomberg-mono-pos.svg +11 -0
- package/core/images/cust-logo-hopin-mono-pos.svg +4 -0
- package/core/images/cust-logo-hubspot-col-pos.png +0 -0
- package/core/images/cust-logo-hubspot-col-pos@2x.png +0 -0
- package/core/images/cust-logo-hubspot-mono-pos.svg +4 -0
- package/core/images/cust-logo-lightspeed-col-pos.png +0 -0
- package/core/images/cust-logo-lightspeed-col-pos@2x.png +0 -0
- package/core/images/cust-logo-lightspeed-syst-col-pos.png +0 -0
- package/core/images/cust-logo-lightspeed-syst-col-pos@2x.png +0 -0
- package/core/images/cust-logo-split-col-pos.png +0 -0
- package/core/images/cust-logo-split-col-pos@2x.png +0 -0
- package/core/images/cust-logo-split-mono-pos.svg +9 -0
- package/core/images/cust-logo-toyota-mono-pos.svg +18 -0
- package/core/images/cust-logo-vitac-col-pos.png +0 -0
- package/core/images/cust-logo-vitac-col-pos@2x.png +0 -0
- package/core/images/cust-photo-hubspot-max-freiert.jpg +0 -0
- package/core/images/cust-photo-split-pato-echague.jpg +0 -0
- package/core/images/cust-photo-vitac-joe-antonio.jpg +0 -0
- package/core/images/flexible-companies.png +0 -0
- package/core/images/rocket-list-2021.png +0 -0
- package/core/images/scale-motif-open-empathetic.svg +1 -0
- package/core/images/technical-support-01-800x533.jpg +0 -0
- package/core/scripts.js +1 -0
- package/core/sprites.svg +130 -0
- package/core/styles.base.css +1 -0
- package/core/styles.components.css +49 -0
- package/core/styles.css +560 -0
- package/package.json +1 -1
- package/preview/log/.keep +0 -0
- package/preview/tmp/.keep +0 -0
- package/preview/tmp/pids/.keep +0 -0
- package/reset/.gitignore +1 -0
- package/reset/scripts.js +1 -0
- package/reset/styles.css +487 -0
- package/src/.DS_Store +0 -0
- package/src/core/.DS_Store +0 -0
- package/src/core/Code/component.html.erb +3 -3
- package/src/core/Code/component.jsx +3 -2
- package/src/core/Code/component.rb +2 -1
- package/src/core/CustomerLogos/component.html.erb +9 -0
- package/src/core/CustomerLogos/component.js +0 -0
- package/src/core/CustomerLogos/component.jsx +27 -0
- package/src/core/CustomerLogos/component.rb +13 -0
- package/src/core/FeaturedLink/component.css +1 -2
- package/src/core/FeaturedLink/component.html.erb +1 -1
- package/src/core/FeaturedLink/component.rb +3 -1
- package/src/core/MeganavItemsSignedIn/component.html.erb +1 -1
- package/src/core/MeganavItemsSignedIn/component.jsx +1 -1
- package/src/core/Slider/component.html.erb +2 -2
- package/src/core/Slider/component.js +2 -2
- package/src/core/Slider/component.jsx +2 -2
- package/src/core/icons/icon-display-api-keys.svg +3 -0
- package/src/core/icons/icon-display-cloud-servers.svg +3 -0
- package/src/core/icons/icon-display-map-pin.svg +1 -1
- package/src/core/icons/icon-display-servers.svg +3 -0
- package/src/core/icons/icon-gui-history.svg +3 -0
- package/src/core/icons/icon-gui-refresh.svg +10 -0
- package/src/core/images/cust-logo-ausopen-mono-pos.svg +5 -0
- package/src/core/images/cust-logo-bloomberg-mono-pos.svg +11 -0
- package/src/core/images/cust-logo-hopin-mono-pos.svg +4 -0
- package/src/core/images/cust-logo-hubspot-mono-pos.svg +4 -0
- package/src/core/images/cust-logo-split-mono-pos.svg +9 -0
- package/src/core/images/cust-logo-toyota-mono-pos.svg +18 -0
- package/src/core/styles/buttons.css +91 -4
- package/src/core/styles/forms.css +50 -0
- package/src/core/styles/properties.css +34 -6
- package/src/core/styles/text.css +62 -1
- package/src/core/styles.components.css +1 -0
- package/tailwind.config.js +22 -1
package/core/Slider.jsx
ADDED
|
@@ -0,0 +1,957 @@
|
|
|
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([], factory);
|
|
6
|
+
else {
|
|
7
|
+
var a = typeof exports === 'object' ? factory(require("react")) : factory(root[undefined]);
|
|
8
|
+
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
|
9
|
+
}
|
|
10
|
+
})(this, function(__WEBPACK_EXTERNAL_MODULE__9281__) {
|
|
11
|
+
return /******/ (() => { // webpackBootstrap
|
|
12
|
+
/******/ var __webpack_modules__ = ({
|
|
13
|
+
|
|
14
|
+
/***/ 9008:
|
|
15
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
16
|
+
|
|
17
|
+
"use strict";
|
|
18
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
19
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
20
|
+
/* harmony export */ });
|
|
21
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9281);
|
|
22
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
23
|
+
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5697);
|
|
24
|
+
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
|
|
25
|
+
var _excluded = ["name", "size", "color", "additionalCSS"];
|
|
26
|
+
|
|
27
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
28
|
+
|
|
29
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
30
|
+
|
|
31
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
var Icon = function Icon(_ref) {
|
|
37
|
+
var name = _ref.name,
|
|
38
|
+
_ref$size = _ref.size,
|
|
39
|
+
size = _ref$size === void 0 ? "0.75rem" : _ref$size,
|
|
40
|
+
_ref$color = _ref.color,
|
|
41
|
+
color = _ref$color === void 0 ? "" : _ref$color,
|
|
42
|
+
_ref$additionalCSS = _ref.additionalCSS,
|
|
43
|
+
additionalCSS = _ref$additionalCSS === void 0 ? "" : _ref$additionalCSS,
|
|
44
|
+
additionalAttributes = _objectWithoutProperties(_ref, _excluded);
|
|
45
|
+
|
|
46
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", _extends({
|
|
47
|
+
className: "".concat(color, " ").concat(additionalCSS),
|
|
48
|
+
style: {
|
|
49
|
+
width: size,
|
|
50
|
+
height: size
|
|
51
|
+
}
|
|
52
|
+
}, additionalAttributes), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("use", {
|
|
53
|
+
xlinkHref: "#sprite-".concat(name)
|
|
54
|
+
}));
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
Icon.propTypes = {
|
|
58
|
+
name: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string.isRequired),
|
|
59
|
+
size: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
|
|
60
|
+
color: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
|
|
61
|
+
additionalCSS: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)
|
|
62
|
+
};
|
|
63
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Icon);
|
|
64
|
+
|
|
65
|
+
/***/ }),
|
|
66
|
+
|
|
67
|
+
/***/ 3096:
|
|
68
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* lodash (Custom Build) <https://lodash.com/>
|
|
72
|
+
* Build: `lodash modularize exports="npm" -o ./`
|
|
73
|
+
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
|
74
|
+
* Released under MIT license <https://lodash.com/license>
|
|
75
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
76
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
77
|
+
*/
|
|
78
|
+
|
|
79
|
+
/** Used as the `TypeError` message for "Functions" methods. */
|
|
80
|
+
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
81
|
+
|
|
82
|
+
/** Used as references for various `Number` constants. */
|
|
83
|
+
var NAN = 0 / 0;
|
|
84
|
+
|
|
85
|
+
/** `Object#toString` result references. */
|
|
86
|
+
var symbolTag = '[object Symbol]';
|
|
87
|
+
|
|
88
|
+
/** Used to match leading and trailing whitespace. */
|
|
89
|
+
var reTrim = /^\s+|\s+$/g;
|
|
90
|
+
|
|
91
|
+
/** Used to detect bad signed hexadecimal string values. */
|
|
92
|
+
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
93
|
+
|
|
94
|
+
/** Used to detect binary string values. */
|
|
95
|
+
var reIsBinary = /^0b[01]+$/i;
|
|
96
|
+
|
|
97
|
+
/** Used to detect octal string values. */
|
|
98
|
+
var reIsOctal = /^0o[0-7]+$/i;
|
|
99
|
+
|
|
100
|
+
/** Built-in method references without a dependency on `root`. */
|
|
101
|
+
var freeParseInt = parseInt;
|
|
102
|
+
|
|
103
|
+
/** Detect free variable `global` from Node.js. */
|
|
104
|
+
var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
|
|
105
|
+
|
|
106
|
+
/** Detect free variable `self`. */
|
|
107
|
+
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
108
|
+
|
|
109
|
+
/** Used as a reference to the global object. */
|
|
110
|
+
var root = freeGlobal || freeSelf || Function('return this')();
|
|
111
|
+
|
|
112
|
+
/** Used for built-in method references. */
|
|
113
|
+
var objectProto = Object.prototype;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Used to resolve the
|
|
117
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
118
|
+
* of values.
|
|
119
|
+
*/
|
|
120
|
+
var objectToString = objectProto.toString;
|
|
121
|
+
|
|
122
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
123
|
+
var nativeMax = Math.max,
|
|
124
|
+
nativeMin = Math.min;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Gets the timestamp of the number of milliseconds that have elapsed since
|
|
128
|
+
* the Unix epoch (1 January 1970 00:00:00 UTC).
|
|
129
|
+
*
|
|
130
|
+
* @static
|
|
131
|
+
* @memberOf _
|
|
132
|
+
* @since 2.4.0
|
|
133
|
+
* @category Date
|
|
134
|
+
* @returns {number} Returns the timestamp.
|
|
135
|
+
* @example
|
|
136
|
+
*
|
|
137
|
+
* _.defer(function(stamp) {
|
|
138
|
+
* console.log(_.now() - stamp);
|
|
139
|
+
* }, _.now());
|
|
140
|
+
* // => Logs the number of milliseconds it took for the deferred invocation.
|
|
141
|
+
*/
|
|
142
|
+
var now = function() {
|
|
143
|
+
return root.Date.now();
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Creates a debounced function that delays invoking `func` until after `wait`
|
|
148
|
+
* milliseconds have elapsed since the last time the debounced function was
|
|
149
|
+
* invoked. The debounced function comes with a `cancel` method to cancel
|
|
150
|
+
* delayed `func` invocations and a `flush` method to immediately invoke them.
|
|
151
|
+
* Provide `options` to indicate whether `func` should be invoked on the
|
|
152
|
+
* leading and/or trailing edge of the `wait` timeout. The `func` is invoked
|
|
153
|
+
* with the last arguments provided to the debounced function. Subsequent
|
|
154
|
+
* calls to the debounced function return the result of the last `func`
|
|
155
|
+
* invocation.
|
|
156
|
+
*
|
|
157
|
+
* **Note:** If `leading` and `trailing` options are `true`, `func` is
|
|
158
|
+
* invoked on the trailing edge of the timeout only if the debounced function
|
|
159
|
+
* is invoked more than once during the `wait` timeout.
|
|
160
|
+
*
|
|
161
|
+
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
|
162
|
+
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
|
|
163
|
+
*
|
|
164
|
+
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
|
165
|
+
* for details over the differences between `_.debounce` and `_.throttle`.
|
|
166
|
+
*
|
|
167
|
+
* @static
|
|
168
|
+
* @memberOf _
|
|
169
|
+
* @since 0.1.0
|
|
170
|
+
* @category Function
|
|
171
|
+
* @param {Function} func The function to debounce.
|
|
172
|
+
* @param {number} [wait=0] The number of milliseconds to delay.
|
|
173
|
+
* @param {Object} [options={}] The options object.
|
|
174
|
+
* @param {boolean} [options.leading=false]
|
|
175
|
+
* Specify invoking on the leading edge of the timeout.
|
|
176
|
+
* @param {number} [options.maxWait]
|
|
177
|
+
* The maximum time `func` is allowed to be delayed before it's invoked.
|
|
178
|
+
* @param {boolean} [options.trailing=true]
|
|
179
|
+
* Specify invoking on the trailing edge of the timeout.
|
|
180
|
+
* @returns {Function} Returns the new debounced function.
|
|
181
|
+
* @example
|
|
182
|
+
*
|
|
183
|
+
* // Avoid costly calculations while the window size is in flux.
|
|
184
|
+
* jQuery(window).on('resize', _.debounce(calculateLayout, 150));
|
|
185
|
+
*
|
|
186
|
+
* // Invoke `sendMail` when clicked, debouncing subsequent calls.
|
|
187
|
+
* jQuery(element).on('click', _.debounce(sendMail, 300, {
|
|
188
|
+
* 'leading': true,
|
|
189
|
+
* 'trailing': false
|
|
190
|
+
* }));
|
|
191
|
+
*
|
|
192
|
+
* // Ensure `batchLog` is invoked once after 1 second of debounced calls.
|
|
193
|
+
* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
|
|
194
|
+
* var source = new EventSource('/stream');
|
|
195
|
+
* jQuery(source).on('message', debounced);
|
|
196
|
+
*
|
|
197
|
+
* // Cancel the trailing debounced invocation.
|
|
198
|
+
* jQuery(window).on('popstate', debounced.cancel);
|
|
199
|
+
*/
|
|
200
|
+
function debounce(func, wait, options) {
|
|
201
|
+
var lastArgs,
|
|
202
|
+
lastThis,
|
|
203
|
+
maxWait,
|
|
204
|
+
result,
|
|
205
|
+
timerId,
|
|
206
|
+
lastCallTime,
|
|
207
|
+
lastInvokeTime = 0,
|
|
208
|
+
leading = false,
|
|
209
|
+
maxing = false,
|
|
210
|
+
trailing = true;
|
|
211
|
+
|
|
212
|
+
if (typeof func != 'function') {
|
|
213
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
214
|
+
}
|
|
215
|
+
wait = toNumber(wait) || 0;
|
|
216
|
+
if (isObject(options)) {
|
|
217
|
+
leading = !!options.leading;
|
|
218
|
+
maxing = 'maxWait' in options;
|
|
219
|
+
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
|
220
|
+
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function invokeFunc(time) {
|
|
224
|
+
var args = lastArgs,
|
|
225
|
+
thisArg = lastThis;
|
|
226
|
+
|
|
227
|
+
lastArgs = lastThis = undefined;
|
|
228
|
+
lastInvokeTime = time;
|
|
229
|
+
result = func.apply(thisArg, args);
|
|
230
|
+
return result;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
function leadingEdge(time) {
|
|
234
|
+
// Reset any `maxWait` timer.
|
|
235
|
+
lastInvokeTime = time;
|
|
236
|
+
// Start the timer for the trailing edge.
|
|
237
|
+
timerId = setTimeout(timerExpired, wait);
|
|
238
|
+
// Invoke the leading edge.
|
|
239
|
+
return leading ? invokeFunc(time) : result;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
function remainingWait(time) {
|
|
243
|
+
var timeSinceLastCall = time - lastCallTime,
|
|
244
|
+
timeSinceLastInvoke = time - lastInvokeTime,
|
|
245
|
+
result = wait - timeSinceLastCall;
|
|
246
|
+
|
|
247
|
+
return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function shouldInvoke(time) {
|
|
251
|
+
var timeSinceLastCall = time - lastCallTime,
|
|
252
|
+
timeSinceLastInvoke = time - lastInvokeTime;
|
|
253
|
+
|
|
254
|
+
// Either this is the first call, activity has stopped and we're at the
|
|
255
|
+
// trailing edge, the system time has gone backwards and we're treating
|
|
256
|
+
// it as the trailing edge, or we've hit the `maxWait` limit.
|
|
257
|
+
return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
|
|
258
|
+
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
function timerExpired() {
|
|
262
|
+
var time = now();
|
|
263
|
+
if (shouldInvoke(time)) {
|
|
264
|
+
return trailingEdge(time);
|
|
265
|
+
}
|
|
266
|
+
// Restart the timer.
|
|
267
|
+
timerId = setTimeout(timerExpired, remainingWait(time));
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
function trailingEdge(time) {
|
|
271
|
+
timerId = undefined;
|
|
272
|
+
|
|
273
|
+
// Only invoke if we have `lastArgs` which means `func` has been
|
|
274
|
+
// debounced at least once.
|
|
275
|
+
if (trailing && lastArgs) {
|
|
276
|
+
return invokeFunc(time);
|
|
277
|
+
}
|
|
278
|
+
lastArgs = lastThis = undefined;
|
|
279
|
+
return result;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
function cancel() {
|
|
283
|
+
if (timerId !== undefined) {
|
|
284
|
+
clearTimeout(timerId);
|
|
285
|
+
}
|
|
286
|
+
lastInvokeTime = 0;
|
|
287
|
+
lastArgs = lastCallTime = lastThis = timerId = undefined;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
function flush() {
|
|
291
|
+
return timerId === undefined ? result : trailingEdge(now());
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
function debounced() {
|
|
295
|
+
var time = now(),
|
|
296
|
+
isInvoking = shouldInvoke(time);
|
|
297
|
+
|
|
298
|
+
lastArgs = arguments;
|
|
299
|
+
lastThis = this;
|
|
300
|
+
lastCallTime = time;
|
|
301
|
+
|
|
302
|
+
if (isInvoking) {
|
|
303
|
+
if (timerId === undefined) {
|
|
304
|
+
return leadingEdge(lastCallTime);
|
|
305
|
+
}
|
|
306
|
+
if (maxing) {
|
|
307
|
+
// Handle invocations in a tight loop.
|
|
308
|
+
timerId = setTimeout(timerExpired, wait);
|
|
309
|
+
return invokeFunc(lastCallTime);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
if (timerId === undefined) {
|
|
313
|
+
timerId = setTimeout(timerExpired, wait);
|
|
314
|
+
}
|
|
315
|
+
return result;
|
|
316
|
+
}
|
|
317
|
+
debounced.cancel = cancel;
|
|
318
|
+
debounced.flush = flush;
|
|
319
|
+
return debounced;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Creates a throttled function that only invokes `func` at most once per
|
|
324
|
+
* every `wait` milliseconds. The throttled function comes with a `cancel`
|
|
325
|
+
* method to cancel delayed `func` invocations and a `flush` method to
|
|
326
|
+
* immediately invoke them. Provide `options` to indicate whether `func`
|
|
327
|
+
* should be invoked on the leading and/or trailing edge of the `wait`
|
|
328
|
+
* timeout. The `func` is invoked with the last arguments provided to the
|
|
329
|
+
* throttled function. Subsequent calls to the throttled function return the
|
|
330
|
+
* result of the last `func` invocation.
|
|
331
|
+
*
|
|
332
|
+
* **Note:** If `leading` and `trailing` options are `true`, `func` is
|
|
333
|
+
* invoked on the trailing edge of the timeout only if the throttled function
|
|
334
|
+
* is invoked more than once during the `wait` timeout.
|
|
335
|
+
*
|
|
336
|
+
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
|
337
|
+
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
|
|
338
|
+
*
|
|
339
|
+
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
|
340
|
+
* for details over the differences between `_.throttle` and `_.debounce`.
|
|
341
|
+
*
|
|
342
|
+
* @static
|
|
343
|
+
* @memberOf _
|
|
344
|
+
* @since 0.1.0
|
|
345
|
+
* @category Function
|
|
346
|
+
* @param {Function} func The function to throttle.
|
|
347
|
+
* @param {number} [wait=0] The number of milliseconds to throttle invocations to.
|
|
348
|
+
* @param {Object} [options={}] The options object.
|
|
349
|
+
* @param {boolean} [options.leading=true]
|
|
350
|
+
* Specify invoking on the leading edge of the timeout.
|
|
351
|
+
* @param {boolean} [options.trailing=true]
|
|
352
|
+
* Specify invoking on the trailing edge of the timeout.
|
|
353
|
+
* @returns {Function} Returns the new throttled function.
|
|
354
|
+
* @example
|
|
355
|
+
*
|
|
356
|
+
* // Avoid excessively updating the position while scrolling.
|
|
357
|
+
* jQuery(window).on('scroll', _.throttle(updatePosition, 100));
|
|
358
|
+
*
|
|
359
|
+
* // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
|
|
360
|
+
* var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
|
|
361
|
+
* jQuery(element).on('click', throttled);
|
|
362
|
+
*
|
|
363
|
+
* // Cancel the trailing throttled invocation.
|
|
364
|
+
* jQuery(window).on('popstate', throttled.cancel);
|
|
365
|
+
*/
|
|
366
|
+
function throttle(func, wait, options) {
|
|
367
|
+
var leading = true,
|
|
368
|
+
trailing = true;
|
|
369
|
+
|
|
370
|
+
if (typeof func != 'function') {
|
|
371
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
372
|
+
}
|
|
373
|
+
if (isObject(options)) {
|
|
374
|
+
leading = 'leading' in options ? !!options.leading : leading;
|
|
375
|
+
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
|
376
|
+
}
|
|
377
|
+
return debounce(func, wait, {
|
|
378
|
+
'leading': leading,
|
|
379
|
+
'maxWait': wait,
|
|
380
|
+
'trailing': trailing
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Checks if `value` is the
|
|
386
|
+
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
387
|
+
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
388
|
+
*
|
|
389
|
+
* @static
|
|
390
|
+
* @memberOf _
|
|
391
|
+
* @since 0.1.0
|
|
392
|
+
* @category Lang
|
|
393
|
+
* @param {*} value The value to check.
|
|
394
|
+
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
395
|
+
* @example
|
|
396
|
+
*
|
|
397
|
+
* _.isObject({});
|
|
398
|
+
* // => true
|
|
399
|
+
*
|
|
400
|
+
* _.isObject([1, 2, 3]);
|
|
401
|
+
* // => true
|
|
402
|
+
*
|
|
403
|
+
* _.isObject(_.noop);
|
|
404
|
+
* // => true
|
|
405
|
+
*
|
|
406
|
+
* _.isObject(null);
|
|
407
|
+
* // => false
|
|
408
|
+
*/
|
|
409
|
+
function isObject(value) {
|
|
410
|
+
var type = typeof value;
|
|
411
|
+
return !!value && (type == 'object' || type == 'function');
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
416
|
+
* and has a `typeof` result of "object".
|
|
417
|
+
*
|
|
418
|
+
* @static
|
|
419
|
+
* @memberOf _
|
|
420
|
+
* @since 4.0.0
|
|
421
|
+
* @category Lang
|
|
422
|
+
* @param {*} value The value to check.
|
|
423
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
424
|
+
* @example
|
|
425
|
+
*
|
|
426
|
+
* _.isObjectLike({});
|
|
427
|
+
* // => true
|
|
428
|
+
*
|
|
429
|
+
* _.isObjectLike([1, 2, 3]);
|
|
430
|
+
* // => true
|
|
431
|
+
*
|
|
432
|
+
* _.isObjectLike(_.noop);
|
|
433
|
+
* // => false
|
|
434
|
+
*
|
|
435
|
+
* _.isObjectLike(null);
|
|
436
|
+
* // => false
|
|
437
|
+
*/
|
|
438
|
+
function isObjectLike(value) {
|
|
439
|
+
return !!value && typeof value == 'object';
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
444
|
+
*
|
|
445
|
+
* @static
|
|
446
|
+
* @memberOf _
|
|
447
|
+
* @since 4.0.0
|
|
448
|
+
* @category Lang
|
|
449
|
+
* @param {*} value The value to check.
|
|
450
|
+
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
|
451
|
+
* @example
|
|
452
|
+
*
|
|
453
|
+
* _.isSymbol(Symbol.iterator);
|
|
454
|
+
* // => true
|
|
455
|
+
*
|
|
456
|
+
* _.isSymbol('abc');
|
|
457
|
+
* // => false
|
|
458
|
+
*/
|
|
459
|
+
function isSymbol(value) {
|
|
460
|
+
return typeof value == 'symbol' ||
|
|
461
|
+
(isObjectLike(value) && objectToString.call(value) == symbolTag);
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* Converts `value` to a number.
|
|
466
|
+
*
|
|
467
|
+
* @static
|
|
468
|
+
* @memberOf _
|
|
469
|
+
* @since 4.0.0
|
|
470
|
+
* @category Lang
|
|
471
|
+
* @param {*} value The value to process.
|
|
472
|
+
* @returns {number} Returns the number.
|
|
473
|
+
* @example
|
|
474
|
+
*
|
|
475
|
+
* _.toNumber(3.2);
|
|
476
|
+
* // => 3.2
|
|
477
|
+
*
|
|
478
|
+
* _.toNumber(Number.MIN_VALUE);
|
|
479
|
+
* // => 5e-324
|
|
480
|
+
*
|
|
481
|
+
* _.toNumber(Infinity);
|
|
482
|
+
* // => Infinity
|
|
483
|
+
*
|
|
484
|
+
* _.toNumber('3.2');
|
|
485
|
+
* // => 3.2
|
|
486
|
+
*/
|
|
487
|
+
function toNumber(value) {
|
|
488
|
+
if (typeof value == 'number') {
|
|
489
|
+
return value;
|
|
490
|
+
}
|
|
491
|
+
if (isSymbol(value)) {
|
|
492
|
+
return NAN;
|
|
493
|
+
}
|
|
494
|
+
if (isObject(value)) {
|
|
495
|
+
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
|
|
496
|
+
value = isObject(other) ? (other + '') : other;
|
|
497
|
+
}
|
|
498
|
+
if (typeof value != 'string') {
|
|
499
|
+
return value === 0 ? value : +value;
|
|
500
|
+
}
|
|
501
|
+
value = value.replace(reTrim, '');
|
|
502
|
+
var isBinary = reIsBinary.test(value);
|
|
503
|
+
return (isBinary || reIsOctal.test(value))
|
|
504
|
+
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
|
|
505
|
+
: (reIsBadHex.test(value) ? NAN : +value);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
module.exports = throttle;
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
/***/ }),
|
|
512
|
+
|
|
513
|
+
/***/ 2703:
|
|
514
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
515
|
+
|
|
516
|
+
"use strict";
|
|
517
|
+
/**
|
|
518
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
519
|
+
*
|
|
520
|
+
* This source code is licensed under the MIT license found in the
|
|
521
|
+
* LICENSE file in the root directory of this source tree.
|
|
522
|
+
*/
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
var ReactPropTypesSecret = __webpack_require__(414);
|
|
527
|
+
|
|
528
|
+
function emptyFunction() {}
|
|
529
|
+
function emptyFunctionWithReset() {}
|
|
530
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
531
|
+
|
|
532
|
+
module.exports = function() {
|
|
533
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
534
|
+
if (secret === ReactPropTypesSecret) {
|
|
535
|
+
// It is still safe when called from React.
|
|
536
|
+
return;
|
|
537
|
+
}
|
|
538
|
+
var err = new Error(
|
|
539
|
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
540
|
+
'Use PropTypes.checkPropTypes() to call them. ' +
|
|
541
|
+
'Read more at http://fb.me/use-check-prop-types'
|
|
542
|
+
);
|
|
543
|
+
err.name = 'Invariant Violation';
|
|
544
|
+
throw err;
|
|
545
|
+
};
|
|
546
|
+
shim.isRequired = shim;
|
|
547
|
+
function getShim() {
|
|
548
|
+
return shim;
|
|
549
|
+
};
|
|
550
|
+
// Important!
|
|
551
|
+
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
552
|
+
var ReactPropTypes = {
|
|
553
|
+
array: shim,
|
|
554
|
+
bool: shim,
|
|
555
|
+
func: shim,
|
|
556
|
+
number: shim,
|
|
557
|
+
object: shim,
|
|
558
|
+
string: shim,
|
|
559
|
+
symbol: shim,
|
|
560
|
+
|
|
561
|
+
any: shim,
|
|
562
|
+
arrayOf: getShim,
|
|
563
|
+
element: shim,
|
|
564
|
+
elementType: shim,
|
|
565
|
+
instanceOf: getShim,
|
|
566
|
+
node: shim,
|
|
567
|
+
objectOf: getShim,
|
|
568
|
+
oneOf: getShim,
|
|
569
|
+
oneOfType: getShim,
|
|
570
|
+
shape: getShim,
|
|
571
|
+
exact: getShim,
|
|
572
|
+
|
|
573
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
574
|
+
resetWarningCache: emptyFunction
|
|
575
|
+
};
|
|
576
|
+
|
|
577
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
578
|
+
|
|
579
|
+
return ReactPropTypes;
|
|
580
|
+
};
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
/***/ }),
|
|
584
|
+
|
|
585
|
+
/***/ 5697:
|
|
586
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
590
|
+
*
|
|
591
|
+
* This source code is licensed under the MIT license found in the
|
|
592
|
+
* LICENSE file in the root directory of this source tree.
|
|
593
|
+
*/
|
|
594
|
+
|
|
595
|
+
if (false) { var throwOnDirectAccess, ReactIs; } else {
|
|
596
|
+
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
597
|
+
// http://fb.me/prop-types-in-prod
|
|
598
|
+
module.exports = __webpack_require__(2703)();
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
|
|
602
|
+
/***/ }),
|
|
603
|
+
|
|
604
|
+
/***/ 414:
|
|
605
|
+
/***/ ((module) => {
|
|
606
|
+
|
|
607
|
+
"use strict";
|
|
608
|
+
/**
|
|
609
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
610
|
+
*
|
|
611
|
+
* This source code is licensed under the MIT license found in the
|
|
612
|
+
* LICENSE file in the root directory of this source tree.
|
|
613
|
+
*/
|
|
614
|
+
|
|
615
|
+
|
|
616
|
+
|
|
617
|
+
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
618
|
+
|
|
619
|
+
module.exports = ReactPropTypesSecret;
|
|
620
|
+
|
|
621
|
+
|
|
622
|
+
/***/ }),
|
|
623
|
+
|
|
624
|
+
/***/ 9281:
|
|
625
|
+
/***/ ((module) => {
|
|
626
|
+
|
|
627
|
+
"use strict";
|
|
628
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__9281__;
|
|
629
|
+
|
|
630
|
+
/***/ })
|
|
631
|
+
|
|
632
|
+
/******/ });
|
|
633
|
+
/************************************************************************/
|
|
634
|
+
/******/ // The module cache
|
|
635
|
+
/******/ var __webpack_module_cache__ = {};
|
|
636
|
+
/******/
|
|
637
|
+
/******/ // The require function
|
|
638
|
+
/******/ function __webpack_require__(moduleId) {
|
|
639
|
+
/******/ // Check if module is in cache
|
|
640
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
641
|
+
/******/ if (cachedModule !== undefined) {
|
|
642
|
+
/******/ return cachedModule.exports;
|
|
643
|
+
/******/ }
|
|
644
|
+
/******/ // Create a new module (and put it into the cache)
|
|
645
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
646
|
+
/******/ // no module.id needed
|
|
647
|
+
/******/ // no module.loaded needed
|
|
648
|
+
/******/ exports: {}
|
|
649
|
+
/******/ };
|
|
650
|
+
/******/
|
|
651
|
+
/******/ // Execute the module function
|
|
652
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
653
|
+
/******/
|
|
654
|
+
/******/ // Return the exports of the module
|
|
655
|
+
/******/ return module.exports;
|
|
656
|
+
/******/ }
|
|
657
|
+
/******/
|
|
658
|
+
/************************************************************************/
|
|
659
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
660
|
+
/******/ (() => {
|
|
661
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
662
|
+
/******/ __webpack_require__.n = (module) => {
|
|
663
|
+
/******/ var getter = module && module.__esModule ?
|
|
664
|
+
/******/ () => (module['default']) :
|
|
665
|
+
/******/ () => (module);
|
|
666
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
667
|
+
/******/ return getter;
|
|
668
|
+
/******/ };
|
|
669
|
+
/******/ })();
|
|
670
|
+
/******/
|
|
671
|
+
/******/ /* webpack/runtime/define property getters */
|
|
672
|
+
/******/ (() => {
|
|
673
|
+
/******/ // define getter functions for harmony exports
|
|
674
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
675
|
+
/******/ for(var key in definition) {
|
|
676
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
677
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
678
|
+
/******/ }
|
|
679
|
+
/******/ }
|
|
680
|
+
/******/ };
|
|
681
|
+
/******/ })();
|
|
682
|
+
/******/
|
|
683
|
+
/******/ /* webpack/runtime/global */
|
|
684
|
+
/******/ (() => {
|
|
685
|
+
/******/ __webpack_require__.g = (function() {
|
|
686
|
+
/******/ if (typeof globalThis === 'object') return globalThis;
|
|
687
|
+
/******/ try {
|
|
688
|
+
/******/ return this || new Function('return this')();
|
|
689
|
+
/******/ } catch (e) {
|
|
690
|
+
/******/ if (typeof window === 'object') return window;
|
|
691
|
+
/******/ }
|
|
692
|
+
/******/ })();
|
|
693
|
+
/******/ })();
|
|
694
|
+
/******/
|
|
695
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
696
|
+
/******/ (() => {
|
|
697
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
698
|
+
/******/ })();
|
|
699
|
+
/******/
|
|
700
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
701
|
+
/******/ (() => {
|
|
702
|
+
/******/ // define __esModule on exports
|
|
703
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
704
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
705
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
706
|
+
/******/ }
|
|
707
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
708
|
+
/******/ };
|
|
709
|
+
/******/ })();
|
|
710
|
+
/******/
|
|
711
|
+
/************************************************************************/
|
|
712
|
+
var __webpack_exports__ = {};
|
|
713
|
+
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
|
|
714
|
+
(() => {
|
|
715
|
+
"use strict";
|
|
716
|
+
// ESM COMPAT FLAG
|
|
717
|
+
__webpack_require__.r(__webpack_exports__);
|
|
718
|
+
|
|
719
|
+
// EXPORTS
|
|
720
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
721
|
+
"default": () => (/* binding */ core_Slider_component)
|
|
722
|
+
});
|
|
723
|
+
|
|
724
|
+
// EXTERNAL MODULE: external {"commonjs":"react","commonjs2":"react"}
|
|
725
|
+
var external_commonjs_react_commonjs2_react_ = __webpack_require__(9281);
|
|
726
|
+
var external_commonjs_react_commonjs2_react_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_react_commonjs2_react_);
|
|
727
|
+
// EXTERNAL MODULE: ./node_modules/prop-types/index.js
|
|
728
|
+
var prop_types = __webpack_require__(5697);
|
|
729
|
+
var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types);
|
|
730
|
+
// EXTERNAL MODULE: ./src/core/Icon/component.jsx
|
|
731
|
+
var component = __webpack_require__(9008);
|
|
732
|
+
// EXTERNAL MODULE: ./node_modules/lodash.throttle/index.js
|
|
733
|
+
var lodash_throttle = __webpack_require__(3096);
|
|
734
|
+
var lodash_throttle_default = /*#__PURE__*/__webpack_require__.n(lodash_throttle);
|
|
735
|
+
;// CONCATENATED MODULE: ./src/core/dom-query.js
|
|
736
|
+
var queryId = function queryId(val) {
|
|
737
|
+
var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;
|
|
738
|
+
return root.querySelector("[data-id=".concat(val, "]"));
|
|
739
|
+
};
|
|
740
|
+
var queryIdAll = function queryIdAll(val) {
|
|
741
|
+
var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;
|
|
742
|
+
return root.querySelectorAll("[data-id=".concat(val, "]"));
|
|
743
|
+
};
|
|
744
|
+
;// CONCATENATED MODULE: ./src/core/Slider/component.js
|
|
745
|
+
|
|
746
|
+
|
|
747
|
+
|
|
748
|
+
|
|
749
|
+
var mdBreakpoint = function mdBreakpoint() {
|
|
750
|
+
return window.matchMedia("(min-width: 48rem)").matches;
|
|
751
|
+
};
|
|
752
|
+
|
|
753
|
+
var DRAG_BUFFER = 20;
|
|
754
|
+
|
|
755
|
+
var init = function init(slidesContainer) {
|
|
756
|
+
var transformContainer = queryId("slider-strip", slidesContainer);
|
|
757
|
+
var slides = Array.from(queryIdAll("slider-slide", slidesContainer));
|
|
758
|
+
var slideLeftChevron = queryId("slider-previous", slidesContainer);
|
|
759
|
+
var slideRightChevron = queryId("slider-next", slidesContainer);
|
|
760
|
+
var slideMarkers = Array.from(queryIdAll("slider-marker", slidesContainer));
|
|
761
|
+
var sliderControls = queryId("slider-controls", slidesContainer);
|
|
762
|
+
sliderControls.classList.replace("hidden", "flex");
|
|
763
|
+
var slidesLength = slides.length;
|
|
764
|
+
var slidesWidth = slidesContainer.getBoundingClientRect().width;
|
|
765
|
+
|
|
766
|
+
var _slides$0$getBounding = slides[0].getBoundingClientRect(),
|
|
767
|
+
slideWidth = _slides$0$getBounding.width,
|
|
768
|
+
slideLeftDistance = _slides$0$getBounding.left;
|
|
769
|
+
|
|
770
|
+
var _slides$1$getBounding = slides[1].getBoundingClientRect(),
|
|
771
|
+
slideLeftDistanceSecond = _slides$1$getBounding.left;
|
|
772
|
+
|
|
773
|
+
var slideGap = slideLeftDistanceSecond - slideLeftDistance - slideWidth;
|
|
774
|
+
var adjustment = (slidesWidth - slideWidth) / 2;
|
|
775
|
+
var currentIndex = 0;
|
|
776
|
+
var touchStartX = 0;
|
|
777
|
+
|
|
778
|
+
var calculateTransform = function calculateTransform(index) {
|
|
779
|
+
return index * -slideWidth + adjustment + index * -slideGap;
|
|
780
|
+
};
|
|
781
|
+
|
|
782
|
+
var updateSlide = function updateSlide(index) {
|
|
783
|
+
return transformContainer.style.transform = "translateX(".concat(calculateTransform(index), "px)");
|
|
784
|
+
};
|
|
785
|
+
|
|
786
|
+
var updateMarkers = function updateMarkers(index) {
|
|
787
|
+
slideMarkers.forEach(function (marker) {
|
|
788
|
+
return marker.classList.remove("text-active-orange");
|
|
789
|
+
});
|
|
790
|
+
slideMarkers[index].classList.remove("text-cool-black");
|
|
791
|
+
slideMarkers[index].classList.add("text-active-orange");
|
|
792
|
+
};
|
|
793
|
+
|
|
794
|
+
var slideLeft = function slideLeft() {
|
|
795
|
+
currentIndex = currentIndex - 1 <= 0 ? 0 : currentIndex - 1;
|
|
796
|
+
updateSlide(currentIndex);
|
|
797
|
+
updateMarkers(currentIndex);
|
|
798
|
+
};
|
|
799
|
+
|
|
800
|
+
var slideRight = function slideRight() {
|
|
801
|
+
currentIndex = currentIndex + 1 >= slidesLength ? currentIndex : currentIndex + 1;
|
|
802
|
+
updateSlide(currentIndex);
|
|
803
|
+
updateMarkers(currentIndex);
|
|
804
|
+
};
|
|
805
|
+
|
|
806
|
+
updateSlide(0);
|
|
807
|
+
updateMarkers(0);
|
|
808
|
+
slideLeftChevron.addEventListener("click", slideLeft);
|
|
809
|
+
transformContainer.addEventListener("touchstart", function (e) {
|
|
810
|
+
var _e$touches$;
|
|
811
|
+
|
|
812
|
+
touchStartX = (_e$touches$ = e.touches[0]) === null || _e$touches$ === void 0 ? void 0 : _e$touches$.clientX;
|
|
813
|
+
});
|
|
814
|
+
transformContainer.addEventListener("touchend", function (e) {
|
|
815
|
+
var _e$changedTouches$;
|
|
816
|
+
|
|
817
|
+
var distance = ((_e$changedTouches$ = e.changedTouches[0]) === null || _e$changedTouches$ === void 0 ? void 0 : _e$changedTouches$.clientX) - touchStartX; // Prevent sliding on clicks
|
|
818
|
+
|
|
819
|
+
if (Math.abs(distance) < DRAG_BUFFER) return;
|
|
820
|
+
var direction = distance > 0 ? slideLeft : slideRight;
|
|
821
|
+
direction();
|
|
822
|
+
});
|
|
823
|
+
slideRightChevron.addEventListener("click", slideRight);
|
|
824
|
+
return function () {
|
|
825
|
+
transformContainer.style.transform = null;
|
|
826
|
+
sliderControls.classList.replace("flex", "hidden");
|
|
827
|
+
};
|
|
828
|
+
};
|
|
829
|
+
|
|
830
|
+
var Slider = function Slider(_ref) {
|
|
831
|
+
var container = _ref.container,
|
|
832
|
+
mqEnableThreshold = _ref.mqEnableThreshold;
|
|
833
|
+
if (!container) return;
|
|
834
|
+
|
|
835
|
+
var breakpointCheck = mqEnableThreshold || function () {
|
|
836
|
+
return !mdBreakpoint();
|
|
837
|
+
};
|
|
838
|
+
|
|
839
|
+
var unmount = function unmount() {};
|
|
840
|
+
|
|
841
|
+
if (breakpointCheck()) unmount = init(container);
|
|
842
|
+
window.addEventListener("resize", lodash_throttle_default()(function () {
|
|
843
|
+
if (breakpointCheck()) {
|
|
844
|
+
unmount = init(container);
|
|
845
|
+
} else {
|
|
846
|
+
unmount();
|
|
847
|
+
}
|
|
848
|
+
}, 100));
|
|
849
|
+
};
|
|
850
|
+
|
|
851
|
+
/* harmony default export */ const Slider_component = (Slider);
|
|
852
|
+
;// CONCATENATED MODULE: ./src/core/Slider/component.jsx
|
|
853
|
+
var _excluded = ["slides", "classes", "slideClasses", "slideMinWidth", "slideMaxWidth", "mqEnableThreshold"];
|
|
854
|
+
|
|
855
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
856
|
+
|
|
857
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
858
|
+
|
|
859
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
860
|
+
|
|
861
|
+
|
|
862
|
+
|
|
863
|
+
|
|
864
|
+
|
|
865
|
+
|
|
866
|
+
var component_Slider = function Slider(_ref) {
|
|
867
|
+
var _ref$slides = _ref.slides,
|
|
868
|
+
slides = _ref$slides === void 0 ? [] : _ref$slides,
|
|
869
|
+
_ref$classes = _ref.classes,
|
|
870
|
+
classes = _ref$classes === void 0 ? "" : _ref$classes,
|
|
871
|
+
_ref$slideClasses = _ref.slideClasses,
|
|
872
|
+
slideClasses = _ref$slideClasses === void 0 ? "" : _ref$slideClasses,
|
|
873
|
+
_ref$slideMinWidth = _ref.slideMinWidth,
|
|
874
|
+
slideMinWidth = _ref$slideMinWidth === void 0 ? "16.875rem" : _ref$slideMinWidth,
|
|
875
|
+
_ref$slideMaxWidth = _ref.slideMaxWidth,
|
|
876
|
+
slideMaxWidth = _ref$slideMaxWidth === void 0 ? "1fr" : _ref$slideMaxWidth,
|
|
877
|
+
_ref$mqEnableThreshol = _ref.mqEnableThreshold,
|
|
878
|
+
mqEnableThreshold = _ref$mqEnableThreshol === void 0 ? function () {
|
|
879
|
+
return true;
|
|
880
|
+
} : _ref$mqEnableThreshol,
|
|
881
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
882
|
+
|
|
883
|
+
var containerRef = (0,external_commonjs_react_commonjs2_react_.useRef)(null);
|
|
884
|
+
(0,external_commonjs_react_commonjs2_react_.useEffect)(function () {
|
|
885
|
+
Slider_component({
|
|
886
|
+
container: containerRef.current,
|
|
887
|
+
mqEnableThreshold: mqEnableThreshold
|
|
888
|
+
});
|
|
889
|
+
}, []);
|
|
890
|
+
if (slides.length === 0) return;
|
|
891
|
+
return /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("div", {
|
|
892
|
+
className: "w-full overflow-x-hidden",
|
|
893
|
+
"data-id": "slider",
|
|
894
|
+
style: {
|
|
895
|
+
"--dynamic-grid-columns-count": slides.length,
|
|
896
|
+
"--dynamic-grid-column-min-width": slideMinWidth,
|
|
897
|
+
"--dynamic-grid-column-max-width": slideMaxWidth
|
|
898
|
+
},
|
|
899
|
+
ref: containerRef
|
|
900
|
+
}, /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("ol", _extends({
|
|
901
|
+
className: "grid ui-grid-gap grid-cols-dynamic transform transition-transform ".concat(classes),
|
|
902
|
+
"data-id": "slider-strip"
|
|
903
|
+
}, props), slides.map(function (slide, i) {
|
|
904
|
+
return /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("li", {
|
|
905
|
+
key: i,
|
|
906
|
+
className: slideClasses,
|
|
907
|
+
"data-id": "slider-slide"
|
|
908
|
+
}, slide);
|
|
909
|
+
})), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("div", {
|
|
910
|
+
className: "justify-center items-center my-24 hidden",
|
|
911
|
+
"data-id": "slider-controls"
|
|
912
|
+
}, /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("button", {
|
|
913
|
+
type: "button",
|
|
914
|
+
className: "p-0 w-24 h-24 flex items-center focus:outline-gui-focus",
|
|
915
|
+
"data-id": "slider-previous"
|
|
916
|
+
}, /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement(component.default, {
|
|
917
|
+
name: "icon-gui-disclosure-arrow",
|
|
918
|
+
size: "1.5rem",
|
|
919
|
+
color: "text-cool-black",
|
|
920
|
+
additionalCSS: "transform rotate-180",
|
|
921
|
+
"data-id": "meganav-control-mobile-dropdown-menu"
|
|
922
|
+
})), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("ul", {
|
|
923
|
+
className: "flex justify-center items-center mx-32 relative h-24"
|
|
924
|
+
}, slides.map(function (_, i) {
|
|
925
|
+
return /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("li", {
|
|
926
|
+
key: i
|
|
927
|
+
}, /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("span", {
|
|
928
|
+
className: "ui-slider-marker text-cool-black",
|
|
929
|
+
"data-id": "slider-marker"
|
|
930
|
+
}, "\u2B24"), " ");
|
|
931
|
+
})), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("button", {
|
|
932
|
+
type: "button",
|
|
933
|
+
className: "p-0 w-24 h-24 flex items-center focus:outline-gui-focus",
|
|
934
|
+
"data-id": "slider-next"
|
|
935
|
+
}, /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement(component.default, {
|
|
936
|
+
name: "icon-gui-disclosure-arrow",
|
|
937
|
+
size: "1.5rem",
|
|
938
|
+
color: "text-cool-black",
|
|
939
|
+
"data-id": "meganav-control-mobile-dropdown-menu"
|
|
940
|
+
}))));
|
|
941
|
+
};
|
|
942
|
+
|
|
943
|
+
component_Slider.propTypes = {
|
|
944
|
+
slides: prop_types_default().arrayOf((prop_types_default()).node),
|
|
945
|
+
classes: (prop_types_default()).string,
|
|
946
|
+
slideClasses: (prop_types_default()).string,
|
|
947
|
+
slideMinWidth: (prop_types_default()).string,
|
|
948
|
+
slideMaxWidth: (prop_types_default()).string,
|
|
949
|
+
mqEnableThreshold: (prop_types_default()).func
|
|
950
|
+
};
|
|
951
|
+
/* harmony default export */ const core_Slider_component = (component_Slider);
|
|
952
|
+
})();
|
|
953
|
+
|
|
954
|
+
/******/ return __webpack_exports__;
|
|
955
|
+
/******/ })()
|
|
956
|
+
;
|
|
957
|
+
});
|