@nice2dev/ui 1.0.25 → 1.0.27
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/CHANGELOG.md +37 -0
- package/dist/NiceErrorBoundary-B91z3IjT.cjs +1 -0
- package/dist/NiceErrorBoundary-DQLk-68V.js +770 -0
- package/dist/NiceForm-8_p8P0uJ.js +5386 -0
- package/dist/NiceForm-DkVFd5Z5.cjs +382 -0
- package/dist/NiceModal-CdiLaYTg.cjs +1 -0
- package/dist/NiceModal-D6Yj67eH.js +95 -0
- package/dist/NiceModuleLifecyclePanel-Bhd8VNjU.js +6856 -0
- package/dist/NiceModuleLifecyclePanel-Cn_nB4dg.cjs +1 -0
- package/dist/NicePagination-Dnlho_8O.cjs +1 -0
- package/dist/NicePagination-kokSP8ls.js +171 -0
- package/dist/NicePinCodeInput-1YGb7l2o.cjs +696 -0
- package/dist/NicePinCodeInput-CZpYON--.js +13097 -0
- package/dist/NiceSavedQueryPanel-C6pPtOAf.js +6893 -0
- package/dist/NiceSavedQueryPanel-DOixGvLP.cjs +596 -0
- package/dist/NiceTabs-DHiA02RD.cjs +1 -0
- package/dist/NiceTabs-MBVJomax.js +1657 -0
- package/dist/NiceWindow-DUOkdKuX.js +1592 -0
- package/dist/NiceWindow-ZAAUD3LJ.cjs +1 -0
- package/dist/charts-B_lYNVMJ.cjs +761 -0
- package/dist/charts-CABhvyAA.js +4657 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.mjs +1 -1
- package/dist/core-BHZDvnBo.js +25364 -0
- package/dist/core-C7PK1L9r.cjs +122 -0
- package/dist/data-branching-BGw7O52F.js +6133 -0
- package/dist/data-branching-Dz3xLUZM.cjs +1 -0
- package/dist/data-branching.cjs +1 -1
- package/dist/data-branching.mjs +1 -1
- package/dist/data.cjs +1 -1
- package/dist/data.mjs +1 -1
- package/dist/devops-CX538_rA.js +7684 -0
- package/dist/devops-JwBTMk0A.cjs +17 -0
- package/dist/devops.cjs +1 -1
- package/dist/devops.mjs +1 -1
- package/dist/editors.cjs +1 -1
- package/dist/editors.mjs +3 -3
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.mjs +2 -2
- package/dist/index-CTe-G23X.cjs +5518 -0
- package/dist/index-DGjd42Q9.js +68223 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +75 -0
- package/dist/index.mjs +803 -797
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.mjs +24 -24
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +18 -1
- package/dist/navigation.mjs +4 -4
- package/dist/no-code-CIf6wiUc.js +7133 -0
- package/dist/no-code-DSa5Yn6l.cjs +332 -0
- package/dist/no-code.cjs +1 -1
- package/dist/no-code.mjs +1 -1
- package/dist/overlays.cjs +1 -1
- package/dist/overlays.mjs +55 -55
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/no-code.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./no-code-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./no-code-DSa5Yn6l.cjs");exports.NiceAPIFlow=e.NiceAPIFlow;exports.NiceCodePreview=e.NiceCodePreview;exports.NiceCodeTemplate=e.NiceCodeTemplate;exports.NiceComponentDesigner=e.NiceComponentDesigner;exports.NiceDataMapper=e.NiceDataMapper;exports.NiceEventOrchestrator=e.NiceEventOrchestrator;exports.NiceLowCodeStudio=e.NiceLowCodeStudio;exports.NicePageBuilder=e.NicePageBuilder;exports.NiceStateDesigner=e.NiceStateDesigner;exports.NiceTestBuilder=e.NiceTestBuilder;
|
package/dist/no-code.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as i, a as s, b as c, c as o, d as r, e as t, f as N, g as d, h as n, i as p } from "./no-code-
|
|
1
|
+
import { N as i, a as s, b as c, c as o, d as r, e as t, f as N, g as d, h as n, i as p } from "./no-code-CIf6wiUc.js";
|
|
2
2
|
export {
|
|
3
3
|
i as NiceAPIFlow,
|
|
4
4
|
s as NiceCodePreview,
|
package/dist/overlays.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("./NiceWindow-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("./NiceWindow-ZAAUD3LJ.cjs"),r=require("react/jsx-runtime"),M=require("./core-C7PK1L9r.cjs"),e=require("react"),I=require("react-dom");function B(){const t=e.useContext(M.gr);return t?.portalTarget?t.portalTarget:typeof document<"u"?document.body:null}const W=({open:t,onClose:s,children:v,title:a,size:g="md",closeOnBackdropClick:l=!0,closeOnEscape:d=!0,disableFocusTrap:u=!1,disableBodyScroll:j=!0,zIndex:_=1e3,className:p,style:C})=>{const w=e.useRef(null);M.Qs(w,t&&!u);const y=B();e.useEffect(()=>{if(!j&&t){const n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=n}}},[t,j]),e.useEffect(()=>{if(!d||!t)return;const n=b=>{b.key==="Escape"&&(b.preventDefault(),s())};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[d,t,s]);const f=e.useCallback(n=>{l&&n.target===n.currentTarget&&s()},[l,s]);if(!t)return null;const i={sm:"nice-modal--sm",md:"nice-modal--md",lg:"nice-modal--lg",xl:"nice-modal--xl",full:"nice-modal--full"}[g];return I.createPortal(r.jsx("div",{className:"nice-modal__overlay",style:{zIndex:_},onClick:f,role:"presentation",children:r.jsx("div",{ref:w,className:`nice-modal ${i} ${p||""}`,role:"dialog","aria-modal":"true","aria-label":a,style:C,tabIndex:-1,children:v})}),y)},O=({children:t,showClose:s=!0,onClose:v,className:a})=>r.jsxs("div",{className:`nice-modal__header ${a||""}`,children:[r.jsx("div",{className:"nice-modal__title",children:t}),s&&v&&r.jsx("button",{type:"button",className:"nice-modal__close",onClick:v,"aria-label":"Close",children:r.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",children:r.jsx("path",{d:"M4 4l12 12M4 16L16 4"})})})]}),X=({children:t,className:s})=>r.jsx("div",{className:`nice-modal__body ${s||""}`,children:t}),q=({children:t,className:s})=>r.jsx("div",{className:`nice-modal__footer ${s||""}`,children:t}),G=({open:t,onClose:s,children:v,position:a="right",size:g=320,title:l,closeOnBackdropClick:d=!0,closeOnEscape:u=!0,swipeToClose:j=!0,zIndex:_=1e3,className:p,style:C})=>{const w=e.useRef(null),[y,f]=e.useState(!1),[i,n]=e.useState(0);M.Qs(w,t);const b=B();e.useEffect(()=>{if(!u||!t)return;const o=k=>{k.key==="Escape"&&(k.preventDefault(),s())};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[u,t,s]);const h=e.useCallback(o=>{let k=0;switch(a){case"left":k=Math.min(0,o.deltaX);break;case"right":k=Math.max(0,o.deltaX);break;case"top":k=Math.min(0,o.deltaY);break;case"bottom":k=Math.max(0,o.deltaY);break}n(k)},[a]),D=e.useCallback(o=>{let E=!1;switch(a){case"left":E=o.deltaX<-100;break;case"right":E=o.deltaX>100;break;case"top":E=o.deltaY<-100;break;case"bottom":E=o.deltaY>100;break}E&&(M.Gr("light"),s()),n(0),f(!1)},[a,s]),{ref:P}=M.bc({enabled:j&&t,onPanStart:()=>f(!0),onPan:h,onPanEnd:D}),$=e.useCallback(o=>{d&&o.target===o.currentTarget&&s()},[d,s]);if(!t)return null;const S=a==="left"||a==="right",L=S?{width:typeof g=="number"?`${g}px`:g}:{height:typeof g=="number"?`${g}px`:g},c=()=>{if(y)return S?`translateX(${i}px)`:`translateY(${i}px)`};return I.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{className:`nice-drawer__overlay ${t?"nice-drawer__overlay--visible":""}`,style:{zIndex:_},onClick:$}),r.jsx("div",{ref:o=>{w.current=o,P.current=o},className:`nice-drawer nice-drawer--${a} ${t?"nice-drawer--open":""} ${p||""}`,style:{...L,zIndex:_+1,transform:c(),transition:y?"none":void 0,...C},role:"dialog","aria-modal":"true","aria-label":l,tabIndex:-1,children:v})]}),b)},K=({open:t,onClose:s,children:v,title:a,showHandle:g=!0,snapPoints:l=[.5,.9],initialSnap:d=0,expandable:u=!0,closeOnBackdropClick:j=!0,closeOnEscape:_=!0,hapticFeedback:p=!0,zIndex:C=1e3,className:w,style:y})=>{const f=e.useRef(null),i=e.useRef(null),[n,b]=e.useState(d),[h,D]=e.useState(!1),[P,$]=e.useState(0),S=e.useRef(0);e.useEffect(()=>{t&&(b(d),$(0))},[t,d]),M.Qs(f,t);const L=B();e.useEffect(()=>{if(!_||!t)return;const m=x=>{x.key==="Escape"&&(x.preventDefault(),s())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[_,t,s]),e.useEffect(()=>{if(t){const m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=m}}},[t]);const c=e.useCallback(m=>{const x=m.target.closest(".nice-bottom-sheet__handle"),Y=i.current,H=!Y||Y.scrollTop<=0;!x&&!H||(D(!0),S.current=m.touches[0].clientY)},[]),o=e.useCallback(m=>{if(!h)return;const x=m.touches[0].clientY-S.current;(x>0||n<l.length-1)&&$(x)},[h,n,l.length]),k=e.useCallback(()=>{if(!h)return;const m=window.innerHeight;l[n]*m;const x=-P,Y=m*.15;x>Y&&u&&n<l.length-1?(b(n+1),p&&M.Gr("selection")):x<-Y&&(n>0?(b(n-1),p&&M.Gr("selection")):(p&&M.Gr("light"),s())),D(!1),$(0)},[h,P,n,l,u,p,s]),E=e.useCallback(()=>{j&&s()},[j,s]);if(!t)return null;const R=l[n]*100,T=h?P:0;return I.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{className:`nice-bottom-sheet__overlay ${t?"nice-bottom-sheet__overlay--visible":""}`,style:{zIndex:C},onClick:E}),r.jsxs("div",{ref:f,className:`nice-bottom-sheet ${t?"nice-bottom-sheet--open":""} ${w||""}`,style:{zIndex:C+1,height:`${R}vh`,transform:`translateY(${Math.max(0,T)}px)`,transition:h?"none":"transform 0.3s ease-out, height 0.3s ease-out",...y},role:"dialog","aria-modal":"true","aria-label":a,tabIndex:-1,onTouchStart:c,onTouchMove:o,onTouchEnd:k,children:[g&&r.jsx("div",{className:"nice-bottom-sheet__handle","aria-hidden":"true"}),a&&r.jsx("div",{className:"nice-bottom-sheet__title",children:a}),r.jsx("div",{ref:i,className:"nice-bottom-sheet__content",children:v})]})]}),L)},F=({trigger:t,children:s,placement:v="bottom",triggerMode:a="click",open:g,onOpenChange:l,hoverDelay:d=200,offset:u=8,className:j,showArrow:_=!0})=>{const[p,C]=e.useState(!1),w=e.useRef(null),y=e.useRef(null),f=e.useRef(null),i=B(),n=g!==void 0,b=n?g:p,h=e.useCallback(c=>{n||C(c),l?.(c)},[n,l]);M.Ys(y,()=>{a!=="manual"&&b&&h(!1)});const D=e.useCallback(()=>{a==="click"&&h(!b)},[a,b,h]),P=e.useCallback(()=>{a==="hover"&&(f.current&&window.clearTimeout(f.current),f.current=window.setTimeout(()=>h(!0),d))},[a,d,h]),$=e.useCallback(()=>{a==="hover"&&(f.current&&window.clearTimeout(f.current),f.current=window.setTimeout(()=>h(!1),d))},[a,d,h]),[S,L]=e.useState({top:0,left:0});return e.useEffect(()=>{if(!b||!w.current||!y.current)return;const c=w.current.getBoundingClientRect(),o=y.current.getBoundingClientRect(),k=window.innerWidth,E=window.innerHeight;let R=0,T=0;const[m,x="center"]=v.split("-");switch(m){case"top":R=c.top-o.height-u,T=c.left+(c.width-o.width)/2;break;case"bottom":R=c.bottom+u,T=c.left+(c.width-o.width)/2;break;case"left":R=c.top+(c.height-o.height)/2,T=c.left-o.width-u;break;case"right":R=c.top+(c.height-o.height)/2,T=c.right+u;break}m==="top"||m==="bottom"?(x==="start"&&(T=c.left),x==="end"&&(T=c.right-o.width)):(x==="start"&&(R=c.top),x==="end"&&(R=c.bottom-o.height)),T=Math.max(8,Math.min(k-o.width-8,T)),R=Math.max(8,Math.min(E-o.height-8,R)),L({top:R,left:T})},[b,v,u]),r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:w,className:"nice-popover__trigger",onClick:D,onMouseEnter:P,onMouseLeave:$,style:{display:"inline-block"},children:t}),b&&I.createPortal(r.jsxs("div",{ref:y,className:`nice-popover nice-popover--${v} ${j||""}`,style:{position:"fixed",top:S.top,left:S.left,zIndex:1100},onMouseEnter:P,onMouseLeave:$,role:"tooltip",children:[_&&r.jsx("div",{className:"nice-popover__arrow"}),r.jsx("div",{className:"nice-popover__content",children:s})]}),i)]})},Q=({items:t,children:s,onOpen:v,onClose:a,className:g})=>{const[l,d]=e.useState(!1),[u,j]=e.useState({x:0,y:0}),_=e.useRef(null),p=e.useRef(null),C=B();M.Ys(_,()=>{l&&(d(!1),a?.())});const w=e.useCallback(i=>{i.preventDefault(),j({x:i.clientX,y:i.clientY}),d(!0),v?.()},[v]),y=e.useCallback(i=>{!i.disabled&&i.onClick&&(i.onClick(),d(!1),a?.())},[a]);e.useEffect(()=>{if(!l)return;const i=n=>{n.key==="Escape"&&(d(!1),a?.())};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[l,a]);const f=i=>r.jsx("ul",{className:"nice-context-menu__list",role:"menu",children:i.map(n=>n.divider?r.jsx("li",{className:"nice-context-menu__divider",role:"separator"},n.key):r.jsx("li",{role:"presentation",children:r.jsxs("button",{type:"button",className:`nice-context-menu__item ${n.disabled?"nice-context-menu__item--disabled":""} ${n.danger?"nice-context-menu__item--danger":""}`,role:"menuitem",disabled:n.disabled,onClick:()=>y(n),children:[n.icon&&r.jsx("span",{className:"nice-context-menu__icon",children:n.icon}),r.jsx("span",{className:"nice-context-menu__label",children:n.label})]})},n.key))});return r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:p,onContextMenu:w,style:{display:"contents"},children:s}),l&&I.createPortal(r.jsx("div",{ref:_,className:`nice-context-menu ${g||""}`,style:{position:"fixed",left:u.x,top:u.y,zIndex:1200},role:"menu",children:f(t)}),C)]})};exports.NiceActionSheet=N.NiceActionSheet;exports.NiceBlockUI=N.NiceBlockUI;exports.NiceBox=N.NiceBox;exports.NiceCommandPaletteProvider=N.NiceCommandPaletteProvider;exports.NiceLoadPanel=N.NiceLoadPanel;exports.NicePopover=N.NicePopover;exports.NiceResizable=N.NiceResizable;exports.NiceResponsiveBox=N.NiceResponsiveBox;exports.NiceScrollView=N.NiceScrollView;exports.NiceTutorial=N.NiceTutorial;exports.NiceTutorialProvider=N.NiceTutorialProvider;exports.NiceWindow=N.NiceWindow;exports.NiceWindowManager=N.NiceWindowManager;exports.useCommandPalette=N.useCommandPalette;exports.useRegisterCommands=N.useRegisterCommands;exports.NiceBottomSheet=K;exports.NiceContextMenu=Q;exports.NiceDrawer=G;exports.NiceModal=W;exports.NiceModalBody=X;exports.NiceModalFooter=q;exports.NiceModalHeader=O;exports.NiceOverlayPopover=F;
|
package/dist/overlays.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { N as se, a as de, b as ue, c as he, d as fe, e as me, f as ve, g as ge, h as we, i as be, j as ye, k as pe, l as _e, u as Ne, m as ke } from "./NiceWindow-
|
|
2
|
-
import { jsxs as H, Fragment as
|
|
3
|
-
import {
|
|
4
|
-
import { useRef as E, useState as
|
|
1
|
+
import { N as se, a as de, b as ue, c as he, d as fe, e as me, f as ve, g as ge, h as we, i as be, j as ye, k as pe, l as _e, u as Ne, m as ke } from "./NiceWindow-DUOkdKuX.js";
|
|
2
|
+
import { jsxs as H, Fragment as O, jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import { Q as j, a as K, Y as Q, b as A, g as G } from "./core-BHZDvnBo.js";
|
|
4
|
+
import { useRef as E, useState as Y, useEffect as I, useCallback as b, useContext as U } from "react";
|
|
5
5
|
import { createPortal as X } from "react-dom";
|
|
6
|
-
function
|
|
7
|
-
const e = U(
|
|
6
|
+
function W() {
|
|
7
|
+
const e = U(G);
|
|
8
8
|
return e?.portalTarget ? e.portalTarget : typeof document < "u" ? document.body : null;
|
|
9
9
|
}
|
|
10
10
|
const F = ({
|
|
@@ -22,16 +22,16 @@ const F = ({
|
|
|
22
22
|
style: M
|
|
23
23
|
}) => {
|
|
24
24
|
const y = E(null);
|
|
25
|
-
|
|
26
|
-
const p =
|
|
27
|
-
|
|
25
|
+
j(y, e && !d);
|
|
26
|
+
const p = W();
|
|
27
|
+
I(() => {
|
|
28
28
|
if (!x && e) {
|
|
29
29
|
const t = document.body.style.overflow;
|
|
30
30
|
return document.body.style.overflow = "hidden", () => {
|
|
31
31
|
document.body.style.overflow = t;
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
}, [e, x]),
|
|
34
|
+
}, [e, x]), I(() => {
|
|
35
35
|
if (!s || !e)
|
|
36
36
|
return;
|
|
37
37
|
const t = (g) => {
|
|
@@ -112,10 +112,10 @@ const F = ({
|
|
|
112
112
|
className: k,
|
|
113
113
|
style: M
|
|
114
114
|
}) => {
|
|
115
|
-
const y = E(null), [p, u] =
|
|
116
|
-
|
|
117
|
-
const g =
|
|
118
|
-
|
|
115
|
+
const y = E(null), [p, u] = Y(!1), [c, t] = Y(0);
|
|
116
|
+
j(y, e);
|
|
117
|
+
const g = W();
|
|
118
|
+
I(() => {
|
|
119
119
|
if (!d || !e)
|
|
120
120
|
return;
|
|
121
121
|
const n = (_) => {
|
|
@@ -160,15 +160,15 @@ const F = ({
|
|
|
160
160
|
R = n.deltaY > 100;
|
|
161
161
|
break;
|
|
162
162
|
}
|
|
163
|
-
R && (
|
|
163
|
+
R && (K("light"), o()), t(0), u(!1);
|
|
164
164
|
},
|
|
165
165
|
[r, o]
|
|
166
|
-
), { ref:
|
|
166
|
+
), { ref: D } = A({
|
|
167
167
|
enabled: x && e,
|
|
168
168
|
onPanStart: () => u(!0),
|
|
169
169
|
onPan: h,
|
|
170
170
|
onPanEnd: S
|
|
171
|
-
}),
|
|
171
|
+
}), L = b(
|
|
172
172
|
(n) => {
|
|
173
173
|
s && n.target === n.currentTarget && o();
|
|
174
174
|
},
|
|
@@ -176,25 +176,25 @@ const F = ({
|
|
|
176
176
|
);
|
|
177
177
|
if (!e)
|
|
178
178
|
return null;
|
|
179
|
-
const
|
|
179
|
+
const P = r === "left" || r === "right", B = P ? { width: typeof v == "number" ? `${v}px` : v } : { height: typeof v == "number" ? `${v}px` : v }, i = () => {
|
|
180
180
|
if (p)
|
|
181
|
-
return
|
|
181
|
+
return P ? `translateX(${c}px)` : `translateY(${c}px)`;
|
|
182
182
|
};
|
|
183
183
|
return X(
|
|
184
|
-
/* @__PURE__ */ H(
|
|
184
|
+
/* @__PURE__ */ H(O, { children: [
|
|
185
185
|
/* @__PURE__ */ a(
|
|
186
186
|
"div",
|
|
187
187
|
{
|
|
188
188
|
className: `nice-drawer__overlay ${e ? "nice-drawer__overlay--visible" : ""}`,
|
|
189
189
|
style: { zIndex: N },
|
|
190
|
-
onClick:
|
|
190
|
+
onClick: L
|
|
191
191
|
}
|
|
192
192
|
),
|
|
193
193
|
/* @__PURE__ */ a(
|
|
194
194
|
"div",
|
|
195
195
|
{
|
|
196
196
|
ref: (n) => {
|
|
197
|
-
y.current = n,
|
|
197
|
+
y.current = n, D.current = n;
|
|
198
198
|
},
|
|
199
199
|
className: `nice-drawer nice-drawer--${r} ${e ? "nice-drawer--open" : ""} ${k || ""}`,
|
|
200
200
|
style: {
|
|
@@ -230,19 +230,19 @@ const F = ({
|
|
|
230
230
|
className: y,
|
|
231
231
|
style: p
|
|
232
232
|
}) => {
|
|
233
|
-
const u = E(null), c = E(null), [t, g] =
|
|
234
|
-
|
|
235
|
-
e && (g(s),
|
|
236
|
-
}, [e, s]),
|
|
237
|
-
const B =
|
|
238
|
-
|
|
233
|
+
const u = E(null), c = E(null), [t, g] = Y(s), [h, S] = Y(!1), [D, L] = Y(0), P = E(0);
|
|
234
|
+
I(() => {
|
|
235
|
+
e && (g(s), L(0));
|
|
236
|
+
}, [e, s]), j(u, e);
|
|
237
|
+
const B = W();
|
|
238
|
+
I(() => {
|
|
239
239
|
if (!N || !e)
|
|
240
240
|
return;
|
|
241
241
|
const f = (w) => {
|
|
242
242
|
w.key === "Escape" && (w.preventDefault(), o());
|
|
243
243
|
};
|
|
244
244
|
return document.addEventListener("keydown", f), () => document.removeEventListener("keydown", f);
|
|
245
|
-
}, [N, e, o]),
|
|
245
|
+
}, [N, e, o]), I(() => {
|
|
246
246
|
if (e) {
|
|
247
247
|
const f = document.body.style.overflow;
|
|
248
248
|
return document.body.style.overflow = "hidden", () => {
|
|
@@ -251,14 +251,14 @@ const F = ({
|
|
|
251
251
|
}
|
|
252
252
|
}, [e]);
|
|
253
253
|
const i = b((f) => {
|
|
254
|
-
const w = f.target.closest(".nice-bottom-sheet__handle"), C = c.current,
|
|
255
|
-
!w && !
|
|
254
|
+
const w = f.target.closest(".nice-bottom-sheet__handle"), C = c.current, z = !C || C.scrollTop <= 0;
|
|
255
|
+
!w && !z || (S(!0), P.current = f.touches[0].clientY);
|
|
256
256
|
}, []), n = b(
|
|
257
257
|
(f) => {
|
|
258
258
|
if (!h)
|
|
259
259
|
return;
|
|
260
|
-
const w = f.touches[0].clientY -
|
|
261
|
-
(w > 0 || t < l.length - 1) &&
|
|
260
|
+
const w = f.touches[0].clientY - P.current;
|
|
261
|
+
(w > 0 || t < l.length - 1) && L(w);
|
|
262
262
|
},
|
|
263
263
|
[h, t, l.length]
|
|
264
264
|
), _ = b(() => {
|
|
@@ -266,16 +266,16 @@ const F = ({
|
|
|
266
266
|
return;
|
|
267
267
|
const f = window.innerHeight;
|
|
268
268
|
l[t] * f;
|
|
269
|
-
const w = -
|
|
270
|
-
w > C && d && t < l.length - 1 ? (g(t + 1), k &&
|
|
271
|
-
}, [h,
|
|
269
|
+
const w = -D, C = f * 0.15;
|
|
270
|
+
w > C && d && t < l.length - 1 ? (g(t + 1), k && K("selection")) : w < -C && (t > 0 ? (g(t - 1), k && K("selection")) : (k && K("light"), o())), S(!1), L(0);
|
|
271
|
+
}, [h, D, t, l, d, k, o]), R = b(() => {
|
|
272
272
|
x && o();
|
|
273
273
|
}, [x, o]);
|
|
274
274
|
if (!e)
|
|
275
275
|
return null;
|
|
276
|
-
const T = l[t] * 100, $ = h ?
|
|
276
|
+
const T = l[t] * 100, $ = h ? D : 0;
|
|
277
277
|
return X(
|
|
278
|
-
/* @__PURE__ */ H(
|
|
278
|
+
/* @__PURE__ */ H(O, { children: [
|
|
279
279
|
/* @__PURE__ */ a(
|
|
280
280
|
"div",
|
|
281
281
|
{
|
|
@@ -325,23 +325,23 @@ const F = ({
|
|
|
325
325
|
className: x,
|
|
326
326
|
showArrow: N = !0
|
|
327
327
|
}) => {
|
|
328
|
-
const [k, M] =
|
|
328
|
+
const [k, M] = Y(!1), y = E(null), p = E(null), u = E(null), c = W(), t = v !== void 0, g = t ? v : k, h = b(
|
|
329
329
|
(i) => {
|
|
330
330
|
t || M(i), l?.(i);
|
|
331
331
|
},
|
|
332
332
|
[t, l]
|
|
333
333
|
);
|
|
334
|
-
|
|
334
|
+
Q(p, () => {
|
|
335
335
|
r !== "manual" && g && h(!1);
|
|
336
336
|
});
|
|
337
337
|
const S = b(() => {
|
|
338
338
|
r === "click" && h(!g);
|
|
339
|
-
}, [r, g, h]),
|
|
339
|
+
}, [r, g, h]), D = b(() => {
|
|
340
340
|
r === "hover" && (u.current && window.clearTimeout(u.current), u.current = window.setTimeout(() => h(!0), s));
|
|
341
|
-
}, [r, s, h]),
|
|
341
|
+
}, [r, s, h]), L = b(() => {
|
|
342
342
|
r === "hover" && (u.current && window.clearTimeout(u.current), u.current = window.setTimeout(() => h(!1), s));
|
|
343
|
-
}, [r, s, h]), [
|
|
344
|
-
return
|
|
343
|
+
}, [r, s, h]), [P, B] = Y({ top: 0, left: 0 });
|
|
344
|
+
return I(() => {
|
|
345
345
|
if (!g || !y.current || !p.current)
|
|
346
346
|
return;
|
|
347
347
|
const i = y.current.getBoundingClientRect(), n = p.current.getBoundingClientRect(), _ = window.innerWidth, R = window.innerHeight;
|
|
@@ -362,15 +362,15 @@ const F = ({
|
|
|
362
362
|
break;
|
|
363
363
|
}
|
|
364
364
|
f === "top" || f === "bottom" ? (w === "start" && ($ = i.left), w === "end" && ($ = i.right - n.width)) : (w === "start" && (T = i.top), w === "end" && (T = i.bottom - n.height)), $ = Math.max(8, Math.min(_ - n.width - 8, $)), T = Math.max(8, Math.min(R - n.height - 8, T)), B({ top: T, left: $ });
|
|
365
|
-
}, [g, m, d]), /* @__PURE__ */ H(
|
|
365
|
+
}, [g, m, d]), /* @__PURE__ */ H(O, { children: [
|
|
366
366
|
/* @__PURE__ */ a(
|
|
367
367
|
"div",
|
|
368
368
|
{
|
|
369
369
|
ref: y,
|
|
370
370
|
className: "nice-popover__trigger",
|
|
371
371
|
onClick: S,
|
|
372
|
-
onMouseEnter:
|
|
373
|
-
onMouseLeave:
|
|
372
|
+
onMouseEnter: D,
|
|
373
|
+
onMouseLeave: L,
|
|
374
374
|
style: { display: "inline-block" },
|
|
375
375
|
children: e
|
|
376
376
|
}
|
|
@@ -383,12 +383,12 @@ const F = ({
|
|
|
383
383
|
className: `nice-popover nice-popover--${m} ${x || ""}`,
|
|
384
384
|
style: {
|
|
385
385
|
position: "fixed",
|
|
386
|
-
top:
|
|
387
|
-
left:
|
|
386
|
+
top: P.top,
|
|
387
|
+
left: P.left,
|
|
388
388
|
zIndex: 1100
|
|
389
389
|
},
|
|
390
|
-
onMouseEnter:
|
|
391
|
-
onMouseLeave:
|
|
390
|
+
onMouseEnter: D,
|
|
391
|
+
onMouseLeave: L,
|
|
392
392
|
role: "tooltip",
|
|
393
393
|
children: [
|
|
394
394
|
N && /* @__PURE__ */ a("div", { className: "nice-popover__arrow" }),
|
|
@@ -406,8 +406,8 @@ const F = ({
|
|
|
406
406
|
onClose: r,
|
|
407
407
|
className: v
|
|
408
408
|
}) => {
|
|
409
|
-
const [l, s] =
|
|
410
|
-
|
|
409
|
+
const [l, s] = Y(!1), [d, x] = Y({ x: 0, y: 0 }), N = E(null), k = E(null), M = W();
|
|
410
|
+
Q(N, () => {
|
|
411
411
|
l && (s(!1), r?.());
|
|
412
412
|
});
|
|
413
413
|
const y = b(
|
|
@@ -421,7 +421,7 @@ const F = ({
|
|
|
421
421
|
},
|
|
422
422
|
[r]
|
|
423
423
|
);
|
|
424
|
-
|
|
424
|
+
I(() => {
|
|
425
425
|
if (!l)
|
|
426
426
|
return;
|
|
427
427
|
const c = (t) => {
|
|
@@ -443,7 +443,7 @@ const F = ({
|
|
|
443
443
|
]
|
|
444
444
|
}
|
|
445
445
|
) }, t.key)) });
|
|
446
|
-
return /* @__PURE__ */ H(
|
|
446
|
+
return /* @__PURE__ */ H(O, { children: [
|
|
447
447
|
/* @__PURE__ */ a("div", { ref: k, onContextMenu: y, style: { display: "contents" }, children: o }),
|
|
448
448
|
l && X(
|
|
449
449
|
/* @__PURE__ */ a(
|