fis-component 0.0.57 → 0.0.59
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/cjs/index.js +21 -9
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/src/components/Combobox/types.d.ts +1 -1
- package/dist/cjs/types/src/components/Input/InputDate/index.d.ts +10 -0
- package/dist/cjs/types/src/components/MenuSelect/types.d.ts +3 -3
- package/dist/cjs/types/src/components/Select/Select.stories.d.ts +2 -0
- package/dist/cjs/types/src/components/Select/index.d.ts +1 -1
- package/dist/cjs/types/src/components/Select/types.d.ts +5 -5
- package/dist/esm/index.js +21 -9
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/src/components/Combobox/types.d.ts +1 -1
- package/dist/esm/types/src/components/Input/InputDate/index.d.ts +10 -0
- package/dist/esm/types/src/components/MenuSelect/types.d.ts +3 -3
- package/dist/esm/types/src/components/Select/Select.stories.d.ts +2 -0
- package/dist/esm/types/src/components/Select/index.d.ts +1 -1
- package/dist/esm/types/src/components/Select/types.d.ts +5 -5
- package/dist/index.d.ts +21 -11
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { InputFieldProps } from "../InputField";
|
|
2
|
+
import dayjs from "dayjs";
|
|
2
3
|
import { InputLabelProps } from "../InputLabel";
|
|
3
4
|
export interface InputDateProps extends Omit<InputFieldProps, "value" | "onChange">, Partial<InputLabelProps> {
|
|
4
5
|
/**Date value*/
|
|
@@ -11,6 +12,15 @@ export interface InputDateProps extends Omit<InputFieldProps, "value" | "onChang
|
|
|
11
12
|
positive?: boolean;
|
|
12
13
|
/** Handle on change action */
|
|
13
14
|
onChange?: (date: Date | null) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Function that returns the HTML element to render the popup container into.
|
|
17
|
+
* Useful for controlling where the date picker dropdown is attached in the DOM.
|
|
18
|
+
*/
|
|
19
|
+
getPopupContainer?: () => HTMLElement;
|
|
20
|
+
/**The minimum selectable date. Dates before this value will be disabled.*/
|
|
21
|
+
minDate?: dayjs.Dayjs | undefined;
|
|
22
|
+
/**The maximum selectable date. Dates after this value will be disabled.*/
|
|
23
|
+
maxDate?: dayjs.Dayjs | undefined;
|
|
14
24
|
}
|
|
15
25
|
declare const FISInputDate: import("react").ForwardRefExoticComponent<InputDateProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
16
26
|
export default FISInputDate;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export interface MenuItem {
|
|
2
2
|
label: string;
|
|
3
3
|
description?: string;
|
|
4
|
-
value: string;
|
|
4
|
+
value: string | number;
|
|
5
5
|
}
|
|
6
6
|
export interface MenuGroup {
|
|
7
7
|
groupLabel?: string;
|
|
@@ -16,8 +16,8 @@ export interface MenuProps {
|
|
|
16
16
|
multi?: boolean;
|
|
17
17
|
searchValue?: string;
|
|
18
18
|
onSearchChange?: (value: string) => void;
|
|
19
|
-
selectedValues?: string[];
|
|
20
|
-
onChangeSelected?: (values: string[]) => void;
|
|
19
|
+
selectedValues?: (string | number)[];
|
|
20
|
+
onChangeSelected?: (values: (string | number)[]) => void;
|
|
21
21
|
loading?: boolean;
|
|
22
22
|
noData?: boolean;
|
|
23
23
|
noResult?: boolean;
|
|
@@ -2,6 +2,7 @@ import { Meta } from "@storybook/react";
|
|
|
2
2
|
import { SelectProps } from "./types";
|
|
3
3
|
type SingleSelectStoryProps = SelectProps<string>;
|
|
4
4
|
type MultiSelectStoryProps = SelectProps<string>;
|
|
5
|
+
type NumberSelectStoryProps = SelectProps<number>;
|
|
5
6
|
declare const _default: Meta<SingleSelectStoryProps>;
|
|
6
7
|
export default _default;
|
|
7
8
|
export declare const Default: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, SingleSelectStoryProps>;
|
|
@@ -11,3 +12,4 @@ export declare const WithValidation: import("@storybook/core/csf").AnnotatedStor
|
|
|
11
12
|
export declare const Loading: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, SingleSelectStoryProps>;
|
|
12
13
|
export declare const LargeSize: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, SingleSelectStoryProps>;
|
|
13
14
|
export declare const Disabled: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, SingleSelectStoryProps>;
|
|
15
|
+
export declare const NumberType: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, NumberSelectStoryProps>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SelectProps } from "./types";
|
|
2
|
-
declare const FISSelect: import("react").ForwardRefExoticComponent<SelectProps<string> & import("react").RefAttributes<HTMLInputElement>>;
|
|
2
|
+
declare const FISSelect: import("react").ForwardRefExoticComponent<SelectProps<string | number> & import("react").RefAttributes<HTMLInputElement>>;
|
|
3
3
|
export default FISSelect;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InputLabelProps } from "../Input/InputLabel";
|
|
2
2
|
import { MenuProps } from "../MenuSelect/types";
|
|
3
3
|
import { SelectFieldProps } from "../SelectItem";
|
|
4
|
-
export interface SelectOption<T = string> {
|
|
4
|
+
export interface SelectOption<T = string | number> {
|
|
5
5
|
groupLabel?: string;
|
|
6
6
|
items: {
|
|
7
7
|
label: string;
|
|
@@ -9,7 +9,7 @@ export interface SelectOption<T = string> {
|
|
|
9
9
|
value: T;
|
|
10
10
|
}[];
|
|
11
11
|
}
|
|
12
|
-
type BaseSelectProps<T> = Partial<InputLabelProps> & Omit<MenuProps, "groups" | "multi" | "selectedValues" | "onChangeSelected" | "onClickMenu" | "size"> & Omit<SelectFieldProps, "value" | "onChange"> & {
|
|
12
|
+
type BaseSelectProps<T extends string | number> = Partial<InputLabelProps> & Omit<MenuProps, "groups" | "multi" | "selectedValues" | "onChangeSelected" | "onClickMenu" | "size"> & Omit<SelectFieldProps, "value" | "onChange"> & {
|
|
13
13
|
options: SelectOption<T>[];
|
|
14
14
|
message?: string;
|
|
15
15
|
disabled?: boolean;
|
|
@@ -19,17 +19,17 @@ type BaseSelectProps<T> = Partial<InputLabelProps> & Omit<MenuProps, "groups" |
|
|
|
19
19
|
renderOption?: (option: SelectOption<T>) => React.ReactNode;
|
|
20
20
|
portal?: boolean;
|
|
21
21
|
};
|
|
22
|
-
export type SingleSelectProps<T> = BaseSelectProps<T> & {
|
|
22
|
+
export type SingleSelectProps<T extends string | number> = BaseSelectProps<T> & {
|
|
23
23
|
multi?: false;
|
|
24
24
|
value: T;
|
|
25
25
|
onChange: (value: T) => void;
|
|
26
26
|
displayValue?: (value: SelectOption<T>) => string;
|
|
27
27
|
};
|
|
28
|
-
export type MultiSelectProps<T> = BaseSelectProps<T> & {
|
|
28
|
+
export type MultiSelectProps<T extends string | number> = BaseSelectProps<T> & {
|
|
29
29
|
multi: true;
|
|
30
30
|
value: T[];
|
|
31
31
|
onChange: (value: T[]) => void;
|
|
32
32
|
displayValue?: (value: SelectOption<T>[]) => string;
|
|
33
33
|
};
|
|
34
|
-
export type SelectProps<T> = SingleSelectProps<T> | MultiSelectProps<T>;
|
|
34
|
+
export type SelectProps<T extends string | number> = SingleSelectProps<T> | MultiSelectProps<T>;
|
|
35
35
|
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -3,12 +3,13 @@ import React__default, { ComponentPropsWithoutRef, ReactNode, Ref, ForwardedRef,
|
|
|
3
3
|
import { DefaultTheme } from 'styled-components';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
import { TooltipProps as TooltipProps$1, CollapseProps, TableProps as TableProps$1, PaginationProps as PaginationProps$1 } from 'antd';
|
|
6
|
+
import * as dayjs from 'dayjs';
|
|
7
|
+
import dayjs__default from 'dayjs';
|
|
6
8
|
import * as antd_es_config_provider from 'antd/es/config-provider';
|
|
7
9
|
import * as antd_es__util_statusUtils from 'antd/es/_util/statusUtils';
|
|
8
10
|
import * as antd_es_button from 'antd/es/button';
|
|
9
11
|
import * as antd_es_date_picker_generatePicker from 'antd/es/date-picker/generatePicker';
|
|
10
12
|
import * as rc_picker from 'rc-picker';
|
|
11
|
-
import * as dayjs from 'dayjs';
|
|
12
13
|
import * as antd_es_notification_interface from 'antd/es/notification/interface';
|
|
13
14
|
|
|
14
15
|
interface ThemeProviderProps {
|
|
@@ -3848,7 +3849,7 @@ declare const FISTooltip: FC<TooltipProps>;
|
|
|
3848
3849
|
interface MenuItem {
|
|
3849
3850
|
label: string;
|
|
3850
3851
|
description?: string;
|
|
3851
|
-
value: string;
|
|
3852
|
+
value: string | number;
|
|
3852
3853
|
}
|
|
3853
3854
|
interface MenuGroup {
|
|
3854
3855
|
groupLabel?: string;
|
|
@@ -3863,8 +3864,8 @@ interface MenuProps {
|
|
|
3863
3864
|
multi?: boolean;
|
|
3864
3865
|
searchValue?: string;
|
|
3865
3866
|
onSearchChange?: (value: string) => void;
|
|
3866
|
-
selectedValues?: string[];
|
|
3867
|
-
onChangeSelected?: (values: string[]) => void;
|
|
3867
|
+
selectedValues?: (string | number)[];
|
|
3868
|
+
onChangeSelected?: (values: (string | number)[]) => void;
|
|
3868
3869
|
loading?: boolean;
|
|
3869
3870
|
noData?: boolean;
|
|
3870
3871
|
noResult?: boolean;
|
|
@@ -3993,7 +3994,7 @@ interface ComboboxOption {
|
|
|
3993
3994
|
}[];
|
|
3994
3995
|
}
|
|
3995
3996
|
type SingleSelect<T> = {
|
|
3996
|
-
multi?:
|
|
3997
|
+
multi?: false;
|
|
3997
3998
|
value: T;
|
|
3998
3999
|
onChange: (value: T) => void;
|
|
3999
4000
|
displayValue?: (value: ComboboxOption) => string;
|
|
@@ -4059,6 +4060,15 @@ interface InputDateProps extends Omit<InputFieldProps, "value" | "onChange">, Pa
|
|
|
4059
4060
|
positive?: boolean;
|
|
4060
4061
|
/** Handle on change action */
|
|
4061
4062
|
onChange?: (date: Date | null) => void;
|
|
4063
|
+
/**
|
|
4064
|
+
* Function that returns the HTML element to render the popup container into.
|
|
4065
|
+
* Useful for controlling where the date picker dropdown is attached in the DOM.
|
|
4066
|
+
*/
|
|
4067
|
+
getPopupContainer?: () => HTMLElement;
|
|
4068
|
+
/**The minimum selectable date. Dates before this value will be disabled.*/
|
|
4069
|
+
minDate?: dayjs__default.Dayjs | undefined;
|
|
4070
|
+
/**The maximum selectable date. Dates after this value will be disabled.*/
|
|
4071
|
+
maxDate?: dayjs__default.Dayjs | undefined;
|
|
4062
4072
|
}
|
|
4063
4073
|
declare const FISInputDate: React$1.ForwardRefExoticComponent<InputDateProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
4064
4074
|
|
|
@@ -4220,7 +4230,7 @@ interface SelectFieldProps extends Omit<ComponentPropsWithoutRef<"input">, "onCl
|
|
|
4220
4230
|
}
|
|
4221
4231
|
declare const FISSelectItem: React$1.ForwardRefExoticComponent<SelectFieldProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
4222
4232
|
|
|
4223
|
-
interface SelectOption<T = string> {
|
|
4233
|
+
interface SelectOption<T = string | number> {
|
|
4224
4234
|
groupLabel?: string;
|
|
4225
4235
|
items: {
|
|
4226
4236
|
label: string;
|
|
@@ -4228,7 +4238,7 @@ interface SelectOption<T = string> {
|
|
|
4228
4238
|
value: T;
|
|
4229
4239
|
}[];
|
|
4230
4240
|
}
|
|
4231
|
-
type BaseSelectProps<T> = Partial<InputLabelProps> & Omit<MenuProps, "groups" | "multi" | "selectedValues" | "onChangeSelected" | "onClickMenu" | "size"> & Omit<SelectFieldProps, "value" | "onChange"> & {
|
|
4241
|
+
type BaseSelectProps<T extends string | number> = Partial<InputLabelProps> & Omit<MenuProps, "groups" | "multi" | "selectedValues" | "onChangeSelected" | "onClickMenu" | "size"> & Omit<SelectFieldProps, "value" | "onChange"> & {
|
|
4232
4242
|
options: SelectOption<T>[];
|
|
4233
4243
|
message?: string;
|
|
4234
4244
|
disabled?: boolean;
|
|
@@ -4238,21 +4248,21 @@ type BaseSelectProps<T> = Partial<InputLabelProps> & Omit<MenuProps, "groups" |
|
|
|
4238
4248
|
renderOption?: (option: SelectOption<T>) => React.ReactNode;
|
|
4239
4249
|
portal?: boolean;
|
|
4240
4250
|
};
|
|
4241
|
-
type SingleSelectProps<T> = BaseSelectProps<T> & {
|
|
4251
|
+
type SingleSelectProps<T extends string | number> = BaseSelectProps<T> & {
|
|
4242
4252
|
multi?: false;
|
|
4243
4253
|
value: T;
|
|
4244
4254
|
onChange: (value: T) => void;
|
|
4245
4255
|
displayValue?: (value: SelectOption<T>) => string;
|
|
4246
4256
|
};
|
|
4247
|
-
type MultiSelectProps<T> = BaseSelectProps<T> & {
|
|
4257
|
+
type MultiSelectProps<T extends string | number> = BaseSelectProps<T> & {
|
|
4248
4258
|
multi: true;
|
|
4249
4259
|
value: T[];
|
|
4250
4260
|
onChange: (value: T[]) => void;
|
|
4251
4261
|
displayValue?: (value: SelectOption<T>[]) => string;
|
|
4252
4262
|
};
|
|
4253
|
-
type SelectProps<T> = SingleSelectProps<T> | MultiSelectProps<T>;
|
|
4263
|
+
type SelectProps<T extends string | number> = SingleSelectProps<T> | MultiSelectProps<T>;
|
|
4254
4264
|
|
|
4255
|
-
declare const FISSelect: React$1.ForwardRefExoticComponent<SelectProps<string> & React$1.RefAttributes<HTMLInputElement>>;
|
|
4265
|
+
declare const FISSelect: React$1.ForwardRefExoticComponent<SelectProps<string | number> & React$1.RefAttributes<HTMLInputElement>>;
|
|
4256
4266
|
|
|
4257
4267
|
type NotificationBaseProps = {
|
|
4258
4268
|
title: string | React.ReactElement;
|