@nice2dev/ui 1.0.8 → 1.0.11
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/dist/NiceErrorBoundary-B5nF-OVn.cjs +1 -0
- package/dist/NiceErrorBoundary-BZEHCXNM.cjs +1 -0
- package/dist/NiceErrorBoundary-D6jw6wwD.js +762 -0
- package/dist/NiceErrorBoundary-D75yr_WE.js +762 -0
- package/dist/NiceForm-BgR-m8T9.cjs +382 -0
- package/dist/NiceForm-CKoJA6NG.js +5131 -0
- package/dist/NiceForm-D7xnpnRJ.cjs +382 -0
- package/dist/NiceForm-DYKciCeR.js +5131 -0
- package/dist/NiceForm.css +1 -0
- package/dist/NiceModal-1QX7NhyH.js +95 -0
- package/dist/NiceModal-Br3J9jOV.cjs +1 -0
- package/dist/NiceModal-CAwsKVQ2.cjs +1 -0
- package/dist/NiceModal-DVAsBzHP.js +95 -0
- package/dist/NiceModuleLifecyclePanel-C9xMSjOF.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-CMrPbSw9.js +5249 -0
- package/dist/NiceModuleLifecyclePanel-D3azLDdj.js +5249 -0
- package/dist/NiceModuleLifecyclePanel-DEfAIhFf.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel.css +1 -0
- package/dist/NicePagination-CbB5P1N_.js +171 -0
- package/dist/NicePagination-DbE-uOkl.js +171 -0
- package/dist/NicePagination-DlealakT.cjs +1 -0
- package/dist/NicePagination-UGjzvRUS.cjs +1 -0
- package/dist/NicePinCodeInput-B8cI8zu8.js +11830 -0
- package/dist/NicePinCodeInput-BmRO9HSQ.js +11830 -0
- package/dist/NicePinCodeInput-D91uvVsF.cjs +419 -0
- package/dist/NicePinCodeInput-SGQaHvpE.cjs +419 -0
- package/dist/NicePinCodeInput.css +1 -1
- package/dist/NiceSavedQueryPanel-7nZe46t8.cjs +596 -0
- package/dist/NiceSavedQueryPanel-BSGzs7Oc.js +6449 -0
- package/dist/NiceSavedQueryPanel-CZ5bYOe_.js +6449 -0
- package/dist/NiceSavedQueryPanel-Ce2s060j.cjs +596 -0
- package/dist/NiceTabs-BeaxZzAO.js +1636 -0
- package/dist/NiceTabs-DcbYFIWR.cjs +1 -0
- package/dist/NiceTabs-DvOmxKyQ.cjs +1 -0
- package/dist/NiceTabs-DzLHzwuA.js +1636 -0
- package/dist/NiceWindow-Bga9fOkg.js +1409 -0
- package/dist/NiceWindow-CVgkxcCz.cjs +1 -0
- package/dist/NiceWindow-CxWTj5xH.cjs +1 -0
- package/dist/NiceWindow-DeC83yfE.js +1409 -0
- package/dist/charts-BAS21jkC.js +4621 -0
- package/dist/charts-BcvKWYUl.cjs +759 -0
- package/dist/charts-DShUbWrP.cjs +759 -0
- package/dist/charts-DZvmvfhM.js +4621 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.d.ts +42 -45
- package/dist/charts.mjs +1 -1
- package/dist/core-B4b1BmHt.js +22177 -0
- package/dist/core-C2ZmWe_u.cjs +96 -0
- package/dist/core-CjmLbclt.cjs +96 -0
- package/dist/core-Da43q-pO.js +22094 -0
- package/dist/data-branching-CJlrg8qf.cjs +1 -0
- package/dist/data-branching-DCUwI53s.js +6121 -0
- package/dist/data-branching.cjs +1 -1
- package/dist/data-branching.d.ts +1 -38
- package/dist/data-branching.mjs +1 -1
- package/dist/data.cjs +1 -1
- package/dist/data.d.ts +206 -192
- package/dist/data.mjs +1 -1
- package/dist/devops-CXynFG3X.cjs +17 -0
- package/dist/devops-D0TfzV5B.js +7660 -0
- package/dist/devops.cjs +1 -1
- package/dist/devops.d.ts +1 -38
- package/dist/devops.mjs +1 -1
- package/dist/editors.cjs +1 -1
- package/dist/editors.d.ts +311 -393
- package/dist/editors.mjs +61 -64
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.d.ts +3 -44
- package/dist/feedback.mjs +11 -10
- package/dist/index-B8wxZ8Ps.cjs +5192 -0
- package/dist/index-DlHlXz8e.js +57319 -0
- package/dist/index-Dx726U90.cjs +5192 -0
- package/dist/index-pAuGTbuB.js +57319 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2249 -11141
- package/dist/index.mjs +880 -1018
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.d.ts +7 -39
- package/dist/lazy.mjs +24 -24
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +151 -216
- package/dist/navigation.mjs +52 -46
- package/dist/no-code-B5bzduNP.cjs +332 -0
- package/dist/no-code-D8RJ7lx0.js +7064 -0
- package/dist/no-code.cjs +1 -1
- package/dist/no-code.d.ts +1 -38
- package/dist/no-code.mjs +1 -1
- package/dist/overlays.cjs +1 -1
- package/dist/overlays.d.ts +13 -45
- package/dist/overlays.mjs +243 -233
- package/package.json +5 -3
package/dist/overlays.mjs
CHANGED
|
@@ -1,66 +1,72 @@
|
|
|
1
|
-
import { N as
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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-Bga9fOkg.js";
|
|
2
|
+
import { jsxs as H, Fragment as O, jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import { f as j, L as K, a as Q, T as A, Q as U } from "./core-B4b1BmHt.js";
|
|
4
|
+
import { useRef as E, useState as L, useEffect as Y, useCallback as b, useContext as V } from "react";
|
|
5
|
+
import { createPortal as X } from "react-dom";
|
|
6
|
+
function W() {
|
|
7
|
+
const e = V(U);
|
|
8
|
+
return e?.portalTarget ? e.portalTarget : typeof document < "u" ? document.body : null;
|
|
9
|
+
}
|
|
6
10
|
const F = ({
|
|
7
11
|
open: e,
|
|
8
12
|
onClose: o,
|
|
9
13
|
children: m,
|
|
10
14
|
title: r,
|
|
11
|
-
size:
|
|
12
|
-
closeOnBackdropClick:
|
|
13
|
-
closeOnEscape:
|
|
14
|
-
disableFocusTrap:
|
|
15
|
-
disableBodyScroll:
|
|
15
|
+
size: v = "md",
|
|
16
|
+
closeOnBackdropClick: l = !0,
|
|
17
|
+
closeOnEscape: s = !0,
|
|
18
|
+
disableFocusTrap: d = !1,
|
|
19
|
+
disableBodyScroll: x = !0,
|
|
16
20
|
zIndex: N = 1e3,
|
|
17
|
-
className:
|
|
21
|
+
className: k,
|
|
18
22
|
style: M
|
|
19
23
|
}) => {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
const y = E(null);
|
|
25
|
+
j(y, e && !d);
|
|
26
|
+
const p = W();
|
|
27
|
+
Y(() => {
|
|
28
|
+
if (!x && e) {
|
|
29
|
+
const t = document.body.style.overflow;
|
|
24
30
|
return document.body.style.overflow = "hidden", () => {
|
|
25
|
-
document.body.style.overflow =
|
|
31
|
+
document.body.style.overflow = t;
|
|
26
32
|
};
|
|
27
33
|
}
|
|
28
|
-
}, [e,
|
|
29
|
-
if (!
|
|
34
|
+
}, [e, x]), Y(() => {
|
|
35
|
+
if (!s || !e)
|
|
30
36
|
return;
|
|
31
|
-
const
|
|
32
|
-
|
|
37
|
+
const t = (g) => {
|
|
38
|
+
g.key === "Escape" && (g.preventDefault(), o());
|
|
33
39
|
};
|
|
34
|
-
return document.addEventListener("keydown",
|
|
35
|
-
}, [
|
|
36
|
-
const
|
|
37
|
-
(
|
|
38
|
-
|
|
40
|
+
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
41
|
+
}, [s, e, o]);
|
|
42
|
+
const u = b(
|
|
43
|
+
(t) => {
|
|
44
|
+
l && t.target === t.currentTarget && o();
|
|
39
45
|
},
|
|
40
|
-
[
|
|
46
|
+
[l, o]
|
|
41
47
|
);
|
|
42
48
|
if (!e)
|
|
43
49
|
return null;
|
|
44
|
-
const
|
|
50
|
+
const c = {
|
|
45
51
|
sm: "nice-modal--sm",
|
|
46
52
|
md: "nice-modal--md",
|
|
47
53
|
lg: "nice-modal--lg",
|
|
48
54
|
xl: "nice-modal--xl",
|
|
49
55
|
full: "nice-modal--full"
|
|
50
|
-
}[
|
|
51
|
-
return
|
|
56
|
+
}[v];
|
|
57
|
+
return X(
|
|
52
58
|
/* @__PURE__ */ a(
|
|
53
59
|
"div",
|
|
54
60
|
{
|
|
55
61
|
className: "nice-modal__overlay",
|
|
56
62
|
style: { zIndex: N },
|
|
57
|
-
onClick:
|
|
63
|
+
onClick: u,
|
|
58
64
|
role: "presentation",
|
|
59
65
|
children: /* @__PURE__ */ a(
|
|
60
66
|
"div",
|
|
61
67
|
{
|
|
62
|
-
ref:
|
|
63
|
-
className: `nice-modal ${
|
|
68
|
+
ref: y,
|
|
69
|
+
className: `nice-modal ${c} ${k || ""}`,
|
|
64
70
|
role: "dialog",
|
|
65
71
|
"aria-modal": "true",
|
|
66
72
|
"aria-label": r,
|
|
@@ -71,14 +77,14 @@ const F = ({
|
|
|
71
77
|
)
|
|
72
78
|
}
|
|
73
79
|
),
|
|
74
|
-
|
|
80
|
+
p
|
|
75
81
|
);
|
|
76
|
-
},
|
|
82
|
+
}, ee = ({
|
|
77
83
|
children: e,
|
|
78
84
|
showClose: o = !0,
|
|
79
85
|
onClose: m,
|
|
80
86
|
className: r
|
|
81
|
-
}) => /* @__PURE__ */
|
|
87
|
+
}) => /* @__PURE__ */ H("div", { className: `nice-modal__header ${r || ""}`, children: [
|
|
82
88
|
/* @__PURE__ */ a("div", { className: "nice-modal__title", children: e }),
|
|
83
89
|
o && m && /* @__PURE__ */ a("button", { type: "button", className: "nice-modal__close", onClick: m, "aria-label": "Close", children: /* @__PURE__ */ a(
|
|
84
90
|
"svg",
|
|
@@ -92,88 +98,90 @@ const F = ({
|
|
|
92
98
|
children: /* @__PURE__ */ a("path", { d: "M4 4l12 12M4 16L16 4" })
|
|
93
99
|
}
|
|
94
100
|
) })
|
|
95
|
-
] }),
|
|
101
|
+
] }), te = ({ children: e, className: o }) => /* @__PURE__ */ a("div", { className: `nice-modal__body ${o || ""}`, children: e }), ne = ({ children: e, className: o }) => /* @__PURE__ */ a("div", { className: `nice-modal__footer ${o || ""}`, children: e }), re = ({
|
|
96
102
|
open: e,
|
|
97
103
|
onClose: o,
|
|
98
104
|
children: m,
|
|
99
105
|
position: r = "right",
|
|
100
|
-
size:
|
|
101
|
-
title:
|
|
102
|
-
closeOnBackdropClick:
|
|
103
|
-
closeOnEscape:
|
|
104
|
-
swipeToClose:
|
|
106
|
+
size: v = 320,
|
|
107
|
+
title: l,
|
|
108
|
+
closeOnBackdropClick: s = !0,
|
|
109
|
+
closeOnEscape: d = !0,
|
|
110
|
+
swipeToClose: x = !0,
|
|
105
111
|
zIndex: N = 1e3,
|
|
106
|
-
className:
|
|
112
|
+
className: k,
|
|
107
113
|
style: M
|
|
108
114
|
}) => {
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
115
|
+
const y = E(null), [p, u] = L(!1), [c, t] = L(0);
|
|
116
|
+
j(y, e);
|
|
117
|
+
const g = W();
|
|
118
|
+
Y(() => {
|
|
119
|
+
if (!d || !e)
|
|
112
120
|
return;
|
|
113
|
-
const
|
|
121
|
+
const n = (_) => {
|
|
114
122
|
_.key === "Escape" && (_.preventDefault(), o());
|
|
115
123
|
};
|
|
116
|
-
return document.addEventListener("keydown",
|
|
117
|
-
}, [
|
|
118
|
-
const
|
|
119
|
-
(
|
|
124
|
+
return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
|
|
125
|
+
}, [d, e, o]);
|
|
126
|
+
const h = b(
|
|
127
|
+
(n) => {
|
|
120
128
|
let _ = 0;
|
|
121
129
|
switch (r) {
|
|
122
130
|
case "left":
|
|
123
|
-
_ = Math.min(0,
|
|
131
|
+
_ = Math.min(0, n.deltaX);
|
|
124
132
|
break;
|
|
125
133
|
case "right":
|
|
126
|
-
_ = Math.max(0,
|
|
134
|
+
_ = Math.max(0, n.deltaX);
|
|
127
135
|
break;
|
|
128
136
|
case "top":
|
|
129
|
-
_ = Math.min(0,
|
|
137
|
+
_ = Math.min(0, n.deltaY);
|
|
130
138
|
break;
|
|
131
139
|
case "bottom":
|
|
132
|
-
_ = Math.max(0,
|
|
140
|
+
_ = Math.max(0, n.deltaY);
|
|
133
141
|
break;
|
|
134
142
|
}
|
|
135
|
-
|
|
143
|
+
t(_);
|
|
136
144
|
},
|
|
137
145
|
[r]
|
|
138
|
-
),
|
|
139
|
-
(
|
|
140
|
-
let
|
|
146
|
+
), S = b(
|
|
147
|
+
(n) => {
|
|
148
|
+
let R = !1;
|
|
141
149
|
switch (r) {
|
|
142
150
|
case "left":
|
|
143
|
-
|
|
151
|
+
R = n.deltaX < -100;
|
|
144
152
|
break;
|
|
145
153
|
case "right":
|
|
146
|
-
|
|
154
|
+
R = n.deltaX > 100;
|
|
147
155
|
break;
|
|
148
156
|
case "top":
|
|
149
|
-
|
|
157
|
+
R = n.deltaY < -100;
|
|
150
158
|
break;
|
|
151
159
|
case "bottom":
|
|
152
|
-
|
|
160
|
+
R = n.deltaY > 100;
|
|
153
161
|
break;
|
|
154
162
|
}
|
|
155
|
-
|
|
163
|
+
R && (K("light"), o()), t(0), u(!1);
|
|
156
164
|
},
|
|
157
165
|
[r, o]
|
|
158
|
-
), { ref:
|
|
159
|
-
enabled:
|
|
160
|
-
onPanStart: () =>
|
|
161
|
-
onPan:
|
|
162
|
-
onPanEnd:
|
|
163
|
-
}), P =
|
|
164
|
-
(
|
|
165
|
-
|
|
166
|
+
), { ref: D } = A({
|
|
167
|
+
enabled: x && e,
|
|
168
|
+
onPanStart: () => u(!0),
|
|
169
|
+
onPan: h,
|
|
170
|
+
onPanEnd: S
|
|
171
|
+
}), P = b(
|
|
172
|
+
(n) => {
|
|
173
|
+
s && n.target === n.currentTarget && o();
|
|
166
174
|
},
|
|
167
|
-
[
|
|
175
|
+
[s, o]
|
|
168
176
|
);
|
|
169
177
|
if (!e)
|
|
170
178
|
return null;
|
|
171
|
-
const
|
|
172
|
-
if (
|
|
173
|
-
return
|
|
179
|
+
const I = r === "left" || r === "right", B = I ? { width: typeof v == "number" ? `${v}px` : v } : { height: typeof v == "number" ? `${v}px` : v }, i = () => {
|
|
180
|
+
if (p)
|
|
181
|
+
return I ? `translateX(${c}px)` : `translateY(${c}px)`;
|
|
174
182
|
};
|
|
175
|
-
return
|
|
176
|
-
/* @__PURE__ */
|
|
183
|
+
return X(
|
|
184
|
+
/* @__PURE__ */ H(O, { children: [
|
|
177
185
|
/* @__PURE__ */ a(
|
|
178
186
|
"div",
|
|
179
187
|
{
|
|
@@ -185,199 +193,201 @@ const F = ({
|
|
|
185
193
|
/* @__PURE__ */ a(
|
|
186
194
|
"div",
|
|
187
195
|
{
|
|
188
|
-
ref: (
|
|
189
|
-
|
|
196
|
+
ref: (n) => {
|
|
197
|
+
y.current = n, D.current = n;
|
|
190
198
|
},
|
|
191
|
-
className: `nice-drawer nice-drawer--${r} ${e ? "nice-drawer--open" : ""} ${
|
|
199
|
+
className: `nice-drawer nice-drawer--${r} ${e ? "nice-drawer--open" : ""} ${k || ""}`,
|
|
192
200
|
style: {
|
|
193
|
-
...
|
|
201
|
+
...B,
|
|
194
202
|
zIndex: N + 1,
|
|
195
|
-
transform:
|
|
196
|
-
transition:
|
|
203
|
+
transform: i(),
|
|
204
|
+
transition: p ? "none" : void 0,
|
|
197
205
|
...M
|
|
198
206
|
},
|
|
199
207
|
role: "dialog",
|
|
200
208
|
"aria-modal": "true",
|
|
201
|
-
"aria-label":
|
|
209
|
+
"aria-label": l,
|
|
202
210
|
tabIndex: -1,
|
|
203
211
|
children: m
|
|
204
212
|
}
|
|
205
213
|
)
|
|
206
214
|
] }),
|
|
207
|
-
|
|
215
|
+
g
|
|
208
216
|
);
|
|
209
|
-
},
|
|
217
|
+
}, oe = ({
|
|
210
218
|
open: e,
|
|
211
219
|
onClose: o,
|
|
212
220
|
children: m,
|
|
213
221
|
title: r,
|
|
214
|
-
showHandle:
|
|
215
|
-
snapPoints:
|
|
216
|
-
initialSnap:
|
|
217
|
-
expandable:
|
|
218
|
-
closeOnBackdropClick:
|
|
222
|
+
showHandle: v = !0,
|
|
223
|
+
snapPoints: l = [0.5, 0.9],
|
|
224
|
+
initialSnap: s = 0,
|
|
225
|
+
expandable: d = !0,
|
|
226
|
+
closeOnBackdropClick: x = !0,
|
|
219
227
|
closeOnEscape: N = !0,
|
|
220
|
-
hapticFeedback:
|
|
228
|
+
hapticFeedback: k = !0,
|
|
221
229
|
zIndex: M = 1e3,
|
|
222
|
-
className:
|
|
223
|
-
style:
|
|
230
|
+
className: y,
|
|
231
|
+
style: p
|
|
224
232
|
}) => {
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
e && (
|
|
228
|
-
}, [e,
|
|
233
|
+
const u = E(null), c = E(null), [t, g] = L(s), [h, S] = L(!1), [D, P] = L(0), I = E(0);
|
|
234
|
+
Y(() => {
|
|
235
|
+
e && (g(s), P(0));
|
|
236
|
+
}, [e, s]), j(u, e);
|
|
237
|
+
const B = W();
|
|
238
|
+
Y(() => {
|
|
229
239
|
if (!N || !e)
|
|
230
240
|
return;
|
|
231
|
-
const
|
|
232
|
-
|
|
241
|
+
const f = (w) => {
|
|
242
|
+
w.key === "Escape" && (w.preventDefault(), o());
|
|
233
243
|
};
|
|
234
|
-
return document.addEventListener("keydown",
|
|
235
|
-
}, [N, e, o]),
|
|
244
|
+
return document.addEventListener("keydown", f), () => document.removeEventListener("keydown", f);
|
|
245
|
+
}, [N, e, o]), Y(() => {
|
|
236
246
|
if (e) {
|
|
237
|
-
const
|
|
247
|
+
const f = document.body.style.overflow;
|
|
238
248
|
return document.body.style.overflow = "hidden", () => {
|
|
239
|
-
document.body.style.overflow =
|
|
249
|
+
document.body.style.overflow = f;
|
|
240
250
|
};
|
|
241
251
|
}
|
|
242
252
|
}, [e]);
|
|
243
|
-
const
|
|
244
|
-
const
|
|
245
|
-
!
|
|
246
|
-
}, []),
|
|
247
|
-
(
|
|
248
|
-
if (!
|
|
253
|
+
const i = b((f) => {
|
|
254
|
+
const w = f.target.closest(".nice-bottom-sheet__handle"), C = c.current, z = !C || C.scrollTop <= 0;
|
|
255
|
+
!w && !z || (S(!0), I.current = f.touches[0].clientY);
|
|
256
|
+
}, []), n = b(
|
|
257
|
+
(f) => {
|
|
258
|
+
if (!h)
|
|
249
259
|
return;
|
|
250
|
-
const
|
|
251
|
-
(
|
|
260
|
+
const w = f.touches[0].clientY - I.current;
|
|
261
|
+
(w > 0 || t < l.length - 1) && P(w);
|
|
252
262
|
},
|
|
253
|
-
[
|
|
254
|
-
), _ =
|
|
255
|
-
if (!
|
|
263
|
+
[h, t, l.length]
|
|
264
|
+
), _ = b(() => {
|
|
265
|
+
if (!h)
|
|
256
266
|
return;
|
|
257
|
-
const
|
|
258
|
-
|
|
259
|
-
const
|
|
260
|
-
|
|
261
|
-
}, [
|
|
262
|
-
|
|
263
|
-
}, [
|
|
267
|
+
const f = window.innerHeight;
|
|
268
|
+
l[t] * f;
|
|
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), P(0);
|
|
271
|
+
}, [h, D, t, l, d, k, o]), R = b(() => {
|
|
272
|
+
x && o();
|
|
273
|
+
}, [x, o]);
|
|
264
274
|
if (!e)
|
|
265
275
|
return null;
|
|
266
|
-
const
|
|
267
|
-
return
|
|
268
|
-
/* @__PURE__ */
|
|
276
|
+
const T = l[t] * 100, $ = h ? D : 0;
|
|
277
|
+
return X(
|
|
278
|
+
/* @__PURE__ */ H(O, { children: [
|
|
269
279
|
/* @__PURE__ */ a(
|
|
270
280
|
"div",
|
|
271
281
|
{
|
|
272
282
|
className: `nice-bottom-sheet__overlay ${e ? "nice-bottom-sheet__overlay--visible" : ""}`,
|
|
273
283
|
style: { zIndex: M },
|
|
274
|
-
onClick:
|
|
284
|
+
onClick: R
|
|
275
285
|
}
|
|
276
286
|
),
|
|
277
|
-
/* @__PURE__ */
|
|
287
|
+
/* @__PURE__ */ H(
|
|
278
288
|
"div",
|
|
279
289
|
{
|
|
280
|
-
ref:
|
|
281
|
-
className: `nice-bottom-sheet ${e ? "nice-bottom-sheet--open" : ""} ${
|
|
290
|
+
ref: u,
|
|
291
|
+
className: `nice-bottom-sheet ${e ? "nice-bottom-sheet--open" : ""} ${y || ""}`,
|
|
282
292
|
style: {
|
|
283
293
|
zIndex: M + 1,
|
|
284
|
-
height: `${
|
|
294
|
+
height: `${T}vh`,
|
|
285
295
|
transform: `translateY(${Math.max(0, $)}px)`,
|
|
286
|
-
transition:
|
|
287
|
-
...
|
|
296
|
+
transition: h ? "none" : "transform 0.3s ease-out, height 0.3s ease-out",
|
|
297
|
+
...p
|
|
288
298
|
},
|
|
289
299
|
role: "dialog",
|
|
290
300
|
"aria-modal": "true",
|
|
291
301
|
"aria-label": r,
|
|
292
302
|
tabIndex: -1,
|
|
293
|
-
onTouchStart:
|
|
294
|
-
onTouchMove:
|
|
303
|
+
onTouchStart: i,
|
|
304
|
+
onTouchMove: n,
|
|
295
305
|
onTouchEnd: _,
|
|
296
306
|
children: [
|
|
297
|
-
|
|
307
|
+
v && /* @__PURE__ */ a("div", { className: "nice-bottom-sheet__handle", "aria-hidden": "true" }),
|
|
298
308
|
r && /* @__PURE__ */ a("div", { className: "nice-bottom-sheet__title", children: r }),
|
|
299
|
-
/* @__PURE__ */ a("div", { ref:
|
|
309
|
+
/* @__PURE__ */ a("div", { ref: c, className: "nice-bottom-sheet__content", children: m })
|
|
300
310
|
]
|
|
301
311
|
}
|
|
302
312
|
)
|
|
303
313
|
] }),
|
|
304
|
-
|
|
314
|
+
B
|
|
305
315
|
);
|
|
306
|
-
},
|
|
316
|
+
}, ae = ({
|
|
307
317
|
trigger: e,
|
|
308
318
|
children: o,
|
|
309
319
|
placement: m = "bottom",
|
|
310
320
|
triggerMode: r = "click",
|
|
311
|
-
open:
|
|
312
|
-
onOpenChange:
|
|
313
|
-
hoverDelay:
|
|
314
|
-
offset:
|
|
315
|
-
className:
|
|
321
|
+
open: v,
|
|
322
|
+
onOpenChange: l,
|
|
323
|
+
hoverDelay: s = 200,
|
|
324
|
+
offset: d = 8,
|
|
325
|
+
className: x,
|
|
316
326
|
showArrow: N = !0
|
|
317
327
|
}) => {
|
|
318
|
-
const [
|
|
319
|
-
(
|
|
320
|
-
|
|
328
|
+
const [k, M] = L(!1), y = E(null), p = E(null), u = E(null), c = W(), t = v !== void 0, g = t ? v : k, h = b(
|
|
329
|
+
(i) => {
|
|
330
|
+
t || M(i), l?.(i);
|
|
321
331
|
},
|
|
322
|
-
[
|
|
332
|
+
[t, l]
|
|
323
333
|
);
|
|
324
|
-
|
|
325
|
-
r !== "manual" &&
|
|
334
|
+
Q(p, () => {
|
|
335
|
+
r !== "manual" && g && h(!1);
|
|
326
336
|
});
|
|
327
|
-
const
|
|
328
|
-
r === "click" &&
|
|
329
|
-
}, [r,
|
|
330
|
-
r === "hover" && (
|
|
331
|
-
}, [r,
|
|
332
|
-
r === "hover" && (
|
|
333
|
-
}, [r,
|
|
334
|
-
return
|
|
335
|
-
if (!
|
|
337
|
+
const S = b(() => {
|
|
338
|
+
r === "click" && h(!g);
|
|
339
|
+
}, [r, g, h]), D = b(() => {
|
|
340
|
+
r === "hover" && (u.current && window.clearTimeout(u.current), u.current = window.setTimeout(() => h(!0), s));
|
|
341
|
+
}, [r, s, h]), P = b(() => {
|
|
342
|
+
r === "hover" && (u.current && window.clearTimeout(u.current), u.current = window.setTimeout(() => h(!1), s));
|
|
343
|
+
}, [r, s, h]), [I, B] = L({ top: 0, left: 0 });
|
|
344
|
+
return Y(() => {
|
|
345
|
+
if (!g || !y.current || !p.current)
|
|
336
346
|
return;
|
|
337
|
-
const
|
|
338
|
-
let
|
|
339
|
-
const [
|
|
340
|
-
switch (
|
|
347
|
+
const i = y.current.getBoundingClientRect(), n = p.current.getBoundingClientRect(), _ = window.innerWidth, R = window.innerHeight;
|
|
348
|
+
let T = 0, $ = 0;
|
|
349
|
+
const [f, w = "center"] = m.split("-");
|
|
350
|
+
switch (f) {
|
|
341
351
|
case "top":
|
|
342
|
-
|
|
352
|
+
T = i.top - n.height - d, $ = i.left + (i.width - n.width) / 2;
|
|
343
353
|
break;
|
|
344
354
|
case "bottom":
|
|
345
|
-
|
|
355
|
+
T = i.bottom + d, $ = i.left + (i.width - n.width) / 2;
|
|
346
356
|
break;
|
|
347
357
|
case "left":
|
|
348
|
-
|
|
358
|
+
T = i.top + (i.height - n.height) / 2, $ = i.left - n.width - d;
|
|
349
359
|
break;
|
|
350
360
|
case "right":
|
|
351
|
-
|
|
361
|
+
T = i.top + (i.height - n.height) / 2, $ = i.right + d;
|
|
352
362
|
break;
|
|
353
363
|
}
|
|
354
|
-
|
|
355
|
-
}, [
|
|
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(O, { children: [
|
|
356
366
|
/* @__PURE__ */ a(
|
|
357
367
|
"div",
|
|
358
368
|
{
|
|
359
|
-
ref:
|
|
369
|
+
ref: y,
|
|
360
370
|
className: "nice-popover__trigger",
|
|
361
|
-
onClick:
|
|
362
|
-
onMouseEnter:
|
|
371
|
+
onClick: S,
|
|
372
|
+
onMouseEnter: D,
|
|
363
373
|
onMouseLeave: P,
|
|
364
374
|
style: { display: "inline-block" },
|
|
365
375
|
children: e
|
|
366
376
|
}
|
|
367
377
|
),
|
|
368
|
-
|
|
369
|
-
/* @__PURE__ */
|
|
378
|
+
g && X(
|
|
379
|
+
/* @__PURE__ */ H(
|
|
370
380
|
"div",
|
|
371
381
|
{
|
|
372
|
-
ref:
|
|
373
|
-
className: `nice-popover nice-popover--${m} ${
|
|
382
|
+
ref: p,
|
|
383
|
+
className: `nice-popover nice-popover--${m} ${x || ""}`,
|
|
374
384
|
style: {
|
|
375
385
|
position: "fixed",
|
|
376
|
-
top:
|
|
377
|
-
left:
|
|
386
|
+
top: I.top,
|
|
387
|
+
left: I.left,
|
|
378
388
|
zIndex: 1100
|
|
379
389
|
},
|
|
380
|
-
onMouseEnter:
|
|
390
|
+
onMouseEnter: D,
|
|
381
391
|
onMouseLeave: P,
|
|
382
392
|
role: "tooltip",
|
|
383
393
|
children: [
|
|
@@ -386,97 +396,97 @@ const F = ({
|
|
|
386
396
|
]
|
|
387
397
|
}
|
|
388
398
|
),
|
|
389
|
-
|
|
399
|
+
c
|
|
390
400
|
)
|
|
391
401
|
] });
|
|
392
|
-
},
|
|
402
|
+
}, ie = ({
|
|
393
403
|
items: e,
|
|
394
404
|
children: o,
|
|
395
405
|
onOpen: m,
|
|
396
406
|
onClose: r,
|
|
397
|
-
className:
|
|
407
|
+
className: v
|
|
398
408
|
}) => {
|
|
399
|
-
const [
|
|
400
|
-
|
|
401
|
-
|
|
409
|
+
const [l, s] = L(!1), [d, x] = L({ x: 0, y: 0 }), N = E(null), k = E(null), M = W();
|
|
410
|
+
Q(N, () => {
|
|
411
|
+
l && (s(!1), r?.());
|
|
402
412
|
});
|
|
403
|
-
const
|
|
404
|
-
(
|
|
405
|
-
|
|
413
|
+
const y = b(
|
|
414
|
+
(c) => {
|
|
415
|
+
c.preventDefault(), x({ x: c.clientX, y: c.clientY }), s(!0), m?.();
|
|
406
416
|
},
|
|
407
417
|
[m]
|
|
408
|
-
),
|
|
409
|
-
(
|
|
410
|
-
!
|
|
418
|
+
), p = b(
|
|
419
|
+
(c) => {
|
|
420
|
+
!c.disabled && c.onClick && (c.onClick(), s(!1), r?.());
|
|
411
421
|
},
|
|
412
422
|
[r]
|
|
413
423
|
);
|
|
414
|
-
|
|
415
|
-
if (!
|
|
424
|
+
Y(() => {
|
|
425
|
+
if (!l)
|
|
416
426
|
return;
|
|
417
|
-
const
|
|
418
|
-
|
|
427
|
+
const c = (t) => {
|
|
428
|
+
t.key === "Escape" && (s(!1), r?.());
|
|
419
429
|
};
|
|
420
|
-
return document.addEventListener("keydown",
|
|
421
|
-
}, [
|
|
422
|
-
const
|
|
430
|
+
return document.addEventListener("keydown", c), () => document.removeEventListener("keydown", c);
|
|
431
|
+
}, [l, r]);
|
|
432
|
+
const u = (c) => /* @__PURE__ */ a("ul", { className: "nice-context-menu__list", role: "menu", children: c.map((t) => t.divider ? /* @__PURE__ */ a("li", { className: "nice-context-menu__divider", role: "separator" }, t.key) : /* @__PURE__ */ a("li", { role: "presentation", children: /* @__PURE__ */ H(
|
|
423
433
|
"button",
|
|
424
434
|
{
|
|
425
435
|
type: "button",
|
|
426
|
-
className: `nice-context-menu__item ${
|
|
436
|
+
className: `nice-context-menu__item ${t.disabled ? "nice-context-menu__item--disabled" : ""} ${t.danger ? "nice-context-menu__item--danger" : ""}`,
|
|
427
437
|
role: "menuitem",
|
|
428
|
-
disabled:
|
|
429
|
-
onClick: () =>
|
|
438
|
+
disabled: t.disabled,
|
|
439
|
+
onClick: () => p(t),
|
|
430
440
|
children: [
|
|
431
|
-
|
|
432
|
-
/* @__PURE__ */ a("span", { className: "nice-context-menu__label", children:
|
|
441
|
+
t.icon && /* @__PURE__ */ a("span", { className: "nice-context-menu__icon", children: t.icon }),
|
|
442
|
+
/* @__PURE__ */ a("span", { className: "nice-context-menu__label", children: t.label })
|
|
433
443
|
]
|
|
434
444
|
}
|
|
435
|
-
) },
|
|
436
|
-
return /* @__PURE__ */
|
|
437
|
-
/* @__PURE__ */ a("div", { ref:
|
|
438
|
-
|
|
445
|
+
) }, t.key)) });
|
|
446
|
+
return /* @__PURE__ */ H(O, { children: [
|
|
447
|
+
/* @__PURE__ */ a("div", { ref: k, onContextMenu: y, style: { display: "contents" }, children: o }),
|
|
448
|
+
l && X(
|
|
439
449
|
/* @__PURE__ */ a(
|
|
440
450
|
"div",
|
|
441
451
|
{
|
|
442
452
|
ref: N,
|
|
443
|
-
className: `nice-context-menu ${
|
|
453
|
+
className: `nice-context-menu ${v || ""}`,
|
|
444
454
|
style: {
|
|
445
455
|
position: "fixed",
|
|
446
|
-
left:
|
|
447
|
-
top:
|
|
456
|
+
left: d.x,
|
|
457
|
+
top: d.y,
|
|
448
458
|
zIndex: 1200
|
|
449
459
|
},
|
|
450
460
|
role: "menu",
|
|
451
|
-
children:
|
|
461
|
+
children: u(e)
|
|
452
462
|
}
|
|
453
463
|
),
|
|
454
|
-
|
|
464
|
+
M
|
|
455
465
|
)
|
|
456
466
|
] });
|
|
457
467
|
};
|
|
458
468
|
export {
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
469
|
+
se as NiceActionSheet,
|
|
470
|
+
de as NiceBlockUI,
|
|
471
|
+
oe as NiceBottomSheet,
|
|
472
|
+
ue as NiceBox,
|
|
473
|
+
he as NiceCommandPaletteProvider,
|
|
474
|
+
ie as NiceContextMenu,
|
|
475
|
+
re as NiceDrawer,
|
|
476
|
+
fe as NiceLoadPanel,
|
|
467
477
|
F as NiceModal,
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
478
|
+
te as NiceModalBody,
|
|
479
|
+
ne as NiceModalFooter,
|
|
480
|
+
ee as NiceModalHeader,
|
|
481
|
+
ae as NiceOverlayPopover,
|
|
482
|
+
me as NicePopover,
|
|
483
|
+
ve as NiceResizable,
|
|
484
|
+
ge as NiceResponsiveBox,
|
|
485
|
+
we as NiceScrollView,
|
|
486
|
+
be as NiceTutorial,
|
|
487
|
+
ye as NiceTutorialProvider,
|
|
488
|
+
pe as NiceWindow,
|
|
489
|
+
_e as NiceWindowManager,
|
|
490
|
+
Ne as useCommandPalette,
|
|
491
|
+
ke as useRegisterCommands
|
|
482
492
|
};
|