@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
|
@@ -3826,37 +3826,37 @@ function arrObjKeys(obj, inspect) {
|
|
|
3826
3826
|
"use strict";
|
|
3827
3827
|
__webpack_require__.r(__webpack_exports__);
|
|
3828
3828
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3829
|
-
/* harmony export */ "Children": () => (/* binding */
|
|
3829
|
+
/* harmony export */ "Children": () => (/* binding */ A),
|
|
3830
3830
|
/* harmony export */ "Component": () => (/* reexport safe */ preact__WEBPACK_IMPORTED_MODULE_0__.Component),
|
|
3831
3831
|
/* harmony export */ "Fragment": () => (/* reexport safe */ preact__WEBPACK_IMPORTED_MODULE_0__.Fragment),
|
|
3832
|
-
/* harmony export */ "PureComponent": () => (/* binding */
|
|
3833
|
-
/* harmony export */ "StrictMode": () => (/* binding */
|
|
3834
|
-
/* harmony export */ "Suspense": () => (/* binding */
|
|
3835
|
-
/* harmony export */ "SuspenseList": () => (/* binding */
|
|
3836
|
-
/* harmony export */ "__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED": () => (/* binding */
|
|
3837
|
-
/* harmony export */ "cloneElement": () => (/* binding */
|
|
3832
|
+
/* harmony export */ "PureComponent": () => (/* binding */ E),
|
|
3833
|
+
/* harmony export */ "StrictMode": () => (/* binding */ hn),
|
|
3834
|
+
/* harmony export */ "Suspense": () => (/* binding */ U),
|
|
3835
|
+
/* harmony export */ "SuspenseList": () => (/* binding */ M),
|
|
3836
|
+
/* harmony export */ "__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED": () => (/* binding */ en),
|
|
3837
|
+
/* harmony export */ "cloneElement": () => (/* binding */ ln),
|
|
3838
3838
|
/* harmony export */ "createContext": () => (/* reexport safe */ preact__WEBPACK_IMPORTED_MODULE_0__.createContext),
|
|
3839
3839
|
/* harmony export */ "createElement": () => (/* reexport safe */ preact__WEBPACK_IMPORTED_MODULE_0__.createElement),
|
|
3840
|
-
/* harmony export */ "createFactory": () => (/* binding */
|
|
3841
|
-
/* harmony export */ "createPortal": () => (/* binding */
|
|
3840
|
+
/* harmony export */ "createFactory": () => (/* binding */ un),
|
|
3841
|
+
/* harmony export */ "createPortal": () => (/* binding */ $),
|
|
3842
3842
|
/* harmony export */ "createRef": () => (/* reexport safe */ preact__WEBPACK_IMPORTED_MODULE_0__.createRef),
|
|
3843
|
-
/* harmony export */ "default": () => (/* binding */
|
|
3844
|
-
/* harmony export */ "findDOMNode": () => (/* binding */
|
|
3845
|
-
/* harmony export */ "flushSync": () => (/* binding */
|
|
3846
|
-
/* harmony export */ "forwardRef": () => (/* binding */
|
|
3847
|
-
/* harmony export */ "hydrate": () => (/* binding */
|
|
3848
|
-
/* harmony export */ "isValidElement": () => (/* binding */
|
|
3849
|
-
/* harmony export */ "lazy": () => (/* binding */
|
|
3850
|
-
/* harmony export */ "memo": () => (/* binding */
|
|
3851
|
-
/* harmony export */ "render": () => (/* binding */
|
|
3852
|
-
/* harmony export */ "startTransition": () => (/* binding */
|
|
3853
|
-
/* harmony export */ "unmountComponentAtNode": () => (/* binding */
|
|
3854
|
-
/* harmony export */ "unstable_batchedUpdates": () => (/* binding */
|
|
3855
|
-
/* harmony export */ "useDeferredValue": () => (/* binding */
|
|
3856
|
-
/* harmony export */ "useInsertionEffect": () => (/* binding */
|
|
3857
|
-
/* harmony export */ "useSyncExternalStore": () => (/* binding */
|
|
3858
|
-
/* harmony export */ "useTransition": () => (/* binding */
|
|
3859
|
-
/* harmony export */ "version": () => (/* binding */
|
|
3843
|
+
/* harmony export */ "default": () => (/* binding */ _n),
|
|
3844
|
+
/* harmony export */ "findDOMNode": () => (/* binding */ fn),
|
|
3845
|
+
/* harmony export */ "flushSync": () => (/* binding */ sn),
|
|
3846
|
+
/* harmony export */ "forwardRef": () => (/* binding */ N),
|
|
3847
|
+
/* harmony export */ "hydrate": () => (/* binding */ Y),
|
|
3848
|
+
/* harmony export */ "isValidElement": () => (/* binding */ on),
|
|
3849
|
+
/* harmony export */ "lazy": () => (/* binding */ F),
|
|
3850
|
+
/* harmony export */ "memo": () => (/* binding */ w),
|
|
3851
|
+
/* harmony export */ "render": () => (/* binding */ Z),
|
|
3852
|
+
/* harmony export */ "startTransition": () => (/* binding */ vn),
|
|
3853
|
+
/* harmony export */ "unmountComponentAtNode": () => (/* binding */ cn),
|
|
3854
|
+
/* harmony export */ "unstable_batchedUpdates": () => (/* binding */ an),
|
|
3855
|
+
/* harmony export */ "useDeferredValue": () => (/* binding */ dn),
|
|
3856
|
+
/* harmony export */ "useInsertionEffect": () => (/* binding */ mn),
|
|
3857
|
+
/* harmony export */ "useSyncExternalStore": () => (/* binding */ yn),
|
|
3858
|
+
/* harmony export */ "useTransition": () => (/* binding */ pn),
|
|
3859
|
+
/* harmony export */ "version": () => (/* binding */ rn)
|
|
3860
3860
|
/* harmony export */ });
|
|
3861
3861
|
/* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(710);
|
|
3862
3862
|
/* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(preact__WEBPACK_IMPORTED_MODULE_0__);
|
|
@@ -3865,7 +3865,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3865
3865
|
/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
3866
3866
|
/* 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__]
|
|
3867
3867
|
/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
3868
|
-
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};
|
|
3868
|
+
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};
|
|
3869
3869
|
//# sourceMappingURL=compat.module.js.map
|
|
3870
3870
|
|
|
3871
3871
|
|
|
@@ -7113,7 +7113,7 @@ class API {
|
|
|
7113
7113
|
(_a = this.conversation) === null || _a === void 0 ? void 0 : _a.onConnection(connectionState => {
|
|
7114
7114
|
const connected = connectionState === 'join_channel_succeeded';
|
|
7115
7115
|
const ready = connectionState === 'attach_channel_succeeded';
|
|
7116
|
-
if (
|
|
7116
|
+
if (connected || ready) {
|
|
7117
7117
|
this.send(command, payload, waitForReady);
|
|
7118
7118
|
}
|
|
7119
7119
|
});
|
|
@@ -7211,7 +7211,7 @@ _API_ready = new WeakMap(), _API_externalId = new WeakMap(), _API_layoutMode = n
|
|
|
7211
7211
|
return {
|
|
7212
7212
|
clientName: "@seamly/web-ui",
|
|
7213
7213
|
clientVariant: api_classPrivateFieldGet(this, _API_layoutMode, "f"),
|
|
7214
|
-
clientVersion: "21.0.2-beta.
|
|
7214
|
+
clientVersion: "21.0.2-beta.2",
|
|
7215
7215
|
currentUrl: window.location.toString(),
|
|
7216
7216
|
screenResolution: `${window.screen.width}x${window.screen.height}`,
|
|
7217
7217
|
timezone: getTimeZone(),
|
|
@@ -16441,21 +16441,24 @@ var isFocusable = function isFocusable(node, options) {
|
|
|
16441
16441
|
|
|
16442
16442
|
;// CONCATENATED MODULE: ./node_modules/focus-trap/dist/focus-trap.esm.js
|
|
16443
16443
|
/*!
|
|
16444
|
-
* focus-trap 7.
|
|
16444
|
+
* focus-trap 7.0.0
|
|
16445
16445
|
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
16446
16446
|
*/
|
|
16447
16447
|
|
|
16448
16448
|
|
|
16449
16449
|
function focus_trap_esm_ownKeys(object, enumerableOnly) {
|
|
16450
16450
|
var keys = Object.keys(object);
|
|
16451
|
+
|
|
16451
16452
|
if (Object.getOwnPropertySymbols) {
|
|
16452
16453
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
16453
16454
|
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
16454
16455
|
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
16455
16456
|
})), keys.push.apply(keys, symbols);
|
|
16456
16457
|
}
|
|
16458
|
+
|
|
16457
16459
|
return keys;
|
|
16458
16460
|
}
|
|
16461
|
+
|
|
16459
16462
|
function focus_trap_esm_objectSpread2(target) {
|
|
16460
16463
|
for (var i = 1; i < arguments.length; i++) {
|
|
16461
16464
|
var source = null != arguments[i] ? arguments[i] : {};
|
|
@@ -16465,8 +16468,10 @@ function focus_trap_esm_objectSpread2(target) {
|
|
|
16465
16468
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
16466
16469
|
});
|
|
16467
16470
|
}
|
|
16471
|
+
|
|
16468
16472
|
return target;
|
|
16469
16473
|
}
|
|
16474
|
+
|
|
16470
16475
|
function focus_trap_esm_defineProperty(obj, key, value) {
|
|
16471
16476
|
if (key in obj) {
|
|
16472
16477
|
Object.defineProperty(obj, key, {
|
|
@@ -16478,52 +16483,64 @@ function focus_trap_esm_defineProperty(obj, key, value) {
|
|
|
16478
16483
|
} else {
|
|
16479
16484
|
obj[key] = value;
|
|
16480
16485
|
}
|
|
16486
|
+
|
|
16481
16487
|
return obj;
|
|
16482
16488
|
}
|
|
16483
16489
|
|
|
16484
|
-
var
|
|
16485
|
-
var
|
|
16486
|
-
|
|
16487
|
-
|
|
16488
|
-
|
|
16489
|
-
|
|
16490
|
-
|
|
16490
|
+
var activeFocusTraps = function () {
|
|
16491
|
+
var trapQueue = [];
|
|
16492
|
+
return {
|
|
16493
|
+
activateTrap: function activateTrap(trap) {
|
|
16494
|
+
if (trapQueue.length > 0) {
|
|
16495
|
+
var activeTrap = trapQueue[trapQueue.length - 1];
|
|
16496
|
+
|
|
16497
|
+
if (activeTrap !== trap) {
|
|
16498
|
+
activeTrap.pause();
|
|
16499
|
+
}
|
|
16500
|
+
}
|
|
16501
|
+
|
|
16502
|
+
var trapIndex = trapQueue.indexOf(trap);
|
|
16503
|
+
|
|
16504
|
+
if (trapIndex === -1) {
|
|
16505
|
+
trapQueue.push(trap);
|
|
16506
|
+
} else {
|
|
16507
|
+
// move this existing trap to the front of the queue
|
|
16508
|
+
trapQueue.splice(trapIndex, 1);
|
|
16509
|
+
trapQueue.push(trap);
|
|
16510
|
+
}
|
|
16511
|
+
},
|
|
16512
|
+
deactivateTrap: function deactivateTrap(trap) {
|
|
16513
|
+
var trapIndex = trapQueue.indexOf(trap);
|
|
16514
|
+
|
|
16515
|
+
if (trapIndex !== -1) {
|
|
16516
|
+
trapQueue.splice(trapIndex, 1);
|
|
16517
|
+
}
|
|
16518
|
+
|
|
16519
|
+
if (trapQueue.length > 0) {
|
|
16520
|
+
trapQueue[trapQueue.length - 1].unpause();
|
|
16491
16521
|
}
|
|
16492
16522
|
}
|
|
16493
|
-
|
|
16494
|
-
|
|
16495
|
-
|
|
16496
|
-
} else {
|
|
16497
|
-
// move this existing trap to the front of the queue
|
|
16498
|
-
trapStack.splice(trapIndex, 1);
|
|
16499
|
-
trapStack.push(trap);
|
|
16500
|
-
}
|
|
16501
|
-
},
|
|
16502
|
-
deactivateTrap: function deactivateTrap(trapStack, trap) {
|
|
16503
|
-
var trapIndex = trapStack.indexOf(trap);
|
|
16504
|
-
if (trapIndex !== -1) {
|
|
16505
|
-
trapStack.splice(trapIndex, 1);
|
|
16506
|
-
}
|
|
16507
|
-
if (trapStack.length > 0) {
|
|
16508
|
-
trapStack[trapStack.length - 1].unpause();
|
|
16509
|
-
}
|
|
16510
|
-
}
|
|
16511
|
-
};
|
|
16523
|
+
};
|
|
16524
|
+
}();
|
|
16525
|
+
|
|
16512
16526
|
var isSelectableInput = function isSelectableInput(node) {
|
|
16513
16527
|
return node.tagName && node.tagName.toLowerCase() === 'input' && typeof node.select === 'function';
|
|
16514
16528
|
};
|
|
16529
|
+
|
|
16515
16530
|
var isEscapeEvent = function isEscapeEvent(e) {
|
|
16516
16531
|
return e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27;
|
|
16517
16532
|
};
|
|
16533
|
+
|
|
16518
16534
|
var isTabEvent = function isTabEvent(e) {
|
|
16519
16535
|
return e.key === 'Tab' || e.keyCode === 9;
|
|
16520
16536
|
};
|
|
16537
|
+
|
|
16521
16538
|
var delay = function delay(fn) {
|
|
16522
16539
|
return setTimeout(fn, 0);
|
|
16523
|
-
};
|
|
16524
|
-
|
|
16525
|
-
// Array.find/findIndex() are not supported on IE; this replicates enough
|
|
16540
|
+
}; // Array.find/findIndex() are not supported on IE; this replicates enough
|
|
16526
16541
|
// of Array.findIndex() for our needs
|
|
16542
|
+
|
|
16543
|
+
|
|
16527
16544
|
var findIndex = function findIndex(arr, fn) {
|
|
16528
16545
|
var idx = -1;
|
|
16529
16546
|
arr.every(function (value, i) {
|
|
@@ -16534,10 +16551,8 @@ var findIndex = function findIndex(arr, fn) {
|
|
|
16534
16551
|
|
|
16535
16552
|
return true; // next
|
|
16536
16553
|
});
|
|
16537
|
-
|
|
16538
16554
|
return idx;
|
|
16539
16555
|
};
|
|
16540
|
-
|
|
16541
16556
|
/**
|
|
16542
16557
|
* Get an option's value when it could be a plain value, or a handler that provides
|
|
16543
16558
|
* the value.
|
|
@@ -16545,12 +16560,16 @@ var findIndex = function findIndex(arr, fn) {
|
|
|
16545
16560
|
* @param {...*} [params] Any parameters to pass to the handler, if `value` is a function.
|
|
16546
16561
|
* @returns {*} The `value`, or the handler's returned value.
|
|
16547
16562
|
*/
|
|
16563
|
+
|
|
16564
|
+
|
|
16548
16565
|
var valueOrHandler = function valueOrHandler(value) {
|
|
16549
16566
|
for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
16550
16567
|
params[_key - 1] = arguments[_key];
|
|
16551
16568
|
}
|
|
16569
|
+
|
|
16552
16570
|
return typeof value === 'function' ? value.apply(void 0, params) : value;
|
|
16553
16571
|
};
|
|
16572
|
+
|
|
16554
16573
|
var getActualTarget = function getActualTarget(event) {
|
|
16555
16574
|
// NOTE: If the trap is _inside_ a shadow DOM, event.target will always be the
|
|
16556
16575
|
// shadow host. However, event.target.composedPath() will be an array of
|
|
@@ -16561,16 +16580,18 @@ var getActualTarget = function getActualTarget(event) {
|
|
|
16561
16580
|
// composedPath()[0] === event.target always).
|
|
16562
16581
|
return event.target.shadowRoot && typeof event.composedPath === 'function' ? event.composedPath()[0] : event.target;
|
|
16563
16582
|
};
|
|
16583
|
+
|
|
16564
16584
|
var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
16565
16585
|
// SSR: a live trap shouldn't be created in this type of environment so this
|
|
16566
16586
|
// should be safe code to execute if the `document` option isn't specified
|
|
16567
16587
|
var doc = (userOptions === null || userOptions === void 0 ? void 0 : userOptions.document) || document;
|
|
16568
|
-
|
|
16588
|
+
|
|
16569
16589
|
var config = focus_trap_esm_objectSpread2({
|
|
16570
16590
|
returnFocusOnDeactivate: true,
|
|
16571
16591
|
escapeDeactivates: true,
|
|
16572
16592
|
delayInitialFocus: true
|
|
16573
16593
|
}, userOptions);
|
|
16594
|
+
|
|
16574
16595
|
var state = {
|
|
16575
16596
|
// containers given to createFocusTrap()
|
|
16576
16597
|
// @type {Array<HTMLElement>}
|
|
@@ -16590,7 +16611,6 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16590
16611
|
// }>}
|
|
16591
16612
|
containerGroups: [],
|
|
16592
16613
|
// same order/length as `containers` list
|
|
16593
|
-
|
|
16594
16614
|
// references to objects in `containerGroups`, but only those that actually have
|
|
16595
16615
|
// tabbable nodes in them
|
|
16596
16616
|
// NOTE: same order as `containers` and `containerGroups`, but __not necessarily__
|
|
@@ -16614,10 +16634,10 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16614
16634
|
* @param {string|undefined} [configOptionName] Name of option to use __instead of__ `optionName`
|
|
16615
16635
|
* IIF `configOverrideOptions` is not defined. Otherwise, `optionName` is used.
|
|
16616
16636
|
*/
|
|
16637
|
+
|
|
16617
16638
|
var getOption = function getOption(configOverrideOptions, optionName, configOptionName) {
|
|
16618
16639
|
return configOverrideOptions && configOverrideOptions[optionName] !== undefined ? configOverrideOptions[optionName] : config[configOptionName || optionName];
|
|
16619
16640
|
};
|
|
16620
|
-
|
|
16621
16641
|
/**
|
|
16622
16642
|
* Finds the index of the container that contains the element.
|
|
16623
16643
|
* @param {HTMLElement} element
|
|
@@ -16625,15 +16645,16 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16625
16645
|
* `state.containerGroups` (the order/length of these lists are the same); -1
|
|
16626
16646
|
* if the element isn't found.
|
|
16627
16647
|
*/
|
|
16648
|
+
|
|
16649
|
+
|
|
16628
16650
|
var findContainerIndex = function findContainerIndex(element) {
|
|
16629
16651
|
// NOTE: search `containerGroups` because it's possible a group contains no tabbable
|
|
16630
16652
|
// nodes, but still contains focusable nodes (e.g. if they all have `tabindex=-1`)
|
|
16631
16653
|
// and we still need to find the element in there
|
|
16632
16654
|
return state.containerGroups.findIndex(function (_ref) {
|
|
16633
16655
|
var container = _ref.container,
|
|
16634
|
-
|
|
16635
|
-
return container.contains(element) ||
|
|
16636
|
-
// fall back to explicit tabbable search which will take into consideration any
|
|
16656
|
+
tabbableNodes = _ref.tabbableNodes;
|
|
16657
|
+
return container.contains(element) || // fall back to explicit tabbable search which will take into consideration any
|
|
16637
16658
|
// web components if the `tabbableOptions.getShadowRoot` option was used for
|
|
16638
16659
|
// the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't
|
|
16639
16660
|
// look inside web components even if open)
|
|
@@ -16642,7 +16663,6 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16642
16663
|
});
|
|
16643
16664
|
});
|
|
16644
16665
|
};
|
|
16645
|
-
|
|
16646
16666
|
/**
|
|
16647
16667
|
* Gets the node for the given option, which is expected to be an option that
|
|
16648
16668
|
* can be either a DOM node, a string that is a selector to get a node, `false`
|
|
@@ -16656,14 +16676,19 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16656
16676
|
* @throws {Error} If the option is set, not `false`, and is not, or does not
|
|
16657
16677
|
* resolve to a node.
|
|
16658
16678
|
*/
|
|
16679
|
+
|
|
16680
|
+
|
|
16659
16681
|
var getNodeForOption = function getNodeForOption(optionName) {
|
|
16660
16682
|
var optionValue = config[optionName];
|
|
16683
|
+
|
|
16661
16684
|
if (typeof optionValue === 'function') {
|
|
16662
16685
|
for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
16663
16686
|
params[_key2 - 1] = arguments[_key2];
|
|
16664
16687
|
}
|
|
16688
|
+
|
|
16665
16689
|
optionValue = optionValue.apply(void 0, params);
|
|
16666
16690
|
}
|
|
16691
|
+
|
|
16667
16692
|
if (optionValue === true) {
|
|
16668
16693
|
optionValue = undefined; // use default value
|
|
16669
16694
|
}
|
|
@@ -16671,51 +16696,56 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16671
16696
|
if (!optionValue) {
|
|
16672
16697
|
if (optionValue === undefined || optionValue === false) {
|
|
16673
16698
|
return optionValue;
|
|
16674
|
-
}
|
|
16675
|
-
|
|
16699
|
+
} // else, empty string (invalid), null (invalid), 0 (invalid)
|
|
16700
|
+
|
|
16676
16701
|
|
|
16677
16702
|
throw new Error("`".concat(optionName, "` was specified but was not a node, or did not return a node"));
|
|
16678
16703
|
}
|
|
16704
|
+
|
|
16679
16705
|
var node = optionValue; // could be HTMLElement, SVGElement, or non-empty string at this point
|
|
16680
16706
|
|
|
16681
16707
|
if (typeof optionValue === 'string') {
|
|
16682
16708
|
node = doc.querySelector(optionValue); // resolve to node, or null if fails
|
|
16709
|
+
|
|
16683
16710
|
if (!node) {
|
|
16684
16711
|
throw new Error("`".concat(optionName, "` as selector refers to no known node"));
|
|
16685
16712
|
}
|
|
16686
16713
|
}
|
|
16714
|
+
|
|
16687
16715
|
return node;
|
|
16688
16716
|
};
|
|
16717
|
+
|
|
16689
16718
|
var getInitialFocusNode = function getInitialFocusNode() {
|
|
16690
|
-
var node = getNodeForOption('initialFocus');
|
|
16719
|
+
var node = getNodeForOption('initialFocus'); // false explicitly indicates we want no initialFocus at all
|
|
16691
16720
|
|
|
16692
|
-
// false explicitly indicates we want no initialFocus at all
|
|
16693
16721
|
if (node === false) {
|
|
16694
16722
|
return false;
|
|
16695
16723
|
}
|
|
16724
|
+
|
|
16696
16725
|
if (node === undefined) {
|
|
16697
16726
|
// option not specified: use fallback options
|
|
16698
16727
|
if (findContainerIndex(doc.activeElement) >= 0) {
|
|
16699
16728
|
node = doc.activeElement;
|
|
16700
16729
|
} else {
|
|
16701
16730
|
var firstTabbableGroup = state.tabbableGroups[0];
|
|
16702
|
-
var firstTabbableNode = firstTabbableGroup && firstTabbableGroup.firstTabbableNode;
|
|
16731
|
+
var firstTabbableNode = firstTabbableGroup && firstTabbableGroup.firstTabbableNode; // NOTE: `fallbackFocus` option function cannot return `false` (not supported)
|
|
16703
16732
|
|
|
16704
|
-
// NOTE: `fallbackFocus` option function cannot return `false` (not supported)
|
|
16705
16733
|
node = firstTabbableNode || getNodeForOption('fallbackFocus');
|
|
16706
16734
|
}
|
|
16707
16735
|
}
|
|
16736
|
+
|
|
16708
16737
|
if (!node) {
|
|
16709
16738
|
throw new Error('Your focus-trap needs to have at least one focusable element');
|
|
16710
16739
|
}
|
|
16740
|
+
|
|
16711
16741
|
return node;
|
|
16712
16742
|
};
|
|
16743
|
+
|
|
16713
16744
|
var updateTabbableNodes = function updateTabbableNodes() {
|
|
16714
16745
|
state.containerGroups = state.containers.map(function (container) {
|
|
16715
|
-
var tabbableNodes = tabbable(container, config.tabbableOptions);
|
|
16716
|
-
|
|
16717
|
-
// NOTE: if we have tabbable nodes, we must have focusable nodes; focusable nodes
|
|
16746
|
+
var tabbableNodes = tabbable(container, config.tabbableOptions); // NOTE: if we have tabbable nodes, we must have focusable nodes; focusable nodes
|
|
16718
16747
|
// are a superset of tabbable nodes
|
|
16748
|
+
|
|
16719
16749
|
var focusableNodes = focusable(container, config.tabbableOptions);
|
|
16720
16750
|
return {
|
|
16721
16751
|
container: container,
|
|
@@ -16723,6 +16753,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16723
16753
|
focusableNodes: focusableNodes,
|
|
16724
16754
|
firstTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[0] : null,
|
|
16725
16755
|
lastTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[tabbableNodes.length - 1] : null,
|
|
16756
|
+
|
|
16726
16757
|
/**
|
|
16727
16758
|
* Finds the __tabbable__ node that follows the given node in the specified direction,
|
|
16728
16759
|
* in this container, if any.
|
|
@@ -16746,14 +16777,17 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16746
16777
|
var nodeIdx = focusableNodes.findIndex(function (n) {
|
|
16747
16778
|
return n === node;
|
|
16748
16779
|
});
|
|
16780
|
+
|
|
16749
16781
|
if (nodeIdx < 0) {
|
|
16750
16782
|
return undefined;
|
|
16751
16783
|
}
|
|
16784
|
+
|
|
16752
16785
|
if (forward) {
|
|
16753
16786
|
return focusableNodes.slice(nodeIdx + 1).find(function (n) {
|
|
16754
16787
|
return isTabbable(n, config.tabbableOptions);
|
|
16755
16788
|
});
|
|
16756
16789
|
}
|
|
16790
|
+
|
|
16757
16791
|
return focusableNodes.slice(0, nodeIdx).reverse().find(function (n) {
|
|
16758
16792
|
return isTabbable(n, config.tabbableOptions);
|
|
16759
16793
|
});
|
|
@@ -16762,46 +16796,53 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16762
16796
|
});
|
|
16763
16797
|
state.tabbableGroups = state.containerGroups.filter(function (group) {
|
|
16764
16798
|
return group.tabbableNodes.length > 0;
|
|
16765
|
-
});
|
|
16799
|
+
}); // throw if no groups have tabbable nodes and we don't have a fallback focus node either
|
|
16766
16800
|
|
|
16767
|
-
// throw if no groups have tabbable nodes and we don't have a fallback focus node either
|
|
16768
16801
|
if (state.tabbableGroups.length <= 0 && !getNodeForOption('fallbackFocus') // returning false not supported for this option
|
|
16769
16802
|
) {
|
|
16770
16803
|
throw new Error('Your focus-trap must have at least one container with at least one tabbable node in it at all times');
|
|
16771
16804
|
}
|
|
16772
16805
|
};
|
|
16806
|
+
|
|
16773
16807
|
var tryFocus = function tryFocus(node) {
|
|
16774
16808
|
if (node === false) {
|
|
16775
16809
|
return;
|
|
16776
16810
|
}
|
|
16811
|
+
|
|
16777
16812
|
if (node === doc.activeElement) {
|
|
16778
16813
|
return;
|
|
16779
16814
|
}
|
|
16815
|
+
|
|
16780
16816
|
if (!node || !node.focus) {
|
|
16781
16817
|
tryFocus(getInitialFocusNode());
|
|
16782
16818
|
return;
|
|
16783
16819
|
}
|
|
16820
|
+
|
|
16784
16821
|
node.focus({
|
|
16785
16822
|
preventScroll: !!config.preventScroll
|
|
16786
16823
|
});
|
|
16787
16824
|
state.mostRecentlyFocusedNode = node;
|
|
16825
|
+
|
|
16788
16826
|
if (isSelectableInput(node)) {
|
|
16789
16827
|
node.select();
|
|
16790
16828
|
}
|
|
16791
16829
|
};
|
|
16830
|
+
|
|
16792
16831
|
var getReturnFocusNode = function getReturnFocusNode(previousActiveElement) {
|
|
16793
16832
|
var node = getNodeForOption('setReturnFocus', previousActiveElement);
|
|
16794
16833
|
return node ? node : node === false ? false : previousActiveElement;
|
|
16795
|
-
};
|
|
16796
|
-
|
|
16797
|
-
// This needs to be done on mousedown and touchstart instead of click
|
|
16834
|
+
}; // This needs to be done on mousedown and touchstart instead of click
|
|
16798
16835
|
// so that it precedes the focus event.
|
|
16836
|
+
|
|
16837
|
+
|
|
16799
16838
|
var checkPointerDown = function checkPointerDown(e) {
|
|
16800
16839
|
var target = getActualTarget(e);
|
|
16840
|
+
|
|
16801
16841
|
if (findContainerIndex(target) >= 0) {
|
|
16802
16842
|
// allow the click since it ocurred inside the trap
|
|
16803
16843
|
return;
|
|
16804
16844
|
}
|
|
16845
|
+
|
|
16805
16846
|
if (valueOrHandler(config.clickOutsideDeactivates, e)) {
|
|
16806
16847
|
// immediately deactivate the trap
|
|
16807
16848
|
trap.deactivate({
|
|
@@ -16819,26 +16860,25 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16819
16860
|
returnFocus: config.returnFocusOnDeactivate && !isFocusable(target, config.tabbableOptions)
|
|
16820
16861
|
});
|
|
16821
16862
|
return;
|
|
16822
|
-
}
|
|
16823
|
-
|
|
16824
|
-
// This is needed for mobile devices.
|
|
16863
|
+
} // This is needed for mobile devices.
|
|
16825
16864
|
// (If we'll only let `click` events through,
|
|
16826
16865
|
// then on mobile they will be blocked anyways if `touchstart` is blocked.)
|
|
16866
|
+
|
|
16867
|
+
|
|
16827
16868
|
if (valueOrHandler(config.allowOutsideClick, e)) {
|
|
16828
16869
|
// allow the click outside the trap to take place
|
|
16829
16870
|
return;
|
|
16830
|
-
}
|
|
16871
|
+
} // otherwise, prevent the click
|
|
16872
|
+
|
|
16831
16873
|
|
|
16832
|
-
// otherwise, prevent the click
|
|
16833
16874
|
e.preventDefault();
|
|
16834
|
-
};
|
|
16875
|
+
}; // In case focus escapes the trap for some strange reason, pull it back in.
|
|
16876
|
+
|
|
16835
16877
|
|
|
16836
|
-
// In case focus escapes the trap for some strange reason, pull it back in.
|
|
16837
16878
|
var checkFocusIn = function checkFocusIn(e) {
|
|
16838
16879
|
var target = getActualTarget(e);
|
|
16839
|
-
var targetContained = findContainerIndex(target) >= 0;
|
|
16880
|
+
var targetContained = findContainerIndex(target) >= 0; // In Firefox when you Tab out of an iframe the Document is briefly focused.
|
|
16840
16881
|
|
|
16841
|
-
// In Firefox when you Tab out of an iframe the Document is briefly focused.
|
|
16842
16882
|
if (targetContained || target instanceof Document) {
|
|
16843
16883
|
if (targetContained) {
|
|
16844
16884
|
state.mostRecentlyFocusedNode = target;
|
|
@@ -16848,22 +16888,24 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16848
16888
|
e.stopImmediatePropagation();
|
|
16849
16889
|
tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
|
|
16850
16890
|
}
|
|
16851
|
-
};
|
|
16852
|
-
|
|
16853
|
-
// Hijack Tab events on the first and last focusable nodes of the trap,
|
|
16891
|
+
}; // Hijack Tab events on the first and last focusable nodes of the trap,
|
|
16854
16892
|
// in order to prevent focus from escaping. If it escapes for even a
|
|
16855
16893
|
// moment it can end up scrolling the page and causing confusion so we
|
|
16856
16894
|
// kind of need to capture the action at the keydown phase.
|
|
16895
|
+
|
|
16896
|
+
|
|
16857
16897
|
var checkTab = function checkTab(e) {
|
|
16858
16898
|
var target = getActualTarget(e);
|
|
16859
16899
|
updateTabbableNodes();
|
|
16860
16900
|
var destinationNode = null;
|
|
16901
|
+
|
|
16861
16902
|
if (state.tabbableGroups.length > 0) {
|
|
16862
16903
|
// make sure the target is actually contained in a group
|
|
16863
16904
|
// NOTE: the target may also be the container itself if it's focusable
|
|
16864
16905
|
// with tabIndex='-1' and was given initial focus
|
|
16865
16906
|
var containerIndex = findContainerIndex(target);
|
|
16866
16907
|
var containerGroup = containerIndex >= 0 ? state.containerGroups[containerIndex] : undefined;
|
|
16908
|
+
|
|
16867
16909
|
if (containerIndex < 0) {
|
|
16868
16910
|
// target not found in any group: quite possible focus has escaped the trap,
|
|
16869
16911
|
// so bring it back in to...
|
|
@@ -16876,12 +16918,12 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16876
16918
|
}
|
|
16877
16919
|
} else if (e.shiftKey) {
|
|
16878
16920
|
// REVERSE
|
|
16879
|
-
|
|
16880
16921
|
// is the target the first tabbable node in a group?
|
|
16881
16922
|
var startOfGroupIndex = findIndex(state.tabbableGroups, function (_ref2) {
|
|
16882
16923
|
var firstTabbableNode = _ref2.firstTabbableNode;
|
|
16883
16924
|
return target === firstTabbableNode;
|
|
16884
16925
|
});
|
|
16926
|
+
|
|
16885
16927
|
if (startOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target, false))) {
|
|
16886
16928
|
// an exception case where the target is either the container itself, or
|
|
16887
16929
|
// a non-tabbable node that was given focus (i.e. tabindex is negative
|
|
@@ -16891,6 +16933,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16891
16933
|
// first tabbable node, and go to the last tabbable node of the LAST group
|
|
16892
16934
|
startOfGroupIndex = containerIndex;
|
|
16893
16935
|
}
|
|
16936
|
+
|
|
16894
16937
|
if (startOfGroupIndex >= 0) {
|
|
16895
16938
|
// YES: then shift+tab should go to the last tabbable node in the
|
|
16896
16939
|
// previous group (and wrap around to the last tabbable node of
|
|
@@ -16901,12 +16944,12 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16901
16944
|
}
|
|
16902
16945
|
} else {
|
|
16903
16946
|
// FORWARD
|
|
16904
|
-
|
|
16905
16947
|
// is the target the last tabbable node in a group?
|
|
16906
16948
|
var lastOfGroupIndex = findIndex(state.tabbableGroups, function (_ref3) {
|
|
16907
16949
|
var lastTabbableNode = _ref3.lastTabbableNode;
|
|
16908
16950
|
return target === lastTabbableNode;
|
|
16909
16951
|
});
|
|
16952
|
+
|
|
16910
16953
|
if (lastOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target))) {
|
|
16911
16954
|
// an exception case where the target is the container itself, or
|
|
16912
16955
|
// a non-tabbable node that was given focus (i.e. tabindex is negative
|
|
@@ -16916,11 +16959,13 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16916
16959
|
// last tabbable node, and go to the first tabbable node of the FIRST group
|
|
16917
16960
|
lastOfGroupIndex = containerIndex;
|
|
16918
16961
|
}
|
|
16962
|
+
|
|
16919
16963
|
if (lastOfGroupIndex >= 0) {
|
|
16920
16964
|
// YES: then tab should go to the first tabbable node in the next
|
|
16921
16965
|
// group (and wrap around to the first tabbable node of the FIRST
|
|
16922
16966
|
// group if it's the last tabbable node of the LAST group)
|
|
16923
16967
|
var _destinationGroupIndex = lastOfGroupIndex === state.tabbableGroups.length - 1 ? 0 : lastOfGroupIndex + 1;
|
|
16968
|
+
|
|
16924
16969
|
var _destinationGroup = state.tabbableGroups[_destinationGroupIndex];
|
|
16925
16970
|
destinationNode = _destinationGroup.firstTabbableNode;
|
|
16926
16971
|
}
|
|
@@ -16929,11 +16974,12 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16929
16974
|
// NOTE: the fallbackFocus option does not support returning false to opt-out
|
|
16930
16975
|
destinationNode = getNodeForOption('fallbackFocus');
|
|
16931
16976
|
}
|
|
16977
|
+
|
|
16932
16978
|
if (destinationNode) {
|
|
16933
16979
|
e.preventDefault();
|
|
16934
16980
|
tryFocus(destinationNode);
|
|
16935
|
-
}
|
|
16936
|
-
|
|
16981
|
+
} // else, let the browser take care of [shift+]tab and move the focus
|
|
16982
|
+
|
|
16937
16983
|
};
|
|
16938
16984
|
|
|
16939
16985
|
var checkKey = function checkKey(e) {
|
|
@@ -16942,40 +16988,44 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16942
16988
|
trap.deactivate();
|
|
16943
16989
|
return;
|
|
16944
16990
|
}
|
|
16991
|
+
|
|
16945
16992
|
if (isTabEvent(e)) {
|
|
16946
16993
|
checkTab(e);
|
|
16947
16994
|
return;
|
|
16948
16995
|
}
|
|
16949
16996
|
};
|
|
16997
|
+
|
|
16950
16998
|
var checkClick = function checkClick(e) {
|
|
16951
16999
|
var target = getActualTarget(e);
|
|
17000
|
+
|
|
16952
17001
|
if (findContainerIndex(target) >= 0) {
|
|
16953
17002
|
return;
|
|
16954
17003
|
}
|
|
17004
|
+
|
|
16955
17005
|
if (valueOrHandler(config.clickOutsideDeactivates, e)) {
|
|
16956
17006
|
return;
|
|
16957
17007
|
}
|
|
17008
|
+
|
|
16958
17009
|
if (valueOrHandler(config.allowOutsideClick, e)) {
|
|
16959
17010
|
return;
|
|
16960
17011
|
}
|
|
17012
|
+
|
|
16961
17013
|
e.preventDefault();
|
|
16962
17014
|
e.stopImmediatePropagation();
|
|
16963
|
-
};
|
|
16964
|
-
|
|
16965
|
-
//
|
|
17015
|
+
}; //
|
|
16966
17016
|
// EVENT LISTENERS
|
|
16967
17017
|
//
|
|
16968
17018
|
|
|
17019
|
+
|
|
16969
17020
|
var addListeners = function addListeners() {
|
|
16970
17021
|
if (!state.active) {
|
|
16971
17022
|
return;
|
|
16972
|
-
}
|
|
17023
|
+
} // There can be only one listening focus trap at a time
|
|
16973
17024
|
|
|
16974
|
-
// There can be only one listening focus trap at a time
|
|
16975
|
-
activeFocusTraps.activateTrap(trapStack, trap);
|
|
16976
17025
|
|
|
16977
|
-
// Delay ensures that the focused element doesn't capture the event
|
|
17026
|
+
activeFocusTraps.activateTrap(trap); // Delay ensures that the focused element doesn't capture the event
|
|
16978
17027
|
// that caused the focus trap activation.
|
|
17028
|
+
|
|
16979
17029
|
state.delayInitialFocusTimer = config.delayInitialFocus ? delay(function () {
|
|
16980
17030
|
tryFocus(getInitialFocusNode());
|
|
16981
17031
|
}) : tryFocus(getInitialFocusNode());
|
|
@@ -16998,58 +17048,70 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16998
17048
|
});
|
|
16999
17049
|
return trap;
|
|
17000
17050
|
};
|
|
17051
|
+
|
|
17001
17052
|
var removeListeners = function removeListeners() {
|
|
17002
17053
|
if (!state.active) {
|
|
17003
17054
|
return;
|
|
17004
17055
|
}
|
|
17056
|
+
|
|
17005
17057
|
doc.removeEventListener('focusin', checkFocusIn, true);
|
|
17006
17058
|
doc.removeEventListener('mousedown', checkPointerDown, true);
|
|
17007
17059
|
doc.removeEventListener('touchstart', checkPointerDown, true);
|
|
17008
17060
|
doc.removeEventListener('click', checkClick, true);
|
|
17009
17061
|
doc.removeEventListener('keydown', checkKey, true);
|
|
17010
17062
|
return trap;
|
|
17011
|
-
};
|
|
17012
|
-
|
|
17013
|
-
//
|
|
17063
|
+
}; //
|
|
17014
17064
|
// TRAP DEFINITION
|
|
17015
17065
|
//
|
|
17016
17066
|
|
|
17067
|
+
|
|
17017
17068
|
trap = {
|
|
17018
17069
|
get active() {
|
|
17019
17070
|
return state.active;
|
|
17020
17071
|
},
|
|
17072
|
+
|
|
17021
17073
|
get paused() {
|
|
17022
17074
|
return state.paused;
|
|
17023
17075
|
},
|
|
17076
|
+
|
|
17024
17077
|
activate: function activate(activateOptions) {
|
|
17025
17078
|
if (state.active) {
|
|
17026
17079
|
return this;
|
|
17027
17080
|
}
|
|
17081
|
+
|
|
17028
17082
|
var onActivate = getOption(activateOptions, 'onActivate');
|
|
17029
17083
|
var onPostActivate = getOption(activateOptions, 'onPostActivate');
|
|
17030
17084
|
var checkCanFocusTrap = getOption(activateOptions, 'checkCanFocusTrap');
|
|
17085
|
+
|
|
17031
17086
|
if (!checkCanFocusTrap) {
|
|
17032
17087
|
updateTabbableNodes();
|
|
17033
17088
|
}
|
|
17089
|
+
|
|
17034
17090
|
state.active = true;
|
|
17035
17091
|
state.paused = false;
|
|
17036
17092
|
state.nodeFocusedBeforeActivation = doc.activeElement;
|
|
17093
|
+
|
|
17037
17094
|
if (onActivate) {
|
|
17038
17095
|
onActivate();
|
|
17039
17096
|
}
|
|
17097
|
+
|
|
17040
17098
|
var finishActivation = function finishActivation() {
|
|
17041
17099
|
if (checkCanFocusTrap) {
|
|
17042
17100
|
updateTabbableNodes();
|
|
17043
17101
|
}
|
|
17102
|
+
|
|
17044
17103
|
addListeners();
|
|
17104
|
+
|
|
17045
17105
|
if (onPostActivate) {
|
|
17046
17106
|
onPostActivate();
|
|
17047
17107
|
}
|
|
17048
17108
|
};
|
|
17109
|
+
|
|
17049
17110
|
if (checkCanFocusTrap) {
|
|
17050
17111
|
checkCanFocusTrap(state.containers.concat()).then(finishActivation, finishActivation);
|
|
17051
17112
|
return this;
|
|
17052
17113
|
}
|
|
17114
|
+
|
|
17053
17115
|
finishActivation();
|
|
17054
17116
|
return this;
|
|
17055
17117
|
},
|
|
@@ -17057,38 +17119,46 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
17057
17119
|
if (!state.active) {
|
|
17058
17120
|
return this;
|
|
17059
17121
|
}
|
|
17122
|
+
|
|
17060
17123
|
var options = focus_trap_esm_objectSpread2({
|
|
17061
17124
|
onDeactivate: config.onDeactivate,
|
|
17062
17125
|
onPostDeactivate: config.onPostDeactivate,
|
|
17063
17126
|
checkCanReturnFocus: config.checkCanReturnFocus
|
|
17064
17127
|
}, deactivateOptions);
|
|
17128
|
+
|
|
17065
17129
|
clearTimeout(state.delayInitialFocusTimer); // noop if undefined
|
|
17130
|
+
|
|
17066
17131
|
state.delayInitialFocusTimer = undefined;
|
|
17067
17132
|
removeListeners();
|
|
17068
17133
|
state.active = false;
|
|
17069
17134
|
state.paused = false;
|
|
17070
|
-
activeFocusTraps.deactivateTrap(
|
|
17135
|
+
activeFocusTraps.deactivateTrap(trap);
|
|
17071
17136
|
var onDeactivate = getOption(options, 'onDeactivate');
|
|
17072
17137
|
var onPostDeactivate = getOption(options, 'onPostDeactivate');
|
|
17073
17138
|
var checkCanReturnFocus = getOption(options, 'checkCanReturnFocus');
|
|
17074
17139
|
var returnFocus = getOption(options, 'returnFocus', 'returnFocusOnDeactivate');
|
|
17140
|
+
|
|
17075
17141
|
if (onDeactivate) {
|
|
17076
17142
|
onDeactivate();
|
|
17077
17143
|
}
|
|
17144
|
+
|
|
17078
17145
|
var finishDeactivation = function finishDeactivation() {
|
|
17079
17146
|
delay(function () {
|
|
17080
17147
|
if (returnFocus) {
|
|
17081
17148
|
tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation));
|
|
17082
17149
|
}
|
|
17150
|
+
|
|
17083
17151
|
if (onPostDeactivate) {
|
|
17084
17152
|
onPostDeactivate();
|
|
17085
17153
|
}
|
|
17086
17154
|
});
|
|
17087
17155
|
};
|
|
17156
|
+
|
|
17088
17157
|
if (returnFocus && checkCanReturnFocus) {
|
|
17089
17158
|
checkCanReturnFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)).then(finishDeactivation, finishDeactivation);
|
|
17090
17159
|
return this;
|
|
17091
17160
|
}
|
|
17161
|
+
|
|
17092
17162
|
finishDeactivation();
|
|
17093
17163
|
return this;
|
|
17094
17164
|
},
|
|
@@ -17096,6 +17166,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
17096
17166
|
if (state.paused || !state.active) {
|
|
17097
17167
|
return this;
|
|
17098
17168
|
}
|
|
17169
|
+
|
|
17099
17170
|
state.paused = true;
|
|
17100
17171
|
removeListeners();
|
|
17101
17172
|
return this;
|
|
@@ -17104,6 +17175,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
17104
17175
|
if (!state.paused || !state.active) {
|
|
17105
17176
|
return this;
|
|
17106
17177
|
}
|
|
17178
|
+
|
|
17107
17179
|
state.paused = false;
|
|
17108
17180
|
updateTabbableNodes();
|
|
17109
17181
|
addListeners();
|
|
@@ -17114,14 +17186,15 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
17114
17186
|
state.containers = elementsAsArray.map(function (element) {
|
|
17115
17187
|
return typeof element === 'string' ? doc.querySelector(element) : element;
|
|
17116
17188
|
});
|
|
17189
|
+
|
|
17117
17190
|
if (state.active) {
|
|
17118
17191
|
updateTabbableNodes();
|
|
17119
17192
|
}
|
|
17193
|
+
|
|
17120
17194
|
return this;
|
|
17121
17195
|
}
|
|
17122
|
-
};
|
|
17196
|
+
}; // initialize container elements
|
|
17123
17197
|
|
|
17124
|
-
// initialize container elements
|
|
17125
17198
|
trap.updateContainerElements(elements);
|
|
17126
17199
|
return trap;
|
|
17127
17200
|
};
|