Renamed nullable utils into isDefined and isUndefinedOrNull (#4402)
* Renamed nullable utils into isDefined and isUndefinedOrNull
This commit is contained in:
@ -7,7 +7,7 @@ import { SETTINGS_FIELD_CURRENCY_CODES } from '@/settings/data-model/constants/S
|
||||
import { IconComponent } from '@/ui/display/icon/types/IconComponent';
|
||||
import { CurrencyPickerDropdownButton } from '@/ui/input/components/internal/currency/components/CurrencyPickerDropdownButton';
|
||||
import { TEXT_INPUT_STYLE } from '@/ui/theme/constants/TextInputStyle';
|
||||
import { isNonNullable } from '~/utils/isNonNullable';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
|
||||
export const StyledInput = styled.input`
|
||||
margin: 0;
|
||||
@ -118,7 +118,7 @@ export const CurrencyInput = ({
|
||||
|
||||
useEffect(() => {
|
||||
const currency = currencies.find(({ value }) => value === currencyCode);
|
||||
if (isNonNullable(currency)) {
|
||||
if (isDefined(currency)) {
|
||||
setInternalCurrency(currency);
|
||||
}
|
||||
}, [currencies, currencyCode]);
|
||||
|
||||
@ -5,7 +5,7 @@ import { Key } from 'ts-key-enum';
|
||||
import { FieldDoubleText } from '@/object-record/record-field/types/FieldDoubleText';
|
||||
import { useScopedHotkeys } from '@/ui/utilities/hotkey/hooks/useScopedHotkeys';
|
||||
import { useListenClickOutside } from '@/ui/utilities/pointer-event/hooks/useListenClickOutside';
|
||||
import { isNonNullable } from '~/utils/isNonNullable';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
|
||||
import { StyledInput } from './TextInput';
|
||||
|
||||
@ -147,7 +147,7 @@ export const DoubleTextInput = ({
|
||||
secondValue: secondInternalValue,
|
||||
});
|
||||
},
|
||||
enabled: isNonNullable(onClickOutside),
|
||||
enabled: isDefined(onClickOutside),
|
||||
});
|
||||
|
||||
return (
|
||||
|
||||
@ -4,7 +4,7 @@ import styled from '@emotion/styled';
|
||||
|
||||
import { useRegisterInputEvents } from '@/object-record/record-field/meta-types/input/hooks/useRegisterInputEvents';
|
||||
import { TEXT_INPUT_STYLE } from '@/ui/theme/constants/TextInputStyle';
|
||||
import { isNonNullable } from '~/utils/isNonNullable';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
|
||||
export type TextAreaInputProps = {
|
||||
disabled?: boolean;
|
||||
@ -56,7 +56,7 @@ export const TextAreaInput = ({
|
||||
const wrapperRef = useRef<HTMLTextAreaElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (isNonNullable(wrapperRef.current)) {
|
||||
if (isDefined(wrapperRef.current)) {
|
||||
wrapperRef.current.setSelectionRange(
|
||||
wrapperRef.current.value.length,
|
||||
wrapperRef.current.value.length,
|
||||
|
||||
Reference in New Issue
Block a user