diff --git a/tgui/packages/tgui/interfaces/CharacterDirectory.js b/tgui/packages/tgui/interfaces/CharacterDirectory.js index 7bc6a1dda1..d7a45241e3 100644 --- a/tgui/packages/tgui/interfaces/CharacterDirectory.js +++ b/tgui/packages/tgui/interfaces/CharacterDirectory.js @@ -25,8 +25,14 @@ const getTagColor = (tag) => { export const CharacterDirectory = (props, context) => { const { act, data } = useBackend(context); - const { personalVisibility, personalTag, personalGenderTag, personalSexualityTag, personalErpTag, personalEventTag } = - data; + const { + personalVisibility, + personalTag, + personalGenderTag, + personalSexualityTag, + personalErpTag, + personalEventTag, + } = data; const [overlay, setOverlay] = useLocalState(context, 'overlay', null); @@ -79,14 +85,20 @@ export const CharacterDirectory = (props, context) => { - {buttons &&
{buttons}
} + {buttons && ( +
{buttons}
+ )} {open && {children}} diff --git a/tgui/packages/tgui_ch/components/ColorBox.js b/tgui/packages/tgui_ch/components/ColorBox.js index 641e5fa751..256bb5c90e 100644 --- a/tgui/packages/tgui_ch/components/ColorBox.js +++ b/tgui/packages/tgui_ch/components/ColorBox.js @@ -8,11 +8,14 @@ import { classes, pureComponentHooks } from 'common/react'; import { computeBoxClassName, computeBoxProps } from './Box'; export const ColorBox = (props) => { - const { content, children, className, color, backgroundColor, ...rest } = props; + const { content, children, className, color, backgroundColor, ...rest } = + props; rest.color = content ? null : 'transparent'; rest.backgroundColor = color || backgroundColor; return ( -
+
{content || '.'}
); diff --git a/tgui/packages/tgui_ch/components/DraggableControl.js b/tgui/packages/tgui_ch/components/DraggableControl.js index fffd0cc254..a22fde5227 100644 --- a/tgui/packages/tgui_ch/components/DraggableControl.js +++ b/tgui/packages/tgui_ch/components/DraggableControl.js @@ -81,7 +81,8 @@ export class DraggableControl extends Component { }; this.handleDragMove = (e) => { - const { minValue, maxValue, step, stepPixelSize, dragMatrix } = this.props; + const { minValue, maxValue, step, stepPixelSize, dragMatrix } = + this.props; this.setState((prevState) => { const state = { ...prevState }; const offset = getScalarScreenOffset(e, dragMatrix) - state.origin; @@ -95,7 +96,11 @@ export class DraggableControl extends Component { maxValue + step ); // Clamp the final value - state.value = clamp(state.internalValue - (state.internalValue % step) + stepOffset, minValue, maxValue); + state.value = clamp( + state.internalValue - (state.internalValue % step) + stepOffset, + minValue, + maxValue + ); state.origin = getScalarScreenOffset(e, dragMatrix); } else if (Math.abs(offset) > 4) { state.dragging = true; @@ -139,7 +144,12 @@ export class DraggableControl extends Component { } render() { - const { dragging, editing, value: intermediateValue, suppressingFlicker } = this.state; + const { + dragging, + editing, + value: intermediateValue, + suppressingFlicker, + } = this.state; const { animated, value, diff --git a/tgui/packages/tgui_ch/components/Dropdown.js b/tgui/packages/tgui_ch/components/Dropdown.js index 1309df92b9..32c8dca237 100644 --- a/tgui/packages/tgui_ch/components/Dropdown.js +++ b/tgui/packages/tgui_ch/components/Dropdown.js @@ -105,7 +105,10 @@ export class Dropdown extends Component { style={{ 'width': width, }} - className={classes([(noscroll && 'Dropdown__menu-noscroll') || 'Dropdown__menu', over && 'Dropdown__over'])}> + className={classes([ + (noscroll && 'Dropdown__menu-noscroll') || 'Dropdown__menu', + over && 'Dropdown__over', + ])}> {this.buildMenu()}
) : null; @@ -128,9 +131,15 @@ export class Dropdown extends Component { } this.setOpen(!this.state.open); }}> - {icon && } + {icon && ( + + )} - {displayText ? displayText : this.state.selected || placeholder /* VOREStation Edit */} + { + displayText + ? displayText + : this.state.selected || placeholder /* VOREStation Edit */ + } {!!nochevron || ( diff --git a/tgui/packages/tgui_ch/components/Flex.tsx b/tgui/packages/tgui_ch/components/Flex.tsx index 915047bd9c..060bae5b73 100644 --- a/tgui/packages/tgui_ch/components/Flex.tsx +++ b/tgui/packages/tgui_ch/components/Flex.tsx @@ -52,7 +52,12 @@ export const computeFlexProps = (props: FlexProps) => { export const Flex = (props) => { const { className, ...rest } = props; - return
; + return ( +
+ ); }; Flex.defaultHooks = pureComponentHooks; @@ -66,7 +71,11 @@ export type FlexItemProps = BoxProps & { }; export const computeFlexItemClassName = (props: FlexItemProps) => { - return classes(['Flex__item', Byond.IS_LTE_IE10 && 'Flex__item--iefix', computeBoxClassName(props)]); + return classes([ + 'Flex__item', + Byond.IS_LTE_IE10 && 'Flex__item--iefix', + computeBoxClassName(props), + ]); }; export const computeFlexItemProps = (props: FlexItemProps) => { @@ -99,7 +108,11 @@ const FlexItem = (props) => { const { className, ...rest } = props; return (
); diff --git a/tgui/packages/tgui_ch/components/Icon.js b/tgui/packages/tgui_ch/components/Icon.js index ef02b1059d..f8d1292502 100644 --- a/tgui/packages/tgui_ch/components/Icon.js +++ b/tgui/packages/tgui_ch/components/Icon.js @@ -37,9 +37,20 @@ export const Icon = (props) => { // font awesome icon const faRegular = FA_OUTLINE_REGEX.test(name); const faName = name.replace(FA_OUTLINE_REGEX, ''); - iconClass = (faRegular ? 'far ' : 'fas ') + 'fa-' + faName + (spin ? ' fa-spin' : ''); + iconClass = + (faRegular ? 'far ' : 'fas ') + 'fa-' + faName + (spin ? ' fa-spin' : ''); } - return ; + return ( + + ); }; Icon.defaultHooks = pureComponentHooks; @@ -47,7 +58,9 @@ Icon.defaultHooks = pureComponentHooks; export const IconStack = (props) => { const { className, children, ...rest } = props; return ( - + {children} ); diff --git a/tgui/packages/tgui_ch/components/InfinitePlane.js b/tgui/packages/tgui_ch/components/InfinitePlane.js index a14c478156..a9fcfc01e8 100644 --- a/tgui/packages/tgui_ch/components/InfinitePlane.js +++ b/tgui/packages/tgui_ch/components/InfinitePlane.js @@ -134,7 +134,10 @@ export class InfinitePlane extends Component { /> - + {zoom}x diff --git a/tgui/packages/tgui_ch/components/Input.js b/tgui/packages/tgui_ch/components/Input.js index 92f654f241..0107865f1d 100644 --- a/tgui/packages/tgui_ch/components/Input.js +++ b/tgui/packages/tgui_ch/components/Input.js @@ -9,7 +9,8 @@ import { Component, createRef } from 'inferno'; import { Box } from './Box'; import { KEY_ESCAPE, KEY_ENTER } from 'common/keycodes'; -export const toInputValue = (value) => (typeof value !== 'number' && typeof value !== 'string' ? '' : String(value)); +export const toInputValue = (value) => + typeof value !== 'number' && typeof value !== 'string' ? '' : String(value); export class Input extends Component { constructor() { @@ -117,12 +118,26 @@ export class Input extends Component { render() { const { props } = this; // Input only props - const { selfClear, onInput, onChange, onEnter, value, maxLength, placeholder, ...boxProps } = props; + const { + selfClear, + onInput, + onChange, + onEnter, + value, + maxLength, + placeholder, + ...boxProps + } = props; // Box props const { className, fluid, monospace, ...rest } = boxProps; return (
.
{ value, }}> {(control) => { - const { dragging, editing, value, displayValue, displayElement, inputElement, handleDragStart } = control; - const scaledFillValue = scale(fillValue ?? displayValue, minValue, maxValue); + const { + dragging, + editing, + value, + displayValue, + displayElement, + inputElement, + handleDragStart, + } = control; + const scaledFillValue = scale( + fillValue ?? displayValue, + minValue, + maxValue + ); const scaledDisplayValue = scale(displayValue, minValue, maxValue); - const effectiveColor = color || keyOfMatchingRange(fillValue ?? value, ranges) || 'default'; + const effectiveColor = + color || keyOfMatchingRange(fillValue ?? value, ranges) || 'default'; const rotation = Math.min((scaledDisplayValue - 0.5) * 270, 225); return (
{
- {dragging &&
{displayElement}
} - + {dragging && ( +
{displayElement}
+ )} + - + { const { children, wrap, ...rest } = props; return ( - + {children} ); @@ -19,7 +24,13 @@ const LabeledControlsItem = (props) => { const { label, children, mx = 1, ...rest } = props; return ( - + {children} {label} diff --git a/tgui/packages/tgui_ch/components/LabeledList.tsx b/tgui/packages/tgui_ch/components/LabeledList.tsx index 0a06916ee0..668d42332e 100644 --- a/tgui/packages/tgui_ch/components/LabeledList.tsx +++ b/tgui/packages/tgui_ch/components/LabeledList.tsx @@ -67,7 +67,9 @@ const LabeledListItem = (props: LabeledListItemProps) => { {content} {children}
- {buttons && {buttons}} + {buttons && ( + {buttons} + )} ); }; diff --git a/tgui/packages/tgui_ch/components/Modal.js b/tgui/packages/tgui_ch/components/Modal.js index 72e65cdb13..33d0146161 100644 --- a/tgui/packages/tgui_ch/components/Modal.js +++ b/tgui/packages/tgui_ch/components/Modal.js @@ -28,7 +28,9 @@ export const Modal = (props) => { // VOREStation Addition End return ( -
+
{children}
diff --git a/tgui/packages/tgui_ch/components/NanoMap.js b/tgui/packages/tgui_ch/components/NanoMap.js index 6bb4c49592..4ee5199119 100644 --- a/tgui/packages/tgui_ch/components/NanoMap.js +++ b/tgui/packages/tgui_ch/components/NanoMap.js @@ -143,7 +143,11 @@ export class NanoMap extends Component { return ( - + {children} diff --git a/tgui/packages/tgui_ch/components/NumberInput.js b/tgui/packages/tgui_ch/components/NumberInput.js index 74929778a4..e05f92074d 100644 --- a/tgui/packages/tgui_ch/components/NumberInput.js +++ b/tgui/packages/tgui_ch/components/NumberInput.js @@ -90,7 +90,11 @@ export class NumberInput extends Component { maxValue + step ); // Clamp the final value - state.value = clamp(state.internalValue - (state.internalValue % step) + stepOffset, minValue, maxValue); + state.value = clamp( + state.internalValue - (state.internalValue % step) + stepOffset, + minValue, + maxValue + ); state.origin = e.screenY; } else if (Math.abs(offset) > 4) { state.dragging = true; @@ -134,7 +138,12 @@ export class NumberInput extends Component { } render() { - const { dragging, editing, value: intermediateValue, suppressingFlicker } = this.state; + const { + dragging, + editing, + value: intermediateValue, + suppressingFlicker, + } = this.state; const { className, fluid, @@ -170,7 +179,11 @@ export class NumberInput extends Component { renderContentElement(format ? format(displayValue) : displayValue); return (
@@ -219,7 +237,11 @@ export class NumberInput extends Component { }} onKeyDown={(e) => { if (e.keyCode === 13) { - const value = clamp(parseFloat(e.target.value), minValue, maxValue); + const value = clamp( + parseFloat(e.target.value), + minValue, + maxValue + ); if (Number.isNaN(value)) { this.setState({ editing: false, diff --git a/tgui/packages/tgui_ch/components/Popper.tsx b/tgui/packages/tgui_ch/components/Popper.tsx index 1f025fe63b..c7d41293bc 100644 --- a/tgui/packages/tgui_ch/components/Popper.tsx +++ b/tgui/packages/tgui_ch/components/Popper.tsx @@ -47,7 +47,11 @@ export class Popper extends Component { return; } - this.popperInstance = createPopper(domNode, this.renderedContent, options); + this.popperInstance = createPopper( + domNode, + this.renderedContent, + options + ); }); } @@ -65,7 +69,12 @@ export class Popper extends Component { renderPopperContent(callback: () => void) { // `render` errors when given false, so we convert it to `null`, // which is supported. - render(this.props.popperContent || null, this.renderedContent, callback, this.context); + render( + this.props.popperContent || null, + this.renderedContent, + callback, + this.context + ); } render() { diff --git a/tgui/packages/tgui_ch/components/ProgressBar.js b/tgui/packages/tgui_ch/components/ProgressBar.js index 5b026f2506..194395164b 100644 --- a/tgui/packages/tgui_ch/components/ProgressBar.js +++ b/tgui/packages/tgui_ch/components/ProgressBar.js @@ -9,10 +9,20 @@ import { classes, pureComponentHooks } from 'common/react'; import { computeBoxClassName, computeBoxProps } from './Box'; export const ProgressBar = (props) => { - const { className, value, minValue = 0, maxValue = 1, color, ranges = {}, children, ...rest } = props; + const { + className, + value, + minValue = 0, + maxValue = 1, + color, + ranges = {}, + children, + ...rest + } = props; const scaledValue = scale(value, minValue, maxValue); const hasContent = children !== undefined; - const effectiveColor = color || keyOfMatchingRange(value, ranges) || 'default'; + const effectiveColor = + color || keyOfMatchingRange(value, ranges) || 'default'; return (
{ width: clamp01(scaledValue) * 100 + '%', }} /> -
{hasContent ? children : toFixed(scaledValue * 100) + '%'}
+
+ {hasContent ? children : toFixed(scaledValue * 100) + '%'} +
); }; diff --git a/tgui/packages/tgui_ch/components/RestrictedInput.js b/tgui/packages/tgui_ch/components/RestrictedInput.js index 32293f61a5..977c911d4e 100644 --- a/tgui/packages/tgui_ch/components/RestrictedInput.js +++ b/tgui/packages/tgui_ch/components/RestrictedInput.js @@ -131,7 +131,12 @@ export class RestrictedInput extends Component { const { className, fluid, monospace, ...rest } = boxProps; return (
.
{ return ; } - const { value, minValue = 1, maxValue = 1, ranges, alertAfter, format, size = 1, className, style, ...rest } = props; + const { + value, + minValue = 1, + maxValue = 1, + ranges, + alertAfter, + format, + size = 1, + className, + style, + ...rest + } = props; const scaledValue = scale(value, minValue, maxValue); const clampedValue = clamp01(scaledValue); @@ -23,7 +34,10 @@ export const RoundGauge = (props) => { if (ranges) { Object.keys(ranges).forEach((x) => { const range = ranges[x]; - scaledRanges[x] = [scale(range[0], minValue, maxValue), scale(range[1], minValue, maxValue)]; + scaledRanges[x] = [ + scale(range[0], minValue, maxValue), + scale(range[1], minValue, maxValue), + ]; }); } @@ -35,7 +49,11 @@ export const RoundGauge = (props) => { return (
{ })}> {alertAfter && ( - + )} @@ -60,7 +82,10 @@ export const RoundGauge = (props) => { className={`RoundGauge__ringFill RoundGauge--color--${x}`} key={i} style={{ - 'stroke-dashoffset': Math.max((2.0 - (col_ranges[1] - col_ranges[0])) * Math.PI * 50, 0), + 'stroke-dashoffset': Math.max( + (2.0 - (col_ranges[1] - col_ranges[0])) * Math.PI * 50, + 0 + ), }} transform={`rotate(${180 + 180 * col_ranges[0]} 50 50)`} cx="50" @@ -70,9 +95,19 @@ export const RoundGauge = (props) => { ); })} - - - + + +
diff --git a/tgui/packages/tgui_ch/components/Slider.js b/tgui/packages/tgui_ch/components/Slider.js index 31b47bb0f3..45e00fe3cd 100644 --- a/tgui/packages/tgui_ch/components/Slider.js +++ b/tgui/packages/tgui_ch/components/Slider.js @@ -54,12 +54,25 @@ export const Slider = (props) => { value, }}> {(control) => { - const { dragging, editing, value, displayValue, displayElement, inputElement, handleDragStart } = control; + const { + dragging, + editing, + value, + displayValue, + displayElement, + inputElement, + handleDragStart, + } = control; const hasFillValue = fillValue !== undefined && fillValue !== null; const scaledValue = scale(value, minValue, maxValue); - const scaledFillValue = scale(fillValue ?? displayValue, minValue, maxValue); + const scaledFillValue = scale( + fillValue ?? displayValue, + minValue, + maxValue + ); const scaledDisplayValue = scale(displayValue, minValue, maxValue); - const effectiveColor = color || keyOfMatchingRange(fillValue ?? value, ranges) || 'default'; + const effectiveColor = + color || keyOfMatchingRange(fillValue ?? value, ranges) || 'default'; return (
{ {...computeBoxProps(rest)} onMouseDown={handleDragStart}>
{
{ }}>
- {dragging &&
{displayElement}
} + {dragging && ( +
{displayElement}
+ )} +
+
+ {hasContent ? children : displayElement}
-
{hasContent ? children : displayElement}
{inputElement}
); diff --git a/tgui/packages/tgui_ch/components/Stack.tsx b/tgui/packages/tgui_ch/components/Stack.tsx index f399e97a45..28aaa8080c 100644 --- a/tgui/packages/tgui_ch/components/Stack.tsx +++ b/tgui/packages/tgui_ch/components/Stack.tsx @@ -35,7 +35,13 @@ type StackItemProps = FlexProps & { const StackItem = (props: StackItemProps) => { const { className, innerRef, ...rest } = props; - return ; + return ( + + ); }; Stack.Item = StackItem; @@ -48,7 +54,12 @@ const StackDivider = (props: StackDividerProps) => { const { className, hidden, ...rest } = props; return (