@myunisoft/design-system 1.2.3 → 1.2.5
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/components/Autocomplete/Autocomplete/AutocompleteTag/index.d.ts +3 -6
- package/dist/components/Autocomplete/Autocomplete/index.d.ts +3 -51
- package/dist/components/Autocomplete/Autocomplete/types.d.ts +63 -0
- package/dist/components/VirtualTable/components/ExportDialog/styles.d.ts +1 -1
- package/dist/components/VirtualTable/styles.d.ts +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import { type
|
|
3
|
-
import type { OptionType } from '../
|
|
4
|
-
export type AutocompleteTagProps = {
|
|
2
|
+
import { type ChipProps } from '@mui/material';
|
|
3
|
+
import type { OptionType } from '../types';
|
|
4
|
+
export type AutocompleteTagProps = ChipProps & {
|
|
5
5
|
option?: OptionType;
|
|
6
|
-
label?: string;
|
|
7
6
|
maxChipWidth?: number;
|
|
8
7
|
reserveForCounter?: number;
|
|
9
8
|
isDisabled?: boolean;
|
|
10
|
-
onDelete?: (event: MouseEvent) => void;
|
|
11
|
-
sx?: SxProps<Theme>;
|
|
12
9
|
};
|
|
13
10
|
declare const AutocompleteTag: React.FC<AutocompleteTagProps>;
|
|
14
11
|
export default AutocompleteTag;
|
|
@@ -1,52 +1,4 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
export type OptionType = {
|
|
5
|
-
id: string | number;
|
|
6
|
-
label: string;
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated Use value instead
|
|
9
|
-
*/
|
|
10
|
-
selected?: boolean;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
optionType?: 'default' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning';
|
|
13
|
-
};
|
|
14
|
-
type SingleValueType<T> = T | null;
|
|
15
|
-
type MultiValueType<T> = T[];
|
|
16
|
-
type ValueType<T> = SingleValueType<T> | MultiValueType<T>;
|
|
17
|
-
export type AutocompleteBaseProps<T extends OptionType = OptionType> = {
|
|
18
|
-
label?: string;
|
|
19
|
-
options?: T[];
|
|
20
|
-
isError?: boolean;
|
|
21
|
-
isDisplayLabel?: boolean;
|
|
22
|
-
customSearch?: (inputValue: string, options: T[]) => T[];
|
|
23
|
-
selectAllHidden?: boolean;
|
|
24
|
-
selectAllLabel?: string;
|
|
25
|
-
allSelectedLabel?: string;
|
|
26
|
-
isDisabled?: boolean;
|
|
27
|
-
oneRowMode?: true;
|
|
28
|
-
InputProps?: StandardInputProps;
|
|
29
|
-
onIsSearchingChange?: (isOpen: boolean) => void;
|
|
30
|
-
getOptionLabel?: (option: T) => string;
|
|
31
|
-
onCreate?: (label: string, options: T[]) => void;
|
|
32
|
-
renderTag?: (tagProps: ChipProps, option: T) => ReactNode;
|
|
33
|
-
renderOptionLabel?: (labelChild: ReactNode, option: T) => ReactNode;
|
|
34
|
-
disableAllSelectedTag?: true;
|
|
35
|
-
disableSort?: true;
|
|
36
|
-
variant?: TextFieldVariants;
|
|
37
|
-
isOptionEqualToValue?: (option: T, value: T) => boolean;
|
|
38
|
-
placeholder?: string;
|
|
39
|
-
};
|
|
40
|
-
export type AutocompleteMultipleProps<T extends OptionType = OptionType> = Omit<MuiAutocompleteProps<T, true, false, false>, 'renderInput' | 'renderOption' | 'value' | 'multiple'> & AutocompleteBaseProps<T> & {
|
|
41
|
-
multiple: true;
|
|
42
|
-
value?: MultiValueType<T>;
|
|
43
|
-
onChange?: (newValue: ValueType<T>) => void;
|
|
44
|
-
};
|
|
45
|
-
export type AutocompleteSingleProps<T extends OptionType = OptionType> = Omit<MuiAutocompleteProps<T, false, false, false>, 'renderInput' | 'renderOption' | 'value' | 'multiple'> & AutocompleteBaseProps<T> & {
|
|
46
|
-
multiple?: false;
|
|
47
|
-
value?: SingleValueType<T>;
|
|
48
|
-
onChange?: (newValue: ValueType<T>) => void;
|
|
49
|
-
};
|
|
50
|
-
export type AutocompleteProps<T extends OptionType = OptionType> = AutocompleteMultipleProps<T> | AutocompleteSingleProps<T>;
|
|
51
|
-
declare const Autocomplete: <T extends OptionType = OptionType>(inProps: AutocompleteProps<T>) => React.ReactElement;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { AutocompleteProps, OptionType } from './types';
|
|
3
|
+
declare const Autocomplete: <T = OptionType>(inProps: AutocompleteProps<T>) => React.ReactElement;
|
|
52
4
|
export default Autocomplete;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { AutocompleteRenderOptionState, ChipProps, AutocompleteProps as MuiAutocompleteProps, TextFieldVariants } from '@mui/material';
|
|
3
|
+
import type { InputProps as StandardInputProps } from '@mui/material/Input/Input';
|
|
4
|
+
export type OptionType = {
|
|
5
|
+
id?: string | number;
|
|
6
|
+
label?: string;
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Use value instead
|
|
9
|
+
*/
|
|
10
|
+
selected?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
optionType?: 'default' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning';
|
|
13
|
+
};
|
|
14
|
+
export type SingleValueType<T> = T | null;
|
|
15
|
+
export type MultiValueType<T> = T[];
|
|
16
|
+
export type ValueType<T> = SingleValueType<T> | MultiValueType<T>;
|
|
17
|
+
export type AutocompleteBaseProps<T = OptionType> = {
|
|
18
|
+
label?: string;
|
|
19
|
+
options?: T[];
|
|
20
|
+
isError?: boolean;
|
|
21
|
+
isDisplayLabel?: boolean;
|
|
22
|
+
customSearch?: (inputValue: string, options: T[]) => T[];
|
|
23
|
+
selectAllHidden?: boolean;
|
|
24
|
+
selectAllLabel?: string;
|
|
25
|
+
allSelectedLabel?: string;
|
|
26
|
+
isDisabled?: boolean;
|
|
27
|
+
expandSelectedTagsOnEdition?: false;
|
|
28
|
+
InputProps?: StandardInputProps;
|
|
29
|
+
onIsSearchingChange?: (isOpen: boolean) => void;
|
|
30
|
+
getOptionLabel?: (option: T) => string;
|
|
31
|
+
onCreate?: (label: string, options: T[]) => void;
|
|
32
|
+
renderTag?: (tagProps: ChipProps, option: T) => ReactNode;
|
|
33
|
+
renderOptionLabel?: (labelChild: ReactNode, option: T) => ReactNode;
|
|
34
|
+
disableAllSelectedTag?: true;
|
|
35
|
+
disableSort?: true;
|
|
36
|
+
variant?: TextFieldVariants;
|
|
37
|
+
isOptionEqualToValue?: (option: T, value: T) => boolean;
|
|
38
|
+
placeholder?: string;
|
|
39
|
+
minListWidth?: number;
|
|
40
|
+
helperText?: string;
|
|
41
|
+
};
|
|
42
|
+
export type AutocompleteMultipleProps<T = OptionType> = Omit<MuiAutocompleteProps<T, true, false, false>, 'renderInput' | 'renderOption' | 'value' | 'multiple' | 'onChange'> & AutocompleteBaseProps<T> & {
|
|
43
|
+
multiple: true;
|
|
44
|
+
value?: MultiValueType<T>;
|
|
45
|
+
onChange?: (newValue: MultiValueType<T>) => void;
|
|
46
|
+
};
|
|
47
|
+
export type AutocompleteSingleProps<T = OptionType> = Omit<MuiAutocompleteProps<T, false, false, false>, 'renderInput' | 'renderOption' | 'value' | 'multiple' | 'onChange'> & AutocompleteBaseProps<T> & {
|
|
48
|
+
multiple?: false;
|
|
49
|
+
value?: SingleValueType<T>;
|
|
50
|
+
onChange?: (newValue: SingleValueType<T>) => void;
|
|
51
|
+
};
|
|
52
|
+
export type AutocompleteProps<T = OptionType> = AutocompleteMultipleProps<T> | AutocompleteSingleProps<T>;
|
|
53
|
+
export type ItemData<T = OptionType> = {
|
|
54
|
+
items: Array<{
|
|
55
|
+
key: number;
|
|
56
|
+
group: string;
|
|
57
|
+
children: React.ReactNode;
|
|
58
|
+
} | [React.ReactElement, T, AutocompleteRenderOptionState]>;
|
|
59
|
+
};
|
|
60
|
+
export type AutocompleteContextProps<T = OptionType> = {
|
|
61
|
+
renderOption: (props: React.HTMLAttributes<HTMLLIElement>, option: T, { selected }: AutocompleteRenderOptionState, inlineStyle: React.CSSProperties, currentValue: ValueType<T>) => React.ReactElement;
|
|
62
|
+
value: ValueType<T>;
|
|
63
|
+
};
|
|
@@ -2,7 +2,7 @@ declare const useStyles: (params: void, muiStyleOverridesParams?: {
|
|
|
2
2
|
props: Record<string, unknown>;
|
|
3
3
|
ownerState?: Record<string, unknown> | undefined;
|
|
4
4
|
} | undefined) => {
|
|
5
|
-
classes: Record<"fieldset" | "title" | "
|
|
5
|
+
classes: Record<"fieldset" | "title" | "root" | "checkbox" | "actions" | "exportAllPage" | "checkboxLabel" | "switchButton", string>;
|
|
6
6
|
theme: import("@mui/material/styles").Theme;
|
|
7
7
|
css: import("tss-react/types").Css;
|
|
8
8
|
cx: import("tss-react/types").Cx;
|
|
@@ -2,7 +2,7 @@ declare const useStyles: (params: void, muiStyleOverridesParams?: {
|
|
|
2
2
|
props: Record<string, unknown>;
|
|
3
3
|
ownerState?: Record<string, unknown> | undefined;
|
|
4
4
|
} | undefined) => {
|
|
5
|
-
classes: Record<"center" | "container" | "disabled" | "onError" | "align" | "
|
|
5
|
+
classes: Record<"center" | "container" | "disabled" | "onError" | "align" | "cell" | "checkbox" | "pointer" | "alignLeft" | "alignCenter" | "alignRight" | "thumbnail" | "groupRow" | "cbCell" | "checkmark" | "BodyGrid" | "defaultStyle" | "lockRow" | "alignVerticalCenter" | "alignVerticalBottom" | "alignVerticalTop" | "selectedRow" | "hasSelectAll" | "HeaderGrid" | "GridRow" | "GridColumn" | "LeftSideGridContainer" | "LeftSideGrid" | "mb32" | "hoverRow" | "displayNone", string>;
|
|
6
6
|
theme: import("@mui/material/styles").Theme;
|
|
7
7
|
css: import("tss-react/types").Css;
|
|
8
8
|
cx: import("tss-react/types").Cx;
|