magneto365.ui 2.45.2 → 2.46.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.
- package/dist/cjs/css/magneto.ui.lib.min.css +1 -1
- package/dist/cjs/index.js +904 -701
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/UI/atoms/Checkbox/Checkbox.component.d.ts +3 -0
- package/dist/cjs/types/components/UI/atoms/Checkbox/Checkbox.interface.d.ts +17 -0
- package/dist/cjs/types/components/UI/atoms/Checkbox/index.d.ts +2 -0
- package/dist/cjs/types/components/UI/molecules/MobileDrawer/MobileDrawer.interface.d.ts +2 -1
- package/dist/cjs/types/components/UI/organism/Select/Select.component.d.ts +17 -0
- package/dist/cjs/types/components/UI/organism/Select/Select.context.d.ts +33 -0
- package/dist/cjs/types/components/UI/organism/Select/Select.interface.d.ts +18 -0
- package/dist/cjs/types/components/UI/organism/Select/children/SelectClickout/SelectClickout.component.d.ts +7 -0
- package/dist/cjs/types/components/UI/organism/Select/children/SelectClickout/index.d.ts +1 -0
- package/dist/cjs/types/components/UI/organism/Select/children/SelectDrawer/SelectDrawer.d.ts +4 -0
- package/dist/cjs/types/components/UI/organism/Select/children/SelectDrawer/SelectDrawer.interface.d.ts +5 -0
- package/dist/cjs/types/components/UI/organism/Select/children/SelectDrawer/index.d.ts +2 -0
- package/dist/cjs/types/components/UI/organism/Select/children/SelectInput/SelectInput.component.d.ts +2 -0
- package/dist/cjs/types/components/UI/organism/Select/children/SelectInput/SelectInput.interface.d.ts +36 -0
- package/dist/cjs/types/components/UI/organism/Select/children/SelectListCheck/SelectListCheck.component.d.ts +2 -0
- package/dist/cjs/types/components/UI/organism/Select/children/SelectListCheck/SelectListCheck.interface.d.ts +8 -0
- package/dist/cjs/types/components/UI/organism/Select/children/SelectListCheck/index.d.ts +2 -0
- package/dist/cjs/types/components/UI/organism/Select/index.d.ts +2 -0
- package/dist/cjs/types/components/UI/organism/index.d.ts +1 -0
- package/dist/cjs/types/constants/stories/Select2Multiple.constants.d.ts +5 -0
- package/dist/cjs/types/shared/utils/common/classNames.util.d.ts +3 -0
- package/dist/cjs/types/shared/utils/common/index.d.ts +2 -0
- package/dist/cjs/types/shared/utils/common/stub.util.d.ts +2 -0
- package/dist/cjs/types/shared/utils/storybook/withControlField.hoc.d.ts +6 -3
- package/dist/esm/css/magneto.ui.lib.min.css +1 -1
- package/dist/esm/index.js +904 -702
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/UI/atoms/Checkbox/Checkbox.component.d.ts +3 -0
- package/dist/esm/types/components/UI/atoms/Checkbox/Checkbox.interface.d.ts +17 -0
- package/dist/esm/types/components/UI/atoms/Checkbox/index.d.ts +2 -0
- package/dist/esm/types/components/UI/molecules/MobileDrawer/MobileDrawer.interface.d.ts +2 -1
- package/dist/esm/types/components/UI/organism/Select/Select.component.d.ts +17 -0
- package/dist/esm/types/components/UI/organism/Select/Select.context.d.ts +33 -0
- package/dist/esm/types/components/UI/organism/Select/Select.interface.d.ts +18 -0
- package/dist/esm/types/components/UI/organism/Select/children/SelectClickout/SelectClickout.component.d.ts +7 -0
- package/dist/esm/types/components/UI/organism/Select/children/SelectClickout/index.d.ts +1 -0
- package/dist/esm/types/components/UI/organism/Select/children/SelectDrawer/SelectDrawer.d.ts +4 -0
- package/dist/esm/types/components/UI/organism/Select/children/SelectDrawer/SelectDrawer.interface.d.ts +5 -0
- package/dist/esm/types/components/UI/organism/Select/children/SelectDrawer/index.d.ts +2 -0
- package/dist/esm/types/components/UI/organism/Select/children/SelectInput/SelectInput.component.d.ts +2 -0
- package/dist/esm/types/components/UI/organism/Select/children/SelectInput/SelectInput.interface.d.ts +36 -0
- package/dist/esm/types/components/UI/organism/Select/children/SelectListCheck/SelectListCheck.component.d.ts +2 -0
- package/dist/esm/types/components/UI/organism/Select/children/SelectListCheck/SelectListCheck.interface.d.ts +8 -0
- package/dist/esm/types/components/UI/organism/Select/children/SelectListCheck/index.d.ts +2 -0
- package/dist/esm/types/components/UI/organism/Select/index.d.ts +2 -0
- package/dist/esm/types/components/UI/organism/index.d.ts +1 -0
- package/dist/esm/types/constants/stories/Select2Multiple.constants.d.ts +5 -0
- package/dist/esm/types/shared/utils/common/classNames.util.d.ts +3 -0
- package/dist/esm/types/shared/utils/common/index.d.ts +2 -0
- package/dist/esm/types/shared/utils/common/stub.util.d.ts +2 -0
- package/dist/esm/types/shared/utils/storybook/withControlField.hoc.d.ts +6 -3
- package/dist/index.d.ts +113 -2
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface ICheckbox extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
|
|
3
|
+
/**
|
|
4
|
+
* event to controll the change value component.
|
|
5
|
+
* @param checked
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
onChange?: (checked: boolean) => void;
|
|
9
|
+
/**
|
|
10
|
+
* change UI behavior with this prop.
|
|
11
|
+
*/
|
|
12
|
+
type?: 'box' | 'background';
|
|
13
|
+
/**
|
|
14
|
+
* change display behavior for checkbox.
|
|
15
|
+
*/
|
|
16
|
+
display?: 'inline' | 'block';
|
|
17
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export interface IMoblieDrawer {
|
|
2
3
|
className?: string;
|
|
3
4
|
/**
|
|
@@ -11,7 +12,7 @@ export interface IMoblieDrawer {
|
|
|
11
12
|
/**
|
|
12
13
|
* can receive components inside the drawer
|
|
13
14
|
*/
|
|
14
|
-
children: JSX.Element | JSX.Element[];
|
|
15
|
+
children: JSX.Element | JSX.Element[] | React.ReactNode;
|
|
15
16
|
/**
|
|
16
17
|
* this property blocks fn onClose from background
|
|
17
18
|
*/
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ISelect } from './Select.interface';
|
|
3
|
+
import { ISelectInput } from './children/SelectInput/SelectInput.interface';
|
|
4
|
+
/**
|
|
5
|
+
* @experimental this component is early, so that the interface component and behavrior could change.
|
|
6
|
+
* @deprecated this function will change soon.
|
|
7
|
+
*/
|
|
8
|
+
export declare const Select: (<T>({ children, renderSelect, placeholder, options, value, onChange, inputReadonly }: ISelect<T>) => JSX.Element) & {
|
|
9
|
+
useContext: <T_1>() => import("./Select.context").ISelectContext<T_1>;
|
|
10
|
+
Input: <T_2>({ onChange, value, className, onClick, open, actionIcon, selected, getLabel, readOnly, ...rest }: ISelectInput<T_2>) => JSX.Element;
|
|
11
|
+
Clickout: React.FC<{
|
|
12
|
+
clickOut: boolean;
|
|
13
|
+
setClickOut: (value: boolean) => void;
|
|
14
|
+
}>;
|
|
15
|
+
Drawer: React.FC<import("./children/SelectDrawer").ISelectDrawer>;
|
|
16
|
+
ListCheck: <T_3>({ className, renderItem, filter }: import("./children/SelectListCheck").ISelect2ListCheck<T_3>) => JSX.Element;
|
|
17
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ISelect } from './Select.interface';
|
|
3
|
+
export interface ISelectContext<T> {
|
|
4
|
+
value: ISelect<T>['value'];
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @param value
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
onChange: (value: ISelectContext<T>['value']) => void;
|
|
11
|
+
/**
|
|
12
|
+
* current options to display in select list components.
|
|
13
|
+
*/
|
|
14
|
+
options: ISelect<T>['options'];
|
|
15
|
+
/**
|
|
16
|
+
* input search values, it works for make filters.
|
|
17
|
+
*/
|
|
18
|
+
search: string;
|
|
19
|
+
/**
|
|
20
|
+
* @param search current search input value.
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
onSearch: (search: string | ((current: string) => string)) => void;
|
|
24
|
+
open: boolean;
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @param value current state from Drawer (open/close).
|
|
28
|
+
* @returns
|
|
29
|
+
*/
|
|
30
|
+
onSwitch: (value: boolean | ((current: boolean) => boolean)) => void;
|
|
31
|
+
}
|
|
32
|
+
export declare const SelectContext: React.Context<ISelectContext<any>>;
|
|
33
|
+
export declare const useSelectContext: <T>() => ISelectContext<T>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ISelectInput } from './children/SelectInput/SelectInput.interface';
|
|
3
|
+
export interface ISelect<T> {
|
|
4
|
+
value: IValueSelect<T>[];
|
|
5
|
+
onChange?: (value: IValueSelect<T>[]) => void;
|
|
6
|
+
options: IOption<T>[];
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
renderSelect?: <T>(props: ISelectInput<T>) => React.ReactNode;
|
|
9
|
+
inputReadonly?: boolean;
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export interface IValueSelect<T> {
|
|
13
|
+
id: number | string;
|
|
14
|
+
value: T;
|
|
15
|
+
}
|
|
16
|
+
export interface IOption<T> extends IValueSelect<T> {
|
|
17
|
+
label?: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as SelectClickout } from './SelectClickout.component';
|
package/dist/cjs/types/components/UI/organism/Select/children/SelectInput/SelectInput.interface.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { IInput } from '@components/UI/molecules/Input/Input.interface';
|
|
2
|
+
import { ISelect, IValueSelect } from '../../Select.interface';
|
|
3
|
+
export interface ISelectInput<T> extends IInput {
|
|
4
|
+
/**
|
|
5
|
+
* placeholder for input.
|
|
6
|
+
*/
|
|
7
|
+
placeholder: IInput['placeholder'];
|
|
8
|
+
/**
|
|
9
|
+
* type for input.
|
|
10
|
+
*/
|
|
11
|
+
type: IInput['type'];
|
|
12
|
+
/**
|
|
13
|
+
* to know if the select is open.
|
|
14
|
+
*/
|
|
15
|
+
open?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* select value.
|
|
18
|
+
*/
|
|
19
|
+
selected: ISelect<T>['value'];
|
|
20
|
+
/**
|
|
21
|
+
* onClick on input container.
|
|
22
|
+
*/
|
|
23
|
+
onClick: () => void;
|
|
24
|
+
/**
|
|
25
|
+
* display values selected in input.
|
|
26
|
+
*/
|
|
27
|
+
readonly?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* The select value is generic, so for display correctly the label in input
|
|
30
|
+
* use this function.
|
|
31
|
+
* @param value current values selected
|
|
32
|
+
* @default (value) => value.map(select => select.value).join(', ')
|
|
33
|
+
* @returns
|
|
34
|
+
*/
|
|
35
|
+
getLabel?: (value: IValueSelect<T>[]) => string;
|
|
36
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IOption } from '../../Select.interface';
|
|
2
|
+
export interface ISelect2ListCheck<T> {
|
|
3
|
+
className?: string;
|
|
4
|
+
filter?: (option: IOption<T>, searchValue: string, value?: IOption<T> | IOption<T>[] | undefined) => boolean;
|
|
5
|
+
renderItem?: (option: IOption<T>) => JSX.Element;
|
|
6
|
+
clickOut?: boolean;
|
|
7
|
+
setClickOut?: (clickOut: boolean) => void;
|
|
8
|
+
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
declare type ControllerField = {
|
|
3
|
+
valueNameProp?: string;
|
|
4
|
+
onChangeNameProp?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const withControlField: (WrappedComponent: React.FC<Record<string, unknown>>) => ({ onChangeNameProp, valueNameProp, ...args }: Record<string, unknown> & ControllerField) => JSX.Element;
|
|
7
|
+
export {};
|