tgui-core 1.1.24 → 1.2.0
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/assets/ImageButton.css +5 -0
- package/dist/components/Box.d.ts +2 -0
- package/dist/components/DraggableControl.js +4 -6
- package/dist/components/ImageButton.d.ts +61 -0
- package/dist/components/ImageButton.js +218 -0
- package/dist/components/NumberInput.js +82 -82
- package/dist/components/Slider.d.ts +2 -0
- package/dist/components/TextArea.d.ts +2 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +60 -58
- package/package.json +1 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file
|
|
3
|
+
* @copyright 2024 Aylong (https://github.com/AyIong)
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/._color__black_7gau9_18{background-color:#0003;color:#fff;border:solid rgba(32,32,32,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__black_7gau9_18:hover{background-color:#20202033}._contentColor__black_7gau9_29{background-color:#000;color:#fff;border:solid #101010;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__black_7gau9_37{background-color:#00000054;color:#fff;border:solid rgba(32,32,32,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__white_7gau9_45{background-color:#d9d9d933;color:#000;border:solid rgba(250,250,250,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__white_7gau9_45:hover{background-color:#fafafa33}._contentColor__white_7gau9_56{background-color:#d9d9d9;color:#000;border:solid #f8f8f8;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__white_7gau9_64{background-color:#d9d9d954;color:#000;border:solid rgba(250,250,250,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__red_7gau9_72{background-color:#bd202033;color:#fff;border:solid rgba(227,112,112,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__red_7gau9_72:hover{background-color:#e3707033}._contentColor__red_7gau9_83{background-color:#bd2020;color:#fff;border:solid #d93f3f;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__red_7gau9_91{background-color:#bd202054;color:#fff;border:solid rgba(227,112,112,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__orange_7gau9_99{background-color:#d95e0c33;color:#fff;border:solid rgba(244,162,107,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__orange_7gau9_99:hover{background-color:#f4a26b33}._contentColor__orange_7gau9_110{background-color:#d95e0c;color:#fff;border:solid #ef7e33;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__orange_7gau9_118{background-color:#d95e0c54;color:#fff;border:solid rgba(244,162,107,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__yellow_7gau9_126{background-color:#d9b80433;color:#000;border:solid rgba(248,225,91,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__yellow_7gau9_126:hover{background-color:#f8e15b33}._contentColor__yellow_7gau9_137{background-color:#d9b804;color:#000;border:solid #f5d523;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__yellow_7gau9_145{background-color:#d9b80454;color:#000;border:solid rgba(248,225,91,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__olive_7gau9_153{background-color:#9aad1433;color:#000;border:solid rgba(209,228,79,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__olive_7gau9_153:hover{background-color:#d1e44f33}._contentColor__olive_7gau9_164{background-color:#9aad14;color:#000;border:solid #bdd327;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__olive_7gau9_172{background-color:#9aad1454;color:#000;border:solid rgba(209,228,79,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__green_7gau9_180{background-color:#1b963833;color:#fff;border:solid rgba(72,214,105,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__green_7gau9_180:hover{background-color:#48d66933}._contentColor__green_7gau9_191{background-color:#1b9638;color:#fff;border:solid #2fb94f;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__green_7gau9_199{background-color:#1b963854;color:#fff;border:solid rgba(72,214,105,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__teal_7gau9_207{background-color:#009a9333;color:#fff;border:solid rgba(32,225,216,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__teal_7gau9_207:hover{background-color:#20e1d833}._contentColor__teal_7gau9_218{background-color:#009a93;color:#fff;border:solid #10bdb6;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__teal_7gau9_226{background-color:#009a9354;color:#fff;border:solid rgba(32,225,216,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__blue_7gau9_234{background-color:#1c71b133;color:#fff;border:solid rgba(96,169,224,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__blue_7gau9_234:hover{background-color:#60a9e033}._contentColor__blue_7gau9_245{background-color:#1c71b1;color:#fff;border:solid #308fd6;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__blue_7gau9_253{background-color:#1c71b154;color:#fff;border:solid rgba(96,169,224,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__violet_7gau9_261{background-color:#552dab33;color:#fff;border:solid rgba(149,119,215,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__violet_7gau9_261:hover{background-color:#9577d733}._contentColor__violet_7gau9_272{background-color:#552dab;color:#fff;border:solid #7249ca;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__violet_7gau9_280{background-color:#552dab54;color:#fff;border:solid rgba(149,119,215,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__purple_7gau9_288{background-color:#8b2baa33;color:#fff;border:solid rgba(190,115,215,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__purple_7gau9_288:hover{background-color:#be73d733}._contentColor__purple_7gau9_299{background-color:#8b2baa;color:#fff;border:solid #aa46ca;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__purple_7gau9_307{background-color:#8b2baa54;color:#fff;border:solid rgba(190,115,215,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__pink_7gau9_315{background-color:#cf208233;color:#fff;border:solid rgba(233,129,188,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__pink_7gau9_315:hover{background-color:#e981bc33}._contentColor__pink_7gau9_326{background-color:#cf2082;color:#fff;border:solid #e04ca0;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__pink_7gau9_334{background-color:#cf208254;color:#fff;border:solid rgba(233,129,188,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__brown_7gau9_342{background-color:#8c583633;color:#fff;border:solid rgba(195,144,111,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__brown_7gau9_342:hover{background-color:#c3906f33}._contentColor__brown_7gau9_353{background-color:#8c5836;color:#fff;border:solid #ae724c;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__brown_7gau9_361{background-color:#8c583654;color:#fff;border:solid rgba(195,144,111,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__grey_7gau9_369{background-color:#64646433;color:#fff;border:solid rgba(157,157,157,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__grey_7gau9_369:hover{background-color:#9d9d9d33}._contentColor__grey_7gau9_380{background-color:#646464;color:#fff;border:solid #818181;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__grey_7gau9_388{background-color:#64646454;color:#fff;border:solid rgba(157,157,157,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__light-grey_7gau9_396{background-color:#91919133;color:#fff;border:solid rgba(213,213,213,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__light-grey_7gau9_396:hover{background-color:#d5d5d533}._contentColor__light-grey_7gau9_407{background-color:#919191;color:#fff;border:solid #b3b3b3;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__light-grey_7gau9_415{background-color:#91919154;color:#fff;border:solid rgba(213,213,213,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__good_7gau9_423{background-color:#4d912133;color:#fff;border:solid rgba(130,208,79,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__good_7gau9_423:hover{background-color:#82d04f33}._contentColor__good_7gau9_434{background-color:#4d9121;color:#fff;border:solid #67b335;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__good_7gau9_442{background-color:#4d912154;color:#fff;border:solid rgba(130,208,79,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__average_7gau9_450{background-color:#cd7a0d33;color:#fff;border:solid rgba(241,178,96,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__average_7gau9_450:hover{background-color:#f1b26033}._contentColor__average_7gau9_461{background-color:#cd7a0d;color:#fff;border:solid #eb972b;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__average_7gau9_469{background-color:#cd7a0d54;color:#fff;border:solid rgba(241,178,96,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__bad_7gau9_477{background-color:#bd202033;color:#fff;border:solid rgba(227,112,112,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__bad_7gau9_477:hover{background-color:#e3707033}._contentColor__bad_7gau9_488{background-color:#bd2020;color:#fff;border:solid #d93f3f;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__bad_7gau9_496{background-color:#bd202054;color:#fff;border:solid rgba(227,112,112,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__label_7gau9_504{background-color:#657a9433;color:#fff;border:solid rgba(175,186,201,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__label_7gau9_504:hover{background-color:#afbac933}._contentColor__label_7gau9_515{background-color:#657a94;color:#fff;border:solid #8a9aae;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__label_7gau9_523{background-color:#657a9454;color:#fff;border:solid rgba(175,186,201,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._color__default_7gau9_531{background-color:#35353533;color:#fff;border:solid rgba(99,99,99,.2);border-width:1px;transition:background-color .2s,border-color .2s}._color__default_7gau9_531:hover{background-color:#63636333}._disabled_7gau9_542{background-color:#631d1d40!important;border-color:#631d1d40!important}._selected_7gau9_547{background-color:#1b963833;color:#fff;border:solid rgba(27,150,56,.25);border-width:1px;transition:background-color .2s,border-color .2s}._selected_7gau9_547:hover{background-color:#48d66933}._contentColor__default_7gau9_558{background-color:#313131;color:#fff;border:solid #404040;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._contentDisabled_7gau9_566{background-color:#631d1d!important;border-top:1px solid #803131!important}._contentSelected_7gau9_571{background-color:#1b9638;color:#fff;border:solid #2fb94f;border-width:1px 0 0 0;transition:background-color .2s,border-color .2s}._buttonsContainerColor__default_7gau9_579{background-color:#35353533;color:#fff;border:solid rgba(99,99,99,.2);border-width:1px 1px 1px 0;transition:background-color 0,border-color 0}._ImageButton_7gau9_587{display:inline-table;position:relative;text-align:center;margin:.25em;-webkit-user-select:none;user-select:none;-ms-user-select:none}._ImageButton_7gau9_587 ._noAction_7gau9_595{pointer-events:none}._ImageButton_7gau9_587 ._container_7gau9_598{display:flex;flex-direction:column;border-radius:.33em}._ImageButton_7gau9_587 ._image_7gau9_603{position:relative;align-self:center;pointer-events:none;overflow:hidden;line-height:0;padding:.25em;border-radius:.33em}._ImageButton_7gau9_587 ._buttonsContainer_7gau9_37{display:flex;position:absolute;overflow:hidden;left:1px;bottom:1.8em;max-width:100%;z-index:1}._ImageButton_7gau9_587 ._buttonsContainer_7gau9_37._buttonsAltContainer_7gau9_621{overflow:visible;flex-direction:column;pointer-events:none;top:1px;bottom:inherit!important}._ImageButton_7gau9_587 ._buttonsContainer_7gau9_37._buttonsEmpty_7gau9_628{bottom:1px}._ImageButton_7gau9_587 ._buttonsContainer_7gau9_37>*{margin:0!important;padding:0 .2em!important;border-radius:0!important}._ImageButton_7gau9_587 ._content_7gau9_29{-ms-user-select:none;-webkit-user-select:none;user-select:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:.25em .5em;margin:-1px;border-radius:0 0 .33em .33em;z-index:2}._fluid_7gau9_649{display:flex;flex-direction:row;position:relative;text-align:center;margin:0 0 .5em;-webkit-user-select:none;user-select:none;-ms-user-select:none}._fluid_7gau9_649:last-child{margin-bottom:0}._fluid_7gau9_649 ._info_7gau9_661{display:flex;flex-direction:column;justify-content:center;flex:1}._fluid_7gau9_649 ._title_7gau9_667{font-weight:700;padding:.5em}._fluid_7gau9_649 ._title_7gau9_667._divider_7gau9_671{margin:0 .5em;border-bottom:.1666666667em solid rgba(255,255,255,.1)}._fluid_7gau9_649 ._contentFluid_7gau9_675{padding:.5em;color:#fff}._fluid_7gau9_649 ._container_7gau9_598{flex-direction:row;flex:1}._fluid_7gau9_649 ._container_7gau9_598._hasButtons_7gau9_683{border-radius:.33em 0 0 .33em;border-width:1px 0 1px 1px}._fluid_7gau9_649 ._image_7gau9_603{padding:0}._fluid_7gau9_649 ._buttonsContainer_7gau9_37{position:relative;left:inherit;bottom:inherit;border-radius:0 .33em .33em 0}._fluid_7gau9_649 ._buttonsContainer_7gau9_37._buttonsEmpty_7gau9_628{bottom:inherit}._fluid_7gau9_649 ._buttonsContainer_7gau9_37._buttonsAltContainer_7gau9_621{overflow:hidden;pointer-events:auto;top:inherit}._fluid_7gau9_649 ._buttonsContainer_7gau9_37._buttonsAltContainer_7gau9_621>*{border-top:1px solid rgba(255,255,255,.075)}._fluid_7gau9_649 ._buttonsContainer_7gau9_37._buttonsAltContainer_7gau9_621>*:first-child{border-top:0}._fluid_7gau9_649 ._buttonsContainer_7gau9_37>*{display:inline-flex;flex-direction:column;justify-content:center;text-align:center;white-space:pre-wrap;line-height:1.1666666667em;height:100%;border-left:1px solid rgba(255,255,255,.075)}
|
package/dist/components/Box.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export type EventHandlers = Partial<{
|
|
|
10
10
|
onKeyDown: KeyboardEventHandler<HTMLDivElement>;
|
|
11
11
|
onKeyUp: KeyboardEventHandler<HTMLDivElement>;
|
|
12
12
|
onMouseDown: MouseEventHandler<HTMLDivElement>;
|
|
13
|
+
onMouseLeave: MouseEventHandler<HTMLDivElement>;
|
|
13
14
|
onMouseMove: MouseEventHandler<HTMLDivElement>;
|
|
14
15
|
onMouseOver: MouseEventHandler<HTMLDivElement>;
|
|
15
16
|
onMouseUp: MouseEventHandler<HTMLDivElement>;
|
|
@@ -19,6 +20,7 @@ export type BoxProps = Partial<{
|
|
|
19
20
|
as: string;
|
|
20
21
|
children: ReactNode;
|
|
21
22
|
className: string | BooleanLike;
|
|
23
|
+
id: string;
|
|
22
24
|
style: CSSProperties;
|
|
23
25
|
}> & BooleanProps & StringProps & EventHandlers;
|
|
24
26
|
type DangerDoNotUse = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as T, Fragment as N, jsx as F } from "react/jsx-runtime";
|
|
2
2
|
import { clamp as m } from "../common/math.js";
|
|
3
3
|
import { Component as b, createRef as I } from "react";
|
|
4
4
|
import { AnimatedNumber as M } from "./AnimatedNumber.js";
|
|
@@ -67,11 +67,9 @@ class C extends b {
|
|
|
67
67
|
this.suppressFlicker(), i && i(e, o), l && l(e, o);
|
|
68
68
|
else if (this.inputRef) {
|
|
69
69
|
const a = this.inputRef.current;
|
|
70
|
-
a.value = g
|
|
71
|
-
try {
|
|
70
|
+
a.value = g, setTimeout(() => {
|
|
72
71
|
a.focus(), a.select();
|
|
73
|
-
}
|
|
74
|
-
}
|
|
72
|
+
}, 10);
|
|
75
73
|
}
|
|
76
74
|
};
|
|
77
75
|
}
|
|
@@ -99,7 +97,7 @@ class C extends b {
|
|
|
99
97
|
} = this.props;
|
|
100
98
|
let d = o;
|
|
101
99
|
(u || l) && (d = i);
|
|
102
|
-
const E = /* @__PURE__ */ N
|
|
100
|
+
const E = /* @__PURE__ */ T(N, { children: [
|
|
103
101
|
s && !u && !l ? /* @__PURE__ */ F(M, { value: d, format: h }) : h ? h(d) : d,
|
|
104
102
|
g ? " " + g : ""
|
|
105
103
|
] }), x = /* @__PURE__ */ F(
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Placement } from '@popperjs/core';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { BooleanLike } from '../common/react';
|
|
4
|
+
import { BoxProps } from './Box';
|
|
5
|
+
|
|
6
|
+
type Props = Partial<{
|
|
7
|
+
/** Asset cache. Example: `asset={['assetname32x32', thing.key]}` */
|
|
8
|
+
asset: string[];
|
|
9
|
+
/** Classic way to put images. Example: `base64={thing.image}` */
|
|
10
|
+
base64: string;
|
|
11
|
+
/**
|
|
12
|
+
* Special container for buttons.
|
|
13
|
+
* You can put any other component here.
|
|
14
|
+
* Has some special stylings!
|
|
15
|
+
* Example: `buttons={<Button>Send</Button>}`
|
|
16
|
+
*/
|
|
17
|
+
buttons: ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Enables alternate layout for `buttons` container.
|
|
20
|
+
* Without fluid, buttons will be on top and with `pointer-events: none`, useful for text info.
|
|
21
|
+
* With fluid, buttons will be in "hamburger" style.
|
|
22
|
+
*/
|
|
23
|
+
buttonsAlt: boolean;
|
|
24
|
+
/** Content under image. Or on the right if fluid. */
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
/** Applies a CSS class to the element. */
|
|
27
|
+
className: string;
|
|
28
|
+
/** Color of the button. See [Button](#button) but without `transparent`. */
|
|
29
|
+
color: string;
|
|
30
|
+
/** Makes button disabled and dark red if true. Also disables onClick. */
|
|
31
|
+
disabled: BooleanLike;
|
|
32
|
+
/** Optional. Adds a "stub" when loading DmIcon. */
|
|
33
|
+
dmFallback: ReactNode;
|
|
34
|
+
/** Parameter `icon` of component `DmIcon`. */
|
|
35
|
+
dmIcon: string | null;
|
|
36
|
+
/** Parameter `icon_state` of component `DmIcon`. */
|
|
37
|
+
dmIconState: string | null;
|
|
38
|
+
/**
|
|
39
|
+
* Changes the layout of the button, making it fill the entire horizontally available space.
|
|
40
|
+
* Allows the use of `title`
|
|
41
|
+
*/
|
|
42
|
+
fluid: boolean;
|
|
43
|
+
/** Parameter responsible for the size of the image, component and standard "stubs". */
|
|
44
|
+
imageSize: number;
|
|
45
|
+
/** Prop `src` of Image component. Example: `imageSrc={resolveAsset(thing.image}` */
|
|
46
|
+
imageSrc: string;
|
|
47
|
+
/** Called when button is clicked with LMB. */
|
|
48
|
+
onClick: (e: any) => void;
|
|
49
|
+
/** Called when button is clicked with RMB. */
|
|
50
|
+
onRightClick: (e: any) => void;
|
|
51
|
+
/** Makes button selected and green if true. */
|
|
52
|
+
selected: BooleanLike;
|
|
53
|
+
/** Requires `fluid` for work. Bold text with divider betwen content. */
|
|
54
|
+
title: string;
|
|
55
|
+
/** A fancy, boxy tooltip, which appears when hovering over the button */
|
|
56
|
+
tooltip: ReactNode;
|
|
57
|
+
/** Position of the tooltip. See [`Popper`](#Popper) for valid options. */
|
|
58
|
+
tooltipPosition: Placement;
|
|
59
|
+
}> & BoxProps;
|
|
60
|
+
export declare function ImageButton(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { jsxs as d, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { classes as e } from "../common/react.js";
|
|
3
|
+
import { computeBoxProps as D } from "./Box.js";
|
|
4
|
+
import { DmIcon as F } from "./DmIcon.js";
|
|
5
|
+
import { Icon as E } from "./Icon.js";
|
|
6
|
+
import { Image as j } from "./Image.js";
|
|
7
|
+
import { Stack as I } from "./Stack.js";
|
|
8
|
+
import { Tooltip as z } from "./Tooltip.js";
|
|
9
|
+
import '../assets/ImageButton.css';const P = "_color__black_7gau9_18", q = "_contentColor__black_7gau9_29", M = "_buttonsContainerColor__black_7gau9_37", R = "_color__white_7gau9_45", T = "_contentColor__white_7gau9_56", G = "_buttonsContainerColor__white_7gau9_64", H = "_color__red_7gau9_72", J = "_contentColor__red_7gau9_83", K = "_buttonsContainerColor__red_7gau9_91", L = "_color__orange_7gau9_99", O = "_contentColor__orange_7gau9_110", Q = "_buttonsContainerColor__orange_7gau9_118", U = "_color__yellow_7gau9_126", V = "_contentColor__yellow_7gau9_137", W = "_buttonsContainerColor__yellow_7gau9_145", X = "_color__olive_7gau9_153", Y = "_contentColor__olive_7gau9_164", Z = "_buttonsContainerColor__olive_7gau9_172", oo = "_color__green_7gau9_180", to = "_contentColor__green_7gau9_191", _o = "_buttonsContainerColor__green_7gau9_199", no = "_color__teal_7gau9_207", eo = "_contentColor__teal_7gau9_218", ro = "_buttonsContainerColor__teal_7gau9_226", lo = "_color__blue_7gau9_234", ao = "_contentColor__blue_7gau9_245", co = "_buttonsContainerColor__blue_7gau9_253", so = "_color__violet_7gau9_261", io = "_contentColor__violet_7gau9_272", uo = "_buttonsContainerColor__violet_7gau9_280", Co = "_color__purple_7gau9_288", go = "_contentColor__purple_7gau9_299", bo = "_buttonsContainerColor__purple_7gau9_307", po = "_color__pink_7gau9_315", mo = "_contentColor__pink_7gau9_326", fo = "_buttonsContainerColor__pink_7gau9_334", ho = "_color__brown_7gau9_342", vo = "_contentColor__brown_7gau9_353", yo = "_buttonsContainerColor__brown_7gau9_361", wo = "_color__grey_7gau9_369", ko = "_contentColor__grey_7gau9_380", xo = "_buttonsContainerColor__grey_7gau9_388", Io = "_color__good_7gau9_423", $o = "_contentColor__good_7gau9_434", Ao = "_buttonsContainerColor__good_7gau9_442", Bo = "_color__average_7gau9_450", No = "_contentColor__average_7gau9_461", So = "_buttonsContainerColor__average_7gau9_469", Do = "_color__bad_7gau9_477", Fo = "_contentColor__bad_7gau9_488", Eo = "_buttonsContainerColor__bad_7gau9_496", jo = "_color__label_7gau9_504", zo = "_contentColor__label_7gau9_515", Po = "_buttonsContainerColor__label_7gau9_523", qo = "_color__default_7gau9_531", Mo = "_disabled_7gau9_542", Ro = "_selected_7gau9_547", To = "_contentColor__default_7gau9_558", Go = "_contentDisabled_7gau9_566", Ho = "_contentSelected_7gau9_571", Jo = "_buttonsContainerColor__default_7gau9_579", Ko = "_ImageButton_7gau9_587", Lo = "_noAction_7gau9_595", Oo = "_container_7gau9_598", Qo = "_image_7gau9_603", Uo = "_buttonsContainer_7gau9_37", Vo = "_buttonsAltContainer_7gau9_621", Wo = "_buttonsEmpty_7gau9_628", Xo = "_content_7gau9_29", Yo = "_fluid_7gau9_649", Zo = "_info_7gau9_661", ot = "_title_7gau9_667", tt = "_divider_7gau9_671", _t = "_contentFluid_7gau9_675", nt = "_hasButtons_7gau9_683", o = {
|
|
10
|
+
color__black: P,
|
|
11
|
+
contentColor__black: q,
|
|
12
|
+
buttonsContainerColor__black: M,
|
|
13
|
+
color__white: R,
|
|
14
|
+
contentColor__white: T,
|
|
15
|
+
buttonsContainerColor__white: G,
|
|
16
|
+
color__red: H,
|
|
17
|
+
contentColor__red: J,
|
|
18
|
+
buttonsContainerColor__red: K,
|
|
19
|
+
color__orange: L,
|
|
20
|
+
contentColor__orange: O,
|
|
21
|
+
buttonsContainerColor__orange: Q,
|
|
22
|
+
color__yellow: U,
|
|
23
|
+
contentColor__yellow: V,
|
|
24
|
+
buttonsContainerColor__yellow: W,
|
|
25
|
+
color__olive: X,
|
|
26
|
+
contentColor__olive: Y,
|
|
27
|
+
buttonsContainerColor__olive: Z,
|
|
28
|
+
color__green: oo,
|
|
29
|
+
contentColor__green: to,
|
|
30
|
+
buttonsContainerColor__green: _o,
|
|
31
|
+
color__teal: no,
|
|
32
|
+
contentColor__teal: eo,
|
|
33
|
+
buttonsContainerColor__teal: ro,
|
|
34
|
+
color__blue: lo,
|
|
35
|
+
contentColor__blue: ao,
|
|
36
|
+
buttonsContainerColor__blue: co,
|
|
37
|
+
color__violet: so,
|
|
38
|
+
contentColor__violet: io,
|
|
39
|
+
buttonsContainerColor__violet: uo,
|
|
40
|
+
color__purple: Co,
|
|
41
|
+
contentColor__purple: go,
|
|
42
|
+
buttonsContainerColor__purple: bo,
|
|
43
|
+
color__pink: po,
|
|
44
|
+
contentColor__pink: mo,
|
|
45
|
+
buttonsContainerColor__pink: fo,
|
|
46
|
+
color__brown: ho,
|
|
47
|
+
contentColor__brown: vo,
|
|
48
|
+
buttonsContainerColor__brown: yo,
|
|
49
|
+
color__grey: wo,
|
|
50
|
+
contentColor__grey: ko,
|
|
51
|
+
buttonsContainerColor__grey: xo,
|
|
52
|
+
"color__light-grey": "_color__light-grey_7gau9_396",
|
|
53
|
+
"contentColor__light-grey": "_contentColor__light-grey_7gau9_407",
|
|
54
|
+
"buttonsContainerColor__light-grey": "_buttonsContainerColor__light-grey_7gau9_415",
|
|
55
|
+
color__good: Io,
|
|
56
|
+
contentColor__good: $o,
|
|
57
|
+
buttonsContainerColor__good: Ao,
|
|
58
|
+
color__average: Bo,
|
|
59
|
+
contentColor__average: No,
|
|
60
|
+
buttonsContainerColor__average: So,
|
|
61
|
+
color__bad: Do,
|
|
62
|
+
contentColor__bad: Fo,
|
|
63
|
+
buttonsContainerColor__bad: Eo,
|
|
64
|
+
color__label: jo,
|
|
65
|
+
contentColor__label: zo,
|
|
66
|
+
buttonsContainerColor__label: Po,
|
|
67
|
+
color__default: qo,
|
|
68
|
+
disabled: Mo,
|
|
69
|
+
selected: Ro,
|
|
70
|
+
contentColor__default: To,
|
|
71
|
+
contentDisabled: Go,
|
|
72
|
+
contentSelected: Ho,
|
|
73
|
+
buttonsContainerColor__default: Jo,
|
|
74
|
+
ImageButton: Ko,
|
|
75
|
+
noAction: Lo,
|
|
76
|
+
container: Oo,
|
|
77
|
+
image: Qo,
|
|
78
|
+
buttonsContainer: Uo,
|
|
79
|
+
buttonsAltContainer: Vo,
|
|
80
|
+
buttonsEmpty: Wo,
|
|
81
|
+
content: Xo,
|
|
82
|
+
fluid: Yo,
|
|
83
|
+
info: Zo,
|
|
84
|
+
title: ot,
|
|
85
|
+
divider: tt,
|
|
86
|
+
contentFluid: _t,
|
|
87
|
+
hasButtons: nt
|
|
88
|
+
};
|
|
89
|
+
function Ct($) {
|
|
90
|
+
const {
|
|
91
|
+
asset: p,
|
|
92
|
+
base64: s,
|
|
93
|
+
buttons: i,
|
|
94
|
+
buttonsAlt: m,
|
|
95
|
+
children: r,
|
|
96
|
+
className: A,
|
|
97
|
+
color: _,
|
|
98
|
+
disabled: a,
|
|
99
|
+
dmFallback: f,
|
|
100
|
+
dmIcon: h,
|
|
101
|
+
dmIconState: v,
|
|
102
|
+
fluid: c,
|
|
103
|
+
imageSize: n = 64,
|
|
104
|
+
imageSrc: u,
|
|
105
|
+
onClick: C,
|
|
106
|
+
onRightClick: g,
|
|
107
|
+
selected: y,
|
|
108
|
+
title: w,
|
|
109
|
+
tooltip: k,
|
|
110
|
+
tooltipPosition: B,
|
|
111
|
+
...N
|
|
112
|
+
} = $;
|
|
113
|
+
function x(l, S) {
|
|
114
|
+
return /* @__PURE__ */ t(I, { height: `${n}px`, width: `${n}px`, children: /* @__PURE__ */ t(I.Item, { grow: !0, textAlign: "center", align: "center", children: /* @__PURE__ */ t(
|
|
115
|
+
E,
|
|
116
|
+
{
|
|
117
|
+
spin: S,
|
|
118
|
+
name: l,
|
|
119
|
+
color: "gray",
|
|
120
|
+
style: { fontSize: `calc(${n}px * 0.75)` }
|
|
121
|
+
}
|
|
122
|
+
) }) });
|
|
123
|
+
}
|
|
124
|
+
let b = /* @__PURE__ */ d(
|
|
125
|
+
"div",
|
|
126
|
+
{
|
|
127
|
+
className: e([
|
|
128
|
+
o.container,
|
|
129
|
+
i && o.hasButtons,
|
|
130
|
+
!C && !g && o.noAction,
|
|
131
|
+
y && o.selected,
|
|
132
|
+
a && o.disabled,
|
|
133
|
+
_ && typeof _ == "string" ? o["color__" + _] : o.color__default
|
|
134
|
+
]),
|
|
135
|
+
tabIndex: a ? void 0 : 0,
|
|
136
|
+
onClick: (l) => {
|
|
137
|
+
!a && C && C(l);
|
|
138
|
+
},
|
|
139
|
+
onContextMenu: (l) => {
|
|
140
|
+
l.preventDefault(), !a && g && g(l);
|
|
141
|
+
},
|
|
142
|
+
style: { width: c ? "auto" : `calc(${n}px + 0.5em + 2px)` },
|
|
143
|
+
children: [
|
|
144
|
+
/* @__PURE__ */ t("div", { className: e([o.image]), children: s || p || u ? /* @__PURE__ */ t(
|
|
145
|
+
j,
|
|
146
|
+
{
|
|
147
|
+
className: e(!s && !u && p || []),
|
|
148
|
+
src: s ? `data:image/png;base64,${s}` : u,
|
|
149
|
+
height: `${n}px`,
|
|
150
|
+
width: `${n}px`
|
|
151
|
+
}
|
|
152
|
+
) : h && v ? /* @__PURE__ */ t(
|
|
153
|
+
F,
|
|
154
|
+
{
|
|
155
|
+
icon: h,
|
|
156
|
+
icon_state: v,
|
|
157
|
+
fallback: f || x("spinner", !0),
|
|
158
|
+
height: `${n}px`,
|
|
159
|
+
width: `${n}px`
|
|
160
|
+
}
|
|
161
|
+
) : x("question", !1) }),
|
|
162
|
+
c ? /* @__PURE__ */ d("div", { className: e([o.info]), children: [
|
|
163
|
+
w && /* @__PURE__ */ t(
|
|
164
|
+
"span",
|
|
165
|
+
{
|
|
166
|
+
className: e([o.title, r && o.divider]),
|
|
167
|
+
children: w
|
|
168
|
+
}
|
|
169
|
+
),
|
|
170
|
+
r && /* @__PURE__ */ t("span", { className: e([o.contentFluid]), children: r })
|
|
171
|
+
] }) : r && /* @__PURE__ */ t(
|
|
172
|
+
"span",
|
|
173
|
+
{
|
|
174
|
+
className: e([
|
|
175
|
+
o.content,
|
|
176
|
+
y && o.contentSelected,
|
|
177
|
+
a && o.contentDisabled,
|
|
178
|
+
_ && typeof _ == "string" ? o["contentColor__" + _] : o.contentColor__default
|
|
179
|
+
]),
|
|
180
|
+
children: r
|
|
181
|
+
}
|
|
182
|
+
)
|
|
183
|
+
]
|
|
184
|
+
}
|
|
185
|
+
);
|
|
186
|
+
return k && (b = /* @__PURE__ */ t(z, { content: k, position: B, children: b })), /* @__PURE__ */ d(
|
|
187
|
+
"div",
|
|
188
|
+
{
|
|
189
|
+
className: e([
|
|
190
|
+
o.ImageButton,
|
|
191
|
+
c && o.fluid,
|
|
192
|
+
A
|
|
193
|
+
]),
|
|
194
|
+
...D(N),
|
|
195
|
+
children: [
|
|
196
|
+
b,
|
|
197
|
+
i && /* @__PURE__ */ t(
|
|
198
|
+
"div",
|
|
199
|
+
{
|
|
200
|
+
className: e([
|
|
201
|
+
o.buttonsContainer,
|
|
202
|
+
m && o.buttonsAltContainer,
|
|
203
|
+
!r && o.buttonsEmpty,
|
|
204
|
+
c && _ && typeof _ == "string" ? o["buttonsContainerColor__" + _] : c && o.buttonsContainerColor__default
|
|
205
|
+
]),
|
|
206
|
+
style: {
|
|
207
|
+
width: m ? `calc(${n}px + 0.5em)` : "auto"
|
|
208
|
+
},
|
|
209
|
+
children: i
|
|
210
|
+
}
|
|
211
|
+
)
|
|
212
|
+
]
|
|
213
|
+
}
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
export {
|
|
217
|
+
Ct as ImageButton
|
|
218
|
+
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import '../assets/NumberInput.css';var N = Object.defineProperty;
|
|
2
2
|
var w = (c, d, e) => d in c ? N(c, d, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[d] = e;
|
|
3
3
|
var l = (c, d, e) => w(c, typeof d != "symbol" ? d + "" : d, e);
|
|
4
|
-
import { jsxs as _, jsx as
|
|
4
|
+
import { jsxs as _, jsx as V } from "react/jsx-runtime";
|
|
5
5
|
import { Component as E, createRef as I } from "react";
|
|
6
|
-
import { KEY as D, isEscape as
|
|
7
|
-
import { clamp as
|
|
6
|
+
import { KEY as D, isEscape as M } from "../common/keys.js";
|
|
7
|
+
import { clamp as g, round as T } from "../common/math.js";
|
|
8
8
|
import { classes as F } from "../common/react.js";
|
|
9
|
-
import { AnimatedNumber as
|
|
10
|
-
import { Box as
|
|
11
|
-
const B = "_numberInput_4xyrw_20", K = "_fluid_4xyrw_36", L = "_content_4xyrw_40",
|
|
9
|
+
import { AnimatedNumber as R } from "./AnimatedNumber.js";
|
|
10
|
+
import { Box as Y } from "./Box.js";
|
|
11
|
+
const B = "_numberInput_4xyrw_20", K = "_fluid_4xyrw_36", L = "_content_4xyrw_40", z = "_barContainer_4xyrw_44", j = "_bar_4xyrw_44", k = "_inner_4xyrw_61", p = {
|
|
12
12
|
numberInput: B,
|
|
13
13
|
fluid: K,
|
|
14
14
|
content: L,
|
|
15
|
-
barContainer:
|
|
15
|
+
barContainer: z,
|
|
16
16
|
bar: j,
|
|
17
17
|
inner: k
|
|
18
18
|
};
|
|
19
|
-
class
|
|
19
|
+
class J extends E {
|
|
20
20
|
constructor(e) {
|
|
21
21
|
super(e);
|
|
22
22
|
// Ref to the input field to set focus & highlight
|
|
@@ -34,74 +34,74 @@ class q extends E {
|
|
|
34
34
|
origin: 0
|
|
35
35
|
});
|
|
36
36
|
l(this, "handleDragStart", (e) => {
|
|
37
|
-
const { value:
|
|
38
|
-
if (
|
|
37
|
+
const { value: o, disabled: a } = this.props, { editing: s } = this.state;
|
|
38
|
+
if (a || s)
|
|
39
39
|
return;
|
|
40
40
|
document.body.style["pointer-events"] = "none";
|
|
41
|
-
const
|
|
41
|
+
const r = parseFloat(o.toString());
|
|
42
42
|
this.setState({
|
|
43
43
|
dragging: !1,
|
|
44
44
|
origin: e.screenY,
|
|
45
|
-
currentValue:
|
|
46
|
-
previousValue:
|
|
45
|
+
currentValue: r,
|
|
46
|
+
previousValue: r
|
|
47
47
|
}), this.dragTimeout = setTimeout(() => {
|
|
48
48
|
this.setState({
|
|
49
49
|
dragging: !0
|
|
50
50
|
});
|
|
51
51
|
}, 250), this.dragInterval = setInterval(() => {
|
|
52
|
-
const { dragging:
|
|
53
|
-
|
|
54
|
-
previousValue:
|
|
55
|
-
}),
|
|
52
|
+
const { dragging: u, currentValue: i, previousValue: t } = this.state, { onDrag: n } = this.props;
|
|
53
|
+
u && i !== t && (this.setState({
|
|
54
|
+
previousValue: i
|
|
55
|
+
}), n == null || n(i));
|
|
56
56
|
}, 400), document.addEventListener("mousemove", this.handleDragMove), document.addEventListener("mouseup", this.handleDragEnd);
|
|
57
57
|
});
|
|
58
58
|
l(this, "handleDragMove", (e) => {
|
|
59
|
-
const { minValue:
|
|
60
|
-
|
|
61
|
-
const t = { ...
|
|
62
|
-
if (
|
|
63
|
-
const f =
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
a
|
|
67
|
-
|
|
68
|
-
)
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
), t.origin = e.screenY;
|
|
73
|
-
} else Math.abs(
|
|
59
|
+
const { minValue: o, maxValue: a, step: s, stepPixelSize: r, disabled: u } = this.props;
|
|
60
|
+
u || this.setState((i) => {
|
|
61
|
+
const t = { ...i }, n = t.origin - e.screenY;
|
|
62
|
+
if (i.dragging) {
|
|
63
|
+
const f = r || 1, m = g(
|
|
64
|
+
t.currentValue + n * s / f,
|
|
65
|
+
o - s,
|
|
66
|
+
a + s
|
|
67
|
+
);
|
|
68
|
+
Math.abs(m - t.currentValue) >= s ? (t.currentValue = g(
|
|
69
|
+
T(m / s, 0) * s,
|
|
70
|
+
o,
|
|
71
|
+
a
|
|
72
|
+
), t.origin = e.screenY) : Math.abs(n) > f && (t.origin = e.screenY);
|
|
73
|
+
} else Math.abs(n) > 4 && (t.dragging = !0);
|
|
74
74
|
return t;
|
|
75
75
|
});
|
|
76
76
|
});
|
|
77
77
|
l(this, "handleDragEnd", (e) => {
|
|
78
|
-
const { dragging:
|
|
79
|
-
if (!
|
|
78
|
+
const { dragging: o, currentValue: a } = this.state, { onDrag: s, onChange: r, disabled: u } = this.props;
|
|
79
|
+
if (!u) {
|
|
80
80
|
if (document.body.style["pointer-events"] = "auto", clearInterval(this.dragInterval), clearTimeout(this.dragTimeout), this.setState({
|
|
81
81
|
dragging: !1,
|
|
82
|
-
editing: !
|
|
83
|
-
previousValue:
|
|
84
|
-
}),
|
|
85
|
-
|
|
82
|
+
editing: !o,
|
|
83
|
+
previousValue: a
|
|
84
|
+
}), o)
|
|
85
|
+
r == null || r(a), s == null || s(a);
|
|
86
86
|
else if (this.inputRef) {
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
},
|
|
87
|
+
const i = this.inputRef.current;
|
|
88
|
+
i && (i.value = `${a}`, setTimeout(() => {
|
|
89
|
+
i.focus(), i.select();
|
|
90
|
+
}, 10));
|
|
91
91
|
}
|
|
92
92
|
document.removeEventListener("mousemove", this.handleDragMove), document.removeEventListener("mouseup", this.handleDragEnd);
|
|
93
93
|
}
|
|
94
94
|
});
|
|
95
95
|
l(this, "handleBlur", (e) => {
|
|
96
|
-
const { editing:
|
|
97
|
-
if (t || !
|
|
96
|
+
const { editing: o, previousValue: a } = this.state, { minValue: s, maxValue: r, onChange: u, onDrag: i, disabled: t } = this.props;
|
|
97
|
+
if (t || !o)
|
|
98
98
|
return;
|
|
99
|
-
const
|
|
99
|
+
const n = g(
|
|
100
100
|
parseFloat(e.target.value),
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
s,
|
|
102
|
+
r
|
|
103
103
|
);
|
|
104
|
-
if (isNaN(
|
|
104
|
+
if (isNaN(n)) {
|
|
105
105
|
this.setState({
|
|
106
106
|
editing: !1
|
|
107
107
|
});
|
|
@@ -109,20 +109,20 @@ class q extends E {
|
|
|
109
109
|
}
|
|
110
110
|
this.setState({
|
|
111
111
|
editing: !1,
|
|
112
|
-
currentValue:
|
|
113
|
-
previousValue:
|
|
114
|
-
}),
|
|
112
|
+
currentValue: n,
|
|
113
|
+
previousValue: n
|
|
114
|
+
}), a !== n && (u == null || u(n), i == null || i(n));
|
|
115
115
|
});
|
|
116
116
|
l(this, "handleKeyDown", (e) => {
|
|
117
|
-
const { minValue:
|
|
118
|
-
if (
|
|
117
|
+
const { minValue: o, maxValue: a, onChange: s, onDrag: r, disabled: u } = this.props;
|
|
118
|
+
if (u)
|
|
119
119
|
return;
|
|
120
|
-
const { previousValue:
|
|
120
|
+
const { previousValue: i } = this.state;
|
|
121
121
|
if (e.key === D.Enter) {
|
|
122
|
-
const t =
|
|
122
|
+
const t = g(
|
|
123
123
|
parseFloat(e.currentTarget.value),
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
o,
|
|
125
|
+
a
|
|
126
126
|
);
|
|
127
127
|
if (isNaN(t)) {
|
|
128
128
|
this.setState({
|
|
@@ -134,8 +134,8 @@ class q extends E {
|
|
|
134
134
|
editing: !1,
|
|
135
135
|
currentValue: t,
|
|
136
136
|
previousValue: t
|
|
137
|
-
}),
|
|
138
|
-
} else
|
|
137
|
+
}), i !== t && (s == null || s(t), r == null || r(t));
|
|
138
|
+
} else M(e.key) && this.setState({
|
|
139
139
|
editing: !1
|
|
140
140
|
});
|
|
141
141
|
});
|
|
@@ -148,47 +148,47 @@ class q extends E {
|
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
150
|
render() {
|
|
151
|
-
const { dragging: e, editing:
|
|
152
|
-
className:
|
|
153
|
-
fluid:
|
|
154
|
-
animated:
|
|
155
|
-
unit:
|
|
151
|
+
const { dragging: e, editing: o, currentValue: a } = this.state, {
|
|
152
|
+
className: s,
|
|
153
|
+
fluid: r,
|
|
154
|
+
animated: u,
|
|
155
|
+
unit: i,
|
|
156
156
|
value: t,
|
|
157
|
-
minValue:
|
|
157
|
+
minValue: n,
|
|
158
158
|
maxValue: f,
|
|
159
|
-
height:
|
|
159
|
+
height: m,
|
|
160
160
|
width: S,
|
|
161
161
|
lineHeight: b,
|
|
162
162
|
fontSize: y,
|
|
163
|
-
format:
|
|
163
|
+
format: v
|
|
164
164
|
} = this.props;
|
|
165
|
-
let
|
|
166
|
-
e && (
|
|
165
|
+
let h = parseFloat(t.toString());
|
|
166
|
+
e && (h = a);
|
|
167
167
|
const x = /* @__PURE__ */ _("div", { className: p.content, children: [
|
|
168
|
-
|
|
169
|
-
|
|
168
|
+
u && !e ? /* @__PURE__ */ V(R, { value: h, format: v }) : v ? v(h) : h,
|
|
169
|
+
i ? " " + i : ""
|
|
170
170
|
] });
|
|
171
171
|
return /* @__PURE__ */ _(
|
|
172
|
-
|
|
172
|
+
Y,
|
|
173
173
|
{
|
|
174
174
|
className: F([
|
|
175
175
|
p.numberInput,
|
|
176
|
-
|
|
177
|
-
|
|
176
|
+
r && p.fluid,
|
|
177
|
+
s
|
|
178
178
|
]),
|
|
179
179
|
minWidth: S,
|
|
180
|
-
minHeight:
|
|
180
|
+
minHeight: m,
|
|
181
181
|
lineHeight: b,
|
|
182
182
|
fontSize: y,
|
|
183
183
|
onMouseDown: this.handleDragStart,
|
|
184
184
|
children: [
|
|
185
|
-
/* @__PURE__ */
|
|
185
|
+
/* @__PURE__ */ V("div", { className: p.barContainer, children: /* @__PURE__ */ V(
|
|
186
186
|
"div",
|
|
187
187
|
{
|
|
188
188
|
className: p.bar,
|
|
189
189
|
style: {
|
|
190
|
-
height:
|
|
191
|
-
(
|
|
190
|
+
height: g(
|
|
191
|
+
(h - n) / (f - n) * 100,
|
|
192
192
|
0,
|
|
193
193
|
100
|
|
194
194
|
) + "%"
|
|
@@ -196,14 +196,14 @@ class q extends E {
|
|
|
196
196
|
}
|
|
197
197
|
) }),
|
|
198
198
|
x,
|
|
199
|
-
/* @__PURE__ */
|
|
199
|
+
/* @__PURE__ */ V(
|
|
200
200
|
"input",
|
|
201
201
|
{
|
|
202
202
|
ref: this.inputRef,
|
|
203
203
|
className: p.inner,
|
|
204
204
|
style: {
|
|
205
|
-
display:
|
|
206
|
-
height:
|
|
205
|
+
display: o ? "inline" : "none",
|
|
206
|
+
height: m,
|
|
207
207
|
lineHeight: b,
|
|
208
208
|
fontSize: y
|
|
209
209
|
},
|
|
@@ -217,5 +217,5 @@ class q extends E {
|
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
export {
|
|
220
|
-
|
|
220
|
+
J as NumberInput
|
|
221
221
|
};
|
|
@@ -15,6 +15,8 @@ type Props = {
|
|
|
15
15
|
className: string;
|
|
16
16
|
/** Color of the slider. */
|
|
17
17
|
color: string;
|
|
18
|
+
/** Disables the slider. */
|
|
19
|
+
disabled: boolean;
|
|
18
20
|
/** If set, this value will be used to set the fill percentage of the progress bar filler independently of the main value. */
|
|
19
21
|
fillValue: number;
|
|
20
22
|
/** Format value using this function before displaying it. */
|
|
@@ -24,6 +24,7 @@ export declare const TextArea: import('react').ForwardRefExoticComponent<Partial
|
|
|
24
24
|
as: string;
|
|
25
25
|
children: import('react').ReactNode;
|
|
26
26
|
className: string | import('../common/react').BooleanLike;
|
|
27
|
+
id: string;
|
|
27
28
|
style: import('react').CSSProperties;
|
|
28
29
|
}> & Partial<Record<"bold" | "italic" | "nowrap" | "fillPositionedParent" | "inline" | "preserveWhitespace", boolean>> & Partial<Record<"fontWeight" | "textAlign" | "bottom" | "fontFamily" | "fontSize" | "height" | "left" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "overflow" | "overflowX" | "overflowY" | "position" | "right" | "top" | "verticalAlign" | "width" | "color" | "backgroundColor" | "align" | "lineHeight" | "m" | "mb" | "ml" | "mr" | "mt" | "mx" | "my" | "p" | "pb" | "pl" | "pr" | "pt" | "px" | "py" | "textColor", string | import('../common/react').BooleanLike>> & Partial<{
|
|
29
30
|
onClick: import('react').MouseEventHandler<HTMLDivElement>;
|
|
@@ -32,6 +33,7 @@ export declare const TextArea: import('react').ForwardRefExoticComponent<Partial
|
|
|
32
33
|
onKeyDown: import('react').KeyboardEventHandler<HTMLDivElement>;
|
|
33
34
|
onKeyUp: import('react').KeyboardEventHandler<HTMLDivElement>;
|
|
34
35
|
onMouseDown: import('react').MouseEventHandler<HTMLDivElement>;
|
|
36
|
+
onMouseLeave: import('react').MouseEventHandler<HTMLDivElement>;
|
|
35
37
|
onMouseMove: import('react').MouseEventHandler<HTMLDivElement>;
|
|
36
38
|
onMouseOver: import('react').MouseEventHandler<HTMLDivElement>;
|
|
37
39
|
onMouseUp: import('react').MouseEventHandler<HTMLDivElement>;
|
|
@@ -18,6 +18,7 @@ export { FitText } from './FitText';
|
|
|
18
18
|
export { Flex } from './Flex';
|
|
19
19
|
export { Icon } from './Icon';
|
|
20
20
|
export { Image } from './Image';
|
|
21
|
+
export { ImageButton } from './ImageButton';
|
|
21
22
|
export { InfinitePlane } from './InfinitePlane';
|
|
22
23
|
export { Input } from './Input';
|
|
23
24
|
export { KeyListener } from './KeyListener';
|
package/dist/components/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { AnimatedNumber as e } from "./AnimatedNumber.js";
|
|
2
|
-
import { Autofocus as
|
|
2
|
+
import { Autofocus as m } from "./Autofocus.js";
|
|
3
3
|
import { Blink as x } from "./Blink.js";
|
|
4
4
|
import { BlockQuote as i } from "./BlockQuote.js";
|
|
5
|
-
import { Box as
|
|
5
|
+
import { Box as l } from "./Box.js";
|
|
6
6
|
import { Button as u } from "./Button.js";
|
|
7
7
|
import { ByondUi as c } from "./ByondUi.js";
|
|
8
8
|
import { Chart as b } from "./Chart.js";
|
|
9
|
-
import { Collapsible as
|
|
10
|
-
import { ColorBox as
|
|
9
|
+
import { Collapsible as I } from "./Collapsible.js";
|
|
10
|
+
import { ColorBox as D } from "./ColorBox.js";
|
|
11
11
|
import { Dialog as C } from "./Dialog.js";
|
|
12
12
|
import { Dimmer as L } from "./Dimmer.js";
|
|
13
13
|
import { Divider as y } from "./Divider.js";
|
|
@@ -18,42 +18,43 @@ import { FitText as h } from "./FitText.js";
|
|
|
18
18
|
import { Flex as w } from "./Flex.js";
|
|
19
19
|
import { Icon as O } from "./Icon.js";
|
|
20
20
|
import { Image as U } from "./Image.js";
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
21
|
+
import { ImageButton as j } from "./ImageButton.js";
|
|
22
|
+
import { InfinitePlane as z } from "./InfinitePlane.js";
|
|
23
|
+
import { Input as H } from "./Input.js";
|
|
24
|
+
import { KeyListener as W } from "./KeyListener.js";
|
|
25
|
+
import { Knob as Y } from "./Knob.js";
|
|
26
|
+
import { LabeledControls as _ } from "./LabeledControls.js";
|
|
27
|
+
import { LabeledList as oo } from "./LabeledList.js";
|
|
28
|
+
import { MenuBar as eo } from "./MenuBar.js";
|
|
29
|
+
import { Modal as mo } from "./Modal.js";
|
|
30
|
+
import { NoticeBox as xo } from "./NoticeBox.js";
|
|
31
|
+
import { NumberInput as io } from "./NumberInput.js";
|
|
32
|
+
import { Popper as lo } from "./Popper.js";
|
|
33
|
+
import { ProgressBar as uo } from "./ProgressBar.js";
|
|
34
|
+
import { RestrictedInput as co } from "./RestrictedInput.js";
|
|
35
|
+
import { RoundGauge as Bo } from "./RoundGauge.js";
|
|
36
|
+
import { Section as go } from "./Section.js";
|
|
37
|
+
import { Slider as To } from "./Slider.js";
|
|
38
|
+
import { Stack as ko } from "./Stack.js";
|
|
39
|
+
import { StyleableSection as So } from "./StyleableSection.js";
|
|
40
|
+
import { Table as Ao } from "./Table.js";
|
|
41
|
+
import { Tabs as Po } from "./Tabs.js";
|
|
42
|
+
import { TextArea as Ko } from "./TextArea.js";
|
|
43
|
+
import { TimeDisplay as Ro } from "./TimeDisplay.js";
|
|
44
|
+
import { Tooltip as vo } from "./Tooltip.js";
|
|
45
|
+
import { TrackOutsideClicks as Go } from "./TrackOutsideClicks.js";
|
|
46
|
+
import { VirtualList as Qo } from "./VirtualList.js";
|
|
46
47
|
export {
|
|
47
48
|
e as AnimatedNumber,
|
|
48
|
-
|
|
49
|
+
m as Autofocus,
|
|
49
50
|
x as Blink,
|
|
50
51
|
i as BlockQuote,
|
|
51
|
-
|
|
52
|
+
l as Box,
|
|
52
53
|
u as Button,
|
|
53
54
|
c as ByondUi,
|
|
54
55
|
b as Chart,
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
I as Collapsible,
|
|
57
|
+
D as ColorBox,
|
|
57
58
|
C as Dialog,
|
|
58
59
|
L as Dimmer,
|
|
59
60
|
y as Divider,
|
|
@@ -64,29 +65,30 @@ export {
|
|
|
64
65
|
w as Flex,
|
|
65
66
|
O as Icon,
|
|
66
67
|
U as Image,
|
|
67
|
-
j as
|
|
68
|
-
z as
|
|
69
|
-
H as
|
|
70
|
-
W as
|
|
71
|
-
Y as
|
|
72
|
-
_ as
|
|
73
|
-
oo as
|
|
74
|
-
eo as
|
|
75
|
-
|
|
76
|
-
xo as
|
|
77
|
-
io as
|
|
78
|
-
|
|
79
|
-
uo as
|
|
80
|
-
co as
|
|
81
|
-
Bo as
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
ko as
|
|
85
|
-
So as
|
|
86
|
-
Ao as
|
|
87
|
-
Po as
|
|
88
|
-
Ko as
|
|
89
|
-
Ro as
|
|
90
|
-
vo as
|
|
91
|
-
Go as
|
|
68
|
+
j as ImageButton,
|
|
69
|
+
z as InfinitePlane,
|
|
70
|
+
H as Input,
|
|
71
|
+
W as KeyListener,
|
|
72
|
+
Y as Knob,
|
|
73
|
+
_ as LabeledControls,
|
|
74
|
+
oo as LabeledList,
|
|
75
|
+
eo as MenuBar,
|
|
76
|
+
mo as Modal,
|
|
77
|
+
xo as NoticeBox,
|
|
78
|
+
io as NumberInput,
|
|
79
|
+
lo as Popper,
|
|
80
|
+
uo as ProgressBar,
|
|
81
|
+
co as RestrictedInput,
|
|
82
|
+
Bo as RoundGauge,
|
|
83
|
+
go as Section,
|
|
84
|
+
To as Slider,
|
|
85
|
+
ko as Stack,
|
|
86
|
+
So as StyleableSection,
|
|
87
|
+
Ao as Table,
|
|
88
|
+
Po as Tabs,
|
|
89
|
+
Ko as TextArea,
|
|
90
|
+
Ro as TimeDisplay,
|
|
91
|
+
vo as Tooltip,
|
|
92
|
+
Go as TrackOutsideClicks,
|
|
93
|
+
Qo as VirtualList
|
|
92
94
|
};
|