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