tgui-core 1.1.23 → 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/Section.module-qhQWhlUX.js +18 -0
- package/dist/assets/ImageButton.css +5 -0
- package/dist/assets/Section.css +1 -1
- package/dist/components/Box.d.ts +2 -0
- package/dist/components/Button.d.ts +2 -0
- package/dist/components/Button.js +178 -175
- package/dist/components/Collapsible.d.ts +2 -0
- package/dist/components/Collapsible.js +24 -16
- 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/Input.js +47 -41
- package/dist/components/NoticeBox.d.ts +4 -1
- package/dist/components/NoticeBox.js +31 -30
- package/dist/components/NumberInput.js +99 -99
- package/dist/components/Section.d.ts +27 -34
- package/dist/components/Section.js +67 -60
- package/dist/components/Slider.d.ts +2 -0
- package/dist/components/StyleableSection.js +1 -1
- package/dist/components/Tabs.d.ts +1 -0
- package/dist/components/Tabs.js +69 -64
- package/dist/components/TextArea.d.ts +2 -0
- package/dist/components/TextArea.js +36 -36
- package/dist/components/TimeDisplay.js +8 -8
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +60 -58
- package/package.json +1 -1
- package/dist/Section.module-CLVHJ4yA.js +0 -15
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import './assets/Section.css';const t = "_section_10c68_17", _ = "_title_10c68_28", n = "_titleText_10c68_34", o = "_buttons_10c68_40", c = "_rest_10c68_47", e = "_content_10c68_51", s = "_fitted_10c68_55", l = "_fill_10c68_59", i = "_scrollable_10c68_73", r = "_scrollableHorizontal_10c68_90", a = "_section__flex_10c68_125", b = "_content__noTopPadding_10c68_135", d = "_content__stretchContents_10c68_139", f = {
|
|
2
|
+
section: t,
|
|
3
|
+
title: _,
|
|
4
|
+
titleText: n,
|
|
5
|
+
buttons: o,
|
|
6
|
+
rest: c,
|
|
7
|
+
content: e,
|
|
8
|
+
fitted: s,
|
|
9
|
+
fill: l,
|
|
10
|
+
scrollable: i,
|
|
11
|
+
scrollableHorizontal: r,
|
|
12
|
+
section__flex: a,
|
|
13
|
+
content__noTopPadding: b,
|
|
14
|
+
content__stretchContents: d
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
f as s
|
|
18
|
+
};
|
|
@@ -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/assets/Section.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._section_10c68_17{position:relative;margin-bottom:.5em;background-color:#191919;background-color:#00000054;box-sizing:border-box}._section_10c68_17:last-child{margin-bottom:0}._title_10c68_28{position:relative;padding:.5em;border-bottom:.1666666667em solid #4972a1}._titleText_10c68_34{font-size:1.1666666667em;font-weight:700;color:#fff}._buttons_10c68_40{position:absolute;display:inline-block;right:.5em;margin-top:-.0833333333em}._rest_10c68_47{position:relative}._content_10c68_51{padding:.66em .5em}._fitted_10c68_55>._rest_10c68_47>._content_10c68_51{padding:0}._fill_10c68_59{display:flex;flex-direction:column;height:100%}._fill_10c68_59>._rest_10c68_47{flex-grow:1}._fill_10c68_59>._rest_10c68_47>._content_10c68_51{height:100%}._fill_10c68_59._scrollable_10c68_73>._rest_10c68_47>._content_10c68_51{position:absolute;top:0;left:0;right:0;bottom:0}._scrollable_10c68_73{overflow-x:hidden;overflow-y:hidden}._scrollable_10c68_73>._rest_10c68_47>._content_10c68_51{overflow-y:scroll;overflow-x:hidden}._scrollableHorizontal_10c68_90{overflow-x:hidden;overflow-y:hidden}._scrollableHorizontal_10c68_90>._rest_10c68_47>._content_10c68_51{overflow-y:hidden;overflow-x:scroll}._scrollable_10c68_73._scrollableHorizontal_10c68_90{overflow-x:hidden;overflow-y:hidden}._scrollable_10c68_73._scrollableHorizontal_10c68_90>._rest_10c68_47>._content_10c68_51{overflow-y:scroll;overflow-x:scroll}._section_10c68_17 ._section_10c68_17{background-color:transparent;margin-left:-.5em;margin-right:-.5em}._section_10c68_17 ._section_10c68_17:first-child{margin-top:-.5em}._section_10c68_17 ._section_10c68_17 ._titleText_10c68_34{font-size:1.0833333333em}._section_10c68_17 ._section_10c68_17 ._section_10c68_17 ._titleText_10c68_34{font-size:1em}._section__flex_10c68_125{display:flex;flex-flow:column}._section__flex_10c68_125 ._content_10c68_51{overflow:auto;flex-grow:1}._content__noTopPadding_10c68_135{padding-top:0}._content__stretchContents_10c68_139{height:calc(100% - 3rem)}
|
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,267 +1,270 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { KEY as
|
|
4
|
-
import { classes as
|
|
5
|
-
import { computeBoxClassName as
|
|
6
|
-
import { Icon as
|
|
7
|
-
import { Tooltip as
|
|
8
|
-
import '../assets/Button.css';const
|
|
9
|
-
button:
|
|
10
|
-
fa:
|
|
11
|
-
fas:
|
|
12
|
-
far:
|
|
13
|
-
dropdown:
|
|
14
|
-
ellipsis:
|
|
15
|
-
fluid:
|
|
16
|
-
circular:
|
|
17
|
-
compact:
|
|
18
|
-
color__black:
|
|
19
|
-
color__white:
|
|
20
|
-
color__red:
|
|
21
|
-
color__orange:
|
|
22
|
-
color__yellow:
|
|
23
|
-
color__olive:
|
|
24
|
-
color__green:
|
|
25
|
-
color__teal:
|
|
26
|
-
color__blue:
|
|
27
|
-
color__violet:
|
|
28
|
-
color__purple:
|
|
29
|
-
color__pink:
|
|
30
|
-
color__brown:
|
|
31
|
-
color__grey:
|
|
1
|
+
import { jsx as l, jsxs as P, Fragment as M } from "react/jsx-runtime";
|
|
2
|
+
import { useState as S, createRef as V, useEffect as z, useRef as j } from "react";
|
|
3
|
+
import { KEY as R, isEscape as E } from "../common/keys.js";
|
|
4
|
+
import { classes as D } from "../common/react.js";
|
|
5
|
+
import { computeBoxClassName as q, computeBoxProps as O, Box as T } from "./Box.js";
|
|
6
|
+
import { Icon as F } from "./Icon.js";
|
|
7
|
+
import { Tooltip as K } from "./Tooltip.js";
|
|
8
|
+
import '../assets/Button.css';const L = "_button_433yx_17", Y = "_fa_433yx_34", G = "_fas_433yx_35", H = "_far_433yx_36", J = "_dropdown_433yx_43", Q = "_ellipsis_433yx_49", U = "_fluid_433yx_54", W = "_circular_433yx_60", X = "_compact_433yx_64", Z = "_color__black_433yx_69", $ = "_color__white_433yx_82", oo = "_color__red_433yx_95", to = "_color__orange_433yx_108", _o = "_color__yellow_433yx_121", no = "_color__olive_433yx_134", eo = "_color__green_433yx_147", lo = "_color__teal_433yx_160", co = "_color__blue_433yx_173", ro = "_color__violet_433yx_186", io = "_color__purple_433yx_199", so = "_color__pink_433yx_212", ao = "_color__brown_433yx_225", uo = "_color__grey_433yx_238", fo = "_color__good_433yx_264", po = "_color__average_433yx_277", yo = "_color__bad_433yx_290", xo = "_color__label_433yx_303", mo = "_color__default_433yx_316", go = "_color__caution_433yx_329", bo = "_color__danger_433yx_342", ho = "_color__transparent_433yx_355", Co = "_disabled_433yx_370", ko = "_selected_433yx_374", vo = "_flex_433yx_387", wo = "_flex__fluid_433yx_392", Ao = "_verticalAlignContent__top_433yx_396", Bo = "_verticalAlignContent__middle_433yx_400", Io = "_verticalAlignContent__bottom_433yx_404", No = "_content_433yx_408", Ro = "_textMargin_433yx_413", _ = {
|
|
9
|
+
button: L,
|
|
10
|
+
fa: Y,
|
|
11
|
+
fas: G,
|
|
12
|
+
far: H,
|
|
13
|
+
dropdown: J,
|
|
14
|
+
ellipsis: Q,
|
|
15
|
+
fluid: U,
|
|
16
|
+
circular: W,
|
|
17
|
+
compact: X,
|
|
18
|
+
color__black: Z,
|
|
19
|
+
color__white: $,
|
|
20
|
+
color__red: oo,
|
|
21
|
+
color__orange: to,
|
|
22
|
+
color__yellow: _o,
|
|
23
|
+
color__olive: no,
|
|
24
|
+
color__green: eo,
|
|
25
|
+
color__teal: lo,
|
|
26
|
+
color__blue: co,
|
|
27
|
+
color__violet: ro,
|
|
28
|
+
color__purple: io,
|
|
29
|
+
color__pink: so,
|
|
30
|
+
color__brown: ao,
|
|
31
|
+
color__grey: uo,
|
|
32
32
|
"color__light-grey": "_color__light-grey_433yx_251",
|
|
33
|
-
color__good:
|
|
34
|
-
color__average:
|
|
35
|
-
color__bad:
|
|
36
|
-
color__label:
|
|
37
|
-
color__default:
|
|
38
|
-
color__caution:
|
|
39
|
-
color__danger:
|
|
40
|
-
color__transparent:
|
|
41
|
-
disabled:
|
|
42
|
-
selected:
|
|
43
|
-
flex:
|
|
44
|
-
flex__fluid:
|
|
45
|
-
verticalAlignContent__top:
|
|
46
|
-
verticalAlignContent__middle:
|
|
47
|
-
verticalAlignContent__bottom:
|
|
48
|
-
content:
|
|
49
|
-
textMargin:
|
|
33
|
+
color__good: fo,
|
|
34
|
+
color__average: po,
|
|
35
|
+
color__bad: yo,
|
|
36
|
+
color__label: xo,
|
|
37
|
+
color__default: mo,
|
|
38
|
+
color__caution: go,
|
|
39
|
+
color__danger: bo,
|
|
40
|
+
color__transparent: ho,
|
|
41
|
+
disabled: Co,
|
|
42
|
+
selected: ko,
|
|
43
|
+
flex: vo,
|
|
44
|
+
flex__fluid: wo,
|
|
45
|
+
verticalAlignContent__top: Ao,
|
|
46
|
+
verticalAlignContent__middle: Bo,
|
|
47
|
+
verticalAlignContent__bottom: Io,
|
|
48
|
+
content: No,
|
|
49
|
+
textMargin: Ro
|
|
50
50
|
};
|
|
51
|
-
function
|
|
51
|
+
function b(a) {
|
|
52
52
|
const {
|
|
53
|
-
captureKeys:
|
|
54
|
-
children:
|
|
53
|
+
captureKeys: i = !0,
|
|
54
|
+
children: s,
|
|
55
55
|
circular: y,
|
|
56
|
-
className:
|
|
57
|
-
color:
|
|
58
|
-
compact:
|
|
56
|
+
className: p,
|
|
57
|
+
color: r,
|
|
58
|
+
compact: h,
|
|
59
59
|
content: x,
|
|
60
60
|
disabled: o,
|
|
61
61
|
ellipsis: c,
|
|
62
62
|
fluid: n,
|
|
63
63
|
icon: e,
|
|
64
|
-
iconColor:
|
|
65
|
-
iconPosition:
|
|
66
|
-
iconRotation:
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
iconColor: u,
|
|
65
|
+
iconPosition: w,
|
|
66
|
+
iconRotation: A,
|
|
67
|
+
iconSize: B,
|
|
68
|
+
iconSpin: I,
|
|
69
|
+
onClick: d,
|
|
69
70
|
selected: C,
|
|
70
|
-
tooltip:
|
|
71
|
-
tooltipPosition:
|
|
72
|
-
verticalAlignContent:
|
|
73
|
-
...
|
|
74
|
-
} =
|
|
75
|
-
let
|
|
71
|
+
tooltip: k,
|
|
72
|
+
tooltipPosition: N,
|
|
73
|
+
verticalAlignContent: m,
|
|
74
|
+
...v
|
|
75
|
+
} = a, t = x || s;
|
|
76
|
+
let g = /* @__PURE__ */ l(
|
|
76
77
|
"div",
|
|
77
78
|
{
|
|
78
|
-
className:
|
|
79
|
+
className: D([
|
|
79
80
|
_.button,
|
|
80
81
|
n && _.fluid,
|
|
81
82
|
o && _.disabled,
|
|
82
83
|
C && _.selected,
|
|
83
84
|
y && _.circular,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
h && _.compact,
|
|
86
|
+
m && _.flex,
|
|
87
|
+
m && n && _.flex__fluid,
|
|
88
|
+
m && _["verticalAlignContent__" + m],
|
|
89
|
+
r && typeof r == "string" ? _["color__" + r] : _.color__default,
|
|
90
|
+
p,
|
|
91
|
+
q(v)
|
|
91
92
|
]),
|
|
92
93
|
tabIndex: o ? void 0 : 0,
|
|
93
|
-
onClick: (
|
|
94
|
-
!o &&
|
|
94
|
+
onClick: (f) => {
|
|
95
|
+
!o && d && d(f);
|
|
95
96
|
},
|
|
96
|
-
onKeyDown: (
|
|
97
|
-
if (
|
|
98
|
-
if (
|
|
99
|
-
|
|
97
|
+
onKeyDown: (f) => {
|
|
98
|
+
if (i) {
|
|
99
|
+
if (f.key === R.Space || f.key === R.Enter) {
|
|
100
|
+
f.preventDefault(), !o && d && d(f);
|
|
100
101
|
return;
|
|
101
102
|
}
|
|
102
|
-
|
|
103
|
+
E(f.key) && f.preventDefault();
|
|
103
104
|
}
|
|
104
105
|
},
|
|
105
|
-
...
|
|
106
|
-
children: /* @__PURE__ */
|
|
107
|
-
e &&
|
|
108
|
-
|
|
106
|
+
...O(v),
|
|
107
|
+
children: /* @__PURE__ */ P("div", { className: _.content, children: [
|
|
108
|
+
e && w !== "right" && /* @__PURE__ */ l(
|
|
109
|
+
F,
|
|
109
110
|
{
|
|
110
|
-
mr:
|
|
111
|
+
mr: t ? 1 : 0,
|
|
111
112
|
name: e,
|
|
112
|
-
color:
|
|
113
|
-
rotation:
|
|
114
|
-
|
|
113
|
+
color: u,
|
|
114
|
+
rotation: A,
|
|
115
|
+
size: B,
|
|
116
|
+
spin: I
|
|
115
117
|
}
|
|
116
118
|
),
|
|
117
119
|
c ? /* @__PURE__ */ l(
|
|
118
120
|
"span",
|
|
119
121
|
{
|
|
120
|
-
className:
|
|
121
|
-
children:
|
|
122
|
+
className: D([_.ellipsis, e && _.textMargin]),
|
|
123
|
+
children: t
|
|
122
124
|
}
|
|
123
|
-
) :
|
|
124
|
-
e &&
|
|
125
|
-
|
|
125
|
+
) : t,
|
|
126
|
+
e && w === "right" && /* @__PURE__ */ l(
|
|
127
|
+
F,
|
|
126
128
|
{
|
|
127
|
-
ml:
|
|
129
|
+
ml: t ? 1 : 0,
|
|
128
130
|
name: e,
|
|
129
|
-
color:
|
|
130
|
-
rotation:
|
|
131
|
-
|
|
131
|
+
color: u,
|
|
132
|
+
rotation: A,
|
|
133
|
+
size: B,
|
|
134
|
+
spin: I
|
|
132
135
|
}
|
|
133
136
|
)
|
|
134
137
|
] })
|
|
135
138
|
}
|
|
136
139
|
);
|
|
137
|
-
return
|
|
140
|
+
return k && (g = /* @__PURE__ */ l(K, { content: k, position: N, children: g })), g;
|
|
138
141
|
}
|
|
139
|
-
function
|
|
140
|
-
const { checked:
|
|
142
|
+
function Do(a) {
|
|
143
|
+
const { checked: i, ...s } = a;
|
|
141
144
|
return /* @__PURE__ */ l(
|
|
142
|
-
|
|
145
|
+
b,
|
|
143
146
|
{
|
|
144
147
|
color: "transparent",
|
|
145
|
-
icon:
|
|
146
|
-
selected:
|
|
147
|
-
...
|
|
148
|
+
icon: i ? "check-square-o" : "square-o",
|
|
149
|
+
selected: i,
|
|
150
|
+
...s
|
|
148
151
|
}
|
|
149
152
|
);
|
|
150
153
|
}
|
|
151
|
-
|
|
152
|
-
function
|
|
154
|
+
b.Checkbox = Do;
|
|
155
|
+
function Fo(a) {
|
|
153
156
|
const {
|
|
154
|
-
children:
|
|
155
|
-
color:
|
|
157
|
+
children: i,
|
|
158
|
+
color: s,
|
|
156
159
|
confirmColor: y = "bad",
|
|
157
|
-
confirmContent:
|
|
158
|
-
confirmIcon:
|
|
159
|
-
ellipsis:
|
|
160
|
+
confirmContent: p = "Confirm?",
|
|
161
|
+
confirmIcon: r,
|
|
162
|
+
ellipsis: h = !0,
|
|
160
163
|
icon: x,
|
|
161
164
|
onClick: o,
|
|
162
165
|
...c
|
|
163
|
-
} =
|
|
164
|
-
function
|
|
166
|
+
} = a, [n, e] = S(!1);
|
|
167
|
+
function u(w) {
|
|
165
168
|
if (!n) {
|
|
166
169
|
e(!0);
|
|
167
170
|
return;
|
|
168
171
|
}
|
|
169
|
-
o == null || o(
|
|
172
|
+
o == null || o(w), e(!1);
|
|
170
173
|
}
|
|
171
174
|
return /* @__PURE__ */ l(
|
|
172
|
-
|
|
175
|
+
b,
|
|
173
176
|
{
|
|
174
|
-
icon: n ?
|
|
175
|
-
color: n ? y :
|
|
176
|
-
onClick:
|
|
177
|
+
icon: n ? r : x,
|
|
178
|
+
color: n ? y : s,
|
|
179
|
+
onClick: u,
|
|
177
180
|
...c,
|
|
178
|
-
children: n ?
|
|
181
|
+
children: n ? p : i
|
|
179
182
|
}
|
|
180
183
|
);
|
|
181
184
|
}
|
|
182
|
-
|
|
183
|
-
function
|
|
185
|
+
b.Confirm = Fo;
|
|
186
|
+
function Po(a) {
|
|
184
187
|
const {
|
|
185
|
-
children:
|
|
186
|
-
color:
|
|
188
|
+
children: i,
|
|
189
|
+
color: s = "default",
|
|
187
190
|
content: y,
|
|
188
|
-
currentValue:
|
|
189
|
-
defaultValue:
|
|
190
|
-
disabled:
|
|
191
|
+
currentValue: p,
|
|
192
|
+
defaultValue: r,
|
|
193
|
+
disabled: h,
|
|
191
194
|
fluid: x,
|
|
192
195
|
icon: o,
|
|
193
196
|
iconRotation: c,
|
|
194
197
|
iconSpin: n,
|
|
195
198
|
maxLength: e,
|
|
196
|
-
onCommit:
|
|
197
|
-
placeholder:
|
|
198
|
-
tooltip:
|
|
199
|
-
tooltipPosition:
|
|
200
|
-
...
|
|
201
|
-
} =
|
|
202
|
-
function
|
|
203
|
-
const
|
|
204
|
-
if (!
|
|
205
|
-
|
|
199
|
+
onCommit: u = () => null,
|
|
200
|
+
placeholder: w,
|
|
201
|
+
tooltip: A,
|
|
202
|
+
tooltipPosition: B,
|
|
203
|
+
...I
|
|
204
|
+
} = a, [d, C] = S(!1), k = V(), N = y || i;
|
|
205
|
+
function m(t) {
|
|
206
|
+
const g = k.current;
|
|
207
|
+
if (!g) return;
|
|
208
|
+
g.value !== "" ? u(t, g.value) : r && u(t, r);
|
|
206
209
|
}
|
|
207
|
-
|
|
208
|
-
const t =
|
|
209
|
-
if (t &&
|
|
210
|
-
t.value =
|
|
210
|
+
z(() => {
|
|
211
|
+
const t = k.current;
|
|
212
|
+
if (t && d) {
|
|
213
|
+
t.value = p || "";
|
|
211
214
|
try {
|
|
212
215
|
t.focus(), t.select();
|
|
213
216
|
} catch {
|
|
214
217
|
}
|
|
215
218
|
}
|
|
216
|
-
}, [
|
|
217
|
-
let
|
|
218
|
-
|
|
219
|
+
}, [d, p]);
|
|
220
|
+
let v = /* @__PURE__ */ P(
|
|
221
|
+
T,
|
|
219
222
|
{
|
|
220
|
-
className:
|
|
223
|
+
className: D([
|
|
221
224
|
_.button,
|
|
222
225
|
x && _.fluid,
|
|
223
|
-
_["color__" +
|
|
226
|
+
_["color__" + s]
|
|
224
227
|
]),
|
|
225
|
-
...
|
|
226
|
-
onClick: () =>
|
|
228
|
+
...I,
|
|
229
|
+
onClick: () => C(!0),
|
|
227
230
|
children: [
|
|
228
|
-
o && /* @__PURE__ */ l(
|
|
229
|
-
/* @__PURE__ */ l("div", { children:
|
|
231
|
+
o && /* @__PURE__ */ l(F, { name: o, rotation: c, spin: n }),
|
|
232
|
+
/* @__PURE__ */ l("div", { children: N }),
|
|
230
233
|
/* @__PURE__ */ l(
|
|
231
234
|
"input",
|
|
232
235
|
{
|
|
233
|
-
disabled: !!
|
|
234
|
-
ref:
|
|
236
|
+
disabled: !!h,
|
|
237
|
+
ref: k,
|
|
235
238
|
className: "NumberInput__input",
|
|
236
239
|
style: {
|
|
237
|
-
display:
|
|
240
|
+
display: d ? "" : "none",
|
|
238
241
|
textAlign: "left"
|
|
239
242
|
},
|
|
240
243
|
onBlur: (t) => {
|
|
241
|
-
|
|
244
|
+
d && (C(!1), m(t));
|
|
242
245
|
},
|
|
243
246
|
onKeyDown: (t) => {
|
|
244
|
-
if (t.key ===
|
|
245
|
-
|
|
247
|
+
if (t.key === R.Enter) {
|
|
248
|
+
C(!1), m(t);
|
|
246
249
|
return;
|
|
247
250
|
}
|
|
248
|
-
t.key
|
|
251
|
+
E(t.key) && C(!1);
|
|
249
252
|
}
|
|
250
253
|
}
|
|
251
254
|
)
|
|
252
255
|
]
|
|
253
256
|
}
|
|
254
257
|
);
|
|
255
|
-
return
|
|
258
|
+
return A && (v = /* @__PURE__ */ l(K, { content: A, position: B, children: v })), v;
|
|
256
259
|
}
|
|
257
|
-
|
|
258
|
-
function
|
|
259
|
-
const { accept:
|
|
260
|
-
async function
|
|
260
|
+
b.Input = Po;
|
|
261
|
+
function So(a) {
|
|
262
|
+
const { accept: i, multiple: s, onSelectFiles: y, ...p } = a, r = j(null);
|
|
263
|
+
async function h(o) {
|
|
261
264
|
const c = Array.from(o).map((n) => {
|
|
262
265
|
const e = new FileReader();
|
|
263
|
-
return new Promise((
|
|
264
|
-
e.onload = () =>
|
|
266
|
+
return new Promise((u) => {
|
|
267
|
+
e.onload = () => u(e.result), e.readAsText(n);
|
|
265
268
|
});
|
|
266
269
|
});
|
|
267
270
|
return await Promise.all(c);
|
|
@@ -269,30 +272,30 @@ function Eo(u) {
|
|
|
269
272
|
async function x(o) {
|
|
270
273
|
const c = o.target.files;
|
|
271
274
|
if (c != null && c.length) {
|
|
272
|
-
const n = await
|
|
273
|
-
y(
|
|
275
|
+
const n = await h(c);
|
|
276
|
+
y(s ? n : n[0]);
|
|
274
277
|
}
|
|
275
278
|
}
|
|
276
|
-
return /* @__PURE__ */
|
|
277
|
-
/* @__PURE__ */ l(
|
|
279
|
+
return /* @__PURE__ */ P(M, { children: [
|
|
280
|
+
/* @__PURE__ */ l(b, { onClick: () => {
|
|
278
281
|
var o;
|
|
279
|
-
return (o =
|
|
280
|
-
}, ...
|
|
282
|
+
return (o = r.current) == null ? void 0 : o.click();
|
|
283
|
+
}, ...p }),
|
|
281
284
|
/* @__PURE__ */ l(
|
|
282
285
|
"input",
|
|
283
286
|
{
|
|
284
287
|
hidden: !0,
|
|
285
288
|
type: "file",
|
|
286
|
-
ref:
|
|
287
|
-
accept:
|
|
288
|
-
multiple:
|
|
289
|
+
ref: r,
|
|
290
|
+
accept: i,
|
|
291
|
+
multiple: s,
|
|
289
292
|
onChange: x
|
|
290
293
|
}
|
|
291
294
|
)
|
|
292
295
|
] });
|
|
293
296
|
}
|
|
294
|
-
|
|
297
|
+
b.File = So;
|
|
295
298
|
export {
|
|
296
|
-
|
|
297
|
-
|
|
299
|
+
b as Button,
|
|
300
|
+
Do as ButtonCheckbox
|
|
298
301
|
};
|
|
@@ -4,6 +4,8 @@ import { BoxProps } from './Box';
|
|
|
4
4
|
type Props = Partial<{
|
|
5
5
|
/** Buttons or other content to render inline with the button */
|
|
6
6
|
buttons: ReactNode;
|
|
7
|
+
/** Top margin of the child nodes, defaulted to 1 */
|
|
8
|
+
child_mt: number;
|
|
7
9
|
/** Icon to display with the collapsible */
|
|
8
10
|
icon: string;
|
|
9
11
|
/** Whether the collapsible is open */
|
|
@@ -1,27 +1,35 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Box as
|
|
4
|
-
import { Button as
|
|
5
|
-
function
|
|
6
|
-
const {
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as p } from "react";
|
|
3
|
+
import { Box as t } from "./Box.js";
|
|
4
|
+
import { Button as b } from "./Button.js";
|
|
5
|
+
function x(o) {
|
|
6
|
+
const {
|
|
7
|
+
children: r,
|
|
8
|
+
child_mt: s = 1,
|
|
9
|
+
color: m,
|
|
10
|
+
title: a,
|
|
11
|
+
buttons: c,
|
|
12
|
+
icon: i,
|
|
13
|
+
...d
|
|
14
|
+
} = o, [l, h] = p(o.open);
|
|
15
|
+
return /* @__PURE__ */ n(t, { mb: 1, children: [
|
|
16
|
+
/* @__PURE__ */ n("div", { className: "Table", children: [
|
|
9
17
|
/* @__PURE__ */ e("div", { className: "Table__cell", children: /* @__PURE__ */ e(
|
|
10
|
-
|
|
18
|
+
b,
|
|
11
19
|
{
|
|
12
20
|
fluid: !0,
|
|
13
|
-
color:
|
|
14
|
-
icon:
|
|
15
|
-
onClick: () =>
|
|
16
|
-
...
|
|
21
|
+
color: m,
|
|
22
|
+
icon: i || (l ? "chevron-down" : "chevron-right"),
|
|
23
|
+
onClick: () => h(!l),
|
|
24
|
+
...d,
|
|
17
25
|
children: a
|
|
18
26
|
}
|
|
19
27
|
) }),
|
|
20
|
-
|
|
28
|
+
c && /* @__PURE__ */ e("div", { className: "Table__cell Table__cell--collapsing", children: c })
|
|
21
29
|
] }),
|
|
22
|
-
l && /* @__PURE__ */ e(
|
|
30
|
+
l && /* @__PURE__ */ e(t, { mt: s, children: r })
|
|
23
31
|
] });
|
|
24
32
|
}
|
|
25
33
|
export {
|
|
26
|
-
|
|
34
|
+
x as Collapsible
|
|
27
35
|
};
|