@mtes-mct/monitor-ui 6.5.0 → 6.5.2
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/CHANGELOG.md +15 -0
- package/fields/NumberInput.d.ts +2 -2
- package/hooks/usePreventWheelEvent.d.ts +2 -0
- package/index.js +139 -55
- package/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## [6.5.1](https://github.com/MTES-MCT/monitor-ui/compare/v6.5.0...v6.5.1) (2023-05-26)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **fields:** add missing onBlur & onFocus props passing in NumberInput ([25c210e](https://github.com/MTES-MCT/monitor-ui/commit/25c210e498c37f275aa32dc5104e0c2824eb4a64))
|
|
7
|
+
* **fields:** prevent wheel event in NumberInput, DatePicker & DateRangePicker ([21a1c20](https://github.com/MTES-MCT/monitor-ui/commit/21a1c205620e977b411e755793ff92dfc17da20b))
|
|
8
|
+
|
|
9
|
+
# [6.5.0](https://github.com/MTES-MCT/monitor-ui/compare/v6.4.1...v6.5.0) (2023-05-25)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* **cypress:** extend retries to caught errors in fill command ([6ea6839](https://github.com/MTES-MCT/monitor-ui/commit/6ea6839c489b83c3807f5779ece254d9652dc95e))
|
|
15
|
+
|
|
1
16
|
## [6.4.1](https://github.com/MTES-MCT/monitor-ui/compare/v6.4.0...v6.4.1) (2023-05-25)
|
|
2
17
|
|
|
3
18
|
|
package/fields/NumberInput.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type InputProps } from 'rsuite';
|
|
2
2
|
import type { Promisable } from 'type-fest';
|
|
3
3
|
export type NumberInputProps = Omit<InputProps, 'as' | 'defaultValue' | 'id' | 'onChange' | 'type' | 'value'> & {
|
|
4
4
|
error?: string | undefined;
|
|
@@ -11,4 +11,4 @@ export type NumberInputProps = Omit<InputProps, 'as' | 'defaultValue' | 'id' | '
|
|
|
11
11
|
onChange?: ((nextValue: number | undefined) => Promisable<void>) | undefined;
|
|
12
12
|
value?: number | undefined;
|
|
13
13
|
};
|
|
14
|
-
export declare function NumberInput({ className, error, isErrorMessageHidden, isLabelHidden, isLight, isUndefinedWhenDisabled, label, onChange, style, value, ...originalProps }: NumberInputProps): JSX.Element;
|
|
14
|
+
export declare function NumberInput({ className, error, isErrorMessageHidden, isLabelHidden, isLight, isUndefinedWhenDisabled, label, onBlur, onChange, onFocus, style, value, ...originalProps }: NumberInputProps): JSX.Element;
|
package/index.js
CHANGED
|
@@ -2174,9 +2174,9 @@ function stopMouseEventPropagation(event) {
|
|
|
2174
2174
|
|
|
2175
2175
|
function RawDialog({ children, className, isAbsolute = false, ...nativeProps }) {
|
|
2176
2176
|
const controlledClassName = classnames('Component-Dialog', className);
|
|
2177
|
-
return (jsxs(Box$
|
|
2177
|
+
return (jsxs(Box$h, { "$isAbsolute": isAbsolute, className: controlledClassName, onClick: stopMouseEventPropagation, ...nativeProps, children: [jsx(Overlay, { "$isAbsolute": isAbsolute }), jsx(Window, { "$isAbsolute": isAbsolute, children: children })] }));
|
|
2178
2178
|
}
|
|
2179
|
-
const Box$
|
|
2179
|
+
const Box$h = styled.div `
|
|
2180
2180
|
position: ${p => (p.$isAbsolute ? 'absolute' : 'fixed')};
|
|
2181
2181
|
top: 0;
|
|
2182
2182
|
bottom: 0;
|
|
@@ -3185,9 +3185,9 @@ function SingleTag({ children, className, onDelete, ...nativeProps }) {
|
|
|
3185
3185
|
onDelete();
|
|
3186
3186
|
}
|
|
3187
3187
|
}, [onDelete]);
|
|
3188
|
-
return (jsxs(Box$
|
|
3188
|
+
return (jsxs(Box$g, { className: controlledClassName, ...nativeProps, children: [jsx(Text, { children: children }), jsx(StyledIconButton, { accent: Accent.TERTIARY, Icon: Close, iconSize: 10, onClick: handleDelete })] }));
|
|
3189
3189
|
}
|
|
3190
|
-
const Box$
|
|
3190
|
+
const Box$g = styled.div `
|
|
3191
3191
|
align-items: center;
|
|
3192
3192
|
display: inline-flex;
|
|
3193
3193
|
`;
|
|
@@ -3242,9 +3242,9 @@ p.disabled ? p.theme.color.lightGray : p.hasError ? p.theme.color.maximumRed : p
|
|
|
3242
3242
|
|
|
3243
3243
|
function Fieldset({ children, className, hasBorder = false, hasError = false, isLegendHidden = false, isLight = false, legend, ...nativeProps }) {
|
|
3244
3244
|
const hasLegend = useMemo(() => Boolean(legend), [legend]);
|
|
3245
|
-
return (jsxs(Box$
|
|
3245
|
+
return (jsxs(Box$f, { className: classnames('Element-Fieldset', className), ...nativeProps, children: [legend && (jsx(Legend, { disabled: nativeProps.disabled, hasError: hasError, isHidden: isLegendHidden, children: legend })), jsx(InnerBox, { "$hasBorder": hasBorder, "$hasLegend": hasLegend, "$isLight": isLight, children: children })] }));
|
|
3246
3246
|
}
|
|
3247
|
-
const Box$
|
|
3247
|
+
const Box$f = styled.fieldset `
|
|
3248
3248
|
align-items: flex-start;
|
|
3249
3249
|
border: 0;
|
|
3250
3250
|
display: flex;
|
|
@@ -3307,10 +3307,10 @@ function Tag({ accent, bullet, bulletColor, children, className, color, Icon, is
|
|
|
3307
3307
|
case Accent.TERTIARY:
|
|
3308
3308
|
return jsx(TertiaryTag, { ...commonProps });
|
|
3309
3309
|
default:
|
|
3310
|
-
return jsx(Box$
|
|
3310
|
+
return jsx(Box$e, { "$color": color, ...commonProps });
|
|
3311
3311
|
}
|
|
3312
3312
|
}
|
|
3313
|
-
const Box$
|
|
3313
|
+
const Box$e = styled.span `
|
|
3314
3314
|
align-items: center;
|
|
3315
3315
|
background-color: ${p => (p.$isLight ? p.theme.color.white : 'transparent')};
|
|
3316
3316
|
border-radius: 11px;
|
|
@@ -3332,16 +3332,16 @@ const Box$d = styled.span `
|
|
|
3332
3332
|
margin-right: 4px;
|
|
3333
3333
|
}
|
|
3334
3334
|
`;
|
|
3335
|
-
const PrimaryTag = styled(Box$
|
|
3335
|
+
const PrimaryTag = styled(Box$e) `
|
|
3336
3336
|
background-color: ${p => (p.$isLight ? p.theme.color.white : p.theme.color.gainsboro)};
|
|
3337
3337
|
color: ${p => p.theme.color.gunMetal};
|
|
3338
3338
|
`;
|
|
3339
3339
|
// TODO Fix this color.
|
|
3340
|
-
const SecondaryTag = styled(Box$
|
|
3340
|
+
const SecondaryTag = styled(Box$e) `
|
|
3341
3341
|
background-color: ${p => (p.$isLight ? '#f6d012' : '#f6d012')};
|
|
3342
3342
|
color: ${p => p.theme.color.gunMetal};
|
|
3343
3343
|
`;
|
|
3344
|
-
const TertiaryTag = styled(Box$
|
|
3344
|
+
const TertiaryTag = styled(Box$e) `
|
|
3345
3345
|
background-color: ${p => (p.$isLight ? p.theme.color.charcoal : p.theme.color.charcoal)};
|
|
3346
3346
|
color: ${p => p.theme.color.white};
|
|
3347
3347
|
`;
|
|
@@ -20799,7 +20799,7 @@ function Search({ baseContainer, className, customSearch = undefined, customSear
|
|
|
20799
20799
|
useEffect(() => {
|
|
20800
20800
|
forceUpdate();
|
|
20801
20801
|
}, [forceUpdate]);
|
|
20802
|
-
return (jsxs(Field$2, { className: controlledClassName, children: [jsx(Label, { disabled: originalProps.disabled, hasError: hasError, htmlFor: originalProps.name, isHidden: isLabelHidden, children: label }), jsxs(Box$
|
|
20802
|
+
return (jsxs(Field$2, { className: controlledClassName, children: [jsx(Label, { disabled: originalProps.disabled, hasError: hasError, htmlFor: originalProps.name, isHidden: isLabelHidden, children: label }), jsxs(Box$d, { ref: boxRef, isLight: isLight, children: [boxRef.current && (jsx(StyledAutoComplete, { "$isLight": isLight, container: boxRef.current,
|
|
20803
20803
|
// When we use a custom search, we use `controlledRsuiteData` to provide the matching options (data),
|
|
20804
20804
|
// when we don't, we don't need to control that and just pass the non-internally-controlled `rsuiteData`
|
|
20805
20805
|
data: controlledRsuiteData || data,
|
|
@@ -20848,7 +20848,7 @@ const StyledAutoComplete = styled(AutoComplete) `
|
|
|
20848
20848
|
}
|
|
20849
20849
|
}
|
|
20850
20850
|
`;
|
|
20851
|
-
const Box$
|
|
20851
|
+
const Box$d = styled.div `
|
|
20852
20852
|
background-color: ${p => (p.isLight ? p.theme.color.white : p.theme.color.gainsboro)};
|
|
20853
20853
|
position: relative;
|
|
20854
20854
|
width: 100%;
|
|
@@ -21149,11 +21149,11 @@ function CalendarPicker({ isHistorical, isOpen, onChange, value }) {
|
|
|
21149
21149
|
// and can be used as a container for <RsuiteDatePicker />
|
|
21150
21150
|
forceUpdate();
|
|
21151
21151
|
}, [forceUpdate]);
|
|
21152
|
-
return (jsx(Box$
|
|
21152
|
+
return (jsx(Box$c, { ref: boxRef, onClick: stopMouseEventPropagation, children: boxRef.current && (jsx(DatePicker$1, { container: boxRef.current, format: "yyyy-MM-dd", locale: RSUITE_CALENDAR_LOCALE, oneTap: true, onSelect: handleSelect, open: isOpen, ranges: [], shouldDisableDate: shouldDisableDate,
|
|
21153
21153
|
// eslint-disable-next-line no-null/no-null
|
|
21154
21154
|
value: controlledValue ?? null })) }));
|
|
21155
21155
|
}
|
|
21156
|
-
const Box$
|
|
21156
|
+
const Box$c = styled.div `
|
|
21157
21157
|
height: 0;
|
|
21158
21158
|
position: relative;
|
|
21159
21159
|
user-select: none;
|
|
@@ -21309,26 +21309,58 @@ const Box$b = styled.div `
|
|
|
21309
21309
|
}
|
|
21310
21310
|
`;
|
|
21311
21311
|
|
|
21312
|
-
function
|
|
21312
|
+
function usePreventWheelEvent(inputRef) {
|
|
21313
|
+
/**
|
|
21314
|
+
* Prevent any wheel event from emitting while allowing page scroll when focused.
|
|
21315
|
+
*
|
|
21316
|
+
* @description
|
|
21317
|
+
* We want to prevent the number input from changing when the user accidentally scrolls up or down.
|
|
21318
|
+
* That's why we prevent the default behavior of wheel events when it is focused.
|
|
21319
|
+
*
|
|
21320
|
+
* We also want to allow the user to be able to scroll the page while focused on a number input,
|
|
21321
|
+
* That's why we blur this input when a "wheel" (=> "scroll") event happens.
|
|
21322
|
+
*
|
|
21323
|
+
* Because React uses passive event handler by default,
|
|
21324
|
+
* we can't just call `preventDefault` in the `onWheel` event target.
|
|
21325
|
+
* We thus have to use the input reference and add our event handler manually.
|
|
21326
|
+
*
|
|
21327
|
+
* @see https://github.com/facebook/react/pull/19654
|
|
21328
|
+
*/
|
|
21329
|
+
const preventWheelEvent = useCallback((event) => {
|
|
21330
|
+
if (!inputRef.current) {
|
|
21331
|
+
return;
|
|
21332
|
+
}
|
|
21333
|
+
event.preventDefault();
|
|
21334
|
+
inputRef.current.blur();
|
|
21335
|
+
},
|
|
21336
|
+
// We don't want to pass a reference as a hook dependency since it can't shallow-equal and `.current` is a pointer.
|
|
21337
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
21338
|
+
[]);
|
|
21339
|
+
return preventWheelEvent;
|
|
21340
|
+
}
|
|
21341
|
+
|
|
21342
|
+
function NumberInputWithRef({ isLight, max, min, onBack, onBlur, onFilled, onFocus, onFormatError, onInput, onNext, onPrevious, size, value, ...nativeProps }, ref) {
|
|
21313
21343
|
// eslint-disable-next-line no-null/no-null
|
|
21314
21344
|
const inputRef = useRef(null);
|
|
21315
21345
|
const placeholder = useMemo(() => '-'.repeat(size), [size]);
|
|
21316
21346
|
useImperativeHandle(ref, () => inputRef.current);
|
|
21317
|
-
const
|
|
21318
|
-
|
|
21319
|
-
|
|
21320
|
-
|
|
21347
|
+
const preventWheelEvent = usePreventWheelEvent(inputRef);
|
|
21348
|
+
const handleBlur = useCallback((event) => {
|
|
21349
|
+
event.target.removeEventListener('wheel', preventWheelEvent);
|
|
21350
|
+
if (onBlur) {
|
|
21351
|
+
onBlur(event);
|
|
21321
21352
|
}
|
|
21322
|
-
}, [
|
|
21353
|
+
}, [onBlur, preventWheelEvent]);
|
|
21323
21354
|
const handleFocus = useCallback((event) => {
|
|
21324
21355
|
if (!inputRef.current) {
|
|
21325
21356
|
return;
|
|
21326
21357
|
}
|
|
21358
|
+
event.target.addEventListener('wheel', preventWheelEvent);
|
|
21327
21359
|
inputRef.current.select();
|
|
21328
21360
|
if (onFocus) {
|
|
21329
21361
|
onFocus(event);
|
|
21330
21362
|
}
|
|
21331
|
-
}, [onFocus]);
|
|
21363
|
+
}, [onFocus, preventWheelEvent]);
|
|
21332
21364
|
const handleInput = useCallback(() => {
|
|
21333
21365
|
if (!inputRef.current) {
|
|
21334
21366
|
return;
|
|
@@ -21376,7 +21408,7 @@ function NumberInputWithRef({ isLight, max, min, onBack, onClick, onFilled, onFo
|
|
|
21376
21408
|
onBack();
|
|
21377
21409
|
}
|
|
21378
21410
|
}, [onBack, onNext, onPrevious]);
|
|
21379
|
-
return (jsx(StyledNumberInput, { ref: inputRef, "$isLight": isLight, "$size": size, defaultValue: value, maxLength: size,
|
|
21411
|
+
return (jsx(StyledNumberInput, { ref: inputRef, "$isLight": isLight, "$size": size, defaultValue: value, maxLength: size, onBlur: handleBlur, onFocus: handleFocus, onInput: handleInput, onKeyDown: handleKeyDown, pattern: "\\d*", placeholder: placeholder, type: "text", ...nativeProps }, String(value)));
|
|
21380
21412
|
}
|
|
21381
21413
|
const NumberInput$1 = forwardRef(NumberInputWithRef);
|
|
21382
21414
|
const StyledNumberInput = styled.input `
|
|
@@ -21470,10 +21502,10 @@ function DateInputWithRef({ baseContainer, disabled = false, isCompact, isEndDat
|
|
|
21470
21502
|
];
|
|
21471
21503
|
onChange(nextDateTuple, isFilled);
|
|
21472
21504
|
}, [baseDocument, onChange]);
|
|
21473
|
-
return (jsxs(Box$
|
|
21505
|
+
return (jsxs(Box$b, { ref: boxRef, "$hasError": hasFormatError || hasValidationError, "$isCompact": isCompact, "$isDisabled": disabled, "$isFocused": isForcedFocused || isFocused, "$isLight": isLight, children: [jsxs("div", { children: [isRange && isStartDate && jsx("span", { children: "Du " }), isRange && isEndDate && jsx("span", { children: "Au " }), jsx(NumberInput$1, { ref: dayInputRef, "aria-label": `Jour${isRange && isStartDate ? ' de début' : ''}${isRange && isEndDate ? ' de fin' : ''}`, disabled: disabled, isLight: isLight, max: 31, min: 1, onBack: onBack, onBlur: handleBlur, onClick: onClick, onFilled: submit, onFocus: handleFocus, onFormatError: handleFormatError, onInput: onInput, onNext: () => monthInputRef.current?.focus(), onPrevious: onPrevious, size: 2, value: controlledValue && controlledValue[2] }), "/", jsx(NumberInput$1, { ref: monthInputRef, "aria-label": `Mois${isRange && isStartDate ? ' de début' : ''}${isRange && isEndDate ? ' de fin' : ''}`, disabled: disabled, isLight: isLight, max: 12, min: 1, onBack: () => dayInputRef.current?.focus(), onBlur: handleBlur, onClick: onClick, onFilled: submit, onFocus: handleFocus, onFormatError: handleFormatError, onInput: onInput, onNext: () => yearInputRef.current?.focus(), onPrevious: () => dayInputRef.current?.focus(), size: 2, value: controlledValue && controlledValue[1] }), "/", jsx(NumberInput$1, { ref: yearInputRef, "aria-label": `Année${isRange && isStartDate ? ' de début' : ''}${isRange && isEndDate ? ' de fin' : ''}`, disabled: disabled, isLight: isLight, max: 2030, min: 2020, onBack: () => monthInputRef.current?.focus(), onBlur: handleBlur, onClick: onClick, onFilled: submit, onFocus: handleFocus, onFormatError: handleFormatError, onInput: onInput, onNext: onNext, onPrevious: () => monthInputRef.current?.focus(), size: 4, value: controlledValue && controlledValue[0] })] }), !isCompact && jsx(Calendar, {})] }));
|
|
21474
21506
|
}
|
|
21475
21507
|
const DateInput = forwardRef(DateInputWithRef);
|
|
21476
|
-
const Box$
|
|
21508
|
+
const Box$b = styled.div `
|
|
21477
21509
|
align-items: center;
|
|
21478
21510
|
background-color: ${p => (p.$isLight ? p.theme.color.white : p.theme.color.gainsboro)};
|
|
21479
21511
|
box-shadow: ${p => p.$hasError || p.$isFocused
|
|
@@ -21546,9 +21578,9 @@ function RangedTimePicker({ filter, minutesRange, onChange }) {
|
|
|
21546
21578
|
if (!filteredRangedTimeOptions.length) {
|
|
21547
21579
|
return jsx(Fragment, {});
|
|
21548
21580
|
}
|
|
21549
|
-
return (jsx(Box$
|
|
21581
|
+
return (jsx(Box$a, { onClick: stopMouseEventPropagation, role: "listbox", children: filteredRangedTimeOptions.map(({ label, value }, index) => (jsx(Option, { "aria-selected": false, className: "js-ranged-time-picker-option", isSelected: index === selectedOptionIndex, onClick: () => onChange(value), role: "option", tabIndex: -1, children: spannedLabels[index] }, label))) }));
|
|
21550
21582
|
}
|
|
21551
|
-
const Box$
|
|
21583
|
+
const Box$a = styled.div `
|
|
21552
21584
|
background-color: ${p => p.theme.color.white};
|
|
21553
21585
|
box-shadow: inset 0px 0px 0px 1px ${p => p.theme.color.lightGray};
|
|
21554
21586
|
display: flex;
|
|
@@ -21686,10 +21718,10 @@ function TimeInputWithRef({ baseContainer, disabled = false, isCompact, isEndDat
|
|
|
21686
21718
|
}
|
|
21687
21719
|
setControlledValue(value);
|
|
21688
21720
|
}, [isFocused, previousValue, value]);
|
|
21689
|
-
return (jsxs(Box$
|
|
21721
|
+
return (jsxs(Box$9, { ref: boxRef, "$hasError": hasFormatError || hasValidationError, "$isCompact": isCompact, "$isDisabled": disabled, "$isFocused": isFocused, "$isLight": isLight, children: [jsxs(InputGroup, { children: [jsxs("div", { children: [jsx(NumberInput$1, { ref: hourInputRef, "aria-label": `Heure${isStartDate ? ' de début' : ''}${isEndDate ? ' de fin' : ''}`, disabled: disabled, isLight: isLight, max: 23, min: 0, onBack: handleBack, onBlur: handleBlur, onClick: openRangedTimePicker, onFilled: submit, onFocus: handleFocus, onFormatError: handleFormatError, onInput: handleHourInput, onNext: () => minuteInputRef.current?.focus(), onPrevious: onPrevious, size: 2, value: controlledValue && controlledValue[0] }), ":", jsx(NumberInput$1, { ref: minuteInputRef, "aria-label": `Minute${isStartDate ? ' de début' : ''}${isEndDate ? ' de fin' : ''}`, disabled: disabled, isLight: isLight, max: 59, min: 0, onBack: () => hourInputRef.current?.focus(), onBlur: handleBlur, onClick: openRangedTimePicker, onFilled: submit, onFocus: handleFocus, onFormatError: handleFormatError, onInput: onInput, onNext: onNext, onPrevious: () => hourInputRef.current?.focus(), size: 2, value: controlledValue && controlledValue[1] })] }), !isCompact && jsx(Clock, {})] }), isTimePickerOpen && (jsx(RangedTimePicker, { filter: timePickerFilter, minutesRange: minutesRange, onChange: handleTimePickerChange }))] }));
|
|
21690
21722
|
}
|
|
21691
21723
|
const TimeInput = forwardRef(TimeInputWithRef);
|
|
21692
|
-
const Box$
|
|
21724
|
+
const Box$9 = styled.div `
|
|
21693
21725
|
background-color: ${p => (p.$isLight ? p.theme.color.white : p.theme.color.gainsboro)};
|
|
21694
21726
|
box-shadow: ${p => p.$hasError || p.$isFocused
|
|
21695
21727
|
? `inset 0px 0px 0px 1px ${p.$hasError ? p.theme.color.maximumRed : p.theme.color.blueGray[100]}`
|
|
@@ -21861,17 +21893,28 @@ function DatePicker({ baseContainer, className, defaultValue, disabled = false,
|
|
|
21861
21893
|
selectedUtcTimeTupleRef.current = getUtcTimeTupleFromDayjs(selectedUtcDateAsDayjsRef.current);
|
|
21862
21894
|
forceUpdate();
|
|
21863
21895
|
}, [defaultValue, forceUpdate, previousDefaultValue]);
|
|
21864
|
-
return (jsxs(Fieldset, { className: controlledClassName, disabled: disabled, isLegendHidden: isLabelHidden, legend: label, ...nativeProps, children: [jsxs(Box$
|
|
21896
|
+
return (jsxs(Fieldset, { className: controlledClassName, disabled: disabled, hasError: hasError, isLegendHidden: isLabelHidden, legend: label, ...nativeProps, children: [jsxs(Box$8, { ref: boxRef, "$hasError": hasError, "$isDisabled": disabled, children: [jsx(Field$1, { children: jsx(DateInput, { ref: dateInputRef, baseContainer: baseContainer || undefined, disabled: disabled, isCompact: isCompact, isEndDate: isEndDate, isForcedFocused: isCalendarPickerOpenRef.current, isLight: isLight, onChange: handleDateInputChange, onClick: openCalendarPicker, onInput: handleDateOrTimeInputInput, onNext: handleDateInputNext, value: selectedUtcDateTupleRef.current }) }), withTime && (jsx(Field$1, { "$isTimeField": true, children: jsx(TimeInput, { ref: timeInputRef, baseContainer: baseContainer || undefined, disabled: disabled, isCompact: isCompact, isLight: isLight, minutesRange: minutesRange, onBack: () => dateInputRef.current?.focus(true), onChange: handleTimeInputFilled, onFocus: closeCalendarPicker, onInput: handleDateOrTimeInputInput, onPrevious: () => dateInputRef.current?.focus(true), value: selectedUtcTimeTupleRef.current }, JSON.stringify(selectedUtcTimeTupleRef.current)) }))] }), !isErrorMessageHidden && hasError && jsx(FieldError, { children: controlledError }), jsx(CalendarPicker, { isHistorical: isHistorical, isOpen: isCalendarPickerOpenRef.current, onChange: handleCalendarPickerChange, value: calendarPickerDefaultValue })] }));
|
|
21865
21897
|
}
|
|
21866
|
-
const Box$
|
|
21898
|
+
const Box$8 = styled.div `
|
|
21867
21899
|
* {
|
|
21868
21900
|
font-weight: 500;
|
|
21869
21901
|
line-height: 1;
|
|
21870
21902
|
}
|
|
21871
21903
|
|
|
21872
21904
|
color: ${p => p.theme.color.gunMetal};
|
|
21905
|
+
display: inline-flex;
|
|
21873
21906
|
font-size: 13px;
|
|
21907
|
+
outline: ${p => (p.$hasError ? `1px solid ${p.theme.color.maximumRed}` : 0)};
|
|
21874
21908
|
position: relative;
|
|
21909
|
+
|
|
21910
|
+
${p => p.$isDisabled &&
|
|
21911
|
+
css `
|
|
21912
|
+
* {
|
|
21913
|
+
background-color: ${p.theme.color.cultured} !important;
|
|
21914
|
+
color: ${p.theme.color.lightGray} !important;
|
|
21915
|
+
cursor: not-allowed;
|
|
21916
|
+
}
|
|
21917
|
+
`}
|
|
21875
21918
|
`;
|
|
21876
21919
|
const Field$1 = styled.span `
|
|
21877
21920
|
font-size: inherit;
|
|
@@ -21917,12 +21960,12 @@ function RangeCalendarPicker({ defaultValue, isHistorical, isOpen, onChange }) {
|
|
|
21917
21960
|
// and can be used as a container for <RsuiteDateRangePicker />
|
|
21918
21961
|
forceUpdate();
|
|
21919
21962
|
}, [forceUpdate]);
|
|
21920
|
-
return (jsx(Box$
|
|
21963
|
+
return (jsx(Box$7, { ref: boxRef, onClick: stopMouseEventPropagation, children: boxRef.current && (jsx(DateRangePicker$1, { container: boxRef.current, format: "yyyy-MM-dd", locale: RSUITE_CALENDAR_LOCALE, onSelect: handleSelect, open: isOpen, ranges: [], shouldDisableDate: shouldDisableDate,
|
|
21921
21964
|
// `defaultValue` seems to be immediatly cancelled so we come down to using a controlled `value`
|
|
21922
21965
|
// eslint-disable-next-line no-null/no-null
|
|
21923
21966
|
value: controlledValue ?? null })) }));
|
|
21924
21967
|
}
|
|
21925
|
-
const Box$
|
|
21968
|
+
const Box$7 = styled.div `
|
|
21926
21969
|
height: 0;
|
|
21927
21970
|
position: relative;
|
|
21928
21971
|
user-select: none;
|
|
@@ -22316,19 +22359,21 @@ function DateRangePicker({ baseContainer, className, defaultValue, disabled = fa
|
|
|
22316
22359
|
selectedEndTimeTupleRef.current = getUtcTimeTupleFromDayjs(selectedEndDateAsDayjsRef.current);
|
|
22317
22360
|
forceUpdate();
|
|
22318
22361
|
}, [defaultValue, forceUpdate, previousDefaultValue]);
|
|
22319
|
-
return (jsxs(Fieldset, { className: controlledClassName, disabled: disabled, isLegendHidden: isLabelHidden, legend: label, ...nativeProps, children: [jsxs(Box$
|
|
22362
|
+
return (jsxs(Fieldset, { className: controlledClassName, disabled: disabled, hasError: hasError, isLegendHidden: isLabelHidden, legend: label, ...nativeProps, children: [jsxs(Box$6, { "$hasError": hasError, "$isDisabled": disabled, children: [jsx(Field, { children: jsx(DateInput, { ref: startDateInputRef, baseContainer: baseContainer || undefined, disabled: disabled, isCompact: isCompact, isForcedFocused: isRangeCalendarPickerOpenRef.current, isLight: isLight, isRange: true, isStartDate: true, onChange: (nextDateTuple, isFilled) => handleDateInputChange(DateRangePosition.START, nextDateTuple, isFilled), onClick: openRangeCalendarPicker, onInput: handleDateOrTimeInputInput, onNext: handleStartDateInputNext, value: selectedStartDateTupleRef.current }) }), withTime && (jsx(Field, { isTimeField: true, children: jsx(TimeInput, { ref: startTimeInputRef, baseContainer: baseContainer || undefined, disabled: disabled, isCompact: isCompact, isLight: isLight, isStartDate: true, minutesRange: minutesRange, onBack: () => startDateInputRef.current?.focus(true), onChange: nextTimeTuple => handleTimeInputFilled(DateRangePosition.START, nextTimeTuple), onFocus: closeRangeCalendarPicker, onInput: handleDateOrTimeInputInput, onNext: () => endDateInputRef.current?.focus(), onPrevious: () => startDateInputRef.current?.focus(true), value: selectedStartTimeTupleRef.current }) })), jsx(Field, { isEndDateField: true, children: jsx(DateInput, { ref: endDateInputRef, baseContainer: baseContainer || undefined, disabled: disabled, isCompact: isCompact, isEndDate: true, isForcedFocused: isRangeCalendarPickerOpenRef.current, isLight: isLight, isRange: true, onBack: handleEndDateInputPrevious, onChange: (nextDateTuple, isFilled) => handleDateInputChange(DateRangePosition.END, nextDateTuple, isFilled), onClick: openRangeCalendarPicker, onInput: handleDateOrTimeInputInput, onNext: handleEndDateInputNext, onPrevious: handleEndDateInputPrevious, value: selectedEndDateTupleRef.current }) }), withTime && (jsx(Field, { isTimeField: true, children: jsx(TimeInput, { ref: endTimeInputRef, baseContainer: baseContainer || undefined, disabled: disabled, isCompact: isCompact, isEndDate: true, isLight: isLight, minutesRange: minutesRange, onBack: () => endDateInputRef.current?.focus(true), onChange: nextTimeTuple => handleTimeInputFilled(DateRangePosition.END, nextTimeTuple), onFocus: closeRangeCalendarPicker, onInput: handleDateOrTimeInputInput, onPrevious: () => endDateInputRef.current?.focus(true), value: selectedEndTimeTupleRef.current }) }))] }), !isErrorMessageHidden && hasError && jsx(FieldError, { children: controlledError }), jsx(RangeCalendarPicker, { defaultValue: rangeCalendarPickerDefaultValue, isHistorical: isHistorical, isOpen: isRangeCalendarPickerOpenRef.current, onChange: handleRangeCalendarPickerChange })] }));
|
|
22320
22363
|
}
|
|
22321
|
-
const Box$
|
|
22364
|
+
const Box$6 = styled.div `
|
|
22322
22365
|
* {
|
|
22323
22366
|
font-weight: 500;
|
|
22324
22367
|
line-height: 1;
|
|
22325
22368
|
}
|
|
22326
22369
|
|
|
22327
22370
|
color: ${p => p.theme.color.gunMetal};
|
|
22371
|
+
display: inline-flex;
|
|
22328
22372
|
font-size: 13px;
|
|
22373
|
+
outline: ${p => (p.$hasError ? `1px solid ${p.theme.color.maximumRed}` : 0)};
|
|
22329
22374
|
position: relative;
|
|
22330
22375
|
|
|
22331
|
-
${p => p
|
|
22376
|
+
${p => p.$isDisabled &&
|
|
22332
22377
|
css `
|
|
22333
22378
|
* {
|
|
22334
22379
|
background-color: ${p.theme.color.cultured} !important;
|
|
@@ -25761,7 +25806,7 @@ function MultiSelect({ baseContainer, customSearch, customSearchMinQueryLength =
|
|
|
25761
25806
|
useEffect(() => {
|
|
25762
25807
|
forceUpdate();
|
|
25763
25808
|
}, [forceUpdate]);
|
|
25764
|
-
return (jsxs(Field$2, { className: "Field-MultiSelect", children: [jsx(Label, { disabled: disabled, hasError: hasError, htmlFor: originalProps.name, isHidden: isLabelHidden, children: label }), jsx(Box$
|
|
25809
|
+
return (jsxs(Field$2, { className: "Field-MultiSelect", children: [jsx(Label, { disabled: disabled, hasError: hasError, htmlFor: originalProps.name, isHidden: isLabelHidden, children: label }), jsx(Box$5, { ref: boxRef, "$hasError": hasError, "$isActive": isOpen, "$isLight": isLight, onClick: toggle, children: boxRef.current && (jsx(TagPicker, { container: boxRef.current,
|
|
25765
25810
|
// When we use a custom search, we use `controlledRsuiteData` to provide the matching options (data),
|
|
25766
25811
|
// when we don't, we don't need to control that and just pass the non-internally-controlled `rsuiteData`
|
|
25767
25812
|
data: controlledRsuiteData || rsuiteData, disabled: disabled, id: originalProps.name, onChange: handleChange, onClick: toggle, onSearch: handleSearch, open: isOpen, renderMenuItem: renderMenuItem, searchable: !!customSearch || searchable,
|
|
@@ -25769,7 +25814,7 @@ function MultiSelect({ baseContainer, customSearch, customSearchMinQueryLength =
|
|
|
25769
25814
|
// that's why we send this "always true" filter to disable Rsuite TagPicker internal search filtering
|
|
25770
25815
|
searchBy: (customSearch ? () => true : undefined), value: selectedRsuiteValue, ...originalProps }, key)) }), !isErrorMessageHidden && hasError && jsx(FieldError, { children: controlledError })] }));
|
|
25771
25816
|
}
|
|
25772
|
-
const Box$
|
|
25817
|
+
const Box$5 = styled.div `
|
|
25773
25818
|
position: relative;
|
|
25774
25819
|
user-select: none;
|
|
25775
25820
|
width: 100%;
|
|
@@ -25795,7 +25840,7 @@ const Box$4 = styled.div `
|
|
|
25795
25840
|
|
|
25796
25841
|
:active,
|
|
25797
25842
|
:focus {
|
|
25798
|
-
border: solid 1px ${p => p.theme.color.blueGray[100]} !important;
|
|
25843
|
+
border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.blueGray[100])} !important;
|
|
25799
25844
|
}
|
|
25800
25845
|
|
|
25801
25846
|
> .rs-picker-toggle {
|
|
@@ -25903,13 +25948,14 @@ function MultiRadio({ disabled = false, error, isErrorMessageHidden = false, isI
|
|
|
25903
25948
|
onChange(nextCheckedOptionValue);
|
|
25904
25949
|
}, [onChange]);
|
|
25905
25950
|
useFieldUndefineEffect(isUndefinedWhenDisabled && disabled, onChange);
|
|
25906
|
-
return (jsxs(Fieldset, { className: "Field-MultiRadio", disabled: disabled, hasError: hasError, isLegendHidden: isLabelHidden, isLight: isLight, legend: label, children: [jsx(
|
|
25951
|
+
return (jsxs(Fieldset, { className: "Field-MultiRadio", disabled: disabled, hasError: hasError, isLegendHidden: isLabelHidden, isLight: isLight, legend: label, children: [jsx(Box$4, { "$hasError": hasError, "$isInline": isInline, children: options.map(option => (jsx(Radio, { checked: equals$1(option.value, value), disabled: disabled, name: name, onChange: (_, isChecked) => handleChange(option.value, isChecked), children: option.label }, JSON.stringify(option.value)))) }, key), !isErrorMessageHidden && hasError && jsx(FieldError, { children: controlledError })] }));
|
|
25907
25952
|
}
|
|
25908
|
-
const
|
|
25953
|
+
const Box$4 = styled.div `
|
|
25909
25954
|
color: ${p => p.theme.color.gunMetal};
|
|
25910
25955
|
display: flex;
|
|
25911
25956
|
flex-direction: ${p => (p.$isInline ? 'row' : 'column')};
|
|
25912
25957
|
font-weight: 500;
|
|
25958
|
+
outline: ${p => (p.$hasError ? `1px solid ${p.theme.color.maximumRed}` : 0)};
|
|
25913
25959
|
|
|
25914
25960
|
> .rs-radio {
|
|
25915
25961
|
* {
|
|
@@ -26015,11 +26061,14 @@ const Link = styled.a `
|
|
|
26015
26061
|
}
|
|
26016
26062
|
`;
|
|
26017
26063
|
|
|
26018
|
-
function NumberInput({ className, error, isErrorMessageHidden = false, isLabelHidden = false, isLight = false, isUndefinedWhenDisabled = false, label, onChange, style, value, ...originalProps }) {
|
|
26064
|
+
function NumberInput({ className, error, isErrorMessageHidden = false, isLabelHidden = false, isLight = false, isUndefinedWhenDisabled = false, label, onBlur, onChange, onFocus, style, value, ...originalProps }) {
|
|
26065
|
+
// eslint-disable-next-line no-null/no-null
|
|
26066
|
+
const inputRef = useRef(null);
|
|
26019
26067
|
const controlledClassname = useMemo(() => classnames('Field-NumberInput', className), [className]);
|
|
26020
26068
|
const controlledError = useMemo(() => normalizeString(error), [error]);
|
|
26021
26069
|
const hasError = useMemo(() => Boolean(controlledError), [controlledError]);
|
|
26022
26070
|
const key = useKey([originalProps.disabled, originalProps.name]);
|
|
26071
|
+
const preventWheelEvent = usePreventWheelEvent(inputRef);
|
|
26023
26072
|
const handleChange = useCallback((nextValue) => {
|
|
26024
26073
|
if (!onChange) {
|
|
26025
26074
|
return;
|
|
@@ -26029,24 +26078,40 @@ function NumberInput({ className, error, isErrorMessageHidden = false, isLabelHi
|
|
|
26029
26078
|
const normalizedNextValue = !Number.isNaN(nextValueAsNumber) ? nextValueAsNumber : undefined;
|
|
26030
26079
|
onChange(normalizedNextValue);
|
|
26031
26080
|
}, [onChange]);
|
|
26081
|
+
const handleBlur = useCallback((event) => {
|
|
26082
|
+
event.target.removeEventListener('wheel', preventWheelEvent);
|
|
26083
|
+
if (onBlur) {
|
|
26084
|
+
onBlur(event);
|
|
26085
|
+
}
|
|
26086
|
+
}, [onBlur, preventWheelEvent]);
|
|
26087
|
+
const handleFocus = useCallback((event) => {
|
|
26088
|
+
event.target.addEventListener('wheel', preventWheelEvent);
|
|
26089
|
+
if (onFocus) {
|
|
26090
|
+
onFocus(event);
|
|
26091
|
+
}
|
|
26092
|
+
}, [onFocus, preventWheelEvent]);
|
|
26032
26093
|
useFieldUndefineEffect(isUndefinedWhenDisabled && originalProps.disabled, onChange);
|
|
26033
|
-
return (jsxs(Field$2, { className: controlledClassname, style: style, children: [jsx(Label, { disabled: originalProps.disabled, hasError: hasError, htmlFor: originalProps.name, isHidden: isLabelHidden, children: label }), jsx(StyledInput$2, { "$hasError": hasError, "$isLight": isLight, id: originalProps.name, onChange: handleChange, type: "number", value: value || '', ...originalProps }, key), !isErrorMessageHidden && hasError && jsx(FieldError, { children: controlledError })] }));
|
|
26094
|
+
return (jsxs(Field$2, { className: controlledClassname, style: style, children: [jsx(Label, { disabled: originalProps.disabled, hasError: hasError, htmlFor: originalProps.name, isHidden: isLabelHidden, children: label }), jsx(StyledInput$2, { ref: inputRef, "$hasError": hasError, "$isLight": isLight, id: originalProps.name, onBlur: handleBlur, onChange: handleChange, onFocus: handleFocus, type: "number", value: value || '', ...originalProps }, key), !isErrorMessageHidden && hasError && jsx(FieldError, { children: controlledError })] }));
|
|
26034
26095
|
}
|
|
26035
26096
|
const StyledInput$2 = styled(Input) `
|
|
26036
26097
|
background-color: ${p => (p.$isLight ? p.theme.color.white : p.theme.color.gainsboro)};
|
|
26037
|
-
border: solid 1px ${p => p.theme.color.
|
|
26098
|
+
border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.gainsboro)};
|
|
26038
26099
|
border-radius: 0;
|
|
26039
26100
|
font-size: 13px;
|
|
26040
26101
|
/* TODO It should be 18px but computed line-height is stuck to min. 18.5px. Investigate that. */
|
|
26041
26102
|
line-height: 19px;
|
|
26042
|
-
outline: ${p => (p.$hasError ? `1px solid ${p.theme.color.maximumRed}` : 0)};
|
|
26043
26103
|
padding: 3px 8px 6px;
|
|
26044
26104
|
vertical-align: center;
|
|
26045
26105
|
width: 100%;
|
|
26046
26106
|
|
|
26107
|
+
:hover {
|
|
26108
|
+
border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.blueYonder[100])} !important;
|
|
26109
|
+
}
|
|
26110
|
+
|
|
26111
|
+
:active,
|
|
26047
26112
|
:focus {
|
|
26048
|
-
|
|
26049
|
-
outline
|
|
26113
|
+
border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.blueGray[100])} !important;
|
|
26114
|
+
outline: 0;
|
|
26050
26115
|
}
|
|
26051
26116
|
`;
|
|
26052
26117
|
|
|
@@ -35010,7 +35075,7 @@ function Select({ baseContainer, customSearch, customSearchMinQueryLength = 1, d
|
|
|
35010
35075
|
useEffect(() => {
|
|
35011
35076
|
forceUpdate();
|
|
35012
35077
|
}, [forceUpdate]);
|
|
35013
|
-
return (jsxs(Field$2, { className: "Field-Select", children: [jsx(Label, { disabled: disabled, hasError: hasError, htmlFor: originalProps.name, isHidden: isLabelHidden, children: label }), jsx(Box, { ref: boxRef, onClick: toggle, children: boxRef.current && (jsx(StyledSelectPicker, { "$isLight": isLight, cleanable: isCleanable, container: boxRef.current,
|
|
35078
|
+
return (jsxs(Field$2, { className: "Field-Select", children: [jsx(Label, { disabled: disabled, hasError: hasError, htmlFor: originalProps.name, isHidden: isLabelHidden, children: label }), jsx(Box, { ref: boxRef, "$hasError": hasError, onClick: toggle, children: boxRef.current && (jsx(StyledSelectPicker, { "$isLight": isLight, cleanable: isCleanable, container: boxRef.current,
|
|
35014
35079
|
// When we use a custom search, we use `controlledRsuiteData` to provide the matching options (data),
|
|
35015
35080
|
// when we don't, we don't need to control that and just pass the non-internally-controlled `rsuiteData`
|
|
35016
35081
|
data: controlledRsuiteData || rsuiteData, disabled: disabled, id: originalProps.name, onClean: handleClean, onSearch: handleSearch,
|
|
@@ -35036,18 +35101,18 @@ const Box = styled.div `
|
|
|
35036
35101
|
width: 100%;
|
|
35037
35102
|
|
|
35038
35103
|
> .rs-picker-toggle {
|
|
35039
|
-
border: solid 1px ${p => p.theme.color.gainsboro} !important;
|
|
35104
|
+
border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.gainsboro)} !important;
|
|
35040
35105
|
font-size: 13px;
|
|
35041
35106
|
line-height: 1.3846;
|
|
35042
35107
|
padding: 4px 40px 6px 8px;
|
|
35043
35108
|
|
|
35044
35109
|
:hover {
|
|
35045
|
-
border: solid 1px ${p => p.theme.color.blueYonder[100]} !important;
|
|
35110
|
+
border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.blueYonder[100])} !important;
|
|
35046
35111
|
}
|
|
35047
35112
|
|
|
35048
35113
|
:active,
|
|
35049
35114
|
:focus {
|
|
35050
|
-
border: solid 1px ${p => p.theme.color.blueGray[100]} !important;
|
|
35115
|
+
border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.blueGray[100])} !important;
|
|
35051
35116
|
}
|
|
35052
35117
|
|
|
35053
35118
|
> .rs-stack {
|
|
@@ -35117,11 +35182,11 @@ function Textarea({ error, isErrorMessageHidden = false, isLabelHidden = false,
|
|
|
35117
35182
|
onChange(normalizedNextValue);
|
|
35118
35183
|
}, [onChange]);
|
|
35119
35184
|
useFieldUndefineEffect(isUndefinedWhenDisabled && originalProps.disabled, onChange);
|
|
35120
|
-
return (jsxs(Field$2, { className: "Field-Textarea", children: [jsx(Label, { disabled: originalProps.disabled, htmlFor: originalProps.name, isHidden: isLabelHidden, children: label }), jsx(StyledInput$1, { ref: inputRef, "$isLight": isLight, as: "textarea", id: originalProps.name, onChange: handleChange, rows: rows, value: value || '', ...originalProps }, key), !isErrorMessageHidden && hasError && jsx(FieldError, { children: controlledError })] }));
|
|
35185
|
+
return (jsxs(Field$2, { className: "Field-Textarea", children: [jsx(Label, { disabled: originalProps.disabled, hasError: hasError, htmlFor: originalProps.name, isHidden: isLabelHidden, children: label }), jsx(StyledInput$1, { ref: inputRef, "$hasError": hasError, "$isLight": isLight, as: "textarea", id: originalProps.name, onChange: handleChange, rows: rows, value: value || '', ...originalProps }, key), !isErrorMessageHidden && hasError && jsx(FieldError, { children: controlledError })] }));
|
|
35121
35186
|
}
|
|
35122
35187
|
const StyledInput$1 = styled(Input) `
|
|
35123
35188
|
background-color: ${p => (p.$isLight ? p.theme.color.white : p.theme.color.gainsboro)};
|
|
35124
|
-
border:
|
|
35189
|
+
border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.gainsboro)};
|
|
35125
35190
|
font-size: 13px;
|
|
35126
35191
|
padding: 7px 11px;
|
|
35127
35192
|
width: 100%;
|
|
@@ -35129,6 +35194,16 @@ const StyledInput$1 = styled(Input) `
|
|
|
35129
35194
|
::placeholder {
|
|
35130
35195
|
color: ${p => (p.$isLight ? p.theme.color.slateGray : p.theme.color.slateGray)};
|
|
35131
35196
|
}
|
|
35197
|
+
|
|
35198
|
+
:hover {
|
|
35199
|
+
border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.blueYonder[100])} !important;
|
|
35200
|
+
}
|
|
35201
|
+
|
|
35202
|
+
:active,
|
|
35203
|
+
:focus {
|
|
35204
|
+
border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.blueGray[100])} !important;
|
|
35205
|
+
outline: 0;
|
|
35206
|
+
}
|
|
35132
35207
|
`;
|
|
35133
35208
|
|
|
35134
35209
|
function TextInput({ className, error, Icon, isErrorMessageHidden = false, isLabelHidden = false, isLight = false, isUndefinedWhenDisabled = false, label, onChange, size = Size.NORMAL, style, value, ...originalProps }) {
|
|
@@ -35158,12 +35233,11 @@ const PADDING_WITH_ICON = {
|
|
|
35158
35233
|
};
|
|
35159
35234
|
const StyledInput = styled(Input) `
|
|
35160
35235
|
background-color: ${p => (p.$isLight ? p.theme.color.white : p.theme.color.gainsboro)};
|
|
35161
|
-
border: solid 1px ${p => p.theme.color.
|
|
35236
|
+
border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.gainsboro)};
|
|
35162
35237
|
border-radius: 0;
|
|
35163
35238
|
font-size: 13px;
|
|
35164
35239
|
/* TODO It should be 18px but computed line-height is stuck to min. 18.5px. Investigate that. */
|
|
35165
35240
|
line-height: 19px;
|
|
35166
|
-
outline: ${p => (p.$hasError ? `1px solid ${p.theme.color.maximumRed}` : 0)};
|
|
35167
35241
|
padding: ${p => (p.$hasIcon ? PADDING_WITH_ICON[p.$size] : PADDING[p.$size])};
|
|
35168
35242
|
vertical-align: center;
|
|
35169
35243
|
width: 100%;
|
|
@@ -35171,6 +35245,16 @@ const StyledInput = styled(Input) `
|
|
|
35171
35245
|
::placeholder {
|
|
35172
35246
|
color: ${p => (p.$isLight ? p.theme.color.slateGray : p.theme.color.slateGray)};
|
|
35173
35247
|
}
|
|
35248
|
+
|
|
35249
|
+
:hover {
|
|
35250
|
+
border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.blueYonder[100])} !important;
|
|
35251
|
+
}
|
|
35252
|
+
|
|
35253
|
+
:active,
|
|
35254
|
+
:focus {
|
|
35255
|
+
border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.blueGray[100])} !important;
|
|
35256
|
+
outline: 0;
|
|
35257
|
+
}
|
|
35174
35258
|
`;
|
|
35175
35259
|
const InputBox = styled.div `
|
|
35176
35260
|
position: relative;
|