@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/index.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__(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){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
|
|
|
@@ -5195,6 +5195,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
5195
5195
|
"SeamlyGeneralError": () => (/* reexport */ SeamlyGeneralError),
|
|
5196
5196
|
"SeamlyLiveRegionContext": () => (/* reexport */ SeamlyLiveRegionContext),
|
|
5197
5197
|
"SeamlyOfflineError": () => (/* reexport */ SeamlyOfflineError),
|
|
5198
|
+
"SeamlyStoreProvider": () => (/* reexport */ components_Provider),
|
|
5198
5199
|
"Text": () => (/* reexport */ event_text),
|
|
5199
5200
|
"View": () => (/* reexport */ view),
|
|
5200
5201
|
"calculateVisibility": () => (/* reexport */ calculateVisibility),
|
|
@@ -7254,7 +7255,7 @@ _API_ready = new WeakMap(), _API_externalId = new WeakMap(), _API_layoutMode = n
|
|
|
7254
7255
|
return {
|
|
7255
7256
|
clientName: "@seamly/web-ui",
|
|
7256
7257
|
clientVariant: api_classPrivateFieldGet(this, _API_layoutMode, "f"),
|
|
7257
|
-
clientVersion: "21.0.2-beta.
|
|
7258
|
+
clientVersion: "21.0.2-beta.4",
|
|
7258
7259
|
currentUrl: window.location.toString(),
|
|
7259
7260
|
screenResolution: `${window.screen.width}x${window.screen.height}`,
|
|
7260
7261
|
timezone: getTimeZone(),
|
|
@@ -16484,24 +16485,21 @@ var isFocusable = function isFocusable(node, options) {
|
|
|
16484
16485
|
|
|
16485
16486
|
;// CONCATENATED MODULE: ./node_modules/focus-trap/dist/focus-trap.esm.js
|
|
16486
16487
|
/*!
|
|
16487
|
-
* focus-trap 7.
|
|
16488
|
+
* focus-trap 7.1.0
|
|
16488
16489
|
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
16489
16490
|
*/
|
|
16490
16491
|
|
|
16491
16492
|
|
|
16492
16493
|
function focus_trap_esm_ownKeys(object, enumerableOnly) {
|
|
16493
16494
|
var keys = Object.keys(object);
|
|
16494
|
-
|
|
16495
16495
|
if (Object.getOwnPropertySymbols) {
|
|
16496
16496
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
16497
16497
|
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
16498
16498
|
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
16499
16499
|
})), keys.push.apply(keys, symbols);
|
|
16500
16500
|
}
|
|
16501
|
-
|
|
16502
16501
|
return keys;
|
|
16503
16502
|
}
|
|
16504
|
-
|
|
16505
16503
|
function focus_trap_esm_objectSpread2(target) {
|
|
16506
16504
|
for (var i = 1; i < arguments.length; i++) {
|
|
16507
16505
|
var source = null != arguments[i] ? arguments[i] : {};
|
|
@@ -16511,10 +16509,8 @@ function focus_trap_esm_objectSpread2(target) {
|
|
|
16511
16509
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
16512
16510
|
});
|
|
16513
16511
|
}
|
|
16514
|
-
|
|
16515
16512
|
return target;
|
|
16516
16513
|
}
|
|
16517
|
-
|
|
16518
16514
|
function focus_trap_esm_defineProperty(obj, key, value) {
|
|
16519
16515
|
if (key in obj) {
|
|
16520
16516
|
Object.defineProperty(obj, key, {
|
|
@@ -16526,64 +16522,52 @@ function focus_trap_esm_defineProperty(obj, key, value) {
|
|
|
16526
16522
|
} else {
|
|
16527
16523
|
obj[key] = value;
|
|
16528
16524
|
}
|
|
16529
|
-
|
|
16530
16525
|
return obj;
|
|
16531
16526
|
}
|
|
16532
16527
|
|
|
16533
|
-
var
|
|
16534
|
-
|
|
16535
|
-
|
|
16536
|
-
|
|
16537
|
-
|
|
16538
|
-
|
|
16539
|
-
|
|
16540
|
-
if (activeTrap !== trap) {
|
|
16541
|
-
activeTrap.pause();
|
|
16542
|
-
}
|
|
16543
|
-
}
|
|
16544
|
-
|
|
16545
|
-
var trapIndex = trapQueue.indexOf(trap);
|
|
16546
|
-
|
|
16547
|
-
if (trapIndex === -1) {
|
|
16548
|
-
trapQueue.push(trap);
|
|
16549
|
-
} else {
|
|
16550
|
-
// move this existing trap to the front of the queue
|
|
16551
|
-
trapQueue.splice(trapIndex, 1);
|
|
16552
|
-
trapQueue.push(trap);
|
|
16553
|
-
}
|
|
16554
|
-
},
|
|
16555
|
-
deactivateTrap: function deactivateTrap(trap) {
|
|
16556
|
-
var trapIndex = trapQueue.indexOf(trap);
|
|
16557
|
-
|
|
16558
|
-
if (trapIndex !== -1) {
|
|
16559
|
-
trapQueue.splice(trapIndex, 1);
|
|
16560
|
-
}
|
|
16561
|
-
|
|
16562
|
-
if (trapQueue.length > 0) {
|
|
16563
|
-
trapQueue[trapQueue.length - 1].unpause();
|
|
16528
|
+
var rooTrapStack = [];
|
|
16529
|
+
var activeFocusTraps = {
|
|
16530
|
+
activateTrap: function activateTrap(trapStack, trap) {
|
|
16531
|
+
if (trapStack.length > 0) {
|
|
16532
|
+
var activeTrap = trapStack[trapStack.length - 1];
|
|
16533
|
+
if (activeTrap !== trap) {
|
|
16534
|
+
activeTrap.pause();
|
|
16564
16535
|
}
|
|
16565
16536
|
}
|
|
16566
|
-
|
|
16567
|
-
|
|
16568
|
-
|
|
16537
|
+
var trapIndex = trapStack.indexOf(trap);
|
|
16538
|
+
if (trapIndex === -1) {
|
|
16539
|
+
trapStack.push(trap);
|
|
16540
|
+
} else {
|
|
16541
|
+
// move this existing trap to the front of the queue
|
|
16542
|
+
trapStack.splice(trapIndex, 1);
|
|
16543
|
+
trapStack.push(trap);
|
|
16544
|
+
}
|
|
16545
|
+
},
|
|
16546
|
+
deactivateTrap: function deactivateTrap(trapStack, trap) {
|
|
16547
|
+
var trapIndex = trapStack.indexOf(trap);
|
|
16548
|
+
if (trapIndex !== -1) {
|
|
16549
|
+
trapStack.splice(trapIndex, 1);
|
|
16550
|
+
}
|
|
16551
|
+
if (trapStack.length > 0) {
|
|
16552
|
+
trapStack[trapStack.length - 1].unpause();
|
|
16553
|
+
}
|
|
16554
|
+
}
|
|
16555
|
+
};
|
|
16569
16556
|
var isSelectableInput = function isSelectableInput(node) {
|
|
16570
16557
|
return node.tagName && node.tagName.toLowerCase() === 'input' && typeof node.select === 'function';
|
|
16571
16558
|
};
|
|
16572
|
-
|
|
16573
16559
|
var isEscapeEvent = function isEscapeEvent(e) {
|
|
16574
16560
|
return e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27;
|
|
16575
16561
|
};
|
|
16576
|
-
|
|
16577
16562
|
var isTabEvent = function isTabEvent(e) {
|
|
16578
16563
|
return e.key === 'Tab' || e.keyCode === 9;
|
|
16579
16564
|
};
|
|
16580
|
-
|
|
16581
16565
|
var delay = function delay(fn) {
|
|
16582
16566
|
return setTimeout(fn, 0);
|
|
16583
|
-
};
|
|
16584
|
-
// of Array.findIndex() for our needs
|
|
16585
|
-
|
|
16567
|
+
};
|
|
16586
16568
|
|
|
16569
|
+
// Array.find/findIndex() are not supported on IE; this replicates enough
|
|
16570
|
+
// of Array.findIndex() for our needs
|
|
16587
16571
|
var findIndex = function findIndex(arr, fn) {
|
|
16588
16572
|
var idx = -1;
|
|
16589
16573
|
arr.every(function (value, i) {
|
|
@@ -16594,8 +16578,10 @@ var findIndex = function findIndex(arr, fn) {
|
|
|
16594
16578
|
|
|
16595
16579
|
return true; // next
|
|
16596
16580
|
});
|
|
16581
|
+
|
|
16597
16582
|
return idx;
|
|
16598
16583
|
};
|
|
16584
|
+
|
|
16599
16585
|
/**
|
|
16600
16586
|
* Get an option's value when it could be a plain value, or a handler that provides
|
|
16601
16587
|
* the value.
|
|
@@ -16603,16 +16589,12 @@ var findIndex = function findIndex(arr, fn) {
|
|
|
16603
16589
|
* @param {...*} [params] Any parameters to pass to the handler, if `value` is a function.
|
|
16604
16590
|
* @returns {*} The `value`, or the handler's returned value.
|
|
16605
16591
|
*/
|
|
16606
|
-
|
|
16607
|
-
|
|
16608
16592
|
var valueOrHandler = function valueOrHandler(value) {
|
|
16609
16593
|
for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
16610
16594
|
params[_key - 1] = arguments[_key];
|
|
16611
16595
|
}
|
|
16612
|
-
|
|
16613
16596
|
return typeof value === 'function' ? value.apply(void 0, params) : value;
|
|
16614
16597
|
};
|
|
16615
|
-
|
|
16616
16598
|
var getActualTarget = function getActualTarget(event) {
|
|
16617
16599
|
// NOTE: If the trap is _inside_ a shadow DOM, event.target will always be the
|
|
16618
16600
|
// shadow host. However, event.target.composedPath() will be an array of
|
|
@@ -16623,18 +16605,16 @@ var getActualTarget = function getActualTarget(event) {
|
|
|
16623
16605
|
// composedPath()[0] === event.target always).
|
|
16624
16606
|
return event.target.shadowRoot && typeof event.composedPath === 'function' ? event.composedPath()[0] : event.target;
|
|
16625
16607
|
};
|
|
16626
|
-
|
|
16627
16608
|
var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
16628
16609
|
// SSR: a live trap shouldn't be created in this type of environment so this
|
|
16629
16610
|
// should be safe code to execute if the `document` option isn't specified
|
|
16630
16611
|
var doc = (userOptions === null || userOptions === void 0 ? void 0 : userOptions.document) || document;
|
|
16631
|
-
|
|
16612
|
+
var trapStack = (userOptions === null || userOptions === void 0 ? void 0 : userOptions.trapStack) || rooTrapStack;
|
|
16632
16613
|
var config = focus_trap_esm_objectSpread2({
|
|
16633
16614
|
returnFocusOnDeactivate: true,
|
|
16634
16615
|
escapeDeactivates: true,
|
|
16635
16616
|
delayInitialFocus: true
|
|
16636
16617
|
}, userOptions);
|
|
16637
|
-
|
|
16638
16618
|
var state = {
|
|
16639
16619
|
// containers given to createFocusTrap()
|
|
16640
16620
|
// @type {Array<HTMLElement>}
|
|
@@ -16654,6 +16634,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16654
16634
|
// }>}
|
|
16655
16635
|
containerGroups: [],
|
|
16656
16636
|
// same order/length as `containers` list
|
|
16637
|
+
|
|
16657
16638
|
// references to objects in `containerGroups`, but only those that actually have
|
|
16658
16639
|
// tabbable nodes in them
|
|
16659
16640
|
// NOTE: same order as `containers` and `containerGroups`, but __not necessarily__
|
|
@@ -16677,10 +16658,10 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16677
16658
|
* @param {string|undefined} [configOptionName] Name of option to use __instead of__ `optionName`
|
|
16678
16659
|
* IIF `configOverrideOptions` is not defined. Otherwise, `optionName` is used.
|
|
16679
16660
|
*/
|
|
16680
|
-
|
|
16681
16661
|
var getOption = function getOption(configOverrideOptions, optionName, configOptionName) {
|
|
16682
16662
|
return configOverrideOptions && configOverrideOptions[optionName] !== undefined ? configOverrideOptions[optionName] : config[configOptionName || optionName];
|
|
16683
16663
|
};
|
|
16664
|
+
|
|
16684
16665
|
/**
|
|
16685
16666
|
* Finds the index of the container that contains the element.
|
|
16686
16667
|
* @param {HTMLElement} element
|
|
@@ -16688,16 +16669,15 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16688
16669
|
* `state.containerGroups` (the order/length of these lists are the same); -1
|
|
16689
16670
|
* if the element isn't found.
|
|
16690
16671
|
*/
|
|
16691
|
-
|
|
16692
|
-
|
|
16693
16672
|
var findContainerIndex = function findContainerIndex(element) {
|
|
16694
16673
|
// NOTE: search `containerGroups` because it's possible a group contains no tabbable
|
|
16695
16674
|
// nodes, but still contains focusable nodes (e.g. if they all have `tabindex=-1`)
|
|
16696
16675
|
// and we still need to find the element in there
|
|
16697
16676
|
return state.containerGroups.findIndex(function (_ref) {
|
|
16698
16677
|
var container = _ref.container,
|
|
16699
|
-
|
|
16700
|
-
return container.contains(element) ||
|
|
16678
|
+
tabbableNodes = _ref.tabbableNodes;
|
|
16679
|
+
return container.contains(element) ||
|
|
16680
|
+
// fall back to explicit tabbable search which will take into consideration any
|
|
16701
16681
|
// web components if the `tabbableOptions.getShadowRoot` option was used for
|
|
16702
16682
|
// the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't
|
|
16703
16683
|
// look inside web components even if open)
|
|
@@ -16706,6 +16686,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16706
16686
|
});
|
|
16707
16687
|
});
|
|
16708
16688
|
};
|
|
16689
|
+
|
|
16709
16690
|
/**
|
|
16710
16691
|
* Gets the node for the given option, which is expected to be an option that
|
|
16711
16692
|
* can be either a DOM node, a string that is a selector to get a node, `false`
|
|
@@ -16719,19 +16700,14 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16719
16700
|
* @throws {Error} If the option is set, not `false`, and is not, or does not
|
|
16720
16701
|
* resolve to a node.
|
|
16721
16702
|
*/
|
|
16722
|
-
|
|
16723
|
-
|
|
16724
16703
|
var getNodeForOption = function getNodeForOption(optionName) {
|
|
16725
16704
|
var optionValue = config[optionName];
|
|
16726
|
-
|
|
16727
16705
|
if (typeof optionValue === 'function') {
|
|
16728
16706
|
for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
16729
16707
|
params[_key2 - 1] = arguments[_key2];
|
|
16730
16708
|
}
|
|
16731
|
-
|
|
16732
16709
|
optionValue = optionValue.apply(void 0, params);
|
|
16733
16710
|
}
|
|
16734
|
-
|
|
16735
16711
|
if (optionValue === true) {
|
|
16736
16712
|
optionValue = undefined; // use default value
|
|
16737
16713
|
}
|
|
@@ -16739,56 +16715,51 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16739
16715
|
if (!optionValue) {
|
|
16740
16716
|
if (optionValue === undefined || optionValue === false) {
|
|
16741
16717
|
return optionValue;
|
|
16742
|
-
}
|
|
16743
|
-
|
|
16718
|
+
}
|
|
16719
|
+
// else, empty string (invalid), null (invalid), 0 (invalid)
|
|
16744
16720
|
|
|
16745
16721
|
throw new Error("`".concat(optionName, "` was specified but was not a node, or did not return a node"));
|
|
16746
16722
|
}
|
|
16747
|
-
|
|
16748
16723
|
var node = optionValue; // could be HTMLElement, SVGElement, or non-empty string at this point
|
|
16749
16724
|
|
|
16750
16725
|
if (typeof optionValue === 'string') {
|
|
16751
16726
|
node = doc.querySelector(optionValue); // resolve to node, or null if fails
|
|
16752
|
-
|
|
16753
16727
|
if (!node) {
|
|
16754
16728
|
throw new Error("`".concat(optionName, "` as selector refers to no known node"));
|
|
16755
16729
|
}
|
|
16756
16730
|
}
|
|
16757
|
-
|
|
16758
16731
|
return node;
|
|
16759
16732
|
};
|
|
16760
|
-
|
|
16761
16733
|
var getInitialFocusNode = function getInitialFocusNode() {
|
|
16762
|
-
var node = getNodeForOption('initialFocus');
|
|
16734
|
+
var node = getNodeForOption('initialFocus');
|
|
16763
16735
|
|
|
16736
|
+
// false explicitly indicates we want no initialFocus at all
|
|
16764
16737
|
if (node === false) {
|
|
16765
16738
|
return false;
|
|
16766
16739
|
}
|
|
16767
|
-
|
|
16768
16740
|
if (node === undefined) {
|
|
16769
16741
|
// option not specified: use fallback options
|
|
16770
16742
|
if (findContainerIndex(doc.activeElement) >= 0) {
|
|
16771
16743
|
node = doc.activeElement;
|
|
16772
16744
|
} else {
|
|
16773
16745
|
var firstTabbableGroup = state.tabbableGroups[0];
|
|
16774
|
-
var firstTabbableNode = firstTabbableGroup && firstTabbableGroup.firstTabbableNode;
|
|
16746
|
+
var firstTabbableNode = firstTabbableGroup && firstTabbableGroup.firstTabbableNode;
|
|
16775
16747
|
|
|
16748
|
+
// NOTE: `fallbackFocus` option function cannot return `false` (not supported)
|
|
16776
16749
|
node = firstTabbableNode || getNodeForOption('fallbackFocus');
|
|
16777
16750
|
}
|
|
16778
16751
|
}
|
|
16779
|
-
|
|
16780
16752
|
if (!node) {
|
|
16781
16753
|
throw new Error('Your focus-trap needs to have at least one focusable element');
|
|
16782
16754
|
}
|
|
16783
|
-
|
|
16784
16755
|
return node;
|
|
16785
16756
|
};
|
|
16786
|
-
|
|
16787
16757
|
var updateTabbableNodes = function updateTabbableNodes() {
|
|
16788
16758
|
state.containerGroups = state.containers.map(function (container) {
|
|
16789
|
-
var tabbableNodes = tabbable(container, config.tabbableOptions);
|
|
16790
|
-
// are a superset of tabbable nodes
|
|
16759
|
+
var tabbableNodes = tabbable(container, config.tabbableOptions);
|
|
16791
16760
|
|
|
16761
|
+
// NOTE: if we have tabbable nodes, we must have focusable nodes; focusable nodes
|
|
16762
|
+
// are a superset of tabbable nodes
|
|
16792
16763
|
var focusableNodes = focusable(container, config.tabbableOptions);
|
|
16793
16764
|
return {
|
|
16794
16765
|
container: container,
|
|
@@ -16796,7 +16767,6 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16796
16767
|
focusableNodes: focusableNodes,
|
|
16797
16768
|
firstTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[0] : null,
|
|
16798
16769
|
lastTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[tabbableNodes.length - 1] : null,
|
|
16799
|
-
|
|
16800
16770
|
/**
|
|
16801
16771
|
* Finds the __tabbable__ node that follows the given node in the specified direction,
|
|
16802
16772
|
* in this container, if any.
|
|
@@ -16820,17 +16790,14 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16820
16790
|
var nodeIdx = focusableNodes.findIndex(function (n) {
|
|
16821
16791
|
return n === node;
|
|
16822
16792
|
});
|
|
16823
|
-
|
|
16824
16793
|
if (nodeIdx < 0) {
|
|
16825
16794
|
return undefined;
|
|
16826
16795
|
}
|
|
16827
|
-
|
|
16828
16796
|
if (forward) {
|
|
16829
16797
|
return focusableNodes.slice(nodeIdx + 1).find(function (n) {
|
|
16830
16798
|
return isTabbable(n, config.tabbableOptions);
|
|
16831
16799
|
});
|
|
16832
16800
|
}
|
|
16833
|
-
|
|
16834
16801
|
return focusableNodes.slice(0, nodeIdx).reverse().find(function (n) {
|
|
16835
16802
|
return isTabbable(n, config.tabbableOptions);
|
|
16836
16803
|
});
|
|
@@ -16839,53 +16806,46 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16839
16806
|
});
|
|
16840
16807
|
state.tabbableGroups = state.containerGroups.filter(function (group) {
|
|
16841
16808
|
return group.tabbableNodes.length > 0;
|
|
16842
|
-
});
|
|
16809
|
+
});
|
|
16843
16810
|
|
|
16811
|
+
// throw if no groups have tabbable nodes and we don't have a fallback focus node either
|
|
16844
16812
|
if (state.tabbableGroups.length <= 0 && !getNodeForOption('fallbackFocus') // returning false not supported for this option
|
|
16845
16813
|
) {
|
|
16846
16814
|
throw new Error('Your focus-trap must have at least one container with at least one tabbable node in it at all times');
|
|
16847
16815
|
}
|
|
16848
16816
|
};
|
|
16849
|
-
|
|
16850
16817
|
var tryFocus = function tryFocus(node) {
|
|
16851
16818
|
if (node === false) {
|
|
16852
16819
|
return;
|
|
16853
16820
|
}
|
|
16854
|
-
|
|
16855
16821
|
if (node === doc.activeElement) {
|
|
16856
16822
|
return;
|
|
16857
16823
|
}
|
|
16858
|
-
|
|
16859
16824
|
if (!node || !node.focus) {
|
|
16860
16825
|
tryFocus(getInitialFocusNode());
|
|
16861
16826
|
return;
|
|
16862
16827
|
}
|
|
16863
|
-
|
|
16864
16828
|
node.focus({
|
|
16865
16829
|
preventScroll: !!config.preventScroll
|
|
16866
16830
|
});
|
|
16867
16831
|
state.mostRecentlyFocusedNode = node;
|
|
16868
|
-
|
|
16869
16832
|
if (isSelectableInput(node)) {
|
|
16870
16833
|
node.select();
|
|
16871
16834
|
}
|
|
16872
16835
|
};
|
|
16873
|
-
|
|
16874
16836
|
var getReturnFocusNode = function getReturnFocusNode(previousActiveElement) {
|
|
16875
16837
|
var node = getNodeForOption('setReturnFocus', previousActiveElement);
|
|
16876
16838
|
return node ? node : node === false ? false : previousActiveElement;
|
|
16877
|
-
};
|
|
16878
|
-
// so that it precedes the focus event.
|
|
16879
|
-
|
|
16839
|
+
};
|
|
16880
16840
|
|
|
16841
|
+
// This needs to be done on mousedown and touchstart instead of click
|
|
16842
|
+
// so that it precedes the focus event.
|
|
16881
16843
|
var checkPointerDown = function checkPointerDown(e) {
|
|
16882
16844
|
var target = getActualTarget(e);
|
|
16883
|
-
|
|
16884
16845
|
if (findContainerIndex(target) >= 0) {
|
|
16885
16846
|
// allow the click since it ocurred inside the trap
|
|
16886
16847
|
return;
|
|
16887
16848
|
}
|
|
16888
|
-
|
|
16889
16849
|
if (valueOrHandler(config.clickOutsideDeactivates, e)) {
|
|
16890
16850
|
// immediately deactivate the trap
|
|
16891
16851
|
trap.deactivate({
|
|
@@ -16903,25 +16863,26 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16903
16863
|
returnFocus: config.returnFocusOnDeactivate && !isFocusable(target, config.tabbableOptions)
|
|
16904
16864
|
});
|
|
16905
16865
|
return;
|
|
16906
|
-
}
|
|
16866
|
+
}
|
|
16867
|
+
|
|
16868
|
+
// This is needed for mobile devices.
|
|
16907
16869
|
// (If we'll only let `click` events through,
|
|
16908
16870
|
// then on mobile they will be blocked anyways if `touchstart` is blocked.)
|
|
16909
|
-
|
|
16910
|
-
|
|
16911
16871
|
if (valueOrHandler(config.allowOutsideClick, e)) {
|
|
16912
16872
|
// allow the click outside the trap to take place
|
|
16913
16873
|
return;
|
|
16914
|
-
}
|
|
16915
|
-
|
|
16874
|
+
}
|
|
16916
16875
|
|
|
16876
|
+
// otherwise, prevent the click
|
|
16917
16877
|
e.preventDefault();
|
|
16918
|
-
};
|
|
16919
|
-
|
|
16878
|
+
};
|
|
16920
16879
|
|
|
16880
|
+
// In case focus escapes the trap for some strange reason, pull it back in.
|
|
16921
16881
|
var checkFocusIn = function checkFocusIn(e) {
|
|
16922
16882
|
var target = getActualTarget(e);
|
|
16923
|
-
var targetContained = findContainerIndex(target) >= 0;
|
|
16883
|
+
var targetContained = findContainerIndex(target) >= 0;
|
|
16924
16884
|
|
|
16885
|
+
// In Firefox when you Tab out of an iframe the Document is briefly focused.
|
|
16925
16886
|
if (targetContained || target instanceof Document) {
|
|
16926
16887
|
if (targetContained) {
|
|
16927
16888
|
state.mostRecentlyFocusedNode = target;
|
|
@@ -16931,24 +16892,22 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16931
16892
|
e.stopImmediatePropagation();
|
|
16932
16893
|
tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
|
|
16933
16894
|
}
|
|
16934
|
-
};
|
|
16895
|
+
};
|
|
16896
|
+
|
|
16897
|
+
// Hijack Tab events on the first and last focusable nodes of the trap,
|
|
16935
16898
|
// in order to prevent focus from escaping. If it escapes for even a
|
|
16936
16899
|
// moment it can end up scrolling the page and causing confusion so we
|
|
16937
16900
|
// kind of need to capture the action at the keydown phase.
|
|
16938
|
-
|
|
16939
|
-
|
|
16940
16901
|
var checkTab = function checkTab(e) {
|
|
16941
16902
|
var target = getActualTarget(e);
|
|
16942
16903
|
updateTabbableNodes();
|
|
16943
16904
|
var destinationNode = null;
|
|
16944
|
-
|
|
16945
16905
|
if (state.tabbableGroups.length > 0) {
|
|
16946
16906
|
// make sure the target is actually contained in a group
|
|
16947
16907
|
// NOTE: the target may also be the container itself if it's focusable
|
|
16948
16908
|
// with tabIndex='-1' and was given initial focus
|
|
16949
16909
|
var containerIndex = findContainerIndex(target);
|
|
16950
16910
|
var containerGroup = containerIndex >= 0 ? state.containerGroups[containerIndex] : undefined;
|
|
16951
|
-
|
|
16952
16911
|
if (containerIndex < 0) {
|
|
16953
16912
|
// target not found in any group: quite possible focus has escaped the trap,
|
|
16954
16913
|
// so bring it back in to...
|
|
@@ -16961,12 +16920,12 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16961
16920
|
}
|
|
16962
16921
|
} else if (e.shiftKey) {
|
|
16963
16922
|
// REVERSE
|
|
16923
|
+
|
|
16964
16924
|
// is the target the first tabbable node in a group?
|
|
16965
16925
|
var startOfGroupIndex = findIndex(state.tabbableGroups, function (_ref2) {
|
|
16966
16926
|
var firstTabbableNode = _ref2.firstTabbableNode;
|
|
16967
16927
|
return target === firstTabbableNode;
|
|
16968
16928
|
});
|
|
16969
|
-
|
|
16970
16929
|
if (startOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target, false))) {
|
|
16971
16930
|
// an exception case where the target is either the container itself, or
|
|
16972
16931
|
// a non-tabbable node that was given focus (i.e. tabindex is negative
|
|
@@ -16976,7 +16935,6 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16976
16935
|
// first tabbable node, and go to the last tabbable node of the LAST group
|
|
16977
16936
|
startOfGroupIndex = containerIndex;
|
|
16978
16937
|
}
|
|
16979
|
-
|
|
16980
16938
|
if (startOfGroupIndex >= 0) {
|
|
16981
16939
|
// YES: then shift+tab should go to the last tabbable node in the
|
|
16982
16940
|
// previous group (and wrap around to the last tabbable node of
|
|
@@ -16987,12 +16945,12 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
16987
16945
|
}
|
|
16988
16946
|
} else {
|
|
16989
16947
|
// FORWARD
|
|
16948
|
+
|
|
16990
16949
|
// is the target the last tabbable node in a group?
|
|
16991
16950
|
var lastOfGroupIndex = findIndex(state.tabbableGroups, function (_ref3) {
|
|
16992
16951
|
var lastTabbableNode = _ref3.lastTabbableNode;
|
|
16993
16952
|
return target === lastTabbableNode;
|
|
16994
16953
|
});
|
|
16995
|
-
|
|
16996
16954
|
if (lastOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target))) {
|
|
16997
16955
|
// an exception case where the target is the container itself, or
|
|
16998
16956
|
// a non-tabbable node that was given focus (i.e. tabindex is negative
|
|
@@ -17002,13 +16960,11 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
17002
16960
|
// last tabbable node, and go to the first tabbable node of the FIRST group
|
|
17003
16961
|
lastOfGroupIndex = containerIndex;
|
|
17004
16962
|
}
|
|
17005
|
-
|
|
17006
16963
|
if (lastOfGroupIndex >= 0) {
|
|
17007
16964
|
// YES: then tab should go to the first tabbable node in the next
|
|
17008
16965
|
// group (and wrap around to the first tabbable node of the FIRST
|
|
17009
16966
|
// group if it's the last tabbable node of the LAST group)
|
|
17010
16967
|
var _destinationGroupIndex = lastOfGroupIndex === state.tabbableGroups.length - 1 ? 0 : lastOfGroupIndex + 1;
|
|
17011
|
-
|
|
17012
16968
|
var _destinationGroup = state.tabbableGroups[_destinationGroupIndex];
|
|
17013
16969
|
destinationNode = _destinationGroup.firstTabbableNode;
|
|
17014
16970
|
}
|
|
@@ -17017,12 +16973,11 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
17017
16973
|
// NOTE: the fallbackFocus option does not support returning false to opt-out
|
|
17018
16974
|
destinationNode = getNodeForOption('fallbackFocus');
|
|
17019
16975
|
}
|
|
17020
|
-
|
|
17021
16976
|
if (destinationNode) {
|
|
17022
16977
|
e.preventDefault();
|
|
17023
16978
|
tryFocus(destinationNode);
|
|
17024
|
-
}
|
|
17025
|
-
|
|
16979
|
+
}
|
|
16980
|
+
// else, let the browser take care of [shift+]tab and move the focus
|
|
17026
16981
|
};
|
|
17027
16982
|
|
|
17028
16983
|
var checkKey = function checkKey(e) {
|
|
@@ -17031,44 +16986,40 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
17031
16986
|
trap.deactivate();
|
|
17032
16987
|
return;
|
|
17033
16988
|
}
|
|
17034
|
-
|
|
17035
16989
|
if (isTabEvent(e)) {
|
|
17036
16990
|
checkTab(e);
|
|
17037
16991
|
return;
|
|
17038
16992
|
}
|
|
17039
16993
|
};
|
|
17040
|
-
|
|
17041
16994
|
var checkClick = function checkClick(e) {
|
|
17042
16995
|
var target = getActualTarget(e);
|
|
17043
|
-
|
|
17044
16996
|
if (findContainerIndex(target) >= 0) {
|
|
17045
16997
|
return;
|
|
17046
16998
|
}
|
|
17047
|
-
|
|
17048
16999
|
if (valueOrHandler(config.clickOutsideDeactivates, e)) {
|
|
17049
17000
|
return;
|
|
17050
17001
|
}
|
|
17051
|
-
|
|
17052
17002
|
if (valueOrHandler(config.allowOutsideClick, e)) {
|
|
17053
17003
|
return;
|
|
17054
17004
|
}
|
|
17055
|
-
|
|
17056
17005
|
e.preventDefault();
|
|
17057
17006
|
e.stopImmediatePropagation();
|
|
17058
|
-
};
|
|
17007
|
+
};
|
|
17008
|
+
|
|
17009
|
+
//
|
|
17059
17010
|
// EVENT LISTENERS
|
|
17060
17011
|
//
|
|
17061
17012
|
|
|
17062
|
-
|
|
17063
17013
|
var addListeners = function addListeners() {
|
|
17064
17014
|
if (!state.active) {
|
|
17065
17015
|
return;
|
|
17066
|
-
}
|
|
17016
|
+
}
|
|
17067
17017
|
|
|
17018
|
+
// There can be only one listening focus trap at a time
|
|
17019
|
+
activeFocusTraps.activateTrap(trapStack, trap);
|
|
17068
17020
|
|
|
17069
|
-
|
|
17021
|
+
// Delay ensures that the focused element doesn't capture the event
|
|
17070
17022
|
// that caused the focus trap activation.
|
|
17071
|
-
|
|
17072
17023
|
state.delayInitialFocusTimer = config.delayInitialFocus ? delay(function () {
|
|
17073
17024
|
tryFocus(getInitialFocusNode());
|
|
17074
17025
|
}) : tryFocus(getInitialFocusNode());
|
|
@@ -17091,70 +17042,58 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
17091
17042
|
});
|
|
17092
17043
|
return trap;
|
|
17093
17044
|
};
|
|
17094
|
-
|
|
17095
17045
|
var removeListeners = function removeListeners() {
|
|
17096
17046
|
if (!state.active) {
|
|
17097
17047
|
return;
|
|
17098
17048
|
}
|
|
17099
|
-
|
|
17100
17049
|
doc.removeEventListener('focusin', checkFocusIn, true);
|
|
17101
17050
|
doc.removeEventListener('mousedown', checkPointerDown, true);
|
|
17102
17051
|
doc.removeEventListener('touchstart', checkPointerDown, true);
|
|
17103
17052
|
doc.removeEventListener('click', checkClick, true);
|
|
17104
17053
|
doc.removeEventListener('keydown', checkKey, true);
|
|
17105
17054
|
return trap;
|
|
17106
|
-
};
|
|
17055
|
+
};
|
|
17056
|
+
|
|
17057
|
+
//
|
|
17107
17058
|
// TRAP DEFINITION
|
|
17108
17059
|
//
|
|
17109
17060
|
|
|
17110
|
-
|
|
17111
17061
|
trap = {
|
|
17112
17062
|
get active() {
|
|
17113
17063
|
return state.active;
|
|
17114
17064
|
},
|
|
17115
|
-
|
|
17116
17065
|
get paused() {
|
|
17117
17066
|
return state.paused;
|
|
17118
17067
|
},
|
|
17119
|
-
|
|
17120
17068
|
activate: function activate(activateOptions) {
|
|
17121
17069
|
if (state.active) {
|
|
17122
17070
|
return this;
|
|
17123
17071
|
}
|
|
17124
|
-
|
|
17125
17072
|
var onActivate = getOption(activateOptions, 'onActivate');
|
|
17126
17073
|
var onPostActivate = getOption(activateOptions, 'onPostActivate');
|
|
17127
17074
|
var checkCanFocusTrap = getOption(activateOptions, 'checkCanFocusTrap');
|
|
17128
|
-
|
|
17129
17075
|
if (!checkCanFocusTrap) {
|
|
17130
17076
|
updateTabbableNodes();
|
|
17131
17077
|
}
|
|
17132
|
-
|
|
17133
17078
|
state.active = true;
|
|
17134
17079
|
state.paused = false;
|
|
17135
17080
|
state.nodeFocusedBeforeActivation = doc.activeElement;
|
|
17136
|
-
|
|
17137
17081
|
if (onActivate) {
|
|
17138
17082
|
onActivate();
|
|
17139
17083
|
}
|
|
17140
|
-
|
|
17141
17084
|
var finishActivation = function finishActivation() {
|
|
17142
17085
|
if (checkCanFocusTrap) {
|
|
17143
17086
|
updateTabbableNodes();
|
|
17144
17087
|
}
|
|
17145
|
-
|
|
17146
17088
|
addListeners();
|
|
17147
|
-
|
|
17148
17089
|
if (onPostActivate) {
|
|
17149
17090
|
onPostActivate();
|
|
17150
17091
|
}
|
|
17151
17092
|
};
|
|
17152
|
-
|
|
17153
17093
|
if (checkCanFocusTrap) {
|
|
17154
17094
|
checkCanFocusTrap(state.containers.concat()).then(finishActivation, finishActivation);
|
|
17155
17095
|
return this;
|
|
17156
17096
|
}
|
|
17157
|
-
|
|
17158
17097
|
finishActivation();
|
|
17159
17098
|
return this;
|
|
17160
17099
|
},
|
|
@@ -17162,46 +17101,38 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
17162
17101
|
if (!state.active) {
|
|
17163
17102
|
return this;
|
|
17164
17103
|
}
|
|
17165
|
-
|
|
17166
17104
|
var options = focus_trap_esm_objectSpread2({
|
|
17167
17105
|
onDeactivate: config.onDeactivate,
|
|
17168
17106
|
onPostDeactivate: config.onPostDeactivate,
|
|
17169
17107
|
checkCanReturnFocus: config.checkCanReturnFocus
|
|
17170
17108
|
}, deactivateOptions);
|
|
17171
|
-
|
|
17172
17109
|
clearTimeout(state.delayInitialFocusTimer); // noop if undefined
|
|
17173
|
-
|
|
17174
17110
|
state.delayInitialFocusTimer = undefined;
|
|
17175
17111
|
removeListeners();
|
|
17176
17112
|
state.active = false;
|
|
17177
17113
|
state.paused = false;
|
|
17178
|
-
activeFocusTraps.deactivateTrap(trap);
|
|
17114
|
+
activeFocusTraps.deactivateTrap(trapStack, trap);
|
|
17179
17115
|
var onDeactivate = getOption(options, 'onDeactivate');
|
|
17180
17116
|
var onPostDeactivate = getOption(options, 'onPostDeactivate');
|
|
17181
17117
|
var checkCanReturnFocus = getOption(options, 'checkCanReturnFocus');
|
|
17182
17118
|
var returnFocus = getOption(options, 'returnFocus', 'returnFocusOnDeactivate');
|
|
17183
|
-
|
|
17184
17119
|
if (onDeactivate) {
|
|
17185
17120
|
onDeactivate();
|
|
17186
17121
|
}
|
|
17187
|
-
|
|
17188
17122
|
var finishDeactivation = function finishDeactivation() {
|
|
17189
17123
|
delay(function () {
|
|
17190
17124
|
if (returnFocus) {
|
|
17191
17125
|
tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation));
|
|
17192
17126
|
}
|
|
17193
|
-
|
|
17194
17127
|
if (onPostDeactivate) {
|
|
17195
17128
|
onPostDeactivate();
|
|
17196
17129
|
}
|
|
17197
17130
|
});
|
|
17198
17131
|
};
|
|
17199
|
-
|
|
17200
17132
|
if (returnFocus && checkCanReturnFocus) {
|
|
17201
17133
|
checkCanReturnFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)).then(finishDeactivation, finishDeactivation);
|
|
17202
17134
|
return this;
|
|
17203
17135
|
}
|
|
17204
|
-
|
|
17205
17136
|
finishDeactivation();
|
|
17206
17137
|
return this;
|
|
17207
17138
|
},
|
|
@@ -17209,7 +17140,6 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
17209
17140
|
if (state.paused || !state.active) {
|
|
17210
17141
|
return this;
|
|
17211
17142
|
}
|
|
17212
|
-
|
|
17213
17143
|
state.paused = true;
|
|
17214
17144
|
removeListeners();
|
|
17215
17145
|
return this;
|
|
@@ -17218,7 +17148,6 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
17218
17148
|
if (!state.paused || !state.active) {
|
|
17219
17149
|
return this;
|
|
17220
17150
|
}
|
|
17221
|
-
|
|
17222
17151
|
state.paused = false;
|
|
17223
17152
|
updateTabbableNodes();
|
|
17224
17153
|
addListeners();
|
|
@@ -17229,15 +17158,14 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
17229
17158
|
state.containers = elementsAsArray.map(function (element) {
|
|
17230
17159
|
return typeof element === 'string' ? doc.querySelector(element) : element;
|
|
17231
17160
|
});
|
|
17232
|
-
|
|
17233
17161
|
if (state.active) {
|
|
17234
17162
|
updateTabbableNodes();
|
|
17235
17163
|
}
|
|
17236
|
-
|
|
17237
17164
|
return this;
|
|
17238
17165
|
}
|
|
17239
|
-
};
|
|
17166
|
+
};
|
|
17240
17167
|
|
|
17168
|
+
// initialize container elements
|
|
17241
17169
|
trap.updateContainerElements(elements);
|
|
17242
17170
|
return trap;
|
|
17243
17171
|
};
|
|
@@ -22081,7 +22009,19 @@ class ExternalApi {
|
|
|
22081
22009
|
}
|
|
22082
22010
|
});
|
|
22083
22011
|
}
|
|
22012
|
+
instanceInitializing(namespace) {
|
|
22013
|
+
const instances = Object.keys(this._instances);
|
|
22014
|
+
return !namespace && instances.length > 0 || instances.includes(namespace);
|
|
22015
|
+
}
|
|
22084
22016
|
setContext(action, args) {
|
|
22017
|
+
const {
|
|
22018
|
+
instance: namespace
|
|
22019
|
+
} = args;
|
|
22020
|
+
// Do not set this action in context if we are already initializing.
|
|
22021
|
+
// If we do, it will not be sent to the server anymore (because it gets marked as 'handled').
|
|
22022
|
+
if (this.instanceInitializing(namespace)) {
|
|
22023
|
+
return false;
|
|
22024
|
+
}
|
|
22085
22025
|
switch (action) {
|
|
22086
22026
|
case 'setTopic':
|
|
22087
22027
|
const {
|
|
@@ -22150,9 +22090,7 @@ class ExternalApi {
|
|
|
22150
22090
|
|
|
22151
22091
|
// results will be an array containing the results of wether an instance has
|
|
22152
22092
|
// handled the action or not
|
|
22153
|
-
const results = instances.map(instance =>
|
|
22154
|
-
return !namespace || instance.namespace === namespace ? instance.execFunction(action, ...args) : false;
|
|
22155
|
-
});
|
|
22093
|
+
const results = instances.map(instance => !namespace || instance.namespace === namespace ? instance.execFunction(action, ...args) : false);
|
|
22156
22094
|
|
|
22157
22095
|
// test if any of the instances has handled the action
|
|
22158
22096
|
return results.some(Boolean);
|
|
@@ -22792,6 +22730,7 @@ const useSeamlyActions = () => {
|
|
|
22792
22730
|
|
|
22793
22731
|
// Used by: StyleGuide
|
|
22794
22732
|
|
|
22733
|
+
|
|
22795
22734
|
// Used by: Client
|
|
22796
22735
|
|
|
22797
22736
|
// Used by: Client
|