first commit
This commit is contained in:
21
node_modules/@floating-ui/react-dom/LICENSE
generated
vendored
Normal file
21
node_modules/@floating-ui/react-dom/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Floating UI contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
3
node_modules/@floating-ui/react-dom/README.md
generated
vendored
Normal file
3
node_modules/@floating-ui/react-dom/README.md
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# @floating-ui/react-dom
|
||||
|
||||
This is the library to use Floating UI with React DOM.
|
||||
220
node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.js
generated
vendored
Normal file
220
node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.js
generated
vendored
Normal file
@@ -0,0 +1,220 @@
|
||||
import { arrow as arrow$1, computePosition } from '@floating-ui/dom';
|
||||
export { autoPlacement, autoUpdate, computePosition, detectOverflow, flip, getOverflowAncestors, hide, inline, limitShift, offset, platform, shift, size } from '@floating-ui/dom';
|
||||
import * as React from 'react';
|
||||
import { useLayoutEffect, useEffect } from 'react';
|
||||
import * as ReactDOM from 'react-dom';
|
||||
|
||||
/**
|
||||
* A data provider that provides data to position an inner element of the
|
||||
* floating element (usually a triangle or caret) so that it is centered to the
|
||||
* reference element.
|
||||
* This wraps the core `arrow` middleware to allow React refs as the element.
|
||||
* @see https://floating-ui.com/docs/arrow
|
||||
*/
|
||||
const arrow = options => {
|
||||
const {
|
||||
element,
|
||||
padding
|
||||
} = options;
|
||||
function isRef(value) {
|
||||
return Object.prototype.hasOwnProperty.call(value, 'current');
|
||||
}
|
||||
return {
|
||||
name: 'arrow',
|
||||
options,
|
||||
fn(args) {
|
||||
if (isRef(element)) {
|
||||
if (element.current != null) {
|
||||
return arrow$1({
|
||||
element: element.current,
|
||||
padding
|
||||
}).fn(args);
|
||||
}
|
||||
return {};
|
||||
} else if (element) {
|
||||
return arrow$1({
|
||||
element,
|
||||
padding
|
||||
}).fn(args);
|
||||
}
|
||||
return {};
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
var index = typeof document !== 'undefined' ? useLayoutEffect : useEffect;
|
||||
|
||||
// Fork of `fast-deep-equal` that only does the comparisons we need and compares
|
||||
// functions
|
||||
function deepEqual(a, b) {
|
||||
if (a === b) {
|
||||
return true;
|
||||
}
|
||||
if (typeof a !== typeof b) {
|
||||
return false;
|
||||
}
|
||||
if (typeof a === 'function' && a.toString() === b.toString()) {
|
||||
return true;
|
||||
}
|
||||
let length, i, keys;
|
||||
if (a && b && typeof a == 'object') {
|
||||
if (Array.isArray(a)) {
|
||||
length = a.length;
|
||||
if (length != b.length) return false;
|
||||
for (i = length; i-- !== 0;) {
|
||||
if (!deepEqual(a[i], b[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
keys = Object.keys(a);
|
||||
length = keys.length;
|
||||
if (length !== Object.keys(b).length) {
|
||||
return false;
|
||||
}
|
||||
for (i = length; i-- !== 0;) {
|
||||
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for (i = length; i-- !== 0;) {
|
||||
const key = keys[i];
|
||||
if (key === '_owner' && a.$$typeof) {
|
||||
continue;
|
||||
}
|
||||
if (!deepEqual(a[key], b[key])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return a !== a && b !== b;
|
||||
}
|
||||
|
||||
function useLatestRef(value) {
|
||||
const ref = React.useRef(value);
|
||||
index(() => {
|
||||
ref.current = value;
|
||||
});
|
||||
return ref;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides data to position a floating element.
|
||||
* @see https://floating-ui.com/docs/react
|
||||
*/
|
||||
function useFloating(options) {
|
||||
if (options === void 0) {
|
||||
options = {};
|
||||
}
|
||||
const {
|
||||
placement = 'bottom',
|
||||
strategy = 'absolute',
|
||||
middleware = [],
|
||||
platform,
|
||||
whileElementsMounted,
|
||||
open
|
||||
} = options;
|
||||
const [data, setData] = React.useState({
|
||||
x: null,
|
||||
y: null,
|
||||
strategy,
|
||||
placement,
|
||||
middlewareData: {},
|
||||
isPositioned: false
|
||||
});
|
||||
const [latestMiddleware, setLatestMiddleware] = React.useState(middleware);
|
||||
if (!deepEqual(latestMiddleware, middleware)) {
|
||||
setLatestMiddleware(middleware);
|
||||
}
|
||||
const referenceRef = React.useRef(null);
|
||||
const floatingRef = React.useRef(null);
|
||||
const dataRef = React.useRef(data);
|
||||
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
||||
const platformRef = useLatestRef(platform);
|
||||
const [reference, _setReference] = React.useState(null);
|
||||
const [floating, _setFloating] = React.useState(null);
|
||||
const setReference = React.useCallback(node => {
|
||||
if (referenceRef.current !== node) {
|
||||
referenceRef.current = node;
|
||||
_setReference(node);
|
||||
}
|
||||
}, []);
|
||||
const setFloating = React.useCallback(node => {
|
||||
if (floatingRef.current !== node) {
|
||||
floatingRef.current = node;
|
||||
_setFloating(node);
|
||||
}
|
||||
}, []);
|
||||
const update = React.useCallback(() => {
|
||||
if (!referenceRef.current || !floatingRef.current) {
|
||||
return;
|
||||
}
|
||||
const config = {
|
||||
placement,
|
||||
strategy,
|
||||
middleware: latestMiddleware
|
||||
};
|
||||
if (platformRef.current) {
|
||||
config.platform = platformRef.current;
|
||||
}
|
||||
computePosition(referenceRef.current, floatingRef.current, config).then(data => {
|
||||
const fullData = {
|
||||
...data,
|
||||
isPositioned: true
|
||||
};
|
||||
if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
|
||||
dataRef.current = fullData;
|
||||
ReactDOM.flushSync(() => {
|
||||
setData(fullData);
|
||||
});
|
||||
}
|
||||
});
|
||||
}, [latestMiddleware, placement, strategy, platformRef]);
|
||||
index(() => {
|
||||
if (open === false && dataRef.current.isPositioned) {
|
||||
dataRef.current.isPositioned = false;
|
||||
setData(data => ({
|
||||
...data,
|
||||
isPositioned: false
|
||||
}));
|
||||
}
|
||||
}, [open]);
|
||||
const isMountedRef = React.useRef(false);
|
||||
index(() => {
|
||||
isMountedRef.current = true;
|
||||
return () => {
|
||||
isMountedRef.current = false;
|
||||
};
|
||||
}, []);
|
||||
index(() => {
|
||||
if (reference && floating) {
|
||||
if (whileElementsMountedRef.current) {
|
||||
return whileElementsMountedRef.current(reference, floating, update);
|
||||
} else {
|
||||
update();
|
||||
}
|
||||
}
|
||||
}, [reference, floating, update, whileElementsMountedRef]);
|
||||
const refs = React.useMemo(() => ({
|
||||
reference: referenceRef,
|
||||
floating: floatingRef,
|
||||
setReference,
|
||||
setFloating
|
||||
}), [setReference, setFloating]);
|
||||
const elements = React.useMemo(() => ({
|
||||
reference,
|
||||
floating
|
||||
}), [reference, floating]);
|
||||
return React.useMemo(() => ({
|
||||
...data,
|
||||
update,
|
||||
refs,
|
||||
elements,
|
||||
reference: setReference,
|
||||
floating: setFloating
|
||||
}), [data, update, refs, elements, setReference, setFloating]);
|
||||
}
|
||||
|
||||
export { arrow, useFloating };
|
||||
1
node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.min.js
generated
vendored
Normal file
1
node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.min.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import{arrow as e,computePosition as t}from"@floating-ui/dom";export{autoPlacement,autoUpdate,computePosition,detectOverflow,flip,getOverflowAncestors,hide,inline,limitShift,offset,platform,shift,size}from"@floating-ui/dom";import*as r from"react";import{useLayoutEffect as n,useEffect as o}from"react";import*as u from"react-dom";const i=t=>{const{element:r,padding:n}=t;return{name:"arrow",options:t,fn(t){return o=r,Object.prototype.hasOwnProperty.call(o,"current")?null!=r.current?e({element:r.current,padding:n}).fn(t):{}:r?e({element:r,padding:n}).fn(t):{};var o}}};var c="undefined"!=typeof document?n:o;function f(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;0!=n--;)if(!f(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!Object.prototype.hasOwnProperty.call(t,o[n]))return!1;for(n=r;0!=n--;){const r=o[n];if(("_owner"!==r||!e.$$typeof)&&!f(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function s(e){const t=r.useRef(e);return c((()=>{t.current=e})),t}function l(e){void 0===e&&(e={});const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:l,whileElementsMounted:a,open:m}=e,[p,d]=r.useState({x:null,y:null,strategy:o,placement:n,middlewareData:{},isPositioned:!1}),[g,y]=r.useState(i);f(g,i)||y(i);const h=r.useRef(null),w=r.useRef(null),b=r.useRef(p),P=s(a),O=s(l),[S,R]=r.useState(null),[j,k]=r.useState(null),v=r.useCallback((e=>{h.current!==e&&(h.current=e,R(e))}),[]),M=r.useCallback((e=>{w.current!==e&&(w.current=e,k(e))}),[]),x=r.useCallback((()=>{if(!h.current||!w.current)return;const e={placement:n,strategy:o,middleware:g};O.current&&(e.platform=O.current),t(h.current,w.current,e).then((e=>{const t={...e,isPositioned:!0};A.current&&!f(b.current,t)&&(b.current=t,u.flushSync((()=>{d(t)})))}))}),[g,n,o,O]);c((()=>{!1===m&&b.current.isPositioned&&(b.current.isPositioned=!1,d((e=>({...e,isPositioned:!1}))))}),[m]);const A=r.useRef(!1);c((()=>(A.current=!0,()=>{A.current=!1})),[]),c((()=>{if(S&&j){if(P.current)return P.current(S,j,x);x()}}),[S,j,x,P]);const C=r.useMemo((()=>({reference:h,floating:w,setReference:v,setFloating:M})),[v,M]),$=r.useMemo((()=>({reference:S,floating:j})),[S,j]);return r.useMemo((()=>({...p,update:x,refs:C,elements:$,reference:v,floating:M})),[p,x,C,$,v,M])}export{i as arrow,l as useFloating};
|
||||
220
node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
generated
vendored
Normal file
220
node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
generated
vendored
Normal file
@@ -0,0 +1,220 @@
|
||||
import { arrow as arrow$1, computePosition } from '@floating-ui/dom';
|
||||
export { autoPlacement, autoUpdate, computePosition, detectOverflow, flip, getOverflowAncestors, hide, inline, limitShift, offset, platform, shift, size } from '@floating-ui/dom';
|
||||
import * as React from 'react';
|
||||
import { useLayoutEffect, useEffect } from 'react';
|
||||
import * as ReactDOM from 'react-dom';
|
||||
|
||||
/**
|
||||
* A data provider that provides data to position an inner element of the
|
||||
* floating element (usually a triangle or caret) so that it is centered to the
|
||||
* reference element.
|
||||
* This wraps the core `arrow` middleware to allow React refs as the element.
|
||||
* @see https://floating-ui.com/docs/arrow
|
||||
*/
|
||||
const arrow = options => {
|
||||
const {
|
||||
element,
|
||||
padding
|
||||
} = options;
|
||||
function isRef(value) {
|
||||
return Object.prototype.hasOwnProperty.call(value, 'current');
|
||||
}
|
||||
return {
|
||||
name: 'arrow',
|
||||
options,
|
||||
fn(args) {
|
||||
if (isRef(element)) {
|
||||
if (element.current != null) {
|
||||
return arrow$1({
|
||||
element: element.current,
|
||||
padding
|
||||
}).fn(args);
|
||||
}
|
||||
return {};
|
||||
} else if (element) {
|
||||
return arrow$1({
|
||||
element,
|
||||
padding
|
||||
}).fn(args);
|
||||
}
|
||||
return {};
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
var index = typeof document !== 'undefined' ? useLayoutEffect : useEffect;
|
||||
|
||||
// Fork of `fast-deep-equal` that only does the comparisons we need and compares
|
||||
// functions
|
||||
function deepEqual(a, b) {
|
||||
if (a === b) {
|
||||
return true;
|
||||
}
|
||||
if (typeof a !== typeof b) {
|
||||
return false;
|
||||
}
|
||||
if (typeof a === 'function' && a.toString() === b.toString()) {
|
||||
return true;
|
||||
}
|
||||
let length, i, keys;
|
||||
if (a && b && typeof a == 'object') {
|
||||
if (Array.isArray(a)) {
|
||||
length = a.length;
|
||||
if (length != b.length) return false;
|
||||
for (i = length; i-- !== 0;) {
|
||||
if (!deepEqual(a[i], b[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
keys = Object.keys(a);
|
||||
length = keys.length;
|
||||
if (length !== Object.keys(b).length) {
|
||||
return false;
|
||||
}
|
||||
for (i = length; i-- !== 0;) {
|
||||
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for (i = length; i-- !== 0;) {
|
||||
const key = keys[i];
|
||||
if (key === '_owner' && a.$$typeof) {
|
||||
continue;
|
||||
}
|
||||
if (!deepEqual(a[key], b[key])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return a !== a && b !== b;
|
||||
}
|
||||
|
||||
function useLatestRef(value) {
|
||||
const ref = React.useRef(value);
|
||||
index(() => {
|
||||
ref.current = value;
|
||||
});
|
||||
return ref;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides data to position a floating element.
|
||||
* @see https://floating-ui.com/docs/react
|
||||
*/
|
||||
function useFloating(options) {
|
||||
if (options === void 0) {
|
||||
options = {};
|
||||
}
|
||||
const {
|
||||
placement = 'bottom',
|
||||
strategy = 'absolute',
|
||||
middleware = [],
|
||||
platform,
|
||||
whileElementsMounted,
|
||||
open
|
||||
} = options;
|
||||
const [data, setData] = React.useState({
|
||||
x: null,
|
||||
y: null,
|
||||
strategy,
|
||||
placement,
|
||||
middlewareData: {},
|
||||
isPositioned: false
|
||||
});
|
||||
const [latestMiddleware, setLatestMiddleware] = React.useState(middleware);
|
||||
if (!deepEqual(latestMiddleware, middleware)) {
|
||||
setLatestMiddleware(middleware);
|
||||
}
|
||||
const referenceRef = React.useRef(null);
|
||||
const floatingRef = React.useRef(null);
|
||||
const dataRef = React.useRef(data);
|
||||
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
||||
const platformRef = useLatestRef(platform);
|
||||
const [reference, _setReference] = React.useState(null);
|
||||
const [floating, _setFloating] = React.useState(null);
|
||||
const setReference = React.useCallback(node => {
|
||||
if (referenceRef.current !== node) {
|
||||
referenceRef.current = node;
|
||||
_setReference(node);
|
||||
}
|
||||
}, []);
|
||||
const setFloating = React.useCallback(node => {
|
||||
if (floatingRef.current !== node) {
|
||||
floatingRef.current = node;
|
||||
_setFloating(node);
|
||||
}
|
||||
}, []);
|
||||
const update = React.useCallback(() => {
|
||||
if (!referenceRef.current || !floatingRef.current) {
|
||||
return;
|
||||
}
|
||||
const config = {
|
||||
placement,
|
||||
strategy,
|
||||
middleware: latestMiddleware
|
||||
};
|
||||
if (platformRef.current) {
|
||||
config.platform = platformRef.current;
|
||||
}
|
||||
computePosition(referenceRef.current, floatingRef.current, config).then(data => {
|
||||
const fullData = {
|
||||
...data,
|
||||
isPositioned: true
|
||||
};
|
||||
if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
|
||||
dataRef.current = fullData;
|
||||
ReactDOM.flushSync(() => {
|
||||
setData(fullData);
|
||||
});
|
||||
}
|
||||
});
|
||||
}, [latestMiddleware, placement, strategy, platformRef]);
|
||||
index(() => {
|
||||
if (open === false && dataRef.current.isPositioned) {
|
||||
dataRef.current.isPositioned = false;
|
||||
setData(data => ({
|
||||
...data,
|
||||
isPositioned: false
|
||||
}));
|
||||
}
|
||||
}, [open]);
|
||||
const isMountedRef = React.useRef(false);
|
||||
index(() => {
|
||||
isMountedRef.current = true;
|
||||
return () => {
|
||||
isMountedRef.current = false;
|
||||
};
|
||||
}, []);
|
||||
index(() => {
|
||||
if (reference && floating) {
|
||||
if (whileElementsMountedRef.current) {
|
||||
return whileElementsMountedRef.current(reference, floating, update);
|
||||
} else {
|
||||
update();
|
||||
}
|
||||
}
|
||||
}, [reference, floating, update, whileElementsMountedRef]);
|
||||
const refs = React.useMemo(() => ({
|
||||
reference: referenceRef,
|
||||
floating: floatingRef,
|
||||
setReference,
|
||||
setFloating
|
||||
}), [setReference, setFloating]);
|
||||
const elements = React.useMemo(() => ({
|
||||
reference,
|
||||
floating
|
||||
}), [reference, floating]);
|
||||
return React.useMemo(() => ({
|
||||
...data,
|
||||
update,
|
||||
refs,
|
||||
elements,
|
||||
reference: setReference,
|
||||
floating: setFloating
|
||||
}), [data, update, refs, elements, setReference, setFloating]);
|
||||
}
|
||||
|
||||
export { arrow, useFloating };
|
||||
298
node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.umd.js
generated
vendored
Normal file
298
node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.umd.js
generated
vendored
Normal file
@@ -0,0 +1,298 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@floating-ui/dom'), require('react'), require('react-dom')) :
|
||||
typeof define === 'function' && define.amd ? define(['exports', '@floating-ui/dom', 'react', 'react-dom'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.FloatingUIReactDOM = {}, global.FloatingUIDOM, global.React, global.ReactDOM));
|
||||
})(this, (function (exports, dom, React, ReactDOM) { 'use strict';
|
||||
|
||||
function _interopNamespace(e) {
|
||||
if (e && e.__esModule) return e;
|
||||
var n = Object.create(null);
|
||||
if (e) {
|
||||
Object.keys(e).forEach(function (k) {
|
||||
if (k !== 'default') {
|
||||
var d = Object.getOwnPropertyDescriptor(e, k);
|
||||
Object.defineProperty(n, k, d.get ? d : {
|
||||
enumerable: true,
|
||||
get: function () { return e[k]; }
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
n["default"] = e;
|
||||
return Object.freeze(n);
|
||||
}
|
||||
|
||||
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
||||
var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
|
||||
|
||||
/**
|
||||
* A data provider that provides data to position an inner element of the
|
||||
* floating element (usually a triangle or caret) so that it is centered to the
|
||||
* reference element.
|
||||
* This wraps the core `arrow` middleware to allow React refs as the element.
|
||||
* @see https://floating-ui.com/docs/arrow
|
||||
*/
|
||||
const arrow = options => {
|
||||
const {
|
||||
element,
|
||||
padding
|
||||
} = options;
|
||||
function isRef(value) {
|
||||
return Object.prototype.hasOwnProperty.call(value, 'current');
|
||||
}
|
||||
return {
|
||||
name: 'arrow',
|
||||
options,
|
||||
fn(args) {
|
||||
if (isRef(element)) {
|
||||
if (element.current != null) {
|
||||
return dom.arrow({
|
||||
element: element.current,
|
||||
padding
|
||||
}).fn(args);
|
||||
}
|
||||
return {};
|
||||
} else if (element) {
|
||||
return dom.arrow({
|
||||
element,
|
||||
padding
|
||||
}).fn(args);
|
||||
}
|
||||
return {};
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
var index = typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect;
|
||||
|
||||
// Fork of `fast-deep-equal` that only does the comparisons we need and compares
|
||||
// functions
|
||||
function deepEqual(a, b) {
|
||||
if (a === b) {
|
||||
return true;
|
||||
}
|
||||
if (typeof a !== typeof b) {
|
||||
return false;
|
||||
}
|
||||
if (typeof a === 'function' && a.toString() === b.toString()) {
|
||||
return true;
|
||||
}
|
||||
let length, i, keys;
|
||||
if (a && b && typeof a == 'object') {
|
||||
if (Array.isArray(a)) {
|
||||
length = a.length;
|
||||
if (length != b.length) return false;
|
||||
for (i = length; i-- !== 0;) {
|
||||
if (!deepEqual(a[i], b[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
keys = Object.keys(a);
|
||||
length = keys.length;
|
||||
if (length !== Object.keys(b).length) {
|
||||
return false;
|
||||
}
|
||||
for (i = length; i-- !== 0;) {
|
||||
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for (i = length; i-- !== 0;) {
|
||||
const key = keys[i];
|
||||
if (key === '_owner' && a.$$typeof) {
|
||||
continue;
|
||||
}
|
||||
if (!deepEqual(a[key], b[key])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return a !== a && b !== b;
|
||||
}
|
||||
|
||||
function useLatestRef(value) {
|
||||
const ref = React__namespace.useRef(value);
|
||||
index(() => {
|
||||
ref.current = value;
|
||||
});
|
||||
return ref;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides data to position a floating element.
|
||||
* @see https://floating-ui.com/docs/react
|
||||
*/
|
||||
function useFloating(options) {
|
||||
if (options === void 0) {
|
||||
options = {};
|
||||
}
|
||||
const {
|
||||
placement = 'bottom',
|
||||
strategy = 'absolute',
|
||||
middleware = [],
|
||||
platform,
|
||||
whileElementsMounted,
|
||||
open
|
||||
} = options;
|
||||
const [data, setData] = React__namespace.useState({
|
||||
x: null,
|
||||
y: null,
|
||||
strategy,
|
||||
placement,
|
||||
middlewareData: {},
|
||||
isPositioned: false
|
||||
});
|
||||
const [latestMiddleware, setLatestMiddleware] = React__namespace.useState(middleware);
|
||||
if (!deepEqual(latestMiddleware, middleware)) {
|
||||
setLatestMiddleware(middleware);
|
||||
}
|
||||
const referenceRef = React__namespace.useRef(null);
|
||||
const floatingRef = React__namespace.useRef(null);
|
||||
const dataRef = React__namespace.useRef(data);
|
||||
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
||||
const platformRef = useLatestRef(platform);
|
||||
const [reference, _setReference] = React__namespace.useState(null);
|
||||
const [floating, _setFloating] = React__namespace.useState(null);
|
||||
const setReference = React__namespace.useCallback(node => {
|
||||
if (referenceRef.current !== node) {
|
||||
referenceRef.current = node;
|
||||
_setReference(node);
|
||||
}
|
||||
}, []);
|
||||
const setFloating = React__namespace.useCallback(node => {
|
||||
if (floatingRef.current !== node) {
|
||||
floatingRef.current = node;
|
||||
_setFloating(node);
|
||||
}
|
||||
}, []);
|
||||
const update = React__namespace.useCallback(() => {
|
||||
if (!referenceRef.current || !floatingRef.current) {
|
||||
return;
|
||||
}
|
||||
const config = {
|
||||
placement,
|
||||
strategy,
|
||||
middleware: latestMiddleware
|
||||
};
|
||||
if (platformRef.current) {
|
||||
config.platform = platformRef.current;
|
||||
}
|
||||
dom.computePosition(referenceRef.current, floatingRef.current, config).then(data => {
|
||||
const fullData = {
|
||||
...data,
|
||||
isPositioned: true
|
||||
};
|
||||
if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
|
||||
dataRef.current = fullData;
|
||||
ReactDOM__namespace.flushSync(() => {
|
||||
setData(fullData);
|
||||
});
|
||||
}
|
||||
});
|
||||
}, [latestMiddleware, placement, strategy, platformRef]);
|
||||
index(() => {
|
||||
if (open === false && dataRef.current.isPositioned) {
|
||||
dataRef.current.isPositioned = false;
|
||||
setData(data => ({
|
||||
...data,
|
||||
isPositioned: false
|
||||
}));
|
||||
}
|
||||
}, [open]);
|
||||
const isMountedRef = React__namespace.useRef(false);
|
||||
index(() => {
|
||||
isMountedRef.current = true;
|
||||
return () => {
|
||||
isMountedRef.current = false;
|
||||
};
|
||||
}, []);
|
||||
index(() => {
|
||||
if (reference && floating) {
|
||||
if (whileElementsMountedRef.current) {
|
||||
return whileElementsMountedRef.current(reference, floating, update);
|
||||
} else {
|
||||
update();
|
||||
}
|
||||
}
|
||||
}, [reference, floating, update, whileElementsMountedRef]);
|
||||
const refs = React__namespace.useMemo(() => ({
|
||||
reference: referenceRef,
|
||||
floating: floatingRef,
|
||||
setReference,
|
||||
setFloating
|
||||
}), [setReference, setFloating]);
|
||||
const elements = React__namespace.useMemo(() => ({
|
||||
reference,
|
||||
floating
|
||||
}), [reference, floating]);
|
||||
return React__namespace.useMemo(() => ({
|
||||
...data,
|
||||
update,
|
||||
refs,
|
||||
elements,
|
||||
reference: setReference,
|
||||
floating: setFloating
|
||||
}), [data, update, refs, elements, setReference, setFloating]);
|
||||
}
|
||||
|
||||
Object.defineProperty(exports, 'autoPlacement', {
|
||||
enumerable: true,
|
||||
get: function () { return dom.autoPlacement; }
|
||||
});
|
||||
Object.defineProperty(exports, 'autoUpdate', {
|
||||
enumerable: true,
|
||||
get: function () { return dom.autoUpdate; }
|
||||
});
|
||||
Object.defineProperty(exports, 'computePosition', {
|
||||
enumerable: true,
|
||||
get: function () { return dom.computePosition; }
|
||||
});
|
||||
Object.defineProperty(exports, 'detectOverflow', {
|
||||
enumerable: true,
|
||||
get: function () { return dom.detectOverflow; }
|
||||
});
|
||||
Object.defineProperty(exports, 'flip', {
|
||||
enumerable: true,
|
||||
get: function () { return dom.flip; }
|
||||
});
|
||||
Object.defineProperty(exports, 'getOverflowAncestors', {
|
||||
enumerable: true,
|
||||
get: function () { return dom.getOverflowAncestors; }
|
||||
});
|
||||
Object.defineProperty(exports, 'hide', {
|
||||
enumerable: true,
|
||||
get: function () { return dom.hide; }
|
||||
});
|
||||
Object.defineProperty(exports, 'inline', {
|
||||
enumerable: true,
|
||||
get: function () { return dom.inline; }
|
||||
});
|
||||
Object.defineProperty(exports, 'limitShift', {
|
||||
enumerable: true,
|
||||
get: function () { return dom.limitShift; }
|
||||
});
|
||||
Object.defineProperty(exports, 'offset', {
|
||||
enumerable: true,
|
||||
get: function () { return dom.offset; }
|
||||
});
|
||||
Object.defineProperty(exports, 'platform', {
|
||||
enumerable: true,
|
||||
get: function () { return dom.platform; }
|
||||
});
|
||||
Object.defineProperty(exports, 'shift', {
|
||||
enumerable: true,
|
||||
get: function () { return dom.shift; }
|
||||
});
|
||||
Object.defineProperty(exports, 'size', {
|
||||
enumerable: true,
|
||||
get: function () { return dom.size; }
|
||||
});
|
||||
exports.arrow = arrow;
|
||||
exports.useFloating = useFloating;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
}));
|
||||
1
node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.umd.min.js
generated
vendored
Normal file
1
node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.umd.min.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@floating-ui/dom"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","@floating-ui/dom","react","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).FloatingUIReactDOM={},e.FloatingUIDOM,e.React,e.ReactDOM)}(this,(function(e,t,r,n){"use strict";function o(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var u=o(r),i=o(n);var f="undefined"!=typeof document?r.useLayoutEffect:r.useEffect;function c(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;0!=n--;)if(!c(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!Object.prototype.hasOwnProperty.call(t,o[n]))return!1;for(n=r;0!=n--;){const r=o[n];if(("_owner"!==r||!e.$$typeof)&&!c(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function l(e){const t=u.useRef(e);return f((()=>{t.current=e})),t}Object.defineProperty(e,"autoPlacement",{enumerable:!0,get:function(){return t.autoPlacement}}),Object.defineProperty(e,"autoUpdate",{enumerable:!0,get:function(){return t.autoUpdate}}),Object.defineProperty(e,"computePosition",{enumerable:!0,get:function(){return t.computePosition}}),Object.defineProperty(e,"detectOverflow",{enumerable:!0,get:function(){return t.detectOverflow}}),Object.defineProperty(e,"flip",{enumerable:!0,get:function(){return t.flip}}),Object.defineProperty(e,"getOverflowAncestors",{enumerable:!0,get:function(){return t.getOverflowAncestors}}),Object.defineProperty(e,"hide",{enumerable:!0,get:function(){return t.hide}}),Object.defineProperty(e,"inline",{enumerable:!0,get:function(){return t.inline}}),Object.defineProperty(e,"limitShift",{enumerable:!0,get:function(){return t.limitShift}}),Object.defineProperty(e,"offset",{enumerable:!0,get:function(){return t.offset}}),Object.defineProperty(e,"platform",{enumerable:!0,get:function(){return t.platform}}),Object.defineProperty(e,"shift",{enumerable:!0,get:function(){return t.shift}}),Object.defineProperty(e,"size",{enumerable:!0,get:function(){return t.size}}),e.arrow=e=>{const{element:r,padding:n}=e;return{name:"arrow",options:e,fn(e){return o=r,Object.prototype.hasOwnProperty.call(o,"current")?null!=r.current?t.arrow({element:r.current,padding:n}).fn(e):{}:r?t.arrow({element:r,padding:n}).fn(e):{};var o}}},e.useFloating=function(e){void 0===e&&(e={});const{placement:r="bottom",strategy:n="absolute",middleware:o=[],platform:a,whileElementsMounted:s,open:d}=e,[p,m]=u.useState({x:null,y:null,strategy:n,placement:r,middlewareData:{},isPositioned:!1}),[b,g]=u.useState(o);c(b,o)||g(o);const y=u.useRef(null),O=u.useRef(null),P=u.useRef(p),j=l(s),h=l(a),[w,v]=u.useState(null),[M,R]=u.useState(null),S=u.useCallback((e=>{y.current!==e&&(y.current=e,v(e))}),[]),k=u.useCallback((e=>{O.current!==e&&(O.current=e,R(e))}),[]),D=u.useCallback((()=>{if(!y.current||!O.current)return;const e={placement:r,strategy:n,middleware:b};h.current&&(e.platform=h.current),t.computePosition(y.current,O.current,e).then((e=>{const t={...e,isPositioned:!0};_.current&&!c(P.current,t)&&(P.current=t,i.flushSync((()=>{m(t)})))}))}),[b,r,n,h]);f((()=>{!1===d&&P.current.isPositioned&&(P.current.isPositioned=!1,m((e=>({...e,isPositioned:!1}))))}),[d]);const _=u.useRef(!1);f((()=>(_.current=!0,()=>{_.current=!1})),[]),f((()=>{if(w&&M){if(j.current)return j.current(w,M,D);D()}}),[w,M,D,j]);const x=u.useMemo((()=>({reference:y,floating:O,setReference:S,setFloating:k})),[S,k]),A=u.useMemo((()=>({reference:w,floating:M})),[w,M]);return u.useMemo((()=>({...p,update:D,refs:x,elements:A,reference:S,floating:k})),[p,D,x,A,S,k])},Object.defineProperty(e,"__esModule",{value:!0})}));
|
||||
1
node_modules/@floating-ui/react-dom/index.d.ts
generated
vendored
Normal file
1
node_modules/@floating-ui/react-dom/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export * from './src/types';
|
||||
73
node_modules/@floating-ui/react-dom/package.json
generated
vendored
Normal file
73
node_modules/@floating-ui/react-dom/package.json
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"name": "@floating-ui/react-dom",
|
||||
"version": "1.3.0",
|
||||
"@rollingversions": {
|
||||
"baseVersion": [
|
||||
0,
|
||||
1,
|
||||
0
|
||||
]
|
||||
},
|
||||
"description": "Floating UI for React DOM",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "./dist/floating-ui.react-dom.umd.js",
|
||||
"module": "./dist/floating-ui.react-dom.esm.js",
|
||||
"unpkg": "./dist/floating-ui.react-dom.umd.min.js",
|
||||
"types": "./index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./index.d.ts",
|
||||
"module": "./dist/floating-ui.react-dom.esm.js",
|
||||
"import": "./dist/floating-ui.react-dom.mjs",
|
||||
"default": "./dist/floating-ui.react-dom.umd.js"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"files": [
|
||||
"dist/",
|
||||
"index.d.ts",
|
||||
"src/**/*.d.ts"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "jest test",
|
||||
"build": "NODE_ENV=build rollup -c"
|
||||
},
|
||||
"author": "atomiks",
|
||||
"license": "MIT",
|
||||
"bugs": "https://github.com/floating-ui/floating-ui",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/floating-ui/floating-ui.git",
|
||||
"directory": "packages/react-dom"
|
||||
},
|
||||
"homepage": "https://floating-ui.com/docs/react-dom",
|
||||
"keywords": [
|
||||
"tooltip",
|
||||
"popover",
|
||||
"dropdown",
|
||||
"menu",
|
||||
"popup",
|
||||
"positioning",
|
||||
"react",
|
||||
"react-dom"
|
||||
],
|
||||
"peerDependencies": {
|
||||
"react": ">=16.8.0",
|
||||
"react-dom": ">=16.8.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@floating-ui/dom": "^1.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/preset-react": "^7.16.0",
|
||||
"@rollup/plugin-commonjs": "^21.0.1",
|
||||
"@testing-library/react": "^13.2.0",
|
||||
"@types/react": "^18.0.1",
|
||||
"react": "^18.0.0",
|
||||
"react-dom": "^18.0.0",
|
||||
"use-isomorphic-layout-effect": "^1.1.1"
|
||||
}
|
||||
}
|
||||
14
node_modules/@floating-ui/react-dom/src/arrow.d.ts
generated
vendored
Normal file
14
node_modules/@floating-ui/react-dom/src/arrow.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { Middleware, SideObject } from '@floating-ui/core';
|
||||
import * as React from 'react';
|
||||
export interface Options {
|
||||
element: React.MutableRefObject<Element | null> | Element;
|
||||
padding?: number | SideObject;
|
||||
}
|
||||
/**
|
||||
* A data provider that provides data to position an inner element of the
|
||||
* floating element (usually a triangle or caret) so that it is centered to the
|
||||
* reference element.
|
||||
* This wraps the core `arrow` middleware to allow React refs as the element.
|
||||
* @see https://floating-ui.com/docs/arrow
|
||||
*/
|
||||
export declare const arrow: (options: Options) => Middleware;
|
||||
3
node_modules/@floating-ui/react-dom/src/index.d.ts
generated
vendored
Normal file
3
node_modules/@floating-ui/react-dom/src/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export { arrow } from './arrow';
|
||||
export { useFloating } from './useFloating';
|
||||
export { autoPlacement, autoUpdate, computePosition, detectOverflow, flip, getOverflowAncestors, hide, inline, limitShift, offset, platform, shift, size, } from '@floating-ui/dom';
|
||||
44
node_modules/@floating-ui/react-dom/src/types.d.ts
generated
vendored
Normal file
44
node_modules/@floating-ui/react-dom/src/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
import type { ComputePositionConfig, ComputePositionReturn, VirtualElement } from '@floating-ui/dom';
|
||||
import * as React from 'react';
|
||||
export { arrow, Options as ArrowOptions } from './arrow';
|
||||
export { useFloating } from './useFloating';
|
||||
export type { AlignedPlacement, Alignment, AutoPlacementOptions, AutoUpdateOptions, Axis, Boundary, ClientRectObject, ComputePositionConfig, ComputePositionReturn, Coords, DetectOverflowOptions, Dimensions, ElementContext, ElementRects, Elements, FlipOptions, FloatingElement, HideOptions, InlineOptions, Length, Middleware, MiddlewareArguments, MiddlewareData, MiddlewareReturn, MiddlewareState, NodeScroll, OffsetOptions, Padding, Placement, Platform, Rect, ReferenceElement, RootBoundary, ShiftOptions, Side, SideObject, SizeOptions, Strategy, VirtualElement, } from '@floating-ui/dom';
|
||||
export { autoPlacement, autoUpdate, computePosition, detectOverflow, flip, getOverflowAncestors, hide, inline, limitShift, offset, platform, shift, size, } from '@floating-ui/dom';
|
||||
type Prettify<T> = {
|
||||
[K in keyof T]: T[K];
|
||||
} & {};
|
||||
export type UseFloatingData = Prettify<Omit<ComputePositionReturn, 'x' | 'y'> & {
|
||||
x: number | null;
|
||||
y: number | null;
|
||||
isPositioned: boolean;
|
||||
}>;
|
||||
export type ReferenceType = Element | VirtualElement;
|
||||
export type UseFloatingReturn<RT extends ReferenceType = ReferenceType> = Prettify<UseFloatingData & {
|
||||
/**
|
||||
* Update the position of the floating element, re-rendering the component
|
||||
* if required.
|
||||
*/
|
||||
update: () => void;
|
||||
/**
|
||||
* @deprecated use `refs.setReference` instead.
|
||||
*/
|
||||
reference: (node: RT | null) => void;
|
||||
/**
|
||||
* @deprecated use `refs.setFloating` instead.
|
||||
*/
|
||||
floating: (node: HTMLElement | null) => void;
|
||||
refs: {
|
||||
reference: React.MutableRefObject<RT | null>;
|
||||
floating: React.MutableRefObject<HTMLElement | null>;
|
||||
setReference: (node: RT | null) => void;
|
||||
setFloating: (node: HTMLElement | null) => void;
|
||||
};
|
||||
elements: {
|
||||
reference: RT | null;
|
||||
floating: HTMLElement | null;
|
||||
};
|
||||
}>;
|
||||
export type UseFloatingProps<RT extends ReferenceType = ReferenceType> = Prettify<Partial<ComputePositionConfig> & {
|
||||
whileElementsMounted?: (reference: RT, floating: HTMLElement, update: () => void) => void | (() => void);
|
||||
open?: boolean;
|
||||
}>;
|
||||
6
node_modules/@floating-ui/react-dom/src/useFloating.d.ts
generated
vendored
Normal file
6
node_modules/@floating-ui/react-dom/src/useFloating.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import type { ReferenceType, UseFloatingProps, UseFloatingReturn } from './types';
|
||||
/**
|
||||
* Provides data to position a floating element.
|
||||
* @see https://floating-ui.com/docs/react
|
||||
*/
|
||||
export declare function useFloating<RT extends ReferenceType = ReferenceType>(options?: UseFloatingProps): UseFloatingReturn<RT>;
|
||||
1
node_modules/@floating-ui/react-dom/src/utils/deepEqual.d.ts
generated
vendored
Normal file
1
node_modules/@floating-ui/react-dom/src/utils/deepEqual.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function deepEqual(a: any, b: any): boolean;
|
||||
2
node_modules/@floating-ui/react-dom/src/utils/useLatestRef.d.ts
generated
vendored
Normal file
2
node_modules/@floating-ui/react-dom/src/utils/useLatestRef.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import * as React from 'react';
|
||||
export declare function useLatestRef<T>(value: T): React.MutableRefObject<T>;
|
||||
Reference in New Issue
Block a user