@mw-kit/mw-ui 1.7.25 → 1.7.28
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/Calendar/components/Basic/interfaces.d.ts +2 -2
- package/dist/components/Filters/Filters/components/Submenu/components/Header/interfaces.d.ts +2 -2
- package/dist/components/Filters/Filters/interfaces.d.ts +2 -2
- package/dist/components/Filters/interfaces.d.ts +3 -3
- package/dist/components/Input/components/Checkbox/interfaces.d.ts +4 -2
- package/dist/components/Input/components/DatePicker/interfaces.d.ts +1 -1
- package/dist/components/Input/components/Input/interfaces.d.ts +6 -2
- package/dist/components/Input/components/Input/styles.d.ts +5 -0
- package/dist/components/Input/components/RadioButton/interfaces.d.ts +2 -2
- package/dist/components/Input/components/Range/interfaces.d.ts +5 -5
- package/dist/components/Input/components/Select/hooks/Select/interfaces.d.ts +3 -2
- package/dist/components/Input/components/Select/hooks/SelectMultiple/components/Label/index.d.ts +7 -0
- package/dist/components/Input/components/Select/hooks/SelectMultiple/interfaces.d.ts +4 -4
- package/dist/components/Input/components/Select/hooks/interfaces.d.ts +17 -26
- package/dist/components/Input/components/Switch/interfaces.d.ts +5 -5
- package/dist/components/Input/components/Tags/interfaces.d.ts +2 -2
- package/dist/components/Menu/interfaces.d.ts +14 -14
- package/dist/components/ScrollContainer/interfaces.d.ts +4 -4
- package/dist/index.js +340 -316
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +340 -316
- package/dist/index.modern.js.map +1 -1
- package/dist/interfaces.d.ts +2 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ReactNode } from '../../../../interfaces';
|
|
3
3
|
import { AbsoluteContainerProps } from '../../../AbsoluteContainer/interfaces';
|
|
4
4
|
import { IndicatorProps } from '../../../Indicator/interfaces';
|
|
5
5
|
export interface CalendarInterface {
|
|
@@ -8,7 +8,7 @@ export interface CalendarInterface {
|
|
|
8
8
|
weeks: Date[][];
|
|
9
9
|
}
|
|
10
10
|
export interface Common extends React.HTMLAttributes<HTMLDivElement> {
|
|
11
|
-
label?:
|
|
11
|
+
label?: ReactNode;
|
|
12
12
|
initialMonth?: Date;
|
|
13
13
|
max?: Date;
|
|
14
14
|
min?: Date;
|
package/dist/components/Filters/Filters/components/Submenu/components/Header/interfaces.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from '../../../../../../../interfaces';
|
|
2
2
|
export interface HeaderProps {
|
|
3
3
|
search: [string, (value: string) => void];
|
|
4
4
|
title: string | {
|
|
5
5
|
text: string;
|
|
6
|
-
element:
|
|
6
|
+
element: ReactNode;
|
|
7
7
|
};
|
|
8
8
|
/** se o filtro for do tipo callback, podera ser enviado este parametro para indicar se o filtro permite busca com string vazia */
|
|
9
9
|
allowEmptySearch?: boolean;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ReactNode, SpacingOrZero } from '../../../interfaces';
|
|
3
3
|
import { AbsoluteContainerProps } from '../../AbsoluteContainer/interfaces';
|
|
4
4
|
import { ButtonProps } from '../Button/interfaces';
|
|
5
5
|
import { AppliedFilter } from '../interfaces';
|
|
6
6
|
export interface Label {
|
|
7
7
|
text: string;
|
|
8
|
-
element:
|
|
8
|
+
element: ReactNode;
|
|
9
9
|
}
|
|
10
10
|
declare type LabelOrString = string | Label;
|
|
11
11
|
export interface Option {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from '../../interfaces';
|
|
2
2
|
export interface AppliedFilter {
|
|
3
3
|
/** nome da chave do filtro */
|
|
4
4
|
name: string;
|
|
@@ -7,12 +7,12 @@ export interface AppliedFilter {
|
|
|
7
7
|
/** label do filtro */
|
|
8
8
|
filter: {
|
|
9
9
|
text: string;
|
|
10
|
-
element:
|
|
10
|
+
element: ReactNode;
|
|
11
11
|
};
|
|
12
12
|
/** label da opcao escolhida */
|
|
13
13
|
option: {
|
|
14
14
|
text: string;
|
|
15
|
-
element:
|
|
15
|
+
element: ReactNode;
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
18
|
/** valor da opcao escolhida */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ReactNode } from '../../../../interfaces';
|
|
3
3
|
import { spacings } from '../../../../theme/constants';
|
|
4
4
|
interface Padding {
|
|
5
5
|
top?: string | keyof typeof spacings;
|
|
@@ -14,8 +14,9 @@ export interface LabelContentProps {
|
|
|
14
14
|
bordered?: true;
|
|
15
15
|
}
|
|
16
16
|
export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'>, LabelContentProps {
|
|
17
|
-
label?:
|
|
17
|
+
label?: ReactNode | React.FunctionComponent<LabelContentProps>;
|
|
18
18
|
type: 'checkbox';
|
|
19
|
+
width?: string;
|
|
19
20
|
}
|
|
20
21
|
export interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
|
|
21
22
|
disabled?: 1 | 0;
|
|
@@ -23,5 +24,6 @@ export interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement>
|
|
|
23
24
|
invalid?: 1 | 0;
|
|
24
25
|
padding?: Padding;
|
|
25
26
|
bordered?: 1 | 0;
|
|
27
|
+
width?: string;
|
|
26
28
|
}
|
|
27
29
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AbsoluteSingleCalendarProps } from '../../../Calendar/interfaces';
|
|
2
2
|
import { InputProps } from '../Input/interfaces';
|
|
3
|
-
export interface DatePickerProps extends Omit<InputProps, 'type' | 'mask' | 'icon' | 'htmlDisabled' | 'clearable' | 'onPressEnter' | 'min' | 'max'> {
|
|
3
|
+
export interface DatePickerProps extends Omit<InputProps, 'type' | 'mask' | 'icon' | 'htmlDisabled' | 'htmlReadonly' | 'clearable' | 'onPressEnter' | 'min' | 'max' | 'children'> {
|
|
4
4
|
type: 'datepicker';
|
|
5
5
|
picker?: true | Omit<AbsoluteSingleCalendarProps, 'initialValue' | 'onSubmit' | 'invalid' | 'open'>;
|
|
6
6
|
value: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ReactNode } from '../../../../interfaces';
|
|
3
3
|
import { IconProps } from '../../../Icon/interfaces';
|
|
4
4
|
import { Mask } from '../../interfaces';
|
|
5
5
|
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
6
|
-
label?:
|
|
6
|
+
label?: ReactNode;
|
|
7
7
|
invalid?: boolean;
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
loading?: boolean;
|
|
@@ -18,17 +18,21 @@ export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>
|
|
|
18
18
|
setValue?: (value: string) => void;
|
|
19
19
|
onPressEnter?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
20
20
|
htmlDisabled?: boolean;
|
|
21
|
+
htmlReadOnly?: boolean;
|
|
21
22
|
type?: 'text' | 'number' | 'search' | 'email' | 'url' | 'PASSWORD';
|
|
22
23
|
width?: string;
|
|
23
24
|
arrows?: boolean;
|
|
24
25
|
borderless?: boolean;
|
|
25
26
|
paddingless?: boolean;
|
|
26
27
|
inputWidth?: string;
|
|
28
|
+
children?: React.ReactNode;
|
|
27
29
|
}
|
|
28
30
|
export interface StyledLabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
|
|
31
|
+
readOnly: 1 | 0;
|
|
29
32
|
invalid: 1 | 0;
|
|
30
33
|
disabled: 1 | 0;
|
|
31
34
|
paddingless: 1 | 0;
|
|
35
|
+
loading: 1 | 0;
|
|
32
36
|
icon?: {
|
|
33
37
|
width: string | number;
|
|
34
38
|
position: 'left' | 'right';
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { StyledInputProps, StyledLabelProps, StyledLabelTextProps } from './interfaces';
|
|
2
3
|
export declare const IconContainer: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
4
|
+
export declare const ChildrenContainer: import("styled-components").StyledComponent<(props: import("react").HTMLAttributes<HTMLDivElement>) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
|
|
3
5
|
export declare const Input: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, StyledInputProps, never>;
|
|
6
|
+
export declare const InputContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
7
|
+
width?: string | undefined;
|
|
8
|
+
}, never>;
|
|
4
9
|
export declare const Label: import("styled-components").StyledComponent<"label", import("styled-components").DefaultTheme, StyledLabelProps, never>;
|
|
5
10
|
export declare const LabelText: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, StyledLabelTextProps, never>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { ReactNode } from '../../../../interfaces';
|
|
3
3
|
export interface RadioButtonProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {
|
|
4
|
-
label?:
|
|
4
|
+
label?: ReactNode;
|
|
5
5
|
required?: boolean;
|
|
6
6
|
invalid?: boolean;
|
|
7
7
|
type: 'radio';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ReactNode } from '../../../../interfaces';
|
|
3
3
|
export interface Marker {
|
|
4
|
-
label:
|
|
4
|
+
label: ReactNode;
|
|
5
5
|
value: number;
|
|
6
6
|
}
|
|
7
7
|
export interface RangeProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'min' | 'max' | 'onChange'> {
|
|
8
8
|
type: 'range';
|
|
9
|
-
label?:
|
|
10
|
-
minLabel?:
|
|
11
|
-
maxLabel?:
|
|
9
|
+
label?: ReactNode;
|
|
10
|
+
minLabel?: ReactNode;
|
|
11
|
+
maxLabel?: ReactNode;
|
|
12
12
|
invalid?: boolean;
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
required?: boolean;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { CommonContext,
|
|
1
|
+
import { CommonContext, CommonProps, Option } from '../interfaces';
|
|
2
2
|
export interface SelectProps extends CommonProps {
|
|
3
3
|
type: 'select';
|
|
4
4
|
name?: string;
|
|
5
|
-
setValue: (value: string, option: Option) => void;
|
|
5
|
+
setValue: (value: string, option: Option['data']) => void;
|
|
6
|
+
onClear: (value: string) => void;
|
|
6
7
|
value: string;
|
|
7
8
|
}
|
|
8
9
|
export declare type ContextInterface = CommonContext<SelectProps>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { CommonContext,
|
|
2
|
+
import { CommonContext, CommonProps } from '../interfaces';
|
|
3
3
|
export interface SelectProps extends CommonProps {
|
|
4
4
|
type: 'select-multiple';
|
|
5
|
-
setValue: (value: string[]
|
|
6
|
-
value: string[]
|
|
5
|
+
setValue: (value: string[]) => void;
|
|
6
|
+
value: string[];
|
|
7
7
|
selectAll?: boolean;
|
|
8
8
|
}
|
|
9
9
|
export interface ContextInterface extends CommonContext<SelectProps> {
|
|
10
|
-
checked: [
|
|
10
|
+
checked: [string[], React.Dispatch<React.SetStateAction<string[]>>];
|
|
11
11
|
}
|
|
12
12
|
export * from '../interfaces';
|
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { ReactNode, GenericObject, SpacingOrZero, Spacings } from '../../../../../interfaces';
|
|
3
3
|
import { Position } from '../../../../AbsoluteContainer/interfaces';
|
|
4
4
|
import { Option as MenuOption } from '../../../../Menu/interfaces';
|
|
5
5
|
import { InputProps } from '../../Input/interfaces';
|
|
6
|
-
export
|
|
7
|
-
label: string | {
|
|
8
|
-
text: string;
|
|
9
|
-
element: ElementOrString;
|
|
10
|
-
};
|
|
6
|
+
export declare type SelectOptionLabelProps<T extends GenericObject = GenericObject> = {
|
|
11
7
|
value: string;
|
|
12
|
-
data
|
|
8
|
+
data: T;
|
|
13
9
|
disabled?: boolean;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
mode?: 'placeholder';
|
|
11
|
+
};
|
|
12
|
+
export declare type SelectOptionLabelComponent<T extends GenericObject = GenericObject> = React.FunctionComponent<SelectOptionLabelProps<T>>;
|
|
13
|
+
export declare type Option<T extends GenericObject = GenericObject> = Pick<MenuOption, 'onClick' | 'rules' | 'data' | 'disabled'> & {
|
|
14
|
+
label: ReactNode | SelectOptionLabelComponent<T>;
|
|
15
|
+
value: string;
|
|
16
|
+
};
|
|
17
|
+
interface LoaderReturn<T extends GenericObject = GenericObject> {
|
|
18
|
+
options: Option<T>[];
|
|
21
19
|
lastPage: boolean;
|
|
22
20
|
}
|
|
23
|
-
export declare type Loader = (search: string, page: number) => Promise<LoaderReturn | Option[]>;
|
|
24
|
-
export interface CommonProps extends Omit<InputProps, 'type' | 'mask' | 'icon' | 'setValue' | 'name' | 'value' | 'onChange'> {
|
|
21
|
+
export declare type Loader<T extends GenericObject = GenericObject> = (search: string, page: number) => Promise<LoaderReturn<T> | Option<T>[]>;
|
|
22
|
+
export interface CommonProps extends Omit<InputProps, 'type' | 'mask' | 'icon' | 'setValue' | 'name' | 'value' | 'onChange' | 'children' | 'clearable'> {
|
|
25
23
|
onScrollEnd?: () => Promise<void>;
|
|
26
24
|
position?: Position;
|
|
27
25
|
search?: boolean;
|
|
@@ -43,18 +41,10 @@ export interface CommonContext<SelectProps extends CommonProps> extends BaseCont
|
|
|
43
41
|
props: SelectProps;
|
|
44
42
|
options: Option[];
|
|
45
43
|
}
|
|
46
|
-
export interface ParsedOption extends MenuOption {
|
|
47
|
-
label: {
|
|
48
|
-
text: string;
|
|
49
|
-
element: ElementOrString;
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
44
|
export interface useSelectReturn {
|
|
53
|
-
parsedOptions:
|
|
45
|
+
parsedOptions: MenuOption[];
|
|
54
46
|
options: [Option[], React.Dispatch<React.SetStateAction<Option[]>>];
|
|
55
|
-
|
|
56
|
-
value: string;
|
|
57
|
-
};
|
|
47
|
+
inputContent: React.ReactNode;
|
|
58
48
|
onReset: () => void;
|
|
59
49
|
menu: {
|
|
60
50
|
itemSpacing?: SpacingOrZero | Spacings;
|
|
@@ -63,5 +53,6 @@ export interface useSelectReturn {
|
|
|
63
53
|
maxHeight: string;
|
|
64
54
|
};
|
|
65
55
|
getContext: (base: BaseContext, children: JSX.Element) => JSX.Element;
|
|
56
|
+
onClear: () => void;
|
|
66
57
|
}
|
|
67
58
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { ReactNode } from '../../../../interfaces';
|
|
3
3
|
export interface SwitchProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {
|
|
4
|
-
label?:
|
|
5
|
-
label?:
|
|
6
|
-
before?:
|
|
7
|
-
after?:
|
|
4
|
+
label?: ReactNode | {
|
|
5
|
+
label?: ReactNode;
|
|
6
|
+
before?: ReactNode;
|
|
7
|
+
after?: ReactNode;
|
|
8
8
|
};
|
|
9
9
|
labelProps?: React.LabelHTMLAttributes<HTMLLabelElement>;
|
|
10
10
|
required?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ReactNode } from '../../../../interfaces';
|
|
3
3
|
import { InputProps } from './components/Input/interfaces';
|
|
4
4
|
export interface LabelProps extends React.HTMLAttributes<HTMLLabelElement> {
|
|
5
5
|
disabled?: boolean;
|
|
@@ -10,7 +10,7 @@ export interface TagContainerProps extends React.HTMLAttributes<HTMLDivElement>
|
|
|
10
10
|
}
|
|
11
11
|
export interface TagsProps {
|
|
12
12
|
type: 'tags';
|
|
13
|
-
label?:
|
|
13
|
+
label?: ReactNode;
|
|
14
14
|
width?: string;
|
|
15
15
|
disabled?: boolean;
|
|
16
16
|
loading?: boolean;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PopupProps } from 'semantic-ui-react';
|
|
3
|
-
import { Borders,
|
|
3
|
+
import { Borders, ReactNode, GenericObject, SpacingOrZero, Spacings } from '../../interfaces';
|
|
4
4
|
import { AbsoluteContainerProps } from '../AbsoluteContainer/interfaces';
|
|
5
5
|
/** funcao que fara a validacao da regra, deve retornar true caso passe na validacao, e false ou o conteudo do popup caso contrario */
|
|
6
|
-
declare type Rule = (index: number, data:
|
|
7
|
-
export
|
|
8
|
-
label: string | {
|
|
9
|
-
text: string;
|
|
10
|
-
element: ElementOrString;
|
|
11
|
-
};
|
|
6
|
+
declare type Rule = (index: number, data: GenericObject) => boolean | Omit<PopupProps, 'trigger'>;
|
|
7
|
+
export declare type MenuOptionLabelProps<T extends GenericObject = GenericObject> = {
|
|
12
8
|
delimiter?: boolean;
|
|
13
9
|
keepOpen?: boolean;
|
|
14
10
|
caret?: boolean;
|
|
15
|
-
onClick?: (index: number, option: Option, event: React.MouseEvent) => void;
|
|
16
|
-
rules?: Rule[];
|
|
17
|
-
data?: any;
|
|
18
11
|
disabled?: boolean;
|
|
19
12
|
border?: Borders;
|
|
20
|
-
|
|
13
|
+
data: T;
|
|
14
|
+
};
|
|
15
|
+
export declare type OptionLabelComponent<T extends GenericObject = GenericObject> = React.FunctionComponent<MenuOptionLabelProps<T>>;
|
|
16
|
+
export declare type Option<T extends GenericObject = GenericObject> = MenuOptionLabelProps<T> & {
|
|
17
|
+
label: ReactNode | OptionLabelComponent<T>;
|
|
18
|
+
onClick?: (index: number, option: Option, event: React.MouseEvent) => void;
|
|
19
|
+
rules?: Rule[];
|
|
20
|
+
};
|
|
21
21
|
export interface CommonProps extends Omit<AbsoluteContainerProps, 'children'> {
|
|
22
22
|
bordered?: boolean;
|
|
23
23
|
containerSpacing?: SpacingOrZero | Omit<Spacings, 'right'>;
|
|
@@ -29,11 +29,11 @@ export interface MenuProps extends CommonProps {
|
|
|
29
29
|
close: () => void;
|
|
30
30
|
options: Option[];
|
|
31
31
|
loading?: boolean;
|
|
32
|
-
innerContent?:
|
|
32
|
+
innerContent?: ReactNode;
|
|
33
33
|
scrollSpacing?: SpacingOrZero | Spacings;
|
|
34
34
|
onScrollEnd?: () => void;
|
|
35
|
-
before?:
|
|
36
|
-
after?:
|
|
35
|
+
before?: ReactNode;
|
|
36
|
+
after?: ReactNode;
|
|
37
37
|
}
|
|
38
38
|
export declare type ContainerProps = CommonProps;
|
|
39
39
|
export declare type MenuInterface = (props: MenuProps, ref?: React.ForwardedRef<HTMLDivElement>) => JSX.Element;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ReactNode, SpacingOrZero, Spacings } from '../../interfaces';
|
|
3
3
|
interface Common extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
height?: string;
|
|
5
5
|
spacing?: SpacingOrZero | Omit<Spacings, 'right'>;
|
|
6
6
|
}
|
|
7
7
|
export interface ScrollContainerProps extends Common {
|
|
8
8
|
onScrollEnd?: (event: React.UIEvent<HTMLDivElement, UIEvent>) => void | Promise<void>;
|
|
9
|
-
before?:
|
|
10
|
-
after?:
|
|
11
|
-
inner?:
|
|
9
|
+
before?: ReactNode;
|
|
10
|
+
after?: ReactNode;
|
|
11
|
+
inner?: ReactNode;
|
|
12
12
|
loading?: boolean;
|
|
13
13
|
}
|
|
14
14
|
export declare type OverflowContainerProps = Common;
|