tgui-core 1.2.0 → 1.3.1
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/README.md +3 -3
- package/dist/common/color.js +31 -30
- package/dist/common/events.js +5 -5
- package/dist/common/format.js +27 -27
- package/dist/common/hotkeys.d.ts +0 -1
- package/dist/common/hotkeys.js +2 -2
- package/dist/common/math.d.ts +4 -0
- package/dist/common/math.js +29 -25
- package/dist/common/random.js +14 -13
- package/dist/common/react.js +1 -1
- package/dist/common/string.js +9 -9
- package/dist/common/type-utils.d.ts +1 -1
- package/dist/components/AnimatedNumber.d.ts +6 -6
- package/dist/components/AnimatedNumber.js +14 -17
- package/dist/components/Autofocus.d.ts +0 -1
- package/dist/components/Blink.d.ts +0 -1
- package/dist/components/BlockQuote.d.ts +0 -1
- package/dist/components/BlockQuote.js +4 -7
- package/dist/components/Box.d.ts +0 -1
- package/dist/components/Box.js +4 -4
- package/dist/components/Button.d.ts +0 -1
- package/dist/components/Button.js +173 -211
- package/dist/components/ByondUi.js +3 -3
- package/dist/components/Chart.d.ts +0 -1
- package/dist/components/Chart.js +25 -22
- package/dist/components/Collapsible.d.ts +0 -1
- package/dist/components/ColorBox.d.ts +0 -1
- package/dist/components/ColorBox.js +7 -14
- package/dist/components/Dialog.js +31 -40
- package/dist/components/Dimmer.d.ts +0 -1
- package/dist/components/Dimmer.js +6 -9
- package/dist/components/Divider.js +10 -14
- package/dist/components/DmIcon.d.ts +0 -1
- package/dist/components/DraggableControl.js +57 -49
- package/dist/components/Dropdown.d.ts +0 -1
- package/dist/components/Dropdown.js +73 -67
- package/dist/components/FitText.d.ts +0 -1
- package/dist/components/Flex.d.ts +1 -1
- package/dist/components/Flex.js +39 -41
- package/dist/components/Icon.d.ts +0 -1
- package/dist/components/Icon.js +27 -34
- package/dist/components/Image.d.ts +0 -1
- package/dist/components/Image.js +7 -6
- package/dist/components/ImageButton.d.ts +0 -1
- package/dist/components/ImageButton.js +87 -170
- package/dist/components/InfinitePlane.js +1 -1
- package/dist/components/Input.d.ts +0 -1
- package/dist/components/Input.js +57 -64
- package/dist/components/KeyListener.d.ts +0 -1
- package/dist/components/Knob.d.ts +0 -1
- package/dist/components/Knob.js +91 -117
- package/dist/components/LabeledControls.d.ts +0 -1
- package/dist/components/LabeledList.d.ts +0 -1
- package/dist/components/LabeledList.js +48 -55
- package/dist/components/MenuBar.d.ts +0 -1
- package/dist/components/MenuBar.js +93 -102
- package/dist/components/Modal.d.ts +0 -1
- package/dist/components/Modal.js +11 -18
- package/dist/components/NoticeBox.d.ts +0 -1
- package/dist/components/NoticeBox.js +16 -43
- package/dist/components/NumberInput.d.ts +0 -2
- package/dist/components/NumberInput.js +99 -107
- package/dist/components/Popper.d.ts +0 -1
- package/dist/components/ProgressBar.d.ts +0 -1
- package/dist/components/ProgressBar.js +22 -27
- package/dist/components/RestrictedInput.js +64 -58
- package/dist/components/RoundGauge.d.ts +0 -1
- package/dist/components/RoundGauge.js +70 -104
- package/dist/components/Section.d.ts +1 -2
- package/dist/components/Section.js +50 -51
- package/dist/components/Slider.d.ts +0 -1
- package/dist/components/Slider.js +72 -80
- package/dist/components/Stack.d.ts +0 -1
- package/dist/components/Stack.js +37 -47
- package/dist/components/StyleableSection.d.ts +0 -1
- package/dist/components/StyleableSection.js +11 -11
- package/dist/components/Table.d.ts +0 -1
- package/dist/components/Table.js +38 -47
- package/dist/components/Tabs.d.ts +0 -1
- package/dist/components/Tabs.js +43 -75
- package/dist/components/TextArea.d.ts +0 -1
- package/dist/components/TextArea.js +74 -69
- package/dist/components/TimeDisplay.d.ts +7 -6
- package/dist/components/TimeDisplay.js +17 -17
- package/dist/components/Tooltip.d.ts +1 -2
- package/dist/components/Tooltip.js +8 -10
- package/dist/components/TrackOutsideClicks.d.ts +0 -1
- package/dist/components/VirtualList.d.ts +0 -1
- package/package.json +25 -25
- package/dist/ProgressBar.module-Jzqlebbx.js +0 -29
- package/dist/Section.module-qhQWhlUX.js +0 -18
- package/dist/assets/BlockQuote.css +0 -1
- package/dist/assets/Button.css +0 -1
- package/dist/assets/ColorBox.css +0 -1
- package/dist/assets/Dialog.css +0 -1
- package/dist/assets/Dimmer.css +0 -1
- package/dist/assets/Divider.css +0 -1
- package/dist/assets/Flex.css +0 -1
- package/dist/assets/Icon.css +0 -6
- package/dist/assets/ImageButton.css +0 -5
- package/dist/assets/Input.css +0 -1
- package/dist/assets/Knob.css +0 -1
- package/dist/assets/LabeledList.css +0 -1
- package/dist/assets/MenuBar.css +0 -1
- package/dist/assets/Modal.css +0 -1
- package/dist/assets/NoticeBox.css +0 -1
- package/dist/assets/NumberInput.css +0 -1
- package/dist/assets/ProgressBar.css +0 -1
- package/dist/assets/RoundGauge.css +0 -1
- package/dist/assets/Section.css +0 -1
- package/dist/assets/Slider.css +0 -1
- package/dist/assets/Stack.css +0 -1
- package/dist/assets/Table.css +0 -1
- package/dist/assets/Tabs.css +0 -1
- package/dist/assets/TextArea.css +0 -1
- package/dist/assets/Tooltip.css +0 -1
|
@@ -1,116 +1,67 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { scale as d, keyOfMatchingRange as M, clamp01 as
|
|
3
|
-
import { classes as
|
|
4
|
-
import { AnimatedNumber as
|
|
5
|
-
import { Box as B, computeBoxClassName as
|
|
6
|
-
|
|
7
|
-
roundGauge: F,
|
|
8
|
-
ringTrack: L,
|
|
9
|
-
ringFill: T,
|
|
10
|
-
needle: V,
|
|
11
|
-
needleLine: O,
|
|
12
|
-
needleMiddle: R,
|
|
13
|
-
alert: Z,
|
|
14
|
-
max: z,
|
|
15
|
-
color__black: P,
|
|
16
|
-
color__white: S,
|
|
17
|
-
color__red: $,
|
|
18
|
-
color__orange: D,
|
|
19
|
-
color__yellow: E,
|
|
20
|
-
color__olive: I,
|
|
21
|
-
color__green: q,
|
|
22
|
-
color__teal: H,
|
|
23
|
-
color__blue: J,
|
|
24
|
-
color__violet: K,
|
|
25
|
-
color__purple: Q,
|
|
26
|
-
color__pink: U,
|
|
27
|
-
color__brown: W,
|
|
28
|
-
color__grey: X,
|
|
29
|
-
"color__light-grey": "_color__light-grey_gktag_119",
|
|
30
|
-
color__good: Y,
|
|
31
|
-
color__average: __,
|
|
32
|
-
color__bad: e_,
|
|
33
|
-
color__label: l_,
|
|
34
|
-
alert__black: o_,
|
|
35
|
-
alertAnim: r_,
|
|
36
|
-
alert__white: t_,
|
|
37
|
-
alert__red: a_,
|
|
38
|
-
alert__orange: c_,
|
|
39
|
-
alert__yellow: g_,
|
|
40
|
-
alert__olive: n_,
|
|
41
|
-
alert__green: s_,
|
|
42
|
-
alert__teal: i_,
|
|
43
|
-
alert__blue: k_,
|
|
44
|
-
alert__violet: d_,
|
|
45
|
-
alert__purple: u_,
|
|
46
|
-
alert__pink: m_,
|
|
47
|
-
alert__brown: p_,
|
|
48
|
-
alert__grey: b_,
|
|
49
|
-
"alert__light-grey": "_alert__light-grey_gktag_223",
|
|
50
|
-
alert__good: y_,
|
|
51
|
-
alert__average: h_,
|
|
52
|
-
alert__bad: f_,
|
|
53
|
-
alert__label: v_
|
|
54
|
-
};
|
|
55
|
-
function A_(y) {
|
|
1
|
+
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { scale as d, keyOfMatchingRange as M, clamp01 as k } from "../common/math.js";
|
|
3
|
+
import { classes as h } from "../common/react.js";
|
|
4
|
+
import { AnimatedNumber as v } from "./AnimatedNumber.js";
|
|
5
|
+
import { Box as B, computeBoxClassName as $, computeBoxProps as j } from "./Box.js";
|
|
6
|
+
function w(p) {
|
|
56
7
|
const {
|
|
57
|
-
alertAfter:
|
|
58
|
-
alertBefore:
|
|
59
|
-
className:
|
|
60
|
-
format:
|
|
61
|
-
maxValue:
|
|
62
|
-
minValue:
|
|
63
|
-
ranges:
|
|
64
|
-
size:
|
|
65
|
-
style:
|
|
66
|
-
value:
|
|
67
|
-
...
|
|
68
|
-
} =
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
d(
|
|
73
|
-
d(
|
|
8
|
+
alertAfter: a,
|
|
9
|
+
alertBefore: t,
|
|
10
|
+
className: _,
|
|
11
|
+
format: R,
|
|
12
|
+
maxValue: c = 1,
|
|
13
|
+
minValue: u = 1,
|
|
14
|
+
ranges: n,
|
|
15
|
+
size: y = 1,
|
|
16
|
+
style: x,
|
|
17
|
+
value: r,
|
|
18
|
+
...g
|
|
19
|
+
} = p, G = d(r, u, c), f = k(G), l = n ? {} : { primary: [0, 1] };
|
|
20
|
+
n && Object.keys(n).forEach((o) => {
|
|
21
|
+
const s = n[o];
|
|
22
|
+
l[o] = [
|
|
23
|
+
d(s[0], u, c),
|
|
24
|
+
d(s[1], u, c)
|
|
74
25
|
];
|
|
75
26
|
});
|
|
76
|
-
function
|
|
77
|
-
return
|
|
27
|
+
function N() {
|
|
28
|
+
return !!(a && t && r > a && r < t || a && r > a || t && r < t);
|
|
78
29
|
}
|
|
79
|
-
const
|
|
80
|
-
return /* @__PURE__ */
|
|
81
|
-
/* @__PURE__ */
|
|
30
|
+
const C = N() && M(f, l);
|
|
31
|
+
return /* @__PURE__ */ m(B, { inline: !0, children: [
|
|
32
|
+
/* @__PURE__ */ e(
|
|
82
33
|
"div",
|
|
83
34
|
{
|
|
84
|
-
className:
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
35
|
+
className: h([
|
|
36
|
+
"RoundGauge",
|
|
37
|
+
_,
|
|
38
|
+
$(g)
|
|
88
39
|
]),
|
|
89
40
|
...j({
|
|
90
41
|
style: {
|
|
91
|
-
fontSize:
|
|
92
|
-
...
|
|
42
|
+
fontSize: `${y}em`,
|
|
43
|
+
...x
|
|
93
44
|
},
|
|
94
|
-
...
|
|
45
|
+
...g
|
|
95
46
|
}),
|
|
96
|
-
children: /* @__PURE__ */
|
|
97
|
-
(
|
|
47
|
+
children: /* @__PURE__ */ m("svg", { viewBox: "0 0 100 50", children: [
|
|
48
|
+
(a || t) && /* @__PURE__ */ e(
|
|
98
49
|
"g",
|
|
99
50
|
{
|
|
100
|
-
className:
|
|
101
|
-
|
|
102
|
-
|
|
51
|
+
className: h([
|
|
52
|
+
"RoundGauge__alert",
|
|
53
|
+
C ? `active RoundGauge__alert--${C}` : ""
|
|
103
54
|
]),
|
|
104
|
-
children: /* @__PURE__ */
|
|
55
|
+
children: /* @__PURE__ */ e("path", { d: "M48.211,14.578C48.55,13.9 49.242,13.472 50,13.472C50.758,13.472 51.45,13.9 51.789,14.578C54.793,20.587 60.795,32.589 63.553,38.106C63.863,38.726 63.83,39.462 63.465,40.051C63.101,40.641 62.457,41 61.764,41C55.996,41 44.004,41 38.236,41C37.543,41 36.899,40.641 36.535,40.051C36.17,39.462 36.137,38.726 36.447,38.106C39.205,32.589 45.207,20.587 48.211,14.578ZM50,34.417C51.426,34.417 52.583,35.574 52.583,37C52.583,38.426 51.426,39.583 50,39.583C48.574,39.583 47.417,38.426 47.417,37C47.417,35.574 48.574,34.417 50,34.417ZM50,32.75C50,32.75 53,31.805 53,22.25C53,20.594 51.656,19.25 50,19.25C48.344,19.25 47,20.594 47,22.25C47,31.805 50,32.75 50,32.75Z" })
|
|
105
56
|
}
|
|
106
57
|
),
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
-
const i =
|
|
110
|
-
return /* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ e("g", { children: /* @__PURE__ */ e("circle", { className: "RoundGauge__ringTrack", cx: "50", cy: "50", r: "45" }) }),
|
|
59
|
+
/* @__PURE__ */ e("g", { children: Object.keys(l).map((o, s) => {
|
|
60
|
+
const i = l[o];
|
|
61
|
+
return /* @__PURE__ */ e(
|
|
111
62
|
"circle",
|
|
112
63
|
{
|
|
113
|
-
className:
|
|
64
|
+
className: `RoundGauge__ringFill RoundGauge--color--${o}`,
|
|
114
65
|
style: {
|
|
115
66
|
strokeDashoffset: Math.max(
|
|
116
67
|
(2 - (i[1] - i[0])) * Math.PI * 50,
|
|
@@ -122,26 +73,41 @@ function A_(y) {
|
|
|
122
73
|
cy: "50",
|
|
123
74
|
r: "45"
|
|
124
75
|
},
|
|
125
|
-
|
|
76
|
+
s
|
|
126
77
|
);
|
|
127
78
|
}) }),
|
|
128
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ m(
|
|
129
80
|
"g",
|
|
130
81
|
{
|
|
131
|
-
className:
|
|
132
|
-
transform: `rotate(${
|
|
82
|
+
className: "RoundGauge__needle",
|
|
83
|
+
transform: `rotate(${f * 180 - 90} 50 50)`,
|
|
133
84
|
children: [
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
|
|
85
|
+
/* @__PURE__ */ e(
|
|
86
|
+
"polygon",
|
|
87
|
+
{
|
|
88
|
+
className: "RoundGauge__needleLine",
|
|
89
|
+
points: "46,50 50,0 54,50"
|
|
90
|
+
}
|
|
91
|
+
),
|
|
92
|
+
/* @__PURE__ */ e(
|
|
93
|
+
"circle",
|
|
94
|
+
{
|
|
95
|
+
className: "RoundGauge__needleMiddle",
|
|
96
|
+
cx: "50",
|
|
97
|
+
cy: "50",
|
|
98
|
+
r: "8"
|
|
99
|
+
}
|
|
100
|
+
)
|
|
136
101
|
]
|
|
137
102
|
}
|
|
138
|
-
)
|
|
103
|
+
),
|
|
104
|
+
/* @__PURE__ */ e("title", { children: "alert" })
|
|
139
105
|
] })
|
|
140
106
|
}
|
|
141
107
|
),
|
|
142
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ e(v, { value: r, format: R })
|
|
143
109
|
] });
|
|
144
110
|
}
|
|
145
111
|
export {
|
|
146
|
-
|
|
112
|
+
w as RoundGauge
|
|
147
113
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { BoxProps } from './Box';
|
|
3
|
-
|
|
4
3
|
type Props = Partial<{
|
|
5
4
|
/** Buttons to render aside the section title. */
|
|
6
5
|
buttons: ReactNode;
|
|
@@ -52,5 +51,5 @@ type Props = Partial<{
|
|
|
52
51
|
* </Section>
|
|
53
52
|
* ```
|
|
54
53
|
*/
|
|
55
|
-
export declare
|
|
54
|
+
export declare function Section(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
56
55
|
export {};
|
|
@@ -1,69 +1,68 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { addScrollableNode as
|
|
4
|
-
import { classes as
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
const _ = (f) => {
|
|
1
|
+
import { jsxs as s, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as T, useEffect as C } from "react";
|
|
3
|
+
import { addScrollableNode as P, removeScrollableNode as g } from "../common/events.js";
|
|
4
|
+
import { classes as a, canRender as d } from "../common/react.js";
|
|
5
|
+
import { computeBoxClassName as j, computeBoxProps as z } from "./Box.js";
|
|
6
|
+
function G(m) {
|
|
8
7
|
const {
|
|
9
|
-
buttons:
|
|
10
|
-
children:
|
|
11
|
-
className:
|
|
12
|
-
fill:
|
|
13
|
-
fitted:
|
|
14
|
-
flexGrow:
|
|
15
|
-
noTopPadding:
|
|
16
|
-
onScroll:
|
|
17
|
-
scrollable:
|
|
18
|
-
scrollableHorizontal:
|
|
19
|
-
stretchContents:
|
|
20
|
-
title:
|
|
21
|
-
container_id:
|
|
8
|
+
buttons: n,
|
|
9
|
+
children: f,
|
|
10
|
+
className: S,
|
|
11
|
+
fill: u,
|
|
12
|
+
fitted: _,
|
|
13
|
+
flexGrow: p,
|
|
14
|
+
noTopPadding: N,
|
|
15
|
+
onScroll: h,
|
|
16
|
+
scrollable: c,
|
|
17
|
+
scrollableHorizontal: l,
|
|
18
|
+
stretchContents: b,
|
|
19
|
+
title: r,
|
|
20
|
+
container_id: x,
|
|
22
21
|
...i
|
|
23
|
-
} =
|
|
24
|
-
return
|
|
25
|
-
if (!(
|
|
26
|
-
const
|
|
27
|
-
return
|
|
28
|
-
|
|
22
|
+
} = m, e = T(null), v = d(r) || d(n);
|
|
23
|
+
return C(() => {
|
|
24
|
+
if (!(e != null && e.current) || !c && !l) return;
|
|
25
|
+
const o = e.current;
|
|
26
|
+
return P(o), () => {
|
|
27
|
+
o && g(o);
|
|
29
28
|
};
|
|
30
|
-
}, []), /* @__PURE__ */
|
|
29
|
+
}, []), /* @__PURE__ */ s(
|
|
31
30
|
"div",
|
|
32
31
|
{
|
|
33
|
-
id:
|
|
34
|
-
className:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
id: x || "",
|
|
33
|
+
className: a([
|
|
34
|
+
"Section",
|
|
35
|
+
u && "Section--fill",
|
|
36
|
+
_ && "Section--fitted",
|
|
37
|
+
c && "Section--scrollable",
|
|
38
|
+
l && "Section--scrollableHorizontal",
|
|
39
|
+
p && "Section--flex",
|
|
40
|
+
S,
|
|
41
|
+
j(i)
|
|
43
42
|
]),
|
|
44
|
-
...
|
|
43
|
+
...z(i),
|
|
45
44
|
children: [
|
|
46
|
-
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */
|
|
45
|
+
v && /* @__PURE__ */ s("div", { className: "Section__title", children: [
|
|
46
|
+
/* @__PURE__ */ t("span", { className: "Section__titleText", children: r }),
|
|
47
|
+
/* @__PURE__ */ t("div", { className: "Section__buttons", children: n })
|
|
49
48
|
] }),
|
|
50
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ t("div", { className: "Section__rest", children: /* @__PURE__ */ t(
|
|
51
50
|
"div",
|
|
52
51
|
{
|
|
53
|
-
className:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
className: a([
|
|
53
|
+
"Section__content",
|
|
54
|
+
b && "Section__content--stretchContents",
|
|
55
|
+
N && "Section__content--noTopPadding"
|
|
57
56
|
]),
|
|
58
|
-
onScroll:
|
|
59
|
-
ref:
|
|
60
|
-
children:
|
|
57
|
+
onScroll: h,
|
|
58
|
+
ref: e,
|
|
59
|
+
children: f
|
|
61
60
|
}
|
|
62
61
|
) })
|
|
63
62
|
]
|
|
64
63
|
}
|
|
65
64
|
);
|
|
66
|
-
}
|
|
65
|
+
}
|
|
67
66
|
export {
|
|
68
|
-
|
|
67
|
+
G as Section
|
|
69
68
|
};
|
|
@@ -1,117 +1,109 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { keyOfMatchingRange as
|
|
3
|
-
import { classes as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import '../assets/Slider.css';const H = "_slider_1assx_9", I = "_cursorOffset_1assx_13", J = "_cursor_1assx_13", K = "_pointer_1assx_30", L = "_popupValue_1assx_41", a = {
|
|
8
|
-
slider: H,
|
|
9
|
-
cursorOffset: I,
|
|
10
|
-
cursor: J,
|
|
11
|
-
pointer: K,
|
|
12
|
-
popupValue: L
|
|
13
|
-
};
|
|
14
|
-
function Z(h) {
|
|
1
|
+
import { jsx as e, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { keyOfMatchingRange as O, clamp01 as r, scale as u } from "../common/math.js";
|
|
3
|
+
import { classes as p } from "../common/react.js";
|
|
4
|
+
import { computeBoxClassName as b, computeBoxProps as z } from "./Box.js";
|
|
5
|
+
import { DraggableControl as R } from "./DraggableControl.js";
|
|
6
|
+
function J(g) {
|
|
15
7
|
const {
|
|
16
8
|
// Draggable props (passthrough)
|
|
17
|
-
animated:
|
|
18
|
-
format:
|
|
19
|
-
maxValue:
|
|
20
|
-
minValue:
|
|
21
|
-
onChange:
|
|
22
|
-
onDrag:
|
|
23
|
-
step:
|
|
24
|
-
stepPixelSize:
|
|
25
|
-
suppressFlicker:
|
|
26
|
-
unit:
|
|
27
|
-
value:
|
|
9
|
+
animated: f,
|
|
10
|
+
format: _,
|
|
11
|
+
maxValue: l,
|
|
12
|
+
minValue: s,
|
|
13
|
+
onChange: h,
|
|
14
|
+
onDrag: v,
|
|
15
|
+
step: N,
|
|
16
|
+
stepPixelSize: x,
|
|
17
|
+
suppressFlicker: y,
|
|
18
|
+
unit: B,
|
|
19
|
+
value: P,
|
|
28
20
|
// Own props
|
|
29
|
-
className:
|
|
30
|
-
fillValue:
|
|
31
|
-
color:
|
|
32
|
-
ranges:
|
|
21
|
+
className: S,
|
|
22
|
+
fillValue: a,
|
|
23
|
+
color: V,
|
|
24
|
+
ranges: C = {},
|
|
33
25
|
children: i,
|
|
34
|
-
...
|
|
35
|
-
} =
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
|
|
26
|
+
...o
|
|
27
|
+
} = g, D = i !== void 0;
|
|
28
|
+
return /* @__PURE__ */ e(
|
|
29
|
+
R,
|
|
38
30
|
{
|
|
39
31
|
dragMatrix: [1, 0],
|
|
40
|
-
animated:
|
|
41
|
-
format:
|
|
42
|
-
maxValue:
|
|
43
|
-
minValue:
|
|
44
|
-
onChange:
|
|
45
|
-
onDrag:
|
|
46
|
-
step:
|
|
47
|
-
stepPixelSize:
|
|
48
|
-
suppressFlicker:
|
|
49
|
-
unit:
|
|
50
|
-
value:
|
|
51
|
-
children: (
|
|
32
|
+
animated: f,
|
|
33
|
+
format: _,
|
|
34
|
+
maxValue: l,
|
|
35
|
+
minValue: s,
|
|
36
|
+
onChange: h,
|
|
37
|
+
onDrag: v,
|
|
38
|
+
step: N,
|
|
39
|
+
stepPixelSize: x,
|
|
40
|
+
suppressFlicker: y,
|
|
41
|
+
unit: B,
|
|
42
|
+
value: P,
|
|
43
|
+
children: (w) => {
|
|
52
44
|
const {
|
|
53
|
-
displayElement:
|
|
54
|
-
displayValue:
|
|
55
|
-
dragging:
|
|
56
|
-
handleDragStart:
|
|
57
|
-
inputElement:
|
|
58
|
-
value:
|
|
59
|
-
} =
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
), d =
|
|
45
|
+
displayElement: t,
|
|
46
|
+
displayValue: n,
|
|
47
|
+
dragging: M,
|
|
48
|
+
handleDragStart: $,
|
|
49
|
+
inputElement: F,
|
|
50
|
+
value: j
|
|
51
|
+
} = w, k = a != null, c = u(
|
|
52
|
+
a ?? n,
|
|
53
|
+
s,
|
|
54
|
+
l
|
|
55
|
+
), d = u(n, s, l), E = V || O(a ?? j, C) || "default";
|
|
64
56
|
return /* @__PURE__ */ m(
|
|
65
57
|
"div",
|
|
66
58
|
{
|
|
67
|
-
className:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
59
|
+
className: p([
|
|
60
|
+
"Slider",
|
|
61
|
+
"ProgressBar",
|
|
62
|
+
`ProgressBar--color--${E}`,
|
|
63
|
+
S,
|
|
64
|
+
b(o)
|
|
73
65
|
]),
|
|
74
|
-
...
|
|
75
|
-
onMouseDown:
|
|
66
|
+
...z(o),
|
|
67
|
+
onMouseDown: $,
|
|
76
68
|
children: [
|
|
77
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ e(
|
|
78
70
|
"div",
|
|
79
71
|
{
|
|
80
|
-
className:
|
|
81
|
-
|
|
82
|
-
|
|
72
|
+
className: p([
|
|
73
|
+
"ProgressBar__fill",
|
|
74
|
+
k && "ProgressBar__fill--animated"
|
|
83
75
|
]),
|
|
84
76
|
style: {
|
|
85
|
-
width:
|
|
77
|
+
width: `${r(c) * 100}%`,
|
|
86
78
|
opacity: 0.4
|
|
87
79
|
}
|
|
88
80
|
}
|
|
89
81
|
),
|
|
90
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ e(
|
|
91
83
|
"div",
|
|
92
84
|
{
|
|
93
|
-
className:
|
|
85
|
+
className: "ProgressBar__fill",
|
|
94
86
|
style: {
|
|
95
|
-
width:
|
|
87
|
+
width: `${r(Math.min(c, d)) * 100}%`
|
|
96
88
|
}
|
|
97
89
|
}
|
|
98
90
|
),
|
|
99
91
|
/* @__PURE__ */ m(
|
|
100
92
|
"div",
|
|
101
93
|
{
|
|
102
|
-
className:
|
|
94
|
+
className: "Slider__cursorOffset",
|
|
103
95
|
style: {
|
|
104
|
-
width:
|
|
96
|
+
width: `${r(d) * 100}%`
|
|
105
97
|
},
|
|
106
98
|
children: [
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
-
|
|
99
|
+
/* @__PURE__ */ e("div", { className: "Slider__cursor" }),
|
|
100
|
+
/* @__PURE__ */ e("div", { className: "Slider__pointer" }),
|
|
101
|
+
M && /* @__PURE__ */ e("div", { className: "Slider__popupValue", children: t })
|
|
110
102
|
]
|
|
111
103
|
}
|
|
112
104
|
),
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
|
|
105
|
+
/* @__PURE__ */ e("div", { className: "ProgressBar__content", children: D ? i : t }),
|
|
106
|
+
F
|
|
115
107
|
]
|
|
116
108
|
}
|
|
117
109
|
);
|
|
@@ -120,5 +112,5 @@ function Z(h) {
|
|
|
120
112
|
);
|
|
121
113
|
}
|
|
122
114
|
export {
|
|
123
|
-
|
|
115
|
+
J as Slider
|
|
124
116
|
};
|