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