@croquiscom/pds 16.39.1 → 16.40.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.
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { ChangeEvent, InputHTMLAttributes } from 'react';
|
|
2
|
+
import { NumberFormatBaseProps } from 'react-number-format';
|
|
2
3
|
import { InputAffixProps } from './InputAffix';
|
|
3
4
|
import { InputBaseType } from './InputBase';
|
|
4
5
|
type ChangeHandler<T extends boolean = false> = T extends true ? (value: number | null, event: ChangeEvent<HTMLInputElement>) => void : (value: number, event: ChangeEvent<HTMLInputElement>) => void;
|
|
5
|
-
export type NumericInputBaseType<TAllowEmpty extends boolean = false> = Omit<InputBaseType, 'showCounter'> & InputAffixProps & {
|
|
6
|
+
export type NumericInputBaseType<TAllowEmpty extends boolean = false> = Omit<InputBaseType, 'showCounter'> & InputAffixProps & Pick<NumberFormatBaseProps, 'isAllowed'> & {
|
|
6
7
|
value?: number | string | null;
|
|
7
8
|
defaultValue?: number | string;
|
|
8
9
|
/** @default true */
|
|
@@ -12,7 +13,7 @@ export type NumericInputBaseType<TAllowEmpty extends boolean = false> = Omit<Inp
|
|
|
12
13
|
onChange?: ChangeHandler<TAllowEmpty>;
|
|
13
14
|
};
|
|
14
15
|
export type NumericInputProps<TAllowEmpty extends boolean = false> = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'onChange' | 'width' | 'size'> & NumericInputBaseType<TAllowEmpty>;
|
|
15
|
-
export declare const NumericInput: <TAllowEmpty extends boolean = false>(props: Omit<React.InputHTMLAttributes<HTMLInputElement>, "width" | "type" | "onChange" | "size"> & Omit<InputBaseType, "showCounter"> & InputAffixProps & {
|
|
16
|
+
export declare const NumericInput: <TAllowEmpty extends boolean = false>(props: Omit<React.InputHTMLAttributes<HTMLInputElement>, "width" | "type" | "onChange" | "size"> & Omit<InputBaseType, "showCounter"> & InputAffixProps & Pick<NumberFormatBaseProps, "isAllowed"> & {
|
|
16
17
|
value?: string | number | null | undefined;
|
|
17
18
|
defaultValue?: string | number | undefined;
|
|
18
19
|
/** @default true */
|
|
@@ -12,6 +12,7 @@ export declare const Size: Story;
|
|
|
12
12
|
export declare const Disabled: Story;
|
|
13
13
|
export declare const AllowEmpty: Story;
|
|
14
14
|
export declare const WhetherNegativeNumbersAreAllowed: Story;
|
|
15
|
+
export declare const IsAllowed: Story;
|
|
15
16
|
export declare const DecimalScale: Story;
|
|
16
17
|
export declare const EnteredDisabled: Story;
|
|
17
18
|
export declare const RightAlignment: Story;
|