@tedi-design-system/react 18.0.0-rc.3 → 18.0.0-rc.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/_virtual/index.es13.js +2 -2
- package/_virtual/index.es14.js +2 -2
- package/bundle-stats.html +1 -1
- package/external/@floating-ui/core/dist/floating-ui.core.cjs.js +1 -1
- package/external/@floating-ui/core/dist/floating-ui.core.es.js +275 -271
- package/external/@floating-ui/dom/dist/floating-ui.dom.cjs.js +1 -1
- package/external/@floating-ui/dom/dist/floating-ui.dom.es.js +189 -188
- package/external/@floating-ui/react/dist/floating-ui.react.cjs.js +1 -1
- package/external/@floating-ui/react/dist/floating-ui.react.es.js +1419 -1538
- package/external/@floating-ui/react/dist/floating-ui.react.utils.cjs.js +1 -1
- package/external/@floating-ui/react/dist/floating-ui.react.utils.es.js +348 -81
- package/external/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs.js +1 -1
- package/external/@floating-ui/react-dom/dist/floating-ui.react-dom.es.js +113 -93
- package/external/@floating-ui/utils/dist/floating-ui.utils.cjs.js +1 -1
- package/external/@floating-ui/utils/dist/floating-ui.utils.dom.cjs.js +1 -1
- package/external/@floating-ui/utils/dist/floating-ui.utils.dom.es.js +97 -97
- package/external/@floating-ui/utils/dist/floating-ui.utils.es.js +66 -68
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/index.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/index.es.js +1 -1
- package/external/lodash-es/_baseUnset.cjs.js +1 -1
- package/external/lodash-es/_baseUnset.es.js +12 -19
- package/external/prop-types/external/react-is/cjs/react-is.development.cjs.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.development.es.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.production.min.es.js +1 -1
- package/external/prop-types/external/react-is/index.cjs.js +1 -1
- package/external/prop-types/external/react-is/index.es.js +1 -1
- package/external/react-is/index.cjs.js +1 -1
- package/external/react-is/index.es.js +1 -1
- package/external/tabbable/dist/index.esm.cjs.js +1 -1
- package/external/tabbable/dist/index.esm.es.js +72 -63
- package/external/toposort/index.cjs.js +1 -1
- package/external/toposort/index.es.js +1 -1
- package/index.css +1 -1
- package/package.json +4 -4
- package/src/community/components/modal/modal-closer.d.ts +6 -0
- package/src/community/components/modal/modal-provider.d.ts +6 -0
- package/src/community/components/modal/modal-trigger.d.ts +6 -0
- package/src/community/components/modal/modal.d.ts +6 -0
- package/src/tedi/components/form/time-field/time-field.es.js +3 -3
- package/src/tedi/components/overlays/modal/index.d.ts +8 -0
- package/src/tedi/components/overlays/modal/modal-body/modal-body.cjs.js +1 -0
- package/src/tedi/components/overlays/modal/modal-body/modal-body.d.ts +22 -0
- package/src/tedi/components/overlays/modal/modal-body/modal-body.es.js +21 -0
- package/src/tedi/components/overlays/modal/modal-closer/modal-closer.cjs.js +1 -0
- package/src/tedi/components/overlays/modal/modal-closer/modal-closer.d.ts +15 -0
- package/src/tedi/components/overlays/modal/modal-closer/modal-closer.es.js +16 -0
- package/src/tedi/components/overlays/modal/modal-content/modal-content.cjs.js +1 -0
- package/src/tedi/components/overlays/modal/modal-content/modal-content.d.ts +108 -0
- package/src/tedi/components/overlays/modal/modal-content/modal-content.es.js +81 -0
- package/src/tedi/components/overlays/modal/modal-context.cjs.js +1 -0
- package/src/tedi/components/overlays/modal/modal-context.d.ts +59 -0
- package/src/tedi/components/overlays/modal/modal-context.es.js +15 -0
- package/src/tedi/components/overlays/modal/modal-footer/modal-footer.cjs.js +1 -0
- package/src/tedi/components/overlays/modal/modal-footer/modal-footer.d.ts +22 -0
- package/src/tedi/components/overlays/modal/modal-footer/modal-footer.es.js +25 -0
- package/src/tedi/components/overlays/modal/modal-header/modal-header.cjs.js +1 -0
- package/src/tedi/components/overlays/modal/modal-header/modal-header.d.ts +58 -0
- package/src/tedi/components/overlays/modal/modal-header/modal-header.es.js +25 -0
- package/src/tedi/components/overlays/modal/modal-trigger/modal-trigger.cjs.js +1 -0
- package/src/tedi/components/overlays/modal/modal-trigger/modal-trigger.d.ts +13 -0
- package/src/tedi/components/overlays/modal/modal-trigger/modal-trigger.es.js +14 -0
- package/src/tedi/components/overlays/modal/modal.cjs.js +1 -0
- package/src/tedi/components/overlays/modal/modal.d.ts +68 -0
- package/src/tedi/components/overlays/modal/modal.es.js +76 -0
- package/src/tedi/components/overlays/modal/modal.module.scss.cjs.js +1 -0
- package/src/tedi/components/overlays/modal/modal.module.scss.es.js +36 -0
- package/src/tedi/helpers/hooks/use-sidenav-state.d.ts +1 -1
- package/src/tedi/index.d.ts +1 -0
- package/tedi.cjs.js +1 -1
- package/tedi.es.js +138 -120
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("../../utils/dist/floating-ui.utils.dom.cjs.js"),M=require("react"),L=require("../../utils/dist/floating-ui.utils.cjs.js"),S=require("../../../tabbable/dist/index.esm.cjs.js");function V(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const I=V(M);function A(){const t=navigator.userAgentData;return t!=null&&t.platform?t.platform:navigator.platform}function y(){const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(n=>{let{brand:e,version:i}=n;return e+"/"+i}).join(" "):navigator.userAgent}function W(){return/apple/i.test(navigator.vendor)}function E(){const t=/android/i;return t.test(A())||t.test(y())}function q(){return A().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function O(){return y().includes("jsdom/")}const P="data-floating-ui-focusable",z="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",T="ArrowLeft",w="ArrowRight",B="ArrowUp",H="ArrowDown";function F(t){let n=t.activeElement;for(;((e=n)==null||(e=e.shadowRoot)==null?void 0:e.activeElement)!=null;){var e;n=n.shadowRoot.activeElement}return n}function G(t,n){if(!t||!n)return!1;const e=n.getRootNode==null?void 0:n.getRootNode();if(t.contains(n))return!0;if(e&&R.isShadowRoot(e)){let i=n;for(;i;){if(t===i)return!0;i=i.parentNode||i.host}}return!1}function J(t){return"composedPath"in t?t.composedPath()[0]:t.target}function $(t,n){if(n==null)return!1;if("composedPath"in t)return t.composedPath().includes(n);const e=t;return e.target!=null&&n.contains(e.target)}function Y(t){return t.matches("html,body")}function v(t){return(t==null?void 0:t.ownerDocument)||document}function k(t){return R.isHTMLElement(t)&&t.matches(z)}function K(t){return t?t.getAttribute("role")==="combobox"&&k(t):!1}function Q(t){if(!t||O())return!0;try{return t.matches(":focus-visible")}catch{return!0}}function X(t){return t?t.hasAttribute(P)?t:t.querySelector("["+P+"]")||t:null}function D(t,n,e){return e===void 0&&(e=!0),t.filter(o=>{var a;return o.parentId===n&&(!e||((a=o.context)==null?void 0:a.open))}).flatMap(o=>[o,...D(t,o.id,e)])}function Z(t,n){let e,i=-1;function o(a,r){r>i&&(e=a,i=r),D(t,a).forEach(b=>{o(b.id,r+1)})}return o(n,0),t.find(a=>a.id===e)}function tt(t,n){var e;let i=[],o=(e=t.find(a=>a.id===n))==null?void 0:e.parentId;for(;o;){const a=t.find(r=>r.id===o);o=a==null?void 0:a.parentId,a&&(i=i.concat(a))}return i}function h(t){t.preventDefault(),t.stopPropagation()}function et(t){return"nativeEvent"in t}function nt(t){return t.mozInputSource===0&&t.isTrusted?!0:E()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function rt(t){return O()?!1:!E()&&t.width===0&&t.height===0||E()&&t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"||t.width<1&&t.height<1&&t.pressure===0&&t.detail===0&&t.pointerType==="touch"}function it(t,n){const e=["mouse","pen"];return n||e.push("",void 0),e.includes(t)}var ot=typeof document<"u",st=function(){},_=ot?M.useLayoutEffect:st;const at={...I};function ut(t){const n=I.useRef(t);return _(()=>{n.current=t}),n}const ct=at.useInsertionEffect,dt=ct||(t=>t());function lt(t){const n=I.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return dt(()=>{n.current=t}),I.useCallback(function(){for(var e=arguments.length,i=new Array(e),o=0;o<e;o++)i[o]=arguments[o];return n.current==null?void 0:n.current(...i)},[])}function x(t,n,e){return Math.floor(t/n)!==e}function m(t,n){return n<0||n>=t.current.length}function ft(t,n){return d(t,{disabledIndices:n})}function gt(t,n){return d(t,{decrement:!0,startingIndex:t.current.length,disabledIndices:n})}function d(t,n){let{startingIndex:e=-1,decrement:i=!1,disabledIndices:o,amount:a=1}=n===void 0?{}:n,r=e;do r+=i?-a:a;while(r>=0&&r<=t.current.length-1&&U(t,r,o));return r}function bt(t,n){let{event:e,orientation:i,loop:o,rtl:a,cols:r,disabledIndices:c,minIndex:b,maxIndex:f,prevIndex:u,stopEvent:l=!1}=n,s=u;if(e.key===B){if(l&&h(e),u===-1)s=f;else if(s=d(t,{startingIndex:s,amount:r,decrement:!0,disabledIndices:c}),o&&(u-r<b||s<0)){const g=u%r,p=f%r,C=f-(p-g);p===g?s=f:s=p>g?C:C-r}m(t,s)&&(s=u)}if(e.key===H&&(l&&h(e),u===-1?s=b:(s=d(t,{startingIndex:u,amount:r,disabledIndices:c}),o&&u+r>f&&(s=d(t,{startingIndex:u%r-r,amount:r,disabledIndices:c}))),m(t,s)&&(s=u)),i==="both"){const g=L.floor(u/r);e.key===(a?T:w)&&(l&&h(e),u%r!==r-1?(s=d(t,{startingIndex:u,disabledIndices:c}),o&&x(s,r,g)&&(s=d(t,{startingIndex:u-u%r-1,disabledIndices:c}))):o&&(s=d(t,{startingIndex:u-u%r-1,disabledIndices:c})),x(s,r,g)&&(s=u)),e.key===(a?w:T)&&(l&&h(e),u%r!==0?(s=d(t,{startingIndex:u,decrement:!0,disabledIndices:c}),o&&x(s,r,g)&&(s=d(t,{startingIndex:u+(r-u%r),decrement:!0,disabledIndices:c}))):o&&(s=d(t,{startingIndex:u+(r-u%r),decrement:!0,disabledIndices:c})),x(s,r,g)&&(s=u));const p=L.floor(f/r)===g;m(t,s)&&(o&&p?s=e.key===(a?w:T)?f:d(t,{startingIndex:u-u%r-1,disabledIndices:c}):s=u)}return s}function pt(t,n,e){const i=[];let o=0;return t.forEach((a,r)=>{let{width:c,height:b}=a;if(c>n&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+r+" is greater than grid columns");let f=!1;for(e&&(o=0);!f;){const u=[];for(let l=0;l<c;l++)for(let s=0;s<b;s++)u.push(o+l+s*n);o%n+c<=n&&u.every(l=>i[l]==null)?(u.forEach(l=>{i[l]=r}),f=!0):o++}}),[...i]}function ht(t,n,e,i,o){if(t===-1)return-1;const a=e.indexOf(t),r=n[t];switch(o){case"tl":return a;case"tr":return r?a+r.width-1:a;case"bl":return r?a+(r.height-1)*i:a;case"br":return e.lastIndexOf(t)}}function xt(t,n){return n.flatMap((e,i)=>t.includes(e)?[i]:[])}function U(t,n,e){if(typeof e=="function")return e(n);if(e)return e.includes(n);const i=t.current[n];return i==null||i.hasAttribute("disabled")||i.getAttribute("aria-disabled")==="true"}const N=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function j(t,n){const e=S.tabbable(t,N()),i=e.length;if(i===0)return;const o=F(v(t)),a=e.indexOf(o),r=a===-1?n===1?0:i-1:a+n;return e[r]}function mt(t){return j(v(t).body,1)||t}function It(t){return j(v(t).body,-1)||t}function Et(t,n){const e=n||t.currentTarget,i=t.relatedTarget;return!i||!G(e,i)}function vt(t){S.tabbable(t,N()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function Tt(t){t.querySelectorAll("[data-tabindex]").forEach(e=>{const i=e.dataset.tabindex;delete e.dataset.tabindex,i?e.setAttribute("tabindex",i):e.removeAttribute("tabindex")})}exports.activeElement=F;exports.contains=G;exports.createGridCellMap=pt;exports.disableFocusInside=vt;exports.enableFocusInside=Tt;exports.findNonDisabledListIndex=d;exports.getDeepestNode=Z;exports.getDocument=v;exports.getFloatingFocusElement=X;exports.getGridCellIndexOfCorner=ht;exports.getGridCellIndices=xt;exports.getGridNavigatedIndex=bt;exports.getMaxListIndex=gt;exports.getMinListIndex=ft;exports.getNextTabbable=mt;exports.getNodeAncestors=tt;exports.getNodeChildren=D;exports.getPlatform=A;exports.getPreviousTabbable=It;exports.getTabbableOptions=N;exports.getTarget=J;exports.getUserAgent=y;exports.isAndroid=E;exports.isDifferentGridRow=x;exports.isEventTargetWithin=$;exports.isIndexOutOfListBounds=m;exports.isJSDOM=O;exports.isListIndexDisabled=U;exports.isMac=q;exports.isMouseLikePointerType=it;exports.isOutsideEvent=Et;exports.isReactEvent=et;exports.isRootElement=Y;exports.isSafari=W;exports.isTypeableCombobox=K;exports.isTypeableElement=k;exports.isVirtualClick=nt;exports.isVirtualPointerEvent=rt;exports.matchesFocusVisible=Q;exports.stopEvent=h;exports.useEffectEvent=lt;exports.useLatestRef=ut;exports.useModernLayoutEffect=_;
|
|
@@ -1,115 +1,382 @@
|
|
|
1
|
-
import { isShadowRoot as
|
|
2
|
-
|
|
1
|
+
import { isShadowRoot as M, isHTMLElement as F } from "../../utils/dist/floating-ui.utils.dom.es.js";
|
|
2
|
+
import * as x from "react";
|
|
3
|
+
import { useLayoutEffect as k } from "react";
|
|
4
|
+
import { floor as y } from "../../utils/dist/floating-ui.utils.es.js";
|
|
5
|
+
import { tabbable as N } from "../../../tabbable/dist/index.esm.es.js";
|
|
6
|
+
function O() {
|
|
7
|
+
const t = navigator.userAgentData;
|
|
8
|
+
return t != null && t.platform ? t.platform : navigator.platform;
|
|
9
|
+
}
|
|
10
|
+
function C() {
|
|
11
|
+
const t = navigator.userAgentData;
|
|
12
|
+
return t && Array.isArray(t.brands) ? t.brands.map((n) => {
|
|
13
|
+
let {
|
|
14
|
+
brand: e,
|
|
15
|
+
version: i
|
|
16
|
+
} = n;
|
|
17
|
+
return e + "/" + i;
|
|
18
|
+
}).join(" ") : navigator.userAgent;
|
|
19
|
+
}
|
|
20
|
+
function tt() {
|
|
21
|
+
return /apple/i.test(navigator.vendor);
|
|
22
|
+
}
|
|
23
|
+
function A() {
|
|
24
|
+
const t = /android/i;
|
|
25
|
+
return t.test(O()) || t.test(C());
|
|
26
|
+
}
|
|
27
|
+
function et() {
|
|
28
|
+
return O().toLowerCase().startsWith("mac") && !navigator.maxTouchPoints;
|
|
29
|
+
}
|
|
30
|
+
function L() {
|
|
31
|
+
return C().includes("jsdom/");
|
|
32
|
+
}
|
|
33
|
+
const D = "data-floating-ui-focusable", W = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])", I = "ArrowLeft", E = "ArrowRight", G = "ArrowUp", U = "ArrowDown";
|
|
34
|
+
function V(t) {
|
|
3
35
|
let n = t.activeElement;
|
|
4
|
-
for (; ((
|
|
5
|
-
var
|
|
36
|
+
for (; ((e = n) == null || (e = e.shadowRoot) == null ? void 0 : e.activeElement) != null; ) {
|
|
37
|
+
var e;
|
|
6
38
|
n = n.shadowRoot.activeElement;
|
|
7
39
|
}
|
|
8
40
|
return n;
|
|
9
41
|
}
|
|
10
|
-
function
|
|
42
|
+
function z(t, n) {
|
|
11
43
|
if (!t || !n)
|
|
12
44
|
return !1;
|
|
13
|
-
const
|
|
45
|
+
const e = n.getRootNode == null ? void 0 : n.getRootNode();
|
|
14
46
|
if (t.contains(n))
|
|
15
47
|
return !0;
|
|
16
|
-
if (
|
|
17
|
-
let
|
|
18
|
-
for (;
|
|
19
|
-
if (t ===
|
|
48
|
+
if (e && M(e)) {
|
|
49
|
+
let i = n;
|
|
50
|
+
for (; i; ) {
|
|
51
|
+
if (t === i)
|
|
20
52
|
return !0;
|
|
21
|
-
|
|
53
|
+
i = i.parentNode || i.host;
|
|
22
54
|
}
|
|
23
55
|
}
|
|
24
56
|
return !1;
|
|
25
57
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
return t != null && t.platform ? t.platform : navigator.platform;
|
|
58
|
+
function nt(t) {
|
|
59
|
+
return "composedPath" in t ? t.composedPath()[0] : t.target;
|
|
29
60
|
}
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return r + "/" + o;
|
|
38
|
-
}).join(" ") : navigator.userAgent;
|
|
61
|
+
function rt(t, n) {
|
|
62
|
+
if (n == null)
|
|
63
|
+
return !1;
|
|
64
|
+
if ("composedPath" in t)
|
|
65
|
+
return t.composedPath().includes(n);
|
|
66
|
+
const e = t;
|
|
67
|
+
return e.target != null && n.contains(e.target);
|
|
39
68
|
}
|
|
40
|
-
function
|
|
41
|
-
return t.
|
|
69
|
+
function it(t) {
|
|
70
|
+
return t.matches("html,body");
|
|
42
71
|
}
|
|
43
|
-
function
|
|
44
|
-
return
|
|
45
|
-
t.width < 1 && t.height < 1 && t.pressure === 0 && t.detail === 0 && t.pointerType === "touch";
|
|
72
|
+
function v(t) {
|
|
73
|
+
return (t == null ? void 0 : t.ownerDocument) || document;
|
|
46
74
|
}
|
|
47
|
-
function
|
|
48
|
-
return
|
|
75
|
+
function B(t) {
|
|
76
|
+
return F(t) && t.matches(W);
|
|
49
77
|
}
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
-
|
|
78
|
+
function ot(t) {
|
|
79
|
+
return t ? t.getAttribute("role") === "combobox" && B(t) : !1;
|
|
80
|
+
}
|
|
81
|
+
function ut(t) {
|
|
82
|
+
if (!t || L()) return !0;
|
|
83
|
+
try {
|
|
84
|
+
return t.matches(":focus-visible");
|
|
85
|
+
} catch {
|
|
86
|
+
return !0;
|
|
87
|
+
}
|
|
53
88
|
}
|
|
54
|
-
function
|
|
55
|
-
return
|
|
89
|
+
function at(t) {
|
|
90
|
+
return t ? t.hasAttribute(D) ? t : t.querySelector("[" + D + "]") || t : null;
|
|
56
91
|
}
|
|
57
|
-
function
|
|
58
|
-
return
|
|
92
|
+
function R(t, n, e) {
|
|
93
|
+
return e === void 0 && (e = !0), t.filter((o) => {
|
|
94
|
+
var a;
|
|
95
|
+
return o.parentId === n && (!e || ((a = o.context) == null ? void 0 : a.open));
|
|
96
|
+
}).flatMap((o) => [o, ...R(t, o.id, e)]);
|
|
59
97
|
}
|
|
60
|
-
function
|
|
61
|
-
|
|
62
|
-
|
|
98
|
+
function st(t, n) {
|
|
99
|
+
let e, i = -1;
|
|
100
|
+
function o(a, r) {
|
|
101
|
+
r > i && (e = a, i = r), R(t, a).forEach((b) => {
|
|
102
|
+
o(b.id, r + 1);
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
return o(n, 0), t.find((a) => a.id === e);
|
|
106
|
+
}
|
|
107
|
+
function ct(t, n) {
|
|
108
|
+
var e;
|
|
109
|
+
let i = [], o = (e = t.find((a) => a.id === n)) == null ? void 0 : e.parentId;
|
|
110
|
+
for (; o; ) {
|
|
111
|
+
const a = t.find((r) => r.id === o);
|
|
112
|
+
o = a == null ? void 0 : a.parentId, a && (i = i.concat(a));
|
|
113
|
+
}
|
|
114
|
+
return i;
|
|
63
115
|
}
|
|
64
|
-
function
|
|
116
|
+
function p(t) {
|
|
117
|
+
t.preventDefault(), t.stopPropagation();
|
|
118
|
+
}
|
|
119
|
+
function ft(t) {
|
|
65
120
|
return "nativeEvent" in t;
|
|
66
121
|
}
|
|
67
|
-
function
|
|
68
|
-
return t.
|
|
122
|
+
function dt(t) {
|
|
123
|
+
return t.mozInputSource === 0 && t.isTrusted ? !0 : A() && t.pointerType ? t.type === "click" && t.buttons === 1 : t.detail === 0 && !t.pointerType;
|
|
69
124
|
}
|
|
70
|
-
function
|
|
71
|
-
return (
|
|
125
|
+
function lt(t) {
|
|
126
|
+
return L() ? !1 : !A() && t.width === 0 && t.height === 0 || A() && t.width === 1 && t.height === 1 && t.pressure === 0 && t.detail === 0 && t.pointerType === "mouse" || // iOS VoiceOver returns 0.333• for width/height.
|
|
127
|
+
t.width < 1 && t.height < 1 && t.pressure === 0 && t.detail === 0 && t.pointerType === "touch";
|
|
72
128
|
}
|
|
73
|
-
function
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if ("composedPath" in t)
|
|
77
|
-
return t.composedPath().includes(n);
|
|
78
|
-
const r = t;
|
|
79
|
-
return r.target != null && n.contains(r.target);
|
|
129
|
+
function gt(t, n) {
|
|
130
|
+
const e = ["mouse", "pen"];
|
|
131
|
+
return n || e.push("", void 0), e.includes(t);
|
|
80
132
|
}
|
|
81
|
-
function
|
|
82
|
-
|
|
133
|
+
var j = typeof document < "u", _ = function() {
|
|
134
|
+
}, q = j ? k : _;
|
|
135
|
+
const H = {
|
|
136
|
+
...x
|
|
137
|
+
};
|
|
138
|
+
function bt(t) {
|
|
139
|
+
const n = x.useRef(t);
|
|
140
|
+
return q(() => {
|
|
141
|
+
n.current = t;
|
|
142
|
+
}), n;
|
|
83
143
|
}
|
|
84
|
-
const
|
|
85
|
-
function
|
|
86
|
-
|
|
144
|
+
const $ = H.useInsertionEffect, J = $ || ((t) => t());
|
|
145
|
+
function ht(t) {
|
|
146
|
+
const n = x.useRef(() => {
|
|
147
|
+
if (process.env.NODE_ENV !== "production")
|
|
148
|
+
throw new Error("Cannot call an event handler while rendering.");
|
|
149
|
+
});
|
|
150
|
+
return J(() => {
|
|
151
|
+
n.current = t;
|
|
152
|
+
}), x.useCallback(function() {
|
|
153
|
+
for (var e = arguments.length, i = new Array(e), o = 0; o < e; o++)
|
|
154
|
+
i[o] = arguments[o];
|
|
155
|
+
return n.current == null ? void 0 : n.current(...i);
|
|
156
|
+
}, []);
|
|
87
157
|
}
|
|
88
|
-
function
|
|
89
|
-
|
|
158
|
+
function m(t, n, e) {
|
|
159
|
+
return Math.floor(t / n) !== e;
|
|
160
|
+
}
|
|
161
|
+
function w(t, n) {
|
|
162
|
+
return n < 0 || n >= t.current.length;
|
|
163
|
+
}
|
|
164
|
+
function pt(t, n) {
|
|
165
|
+
return d(t, {
|
|
166
|
+
disabledIndices: n
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
function mt(t, n) {
|
|
170
|
+
return d(t, {
|
|
171
|
+
decrement: !0,
|
|
172
|
+
startingIndex: t.current.length,
|
|
173
|
+
disabledIndices: n
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
function d(t, n) {
|
|
177
|
+
let {
|
|
178
|
+
startingIndex: e = -1,
|
|
179
|
+
decrement: i = !1,
|
|
180
|
+
disabledIndices: o,
|
|
181
|
+
amount: a = 1
|
|
182
|
+
} = n === void 0 ? {} : n, r = e;
|
|
183
|
+
do
|
|
184
|
+
r += i ? -a : a;
|
|
185
|
+
while (r >= 0 && r <= t.current.length - 1 && Y(t, r, o));
|
|
186
|
+
return r;
|
|
187
|
+
}
|
|
188
|
+
function xt(t, n) {
|
|
189
|
+
let {
|
|
190
|
+
event: e,
|
|
191
|
+
orientation: i,
|
|
192
|
+
loop: o,
|
|
193
|
+
rtl: a,
|
|
194
|
+
cols: r,
|
|
195
|
+
disabledIndices: c,
|
|
196
|
+
minIndex: b,
|
|
197
|
+
maxIndex: l,
|
|
198
|
+
prevIndex: s,
|
|
199
|
+
stopEvent: f = !1
|
|
200
|
+
} = n, u = s;
|
|
201
|
+
if (e.key === G) {
|
|
202
|
+
if (f && p(e), s === -1)
|
|
203
|
+
u = l;
|
|
204
|
+
else if (u = d(t, {
|
|
205
|
+
startingIndex: u,
|
|
206
|
+
amount: r,
|
|
207
|
+
decrement: !0,
|
|
208
|
+
disabledIndices: c
|
|
209
|
+
}), o && (s - r < b || u < 0)) {
|
|
210
|
+
const g = s % r, h = l % r, T = l - (h - g);
|
|
211
|
+
h === g ? u = l : u = h > g ? T : T - r;
|
|
212
|
+
}
|
|
213
|
+
w(t, u) && (u = s);
|
|
214
|
+
}
|
|
215
|
+
if (e.key === U && (f && p(e), s === -1 ? u = b : (u = d(t, {
|
|
216
|
+
startingIndex: s,
|
|
217
|
+
amount: r,
|
|
218
|
+
disabledIndices: c
|
|
219
|
+
}), o && s + r > l && (u = d(t, {
|
|
220
|
+
startingIndex: s % r - r,
|
|
221
|
+
amount: r,
|
|
222
|
+
disabledIndices: c
|
|
223
|
+
}))), w(t, u) && (u = s)), i === "both") {
|
|
224
|
+
const g = y(s / r);
|
|
225
|
+
e.key === (a ? I : E) && (f && p(e), s % r !== r - 1 ? (u = d(t, {
|
|
226
|
+
startingIndex: s,
|
|
227
|
+
disabledIndices: c
|
|
228
|
+
}), o && m(u, r, g) && (u = d(t, {
|
|
229
|
+
startingIndex: s - s % r - 1,
|
|
230
|
+
disabledIndices: c
|
|
231
|
+
}))) : o && (u = d(t, {
|
|
232
|
+
startingIndex: s - s % r - 1,
|
|
233
|
+
disabledIndices: c
|
|
234
|
+
})), m(u, r, g) && (u = s)), e.key === (a ? E : I) && (f && p(e), s % r !== 0 ? (u = d(t, {
|
|
235
|
+
startingIndex: s,
|
|
236
|
+
decrement: !0,
|
|
237
|
+
disabledIndices: c
|
|
238
|
+
}), o && m(u, r, g) && (u = d(t, {
|
|
239
|
+
startingIndex: s + (r - s % r),
|
|
240
|
+
decrement: !0,
|
|
241
|
+
disabledIndices: c
|
|
242
|
+
}))) : o && (u = d(t, {
|
|
243
|
+
startingIndex: s + (r - s % r),
|
|
244
|
+
decrement: !0,
|
|
245
|
+
disabledIndices: c
|
|
246
|
+
})), m(u, r, g) && (u = s));
|
|
247
|
+
const h = y(l / r) === g;
|
|
248
|
+
w(t, u) && (o && h ? u = e.key === (a ? E : I) ? l : d(t, {
|
|
249
|
+
startingIndex: s - s % r - 1,
|
|
250
|
+
disabledIndices: c
|
|
251
|
+
}) : u = s);
|
|
252
|
+
}
|
|
253
|
+
return u;
|
|
254
|
+
}
|
|
255
|
+
function It(t, n, e) {
|
|
256
|
+
const i = [];
|
|
257
|
+
let o = 0;
|
|
258
|
+
return t.forEach((a, r) => {
|
|
259
|
+
let {
|
|
260
|
+
width: c,
|
|
261
|
+
height: b
|
|
262
|
+
} = a;
|
|
263
|
+
if (c > n && process.env.NODE_ENV !== "production")
|
|
264
|
+
throw new Error("[Floating UI]: Invalid grid - item width at index " + r + " is greater than grid columns");
|
|
265
|
+
let l = !1;
|
|
266
|
+
for (e && (o = 0); !l; ) {
|
|
267
|
+
const s = [];
|
|
268
|
+
for (let f = 0; f < c; f++)
|
|
269
|
+
for (let u = 0; u < b; u++)
|
|
270
|
+
s.push(o + f + u * n);
|
|
271
|
+
o % n + c <= n && s.every((f) => i[f] == null) ? (s.forEach((f) => {
|
|
272
|
+
i[f] = r;
|
|
273
|
+
}), l = !0) : o++;
|
|
274
|
+
}
|
|
275
|
+
}), [...i];
|
|
276
|
+
}
|
|
277
|
+
function Et(t, n, e, i, o) {
|
|
278
|
+
if (t === -1) return -1;
|
|
279
|
+
const a = e.indexOf(t), r = n[t];
|
|
280
|
+
switch (o) {
|
|
281
|
+
case "tl":
|
|
282
|
+
return a;
|
|
283
|
+
case "tr":
|
|
284
|
+
return r ? a + r.width - 1 : a;
|
|
285
|
+
case "bl":
|
|
286
|
+
return r ? a + (r.height - 1) * i : a;
|
|
287
|
+
case "br":
|
|
288
|
+
return e.lastIndexOf(t);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
function wt(t, n) {
|
|
292
|
+
return n.flatMap((e, i) => t.includes(e) ? [i] : []);
|
|
293
|
+
}
|
|
294
|
+
function Y(t, n, e) {
|
|
295
|
+
if (typeof e == "function")
|
|
296
|
+
return e(n);
|
|
297
|
+
if (e)
|
|
298
|
+
return e.includes(n);
|
|
299
|
+
const i = t.current[n];
|
|
300
|
+
return i == null || i.hasAttribute("disabled") || i.getAttribute("aria-disabled") === "true";
|
|
301
|
+
}
|
|
302
|
+
const P = () => ({
|
|
303
|
+
getShadowRoot: !0,
|
|
304
|
+
displayCheck: (
|
|
305
|
+
// JSDOM does not support the `tabbable` library. To solve this we can
|
|
306
|
+
// check if `ResizeObserver` is a real function (not polyfilled), which
|
|
307
|
+
// determines if the current environment is JSDOM-like.
|
|
308
|
+
typeof ResizeObserver == "function" && ResizeObserver.toString().includes("[native code]") ? "full" : "none"
|
|
309
|
+
)
|
|
310
|
+
});
|
|
311
|
+
function S(t, n) {
|
|
312
|
+
const e = N(t, P()), i = e.length;
|
|
313
|
+
if (i === 0) return;
|
|
314
|
+
const o = V(v(t)), a = e.indexOf(o), r = a === -1 ? n === 1 ? 0 : i - 1 : a + n;
|
|
315
|
+
return e[r];
|
|
316
|
+
}
|
|
317
|
+
function At(t) {
|
|
318
|
+
return S(v(t).body, 1) || t;
|
|
319
|
+
}
|
|
320
|
+
function vt(t) {
|
|
321
|
+
return S(v(t).body, -1) || t;
|
|
322
|
+
}
|
|
323
|
+
function Tt(t, n) {
|
|
324
|
+
const e = n || t.currentTarget, i = t.relatedTarget;
|
|
325
|
+
return !i || !z(e, i);
|
|
326
|
+
}
|
|
327
|
+
function yt(t) {
|
|
328
|
+
N(t, P()).forEach((e) => {
|
|
329
|
+
e.dataset.tabindex = e.getAttribute("tabindex") || "", e.setAttribute("tabindex", "-1");
|
|
330
|
+
});
|
|
90
331
|
}
|
|
91
|
-
function
|
|
92
|
-
|
|
332
|
+
function Dt(t) {
|
|
333
|
+
t.querySelectorAll("[data-tabindex]").forEach((e) => {
|
|
334
|
+
const i = e.dataset.tabindex;
|
|
335
|
+
delete e.dataset.tabindex, i ? e.setAttribute("tabindex", i) : e.removeAttribute("tabindex");
|
|
336
|
+
});
|
|
93
337
|
}
|
|
94
338
|
export {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
339
|
+
V as activeElement,
|
|
340
|
+
z as contains,
|
|
341
|
+
It as createGridCellMap,
|
|
342
|
+
yt as disableFocusInside,
|
|
343
|
+
Dt as enableFocusInside,
|
|
344
|
+
d as findNonDisabledListIndex,
|
|
345
|
+
st as getDeepestNode,
|
|
346
|
+
v as getDocument,
|
|
347
|
+
at as getFloatingFocusElement,
|
|
348
|
+
Et as getGridCellIndexOfCorner,
|
|
349
|
+
wt as getGridCellIndices,
|
|
350
|
+
xt as getGridNavigatedIndex,
|
|
351
|
+
mt as getMaxListIndex,
|
|
352
|
+
pt as getMinListIndex,
|
|
353
|
+
At as getNextTabbable,
|
|
354
|
+
ct as getNodeAncestors,
|
|
355
|
+
R as getNodeChildren,
|
|
356
|
+
O as getPlatform,
|
|
357
|
+
vt as getPreviousTabbable,
|
|
358
|
+
P as getTabbableOptions,
|
|
359
|
+
nt as getTarget,
|
|
360
|
+
C as getUserAgent,
|
|
361
|
+
A as isAndroid,
|
|
362
|
+
m as isDifferentGridRow,
|
|
363
|
+
rt as isEventTargetWithin,
|
|
364
|
+
w as isIndexOutOfListBounds,
|
|
365
|
+
L as isJSDOM,
|
|
366
|
+
Y as isListIndexDisabled,
|
|
367
|
+
et as isMac,
|
|
368
|
+
gt as isMouseLikePointerType,
|
|
369
|
+
Tt as isOutsideEvent,
|
|
370
|
+
ft as isReactEvent,
|
|
371
|
+
it as isRootElement,
|
|
372
|
+
tt as isSafari,
|
|
373
|
+
ot as isTypeableCombobox,
|
|
374
|
+
B as isTypeableElement,
|
|
375
|
+
dt as isVirtualClick,
|
|
376
|
+
lt as isVirtualPointerEvent,
|
|
377
|
+
ut as matchesFocusVisible,
|
|
378
|
+
p as stopEvent,
|
|
379
|
+
ht as useEffectEvent,
|
|
380
|
+
bt as useLatestRef,
|
|
381
|
+
q as useModernLayoutEffect
|
|
115
382
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../../dom/dist/floating-ui.dom.cjs.js"),L=require("react"),H=require("react-dom");function U(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const o=U(L),I=U(H);var J=typeof document<"u",K=function(){},h=J?L.useLayoutEffect:K;function P(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(typeof e=="function"&&e.toString()===n.toString())return!0;let t,r,u;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(t=e.length,t!==n.length)return!1;for(r=t;r--!==0;)if(!P(e[r],n[r]))return!1;return!0}if(u=Object.keys(e),t=u.length,t!==Object.keys(n).length)return!1;for(r=t;r--!==0;)if(!{}.hasOwnProperty.call(n,u[r]))return!1;for(r=t;r--!==0;){const g=u[r];if(!(g==="_owner"&&e.$$typeof)&&!P(e[g],n[g]))return!1}return!0}return e!==e&&n!==n}function $(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function z(e,n){const t=$(e);return Math.round(n*t)/t}function D(e){const n=o.useRef(e);return h(()=>{n.current=e}),n}function Q(e){e===void 0&&(e={});const{placement:n="bottom",strategy:t="absolute",middleware:r=[],platform:u,elements:{reference:g,floating:A}={},transform:j=!0,whileElementsMounted:k,open:M}=e,[i,E]=o.useState({x:0,y:0,strategy:t,placement:n,middlewareData:{},isPositioned:!1}),[S,T]=o.useState(r);P(S,r)||T(r);const[B,N]=o.useState(null),[V,W]=o.useState(null),b=o.useCallback(f=>{f!==m.current&&(m.current=f,N(f))},[]),v=o.useCallback(f=>{f!==d.current&&(d.current=f,W(f))},[]),c=g||B,l=A||V,m=o.useRef(null),d=o.useRef(null),w=o.useRef(i),G=k!=null,O=D(k),_=D(u),C=D(M),y=o.useCallback(()=>{if(!m.current||!d.current)return;const f={placement:n,strategy:t,middleware:S};_.current&&(f.platform=_.current),s.computePosition(m.current,d.current,f).then(R=>{const p={...R,isPositioned:C.current!==!1};x.current&&!P(w.current,p)&&(w.current=p,I.flushSync(()=>{E(p)}))})},[S,n,t,_,C]);h(()=>{M===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,E(f=>({...f,isPositioned:!1})))},[M]);const x=o.useRef(!1);h(()=>(x.current=!0,()=>{x.current=!1}),[]),h(()=>{if(c&&(m.current=c),l&&(d.current=l),c&&l){if(O.current)return O.current(c,l,y);y()}},[c,l,y,O,G]);const F=o.useMemo(()=>({reference:m,floating:d,setReference:b,setFloating:v}),[b,v]),a=o.useMemo(()=>({reference:c,floating:l}),[c,l]),q=o.useMemo(()=>{const f={position:t,left:0,top:0};if(!a.floating)return f;const R=z(a.floating,i.x),p=z(a.floating,i.y);return j?{...f,transform:"translate("+R+"px, "+p+"px)",...$(a.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:R,top:p}},[t,j,a.floating,i.x,i.y]);return o.useMemo(()=>({...i,update:y,refs:F,elements:a,floatingStyles:q}),[i,y,F,a,q])}const X=e=>{function n(t){return{}.hasOwnProperty.call(t,"current")}return{name:"arrow",options:e,fn(t){const{element:r,padding:u}=typeof e=="function"?e(t):e;return r&&n(r)?r.current!=null?s.arrow({element:r.current,padding:u}).fn(t):{}:r?s.arrow({element:r,padding:u}).fn(t):{}}}},Y=(e,n)=>{const t=s.offset(e);return{name:t.name,fn:t.fn,options:[e,n]}},Z=(e,n)=>{const t=s.shift(e);return{name:t.name,fn:t.fn,options:[e,n]}},ee=(e,n)=>{const t=s.flip(e);return{name:t.name,fn:t.fn,options:[e,n]}},te=(e,n)=>{const t=s.size(e);return{name:t.name,fn:t.fn,options:[e,n]}},ne=(e,n)=>{const t=X(e);return{name:t.name,fn:t.fn,options:[e,n]}};exports.autoUpdate=s.autoUpdate;exports.computePosition=s.computePosition;exports.platform=s.platform;exports.arrow=ne;exports.flip=ee;exports.offset=Y;exports.shift=Z;exports.size=te;exports.useFloating=Q;
|