@seamly/web-ui 21.0.2-beta.1 → 21.0.2-beta.3
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/build/dist/lib/components.js +182 -109
- package/build/dist/lib/components.min.js +1 -1
- package/build/dist/lib/components.min.js.LICENSE.txt +1 -1
- package/build/dist/lib/hooks.js +27 -27
- package/build/dist/lib/hooks.min.js +1 -1
- package/build/dist/lib/index.debug.js +3 -3
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.js +184 -111
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/index.min.js.LICENSE.txt +1 -1
- package/build/dist/lib/standalone.js +211 -138
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/standalone.min.js.LICENSE.txt +1 -1
- package/build/dist/lib/style-guide.js +184 -111
- package/build/dist/lib/style-guide.min.js +1 -1
- package/build/dist/lib/style-guide.min.js.LICENSE.txt +1 -1
- package/build/dist/lib/utils.js +184 -111
- package/build/dist/lib/utils.min.js +1 -1
- package/build/dist/lib/utils.min.js.LICENSE.txt +1 -1
- package/package.json +1 -1
- package/src/javascripts/api/index.ts +1 -1
|
@@ -117,37 +117,37 @@ module.exports = hoistNonReactStatics;
|
|
|
117
117
|
|
|
118
118
|
__webpack_require__.r(__webpack_exports__);
|
|
119
119
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
120
|
-
/* harmony export */ "Children": () => (/* binding */
|
|
120
|
+
/* harmony export */ "Children": () => (/* binding */ A),
|
|
121
121
|
/* harmony export */ "Component": () => (/* reexport safe */ preact__WEBPACK_IMPORTED_MODULE_0__.Component),
|
|
122
122
|
/* harmony export */ "Fragment": () => (/* reexport safe */ preact__WEBPACK_IMPORTED_MODULE_0__.Fragment),
|
|
123
|
-
/* harmony export */ "PureComponent": () => (/* binding */
|
|
124
|
-
/* harmony export */ "StrictMode": () => (/* binding */
|
|
125
|
-
/* harmony export */ "Suspense": () => (/* binding */
|
|
126
|
-
/* harmony export */ "SuspenseList": () => (/* binding */
|
|
127
|
-
/* harmony export */ "__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED": () => (/* binding */
|
|
128
|
-
/* harmony export */ "cloneElement": () => (/* binding */
|
|
123
|
+
/* harmony export */ "PureComponent": () => (/* binding */ E),
|
|
124
|
+
/* harmony export */ "StrictMode": () => (/* binding */ hn),
|
|
125
|
+
/* harmony export */ "Suspense": () => (/* binding */ U),
|
|
126
|
+
/* harmony export */ "SuspenseList": () => (/* binding */ M),
|
|
127
|
+
/* harmony export */ "__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED": () => (/* binding */ en),
|
|
128
|
+
/* harmony export */ "cloneElement": () => (/* binding */ ln),
|
|
129
129
|
/* harmony export */ "createContext": () => (/* reexport safe */ preact__WEBPACK_IMPORTED_MODULE_0__.createContext),
|
|
130
130
|
/* harmony export */ "createElement": () => (/* reexport safe */ preact__WEBPACK_IMPORTED_MODULE_0__.createElement),
|
|
131
|
-
/* harmony export */ "createFactory": () => (/* binding */
|
|
132
|
-
/* harmony export */ "createPortal": () => (/* binding */
|
|
131
|
+
/* harmony export */ "createFactory": () => (/* binding */ un),
|
|
132
|
+
/* harmony export */ "createPortal": () => (/* binding */ $),
|
|
133
133
|
/* harmony export */ "createRef": () => (/* reexport safe */ preact__WEBPACK_IMPORTED_MODULE_0__.createRef),
|
|
134
|
-
/* harmony export */ "default": () => (/* binding */
|
|
135
|
-
/* harmony export */ "findDOMNode": () => (/* binding */
|
|
136
|
-
/* harmony export */ "flushSync": () => (/* binding */
|
|
137
|
-
/* harmony export */ "forwardRef": () => (/* binding */
|
|
138
|
-
/* harmony export */ "hydrate": () => (/* binding */
|
|
139
|
-
/* harmony export */ "isValidElement": () => (/* binding */
|
|
140
|
-
/* harmony export */ "lazy": () => (/* binding */
|
|
141
|
-
/* harmony export */ "memo": () => (/* binding */
|
|
142
|
-
/* harmony export */ "render": () => (/* binding */
|
|
143
|
-
/* harmony export */ "startTransition": () => (/* binding */
|
|
144
|
-
/* harmony export */ "unmountComponentAtNode": () => (/* binding */
|
|
145
|
-
/* harmony export */ "unstable_batchedUpdates": () => (/* binding */
|
|
146
|
-
/* harmony export */ "useDeferredValue": () => (/* binding */
|
|
147
|
-
/* harmony export */ "useInsertionEffect": () => (/* binding */
|
|
148
|
-
/* harmony export */ "useSyncExternalStore": () => (/* binding */
|
|
149
|
-
/* harmony export */ "useTransition": () => (/* binding */
|
|
150
|
-
/* harmony export */ "version": () => (/* binding */
|
|
134
|
+
/* harmony export */ "default": () => (/* binding */ _n),
|
|
135
|
+
/* harmony export */ "findDOMNode": () => (/* binding */ fn),
|
|
136
|
+
/* harmony export */ "flushSync": () => (/* binding */ sn),
|
|
137
|
+
/* harmony export */ "forwardRef": () => (/* binding */ N),
|
|
138
|
+
/* harmony export */ "hydrate": () => (/* binding */ Y),
|
|
139
|
+
/* harmony export */ "isValidElement": () => (/* binding */ on),
|
|
140
|
+
/* harmony export */ "lazy": () => (/* binding */ F),
|
|
141
|
+
/* harmony export */ "memo": () => (/* binding */ w),
|
|
142
|
+
/* harmony export */ "render": () => (/* binding */ Z),
|
|
143
|
+
/* harmony export */ "startTransition": () => (/* binding */ vn),
|
|
144
|
+
/* harmony export */ "unmountComponentAtNode": () => (/* binding */ cn),
|
|
145
|
+
/* harmony export */ "unstable_batchedUpdates": () => (/* binding */ an),
|
|
146
|
+
/* harmony export */ "useDeferredValue": () => (/* binding */ dn),
|
|
147
|
+
/* harmony export */ "useInsertionEffect": () => (/* binding */ mn),
|
|
148
|
+
/* harmony export */ "useSyncExternalStore": () => (/* binding */ yn),
|
|
149
|
+
/* harmony export */ "useTransition": () => (/* binding */ pn),
|
|
150
|
+
/* harmony export */ "version": () => (/* binding */ rn)
|
|
151
151
|
/* harmony export */ });
|
|
152
152
|
/* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(210);
|
|
153
153
|
/* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(preact__WEBPACK_IMPORTED_MODULE_0__);
|
|
@@ -156,7 +156,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
156
156
|
/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
157
157
|
/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in preact_hooks__WEBPACK_IMPORTED_MODULE_1__) if(["default","Component","Fragment","createContext","createElement","createRef","Children","PureComponent","StrictMode","Suspense","SuspenseList","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","cloneElement","createFactory","createPortal","findDOMNode","flushSync","forwardRef","hydrate","isValidElement","lazy","memo","render","startTransition","unmountComponentAtNode","unstable_batchedUpdates","useDeferredValue","useInsertionEffect","useSyncExternalStore","useTransition","version"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => preact_hooks__WEBPACK_IMPORTED_MODULE_1__[__WEBPACK_IMPORT_KEY__]
|
|
158
158
|
/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
159
|
-
function g(n,t){for(var e in t)n[e]=t[e];return n}function C(n,t){for(var e in n)if("__source"!==e&&!(e in t))return!0;for(var r in t)if("__source"!==r&&n[r]!==t[r])return!0;return!1}function E(n,t){return n===t&&(0!==n||1/n==1/t)||n!=n&&t!=t}function w(n){this.props=n}function R(n,e){function r(n){var t=this.props.ref,r=t==n.ref;return!r&&t&&(t.call?t(null):t.current=null),e?!e(this.props,n)||!r:C(this.props,n)}function u(e){return this.shouldComponentUpdate=r,(0,preact__WEBPACK_IMPORTED_MODULE_0__.createElement)(n,e)}return u.displayName="Memo("+(n.displayName||n.name)+")",u.prototype.isReactComponent=!0,u.__f=!0,u}(w.prototype=new preact__WEBPACK_IMPORTED_MODULE_0__.Component).isPureReactComponent=!0,w.prototype.shouldComponentUpdate=function(n,t){return C(this.props,n)||C(this.state,t)};var x=preact__WEBPACK_IMPORTED_MODULE_0__.options.__b;preact__WEBPACK_IMPORTED_MODULE_0__.options.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),x&&x(n)};var N="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function k(n){function t(t){var e=g({},t);return delete e.ref,n(e,t.ref||null)}return t.$$typeof=N,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(n.displayName||n.name)+")",t}var A=function(n,t){return null==n?null:(0,preact__WEBPACK_IMPORTED_MODULE_0__.toChildArray)((0,preact__WEBPACK_IMPORTED_MODULE_0__.toChildArray)(n).map(t))},O={map:A,forEach:A,count:function(n){return n?(0,preact__WEBPACK_IMPORTED_MODULE_0__.toChildArray)(n).length:0},only:function(n){var t=(0,preact__WEBPACK_IMPORTED_MODULE_0__.toChildArray)(n);if(1!==t.length)throw"Children.only";return t[0]},toArray:preact__WEBPACK_IMPORTED_MODULE_0__.toChildArray},T=preact__WEBPACK_IMPORTED_MODULE_0__.options.__e;preact__WEBPACK_IMPORTED_MODULE_0__.options.__e=function(n,t,e,r){if(n.then)for(var u,o=t;o=o.__;)if((u=o.__c)&&u.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k),u.__c(n,t);T(n,t,e,r)};var I=preact__WEBPACK_IMPORTED_MODULE_0__.options.unmount;function L(n,t,e){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c()}),n.__c.__H=null),null!=(n=g({},n)).__c&&(n.__c.__P===e&&(n.__c.__P=t),n.__c=null),n.__k=n.__k&&n.__k.map(function(n){return L(n,t,e)})),n}function U(n,t,e){return n&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(n){return U(n,t,e)}),n.__c&&n.__c.__P===t&&(n.__e&&e.insertBefore(n.__e,n.__d),n.__c.__e=!0,n.__c.__P=e)),n}function D(){this.__u=0,this.t=null,this.__b=null}function F(n){var t=n.__.__c;return t&&t.__a&&t.__a(n)}function M(n){var e,r,u;function o(o){if(e||(e=n()).then(function(n){r=n.default||n},function(n){u=n}),u)throw u;if(!r)throw e;return (0,preact__WEBPACK_IMPORTED_MODULE_0__.createElement)(r,o)}return o.displayName="Lazy",o.__f=!0,o}function V(){this.u=null,this.o=null}preact__WEBPACK_IMPORTED_MODULE_0__.options.unmount=function(n){var t=n.__c;t&&t.__R&&t.__R(),t&&!0===n.__h&&(n.type=null),I&&I(n)},(D.prototype=new preact__WEBPACK_IMPORTED_MODULE_0__.Component).__c=function(n,t){var e=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(e);var u=F(r.__v),o=!1,i=function(){o||(o=!0,e.__R=null,u?u(l):l())};e.__R=i;var l=function(){if(!--r.__u){if(r.state.__a){var n=r.state.__a;r.__v.__k[0]=U(n,n.__c.__P,n.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate()}},c=!0===t.__h;r.__u++||c||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(i,i)},D.prototype.componentWillUnmount=function(){this.t=[]},D.prototype.render=function(n,e){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=L(this.__b,r,o.__O=o.__P)}this.__b=null}var i=e.__a&&(0,preact__WEBPACK_IMPORTED_MODULE_0__.createElement)(preact__WEBPACK_IMPORTED_MODULE_0__.Fragment,null,n.fallback);return i&&(i.__h=null),[(0,preact__WEBPACK_IMPORTED_MODULE_0__.createElement)(preact__WEBPACK_IMPORTED_MODULE_0__.Fragment,null,e.__a?null:n.children),i]};var W=function(n,t,e){if(++e[1]===e[0]&&n.o.delete(t),n.props.revealOrder&&("t"!==n.props.revealOrder[0]||!n.o.size))for(e=n.u;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;n.u=e=e[2]}};function P(n){return this.getChildContext=function(){return n.context},n.children}function $(n){var e=this,r=n.i;e.componentWillUnmount=function(){(0,preact__WEBPACK_IMPORTED_MODULE_0__.render)(null,e.l),e.l=null,e.i=null},e.i&&e.i!==r&&e.componentWillUnmount(),n.__v?(e.l||(e.i=r,e.l={nodeType:1,parentNode:r,childNodes:[],appendChild:function(n){this.childNodes.push(n),e.i.appendChild(n)},insertBefore:function(n,t){this.childNodes.push(n),e.i.appendChild(n)},removeChild:function(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),e.i.removeChild(n)}}),(0,preact__WEBPACK_IMPORTED_MODULE_0__.render)((0,preact__WEBPACK_IMPORTED_MODULE_0__.createElement)(P,{context:e.context},n.__v),e.l)):e.l&&e.componentWillUnmount()}function j(n,e){var r=(0,preact__WEBPACK_IMPORTED_MODULE_0__.createElement)($,{__v:n,i:e});return r.containerInfo=e,r}(V.prototype=new preact__WEBPACK_IMPORTED_MODULE_0__.Component).__a=function(n){var t=this,e=F(t.__v),r=t.o.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),W(t,n,r)):u()};e?e(o):o()}},V.prototype.render=function(n){this.u=null,this.o=new Map;var t=(0,preact__WEBPACK_IMPORTED_MODULE_0__.toChildArray)(n.children);n.revealOrder&&"b"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.o.set(t[e],this.u=[1,0,this.u]);return n.children},V.prototype.componentDidUpdate=V.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(t,e){W(n,e,t)})};var z="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,B=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,H="undefined"!=typeof document,Z=function(n){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(n)};function Y(n,t,e){return null==t.__k&&(t.textContent=""),(0,preact__WEBPACK_IMPORTED_MODULE_0__.render)(n,t),"function"==typeof e&&e(),n?n.__c:null}function q(n,t,e){return (0,preact__WEBPACK_IMPORTED_MODULE_0__.hydrate)(n,t),"function"==typeof e&&e(),n?n.__c:null}preact__WEBPACK_IMPORTED_MODULE_0__.Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(preact__WEBPACK_IMPORTED_MODULE_0__.Component.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})});var G=preact__WEBPACK_IMPORTED_MODULE_0__.options.event;function J(){}function K(){return this.cancelBubble}function Q(){return this.defaultPrevented}preact__WEBPACK_IMPORTED_MODULE_0__.options.event=function(n){return G&&(n=G(n)),n.persist=J,n.isPropagationStopped=K,n.isDefaultPrevented=Q,n.nativeEvent=n};var X,nn={configurable:!0,get:function(){return this.class}},tn=preact__WEBPACK_IMPORTED_MODULE_0__.options.vnode;preact__WEBPACK_IMPORTED_MODULE_0__.options.vnode=function(n){var t=n.type,e=n.props,u=e;if("string"==typeof t){var o=-1===t.indexOf("-");for(var i in u={},e){var l=e[i];H&&"children"===i&&"noscript"===t||"value"===i&&"defaultValue"in e&&null==l||("defaultValue"===i&&"value"in e&&null==e.value?i="value":"download"===i&&!0===l?l="":/ondoubleclick/i.test(i)?i="ondblclick":/^onchange(textarea|input)/i.test(i+t)&&!Z(e.type)?i="oninput":/^onfocus$/i.test(i)?i="onfocusin":/^onblur$/i.test(i)?i="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(i)?i=i.toLowerCase():o&&B.test(i)?i=i.replace(/[A-Z0-9]/g,"-$&").toLowerCase():null===l&&(l=void 0),/^oninput$/i.test(i)&&(i=i.toLowerCase(),u[i]&&(i="oninputCapture")),u[i]=l)}"select"==t&&u.multiple&&Array.isArray(u.value)&&(u.value=(0,preact__WEBPACK_IMPORTED_MODULE_0__.toChildArray)(e.children).forEach(function(n){n.props.selected=-1!=u.value.indexOf(n.props.value)})),"select"==t&&null!=u.defaultValue&&(u.value=(0,preact__WEBPACK_IMPORTED_MODULE_0__.toChildArray)(e.children).forEach(function(n){n.props.selected=u.multiple?-1!=u.defaultValue.indexOf(n.props.value):u.defaultValue==n.props.value})),n.props=u,e.class!=e.className&&(nn.enumerable="className"in e,null!=e.className&&(u.class=e.className),Object.defineProperty(u,"className",nn))}n.$$typeof=z,tn&&tn(n)};var en=preact__WEBPACK_IMPORTED_MODULE_0__.options.__r;preact__WEBPACK_IMPORTED_MODULE_0__.options.__r=function(n){en&&en(n),X=n.__c};var rn={ReactCurrentDispatcher:{current:{readContext:function(n){return X.__n[n.__c].props.value}}}},un="17.0.2";function on(n){return preact__WEBPACK_IMPORTED_MODULE_0__.createElement.bind(null,n)}function ln(n){return!!n&&n.$$typeof===z}function cn(n){return ln(n)?preact__WEBPACK_IMPORTED_MODULE_0__.cloneElement.apply(null,arguments):n}function fn(n){return!!n.__k&&((0,preact__WEBPACK_IMPORTED_MODULE_0__.render)(null,n),!0)}function an(n){return n&&(n.base||1===n.nodeType&&n)||null}var sn=function(n,t){return n(t)},hn=function(n,t){return n(t)},vn=preact__WEBPACK_IMPORTED_MODULE_0__.Fragment;function dn(n){n()}function pn(n){return n}function mn(){return[!1,dn]}var yn=preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect;function _n(n,t){var e=t(),r=(0,preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useState)({h:{__:e,v:t}}),u=r[0].h,o=r[1];return (0,preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect)(function(){u.__=e,u.v=t,E(u.__,t())||o({h:u})},[n,e,t]),(0,preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function(){return E(u.__,u.v())||o({h:u}),n(function(){E(u.__,u.v())||o({h:u})})},[n]),e}var bn={useState:preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useState,useId:preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useId,useReducer:preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useReducer,useEffect:preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useEffect,useLayoutEffect:preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect,useInsertionEffect:yn,useTransition:mn,useDeferredValue:pn,useSyncExternalStore:_n,startTransition:dn,useRef:preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useRef,useImperativeHandle:preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useImperativeHandle,useMemo:preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useMemo,useCallback:preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useCallback,useContext:preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useContext,useDebugValue:preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useDebugValue,version:"17.0.2",Children:O,render:Y,hydrate:q,unmountComponentAtNode:fn,createPortal:j,createElement:preact__WEBPACK_IMPORTED_MODULE_0__.createElement,createContext:preact__WEBPACK_IMPORTED_MODULE_0__.createContext,createFactory:on,cloneElement:cn,createRef:preact__WEBPACK_IMPORTED_MODULE_0__.createRef,Fragment:preact__WEBPACK_IMPORTED_MODULE_0__.Fragment,isValidElement:ln,findDOMNode:an,Component:preact__WEBPACK_IMPORTED_MODULE_0__.Component,PureComponent:w,memo:R,forwardRef:k,flushSync:hn,unstable_batchedUpdates:sn,StrictMode:vn,Suspense:D,SuspenseList:V,lazy:M,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:rn};
|
|
159
|
+
function g(n,t){for(var e in t)n[e]=t[e];return n}function C(n,t){for(var e in n)if("__source"!==e&&!(e in t))return!0;for(var r in t)if("__source"!==r&&n[r]!==t[r])return!0;return!1}function E(n){this.props=n}function w(n,e){function r(n){var t=this.props.ref,r=t==n.ref;return!r&&t&&(t.call?t(null):t.current=null),e?!e(this.props,n)||!r:C(this.props,n)}function u(e){return this.shouldComponentUpdate=r,(0,preact__WEBPACK_IMPORTED_MODULE_0__.createElement)(n,e)}return u.displayName="Memo("+(n.displayName||n.name)+")",u.prototype.isReactComponent=!0,u.__f=!0,u}(E.prototype=new preact__WEBPACK_IMPORTED_MODULE_0__.Component).isPureReactComponent=!0,E.prototype.shouldComponentUpdate=function(n,t){return C(this.props,n)||C(this.state,t)};var R=preact__WEBPACK_IMPORTED_MODULE_0__.options.__b;preact__WEBPACK_IMPORTED_MODULE_0__.options.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),R&&R(n)};var x="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function N(n){function t(t){var e=g({},t);return delete e.ref,n(e,t.ref||null)}return t.$$typeof=x,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(n.displayName||n.name)+")",t}var k=function(n,t){return null==n?null:(0,preact__WEBPACK_IMPORTED_MODULE_0__.toChildArray)((0,preact__WEBPACK_IMPORTED_MODULE_0__.toChildArray)(n).map(t))},A={map:k,forEach:k,count:function(n){return n?(0,preact__WEBPACK_IMPORTED_MODULE_0__.toChildArray)(n).length:0},only:function(n){var t=(0,preact__WEBPACK_IMPORTED_MODULE_0__.toChildArray)(n);if(1!==t.length)throw"Children.only";return t[0]},toArray:preact__WEBPACK_IMPORTED_MODULE_0__.toChildArray},O=preact__WEBPACK_IMPORTED_MODULE_0__.options.__e;preact__WEBPACK_IMPORTED_MODULE_0__.options.__e=function(n,t,e,r){if(n.then)for(var u,o=t;o=o.__;)if((u=o.__c)&&u.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k),u.__c(n,t);O(n,t,e,r)};var T=preact__WEBPACK_IMPORTED_MODULE_0__.options.unmount;function I(n,t,e){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c()}),n.__c.__H=null),null!=(n=g({},n)).__c&&(n.__c.__P===e&&(n.__c.__P=t),n.__c=null),n.__k=n.__k&&n.__k.map(function(n){return I(n,t,e)})),n}function L(n,t,e){return n&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(n){return L(n,t,e)}),n.__c&&n.__c.__P===t&&(n.__e&&e.insertBefore(n.__e,n.__d),n.__c.__e=!0,n.__c.__P=e)),n}function U(){this.__u=0,this.t=null,this.__b=null}function D(n){var t=n.__.__c;return t&&t.__a&&t.__a(n)}function F(n){var e,r,u;function o(o){if(e||(e=n()).then(function(n){r=n.default||n},function(n){u=n}),u)throw u;if(!r)throw e;return (0,preact__WEBPACK_IMPORTED_MODULE_0__.createElement)(r,o)}return o.displayName="Lazy",o.__f=!0,o}function M(){this.u=null,this.o=null}preact__WEBPACK_IMPORTED_MODULE_0__.options.unmount=function(n){var t=n.__c;t&&t.__R&&t.__R(),t&&!0===n.__h&&(n.type=null),T&&T(n)},(U.prototype=new preact__WEBPACK_IMPORTED_MODULE_0__.Component).__c=function(n,t){var e=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(e);var u=D(r.__v),o=!1,i=function(){o||(o=!0,e.__R=null,u?u(l):l())};e.__R=i;var l=function(){if(!--r.__u){if(r.state.__a){var n=r.state.__a;r.__v.__k[0]=L(n,n.__c.__P,n.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate()}},c=!0===t.__h;r.__u++||c||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(i,i)},U.prototype.componentWillUnmount=function(){this.t=[]},U.prototype.render=function(n,e){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=I(this.__b,r,o.__O=o.__P)}this.__b=null}var i=e.__a&&(0,preact__WEBPACK_IMPORTED_MODULE_0__.createElement)(preact__WEBPACK_IMPORTED_MODULE_0__.Fragment,null,n.fallback);return i&&(i.__h=null),[(0,preact__WEBPACK_IMPORTED_MODULE_0__.createElement)(preact__WEBPACK_IMPORTED_MODULE_0__.Fragment,null,e.__a?null:n.children),i]};var V=function(n,t,e){if(++e[1]===e[0]&&n.o.delete(t),n.props.revealOrder&&("t"!==n.props.revealOrder[0]||!n.o.size))for(e=n.u;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;n.u=e=e[2]}};function W(n){return this.getChildContext=function(){return n.context},n.children}function P(n){var e=this,r=n.i;e.componentWillUnmount=function(){(0,preact__WEBPACK_IMPORTED_MODULE_0__.render)(null,e.l),e.l=null,e.i=null},e.i&&e.i!==r&&e.componentWillUnmount(),n.__v?(e.l||(e.i=r,e.l={nodeType:1,parentNode:r,childNodes:[],appendChild:function(n){this.childNodes.push(n),e.i.appendChild(n)},insertBefore:function(n,t){this.childNodes.push(n),e.i.appendChild(n)},removeChild:function(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),e.i.removeChild(n)}}),(0,preact__WEBPACK_IMPORTED_MODULE_0__.render)((0,preact__WEBPACK_IMPORTED_MODULE_0__.createElement)(W,{context:e.context},n.__v),e.l)):e.l&&e.componentWillUnmount()}function $(n,e){var r=(0,preact__WEBPACK_IMPORTED_MODULE_0__.createElement)(P,{__v:n,i:e});return r.containerInfo=e,r}(M.prototype=new preact__WEBPACK_IMPORTED_MODULE_0__.Component).__a=function(n){var t=this,e=D(t.__v),r=t.o.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),V(t,n,r)):u()};e?e(o):o()}},M.prototype.render=function(n){this.u=null,this.o=new Map;var t=(0,preact__WEBPACK_IMPORTED_MODULE_0__.toChildArray)(n.children);n.revealOrder&&"b"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.o.set(t[e],this.u=[1,0,this.u]);return n.children},M.prototype.componentDidUpdate=M.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(t,e){V(n,e,t)})};var j="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,z=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,B="undefined"!=typeof document,H=function(n){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(n)};function Z(n,t,e){return null==t.__k&&(t.textContent=""),(0,preact__WEBPACK_IMPORTED_MODULE_0__.render)(n,t),"function"==typeof e&&e(),n?n.__c:null}function Y(n,t,e){return (0,preact__WEBPACK_IMPORTED_MODULE_0__.hydrate)(n,t),"function"==typeof e&&e(),n?n.__c:null}preact__WEBPACK_IMPORTED_MODULE_0__.Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(preact__WEBPACK_IMPORTED_MODULE_0__.Component.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})});var q=preact__WEBPACK_IMPORTED_MODULE_0__.options.event;function G(){}function J(){return this.cancelBubble}function K(){return this.defaultPrevented}preact__WEBPACK_IMPORTED_MODULE_0__.options.event=function(n){return q&&(n=q(n)),n.persist=G,n.isPropagationStopped=J,n.isDefaultPrevented=K,n.nativeEvent=n};var Q,X={configurable:!0,get:function(){return this.class}},nn=preact__WEBPACK_IMPORTED_MODULE_0__.options.vnode;preact__WEBPACK_IMPORTED_MODULE_0__.options.vnode=function(n){var t=n.type,e=n.props,u=e;if("string"==typeof t){var o=-1===t.indexOf("-");for(var i in u={},e){var l=e[i];B&&"children"===i&&"noscript"===t||"value"===i&&"defaultValue"in e&&null==l||("defaultValue"===i&&"value"in e&&null==e.value?i="value":"download"===i&&!0===l?l="":/ondoubleclick/i.test(i)?i="ondblclick":/^onchange(textarea|input)/i.test(i+t)&&!H(e.type)?i="oninput":/^onfocus$/i.test(i)?i="onfocusin":/^onblur$/i.test(i)?i="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(i)?i=i.toLowerCase():o&&z.test(i)?i=i.replace(/[A-Z0-9]/g,"-$&").toLowerCase():null===l&&(l=void 0),/^oninput$/i.test(i)&&(i=i.toLowerCase(),u[i]&&(i="oninputCapture")),u[i]=l)}"select"==t&&u.multiple&&Array.isArray(u.value)&&(u.value=(0,preact__WEBPACK_IMPORTED_MODULE_0__.toChildArray)(e.children).forEach(function(n){n.props.selected=-1!=u.value.indexOf(n.props.value)})),"select"==t&&null!=u.defaultValue&&(u.value=(0,preact__WEBPACK_IMPORTED_MODULE_0__.toChildArray)(e.children).forEach(function(n){n.props.selected=u.multiple?-1!=u.defaultValue.indexOf(n.props.value):u.defaultValue==n.props.value})),n.props=u,e.class!=e.className&&(X.enumerable="className"in e,null!=e.className&&(u.class=e.className),Object.defineProperty(u,"className",X))}n.$$typeof=j,nn&&nn(n)};var tn=preact__WEBPACK_IMPORTED_MODULE_0__.options.__r;preact__WEBPACK_IMPORTED_MODULE_0__.options.__r=function(n){tn&&tn(n),Q=n.__c};var en={ReactCurrentDispatcher:{current:{readContext:function(n){return Q.__n[n.__c].props.value}}}},rn="17.0.2";function un(n){return preact__WEBPACK_IMPORTED_MODULE_0__.createElement.bind(null,n)}function on(n){return!!n&&n.$$typeof===j}function ln(n){return on(n)?preact__WEBPACK_IMPORTED_MODULE_0__.cloneElement.apply(null,arguments):n}function cn(n){return!!n.__k&&((0,preact__WEBPACK_IMPORTED_MODULE_0__.render)(null,n),!0)}function fn(n){return n&&(n.base||1===n.nodeType&&n)||null}var an=function(n,t){return n(t)},sn=function(n,t){return n(t)},hn=preact__WEBPACK_IMPORTED_MODULE_0__.Fragment;function vn(n){n()}function dn(n){return n}function pn(){return[!1,vn]}var mn=preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect;function yn(n,t){var e=t(),r=(0,preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useState)({h:{__:e,v:t}}),u=r[0].h,o=r[1];return (0,preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect)(function(){u.__=e,u.v=t,u.__!==t()&&o({h:u})},[n,e,t]),(0,preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function(){return u.__!==u.v()&&o({h:u}),n(function(){u.__!==u.v()&&o({h:u})})},[n]),e}var _n={useState:preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useState,useId:preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useId,useReducer:preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useReducer,useEffect:preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useEffect,useLayoutEffect:preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect,useInsertionEffect:mn,useTransition:pn,useDeferredValue:dn,useSyncExternalStore:yn,startTransition:vn,useRef:preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useRef,useImperativeHandle:preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useImperativeHandle,useMemo:preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useMemo,useCallback:preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useCallback,useContext:preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useContext,useDebugValue:preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useDebugValue,version:"17.0.2",Children:A,render:Z,hydrate:Y,unmountComponentAtNode:cn,createPortal:$,createElement:preact__WEBPACK_IMPORTED_MODULE_0__.createElement,createContext:preact__WEBPACK_IMPORTED_MODULE_0__.createContext,createFactory:un,cloneElement:ln,createRef:preact__WEBPACK_IMPORTED_MODULE_0__.createRef,Fragment:preact__WEBPACK_IMPORTED_MODULE_0__.Fragment,isValidElement:on,findDOMNode:fn,Component:preact__WEBPACK_IMPORTED_MODULE_0__.Component,PureComponent:E,memo:w,forwardRef:N,flushSync:sn,unstable_batchedUpdates:an,StrictMode:hn,Suspense:U,SuspenseList:M,lazy:F,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:en};
|
|
160
160
|
//# sourceMappingURL=compat.module.js.map
|
|
161
161
|
|
|
162
162
|
|
|
@@ -9847,21 +9847,24 @@ var isFocusable = function isFocusable(node, options) {
|
|
|
9847
9847
|
|
|
9848
9848
|
;// CONCATENATED MODULE: ./node_modules/focus-trap/dist/focus-trap.esm.js
|
|
9849
9849
|
/*!
|
|
9850
|
-
* focus-trap 7.
|
|
9850
|
+
* focus-trap 7.0.0
|
|
9851
9851
|
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
9852
9852
|
*/
|
|
9853
9853
|
|
|
9854
9854
|
|
|
9855
9855
|
function focus_trap_esm_ownKeys(object, enumerableOnly) {
|
|
9856
9856
|
var keys = Object.keys(object);
|
|
9857
|
+
|
|
9857
9858
|
if (Object.getOwnPropertySymbols) {
|
|
9858
9859
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
9859
9860
|
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
9860
9861
|
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
9861
9862
|
})), keys.push.apply(keys, symbols);
|
|
9862
9863
|
}
|
|
9864
|
+
|
|
9863
9865
|
return keys;
|
|
9864
9866
|
}
|
|
9867
|
+
|
|
9865
9868
|
function _objectSpread2(target) {
|
|
9866
9869
|
for (var i = 1; i < arguments.length; i++) {
|
|
9867
9870
|
var source = null != arguments[i] ? arguments[i] : {};
|
|
@@ -9871,8 +9874,10 @@ function _objectSpread2(target) {
|
|
|
9871
9874
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
9872
9875
|
});
|
|
9873
9876
|
}
|
|
9877
|
+
|
|
9874
9878
|
return target;
|
|
9875
9879
|
}
|
|
9880
|
+
|
|
9876
9881
|
function focus_trap_esm_defineProperty(obj, key, value) {
|
|
9877
9882
|
if (key in obj) {
|
|
9878
9883
|
Object.defineProperty(obj, key, {
|
|
@@ -9884,52 +9889,64 @@ function focus_trap_esm_defineProperty(obj, key, value) {
|
|
|
9884
9889
|
} else {
|
|
9885
9890
|
obj[key] = value;
|
|
9886
9891
|
}
|
|
9892
|
+
|
|
9887
9893
|
return obj;
|
|
9888
9894
|
}
|
|
9889
9895
|
|
|
9890
|
-
var
|
|
9891
|
-
var
|
|
9892
|
-
|
|
9893
|
-
|
|
9894
|
-
|
|
9895
|
-
|
|
9896
|
-
|
|
9896
|
+
var activeFocusTraps = function () {
|
|
9897
|
+
var trapQueue = [];
|
|
9898
|
+
return {
|
|
9899
|
+
activateTrap: function activateTrap(trap) {
|
|
9900
|
+
if (trapQueue.length > 0) {
|
|
9901
|
+
var activeTrap = trapQueue[trapQueue.length - 1];
|
|
9902
|
+
|
|
9903
|
+
if (activeTrap !== trap) {
|
|
9904
|
+
activeTrap.pause();
|
|
9905
|
+
}
|
|
9906
|
+
}
|
|
9907
|
+
|
|
9908
|
+
var trapIndex = trapQueue.indexOf(trap);
|
|
9909
|
+
|
|
9910
|
+
if (trapIndex === -1) {
|
|
9911
|
+
trapQueue.push(trap);
|
|
9912
|
+
} else {
|
|
9913
|
+
// move this existing trap to the front of the queue
|
|
9914
|
+
trapQueue.splice(trapIndex, 1);
|
|
9915
|
+
trapQueue.push(trap);
|
|
9916
|
+
}
|
|
9917
|
+
},
|
|
9918
|
+
deactivateTrap: function deactivateTrap(trap) {
|
|
9919
|
+
var trapIndex = trapQueue.indexOf(trap);
|
|
9920
|
+
|
|
9921
|
+
if (trapIndex !== -1) {
|
|
9922
|
+
trapQueue.splice(trapIndex, 1);
|
|
9923
|
+
}
|
|
9924
|
+
|
|
9925
|
+
if (trapQueue.length > 0) {
|
|
9926
|
+
trapQueue[trapQueue.length - 1].unpause();
|
|
9897
9927
|
}
|
|
9898
9928
|
}
|
|
9899
|
-
|
|
9900
|
-
|
|
9901
|
-
|
|
9902
|
-
} else {
|
|
9903
|
-
// move this existing trap to the front of the queue
|
|
9904
|
-
trapStack.splice(trapIndex, 1);
|
|
9905
|
-
trapStack.push(trap);
|
|
9906
|
-
}
|
|
9907
|
-
},
|
|
9908
|
-
deactivateTrap: function deactivateTrap(trapStack, trap) {
|
|
9909
|
-
var trapIndex = trapStack.indexOf(trap);
|
|
9910
|
-
if (trapIndex !== -1) {
|
|
9911
|
-
trapStack.splice(trapIndex, 1);
|
|
9912
|
-
}
|
|
9913
|
-
if (trapStack.length > 0) {
|
|
9914
|
-
trapStack[trapStack.length - 1].unpause();
|
|
9915
|
-
}
|
|
9916
|
-
}
|
|
9917
|
-
};
|
|
9929
|
+
};
|
|
9930
|
+
}();
|
|
9931
|
+
|
|
9918
9932
|
var isSelectableInput = function isSelectableInput(node) {
|
|
9919
9933
|
return node.tagName && node.tagName.toLowerCase() === 'input' && typeof node.select === 'function';
|
|
9920
9934
|
};
|
|
9935
|
+
|
|
9921
9936
|
var isEscapeEvent = function isEscapeEvent(e) {
|
|
9922
9937
|
return e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27;
|
|
9923
9938
|
};
|
|
9939
|
+
|
|
9924
9940
|
var isTabEvent = function isTabEvent(e) {
|
|
9925
9941
|
return e.key === 'Tab' || e.keyCode === 9;
|
|
9926
9942
|
};
|
|
9943
|
+
|
|
9927
9944
|
var delay = function delay(fn) {
|
|
9928
9945
|
return setTimeout(fn, 0);
|
|
9929
|
-
};
|
|
9930
|
-
|
|
9931
|
-
// Array.find/findIndex() are not supported on IE; this replicates enough
|
|
9946
|
+
}; // Array.find/findIndex() are not supported on IE; this replicates enough
|
|
9932
9947
|
// of Array.findIndex() for our needs
|
|
9948
|
+
|
|
9949
|
+
|
|
9933
9950
|
var findIndex = function findIndex(arr, fn) {
|
|
9934
9951
|
var idx = -1;
|
|
9935
9952
|
arr.every(function (value, i) {
|
|
@@ -9940,10 +9957,8 @@ var findIndex = function findIndex(arr, fn) {
|
|
|
9940
9957
|
|
|
9941
9958
|
return true; // next
|
|
9942
9959
|
});
|
|
9943
|
-
|
|
9944
9960
|
return idx;
|
|
9945
9961
|
};
|
|
9946
|
-
|
|
9947
9962
|
/**
|
|
9948
9963
|
* Get an option's value when it could be a plain value, or a handler that provides
|
|
9949
9964
|
* the value.
|
|
@@ -9951,12 +9966,16 @@ var findIndex = function findIndex(arr, fn) {
|
|
|
9951
9966
|
* @param {...*} [params] Any parameters to pass to the handler, if `value` is a function.
|
|
9952
9967
|
* @returns {*} The `value`, or the handler's returned value.
|
|
9953
9968
|
*/
|
|
9969
|
+
|
|
9970
|
+
|
|
9954
9971
|
var valueOrHandler = function valueOrHandler(value) {
|
|
9955
9972
|
for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
9956
9973
|
params[_key - 1] = arguments[_key];
|
|
9957
9974
|
}
|
|
9975
|
+
|
|
9958
9976
|
return typeof value === 'function' ? value.apply(void 0, params) : value;
|
|
9959
9977
|
};
|
|
9978
|
+
|
|
9960
9979
|
var getActualTarget = function getActualTarget(event) {
|
|
9961
9980
|
// NOTE: If the trap is _inside_ a shadow DOM, event.target will always be the
|
|
9962
9981
|
// shadow host. However, event.target.composedPath() will be an array of
|
|
@@ -9967,16 +9986,18 @@ var getActualTarget = function getActualTarget(event) {
|
|
|
9967
9986
|
// composedPath()[0] === event.target always).
|
|
9968
9987
|
return event.target.shadowRoot && typeof event.composedPath === 'function' ? event.composedPath()[0] : event.target;
|
|
9969
9988
|
};
|
|
9989
|
+
|
|
9970
9990
|
var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
9971
9991
|
// SSR: a live trap shouldn't be created in this type of environment so this
|
|
9972
9992
|
// should be safe code to execute if the `document` option isn't specified
|
|
9973
9993
|
var doc = (userOptions === null || userOptions === void 0 ? void 0 : userOptions.document) || document;
|
|
9974
|
-
|
|
9994
|
+
|
|
9975
9995
|
var config = _objectSpread2({
|
|
9976
9996
|
returnFocusOnDeactivate: true,
|
|
9977
9997
|
escapeDeactivates: true,
|
|
9978
9998
|
delayInitialFocus: true
|
|
9979
9999
|
}, userOptions);
|
|
10000
|
+
|
|
9980
10001
|
var state = {
|
|
9981
10002
|
// containers given to createFocusTrap()
|
|
9982
10003
|
// @type {Array<HTMLElement>}
|
|
@@ -9996,7 +10017,6 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
9996
10017
|
// }>}
|
|
9997
10018
|
containerGroups: [],
|
|
9998
10019
|
// same order/length as `containers` list
|
|
9999
|
-
|
|
10000
10020
|
// references to objects in `containerGroups`, but only those that actually have
|
|
10001
10021
|
// tabbable nodes in them
|
|
10002
10022
|
// NOTE: same order as `containers` and `containerGroups`, but __not necessarily__
|
|
@@ -10020,10 +10040,10 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
10020
10040
|
* @param {string|undefined} [configOptionName] Name of option to use __instead of__ `optionName`
|
|
10021
10041
|
* IIF `configOverrideOptions` is not defined. Otherwise, `optionName` is used.
|
|
10022
10042
|
*/
|
|
10043
|
+
|
|
10023
10044
|
var getOption = function getOption(configOverrideOptions, optionName, configOptionName) {
|
|
10024
10045
|
return configOverrideOptions && configOverrideOptions[optionName] !== undefined ? configOverrideOptions[optionName] : config[configOptionName || optionName];
|
|
10025
10046
|
};
|
|
10026
|
-
|
|
10027
10047
|
/**
|
|
10028
10048
|
* Finds the index of the container that contains the element.
|
|
10029
10049
|
* @param {HTMLElement} element
|
|
@@ -10031,15 +10051,16 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
10031
10051
|
* `state.containerGroups` (the order/length of these lists are the same); -1
|
|
10032
10052
|
* if the element isn't found.
|
|
10033
10053
|
*/
|
|
10054
|
+
|
|
10055
|
+
|
|
10034
10056
|
var findContainerIndex = function findContainerIndex(element) {
|
|
10035
10057
|
// NOTE: search `containerGroups` because it's possible a group contains no tabbable
|
|
10036
10058
|
// nodes, but still contains focusable nodes (e.g. if they all have `tabindex=-1`)
|
|
10037
10059
|
// and we still need to find the element in there
|
|
10038
10060
|
return state.containerGroups.findIndex(function (_ref) {
|
|
10039
10061
|
var container = _ref.container,
|
|
10040
|
-
|
|
10041
|
-
return container.contains(element) ||
|
|
10042
|
-
// fall back to explicit tabbable search which will take into consideration any
|
|
10062
|
+
tabbableNodes = _ref.tabbableNodes;
|
|
10063
|
+
return container.contains(element) || // fall back to explicit tabbable search which will take into consideration any
|
|
10043
10064
|
// web components if the `tabbableOptions.getShadowRoot` option was used for
|
|
10044
10065
|
// the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't
|
|
10045
10066
|
// look inside web components even if open)
|
|
@@ -10048,7 +10069,6 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
10048
10069
|
});
|
|
10049
10070
|
});
|
|
10050
10071
|
};
|
|
10051
|
-
|
|
10052
10072
|
/**
|
|
10053
10073
|
* Gets the node for the given option, which is expected to be an option that
|
|
10054
10074
|
* can be either a DOM node, a string that is a selector to get a node, `false`
|
|
@@ -10062,14 +10082,19 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
10062
10082
|
* @throws {Error} If the option is set, not `false`, and is not, or does not
|
|
10063
10083
|
* resolve to a node.
|
|
10064
10084
|
*/
|
|
10085
|
+
|
|
10086
|
+
|
|
10065
10087
|
var getNodeForOption = function getNodeForOption(optionName) {
|
|
10066
10088
|
var optionValue = config[optionName];
|
|
10089
|
+
|
|
10067
10090
|
if (typeof optionValue === 'function') {
|
|
10068
10091
|
for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
10069
10092
|
params[_key2 - 1] = arguments[_key2];
|
|
10070
10093
|
}
|
|
10094
|
+
|
|
10071
10095
|
optionValue = optionValue.apply(void 0, params);
|
|
10072
10096
|
}
|
|
10097
|
+
|
|
10073
10098
|
if (optionValue === true) {
|
|
10074
10099
|
optionValue = undefined; // use default value
|
|
10075
10100
|
}
|
|
@@ -10077,51 +10102,56 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
10077
10102
|
if (!optionValue) {
|
|
10078
10103
|
if (optionValue === undefined || optionValue === false) {
|
|
10079
10104
|
return optionValue;
|
|
10080
|
-
}
|
|
10081
|
-
|
|
10105
|
+
} // else, empty string (invalid), null (invalid), 0 (invalid)
|
|
10106
|
+
|
|
10082
10107
|
|
|
10083
10108
|
throw new Error("`".concat(optionName, "` was specified but was not a node, or did not return a node"));
|
|
10084
10109
|
}
|
|
10110
|
+
|
|
10085
10111
|
var node = optionValue; // could be HTMLElement, SVGElement, or non-empty string at this point
|
|
10086
10112
|
|
|
10087
10113
|
if (typeof optionValue === 'string') {
|
|
10088
10114
|
node = doc.querySelector(optionValue); // resolve to node, or null if fails
|
|
10115
|
+
|
|
10089
10116
|
if (!node) {
|
|
10090
10117
|
throw new Error("`".concat(optionName, "` as selector refers to no known node"));
|
|
10091
10118
|
}
|
|
10092
10119
|
}
|
|
10120
|
+
|
|
10093
10121
|
return node;
|
|
10094
10122
|
};
|
|
10123
|
+
|
|
10095
10124
|
var getInitialFocusNode = function getInitialFocusNode() {
|
|
10096
|
-
var node = getNodeForOption('initialFocus');
|
|
10125
|
+
var node = getNodeForOption('initialFocus'); // false explicitly indicates we want no initialFocus at all
|
|
10097
10126
|
|
|
10098
|
-
// false explicitly indicates we want no initialFocus at all
|
|
10099
10127
|
if (node === false) {
|
|
10100
10128
|
return false;
|
|
10101
10129
|
}
|
|
10130
|
+
|
|
10102
10131
|
if (node === undefined) {
|
|
10103
10132
|
// option not specified: use fallback options
|
|
10104
10133
|
if (findContainerIndex(doc.activeElement) >= 0) {
|
|
10105
10134
|
node = doc.activeElement;
|
|
10106
10135
|
} else {
|
|
10107
10136
|
var firstTabbableGroup = state.tabbableGroups[0];
|
|
10108
|
-
var firstTabbableNode = firstTabbableGroup && firstTabbableGroup.firstTabbableNode;
|
|
10137
|
+
var firstTabbableNode = firstTabbableGroup && firstTabbableGroup.firstTabbableNode; // NOTE: `fallbackFocus` option function cannot return `false` (not supported)
|
|
10109
10138
|
|
|
10110
|
-
// NOTE: `fallbackFocus` option function cannot return `false` (not supported)
|
|
10111
10139
|
node = firstTabbableNode || getNodeForOption('fallbackFocus');
|
|
10112
10140
|
}
|
|
10113
10141
|
}
|
|
10142
|
+
|
|
10114
10143
|
if (!node) {
|
|
10115
10144
|
throw new Error('Your focus-trap needs to have at least one focusable element');
|
|
10116
10145
|
}
|
|
10146
|
+
|
|
10117
10147
|
return node;
|
|
10118
10148
|
};
|
|
10149
|
+
|
|
10119
10150
|
var updateTabbableNodes = function updateTabbableNodes() {
|
|
10120
10151
|
state.containerGroups = state.containers.map(function (container) {
|
|
10121
|
-
var tabbableNodes = tabbable(container, config.tabbableOptions);
|
|
10122
|
-
|
|
10123
|
-
// NOTE: if we have tabbable nodes, we must have focusable nodes; focusable nodes
|
|
10152
|
+
var tabbableNodes = tabbable(container, config.tabbableOptions); // NOTE: if we have tabbable nodes, we must have focusable nodes; focusable nodes
|
|
10124
10153
|
// are a superset of tabbable nodes
|
|
10154
|
+
|
|
10125
10155
|
var focusableNodes = focusable(container, config.tabbableOptions);
|
|
10126
10156
|
return {
|
|
10127
10157
|
container: container,
|
|
@@ -10129,6 +10159,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
10129
10159
|
focusableNodes: focusableNodes,
|
|
10130
10160
|
firstTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[0] : null,
|
|
10131
10161
|
lastTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[tabbableNodes.length - 1] : null,
|
|
10162
|
+
|
|
10132
10163
|
/**
|
|
10133
10164
|
* Finds the __tabbable__ node that follows the given node in the specified direction,
|
|
10134
10165
|
* in this container, if any.
|
|
@@ -10152,14 +10183,17 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
10152
10183
|
var nodeIdx = focusableNodes.findIndex(function (n) {
|
|
10153
10184
|
return n === node;
|
|
10154
10185
|
});
|
|
10186
|
+
|
|
10155
10187
|
if (nodeIdx < 0) {
|
|
10156
10188
|
return undefined;
|
|
10157
10189
|
}
|
|
10190
|
+
|
|
10158
10191
|
if (forward) {
|
|
10159
10192
|
return focusableNodes.slice(nodeIdx + 1).find(function (n) {
|
|
10160
10193
|
return isTabbable(n, config.tabbableOptions);
|
|
10161
10194
|
});
|
|
10162
10195
|
}
|
|
10196
|
+
|
|
10163
10197
|
return focusableNodes.slice(0, nodeIdx).reverse().find(function (n) {
|
|
10164
10198
|
return isTabbable(n, config.tabbableOptions);
|
|
10165
10199
|
});
|
|
@@ -10168,46 +10202,53 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
10168
10202
|
});
|
|
10169
10203
|
state.tabbableGroups = state.containerGroups.filter(function (group) {
|
|
10170
10204
|
return group.tabbableNodes.length > 0;
|
|
10171
|
-
});
|
|
10205
|
+
}); // throw if no groups have tabbable nodes and we don't have a fallback focus node either
|
|
10172
10206
|
|
|
10173
|
-
// throw if no groups have tabbable nodes and we don't have a fallback focus node either
|
|
10174
10207
|
if (state.tabbableGroups.length <= 0 && !getNodeForOption('fallbackFocus') // returning false not supported for this option
|
|
10175
10208
|
) {
|
|
10176
10209
|
throw new Error('Your focus-trap must have at least one container with at least one tabbable node in it at all times');
|
|
10177
10210
|
}
|
|
10178
10211
|
};
|
|
10212
|
+
|
|
10179
10213
|
var tryFocus = function tryFocus(node) {
|
|
10180
10214
|
if (node === false) {
|
|
10181
10215
|
return;
|
|
10182
10216
|
}
|
|
10217
|
+
|
|
10183
10218
|
if (node === doc.activeElement) {
|
|
10184
10219
|
return;
|
|
10185
10220
|
}
|
|
10221
|
+
|
|
10186
10222
|
if (!node || !node.focus) {
|
|
10187
10223
|
tryFocus(getInitialFocusNode());
|
|
10188
10224
|
return;
|
|
10189
10225
|
}
|
|
10226
|
+
|
|
10190
10227
|
node.focus({
|
|
10191
10228
|
preventScroll: !!config.preventScroll
|
|
10192
10229
|
});
|
|
10193
10230
|
state.mostRecentlyFocusedNode = node;
|
|
10231
|
+
|
|
10194
10232
|
if (isSelectableInput(node)) {
|
|
10195
10233
|
node.select();
|
|
10196
10234
|
}
|
|
10197
10235
|
};
|
|
10236
|
+
|
|
10198
10237
|
var getReturnFocusNode = function getReturnFocusNode(previousActiveElement) {
|
|
10199
10238
|
var node = getNodeForOption('setReturnFocus', previousActiveElement);
|
|
10200
10239
|
return node ? node : node === false ? false : previousActiveElement;
|
|
10201
|
-
};
|
|
10202
|
-
|
|
10203
|
-
// This needs to be done on mousedown and touchstart instead of click
|
|
10240
|
+
}; // This needs to be done on mousedown and touchstart instead of click
|
|
10204
10241
|
// so that it precedes the focus event.
|
|
10242
|
+
|
|
10243
|
+
|
|
10205
10244
|
var checkPointerDown = function checkPointerDown(e) {
|
|
10206
10245
|
var target = getActualTarget(e);
|
|
10246
|
+
|
|
10207
10247
|
if (findContainerIndex(target) >= 0) {
|
|
10208
10248
|
// allow the click since it ocurred inside the trap
|
|
10209
10249
|
return;
|
|
10210
10250
|
}
|
|
10251
|
+
|
|
10211
10252
|
if (valueOrHandler(config.clickOutsideDeactivates, e)) {
|
|
10212
10253
|
// immediately deactivate the trap
|
|
10213
10254
|
trap.deactivate({
|
|
@@ -10225,26 +10266,25 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
10225
10266
|
returnFocus: config.returnFocusOnDeactivate && !isFocusable(target, config.tabbableOptions)
|
|
10226
10267
|
});
|
|
10227
10268
|
return;
|
|
10228
|
-
}
|
|
10229
|
-
|
|
10230
|
-
// This is needed for mobile devices.
|
|
10269
|
+
} // This is needed for mobile devices.
|
|
10231
10270
|
// (If we'll only let `click` events through,
|
|
10232
10271
|
// then on mobile they will be blocked anyways if `touchstart` is blocked.)
|
|
10272
|
+
|
|
10273
|
+
|
|
10233
10274
|
if (valueOrHandler(config.allowOutsideClick, e)) {
|
|
10234
10275
|
// allow the click outside the trap to take place
|
|
10235
10276
|
return;
|
|
10236
|
-
}
|
|
10277
|
+
} // otherwise, prevent the click
|
|
10278
|
+
|
|
10237
10279
|
|
|
10238
|
-
// otherwise, prevent the click
|
|
10239
10280
|
e.preventDefault();
|
|
10240
|
-
};
|
|
10281
|
+
}; // In case focus escapes the trap for some strange reason, pull it back in.
|
|
10282
|
+
|
|
10241
10283
|
|
|
10242
|
-
// In case focus escapes the trap for some strange reason, pull it back in.
|
|
10243
10284
|
var checkFocusIn = function checkFocusIn(e) {
|
|
10244
10285
|
var target = getActualTarget(e);
|
|
10245
|
-
var targetContained = findContainerIndex(target) >= 0;
|
|
10286
|
+
var targetContained = findContainerIndex(target) >= 0; // In Firefox when you Tab out of an iframe the Document is briefly focused.
|
|
10246
10287
|
|
|
10247
|
-
// In Firefox when you Tab out of an iframe the Document is briefly focused.
|
|
10248
10288
|
if (targetContained || target instanceof Document) {
|
|
10249
10289
|
if (targetContained) {
|
|
10250
10290
|
state.mostRecentlyFocusedNode = target;
|
|
@@ -10254,22 +10294,24 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
10254
10294
|
e.stopImmediatePropagation();
|
|
10255
10295
|
tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
|
|
10256
10296
|
}
|
|
10257
|
-
};
|
|
10258
|
-
|
|
10259
|
-
// Hijack Tab events on the first and last focusable nodes of the trap,
|
|
10297
|
+
}; // Hijack Tab events on the first and last focusable nodes of the trap,
|
|
10260
10298
|
// in order to prevent focus from escaping. If it escapes for even a
|
|
10261
10299
|
// moment it can end up scrolling the page and causing confusion so we
|
|
10262
10300
|
// kind of need to capture the action at the keydown phase.
|
|
10301
|
+
|
|
10302
|
+
|
|
10263
10303
|
var checkTab = function checkTab(e) {
|
|
10264
10304
|
var target = getActualTarget(e);
|
|
10265
10305
|
updateTabbableNodes();
|
|
10266
10306
|
var destinationNode = null;
|
|
10307
|
+
|
|
10267
10308
|
if (state.tabbableGroups.length > 0) {
|
|
10268
10309
|
// make sure the target is actually contained in a group
|
|
10269
10310
|
// NOTE: the target may also be the container itself if it's focusable
|
|
10270
10311
|
// with tabIndex='-1' and was given initial focus
|
|
10271
10312
|
var containerIndex = findContainerIndex(target);
|
|
10272
10313
|
var containerGroup = containerIndex >= 0 ? state.containerGroups[containerIndex] : undefined;
|
|
10314
|
+
|
|
10273
10315
|
if (containerIndex < 0) {
|
|
10274
10316
|
// target not found in any group: quite possible focus has escaped the trap,
|
|
10275
10317
|
// so bring it back in to...
|
|
@@ -10282,12 +10324,12 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
10282
10324
|
}
|
|
10283
10325
|
} else if (e.shiftKey) {
|
|
10284
10326
|
// REVERSE
|
|
10285
|
-
|
|
10286
10327
|
// is the target the first tabbable node in a group?
|
|
10287
10328
|
var startOfGroupIndex = findIndex(state.tabbableGroups, function (_ref2) {
|
|
10288
10329
|
var firstTabbableNode = _ref2.firstTabbableNode;
|
|
10289
10330
|
return target === firstTabbableNode;
|
|
10290
10331
|
});
|
|
10332
|
+
|
|
10291
10333
|
if (startOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target, false))) {
|
|
10292
10334
|
// an exception case where the target is either the container itself, or
|
|
10293
10335
|
// a non-tabbable node that was given focus (i.e. tabindex is negative
|
|
@@ -10297,6 +10339,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
10297
10339
|
// first tabbable node, and go to the last tabbable node of the LAST group
|
|
10298
10340
|
startOfGroupIndex = containerIndex;
|
|
10299
10341
|
}
|
|
10342
|
+
|
|
10300
10343
|
if (startOfGroupIndex >= 0) {
|
|
10301
10344
|
// YES: then shift+tab should go to the last tabbable node in the
|
|
10302
10345
|
// previous group (and wrap around to the last tabbable node of
|
|
@@ -10307,12 +10350,12 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
10307
10350
|
}
|
|
10308
10351
|
} else {
|
|
10309
10352
|
// FORWARD
|
|
10310
|
-
|
|
10311
10353
|
// is the target the last tabbable node in a group?
|
|
10312
10354
|
var lastOfGroupIndex = findIndex(state.tabbableGroups, function (_ref3) {
|
|
10313
10355
|
var lastTabbableNode = _ref3.lastTabbableNode;
|
|
10314
10356
|
return target === lastTabbableNode;
|
|
10315
10357
|
});
|
|
10358
|
+
|
|
10316
10359
|
if (lastOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target))) {
|
|
10317
10360
|
// an exception case where the target is the container itself, or
|
|
10318
10361
|
// a non-tabbable node that was given focus (i.e. tabindex is negative
|
|
@@ -10322,11 +10365,13 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
10322
10365
|
// last tabbable node, and go to the first tabbable node of the FIRST group
|
|
10323
10366
|
lastOfGroupIndex = containerIndex;
|
|
10324
10367
|
}
|
|
10368
|
+
|
|
10325
10369
|
if (lastOfGroupIndex >= 0) {
|
|
10326
10370
|
// YES: then tab should go to the first tabbable node in the next
|
|
10327
10371
|
// group (and wrap around to the first tabbable node of the FIRST
|
|
10328
10372
|
// group if it's the last tabbable node of the LAST group)
|
|
10329
10373
|
var _destinationGroupIndex = lastOfGroupIndex === state.tabbableGroups.length - 1 ? 0 : lastOfGroupIndex + 1;
|
|
10374
|
+
|
|
10330
10375
|
var _destinationGroup = state.tabbableGroups[_destinationGroupIndex];
|
|
10331
10376
|
destinationNode = _destinationGroup.firstTabbableNode;
|
|
10332
10377
|
}
|
|
@@ -10335,11 +10380,12 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
10335
10380
|
// NOTE: the fallbackFocus option does not support returning false to opt-out
|
|
10336
10381
|
destinationNode = getNodeForOption('fallbackFocus');
|
|
10337
10382
|
}
|
|
10383
|
+
|
|
10338
10384
|
if (destinationNode) {
|
|
10339
10385
|
e.preventDefault();
|
|
10340
10386
|
tryFocus(destinationNode);
|
|
10341
|
-
}
|
|
10342
|
-
|
|
10387
|
+
} // else, let the browser take care of [shift+]tab and move the focus
|
|
10388
|
+
|
|
10343
10389
|
};
|
|
10344
10390
|
|
|
10345
10391
|
var checkKey = function checkKey(e) {
|
|
@@ -10348,40 +10394,44 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
10348
10394
|
trap.deactivate();
|
|
10349
10395
|
return;
|
|
10350
10396
|
}
|
|
10397
|
+
|
|
10351
10398
|
if (isTabEvent(e)) {
|
|
10352
10399
|
checkTab(e);
|
|
10353
10400
|
return;
|
|
10354
10401
|
}
|
|
10355
10402
|
};
|
|
10403
|
+
|
|
10356
10404
|
var checkClick = function checkClick(e) {
|
|
10357
10405
|
var target = getActualTarget(e);
|
|
10406
|
+
|
|
10358
10407
|
if (findContainerIndex(target) >= 0) {
|
|
10359
10408
|
return;
|
|
10360
10409
|
}
|
|
10410
|
+
|
|
10361
10411
|
if (valueOrHandler(config.clickOutsideDeactivates, e)) {
|
|
10362
10412
|
return;
|
|
10363
10413
|
}
|
|
10414
|
+
|
|
10364
10415
|
if (valueOrHandler(config.allowOutsideClick, e)) {
|
|
10365
10416
|
return;
|
|
10366
10417
|
}
|
|
10418
|
+
|
|
10367
10419
|
e.preventDefault();
|
|
10368
10420
|
e.stopImmediatePropagation();
|
|
10369
|
-
};
|
|
10370
|
-
|
|
10371
|
-
//
|
|
10421
|
+
}; //
|
|
10372
10422
|
// EVENT LISTENERS
|
|
10373
10423
|
//
|
|
10374
10424
|
|
|
10425
|
+
|
|
10375
10426
|
var addListeners = function addListeners() {
|
|
10376
10427
|
if (!state.active) {
|
|
10377
10428
|
return;
|
|
10378
|
-
}
|
|
10429
|
+
} // There can be only one listening focus trap at a time
|
|
10379
10430
|
|
|
10380
|
-
// There can be only one listening focus trap at a time
|
|
10381
|
-
activeFocusTraps.activateTrap(trapStack, trap);
|
|
10382
10431
|
|
|
10383
|
-
// Delay ensures that the focused element doesn't capture the event
|
|
10432
|
+
activeFocusTraps.activateTrap(trap); // Delay ensures that the focused element doesn't capture the event
|
|
10384
10433
|
// that caused the focus trap activation.
|
|
10434
|
+
|
|
10385
10435
|
state.delayInitialFocusTimer = config.delayInitialFocus ? delay(function () {
|
|
10386
10436
|
tryFocus(getInitialFocusNode());
|
|
10387
10437
|
}) : tryFocus(getInitialFocusNode());
|
|
@@ -10404,58 +10454,70 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
10404
10454
|
});
|
|
10405
10455
|
return trap;
|
|
10406
10456
|
};
|
|
10457
|
+
|
|
10407
10458
|
var removeListeners = function removeListeners() {
|
|
10408
10459
|
if (!state.active) {
|
|
10409
10460
|
return;
|
|
10410
10461
|
}
|
|
10462
|
+
|
|
10411
10463
|
doc.removeEventListener('focusin', checkFocusIn, true);
|
|
10412
10464
|
doc.removeEventListener('mousedown', checkPointerDown, true);
|
|
10413
10465
|
doc.removeEventListener('touchstart', checkPointerDown, true);
|
|
10414
10466
|
doc.removeEventListener('click', checkClick, true);
|
|
10415
10467
|
doc.removeEventListener('keydown', checkKey, true);
|
|
10416
10468
|
return trap;
|
|
10417
|
-
};
|
|
10418
|
-
|
|
10419
|
-
//
|
|
10469
|
+
}; //
|
|
10420
10470
|
// TRAP DEFINITION
|
|
10421
10471
|
//
|
|
10422
10472
|
|
|
10473
|
+
|
|
10423
10474
|
trap = {
|
|
10424
10475
|
get active() {
|
|
10425
10476
|
return state.active;
|
|
10426
10477
|
},
|
|
10478
|
+
|
|
10427
10479
|
get paused() {
|
|
10428
10480
|
return state.paused;
|
|
10429
10481
|
},
|
|
10482
|
+
|
|
10430
10483
|
activate: function activate(activateOptions) {
|
|
10431
10484
|
if (state.active) {
|
|
10432
10485
|
return this;
|
|
10433
10486
|
}
|
|
10487
|
+
|
|
10434
10488
|
var onActivate = getOption(activateOptions, 'onActivate');
|
|
10435
10489
|
var onPostActivate = getOption(activateOptions, 'onPostActivate');
|
|
10436
10490
|
var checkCanFocusTrap = getOption(activateOptions, 'checkCanFocusTrap');
|
|
10491
|
+
|
|
10437
10492
|
if (!checkCanFocusTrap) {
|
|
10438
10493
|
updateTabbableNodes();
|
|
10439
10494
|
}
|
|
10495
|
+
|
|
10440
10496
|
state.active = true;
|
|
10441
10497
|
state.paused = false;
|
|
10442
10498
|
state.nodeFocusedBeforeActivation = doc.activeElement;
|
|
10499
|
+
|
|
10443
10500
|
if (onActivate) {
|
|
10444
10501
|
onActivate();
|
|
10445
10502
|
}
|
|
10503
|
+
|
|
10446
10504
|
var finishActivation = function finishActivation() {
|
|
10447
10505
|
if (checkCanFocusTrap) {
|
|
10448
10506
|
updateTabbableNodes();
|
|
10449
10507
|
}
|
|
10508
|
+
|
|
10450
10509
|
addListeners();
|
|
10510
|
+
|
|
10451
10511
|
if (onPostActivate) {
|
|
10452
10512
|
onPostActivate();
|
|
10453
10513
|
}
|
|
10454
10514
|
};
|
|
10515
|
+
|
|
10455
10516
|
if (checkCanFocusTrap) {
|
|
10456
10517
|
checkCanFocusTrap(state.containers.concat()).then(finishActivation, finishActivation);
|
|
10457
10518
|
return this;
|
|
10458
10519
|
}
|
|
10520
|
+
|
|
10459
10521
|
finishActivation();
|
|
10460
10522
|
return this;
|
|
10461
10523
|
},
|
|
@@ -10463,38 +10525,46 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
10463
10525
|
if (!state.active) {
|
|
10464
10526
|
return this;
|
|
10465
10527
|
}
|
|
10528
|
+
|
|
10466
10529
|
var options = _objectSpread2({
|
|
10467
10530
|
onDeactivate: config.onDeactivate,
|
|
10468
10531
|
onPostDeactivate: config.onPostDeactivate,
|
|
10469
10532
|
checkCanReturnFocus: config.checkCanReturnFocus
|
|
10470
10533
|
}, deactivateOptions);
|
|
10534
|
+
|
|
10471
10535
|
clearTimeout(state.delayInitialFocusTimer); // noop if undefined
|
|
10536
|
+
|
|
10472
10537
|
state.delayInitialFocusTimer = undefined;
|
|
10473
10538
|
removeListeners();
|
|
10474
10539
|
state.active = false;
|
|
10475
10540
|
state.paused = false;
|
|
10476
|
-
activeFocusTraps.deactivateTrap(
|
|
10541
|
+
activeFocusTraps.deactivateTrap(trap);
|
|
10477
10542
|
var onDeactivate = getOption(options, 'onDeactivate');
|
|
10478
10543
|
var onPostDeactivate = getOption(options, 'onPostDeactivate');
|
|
10479
10544
|
var checkCanReturnFocus = getOption(options, 'checkCanReturnFocus');
|
|
10480
10545
|
var returnFocus = getOption(options, 'returnFocus', 'returnFocusOnDeactivate');
|
|
10546
|
+
|
|
10481
10547
|
if (onDeactivate) {
|
|
10482
10548
|
onDeactivate();
|
|
10483
10549
|
}
|
|
10550
|
+
|
|
10484
10551
|
var finishDeactivation = function finishDeactivation() {
|
|
10485
10552
|
delay(function () {
|
|
10486
10553
|
if (returnFocus) {
|
|
10487
10554
|
tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation));
|
|
10488
10555
|
}
|
|
10556
|
+
|
|
10489
10557
|
if (onPostDeactivate) {
|
|
10490
10558
|
onPostDeactivate();
|
|
10491
10559
|
}
|
|
10492
10560
|
});
|
|
10493
10561
|
};
|
|
10562
|
+
|
|
10494
10563
|
if (returnFocus && checkCanReturnFocus) {
|
|
10495
10564
|
checkCanReturnFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)).then(finishDeactivation, finishDeactivation);
|
|
10496
10565
|
return this;
|
|
10497
10566
|
}
|
|
10567
|
+
|
|
10498
10568
|
finishDeactivation();
|
|
10499
10569
|
return this;
|
|
10500
10570
|
},
|
|
@@ -10502,6 +10572,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
10502
10572
|
if (state.paused || !state.active) {
|
|
10503
10573
|
return this;
|
|
10504
10574
|
}
|
|
10575
|
+
|
|
10505
10576
|
state.paused = true;
|
|
10506
10577
|
removeListeners();
|
|
10507
10578
|
return this;
|
|
@@ -10510,6 +10581,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
10510
10581
|
if (!state.paused || !state.active) {
|
|
10511
10582
|
return this;
|
|
10512
10583
|
}
|
|
10584
|
+
|
|
10513
10585
|
state.paused = false;
|
|
10514
10586
|
updateTabbableNodes();
|
|
10515
10587
|
addListeners();
|
|
@@ -10520,14 +10592,15 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
10520
10592
|
state.containers = elementsAsArray.map(function (element) {
|
|
10521
10593
|
return typeof element === 'string' ? doc.querySelector(element) : element;
|
|
10522
10594
|
});
|
|
10595
|
+
|
|
10523
10596
|
if (state.active) {
|
|
10524
10597
|
updateTabbableNodes();
|
|
10525
10598
|
}
|
|
10599
|
+
|
|
10526
10600
|
return this;
|
|
10527
10601
|
}
|
|
10528
|
-
};
|
|
10602
|
+
}; // initialize container elements
|
|
10529
10603
|
|
|
10530
|
-
// initialize container elements
|
|
10531
10604
|
trap.updateContainerElements(elements);
|
|
10532
10605
|
return trap;
|
|
10533
10606
|
};
|