@vavt/react-ui 1.2.3 → 1.4.0
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/README.md +1 -1
- package/dist/Announcement-BUvNHscy.cjs +1 -0
- package/dist/Announcement-CznCpx2T.js +174 -0
- package/dist/Badge-BkqoSV-F.cjs +1 -0
- package/dist/Badge-FzXPw1qS.js +72 -0
- package/dist/{Col-CZjR94ac.js → Col-BZdKuXbj.js} +1 -1
- package/dist/{Col-qcq7T83y.cjs → Col-CvoVGKUn.cjs} +1 -1
- package/dist/Cron-B4S_KhO1.cjs +1 -0
- package/dist/{Cron-C3yEuafY.js → Cron-B8cGD7-3.js} +356 -348
- package/dist/{DatePicker-3DRaRPjg.cjs → DatePicker-DwACFSC7.cjs} +1 -1
- package/dist/{DatePicker-IFns1yBl.js → DatePicker-w6jWiNfz.js} +1 -1
- package/dist/{DateTimePicker-Bml1FgyN.cjs → DateTimePicker-B5atDTPW.cjs} +1 -1
- package/dist/{DateTimePicker-DnXBZTg0.js → DateTimePicker-NP2aVE5R.js} +1 -1
- package/dist/Drawer-DNZCj--j.js +113 -0
- package/dist/{Drawer-NyC3NpBR.cjs → Drawer-YWO6-KLG.cjs} +1 -1
- package/dist/Dropdown-Chx8SZPS.cjs +1 -0
- package/dist/Dropdown-CyVxoFAH.js +330 -0
- package/dist/Form-CyCbST4e.cjs +1 -0
- package/dist/Form-Fe4b1pS1.js +446 -0
- package/dist/{Loading-CL0wUgYK.js → Loading-BAKnIASq.js} +4 -4
- package/dist/{Loading-C2pY-4fA.cjs → Loading-BSqhKOle.cjs} +1 -1
- package/dist/{MessageBox-BeEgyiwR.js → MessageBox-C35_ifsL.js} +1 -1
- package/dist/{MessageBox-70-7jPWP.cjs → MessageBox-C6NLihE1.cjs} +1 -1
- package/dist/{Modal-DWKzYEN8.js → Modal-6kNs-9QU.js} +7 -7
- package/dist/{Modal-BYKseLTT.cjs → Modal-BKvRyCXZ.cjs} +1 -1
- package/dist/{Pagination-CXJBTKHs.js → Pagination-BrG1pKYw.js} +1 -1
- package/dist/{Pagination-Bi6z9CZE.cjs → Pagination-D3ok8N9k.cjs} +1 -1
- package/dist/Row-BGzLSkCy.js +24 -0
- package/dist/Row-CRQKzpiH.cjs +1 -0
- package/dist/Select-GleCzXQB.js +497 -0
- package/dist/Select-Rx6AHue2.cjs +1 -0
- package/dist/Sidebar-2KVVRUEM.cjs +1 -0
- package/dist/Sidebar-ByLinOVm.js +77 -0
- package/dist/{Table-8KkwnZom.js → Table-ClWg25Wn.js} +10 -7
- package/dist/{Table-DVb-ByCJ.cjs → Table-Dv2qxs8q.cjs} +1 -1
- package/dist/TimePicker-BCU7D6uD.cjs +1 -0
- package/dist/TimePicker-BVZbkBvJ.js +215 -0
- package/dist/Tooltip-BbbIT5nt.js +198 -0
- package/dist/Tooltip-z6u7ChKj.cjs +1 -0
- package/dist/base.css +1 -1
- package/dist/cjs/Announcement.cjs +1 -1
- package/dist/cjs/Badge.cjs +1 -0
- package/dist/cjs/Col.cjs +1 -1
- package/dist/cjs/Cron.cjs +1 -1
- package/dist/cjs/DatePicker.cjs +1 -1
- package/dist/cjs/DateTimePicker.cjs +1 -1
- package/dist/cjs/Drawer.cjs +1 -1
- package/dist/cjs/Dropdown.cjs +1 -1
- package/dist/cjs/Form.cjs +1 -1
- package/dist/cjs/Loading.cjs +1 -1
- package/dist/cjs/MessageBox.cjs +1 -1
- package/dist/cjs/Modal.cjs +1 -1
- package/dist/cjs/Pagination.cjs +1 -1
- package/dist/cjs/Row.cjs +1 -1
- package/dist/cjs/Select.cjs +1 -1
- package/dist/cjs/Sidebar.cjs +1 -1
- package/dist/cjs/Table.cjs +1 -1
- package/dist/cjs/TimePicker.cjs +1 -1
- package/dist/cjs/Tooltip.cjs +1 -1
- package/dist/cjs/global.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/register.cjs +1 -1
- package/dist/css/Announcement.css +1 -1
- package/dist/css/Badge.css +1 -0
- package/dist/css/Button.css +1 -1
- package/dist/css/Checkbox.css +1 -1
- package/dist/css/Form.css +1 -1
- package/dist/css/Radio.css +1 -1
- package/dist/css/Sidebar.css +1 -1
- package/dist/css/Switch.css +1 -1
- package/dist/date-picker-DVvBQnvF.cjs +1 -0
- package/dist/date-picker-pcnebTrf.js +639 -0
- package/dist/es/Announcement.mjs +1 -1
- package/dist/es/Badge.mjs +3 -0
- package/dist/es/Col.mjs +1 -1
- package/dist/es/Cron.mjs +1 -1
- package/dist/es/DatePicker.mjs +1 -1
- package/dist/es/DateTimePicker.mjs +1 -1
- package/dist/es/Drawer.mjs +1 -1
- package/dist/es/Dropdown.mjs +1 -1
- package/dist/es/Form.mjs +1 -1
- package/dist/es/Loading.mjs +1 -1
- package/dist/es/MessageBox.mjs +1 -1
- package/dist/es/Modal.mjs +1 -1
- package/dist/es/Pagination.mjs +1 -1
- package/dist/es/Row.mjs +1 -1
- package/dist/es/Select.mjs +1 -1
- package/dist/es/Sidebar.mjs +1 -1
- package/dist/es/Table.mjs +1 -1
- package/dist/es/TimePicker.mjs +1 -1
- package/dist/es/Tooltip.mjs +1 -1
- package/dist/es/global.mjs +1 -1
- package/dist/es/index.mjs +41 -40
- package/dist/es/register.mjs +1 -1
- package/dist/floating-BpTI3sWS.cjs +1 -0
- package/dist/{floating-CqdcJWk2.js → floating-BqCWEj83.js} +27 -15
- package/dist/index.css +1 -1
- package/dist/registry-Cddoj83d.js +87 -0
- package/dist/registry-DvXvnY8T.cjs +1 -0
- package/dist/style/Badge.cjs +8 -0
- package/dist/style/Badge.mjs +8 -0
- package/dist/style/Sidebar.cjs +1 -0
- package/dist/style/Sidebar.mjs +1 -0
- package/dist/types/Announcement/type.d.cts +2 -2
- package/dist/types/Announcement/type.d.ts +2 -2
- package/dist/types/Badge/Badge.d.cts +3 -0
- package/dist/types/Badge/Badge.d.ts +3 -0
- package/dist/types/Badge/index.d.cts +5 -0
- package/dist/types/Badge/index.d.ts +5 -0
- package/dist/types/Badge/type.d.cts +31 -0
- package/dist/types/Badge/type.d.ts +31 -0
- package/dist/types/Form/FormItem.d.cts +1 -1
- package/dist/types/Form/FormItem.d.ts +1 -1
- package/dist/types/Form/context.d.cts +4 -2
- package/dist/types/Form/context.d.ts +4 -2
- package/dist/types/Form/index.d.cts +2 -2
- package/dist/types/Form/index.d.ts +2 -2
- package/dist/types/Form/type.d.cts +2 -0
- package/dist/types/Form/type.d.ts +2 -0
- package/dist/types/Select/SelectList.d.cts +20 -0
- package/dist/types/Select/SelectList.d.ts +20 -0
- package/dist/types/_shared/date-calendar.d.cts +20 -0
- package/dist/types/_shared/date-calendar.d.ts +20 -0
- package/dist/types/_shared/floating.d.cts +13 -1
- package/dist/types/_shared/floating.d.ts +13 -1
- package/dist/types/global.d.cts +2 -0
- package/dist/types/global.d.ts +2 -0
- package/dist/types/index.d.cts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/registry.d.cts +2 -1
- package/dist/types/registry.d.ts +2 -1
- package/package.json +1 -1
- package/dist/Announcement-D0hZE2sM.cjs +0 -1
- package/dist/Announcement-DzzaTvcO.js +0 -212
- package/dist/Cron-DyBHGiUj.cjs +0 -1
- package/dist/Drawer-B4vSd2iq.js +0 -113
- package/dist/Dropdown-CI_C-qdP.js +0 -319
- package/dist/Dropdown-DPY4QNdT.cjs +0 -1
- package/dist/Form-BMXJJ8bX.cjs +0 -1
- package/dist/Form-BvCSJ23z.js +0 -449
- package/dist/Row-BJZtEKxG.cjs +0 -1
- package/dist/Row-DpEse7PJ.js +0 -24
- package/dist/Select-DaIhlOMK.js +0 -466
- package/dist/Select-YUrncvbr.cjs +0 -1
- package/dist/Sidebar-BPXVnP7y.cjs +0 -1
- package/dist/Sidebar-u980T-QB.js +0 -76
- package/dist/TimePicker-CZAlhs_F.cjs +0 -1
- package/dist/TimePicker-TtKzEbBJ.js +0 -207
- package/dist/Tooltip-BtUDTfMB.js +0 -205
- package/dist/Tooltip-C4CuAEie.cjs +0 -1
- package/dist/date-picker-Yq0xV3y8.cjs +0 -1
- package/dist/date-picker-tq5q60JP.js +0 -612
- package/dist/floating-5PRFyI8D.cjs +0 -1
- package/dist/registry-BmoI_ib1.js +0 -85
- package/dist/registry-DtJjJt6v.cjs +0 -1
- package/dist/types/Announcement/host.d.cts +0 -12
- package/dist/types/Announcement/host.d.ts +0 -12
package/dist/es/MessageBox.mjs
CHANGED
package/dist/es/Modal.mjs
CHANGED
package/dist/es/Pagination.mjs
CHANGED
package/dist/es/Row.mjs
CHANGED
package/dist/es/Select.mjs
CHANGED
package/dist/es/Sidebar.mjs
CHANGED
package/dist/es/Table.mjs
CHANGED
package/dist/es/TimePicker.mjs
CHANGED
package/dist/es/Tooltip.mjs
CHANGED
package/dist/es/global.mjs
CHANGED
package/dist/es/index.mjs
CHANGED
|
@@ -1,43 +1,44 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { n as e } from "../Alert-BGyLKuv0.js";
|
|
3
3
|
import { n as t } from "../Anchor-CAZPkv56.js";
|
|
4
|
-
import { n } from "../Announcement-
|
|
5
|
-
import { n as r
|
|
6
|
-
import { n as
|
|
7
|
-
import { n as
|
|
8
|
-
import { n as
|
|
9
|
-
import { n as l } from "../
|
|
10
|
-
import { n as u } from "../
|
|
11
|
-
import { n as d } from "../
|
|
12
|
-
import { n as f } from "../
|
|
13
|
-
import { n as p } from "../
|
|
14
|
-
import { n as m } from "../
|
|
15
|
-
import { n as h } from "../
|
|
16
|
-
import { n as g } from "../
|
|
17
|
-
import { n as _ } from "../
|
|
18
|
-
import { n as v } from "../
|
|
19
|
-
import { n as y } from "../
|
|
20
|
-
import { n as b
|
|
21
|
-
import { n as S } from "../
|
|
22
|
-
import { n as C } from "../
|
|
23
|
-
import { n as w } from "../
|
|
24
|
-
import { n as T } from "../
|
|
25
|
-
import {
|
|
26
|
-
import { t as D } from "../
|
|
27
|
-
import {
|
|
28
|
-
import { n as k } from "../
|
|
29
|
-
import { n as A } from "../
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import { n as F } from "../
|
|
34
|
-
import { n as I } from "../
|
|
35
|
-
import { n as L } from "../
|
|
36
|
-
import { n as R } from "../
|
|
37
|
-
import { n as z } from "../
|
|
38
|
-
import { n as B } from "../
|
|
39
|
-
import { n as V } from "../
|
|
40
|
-
import { n as H } from "../
|
|
41
|
-
import { n as U } from "../
|
|
42
|
-
import { n as W
|
|
43
|
-
|
|
4
|
+
import { n } from "../Announcement-CznCpx2T.js";
|
|
5
|
+
import { n as r } from "../Transition-DiO4GsP3.js";
|
|
6
|
+
import { n as i } from "../Badge-FzXPw1qS.js";
|
|
7
|
+
import { n as a, r as o } from "../Button-CwkWSWau.js";
|
|
8
|
+
import { n as s } from "../Card-DCLfLn1x.js";
|
|
9
|
+
import { n as c, r as l } from "../Checkbox-bHOjYdMp.js";
|
|
10
|
+
import { n as u } from "../Col-BZdKuXbj.js";
|
|
11
|
+
import { n as d } from "../Input-BRy5Xuwy.js";
|
|
12
|
+
import { n as f } from "../Tabs-HWLkyrQR.js";
|
|
13
|
+
import { n as p } from "../NumberInput-CB-nKZgs.js";
|
|
14
|
+
import { n as m } from "../Cron-B8cGD7-3.js";
|
|
15
|
+
import { n as h } from "../Dropdown-CyVxoFAH.js";
|
|
16
|
+
import { n as g } from "../DatePicker-w6jWiNfz.js";
|
|
17
|
+
import { n as _ } from "../DateTimePicker-NP2aVE5R.js";
|
|
18
|
+
import { n as v } from "../Divider-BXNZyvHY.js";
|
|
19
|
+
import { n as y } from "../Drawer-DNZCj--j.js";
|
|
20
|
+
import { n as b } from "../Empty-MmxZitR8.js";
|
|
21
|
+
import { n as x, t as S } from "../Form-Fe4b1pS1.js";
|
|
22
|
+
import { n as C } from "../Tooltip-BbbIT5nt.js";
|
|
23
|
+
import { n as w } from "../Loading-BAKnIASq.js";
|
|
24
|
+
import { n as T } from "../Scrollbar-BdMGZrYi.js";
|
|
25
|
+
import { n as E } from "../Modal-6kNs-9QU.js";
|
|
26
|
+
import { t as D } from "../MessageBox-C35_ifsL.js";
|
|
27
|
+
import { t as O } from "../Notification-CJraaZIi.js";
|
|
28
|
+
import { n as k } from "../Select-GleCzXQB.js";
|
|
29
|
+
import { n as A } from "../Pagination-BrG1pKYw.js";
|
|
30
|
+
import { n as j } from "../Progress-D2C6LCml.js";
|
|
31
|
+
import { VlRadio as M, VlRadioGroup as N } from "./Radio.mjs";
|
|
32
|
+
import { VlRow as P } from "./Row.mjs";
|
|
33
|
+
import { n as F } from "../Sidebar-ByLinOVm.js";
|
|
34
|
+
import { n as I } from "../Slider-CKU03SsT.js";
|
|
35
|
+
import { n as L } from "../Space-gnVH7rEt.js";
|
|
36
|
+
import { n as R } from "../Switch-CqTFvp-k.js";
|
|
37
|
+
import { n as z } from "../Table-ClWg25Wn.js";
|
|
38
|
+
import { n as B } from "../Tag-TeYTDdHt.js";
|
|
39
|
+
import { n as V } from "../Textarea-CA6Vzu7t.js";
|
|
40
|
+
import { n as H } from "../Timeline-euWvUS4e.js";
|
|
41
|
+
import { n as U } from "../TimePicker-BVZbkBvJ.js";
|
|
42
|
+
import { n as W } from "../Upload-DZ6VaM7r.js";
|
|
43
|
+
import { n as G, t as K } from "../registry-Cddoj83d.js";
|
|
44
|
+
export { e as VlAlert, t as VlAnchor, n as VlAnnouncement, i as VlBadge, a as VlButton, o as VlButtonGroup, s as VlCard, c as VlCheckbox, l as VlCheckboxGroup, u as VlCol, m as VlCron, g as VlDatePicker, _ as VlDateTimePicker, v as VlDivider, y as VlDrawer, h as VlDropdown, b as VlEmpty, S as VlForm, x as VlFormItem, d as VlInput, w as VlLoading, D as VlMessageBox, E as VlModal, O as VlNotification, p as VlNumberInput, A as VlPagination, j as VlProgress, M as VlRadio, N as VlRadioGroup, P as VlRow, T as VlScrollbar, k as VlSelect, F as VlSidebar, I as VlSlider, L as VlSpace, R as VlSwitch, z as VlTable, f as VlTabs, B as VlTag, V as VlTextarea, U as VlTimePicker, H as VlTimeline, C as VlTooltip, r as VlTransition, W as VlUpload, K as globalComponents, G as registerGlobalComponents };
|
package/dist/es/register.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./effect-BpNxm_06.cjs"),t=require("./number-B7qJF_ZY.cjs");let n=require("react");var r=(e={},t={})=>{let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>Object.is(e[n],t[n]))},i=e=>{let[t,i]=(0,n.useState)({placement:e,style:{}}),a=(0,n.useRef)(t);return[t,(0,n.useCallback)(e=>{let t=a.current;t.placement===e.placement&&r(t.style,e.style)&&r(t.arrowStyle,e.arrowStyle)||(a.current=e,i(e))},[])]},a=({active:t,rootRef:r,floatingRef:i,closeOnOutsideClick:a=!0,ignoreEscapeInsideFloating:o=!1,isOwnedPopup:s,onOutsideClick:c,onEscape:l,onViewportChange:u})=>{let d=(0,n.useRef)({rootRef:r,floatingRef:i,closeOnOutsideClick:a,ignoreEscapeInsideFloating:o,isOwnedPopup:s,onOutsideClick:c,onEscape:l,onViewportChange:u});e.t(()=>{d.current={rootRef:r,floatingRef:i,closeOnOutsideClick:a,ignoreEscapeInsideFloating:o,isOwnedPopup:s,onOutsideClick:c,onEscape:l,onViewportChange:u}});let f=!!l,p=!!u;(0,n.useEffect)(()=>{if(!t)return;let e=null,n=e=>{let{closeOnOutsideClick:t,rootRef:n,floatingRef:r,isOwnedPopup:i,onOutsideClick:a}=d.current;if(!t)return;let o=e.composedPath(),s=n.current,c=r.current;!s||o.includes(s)||c&&o.includes(c)||i?.(o)||a?.()},r=e=>{let{ignoreEscapeInsideFloating:t,floatingRef:n,onEscape:r}=d.current;r&&(e.key!==`Escape`||t&&n.current?.contains(e.target)||(e.preventDefault(),r()))},i=()=>{d.current.onViewportChange&&e===null&&(e=(typeof window<`u`&&typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame:e=>setTimeout(e,16))(()=>{e=null,d.current.onViewportChange?.()}))};return document.addEventListener(`pointerdown`,n,!0),f&&document.addEventListener(`keydown`,r),p&&(window.addEventListener(`resize`,i,{passive:!0}),window.addEventListener(`scroll`,i,{passive:!0,capture:!0})),()=>{e!==null&&(typeof window<`u`&&typeof window.cancelAnimationFrame==`function`?window.cancelAnimationFrame(e):clearTimeout(e),e=null),document.removeEventListener(`pointerdown`,n,!0),f&&document.removeEventListener(`keydown`,r),p&&(window.removeEventListener(`resize`,i),window.removeEventListener(`scroll`,i,!0))}},[t,f,p])},o=e=>({"bottom-start":[`bottom-start`,`bottom-end`,`top-start`,`top-end`],"bottom-end":[`bottom-end`,`bottom-start`,`top-end`,`top-start`],"top-start":[`top-start`,`top-end`,`bottom-start`,`bottom-end`],"top-end":[`top-end`,`top-start`,`bottom-end`,`bottom-start`]})[e],s=({anchorRect:e,floatingRect:n,placement:r,offset:i,edgePadding:a=8,getCandidates:o=c,fallbackFits:s})=>{let l=t=>{let r=t.split(`-`)[0],a=!t.endsWith(`-start`)&&!t.endsWith(`-end`),o=t.endsWith(`-end`);if(r===`top`||r===`bottom`)return{x:a?e.left+(e.width-n.width)/2:o?e.right-n.width:e.left,y:r===`top`?e.top-i-n.height:e.bottom+i};let s=a?e.top+(e.height-n.height)/2:o?e.bottom-n.height:e.top;return{x:r===`left`?e.left-i-n.width:e.right+i,y:s}},u=({x:e,y:t})=>e>=a&&e+n.width<=window.innerWidth-a&&t>=a&&t+n.height<=window.innerHeight-a,d=o(r),f=d.find(e=>u(l(e)))??(s?d.find(e=>s(l(e))):void 0)??r,p=l(f),m=Math.max(a,window.innerWidth-n.width-a),h=Math.max(a,window.innerHeight-n.height-a);return{placement:f,x:t.t(p.x,a,m),y:t.t(p.y,a,h)}},c=e=>({top:[`top`,`bottom`,`left`,`right`],"top-start":[`top-start`,`bottom-start`,`top-end`,`bottom-end`],"top-end":[`top-end`,`bottom-end`,`top-start`,`bottom-start`],bottom:[`bottom`,`top`,`left`,`right`],"bottom-start":[`bottom-start`,`top-start`,`bottom-end`,`top-end`],"bottom-end":[`bottom-end`,`top-end`,`bottom-start`,`top-start`],left:[`left`,`right`,`top`,`bottom`],"left-start":[`left-start`,`right-start`,`left-end`,`right-end`],"left-end":[`left-end`,`right-end`,`left-start`,`right-start`],right:[`right`,`left`,`top`,`bottom`],"right-start":[`right-start`,`left-start`,`right-end`,`left-end`],"right-end":[`right-end`,`left-end`,`right-start`,`left-start`]})[e],l=e=>{let{edgePadding:t=8,...n}=e;return s({...n,edgePadding:t,getCandidates:o,fallbackFits:({y:n})=>n>=t&&n+e.floatingRect.height<=window.innerHeight-t})};Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return l}});
|
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
import { t as e } from "./effect-nifYL_rH.js";
|
|
2
2
|
import { t } from "./number-BN2jHM6Z.js";
|
|
3
|
-
import {
|
|
3
|
+
import { useCallback as n, useEffect as r, useRef as i, useState as a } from "react";
|
|
4
4
|
//#region components/_shared/floating.ts
|
|
5
|
-
var
|
|
6
|
-
let
|
|
7
|
-
|
|
5
|
+
var o = (e = {}, t = {}) => {
|
|
6
|
+
let n = Object.keys(e);
|
|
7
|
+
return n.length === Object.keys(t).length && n.every((n) => Object.is(e[n], t[n]));
|
|
8
|
+
}, s = (e) => {
|
|
9
|
+
let [t, r] = a({
|
|
10
|
+
placement: e,
|
|
11
|
+
style: {}
|
|
12
|
+
}), s = i(t);
|
|
13
|
+
return [t, n((e) => {
|
|
14
|
+
let t = s.current;
|
|
15
|
+
t.placement === e.placement && o(t.style, e.style) && o(t.arrowStyle, e.arrowStyle) || (s.current = e, r(e));
|
|
16
|
+
}, [])];
|
|
17
|
+
}, c = ({ active: t, rootRef: n, floatingRef: a, closeOnOutsideClick: o = !0, ignoreEscapeInsideFloating: s = !1, isOwnedPopup: c, onOutsideClick: l, onEscape: u, onViewportChange: d }) => {
|
|
18
|
+
let f = i({
|
|
19
|
+
rootRef: n,
|
|
8
20
|
floatingRef: a,
|
|
9
21
|
closeOnOutsideClick: o,
|
|
10
22
|
ignoreEscapeInsideFloating: s,
|
|
@@ -15,7 +27,7 @@ var i = ({ active: t, rootRef: i, floatingRef: a, closeOnOutsideClick: o = !0, i
|
|
|
15
27
|
});
|
|
16
28
|
e(() => {
|
|
17
29
|
f.current = {
|
|
18
|
-
rootRef:
|
|
30
|
+
rootRef: n,
|
|
19
31
|
floatingRef: a,
|
|
20
32
|
closeOnOutsideClick: o,
|
|
21
33
|
ignoreEscapeInsideFloating: s,
|
|
@@ -26,7 +38,7 @@ var i = ({ active: t, rootRef: i, floatingRef: a, closeOnOutsideClick: o = !0, i
|
|
|
26
38
|
};
|
|
27
39
|
});
|
|
28
40
|
let p = !!u, m = !!d;
|
|
29
|
-
|
|
41
|
+
r(() => {
|
|
30
42
|
if (!t) return;
|
|
31
43
|
let e = null, n = (e) => {
|
|
32
44
|
let { closeOnOutsideClick: t, rootRef: n, floatingRef: r, isOwnedPopup: i, onOutsideClick: a } = f.current;
|
|
@@ -52,7 +64,7 @@ var i = ({ active: t, rootRef: i, floatingRef: a, closeOnOutsideClick: o = !0, i
|
|
|
52
64
|
p,
|
|
53
65
|
m
|
|
54
66
|
]);
|
|
55
|
-
},
|
|
67
|
+
}, l = (e) => ({
|
|
56
68
|
"bottom-start": [
|
|
57
69
|
"bottom-start",
|
|
58
70
|
"bottom-end",
|
|
@@ -77,8 +89,8 @@ var i = ({ active: t, rootRef: i, floatingRef: a, closeOnOutsideClick: o = !0, i
|
|
|
77
89
|
"bottom-end",
|
|
78
90
|
"bottom-start"
|
|
79
91
|
]
|
|
80
|
-
})[e],
|
|
81
|
-
let
|
|
92
|
+
})[e], u = ({ anchorRect: e, floatingRect: n, placement: r, offset: i, edgePadding: a = 8, getCandidates: o = d, fallbackFits: s }) => {
|
|
93
|
+
let c = (t) => {
|
|
82
94
|
let r = t.split("-")[0], a = !t.endsWith("-start") && !t.endsWith("-end"), o = t.endsWith("-end");
|
|
83
95
|
if (r === "top" || r === "bottom") return {
|
|
84
96
|
x: a ? e.left + (e.width - n.width) / 2 : o ? e.right - n.width : e.left,
|
|
@@ -89,13 +101,13 @@ var i = ({ active: t, rootRef: i, floatingRef: a, closeOnOutsideClick: o = !0, i
|
|
|
89
101
|
x: r === "left" ? e.left - i - n.width : e.right + i,
|
|
90
102
|
y: s
|
|
91
103
|
};
|
|
92
|
-
},
|
|
104
|
+
}, l = ({ x: e, y: t }) => e >= a && e + n.width <= window.innerWidth - a && t >= a && t + n.height <= window.innerHeight - a, u = o(r), f = u.find((e) => l(c(e))) ?? (s ? u.find((e) => s(c(e))) : void 0) ?? r, p = c(f), m = Math.max(a, window.innerWidth - n.width - a), h = Math.max(a, window.innerHeight - n.height - a);
|
|
93
105
|
return {
|
|
94
106
|
placement: f,
|
|
95
107
|
x: t(p.x, a, m),
|
|
96
108
|
y: t(p.y, a, h)
|
|
97
109
|
};
|
|
98
|
-
},
|
|
110
|
+
}, d = (e) => ({
|
|
99
111
|
top: [
|
|
100
112
|
"top",
|
|
101
113
|
"bottom",
|
|
@@ -168,14 +180,14 @@ var i = ({ active: t, rootRef: i, floatingRef: a, closeOnOutsideClick: o = !0, i
|
|
|
168
180
|
"right-start",
|
|
169
181
|
"left-start"
|
|
170
182
|
]
|
|
171
|
-
})[e],
|
|
183
|
+
})[e], f = (e) => {
|
|
172
184
|
let { edgePadding: t = 8, ...n } = e;
|
|
173
|
-
return
|
|
185
|
+
return u({
|
|
174
186
|
...n,
|
|
175
187
|
edgePadding: t,
|
|
176
|
-
getCandidates:
|
|
188
|
+
getCandidates: l,
|
|
177
189
|
fallbackFits: ({ y: n }) => n >= t && n + e.floatingRect.height <= window.innerHeight - t
|
|
178
190
|
});
|
|
179
191
|
};
|
|
180
192
|
//#endregion
|
|
181
|
-
export {
|
|
193
|
+
export { s as i, u as n, c as r, f as t };
|