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.
Files changed (56) hide show
  1. package/dist/cjs/css/magneto.ui.lib.min.css +1 -1
  2. package/dist/cjs/index.js +904 -701
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/cjs/types/components/UI/atoms/Checkbox/Checkbox.component.d.ts +3 -0
  5. package/dist/cjs/types/components/UI/atoms/Checkbox/Checkbox.interface.d.ts +17 -0
  6. package/dist/cjs/types/components/UI/atoms/Checkbox/index.d.ts +2 -0
  7. package/dist/cjs/types/components/UI/molecules/MobileDrawer/MobileDrawer.interface.d.ts +2 -1
  8. package/dist/cjs/types/components/UI/organism/Select/Select.component.d.ts +17 -0
  9. package/dist/cjs/types/components/UI/organism/Select/Select.context.d.ts +33 -0
  10. package/dist/cjs/types/components/UI/organism/Select/Select.interface.d.ts +18 -0
  11. package/dist/cjs/types/components/UI/organism/Select/children/SelectClickout/SelectClickout.component.d.ts +7 -0
  12. package/dist/cjs/types/components/UI/organism/Select/children/SelectClickout/index.d.ts +1 -0
  13. package/dist/cjs/types/components/UI/organism/Select/children/SelectDrawer/SelectDrawer.d.ts +4 -0
  14. package/dist/cjs/types/components/UI/organism/Select/children/SelectDrawer/SelectDrawer.interface.d.ts +5 -0
  15. package/dist/cjs/types/components/UI/organism/Select/children/SelectDrawer/index.d.ts +2 -0
  16. package/dist/cjs/types/components/UI/organism/Select/children/SelectInput/SelectInput.component.d.ts +2 -0
  17. package/dist/cjs/types/components/UI/organism/Select/children/SelectInput/SelectInput.interface.d.ts +36 -0
  18. package/dist/cjs/types/components/UI/organism/Select/children/SelectListCheck/SelectListCheck.component.d.ts +2 -0
  19. package/dist/cjs/types/components/UI/organism/Select/children/SelectListCheck/SelectListCheck.interface.d.ts +8 -0
  20. package/dist/cjs/types/components/UI/organism/Select/children/SelectListCheck/index.d.ts +2 -0
  21. package/dist/cjs/types/components/UI/organism/Select/index.d.ts +2 -0
  22. package/dist/cjs/types/components/UI/organism/index.d.ts +1 -0
  23. package/dist/cjs/types/constants/stories/Select2Multiple.constants.d.ts +5 -0
  24. package/dist/cjs/types/shared/utils/common/classNames.util.d.ts +3 -0
  25. package/dist/cjs/types/shared/utils/common/index.d.ts +2 -0
  26. package/dist/cjs/types/shared/utils/common/stub.util.d.ts +2 -0
  27. package/dist/cjs/types/shared/utils/storybook/withControlField.hoc.d.ts +6 -3
  28. package/dist/esm/css/magneto.ui.lib.min.css +1 -1
  29. package/dist/esm/index.js +904 -702
  30. package/dist/esm/index.js.map +1 -1
  31. package/dist/esm/types/components/UI/atoms/Checkbox/Checkbox.component.d.ts +3 -0
  32. package/dist/esm/types/components/UI/atoms/Checkbox/Checkbox.interface.d.ts +17 -0
  33. package/dist/esm/types/components/UI/atoms/Checkbox/index.d.ts +2 -0
  34. package/dist/esm/types/components/UI/molecules/MobileDrawer/MobileDrawer.interface.d.ts +2 -1
  35. package/dist/esm/types/components/UI/organism/Select/Select.component.d.ts +17 -0
  36. package/dist/esm/types/components/UI/organism/Select/Select.context.d.ts +33 -0
  37. package/dist/esm/types/components/UI/organism/Select/Select.interface.d.ts +18 -0
  38. package/dist/esm/types/components/UI/organism/Select/children/SelectClickout/SelectClickout.component.d.ts +7 -0
  39. package/dist/esm/types/components/UI/organism/Select/children/SelectClickout/index.d.ts +1 -0
  40. package/dist/esm/types/components/UI/organism/Select/children/SelectDrawer/SelectDrawer.d.ts +4 -0
  41. package/dist/esm/types/components/UI/organism/Select/children/SelectDrawer/SelectDrawer.interface.d.ts +5 -0
  42. package/dist/esm/types/components/UI/organism/Select/children/SelectDrawer/index.d.ts +2 -0
  43. package/dist/esm/types/components/UI/organism/Select/children/SelectInput/SelectInput.component.d.ts +2 -0
  44. package/dist/esm/types/components/UI/organism/Select/children/SelectInput/SelectInput.interface.d.ts +36 -0
  45. package/dist/esm/types/components/UI/organism/Select/children/SelectListCheck/SelectListCheck.component.d.ts +2 -0
  46. package/dist/esm/types/components/UI/organism/Select/children/SelectListCheck/SelectListCheck.interface.d.ts +8 -0
  47. package/dist/esm/types/components/UI/organism/Select/children/SelectListCheck/index.d.ts +2 -0
  48. package/dist/esm/types/components/UI/organism/Select/index.d.ts +2 -0
  49. package/dist/esm/types/components/UI/organism/index.d.ts +1 -0
  50. package/dist/esm/types/constants/stories/Select2Multiple.constants.d.ts +5 -0
  51. package/dist/esm/types/shared/utils/common/classNames.util.d.ts +3 -0
  52. package/dist/esm/types/shared/utils/common/index.d.ts +2 -0
  53. package/dist/esm/types/shared/utils/common/stub.util.d.ts +2 -0
  54. package/dist/esm/types/shared/utils/storybook/withControlField.hoc.d.ts +6 -3
  55. package/dist/index.d.ts +113 -2
  56. package/package.json +1 -1
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { ICheckbox } from './Checkbox.interface';
3
+ export declare const Checkbox: React.FC<ICheckbox>;
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ export { Checkbox } from './Checkbox.component';
2
+ export * from './Checkbox.interface';
@@ -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,7 @@
1
+ import React from 'react';
2
+ declare type Props = {
3
+ clickOut: boolean;
4
+ setClickOut: (value: boolean) => void;
5
+ };
6
+ declare const _default: React.FC<Props>;
7
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default as SelectClickout } from './SelectClickout.component';
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { ISelectDrawer } from './SelectDrawer.interface';
3
+ declare const SelectDrawer: React.FC<ISelectDrawer>;
4
+ export default SelectDrawer;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export interface ISelectDrawer {
3
+ className?: string;
4
+ children: React.ReactNode;
5
+ }
@@ -0,0 +1,2 @@
1
+ export * from './SelectDrawer.interface';
2
+ export { default as SelectDrawer } from './SelectDrawer';
@@ -0,0 +1,2 @@
1
+ import { ISelectInput } from './SelectInput.interface';
2
+ export declare const SelectInput: <T>({ onChange, value, className, onClick, open, actionIcon, selected, getLabel, readOnly, ...rest }: ISelectInput<T>) => JSX.Element;
@@ -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,2 @@
1
+ import { ISelect2ListCheck } from './SelectListCheck.interface';
2
+ export declare const SelectListCheck: <T>({ className, renderItem, filter }: ISelect2ListCheck<T>) => JSX.Element;
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ export { SelectListCheck } from './SelectListCheck.component';
2
+ export * from './SelectListCheck.interface';
@@ -0,0 +1,2 @@
1
+ export * from './Select.interface';
2
+ export * from './Select.component';
@@ -24,3 +24,4 @@ export * from './OneSelectionEntry';
24
24
  export * from './Select2';
25
25
  export * from './SimilarJobs';
26
26
  export * from './Timeline';
27
+ export * from './Select';
@@ -0,0 +1,5 @@
1
+ export declare const disabiltiesOptions: {
2
+ id: number;
3
+ value: string;
4
+ label: string;
5
+ }[];
@@ -0,0 +1,3 @@
1
+ export declare const classNames: {
2
+ bind: (stylesObj: Record<string, string | undefined>) => (...params: Array<string | null | undefined | Record<string, boolean | undefined | null>>) => string;
3
+ };
@@ -1,2 +1,4 @@
1
1
  export * from './formatNumbers.util';
2
2
  export * from './dates.util';
3
+ export * from './stub.util';
4
+ export * from './classNames.util';
@@ -0,0 +1,2 @@
1
+ export declare const stubTrue: () => boolean;
2
+ export declare const stubUndefined: () => undefined;
@@ -1,4 +1,7 @@
1
1
  import React from 'react';
2
- export declare const withControlField: (WrappedComponent: React.FC<Record<string, unknown>>) => ({ ...args }: {
3
- [x: string]: any;
4
- }) => JSX.Element;
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 {};