tgui-core 1.1.4 → 1.1.6
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/components/DmIcon.js +24 -24
- package/dist/components/Dropdown.js +54 -54
- package/dist/components/Knob.js +1 -1
- package/dist/components/Popper.js +108 -138
- package/dist/components/ProgressBar.js +4 -4
- package/dist/components/RoundGauge.js +3 -3
- package/dist/components/Section.js +1 -1
- package/dist/components/Slider.js +1 -1
- package/dist/components/Tooltip.js +7 -7
- package/dist/{index-jLZg_duJ.js → popper-CiqSDJTE.js} +165 -166
- package/package.json +1 -2
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { resolveAsset as
|
|
4
|
-
import { fetchRetry as
|
|
5
|
-
import { Image as
|
|
6
|
-
let
|
|
7
|
-
function
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useState as h, useEffect as $ } from "react";
|
|
3
|
+
import { resolveAsset as j } from "../common/assets.js";
|
|
4
|
+
import { fetchRetry as v } from "../common/http.js";
|
|
5
|
+
import { Image as x } from "./Image.js";
|
|
6
|
+
let t;
|
|
7
|
+
function b(o) {
|
|
8
8
|
const {
|
|
9
|
-
className:
|
|
10
|
-
direction:
|
|
11
|
-
fallback:
|
|
12
|
-
frame:
|
|
13
|
-
icon_state:
|
|
14
|
-
icon:
|
|
15
|
-
movement:
|
|
16
|
-
...
|
|
17
|
-
} =
|
|
18
|
-
return
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}, []),
|
|
9
|
+
className: E,
|
|
10
|
+
direction: n = 2,
|
|
11
|
+
fallback: f,
|
|
12
|
+
frame: m = 1,
|
|
13
|
+
icon_state: s,
|
|
14
|
+
icon: c,
|
|
15
|
+
movement: i = !1,
|
|
16
|
+
...a
|
|
17
|
+
} = o, [r, p] = h(""), u = `${r}?state=${s}&dir=${n}&movement=${i}&frame=${m}`;
|
|
18
|
+
return $(() => {
|
|
19
|
+
t || v(j("icon_ref_map.json")).then((e) => e.json()).then((e) => {
|
|
20
|
+
t = e, p(e[c]);
|
|
21
|
+
}).catch((e) => {
|
|
22
|
+
console.error("Error fetching ref map:", e);
|
|
23
|
+
});
|
|
24
|
+
}, []), r ? /* @__PURE__ */ l(x, { fixErrors: !0, src: u, ...a }) : f;
|
|
25
25
|
}
|
|
26
26
|
export {
|
|
27
|
-
|
|
27
|
+
b as DmIcon
|
|
28
28
|
};
|
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { classes as
|
|
4
|
-
import { unit as
|
|
5
|
-
import { Button as
|
|
6
|
-
import { Icon as
|
|
7
|
-
import { Popper as
|
|
1
|
+
import { jsx as o, jsxs as m, Fragment as W } from "react/jsx-runtime";
|
|
2
|
+
import { useState as F, useRef as L, useEffect as q } from "react";
|
|
3
|
+
import { classes as y } from "../common/react.js";
|
|
4
|
+
import { unit as z } from "./Box.js";
|
|
5
|
+
import { Button as D } from "./Button.js";
|
|
6
|
+
import { Icon as b } from "./Icon.js";
|
|
7
|
+
import { Popper as A } from "./Popper.js";
|
|
8
8
|
const G = -1;
|
|
9
9
|
function f(d) {
|
|
10
10
|
return typeof d == "string" ? d : d.value;
|
|
11
11
|
}
|
|
12
12
|
function Y(d) {
|
|
13
13
|
const {
|
|
14
|
-
autoScroll:
|
|
15
|
-
buttons:
|
|
16
|
-
className:
|
|
17
|
-
clipSelectedText:
|
|
18
|
-
color:
|
|
14
|
+
autoScroll: w = !0,
|
|
15
|
+
buttons: I,
|
|
16
|
+
className: O,
|
|
17
|
+
clipSelectedText: k = !0,
|
|
18
|
+
color: B = "default",
|
|
19
19
|
disabled: a,
|
|
20
|
-
displayText:
|
|
21
|
-
icon:
|
|
22
|
-
iconRotation:
|
|
23
|
-
iconSpin:
|
|
24
|
-
menuWidth:
|
|
25
|
-
noChevron:
|
|
20
|
+
displayText: C,
|
|
21
|
+
icon: x,
|
|
22
|
+
iconRotation: T,
|
|
23
|
+
iconSpin: j,
|
|
24
|
+
menuWidth: R = "15rem",
|
|
25
|
+
noChevron: S,
|
|
26
26
|
onClick: p,
|
|
27
27
|
onSelected: i,
|
|
28
|
-
options:
|
|
28
|
+
options: r = [],
|
|
29
29
|
over: g,
|
|
30
|
-
placeholder:
|
|
30
|
+
placeholder: E = "Select...",
|
|
31
31
|
selected: u,
|
|
32
|
-
width:
|
|
33
|
-
} = d, [
|
|
32
|
+
width: P = "15rem"
|
|
33
|
+
} = d, [l, h] = F(!1), V = g ? !l : l, v = L(null), s = r.findIndex((e) => f(e) === u) || 0;
|
|
34
34
|
function _(e) {
|
|
35
35
|
var c;
|
|
36
36
|
let t = e;
|
|
37
|
-
e <
|
|
37
|
+
e < s ? t = e < 2 ? 0 : e - 2 : t = e > r.length - 3 ? r.length - 1 : e - 2;
|
|
38
38
|
const n = (c = v.current) == null ? void 0 : c.children[t];
|
|
39
39
|
n == null || n.scrollIntoView({ block: "nearest" });
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
if (
|
|
41
|
+
function N(e) {
|
|
42
|
+
if (r.length < 1 || a)
|
|
43
43
|
return;
|
|
44
|
-
const t = 0, n =
|
|
44
|
+
const t = 0, n = r.length - 1;
|
|
45
45
|
let c;
|
|
46
|
-
|
|
46
|
+
s < 0 ? c = e === "next" ? n : t : e === "next" ? c = s === n ? t : s + 1 : c = s === t ? n : s - 1, l && w && _(c), i == null || i(f(r[c]));
|
|
47
47
|
}
|
|
48
|
-
return
|
|
48
|
+
return q(() => {
|
|
49
49
|
var e;
|
|
50
|
-
|
|
51
|
-
}, [
|
|
52
|
-
|
|
50
|
+
l && (w && s !== G && _(s), (e = v.current) == null || e.focus());
|
|
51
|
+
}, [l]), /* @__PURE__ */ o(
|
|
52
|
+
A,
|
|
53
53
|
{
|
|
54
|
-
isOpen:
|
|
54
|
+
isOpen: l,
|
|
55
55
|
onClickOutside: () => h(!1),
|
|
56
56
|
placement: g ? "top-start" : "bottom-start",
|
|
57
57
|
content: /* @__PURE__ */ m(
|
|
58
58
|
"div",
|
|
59
59
|
{
|
|
60
60
|
className: "Layout Dropdown__menu",
|
|
61
|
-
style: { minWidth:
|
|
61
|
+
style: { minWidth: R },
|
|
62
62
|
ref: v,
|
|
63
63
|
children: [
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
r.length === 0 && /* @__PURE__ */ o("div", { className: "Dropdown__menuentry", children: "No options" }),
|
|
65
|
+
r.map((e, t) => {
|
|
66
66
|
const n = f(e);
|
|
67
|
-
return /* @__PURE__ */
|
|
67
|
+
return /* @__PURE__ */ o(
|
|
68
68
|
"div",
|
|
69
69
|
{
|
|
70
|
-
className:
|
|
70
|
+
className: y([
|
|
71
71
|
"Dropdown__menuentry",
|
|
72
72
|
u === n && "selected"
|
|
73
73
|
]),
|
|
@@ -82,60 +82,60 @@ function Y(d) {
|
|
|
82
82
|
]
|
|
83
83
|
}
|
|
84
84
|
),
|
|
85
|
-
children: /* @__PURE__ */ m("div", { className: "Dropdown", style: { width:
|
|
85
|
+
children: /* @__PURE__ */ m("div", { className: "Dropdown", style: { width: z(P) }, children: [
|
|
86
86
|
/* @__PURE__ */ m(
|
|
87
87
|
"div",
|
|
88
88
|
{
|
|
89
|
-
className:
|
|
89
|
+
className: y([
|
|
90
90
|
"Dropdown__control",
|
|
91
91
|
"Button",
|
|
92
92
|
"Button--dropdown",
|
|
93
|
-
"Button--color--" +
|
|
93
|
+
"Button--color--" + B,
|
|
94
94
|
a && "Button--disabled",
|
|
95
|
-
|
|
95
|
+
O
|
|
96
96
|
]),
|
|
97
97
|
onClick: (e) => {
|
|
98
|
-
a && !
|
|
98
|
+
a && !l || (h(!l), p == null || p(e));
|
|
99
99
|
},
|
|
100
100
|
children: [
|
|
101
|
-
|
|
102
|
-
/* @__PURE__ */
|
|
101
|
+
x && /* @__PURE__ */ o(b, { mr: 1, name: x, rotation: T, spin: j }),
|
|
102
|
+
/* @__PURE__ */ o(
|
|
103
103
|
"span",
|
|
104
104
|
{
|
|
105
105
|
className: "Dropdown__selected-text",
|
|
106
106
|
style: {
|
|
107
|
-
overflow:
|
|
107
|
+
overflow: k ? "hidden" : "visible"
|
|
108
108
|
},
|
|
109
|
-
children:
|
|
109
|
+
children: C || u && f(u) || E
|
|
110
110
|
}
|
|
111
111
|
),
|
|
112
|
-
!
|
|
112
|
+
!S && /* @__PURE__ */ o("span", { className: "Dropdown__arrow-button", children: /* @__PURE__ */ o(b, { name: V ? "chevron-up" : "chevron-down" }) })
|
|
113
113
|
]
|
|
114
114
|
}
|
|
115
115
|
),
|
|
116
|
-
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
|
|
116
|
+
I && /* @__PURE__ */ m(W, { children: [
|
|
117
|
+
/* @__PURE__ */ o(
|
|
118
|
+
D,
|
|
119
119
|
{
|
|
120
120
|
disabled: a,
|
|
121
121
|
height: 1.8,
|
|
122
122
|
icon: "chevron-left",
|
|
123
123
|
onClick: () => {
|
|
124
|
-
|
|
124
|
+
N(
|
|
125
125
|
"previous"
|
|
126
126
|
/* Previous */
|
|
127
127
|
);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
),
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
|
|
131
|
+
/* @__PURE__ */ o(
|
|
132
|
+
D,
|
|
133
133
|
{
|
|
134
134
|
disabled: a,
|
|
135
135
|
height: 1.8,
|
|
136
136
|
icon: "chevron-right",
|
|
137
137
|
onClick: () => {
|
|
138
|
-
|
|
138
|
+
N(
|
|
139
139
|
"next"
|
|
140
140
|
/* Next */
|
|
141
141
|
);
|
package/dist/components/Knob.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _, jsxs as j } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { keyOfMatchingRange as E, scale as s } from "../common/math.js";
|
|
3
3
|
import { classes as e } from "../common/react.js";
|
|
4
4
|
import { computeBoxClassName as K, computeBoxProps as I } from "./Box.js";
|
|
5
5
|
import { DraggableControl as O } from "./DraggableControl.js";
|
|
@@ -1,86 +1,85 @@
|
|
|
1
|
-
import { jsxs as M, Fragment as
|
|
2
|
-
import * as
|
|
3
|
-
import { useState as
|
|
4
|
-
import * as
|
|
5
|
-
import { c as A } from "../
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return n[o] = a, n;
|
|
1
|
+
import { jsxs as M, Fragment as P, jsx as S } from "react/jsx-runtime";
|
|
2
|
+
import * as l from "react";
|
|
3
|
+
import { useState as E, useRef as g, useEffect as F } from "react";
|
|
4
|
+
import * as _ from "react-dom";
|
|
5
|
+
import { c as A } from "../popper-CiqSDJTE.js";
|
|
6
|
+
var j = function(r) {
|
|
7
|
+
return r.reduce(function(n, t) {
|
|
8
|
+
var o = t[0], u = t[1];
|
|
9
|
+
return n[o] = u, n;
|
|
11
10
|
}, {});
|
|
12
|
-
},
|
|
13
|
-
function I(
|
|
14
|
-
return
|
|
11
|
+
}, R = typeof window < "u" && window.document && window.document.createElement ? l.useLayoutEffect : l.useEffect;
|
|
12
|
+
function I(e) {
|
|
13
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
15
14
|
}
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
if (
|
|
19
|
-
if (
|
|
20
|
-
if (
|
|
21
|
-
var n,
|
|
22
|
-
if (Array.isArray(
|
|
23
|
-
if (n =
|
|
24
|
-
for (
|
|
25
|
-
if (!
|
|
15
|
+
var U = typeof Element < "u", x = typeof Map == "function", z = typeof Set == "function", B = typeof ArrayBuffer == "function" && !!ArrayBuffer.isView;
|
|
16
|
+
function w(e, r) {
|
|
17
|
+
if (e === r) return !0;
|
|
18
|
+
if (e && r && typeof e == "object" && typeof r == "object") {
|
|
19
|
+
if (e.constructor !== r.constructor) return !1;
|
|
20
|
+
var n, t, o;
|
|
21
|
+
if (Array.isArray(e)) {
|
|
22
|
+
if (n = e.length, n != r.length) return !1;
|
|
23
|
+
for (t = n; t-- !== 0; )
|
|
24
|
+
if (!w(e[t], r[t])) return !1;
|
|
26
25
|
return !0;
|
|
27
26
|
}
|
|
28
|
-
var
|
|
29
|
-
if (
|
|
30
|
-
if (
|
|
31
|
-
for (
|
|
32
|
-
if (!r.has(
|
|
33
|
-
for (
|
|
34
|
-
if (!
|
|
27
|
+
var u;
|
|
28
|
+
if (x && e instanceof Map && r instanceof Map) {
|
|
29
|
+
if (e.size !== r.size) return !1;
|
|
30
|
+
for (u = e.entries(); !(t = u.next()).done; )
|
|
31
|
+
if (!r.has(t.value[0])) return !1;
|
|
32
|
+
for (u = e.entries(); !(t = u.next()).done; )
|
|
33
|
+
if (!w(t.value[1], r.get(t.value[0]))) return !1;
|
|
35
34
|
return !0;
|
|
36
35
|
}
|
|
37
|
-
if (
|
|
38
|
-
if (
|
|
39
|
-
for (
|
|
40
|
-
if (!r.has(
|
|
36
|
+
if (z && e instanceof Set && r instanceof Set) {
|
|
37
|
+
if (e.size !== r.size) return !1;
|
|
38
|
+
for (u = e.entries(); !(t = u.next()).done; )
|
|
39
|
+
if (!r.has(t.value[0])) return !1;
|
|
41
40
|
return !0;
|
|
42
41
|
}
|
|
43
|
-
if (
|
|
44
|
-
if (n =
|
|
45
|
-
for (
|
|
46
|
-
if (t
|
|
42
|
+
if (B && ArrayBuffer.isView(e) && ArrayBuffer.isView(r)) {
|
|
43
|
+
if (n = e.length, n != r.length) return !1;
|
|
44
|
+
for (t = n; t-- !== 0; )
|
|
45
|
+
if (e[t] !== r[t]) return !1;
|
|
47
46
|
return !0;
|
|
48
47
|
}
|
|
49
|
-
if (
|
|
50
|
-
if (
|
|
51
|
-
if (
|
|
52
|
-
if (o = Object.keys(
|
|
53
|
-
for (
|
|
54
|
-
if (!Object.prototype.hasOwnProperty.call(r, o[
|
|
55
|
-
if (
|
|
56
|
-
for (
|
|
57
|
-
if (!((o[
|
|
48
|
+
if (e.constructor === RegExp) return e.source === r.source && e.flags === r.flags;
|
|
49
|
+
if (e.valueOf !== Object.prototype.valueOf && typeof e.valueOf == "function" && typeof r.valueOf == "function") return e.valueOf() === r.valueOf();
|
|
50
|
+
if (e.toString !== Object.prototype.toString && typeof e.toString == "function" && typeof r.toString == "function") return e.toString() === r.toString();
|
|
51
|
+
if (o = Object.keys(e), n = o.length, n !== Object.keys(r).length) return !1;
|
|
52
|
+
for (t = n; t-- !== 0; )
|
|
53
|
+
if (!Object.prototype.hasOwnProperty.call(r, o[t])) return !1;
|
|
54
|
+
if (U && e instanceof Element) return !1;
|
|
55
|
+
for (t = n; t-- !== 0; )
|
|
56
|
+
if (!((o[t] === "_owner" || o[t] === "__v" || o[t] === "__o") && e.$$typeof) && !w(e[o[t]], r[o[t]]))
|
|
58
57
|
return !1;
|
|
59
58
|
return !0;
|
|
60
59
|
}
|
|
61
|
-
return
|
|
60
|
+
return e !== e && r !== r;
|
|
62
61
|
}
|
|
63
|
-
var
|
|
62
|
+
var L = function(r, n) {
|
|
64
63
|
try {
|
|
65
|
-
return
|
|
66
|
-
} catch (
|
|
67
|
-
if ((
|
|
64
|
+
return w(r, n);
|
|
65
|
+
} catch (t) {
|
|
66
|
+
if ((t.message || "").match(/stack|recursion/i))
|
|
68
67
|
return console.warn("react-fast-compare cannot handle circular refs"), !1;
|
|
69
|
-
throw
|
|
68
|
+
throw t;
|
|
70
69
|
}
|
|
71
70
|
};
|
|
72
|
-
const
|
|
73
|
-
var
|
|
74
|
-
|
|
75
|
-
var o =
|
|
76
|
-
onFirstUpdate:
|
|
77
|
-
placement:
|
|
78
|
-
strategy:
|
|
79
|
-
modifiers:
|
|
80
|
-
},
|
|
71
|
+
const q = /* @__PURE__ */ I(L);
|
|
72
|
+
var D = [], $ = function(r, n, t) {
|
|
73
|
+
t === void 0 && (t = {});
|
|
74
|
+
var o = l.useRef(null), u = {
|
|
75
|
+
onFirstUpdate: t.onFirstUpdate,
|
|
76
|
+
placement: t.placement || "bottom",
|
|
77
|
+
strategy: t.strategy || "absolute",
|
|
78
|
+
modifiers: t.modifiers || D
|
|
79
|
+
}, m = l.useState({
|
|
81
80
|
styles: {
|
|
82
81
|
popper: {
|
|
83
|
-
position:
|
|
82
|
+
position: u.strategy,
|
|
84
83
|
left: "0",
|
|
85
84
|
top: "0"
|
|
86
85
|
},
|
|
@@ -89,119 +88,90 @@ var C = [], B = function(r, n, e) {
|
|
|
89
88
|
}
|
|
90
89
|
},
|
|
91
90
|
attributes: {}
|
|
92
|
-
}),
|
|
91
|
+
}), y = m[0], O = m[1], v = l.useMemo(function() {
|
|
93
92
|
return {
|
|
94
93
|
name: "updateState",
|
|
95
94
|
enabled: !0,
|
|
96
95
|
phase: "write",
|
|
97
|
-
fn: function(
|
|
98
|
-
var
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
styles:
|
|
102
|
-
return [
|
|
96
|
+
fn: function(d) {
|
|
97
|
+
var i = d.state, f = Object.keys(i.elements);
|
|
98
|
+
_.flushSync(function() {
|
|
99
|
+
O({
|
|
100
|
+
styles: j(f.map(function(c) {
|
|
101
|
+
return [c, i.styles[c] || {}];
|
|
103
102
|
})),
|
|
104
|
-
attributes:
|
|
105
|
-
return [
|
|
103
|
+
attributes: j(f.map(function(c) {
|
|
104
|
+
return [c, i.attributes[c]];
|
|
106
105
|
}))
|
|
107
106
|
});
|
|
108
107
|
});
|
|
109
108
|
},
|
|
110
109
|
requires: ["computeStyles"]
|
|
111
110
|
};
|
|
112
|
-
}, []),
|
|
113
|
-
var
|
|
114
|
-
onFirstUpdate:
|
|
115
|
-
placement:
|
|
116
|
-
strategy:
|
|
117
|
-
modifiers: [].concat(
|
|
111
|
+
}, []), p = l.useMemo(function() {
|
|
112
|
+
var a = {
|
|
113
|
+
onFirstUpdate: u.onFirstUpdate,
|
|
114
|
+
placement: u.placement,
|
|
115
|
+
strategy: u.strategy,
|
|
116
|
+
modifiers: [].concat(u.modifiers, [v, {
|
|
118
117
|
name: "applyStyles",
|
|
119
118
|
enabled: !1
|
|
120
119
|
}])
|
|
121
120
|
};
|
|
122
|
-
return
|
|
123
|
-
}, [
|
|
124
|
-
return
|
|
125
|
-
|
|
126
|
-
}, [
|
|
121
|
+
return q(o.current, a) ? o.current || a : (o.current = a, a);
|
|
122
|
+
}, [u.onFirstUpdate, u.placement, u.strategy, u.modifiers, v]), s = l.useRef();
|
|
123
|
+
return R(function() {
|
|
124
|
+
s.current && s.current.setOptions(p);
|
|
125
|
+
}, [p]), R(function() {
|
|
127
126
|
if (!(r == null || n == null)) {
|
|
128
|
-
var
|
|
129
|
-
return
|
|
130
|
-
|
|
127
|
+
var a = t.createPopper || A, d = a(r, n, p);
|
|
128
|
+
return s.current = d, function() {
|
|
129
|
+
d.destroy(), s.current = null;
|
|
131
130
|
};
|
|
132
131
|
}
|
|
133
|
-
}, [r, n,
|
|
134
|
-
state:
|
|
135
|
-
styles:
|
|
136
|
-
attributes:
|
|
137
|
-
update:
|
|
138
|
-
forceUpdate:
|
|
132
|
+
}, [r, n, t.createPopper]), {
|
|
133
|
+
state: s.current ? s.current.state : null,
|
|
134
|
+
styles: y.styles,
|
|
135
|
+
attributes: y.attributes,
|
|
136
|
+
update: s.current ? s.current.update : null,
|
|
137
|
+
forceUpdate: s.current ? s.current.forceUpdate : null
|
|
139
138
|
};
|
|
140
139
|
};
|
|
141
|
-
|
|
142
|
-
}
|
|
143
|
-
if (q) {
|
|
144
|
-
var L = function(r, n) {
|
|
145
|
-
var e = arguments.length;
|
|
146
|
-
n = new Array(e > 1 ? e - 1 : 0);
|
|
147
|
-
for (var o = 1; o < e; o++)
|
|
148
|
-
n[o - 1] = arguments[o];
|
|
149
|
-
var a = 0, l = "Warning: " + r.replace(/%s/g, function() {
|
|
150
|
-
return n[a++];
|
|
151
|
-
});
|
|
152
|
-
typeof console < "u" && console.error(l);
|
|
153
|
-
try {
|
|
154
|
-
throw new Error(l);
|
|
155
|
-
} catch {
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
z = function(t, r, n) {
|
|
159
|
-
var e = arguments.length;
|
|
160
|
-
n = new Array(e > 2 ? e - 2 : 0);
|
|
161
|
-
for (var o = 2; o < e; o++)
|
|
162
|
-
n[o - 2] = arguments[o];
|
|
163
|
-
if (r === void 0)
|
|
164
|
-
throw new Error(
|
|
165
|
-
"`warning(condition, format, ...args)` requires a warning message argument"
|
|
166
|
-
);
|
|
167
|
-
t || L.apply(null, [r].concat(n));
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
function G(t) {
|
|
171
|
-
const { children: r, content: n, isOpen: e, onClickOutside: o, placement: a } = t, [l, v] = O(null), [h, y] = O(
|
|
140
|
+
function W(e) {
|
|
141
|
+
const { children: r, content: n, isOpen: t, onClickOutside: o, placement: u } = e, [m, y] = E(null), [O, v] = E(
|
|
172
142
|
null
|
|
173
|
-
),
|
|
174
|
-
placement:
|
|
143
|
+
), p = g(null), s = g(null), { styles: a, attributes: d } = $(m, O, {
|
|
144
|
+
placement: u
|
|
175
145
|
});
|
|
176
|
-
function
|
|
177
|
-
var
|
|
178
|
-
!((
|
|
146
|
+
function i(f) {
|
|
147
|
+
var c, h;
|
|
148
|
+
!((c = p.current) != null && c.contains(f.target)) && !((h = s.current) != null && h.contains(f.target)) && (o == null || o());
|
|
179
149
|
}
|
|
180
|
-
return
|
|
181
|
-
document.removeEventListener("mousedown",
|
|
182
|
-
}), [
|
|
183
|
-
/* @__PURE__ */
|
|
150
|
+
return F(() => (t ? document.addEventListener("mousedown", i) : document.removeEventListener("mousedown", i), () => {
|
|
151
|
+
document.removeEventListener("mousedown", i);
|
|
152
|
+
}), [t]), /* @__PURE__ */ M(P, { children: [
|
|
153
|
+
/* @__PURE__ */ S(
|
|
184
154
|
"div",
|
|
185
155
|
{
|
|
186
156
|
ref: (f) => {
|
|
187
|
-
|
|
157
|
+
y(f), s.current = f;
|
|
188
158
|
},
|
|
189
159
|
children: r
|
|
190
160
|
}
|
|
191
161
|
),
|
|
192
|
-
|
|
162
|
+
t && /* @__PURE__ */ S(
|
|
193
163
|
"div",
|
|
194
164
|
{
|
|
195
165
|
ref: (f) => {
|
|
196
|
-
|
|
166
|
+
v(f), p.current = f;
|
|
197
167
|
},
|
|
198
|
-
style: { ...
|
|
199
|
-
...
|
|
168
|
+
style: { ...a.popper, zIndex: e.baseZIndex ?? 5 },
|
|
169
|
+
...d.popper,
|
|
200
170
|
children: n
|
|
201
171
|
}
|
|
202
172
|
)
|
|
203
173
|
] });
|
|
204
174
|
}
|
|
205
175
|
export {
|
|
206
|
-
|
|
176
|
+
W as Popper
|
|
207
177
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as g, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { CSS_COLORS as v } from "../common/constants.js";
|
|
3
|
-
import {
|
|
3
|
+
import { keyOfMatchingRange as y, toFixed as N, scale as _, clamp01 as B } from "../common/math.js";
|
|
4
4
|
import { classes as m } from "../common/react.js";
|
|
5
5
|
import { s as o } from "../ProgressBar.module-BkAFfFy0.js";
|
|
6
6
|
import { computeBoxProps as S, computeBoxClassName as O } from "./Box.js";
|
|
@@ -14,12 +14,12 @@ function w(d) {
|
|
|
14
14
|
ranges: h = {},
|
|
15
15
|
children: l,
|
|
16
16
|
...t
|
|
17
|
-
} = d, a =
|
|
17
|
+
} = d, a = _(r, u, p), x = l !== void 0, s = C || y(r, h) || "default", e = S(t), c = [
|
|
18
18
|
o.progressBar,
|
|
19
19
|
f,
|
|
20
20
|
O(t)
|
|
21
21
|
], i = {
|
|
22
|
-
width:
|
|
22
|
+
width: B(a) * 100 + "%"
|
|
23
23
|
};
|
|
24
24
|
return v.includes(s) || s === "default" ? c.push(o["color__" + s]) : (e.style = { ...e.style, borderColor: s }, i.backgroundColor = s), /* @__PURE__ */ g("div", { className: m(c), ...e, children: [
|
|
25
25
|
/* @__PURE__ */ n(
|
|
@@ -29,7 +29,7 @@ function w(d) {
|
|
|
29
29
|
style: i
|
|
30
30
|
}
|
|
31
31
|
),
|
|
32
|
-
/* @__PURE__ */ n("div", { className: o.content, children: x ? l :
|
|
32
|
+
/* @__PURE__ */ n("div", { className: o.content, children: x ? l : N(a * 100) + "%" })
|
|
33
33
|
] });
|
|
34
34
|
}
|
|
35
35
|
export {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as k, jsx as _ } from "react/jsx-runtime";
|
|
2
|
-
import { scale as d,
|
|
2
|
+
import { scale as d, keyOfMatchingRange as M, clamp01 as N } from "../common/math.js";
|
|
3
3
|
import { classes as u } from "../common/react.js";
|
|
4
4
|
import { AnimatedNumber as A } from "./AnimatedNumber.js";
|
|
5
5
|
import { Box as B, computeBoxClassName as G, computeBoxProps as j } from "./Box.js";
|
|
@@ -65,7 +65,7 @@ function A_(y) {
|
|
|
65
65
|
style: w,
|
|
66
66
|
value: l,
|
|
67
67
|
...m
|
|
68
|
-
} = y, C = d(l, s, n), p =
|
|
68
|
+
} = y, C = d(l, s, n), p = N(C), c = a ? {} : { primary: [0, 1] };
|
|
69
69
|
a && Object.keys(a).forEach((t) => {
|
|
70
70
|
const g = a[t];
|
|
71
71
|
c[t] = [
|
|
@@ -76,7 +76,7 @@ function A_(y) {
|
|
|
76
76
|
function x() {
|
|
77
77
|
return o && r && l > o && l < r || o && l > o ? !0 : !!(r && l < r);
|
|
78
78
|
}
|
|
79
|
-
const b = x() &&
|
|
79
|
+
const b = x() && M(p, c);
|
|
80
80
|
return /* @__PURE__ */ k(B, { inline: !0, children: [
|
|
81
81
|
/* @__PURE__ */ _(
|
|
82
82
|
"div",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as r, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as S, useEffect as j } from "react";
|
|
3
3
|
import { addScrollableNode as z, removeScrollableNode as B } from "../common/events.js";
|
|
4
|
-
import {
|
|
4
|
+
import { classes as H, canRender as m } from "../common/react.js";
|
|
5
5
|
import { s as t } from "../Section.module-CLVHJ4yA.js";
|
|
6
6
|
import { computeBoxClassName as T, computeBoxProps as y } from "./Box.js";
|
|
7
7
|
const q = S(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as s, jsxs as m } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { keyOfMatchingRange as R, clamp01 as t, scale as f } from "../common/math.js";
|
|
3
3
|
import { classes as _ } from "../common/react.js";
|
|
4
4
|
import { s as e } from "../ProgressBar.module-BkAFfFy0.js";
|
|
5
5
|
import { computeBoxClassName as $, computeBoxProps as q } from "./Box.js";
|