@cfx-dev/ui-components 0.0.19 → 0.0.21
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/Combination-Dp_plIQU.js +793 -0
- package/dist/{Icons-B26SczGZ.js → Icons-BlBKvJD8.js} +40 -98
- package/dist/{Rail-BCY3h7eP.js → Rail-CCuyJpf6.js} +11 -11
- package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
- package/dist/assets/InputDropzone.css +1 -0
- package/dist/assets/ItemPreview.css +1 -0
- package/dist/assets/Table.css +1 -0
- package/dist/components/BackdropPortal/BackdropPortal.d.ts +1 -0
- package/dist/components/BackdropPortal/BackdropPortal.js +9 -7
- package/dist/components/Badge/Badge.d.ts +2 -2
- package/dist/components/Button/Button.d.ts +2 -1
- package/dist/components/Button/Button.js +27 -25
- package/dist/components/Button/ButtonBar.d.ts +0 -1
- package/dist/components/Button/LinkButton.js +13 -13
- package/dist/components/Flyout/Flyout.d.ts +1 -0
- package/dist/components/Flyout/Flyout.js +28 -27
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/RichInput.js +2 -2
- package/dist/components/InputDropzone/InputDropzone.d.ts +14 -0
- package/dist/components/InputDropzone/InputDropzone.js +1103 -0
- package/dist/components/InputDropzone/ItemPreview.d.ts +8 -0
- package/dist/components/InputDropzone/ItemPreview.js +24 -0
- package/dist/components/Layout/Scrollable/Rail.js +3 -3
- package/dist/components/Layout/Scrollable/Scrollable.js +2 -2
- package/dist/components/Layout/Scrollable/VirtualScrollable.js +3 -4
- package/dist/components/Modal/Modal.d.ts +0 -2
- package/dist/components/Modal/Modal.js +3 -3
- package/dist/components/NavList/NavList.js +5 -5
- package/dist/components/OnScreenSensor.js +6 -6
- package/dist/components/Overlay/Overlay.d.ts +1 -0
- package/dist/components/Overlay/Overlay.js +16 -15
- package/dist/components/Select/Select.js +652 -663
- package/dist/components/Shroud/Shroud.js +20 -19
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/components/Table/Table.d.ts +17 -0
- package/dist/components/Table/Table.js +61 -0
- package/dist/components/Tabular/Tabular.d.ts +1 -1
- package/dist/components/Text/Text.types.d.ts +0 -1
- package/dist/components/Title/Title.d.ts +1 -0
- package/dist/components/Title/Title.js +26 -25
- package/dist/{extends-Dk_bSU3E.js → extends-hS2Bh-Yp.js} +1 -2
- package/dist/{index-C75OpfGQ.js → index-2hJuj4UN.js} +2018 -2526
- package/dist/index-DQMInta3.js +663 -0
- package/dist/index.esm-BkynlSN6.js +72 -0
- package/dist/main.d.ts +17 -26
- package/dist/main.js +145 -122
- package/dist/{medium-Dc7QRuE0.js → medium-JVtzoF2c.js} +3 -3
- package/dist/style-guide/Colours/DarkThemeSwatches.d.ts +2 -0
- package/dist/style-guide/Colours/DarkThemeSwatches.js +110 -0
- package/dist/style-guide/Colours/LightThemeSwatches.d.ts +2 -0
- package/dist/style-guide/Colours/LightThemeSwatches.js +105 -0
- package/dist/style-guide/Colours/Swatches.d.ts +6 -0
- package/dist/style-guide/Colours/Swatches.js +48 -0
- package/dist/style-guide/Icons/IconDisplayGrid.d.ts +2 -0
- package/dist/style-guide/Icons/IconDisplayGrid.js +42 -0
- package/dist/style-guide/Icons/Icons.js +7 -0
- package/dist/tslib.es6-CBKHJX9H.js +151 -0
- package/dist/utils/functional.js +19 -6
- package/dist/utils/hooks.d.ts +2 -1
- package/dist/utils/hooks.js +77 -10
- package/dist/utils/links.js +1128 -12
- package/dist/utils/math.js +8 -3
- package/dist/utils/mergeRefs.d.ts +1 -1
- package/dist/utils/mergeRefs.js +2 -2
- package/dist/utils/outlet.js +19 -4
- package/dist/utils/string.js +42 -7
- package/package.json +7 -13
- package/dist/Combination-Dj-a6dCZ.js +0 -1462
- package/dist/components/Icons.js +0 -6
- package/dist/functional-C0pE183N.js +0 -30
- package/dist/hooks-GAujvL7d.js +0 -86
- package/dist/links-CgOD-Vfj.js +0 -1142
- package/dist/math-i2ceybzU.js +0 -16
- package/dist/outlet-B11a3Kgw.js +0 -27
- package/dist/string-NVxCUbqk.js +0 -54
- package/dist/tslib.es6-Dd_EkEfR.js +0 -48
- /package/dist/{components → style-guide/Icons}/Icons.d.ts +0 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { jsxs as l, Fragment as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
const r = [
|
|
3
|
+
{
|
|
4
|
+
name: "$bg",
|
|
5
|
+
colorValue: "#ffffff"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
name: "$fg",
|
|
9
|
+
colorValue: "#161923"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: ".color-1",
|
|
13
|
+
colorValue: "#b71c1c"
|
|
14
|
+
},
|
|
15
|
+
// darken(#F44336, 30%)
|
|
16
|
+
{
|
|
17
|
+
name: ".color-2",
|
|
18
|
+
colorValue: "#2e7d32"
|
|
19
|
+
},
|
|
20
|
+
// darken(#4CAF50, 30%)
|
|
21
|
+
{
|
|
22
|
+
name: ".color-3",
|
|
23
|
+
colorValue: "#c6ff00"
|
|
24
|
+
},
|
|
25
|
+
// darken(#FFEB3B, 30%)
|
|
26
|
+
{
|
|
27
|
+
name: ".color-4",
|
|
28
|
+
colorValue: "#2962ff"
|
|
29
|
+
},
|
|
30
|
+
// darken(#42A5F5, 30%)
|
|
31
|
+
{
|
|
32
|
+
name: ".color-5",
|
|
33
|
+
colorValue: "#0277bd"
|
|
34
|
+
},
|
|
35
|
+
// darken(#03A9F4, 30%)
|
|
36
|
+
{
|
|
37
|
+
name: ".color-6",
|
|
38
|
+
colorValue: "#6a1b9a"
|
|
39
|
+
},
|
|
40
|
+
// darken(#9C27B0, 30%)
|
|
41
|
+
{
|
|
42
|
+
name: ".color-8",
|
|
43
|
+
colorValue: "#d84315"
|
|
44
|
+
},
|
|
45
|
+
// darken(#FF5722, 30%)
|
|
46
|
+
{
|
|
47
|
+
name: ".color-9",
|
|
48
|
+
colorValue: "#6d6d6d"
|
|
49
|
+
}
|
|
50
|
+
// darken(#9E9E9E, 30%)
|
|
51
|
+
], i = function() {
|
|
52
|
+
return /* @__PURE__ */ l(a, { children: [
|
|
53
|
+
/* @__PURE__ */ e("h1", { children: " Light Theme " }),
|
|
54
|
+
/* @__PURE__ */ e(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
style: {
|
|
58
|
+
display: "grid",
|
|
59
|
+
gridTemplateColumns: "repeat(auto-fill, minmax(100px, 1fr))",
|
|
60
|
+
gap: "20px",
|
|
61
|
+
padding: "20px"
|
|
62
|
+
},
|
|
63
|
+
children: r.map((o) => /* @__PURE__ */ e(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
style: {
|
|
67
|
+
backgroundColor: o.colorValue,
|
|
68
|
+
color: "#FFF",
|
|
69
|
+
display: "flex",
|
|
70
|
+
flexDirection: "column",
|
|
71
|
+
justifyContent: "center",
|
|
72
|
+
alignItems: "center",
|
|
73
|
+
height: "100px",
|
|
74
|
+
borderRadius: "8px",
|
|
75
|
+
boxShadow: "0 4px 8px rgba(0, 0, 0, 0.1)",
|
|
76
|
+
padding: "10px",
|
|
77
|
+
position: "relative"
|
|
78
|
+
},
|
|
79
|
+
children: /* @__PURE__ */ l(
|
|
80
|
+
"div",
|
|
81
|
+
{
|
|
82
|
+
style: {
|
|
83
|
+
position: "absolute",
|
|
84
|
+
bottom: "-50px",
|
|
85
|
+
textAlign: "center",
|
|
86
|
+
padding: "5px 10px",
|
|
87
|
+
color: "#FFF"
|
|
88
|
+
},
|
|
89
|
+
children: [
|
|
90
|
+
/* @__PURE__ */ e("span", { children: o.name }),
|
|
91
|
+
/* @__PURE__ */ e("br", {}),
|
|
92
|
+
/* @__PURE__ */ e("span", { children: o.colorValue })
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
},
|
|
97
|
+
o.name
|
|
98
|
+
))
|
|
99
|
+
}
|
|
100
|
+
)
|
|
101
|
+
] });
|
|
102
|
+
};
|
|
103
|
+
export {
|
|
104
|
+
i as default
|
|
105
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
function n({
|
|
3
|
+
name: t,
|
|
4
|
+
colorValue: i
|
|
5
|
+
}) {
|
|
6
|
+
return /* @__PURE__ */ r(
|
|
7
|
+
"div",
|
|
8
|
+
{
|
|
9
|
+
style: {
|
|
10
|
+
display: "inline-block",
|
|
11
|
+
margin: "10px",
|
|
12
|
+
padding: "10px",
|
|
13
|
+
border: "1px solid #ccc"
|
|
14
|
+
},
|
|
15
|
+
children: [
|
|
16
|
+
/* @__PURE__ */ e(
|
|
17
|
+
"div",
|
|
18
|
+
{
|
|
19
|
+
style: {
|
|
20
|
+
width: "100px",
|
|
21
|
+
height: "100px",
|
|
22
|
+
backgroundColor: i,
|
|
23
|
+
border: "1px solid #000",
|
|
24
|
+
marginBottom: "5px"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
),
|
|
28
|
+
/* @__PURE__ */ r(
|
|
29
|
+
"div",
|
|
30
|
+
{
|
|
31
|
+
style: {
|
|
32
|
+
textAlign: "center",
|
|
33
|
+
fontFamily: "Arial, sans-serif"
|
|
34
|
+
},
|
|
35
|
+
children: [
|
|
36
|
+
t,
|
|
37
|
+
": ",
|
|
38
|
+
i
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
n as default
|
|
48
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import { I as s } from "../../Icons-BlBKvJD8.js";
|
|
3
|
+
function a() {
|
|
4
|
+
const i = Object.entries(s).map(([e, t]) => ({
|
|
5
|
+
name: e,
|
|
6
|
+
component: t
|
|
7
|
+
}));
|
|
8
|
+
return /* @__PURE__ */ n(
|
|
9
|
+
"div",
|
|
10
|
+
{
|
|
11
|
+
style: {
|
|
12
|
+
display: "grid",
|
|
13
|
+
gridTemplateColumns: "repeat(auto-fill, minmax(200px, 1fr))",
|
|
14
|
+
gap: "30px",
|
|
15
|
+
alignItems: "center",
|
|
16
|
+
justifyContent: "center"
|
|
17
|
+
},
|
|
18
|
+
children: i.map(({
|
|
19
|
+
name: e,
|
|
20
|
+
component: t
|
|
21
|
+
}) => /* @__PURE__ */ r(
|
|
22
|
+
"div",
|
|
23
|
+
{
|
|
24
|
+
style: {
|
|
25
|
+
display: "flex",
|
|
26
|
+
flexDirection: "column",
|
|
27
|
+
alignItems: "center",
|
|
28
|
+
justifyContent: "center"
|
|
29
|
+
},
|
|
30
|
+
children: [
|
|
31
|
+
t,
|
|
32
|
+
/* @__PURE__ */ n("span", { style: { marginTop: "10px" }, children: e })
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
e
|
|
36
|
+
))
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
a as default
|
|
42
|
+
};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
var y = function(c, a) {
|
|
2
|
+
return y = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, e) {
|
|
3
|
+
r.__proto__ = e;
|
|
4
|
+
} || function(r, e) {
|
|
5
|
+
for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (r[o] = e[o]);
|
|
6
|
+
}, y(c, a);
|
|
7
|
+
};
|
|
8
|
+
function h(c, a) {
|
|
9
|
+
if (typeof a != "function" && a !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(a) + " is not a constructor or null");
|
|
11
|
+
y(c, a);
|
|
12
|
+
function r() {
|
|
13
|
+
this.constructor = c;
|
|
14
|
+
}
|
|
15
|
+
c.prototype = a === null ? Object.create(a) : (r.prototype = a.prototype, new r());
|
|
16
|
+
}
|
|
17
|
+
var p = function() {
|
|
18
|
+
return p = Object.assign || function(a) {
|
|
19
|
+
for (var r, e = 1, o = arguments.length; e < o; e++) {
|
|
20
|
+
r = arguments[e];
|
|
21
|
+
for (var t in r) Object.prototype.hasOwnProperty.call(r, t) && (a[t] = r[t]);
|
|
22
|
+
}
|
|
23
|
+
return a;
|
|
24
|
+
}, p.apply(this, arguments);
|
|
25
|
+
};
|
|
26
|
+
function _(c, a) {
|
|
27
|
+
var r = {};
|
|
28
|
+
for (var e in c) Object.prototype.hasOwnProperty.call(c, e) && a.indexOf(e) < 0 && (r[e] = c[e]);
|
|
29
|
+
if (c != null && typeof Object.getOwnPropertySymbols == "function")
|
|
30
|
+
for (var o = 0, e = Object.getOwnPropertySymbols(c); o < e.length; o++)
|
|
31
|
+
a.indexOf(e[o]) < 0 && Object.prototype.propertyIsEnumerable.call(c, e[o]) && (r[e[o]] = c[e[o]]);
|
|
32
|
+
return r;
|
|
33
|
+
}
|
|
34
|
+
function d(c, a, r, e) {
|
|
35
|
+
function o(t) {
|
|
36
|
+
return t instanceof r ? t : new r(function(l) {
|
|
37
|
+
l(t);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return new (r || (r = Promise))(function(t, l) {
|
|
41
|
+
function i(u) {
|
|
42
|
+
try {
|
|
43
|
+
n(e.next(u));
|
|
44
|
+
} catch (s) {
|
|
45
|
+
l(s);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function f(u) {
|
|
49
|
+
try {
|
|
50
|
+
n(e.throw(u));
|
|
51
|
+
} catch (s) {
|
|
52
|
+
l(s);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function n(u) {
|
|
56
|
+
u.done ? t(u.value) : o(u.value).then(i, f);
|
|
57
|
+
}
|
|
58
|
+
n((e = e.apply(c, a || [])).next());
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function w(c, a) {
|
|
62
|
+
var r = { label: 0, sent: function() {
|
|
63
|
+
if (t[0] & 1) throw t[1];
|
|
64
|
+
return t[1];
|
|
65
|
+
}, trys: [], ops: [] }, e, o, t, l;
|
|
66
|
+
return l = { next: i(0), throw: i(1), return: i(2) }, typeof Symbol == "function" && (l[Symbol.iterator] = function() {
|
|
67
|
+
return this;
|
|
68
|
+
}), l;
|
|
69
|
+
function i(n) {
|
|
70
|
+
return function(u) {
|
|
71
|
+
return f([n, u]);
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function f(n) {
|
|
75
|
+
if (e) throw new TypeError("Generator is already executing.");
|
|
76
|
+
for (; l && (l = 0, n[0] && (r = 0)), r; ) try {
|
|
77
|
+
if (e = 1, o && (t = n[0] & 2 ? o.return : n[0] ? o.throw || ((t = o.return) && t.call(o), 0) : o.next) && !(t = t.call(o, n[1])).done) return t;
|
|
78
|
+
switch (o = 0, t && (n = [n[0] & 2, t.value]), n[0]) {
|
|
79
|
+
case 0:
|
|
80
|
+
case 1:
|
|
81
|
+
t = n;
|
|
82
|
+
break;
|
|
83
|
+
case 4:
|
|
84
|
+
return r.label++, { value: n[1], done: !1 };
|
|
85
|
+
case 5:
|
|
86
|
+
r.label++, o = n[1], n = [0];
|
|
87
|
+
continue;
|
|
88
|
+
case 7:
|
|
89
|
+
n = r.ops.pop(), r.trys.pop();
|
|
90
|
+
continue;
|
|
91
|
+
default:
|
|
92
|
+
if (t = r.trys, !(t = t.length > 0 && t[t.length - 1]) && (n[0] === 6 || n[0] === 2)) {
|
|
93
|
+
r = 0;
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
if (n[0] === 3 && (!t || n[1] > t[0] && n[1] < t[3])) {
|
|
97
|
+
r.label = n[1];
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
if (n[0] === 6 && r.label < t[1]) {
|
|
101
|
+
r.label = t[1], t = n;
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
if (t && r.label < t[2]) {
|
|
105
|
+
r.label = t[2], r.ops.push(n);
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
t[2] && r.ops.pop(), r.trys.pop();
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
n = a.call(c, r);
|
|
112
|
+
} catch (u) {
|
|
113
|
+
n = [6, u], o = 0;
|
|
114
|
+
} finally {
|
|
115
|
+
e = t = 0;
|
|
116
|
+
}
|
|
117
|
+
if (n[0] & 5) throw n[1];
|
|
118
|
+
return { value: n[0] ? n[1] : void 0, done: !0 };
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function b(c, a) {
|
|
122
|
+
var r = typeof Symbol == "function" && c[Symbol.iterator];
|
|
123
|
+
if (!r) return c;
|
|
124
|
+
var e = r.call(c), o, t = [], l;
|
|
125
|
+
try {
|
|
126
|
+
for (; (a === void 0 || a-- > 0) && !(o = e.next()).done; ) t.push(o.value);
|
|
127
|
+
} catch (i) {
|
|
128
|
+
l = { error: i };
|
|
129
|
+
} finally {
|
|
130
|
+
try {
|
|
131
|
+
o && !o.done && (r = e.return) && r.call(e);
|
|
132
|
+
} finally {
|
|
133
|
+
if (l) throw l.error;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return t;
|
|
137
|
+
}
|
|
138
|
+
function v(c, a, r) {
|
|
139
|
+
if (r || arguments.length === 2) for (var e = 0, o = a.length, t; e < o; e++)
|
|
140
|
+
(t || !(e in a)) && (t || (t = Array.prototype.slice.call(a, 0, e)), t[e] = a[e]);
|
|
141
|
+
return c.concat(t || Array.prototype.slice.call(a));
|
|
142
|
+
}
|
|
143
|
+
export {
|
|
144
|
+
p as _,
|
|
145
|
+
d as a,
|
|
146
|
+
w as b,
|
|
147
|
+
v as c,
|
|
148
|
+
b as d,
|
|
149
|
+
h as e,
|
|
150
|
+
_ as f
|
|
151
|
+
};
|
package/dist/utils/functional.js
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
function t() {
|
|
2
|
+
}
|
|
3
|
+
function r() {
|
|
4
|
+
return !0;
|
|
5
|
+
}
|
|
6
|
+
function e() {
|
|
7
|
+
return !1;
|
|
8
|
+
}
|
|
9
|
+
function u(n) {
|
|
10
|
+
return n;
|
|
11
|
+
}
|
|
12
|
+
function o(n) {
|
|
13
|
+
n();
|
|
14
|
+
}
|
|
2
15
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
16
|
+
u as identity,
|
|
17
|
+
o as invoke,
|
|
18
|
+
t as noop,
|
|
19
|
+
e as returnFalse,
|
|
20
|
+
r as returnTrue
|
|
8
21
|
};
|
package/dist/utils/hooks.d.ts
CHANGED
|
@@ -11,4 +11,5 @@ export declare namespace useKeyboardClose {
|
|
|
11
11
|
var isCloseEvent: (event: KeyboardEvent) => boolean;
|
|
12
12
|
}
|
|
13
13
|
export declare function useWindowResize<T extends () => void>(callback: T): void;
|
|
14
|
-
export
|
|
14
|
+
export type OutletPosition = 'original' | 'before' | 'after';
|
|
15
|
+
export declare function useOutlet(id: string, position?: OutletPosition): React.FC<React.PropsWithChildren>;
|
package/dist/utils/hooks.js
CHANGED
|
@@ -1,12 +1,79 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import "../index-
|
|
4
|
-
|
|
1
|
+
import { jsx as E } from "react/jsx-runtime";
|
|
2
|
+
import o from "react";
|
|
3
|
+
import { R as m } from "../index-2hJuj4UN.js";
|
|
4
|
+
const a = Symbol("Uninitialized");
|
|
5
|
+
function h(e, ...t) {
|
|
6
|
+
const r = o.useRef(a);
|
|
7
|
+
return r.current === a && (r.current = e(...t)), r.current;
|
|
8
|
+
}
|
|
9
|
+
function l(e) {
|
|
10
|
+
const t = o.useRef(e);
|
|
11
|
+
return t.current = e, t;
|
|
12
|
+
}
|
|
13
|
+
function i(e, t = "keydown", r) {
|
|
14
|
+
o.useEffect(() => {
|
|
15
|
+
const s = (n) => {
|
|
16
|
+
i.shouldProcessEvent(n) && e.current(n);
|
|
17
|
+
};
|
|
18
|
+
return window.addEventListener(t, s, r), () => {
|
|
19
|
+
window.removeEventListener(t, s, r);
|
|
20
|
+
};
|
|
21
|
+
}, [t, r]);
|
|
22
|
+
}
|
|
23
|
+
i.shouldProcessEvent = (e) => {
|
|
24
|
+
if (e.target instanceof Element) {
|
|
25
|
+
if (e.target.hasAttribute("contenteditable"))
|
|
26
|
+
return !1;
|
|
27
|
+
switch (e.target.tagName) {
|
|
28
|
+
case "INPUT":
|
|
29
|
+
case "SELECT":
|
|
30
|
+
case "TEXTAREA":
|
|
31
|
+
return !1;
|
|
32
|
+
default:
|
|
33
|
+
return !0;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return !0;
|
|
37
|
+
};
|
|
38
|
+
function d(e) {
|
|
39
|
+
const t = l((r) => {
|
|
40
|
+
d.isCloseEvent(r) && e();
|
|
41
|
+
});
|
|
42
|
+
i(t);
|
|
43
|
+
}
|
|
44
|
+
d.isCloseEvent = (e) => e.key === "Escape";
|
|
45
|
+
function v(e) {
|
|
46
|
+
const t = l(e);
|
|
47
|
+
o.useEffect(() => {
|
|
48
|
+
const r = () => t.current();
|
|
49
|
+
return window.addEventListener("resize", r), () => window.removeEventListener("resize", r);
|
|
50
|
+
}, []);
|
|
51
|
+
}
|
|
52
|
+
function b(e) {
|
|
53
|
+
const {
|
|
54
|
+
children: t
|
|
55
|
+
} = e;
|
|
56
|
+
return /* @__PURE__ */ E("div", { style: { display: "none" }, children: t });
|
|
57
|
+
}
|
|
58
|
+
function g(e, t = "original") {
|
|
59
|
+
const [r, s] = o.useState(() => b);
|
|
60
|
+
return o.useEffect(() => {
|
|
61
|
+
let n = document.getElementById(e);
|
|
62
|
+
if (n || (n = document.createElement("div"), n.id = e, document.body.appendChild(n)), t !== "original") {
|
|
63
|
+
const c = n, u = `${e}_${t}`;
|
|
64
|
+
n = document.getElementById(u), n || (n = document.createElement("div"), n.id = u, t === "before" ? document.body.insertBefore(n, c) : c.after(n));
|
|
65
|
+
}
|
|
66
|
+
const f = ({
|
|
67
|
+
children: c
|
|
68
|
+
}) => m.createPortal(c, n);
|
|
69
|
+
s(() => f);
|
|
70
|
+
}, [e, t]), r;
|
|
71
|
+
}
|
|
5
72
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
73
|
+
l as useDynamicRef,
|
|
74
|
+
i as useGlobalKeyboardEvent,
|
|
75
|
+
h as useInstance,
|
|
76
|
+
d as useKeyboardClose,
|
|
77
|
+
g as useOutlet,
|
|
78
|
+
v as useWindowResize
|
|
12
79
|
};
|