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