react-asc 19.0.1 → 19.0.2

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 (40) hide show
  1. package/components/AutoComplete/AutoComplete.d.ts +0 -1
  2. package/components/Badge/Badge.d.ts +1 -1
  3. package/components/Breadcrumb/BreadcrumbItem.d.ts +2 -5
  4. package/components/ButtonGroup/ButtonGroup.d.ts +1 -3
  5. package/components/Card/CardBody.d.ts +1 -4
  6. package/components/Card/CardFooter.d.ts +1 -4
  7. package/components/Card/CardImage.d.ts +1 -4
  8. package/components/Card/CardSubtitle.d.ts +1 -4
  9. package/components/Card/CardText.d.ts +1 -4
  10. package/components/Chip/Chip.d.ts +1 -1
  11. package/components/ConditionalWrapper/ConditionalWrapper.d.ts +3 -3
  12. package/components/FloatingActionButton/FloatingActionButton.d.ts +1 -1
  13. package/components/Form/Form.d.ts +1 -1
  14. package/components/Form/FormHint/FormHint.d.ts +1 -4
  15. package/components/Form/FormInput/FormInput.d.ts +2 -2
  16. package/components/Form/FormLabel/FormLabel.d.ts +2 -4
  17. package/components/Form/form.interfaces.d.ts +1 -1
  18. package/components/Form/form.models.d.ts +2 -2
  19. package/components/Form/validators/IsEmptyValidator.d.ts +1 -1
  20. package/components/Form/validators/IsEqualValidator.d.ts +1 -1
  21. package/components/List/list.models.d.ts +2 -2
  22. package/components/LoadingIndicator/LoadingIndicator.d.ts +0 -2
  23. package/components/LoadingIndicator/loading-indicator.service.d.ts +2 -4
  24. package/components/Menu/Menu.d.ts +0 -1
  25. package/components/Menu/MenuBody.d.ts +1 -1
  26. package/components/Modal/Modal.d.ts +2 -2
  27. package/components/Modal/ModalHeader.d.ts +3 -4
  28. package/components/Select/Select.d.ts +2 -2
  29. package/components/SpeedDial/SpeedDialActions.d.ts +2 -6
  30. package/components/Stepper/Step/Step.d.ts +5 -2
  31. package/components/Tabs/Tab.d.ts +5 -2
  32. package/components/Tabs/TabIndicator.d.ts +2 -2
  33. package/components/Tabs/TabPanel.d.ts +0 -1
  34. package/components/TreeView/TreeItem.d.ts +6 -5
  35. package/hooks/useConstructor.d.ts +1 -1
  36. package/hooks/useDebounce.d.ts +2 -1
  37. package/hooks/useHover.d.ts +2 -2
  38. package/index.es.js +70 -67
  39. package/index.js +70 -67
  40. package/package.json +1 -1
@@ -15,6 +15,5 @@ export interface IAutoCompleteProps {
15
15
  showClearButton?: boolean;
16
16
  onSelect?: (val: ISelectOption) => void;
17
17
  onChange?: (val: string | undefined) => void;
18
- onKeyDown?: (event: any) => void;
19
18
  }
20
19
  export declare const AutoComplete: (props: IAutoCompleteProps) => JSX.Element;
@@ -2,6 +2,6 @@ import React from 'react';
2
2
  import { COLOR } from "../component.enums";
3
3
  export interface IBadgeProps extends React.ComponentProps<"div"> {
4
4
  color?: COLOR;
5
- content?: any;
5
+ content?: React.ReactNode;
6
6
  }
7
7
  export declare const Badge: (props: IBadgeProps) => JSX.Element;
@@ -1,9 +1,6 @@
1
- import React, { ReactNode } from 'react';
2
- export interface IBreadcrumbItemProps {
3
- className?: string;
1
+ import React from 'react';
2
+ export interface IBreadcrumbItemProps extends React.ComponentProps<'li'> {
4
3
  isActive?: boolean;
5
4
  path?: string;
6
- children?: ReactNode;
7
- onClick?: (event: React.MouseEvent) => void;
8
5
  }
9
6
  export declare const BreadcrumbItem: (props: IBreadcrumbItemProps) => JSX.Element;
@@ -1,4 +1,2 @@
1
1
  import React from 'react';
2
- export interface IButtonGroupProps extends React.ComponentProps<"div"> {
3
- }
4
- export declare const ButtonGroup: (props: IButtonGroupProps) => JSX.Element;
2
+ export declare const ButtonGroup: (props: React.ComponentProps<"div">) => JSX.Element;
@@ -1,5 +1,2 @@
1
1
  import React from 'react';
2
- interface ICardBodyProps extends React.ComponentProps<"div"> {
3
- }
4
- export declare const CardBody: (props: ICardBodyProps) => JSX.Element;
5
- export {};
2
+ export declare const CardBody: (props: React.ComponentProps<"div">) => JSX.Element;
@@ -1,5 +1,2 @@
1
1
  import React from 'react';
2
- interface ICardFooter extends React.ComponentProps<"div"> {
3
- }
4
- export declare const CardFooter: (props: ICardFooter) => JSX.Element;
5
- export {};
2
+ export declare const CardFooter: (props: React.ComponentProps<"div">) => JSX.Element;
@@ -1,5 +1,2 @@
1
1
  import React from 'react';
2
- interface ICardImageProps extends React.ComponentProps<"img"> {
3
- }
4
- export declare const CardImage: (props: ICardImageProps) => JSX.Element;
5
- export {};
2
+ export declare const CardImage: (props: React.ComponentProps<"img">) => JSX.Element;
@@ -1,5 +1,2 @@
1
1
  import React from 'react';
2
- interface ICardSubtitleProps extends React.ComponentProps<"div"> {
3
- }
4
- export declare const CardSubtitle: (props: ICardSubtitleProps) => JSX.Element;
5
- export {};
2
+ export declare const CardSubtitle: (props: React.ComponentProps<"div">) => JSX.Element;
@@ -1,5 +1,2 @@
1
1
  import React from 'react';
2
- interface ICardTextProps extends React.ComponentProps<"p"> {
3
- }
4
- export declare const CardText: (props: ICardTextProps) => JSX.Element;
5
- export {};
2
+ export declare const CardText: (props: React.ComponentProps<"p">) => JSX.Element;
@@ -6,6 +6,6 @@ export interface IChipProps extends React.ComponentProps<"div"> {
6
6
  onClick?: (e: React.MouseEvent<Element>) => void;
7
7
  isDeletable?: boolean;
8
8
  onDelete?: (e: React.MouseEvent<Element>) => void;
9
- deleteIcon?: any;
9
+ deleteIcon?: JSX.Element;
10
10
  }
11
11
  export declare const Chip: (props: IChipProps) => JSX.Element;
@@ -1,8 +1,8 @@
1
- /// <reference types="react" />
1
+ import React from "react";
2
2
  interface IConditionalWrapperProps {
3
3
  condition: boolean;
4
- wrapper: (children: React.ReactNode) => any;
5
- children: React.ReactNode;
4
+ wrapper: (children: React.ReactNode) => JSX.Element;
5
+ children: any;
6
6
  }
7
7
  export declare const ConditionalWrapper: ({ condition, wrapper, children }: IConditionalWrapperProps) => any;
8
8
  export {};
@@ -7,6 +7,6 @@ export interface IFloatingActionButtonProps extends React.DetailedHTMLProps<Reac
7
7
  fixed?: boolean;
8
8
  isActive?: boolean;
9
9
  disabled?: boolean;
10
- onClick?: (e: any) => void;
10
+ onClick?: (e: React.MouseEvent) => void;
11
11
  }
12
12
  export declare const FloatingActionButton: (props: IFloatingActionButtonProps) => JSX.Element;
@@ -31,7 +31,7 @@ export declare class Form extends Component<IFormProps, IFormState> {
31
31
  private renderLabel;
32
32
  handleFormSubmit(): void;
33
33
  handleFormReset(): void;
34
- handleOnKeyDown(e: React.KeyboardEvent<HTMLInputElement>): void;
34
+ handleOnKeyDown(e: React.KeyboardEvent<HTMLInputElement | undefined>): void;
35
35
  destroy(): void;
36
36
  getFormGroupCssClass(fieldKey: string): string | undefined;
37
37
  render(): JSX.Element;
@@ -1,5 +1,2 @@
1
1
  import React from 'react';
2
- interface IFormHintProps extends React.ComponentProps<"small"> {
3
- }
4
- export declare const FormHint: (props: IFormHintProps) => JSX.Element;
5
- export {};
2
+ export declare const FormHint: (props: React.ComponentProps<"small">) => JSX.Element;
@@ -7,7 +7,7 @@ export interface IFormInputEvent {
7
7
  name?: string;
8
8
  }
9
9
  export interface IFormInputProps {
10
- value: string | number | readonly string[] | undefined;
10
+ value: string | number | boolean | readonly string[] | undefined;
11
11
  name: string;
12
12
  type: IFormControlType;
13
13
  placeholder?: string;
@@ -24,6 +24,6 @@ export interface IFormInputProps {
24
24
  onInput?: (e: IFormInputEvent) => void;
25
25
  onChange?: (e: IFormInputEvent) => void;
26
26
  onBlur?: React.FocusEventHandler<HTMLInputElement> | undefined;
27
- onKeyDown?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
27
+ onKeyDown?: React.KeyboardEventHandler<HTMLInputElement | undefined>;
28
28
  }
29
29
  export declare const FormInput: (props: IFormInputProps) => JSX.Element;
@@ -1,4 +1,2 @@
1
- import { ComponentProps, FunctionComponent, HTMLAttributes } from 'react';
2
- export interface IFormLabelProps extends ComponentProps<"label"> {
3
- }
4
- export declare const FormLabel: FunctionComponent<IFormLabelProps & HTMLAttributes<HTMLLabelElement>>;
1
+ import React from 'react';
2
+ export declare const FormLabel: ({ children, className, htmlFor, ...rest }: React.ComponentProps<"label">) => JSX.Element;
@@ -3,7 +3,7 @@ export interface IControls {
3
3
  [key: string]: FormControl;
4
4
  }
5
5
  export interface IFormValues {
6
- [key: string]: any;
6
+ [key: string]: unknown;
7
7
  }
8
8
  export interface IFormTextAreaOptions {
9
9
  rows: number;
@@ -2,10 +2,10 @@ import { IFormControlConfig, IFormInputError } from './form.interfaces';
2
2
  import { IFormControlType } from './form.types';
3
3
  export declare class FormControl {
4
4
  value: any;
5
- validators: Array<any>;
5
+ validators: Array<string>;
6
6
  type: IFormControlType;
7
7
  config: IFormControlConfig;
8
- constructor(value: any, validators: Array<any>, type: IFormControlType, config: IFormControlConfig);
8
+ constructor(value: any, validators: Array<string>, type: IFormControlType, config: IFormControlConfig);
9
9
  errors: Array<IFormInputError>;
10
10
  isValid: boolean;
11
11
  isDirty: boolean;
@@ -1 +1 @@
1
- export declare const IsEmptyValidator: (value: any) => boolean;
1
+ export declare const IsEmptyValidator: (value: unknown) => boolean;
@@ -1 +1 @@
1
- export declare const IsEqualValidator: (valueA: any, valueB: any) => boolean;
1
+ export declare const IsEqualValidator: (valueA: unknown, valueB: unknown) => boolean;
@@ -2,7 +2,7 @@ import { ReactElement } from 'react';
2
2
  import { IListItemProps } from './ListItem';
3
3
  export declare class ListItemModel {
4
4
  constructor(dto: ReactElement<IListItemProps>);
5
- key: any;
5
+ key: unknown;
6
6
  props: IListItemProps | undefined;
7
- type: any;
7
+ type: unknown;
8
8
  }
@@ -1,4 +1,2 @@
1
1
  import React from 'react';
2
- export interface ILoadingIndicatorProps {
3
- }
4
2
  export declare const LoadingIndicator: ({ ...rest }: React.ComponentProps<"div">) => JSX.Element;
@@ -1,12 +1,10 @@
1
1
  export interface ILoadingIndicatorService {
2
- show(message: string, options?: ILoadingIndicatorOptions): Promise<void>;
3
- }
4
- export interface ILoadingIndicatorOptions {
2
+ show(message: string): void;
5
3
  }
6
4
  declare class LoadingIndicatorService implements ILoadingIndicatorService {
7
5
  private container;
8
6
  private handler;
9
- show(): Promise<void>;
7
+ show(): void;
10
8
  hide(): void;
11
9
  }
12
10
  export declare const loadingIndicatorService: LoadingIndicatorService;
@@ -6,7 +6,6 @@ export interface IMenuProps extends React.DetailedHTMLProps<React.HtmlHTMLAttrib
6
6
  open?: boolean;
7
7
  children?: ReactElement<IMenuItemProps> | Array<ReactElement<IMenuItemProps>>;
8
8
  menuPosition?: MenuPosition;
9
- onToggleClick?: (e: Event) => void;
10
9
  onClickBackdrop?: () => void;
11
10
  }
12
11
  export declare const Menu: (props: IMenuProps) => JSX.Element;
@@ -5,7 +5,7 @@ export interface IMenuBodyProps {
5
5
  children?: ReactElement<IMenuItemProps> | Array<ReactElement<IMenuItemProps>>;
6
6
  className?: string;
7
7
  menuPosition?: MenuPosition;
8
- parentRef: React.RefObject<any>;
8
+ parentRef: React.RefObject<HTMLDivElement>;
9
9
  shadow?: boolean;
10
10
  onClickBackdrop?: () => void;
11
11
  }
@@ -5,8 +5,8 @@ export interface IModalProps {
5
5
  children?: ReactNode;
6
6
  header?: string;
7
7
  footer?: string | ReactElement;
8
- onHeaderCloseClick?: Function;
9
- onBackdropClick?: Function;
8
+ onHeaderCloseClick?: () => void;
9
+ onBackdropClick?: () => void;
10
10
  isDismissable?: boolean;
11
11
  fullScreen?: boolean;
12
12
  size?: SIZE;
@@ -1,7 +1,6 @@
1
- import { ReactNode } from 'react';
2
- interface IModalHeaderProps {
3
- children?: ReactNode;
4
- onClose?: Function;
1
+ import React from 'react';
2
+ interface IModalHeaderProps extends React.ComponentProps<'div'> {
3
+ onClose?: () => void;
5
4
  isDismissable?: boolean;
6
5
  }
7
6
  export declare const ModalHeader: (props: IModalHeaderProps) => JSX.Element;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { ISelectOption } from '../component.interfaces';
3
3
  export interface ISelectProps {
4
4
  id?: string;
@@ -10,6 +10,6 @@ export interface ISelectProps {
10
10
  multipleMaxCountItems?: number;
11
11
  disabled?: boolean;
12
12
  onChange?: (val: string | Array<string>) => void;
13
- onKeyDown?: (event: any) => void;
13
+ onKeyDown?: (event: React.KeyboardEvent<HTMLDivElement>) => void;
14
14
  }
15
15
  export declare const Select: (props: ISelectProps) => JSX.Element;
@@ -1,6 +1,2 @@
1
- /// <reference types="react" />
2
- interface ISpeedDialActionsProps {
3
- children: any;
4
- }
5
- export declare const SpeedDialActions: (props: ISpeedDialActionsProps) => JSX.Element;
6
- export {};
1
+ import React from 'react';
2
+ export declare const SpeedDialActions: (props: React.ComponentProps<'div'>) => JSX.Element;
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
  export interface IStepProps {
3
3
  value: string;
4
4
  index?: number;
@@ -11,6 +11,9 @@ export interface IStepProps {
11
11
  isOptional?: boolean;
12
12
  className?: string;
13
13
  showProgressCheckIcon?: boolean;
14
- onClick?: (event: any, value: string) => void;
14
+ onClick?: (e: {
15
+ event: React.MouseEvent;
16
+ value: string;
17
+ }) => void;
15
18
  }
16
19
  export declare const Step: (props: IStepProps) => JSX.Element;
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
  export interface ITabProps {
3
3
  label: ReactNode;
4
4
  value: string;
@@ -6,6 +6,9 @@ export interface ITabProps {
6
6
  fixed?: boolean;
7
7
  disabled?: boolean;
8
8
  className?: string;
9
- onClick?: (event: any, value: string) => void;
9
+ onClick?: (e: {
10
+ event: React.MouseEvent;
11
+ value: string;
12
+ }) => void;
10
13
  }
11
14
  export declare const Tab: (props: ITabProps) => JSX.Element;
@@ -4,7 +4,7 @@ export interface ITabIndicatorProps extends React.DetailedHTMLProps<React.HtmlHT
4
4
  amount?: number;
5
5
  index?: number;
6
6
  color?: COLOR;
7
- width?: any;
8
- left?: any;
7
+ width?: string;
8
+ left?: number;
9
9
  }
10
10
  export declare const TabIndicator: (props: ITabIndicatorProps) => JSX.Element;
@@ -2,6 +2,5 @@ import React from 'react';
2
2
  export interface ITabPanelProps extends React.DetailedHTMLProps<React.HTMLProps<HTMLDivElement>, HTMLDivElement> {
3
3
  value: string;
4
4
  index: string;
5
- className?: string;
6
5
  }
7
6
  export declare const TabPanel: (props: ITabPanelProps) => JSX.Element;
@@ -1,13 +1,14 @@
1
- /// <reference types="react" />
2
- export interface ITreeItemProps {
1
+ import React from "react";
2
+ export interface ITreeItemProps extends React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLLIElement>, HTMLLIElement> {
3
3
  nodeId: string;
4
4
  label: string;
5
- children?: any;
6
- className?: string;
7
5
  isExpanded?: boolean;
8
6
  isSelected?: boolean;
9
7
  isSelectable?: boolean;
10
8
  onToggleExpand?: (id: string) => void;
11
- onSelect?: (id: string, isSelected: boolean) => void;
9
+ onItemSelect?: (e: {
10
+ id: string;
11
+ isSelected: boolean;
12
+ }) => void;
12
13
  }
13
14
  export declare const TreeItem: (props: ITreeItemProps) => JSX.Element;
@@ -1 +1 @@
1
- export declare const useConstructor: (callBack?: () => void) => void;
1
+ export declare const useConstructor: (callBack: () => void) => void;
@@ -1 +1,2 @@
1
- export declare function useDebounce(callback: any, timeout: any, deps: any): void;
1
+ import React from "react";
2
+ export declare function useDebounce(callback: () => void, timeout: number, deps: React.DependencyList): void;
@@ -1,2 +1,2 @@
1
- /// <reference types="react" />
2
- export declare function useHover(): (boolean | import("react").MutableRefObject<null>)[];
1
+ import { RefObject } from 'react';
2
+ export declare function useHover<T extends HTMLElement = HTMLElement>(elementRef: RefObject<T>): boolean;
package/index.es.js CHANGED
@@ -243,28 +243,25 @@ function useWindowSize() {
243
243
  return windowSize;
244
244
  }
245
245
 
246
- function useHover() {
246
+ function useHover(elementRef) {
247
247
  const [value, setValue] = useState(false);
248
- const ref = useRef(null);
249
248
  const handleMouseOver = () => setValue(true);
250
249
  const handleMouseOut = () => setValue(false);
251
- useEffect(() => {
252
- const node = ref.current;
253
- if (node) {
254
- node.addEventListener("mouseover", handleMouseOver);
255
- node.addEventListener("mouseout", handleMouseOut);
250
+ const node = elementRef.current;
251
+ if (node) {
252
+ node.addEventListener("mouseover", handleMouseOver);
253
+ node.addEventListener("mouseout", handleMouseOut);
254
+ useEffect(() => {
256
255
  return () => {
257
256
  node.removeEventListener("mouseover", handleMouseOver);
258
257
  node.removeEventListener("mouseout", handleMouseOut);
259
258
  };
260
- }
261
- return;
262
- }, [ref.current] // Recall only if ref changes
263
- );
264
- return [ref, value];
259
+ }, [elementRef.current]);
260
+ }
261
+ return value;
265
262
  }
266
263
 
267
- const useConstructor = (callBack = () => { }) => {
264
+ const useConstructor = (callBack) => {
268
265
  const [hasBeenCalled, setHasBeenCalled] = useState(false);
269
266
  if (hasBeenCalled)
270
267
  return;
@@ -592,9 +589,7 @@ const BreadcrumbItem = (props) => {
592
589
  onClick && onClick(event);
593
590
  };
594
591
  return (React.createElement("li", { className: getCssClasses(), onClick: handleClick },
595
- React.createElement(ConditionalWrapper, { condition: !isActive,
596
- // eslint-disable-next-line jsx-a11y/anchor-is-valid
597
- wrapper: label => React.createElement("a", null, label) }, children)));
592
+ React.createElement(ConditionalWrapper, { condition: !isActive, wrapper: label => React.createElement("a", null, label) }, children)));
598
593
  };
599
594
 
600
595
  var css_248z$E = ".Card-module_card__TQdQq {\n background: var(--white);\n border-radius: var(--borderRadius); }\n .Card-module_card__TQdQq.Card-module_shadow__NxDVz {\n box-shadow: var(--shadow); }\n";
@@ -670,7 +665,7 @@ const CardText = (props) => {
670
665
  className && cssClasses.push(className);
671
666
  return cssClasses.filter(css => css).join(' ');
672
667
  };
673
- return (React.createElement("p", Object.assign({ className: getCssClasses() }, rest), props.children));
668
+ return (React.createElement("p", Object.assign({ className: getCssClasses() }, rest), children));
674
669
  };
675
670
 
676
671
  var css_248z$z = ".CardTitle-module_cardTitle__aiPSE {\n margin-bottom: 0;\n font-size: 1.5rem;\n font-weight: 400;\n line-height: 1.334;\n letter-spacing: 0em; }\n";
@@ -776,8 +771,8 @@ var css_248z$v = ".FormLabel-module_formLabel__TXcHc {\n margin-bottom: .5rem;
776
771
  var styles$v = {"formLabel":"FormLabel-module_formLabel__TXcHc"};
777
772
  styleInject(css_248z$v);
778
773
 
779
- const FormLabel = (props) => {
780
- const { children, className, htmlFor } = props, rest = __rest(props, ["children", "className", "htmlFor"]);
774
+ const FormLabel = (_a) => {
775
+ var { children, className, htmlFor } = _a, rest = __rest(_a, ["children", "className", "htmlFor"]);
781
776
  const getCssClasses = () => {
782
777
  const cssClasses = [];
783
778
  cssClasses.push(styles$v.formLabel);
@@ -793,7 +788,7 @@ const FormGroup = (props) => {
793
788
  };
794
789
 
795
790
  const FileInput = (props) => {
796
- const { id, checked, className, children, name, multiple = false, accept, disabled, onChange, readOnly, value, deletable = false } = props, rest = __rest(props, ["id", "checked", "className", "children", "name", "multiple", "accept", "disabled", "onChange", "readOnly", "value", "deletable"]);
791
+ const { id, className, children, name, multiple = false, accept, disabled, onChange, readOnly, value, deletable = false } = props, rest = __rest(props, ["id", "className", "children", "name", "multiple", "accept", "disabled", "onChange", "readOnly", "value", "deletable"]);
797
792
  const inputFileElement = useRef(null);
798
793
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
799
794
  const [model, setModel] = useState(value);
@@ -808,8 +803,7 @@ const FileInput = (props) => {
808
803
  setFileList(values);
809
804
  onChange && onChange(event);
810
805
  };
811
- const handleOnDelete = (file) => {
812
- // TODO - setModel
806
+ const handleOnDelete = () => {
813
807
  alert('coming soon');
814
808
  };
815
809
  return (React.createElement("div", { className: "d-flex align-items-start" },
@@ -837,7 +831,7 @@ const Select = (props) => {
837
831
  return cssClasses.filter(r => r).join(' ');
838
832
  };
839
833
  useEffect(() => {
840
- const newValue = !!value ? value : '';
834
+ const newValue = value ? value : '';
841
835
  writeValue(newValue);
842
836
  if (newValue) {
843
837
  const option = options.find(o => o.value === newValue);
@@ -909,7 +903,7 @@ const Select = (props) => {
909
903
  let result = null;
910
904
  if (selectedOptions.length <= multipleMaxCountItems && selectedOptions.length > 0) {
911
905
  result = selectedOptions
912
- .map(o => React.createElement(Chip, { key: o.value, className: "mr-2", color: COLOR.primary, isDeletable: true, onDelete: (e) => handleOnDelete(e, o) }, o.label));
906
+ .map(option => React.createElement(Chip, { key: option.value, className: "mr-2", color: COLOR.primary, isDeletable: true, onDelete: (e) => handleOnDelete(e, option) }, option.label));
913
907
  }
914
908
  else {
915
909
  result = React.createElement("span", null,
@@ -1017,15 +1011,17 @@ const FormInput = (props) => {
1017
1011
  type === 'textarea' &&
1018
1012
  React.createElement(Textarea, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, autoFocus: autoFocus, onInput: e => handleOnInput(e.target.value, type, name), onChange: e => handleOnChange(e.target.value, type, name), placeholder: placeholder, rows: textareaOptions === null || textareaOptions === void 0 ? void 0 : textareaOptions.rows, style: (textareaOptions === null || textareaOptions === void 0 ? void 0 : textareaOptions.resize) !== false ? undefined : { resize: 'none' } }),
1019
1013
  type === 'select' &&
1020
- React.createElement(Select, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, multiple: selectOptions === null || selectOptions === void 0 ? void 0 : selectOptions.multiple, onChange: e => handleOnChange(e, type, name), onKeyDown: onKeyDown, options: options }),
1014
+ React.createElement(Select, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, multiple: selectOptions === null || selectOptions === void 0 ? void 0 : selectOptions.multiple, onChange: e => handleOnChange(e, type, name),
1015
+ // onKeyDown={e => onKeyDown(e)}
1016
+ options: options }),
1021
1017
  type === 'autocomplete' &&
1022
- React.createElement(AutoComplete, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, openOnFocus: autoCompleteOptions === null || autoCompleteOptions === void 0 ? void 0 : autoCompleteOptions.openOnFocus, onChange: e => handleOnChange(e, type, name), onKeyDown: onKeyDown, options: options }),
1018
+ React.createElement(AutoComplete, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, openOnFocus: autoCompleteOptions === null || autoCompleteOptions === void 0 ? void 0 : autoCompleteOptions.openOnFocus, onChange: e => handleOnChange(e, type, name), options: options }),
1023
1019
  type === 'checkbox' &&
1024
1020
  React.createElement(Checkbox, { id: name, name: name, label: label, className: (!isValid ? ' is-invalid' : ''),
1025
1021
  // onChange={e => handleOnChange((e?.target as HTMLInputElement).checked, type, name as string)}
1026
1022
  checked: value === 'true' ? true : false }),
1027
1023
  type === 'radio' &&
1028
- React.createElement(Fragment, null, options.map((option) => React.createElement("div", { className: "form-check", key: option.id },
1024
+ React.createElement(React.Fragment, null, options.map((option) => React.createElement("div", { className: "form-check", key: option.id },
1029
1025
  React.createElement("input", { id: option.id ? option.id : option.value, name: name, type: "radio", className: "form-check-input", onChange: e => handleOnChange((e === null || e === void 0 ? void 0 : e.target).value, type, name), value: option.value, checked: value === option.value, onKeyDown: onKeyDown }),
1030
1026
  React.createElement("label", { className: "form-check-label", htmlFor: option.id }, option.label))))));
1031
1027
  };
@@ -1046,7 +1042,7 @@ const FormError = (props) => {
1046
1042
  React.createElement("div", { className: className }, errors.map(e => React.createElement("div", { key: e.validator }, e.message)))));
1047
1043
  };
1048
1044
 
1049
- const IsEmptyValidator = (value) => value === '' || value === null || value === undefined;
1045
+ const IsEmptyValidator = (value) => value.trim() === '' || value === null || value === undefined;
1050
1046
 
1051
1047
  const EmailValidator = (value) => {
1052
1048
  const isInvalidEmailFormat = value.match(/^([\w.%+-]+)@([\w-]+\.)+([\w]{2,})$/i) === null;
@@ -1076,7 +1072,7 @@ class Form extends Component {
1076
1072
  const values = keys.reduce((obj, f) => {
1077
1073
  const control = this.getControl(f);
1078
1074
  // TODO - refactor
1079
- const newValue = ((control.type === 'date' || control.type === 'datetime-local') && control.value && isValidDate(control.value)) ? new Date(control.value).toISOString() : control.value;
1075
+ const newValue = ((control.type === 'date' || control.type === 'datetime-local') && control.value && isValidDate((control.value))) ? new Date((control.value)).toISOString() : control.value;
1080
1076
  return (Object.assign(Object.assign({}, obj), { [f]: newValue }));
1081
1077
  }, {});
1082
1078
  if (this.state.isValid && this.state.isSubmitted) {
@@ -1230,7 +1226,9 @@ function isValidDate(dateObject) {
1230
1226
  }
1231
1227
 
1232
1228
  class FormControl {
1233
- constructor(value, validators = [], type, config) {
1229
+ constructor(
1230
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1231
+ value, validators = [], type, config) {
1234
1232
  this.value = value;
1235
1233
  this.validators = validators;
1236
1234
  this.type = type;
@@ -1247,7 +1245,7 @@ const DaySelect = (props) => {
1247
1245
  init();
1248
1246
  }, [month, year]);
1249
1247
  const init = () => {
1250
- var daysInMonth = new Date(year, month + 1, 0).getDate();
1248
+ const daysInMonth = new Date(year, month + 1, 0).getDate();
1251
1249
  const newDays = [];
1252
1250
  for (let i = 1; i <= daysInMonth; i++) {
1253
1251
  newDays.push({ value: i.toString(), label: i.toString() });
@@ -1404,14 +1402,15 @@ const MenuBody = (props) => {
1404
1402
  const { parentRef, children, className, shadow = true, menuPosition = 'left', onClickBackdrop } = props;
1405
1403
  const menuBodyRef = useRef(null);
1406
1404
  useEffect(() => {
1407
- if (menuBodyRef) {
1405
+ if (menuBodyRef && parentRef.current && menuBodyRef.current) {
1408
1406
  createPopper(parentRef.current, menuBodyRef.current, {
1409
1407
  placement: `${menuPosition}-start`,
1410
1408
  modifiers: [
1411
1409
  {
1412
1410
  name: 'offset',
1413
1411
  options: {
1414
- offset: ({ placement, reference, popper }) => {
1412
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1413
+ offset: ({ placement, popper }) => {
1415
1414
  if (placement === 'left-start') {
1416
1415
  return [0, -popper.width]; // y, x
1417
1416
  }
@@ -1446,7 +1445,7 @@ var styles$p = {"menu":"Menu-module_menu__p8QL-"};
1446
1445
  styleInject(css_248z$p);
1447
1446
 
1448
1447
  const Menu = (props) => {
1449
- const { toggle, children, className, open, menuPosition, onClickBackdrop, onToggleClick } = props, rest = __rest(props, ["toggle", "children", "className", "open", "menuPosition", "onClickBackdrop", "onToggleClick"]);
1448
+ const { toggle, children, className, open, menuPosition, onClickBackdrop } = props, rest = __rest(props, ["toggle", "children", "className", "open", "menuPosition", "onClickBackdrop"]);
1450
1449
  const menuContainer = useRef(null);
1451
1450
  const toggleContainerRef = useRef(null);
1452
1451
  const getCssClasses = () => {
@@ -1482,9 +1481,7 @@ const MenuItem = (props) => {
1482
1481
  e.stopPropagation();
1483
1482
  onClick && onClick(e);
1484
1483
  };
1485
- return (React.createElement(ConditionalWrapper, { condition: true, wrapper: children => ((type === 'item' ? (
1486
- // eslint-disable-next-line jsx-a11y/anchor-is-valid
1487
- React.createElement("a", { className: getCssClasses(), onClick: handleClick }, children)) :
1484
+ return (React.createElement(ConditionalWrapper, { condition: true, wrapper: children => ((type === 'item' ? (React.createElement("a", { className: getCssClasses(), onClick: handleClick }, children)) :
1488
1485
  React.createElement("div", { className: getCssClasses(), onClick: handleClick }, children))) }, children));
1489
1486
  };
1490
1487
 
@@ -1646,23 +1643,21 @@ const LoadingIndicatorContainer = ({ children }) => {
1646
1643
 
1647
1644
  class LoadingIndicatorService {
1648
1645
  show() {
1649
- return new Promise((resolve, reject) => {
1650
- if (this.container) {
1651
- this.hide();
1652
- }
1653
- this.container = document.createElement('div');
1654
- this.container.classList.add('snackbar-container');
1655
- document.body.appendChild(this.container);
1656
- render(React.createElement(LoadingIndicatorContainer, null,
1657
- React.createElement(LoadingIndicator, null)), this.container);
1658
- });
1646
+ if (this.container) {
1647
+ this.hide();
1648
+ }
1649
+ this.container = document.createElement('div');
1650
+ this.container.classList.add('snackbar-container');
1651
+ document.body.appendChild(this.container);
1652
+ render(React.createElement(LoadingIndicatorContainer, null,
1653
+ React.createElement(LoadingIndicator, null)), this.container);
1659
1654
  }
1660
1655
  hide() {
1661
1656
  if (this.container) {
1662
1657
  unmountComponentAtNode(this.container);
1663
1658
  document.body.removeChild(this.container);
1664
- this.container = null;
1665
- clearTimeout(this.handler);
1659
+ this.container = undefined;
1660
+ this.handler && clearTimeout(this.handler);
1666
1661
  }
1667
1662
  }
1668
1663
  }
@@ -1673,11 +1668,11 @@ var styles$h = {"modalHeader":"ModalHeader-module_modalHeader__tw-u-"};
1673
1668
  styleInject(css_248z$h);
1674
1669
 
1675
1670
  const ModalHeader = (props) => {
1676
- const { children, isDismissable = false, onClose } = props;
1671
+ const { children, isDismissable = false, onClose } = props, rest = __rest(props, ["children", "isDismissable", "onClose"]);
1677
1672
  const handleClick = () => {
1678
1673
  onClose && onClose();
1679
1674
  };
1680
- return (React.createElement("div", { className: "modal-header " + styles$h.modalHeader },
1675
+ return (React.createElement("div", Object.assign({ className: "modal-header " + styles$h.modalHeader }, rest),
1681
1676
  React.createElement("h5", { className: "modal-title" }, children),
1682
1677
  isDismissable &&
1683
1678
  React.createElement(IconButton, { icon: React.createElement(TimesSolidIcon, null), variant: VARIANT.text, onClick: handleClick })));
@@ -1718,7 +1713,7 @@ const Modal = (props) => {
1718
1713
  return (React.createElement(Fragment, null,
1719
1714
  React.createElement("div", { className: "modal show " + styles$g.modal, style: { display: 'block' } },
1720
1715
  React.createElement("div", { className: getCssClass() },
1721
- React.createElement("div", { className: 'modal-content ' + (!!fullScreen ? styles$g['modalContent'] : undefined) },
1716
+ React.createElement("div", { className: 'modal-content ' + (fullScreen ? styles$g['modalContent'] : undefined) },
1722
1717
  header &&
1723
1718
  React.createElement(ModalHeader, { isDismissable: isDismissable, onClose: () => onHeaderCloseClick && onHeaderCloseClick() }, header),
1724
1719
  React.createElement(ModalBody, null, children),
@@ -1947,7 +1942,7 @@ class SnackbarService {
1947
1942
  show(message, options) {
1948
1943
  const defaultOptions = { timeout: 3000, actionText: 'ok', color: COLOR.dark, target: document.body };
1949
1944
  const mergedOptions = Object.assign(defaultOptions, options);
1950
- return new Promise((resolve, reject) => {
1945
+ return new Promise((resolve) => {
1951
1946
  if (this.container) {
1952
1947
  this.hide();
1953
1948
  }
@@ -1970,8 +1965,8 @@ class SnackbarService {
1970
1965
  if (this.container) {
1971
1966
  unmountComponentAtNode(this.container);
1972
1967
  document.body.removeChild(this.container);
1973
- this.container = null;
1974
- clearTimeout(this.handler);
1968
+ this.container = undefined;
1969
+ this.handler && clearTimeout(this.handler);
1975
1970
  }
1976
1971
  }
1977
1972
  }
@@ -2125,7 +2120,7 @@ const Stepper = (props) => {
2125
2120
  isDisabled: isLinear && (activeIndex + 1 < index),
2126
2121
  showLabel: showLabel,
2127
2122
  showProgressCheckIcon: showProgressCheckIcon,
2128
- onClick: (event, val) => handleClickStep(event, val, index)
2123
+ onClick: (e) => handleClickStep(e.event, e.value, index)
2129
2124
  });
2130
2125
  };
2131
2126
  const isStepOptional = (index) => {
@@ -2217,10 +2212,11 @@ styleInject(css_248z$6);
2217
2212
 
2218
2213
  const Step = (props) => {
2219
2214
  const { className, label, showLabel, index, value, isActive, isDone, isDisabled, showProgressCheckIcon, onClick } = props;
2220
- const [hoverRef, isHovered] = useHover();
2221
- const handleClick = (e) => {
2215
+ const hoverRef = useRef(null);
2216
+ const isHover = useHover(hoverRef);
2217
+ const handleClick = (event) => {
2222
2218
  if (!isDisabled) {
2223
- onClick && onClick(e, value);
2219
+ onClick && onClick({ event, value });
2224
2220
  }
2225
2221
  };
2226
2222
  const getCssClasses = () => {
@@ -2238,11 +2234,18 @@ const Step = (props) => {
2238
2234
  isDisabled && cssClasses.push(styles$6['disabled']);
2239
2235
  return cssClasses.filter(css => css).join(' ');
2240
2236
  };
2237
+ const getCssClassesStepValue = () => {
2238
+ const cssClasses = [];
2239
+ cssClasses.push(styles$6.stepValue);
2240
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2241
+ isActive && cssClasses.push(styles$6.stepValue['isActive']);
2242
+ return cssClasses.filter(css => css).join(' ');
2243
+ };
2241
2244
  return (React.createElement("div", { ref: hoverRef, className: getCssClasses(), onClick: handleClick },
2242
2245
  React.createElement("div", { className: getCssClassesStep() },
2243
- React.createElement(Icon, { className: styles$6.stepIconCircle, iconColor: (isHovered || isActive) && !isDisabled ? COLOR.primary : COLOR.secondary },
2246
+ React.createElement(Icon, { className: styles$6.stepIconCircle, iconColor: (isHover || isActive) && !isDisabled ? COLOR.primary : COLOR.secondary },
2244
2247
  React.createElement(CircleSolidIcon, null)),
2245
- React.createElement("div", { className: styles$6.stepValue + ' ' + (isActive ? (styles$6.stepValue['isActive']) : '') }, showProgressCheckIcon && isActive && isDone ?
2248
+ React.createElement("div", { className: getCssClassesStepValue() }, showProgressCheckIcon && isActive && isDone ?
2246
2249
  React.createElement(Icon, null,
2247
2250
  React.createElement(CheckSolidIcon, null))
2248
2251
  :
@@ -2315,10 +2318,10 @@ const Tabs = (props) => {
2315
2318
  key: child.props.value,
2316
2319
  isActive: child.props.value === selectedValue,
2317
2320
  fixed: fixed,
2318
- onClick: (event, newValue) => handleClickTab(event, newValue, index),
2321
+ onClick: (e) => handleClickTab(e.event, e.value, index),
2319
2322
  });
2320
2323
  };
2321
- return (React.createElement(Fragment, null,
2324
+ return (React.createElement(React.Fragment, null,
2322
2325
  React.createElement("div", { className: getCssClasses() },
2323
2326
  children && React.Children.toArray(children).map((child, index) => renderTabs(child, index)),
2324
2327
  children &&
@@ -2340,11 +2343,11 @@ const Tab = (props) => {
2340
2343
  className && cssClasses.push(className);
2341
2344
  return cssClasses.filter(css => css).join(' ');
2342
2345
  };
2343
- return (React.createElement(Button, { className: getCssClasses(), onClick: (event) => onClick && onClick(event, value), isActive: isActive, disabled: disabled }, label));
2346
+ return (React.createElement(Button, { className: getCssClasses(), onClick: (event) => onClick && onClick({ event, value }), isActive: isActive, disabled: disabled }, label));
2344
2347
  };
2345
2348
 
2346
2349
  const TabPanel = (props) => {
2347
- const { children, className, value, index } = props, rest = __rest(props, ["children", "className", "value", "index"]);
2350
+ const { children, value, index } = props, rest = __rest(props, ["children", "value", "index"]);
2348
2351
  return (React.createElement("div", Object.assign({ role: "tabpanel", hidden: value !== index, id: `tabpanel-${index}`, "aria-labelledby": `wrapped-tab-${index}` }, rest), value === index && children));
2349
2352
  };
2350
2353
 
@@ -2547,7 +2550,7 @@ var styles = {"treeItem":"TreeItem-module_treeItem__Mxsjr"};
2547
2550
  styleInject(css_248z);
2548
2551
 
2549
2552
  const TreeItem = (props) => {
2550
- const { nodeId, label, children, className, isExpanded, isSelected, isSelectable, onToggleExpand, onSelect } = props;
2553
+ const { nodeId, label, children, className, isExpanded, isSelected, isSelectable, onToggleExpand, onItemSelect } = props;
2551
2554
  const [_isExpanded, setIsExpanded] = useState(false);
2552
2555
  const [_isSelected, setIsSelected] = useState(false);
2553
2556
  const getCssClasses = () => {
@@ -2570,7 +2573,7 @@ const TreeItem = (props) => {
2570
2573
  };
2571
2574
  const handleOnSelect = (nodeId) => {
2572
2575
  setIsSelected(!_isSelected);
2573
- onSelect && onSelect(nodeId, !_isSelected);
2576
+ onItemSelect && onItemSelect({ id: nodeId, isSelected: !_isSelected });
2574
2577
  };
2575
2578
  return (React.createElement("li", { className: getCssClasses(), style: { paddingLeft: `${(48 * (children ? 0 : 1))}px` } },
2576
2579
  React.createElement("div", { className: "d-flex align-items-center" },
package/index.js CHANGED
@@ -251,28 +251,25 @@ function useWindowSize() {
251
251
  return windowSize;
252
252
  }
253
253
 
254
- function useHover() {
254
+ function useHover(elementRef) {
255
255
  const [value, setValue] = React.useState(false);
256
- const ref = React.useRef(null);
257
256
  const handleMouseOver = () => setValue(true);
258
257
  const handleMouseOut = () => setValue(false);
259
- React.useEffect(() => {
260
- const node = ref.current;
261
- if (node) {
262
- node.addEventListener("mouseover", handleMouseOver);
263
- node.addEventListener("mouseout", handleMouseOut);
258
+ const node = elementRef.current;
259
+ if (node) {
260
+ node.addEventListener("mouseover", handleMouseOver);
261
+ node.addEventListener("mouseout", handleMouseOut);
262
+ React.useEffect(() => {
264
263
  return () => {
265
264
  node.removeEventListener("mouseover", handleMouseOver);
266
265
  node.removeEventListener("mouseout", handleMouseOut);
267
266
  };
268
- }
269
- return;
270
- }, [ref.current] // Recall only if ref changes
271
- );
272
- return [ref, value];
267
+ }, [elementRef.current]);
268
+ }
269
+ return value;
273
270
  }
274
271
 
275
- const useConstructor = (callBack = () => { }) => {
272
+ const useConstructor = (callBack) => {
276
273
  const [hasBeenCalled, setHasBeenCalled] = React.useState(false);
277
274
  if (hasBeenCalled)
278
275
  return;
@@ -600,9 +597,7 @@ const BreadcrumbItem = (props) => {
600
597
  onClick && onClick(event);
601
598
  };
602
599
  return (React__default["default"].createElement("li", { className: getCssClasses(), onClick: handleClick },
603
- React__default["default"].createElement(ConditionalWrapper, { condition: !isActive,
604
- // eslint-disable-next-line jsx-a11y/anchor-is-valid
605
- wrapper: label => React__default["default"].createElement("a", null, label) }, children)));
600
+ React__default["default"].createElement(ConditionalWrapper, { condition: !isActive, wrapper: label => React__default["default"].createElement("a", null, label) }, children)));
606
601
  };
607
602
 
608
603
  var css_248z$E = ".Card-module_card__TQdQq {\n background: var(--white);\n border-radius: var(--borderRadius); }\n .Card-module_card__TQdQq.Card-module_shadow__NxDVz {\n box-shadow: var(--shadow); }\n";
@@ -678,7 +673,7 @@ const CardText = (props) => {
678
673
  className && cssClasses.push(className);
679
674
  return cssClasses.filter(css => css).join(' ');
680
675
  };
681
- return (React__default["default"].createElement("p", Object.assign({ className: getCssClasses() }, rest), props.children));
676
+ return (React__default["default"].createElement("p", Object.assign({ className: getCssClasses() }, rest), children));
682
677
  };
683
678
 
684
679
  var css_248z$z = ".CardTitle-module_cardTitle__aiPSE {\n margin-bottom: 0;\n font-size: 1.5rem;\n font-weight: 400;\n line-height: 1.334;\n letter-spacing: 0em; }\n";
@@ -784,8 +779,8 @@ var css_248z$v = ".FormLabel-module_formLabel__TXcHc {\n margin-bottom: .5rem;
784
779
  var styles$v = {"formLabel":"FormLabel-module_formLabel__TXcHc"};
785
780
  styleInject(css_248z$v);
786
781
 
787
- const FormLabel = (props) => {
788
- const { children, className, htmlFor } = props, rest = __rest(props, ["children", "className", "htmlFor"]);
782
+ const FormLabel = (_a) => {
783
+ var { children, className, htmlFor } = _a, rest = __rest(_a, ["children", "className", "htmlFor"]);
789
784
  const getCssClasses = () => {
790
785
  const cssClasses = [];
791
786
  cssClasses.push(styles$v.formLabel);
@@ -801,7 +796,7 @@ const FormGroup = (props) => {
801
796
  };
802
797
 
803
798
  const FileInput = (props) => {
804
- const { id, checked, className, children, name, multiple = false, accept, disabled, onChange, readOnly, value, deletable = false } = props, rest = __rest(props, ["id", "checked", "className", "children", "name", "multiple", "accept", "disabled", "onChange", "readOnly", "value", "deletable"]);
799
+ const { id, className, children, name, multiple = false, accept, disabled, onChange, readOnly, value, deletable = false } = props, rest = __rest(props, ["id", "className", "children", "name", "multiple", "accept", "disabled", "onChange", "readOnly", "value", "deletable"]);
805
800
  const inputFileElement = React.useRef(null);
806
801
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
807
802
  const [model, setModel] = React.useState(value);
@@ -816,8 +811,7 @@ const FileInput = (props) => {
816
811
  setFileList(values);
817
812
  onChange && onChange(event);
818
813
  };
819
- const handleOnDelete = (file) => {
820
- // TODO - setModel
814
+ const handleOnDelete = () => {
821
815
  alert('coming soon');
822
816
  };
823
817
  return (React__default["default"].createElement("div", { className: "d-flex align-items-start" },
@@ -845,7 +839,7 @@ const Select = (props) => {
845
839
  return cssClasses.filter(r => r).join(' ');
846
840
  };
847
841
  React.useEffect(() => {
848
- const newValue = !!value ? value : '';
842
+ const newValue = value ? value : '';
849
843
  writeValue(newValue);
850
844
  if (newValue) {
851
845
  const option = options.find(o => o.value === newValue);
@@ -917,7 +911,7 @@ const Select = (props) => {
917
911
  let result = null;
918
912
  if (selectedOptions.length <= multipleMaxCountItems && selectedOptions.length > 0) {
919
913
  result = selectedOptions
920
- .map(o => React__default["default"].createElement(Chip, { key: o.value, className: "mr-2", color: exports.COLOR.primary, isDeletable: true, onDelete: (e) => handleOnDelete(e, o) }, o.label));
914
+ .map(option => React__default["default"].createElement(Chip, { key: option.value, className: "mr-2", color: exports.COLOR.primary, isDeletable: true, onDelete: (e) => handleOnDelete(e, option) }, option.label));
921
915
  }
922
916
  else {
923
917
  result = React__default["default"].createElement("span", null,
@@ -1025,15 +1019,17 @@ const FormInput = (props) => {
1025
1019
  type === 'textarea' &&
1026
1020
  React__default["default"].createElement(Textarea, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, autoFocus: autoFocus, onInput: e => handleOnInput(e.target.value, type, name), onChange: e => handleOnChange(e.target.value, type, name), placeholder: placeholder, rows: textareaOptions === null || textareaOptions === void 0 ? void 0 : textareaOptions.rows, style: (textareaOptions === null || textareaOptions === void 0 ? void 0 : textareaOptions.resize) !== false ? undefined : { resize: 'none' } }),
1027
1021
  type === 'select' &&
1028
- React__default["default"].createElement(Select, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, multiple: selectOptions === null || selectOptions === void 0 ? void 0 : selectOptions.multiple, onChange: e => handleOnChange(e, type, name), onKeyDown: onKeyDown, options: options }),
1022
+ React__default["default"].createElement(Select, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, multiple: selectOptions === null || selectOptions === void 0 ? void 0 : selectOptions.multiple, onChange: e => handleOnChange(e, type, name),
1023
+ // onKeyDown={e => onKeyDown(e)}
1024
+ options: options }),
1029
1025
  type === 'autocomplete' &&
1030
- React__default["default"].createElement(AutoComplete, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, openOnFocus: autoCompleteOptions === null || autoCompleteOptions === void 0 ? void 0 : autoCompleteOptions.openOnFocus, onChange: e => handleOnChange(e, type, name), onKeyDown: onKeyDown, options: options }),
1026
+ React__default["default"].createElement(AutoComplete, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, openOnFocus: autoCompleteOptions === null || autoCompleteOptions === void 0 ? void 0 : autoCompleteOptions.openOnFocus, onChange: e => handleOnChange(e, type, name), options: options }),
1031
1027
  type === 'checkbox' &&
1032
1028
  React__default["default"].createElement(Checkbox, { id: name, name: name, label: label, className: (!isValid ? ' is-invalid' : ''),
1033
1029
  // onChange={e => handleOnChange((e?.target as HTMLInputElement).checked, type, name as string)}
1034
1030
  checked: value === 'true' ? true : false }),
1035
1031
  type === 'radio' &&
1036
- React__default["default"].createElement(React.Fragment, null, options.map((option) => React__default["default"].createElement("div", { className: "form-check", key: option.id },
1032
+ React__default["default"].createElement(React__default["default"].Fragment, null, options.map((option) => React__default["default"].createElement("div", { className: "form-check", key: option.id },
1037
1033
  React__default["default"].createElement("input", { id: option.id ? option.id : option.value, name: name, type: "radio", className: "form-check-input", onChange: e => handleOnChange((e === null || e === void 0 ? void 0 : e.target).value, type, name), value: option.value, checked: value === option.value, onKeyDown: onKeyDown }),
1038
1034
  React__default["default"].createElement("label", { className: "form-check-label", htmlFor: option.id }, option.label))))));
1039
1035
  };
@@ -1054,7 +1050,7 @@ const FormError = (props) => {
1054
1050
  React__default["default"].createElement("div", { className: className }, errors.map(e => React__default["default"].createElement("div", { key: e.validator }, e.message)))));
1055
1051
  };
1056
1052
 
1057
- const IsEmptyValidator = (value) => value === '' || value === null || value === undefined;
1053
+ const IsEmptyValidator = (value) => value.trim() === '' || value === null || value === undefined;
1058
1054
 
1059
1055
  const EmailValidator = (value) => {
1060
1056
  const isInvalidEmailFormat = value.match(/^([\w.%+-]+)@([\w-]+\.)+([\w]{2,})$/i) === null;
@@ -1084,7 +1080,7 @@ class Form extends React.Component {
1084
1080
  const values = keys.reduce((obj, f) => {
1085
1081
  const control = this.getControl(f);
1086
1082
  // TODO - refactor
1087
- const newValue = ((control.type === 'date' || control.type === 'datetime-local') && control.value && isValidDate(control.value)) ? new Date(control.value).toISOString() : control.value;
1083
+ const newValue = ((control.type === 'date' || control.type === 'datetime-local') && control.value && isValidDate((control.value))) ? new Date((control.value)).toISOString() : control.value;
1088
1084
  return (Object.assign(Object.assign({}, obj), { [f]: newValue }));
1089
1085
  }, {});
1090
1086
  if (this.state.isValid && this.state.isSubmitted) {
@@ -1238,7 +1234,9 @@ function isValidDate(dateObject) {
1238
1234
  }
1239
1235
 
1240
1236
  class FormControl {
1241
- constructor(value, validators = [], type, config) {
1237
+ constructor(
1238
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1239
+ value, validators = [], type, config) {
1242
1240
  this.value = value;
1243
1241
  this.validators = validators;
1244
1242
  this.type = type;
@@ -1255,7 +1253,7 @@ const DaySelect = (props) => {
1255
1253
  init();
1256
1254
  }, [month, year]);
1257
1255
  const init = () => {
1258
- var daysInMonth = new Date(year, month + 1, 0).getDate();
1256
+ const daysInMonth = new Date(year, month + 1, 0).getDate();
1259
1257
  const newDays = [];
1260
1258
  for (let i = 1; i <= daysInMonth; i++) {
1261
1259
  newDays.push({ value: i.toString(), label: i.toString() });
@@ -1412,14 +1410,15 @@ const MenuBody = (props) => {
1412
1410
  const { parentRef, children, className, shadow = true, menuPosition = 'left', onClickBackdrop } = props;
1413
1411
  const menuBodyRef = React.useRef(null);
1414
1412
  React.useEffect(() => {
1415
- if (menuBodyRef) {
1413
+ if (menuBodyRef && parentRef.current && menuBodyRef.current) {
1416
1414
  core.createPopper(parentRef.current, menuBodyRef.current, {
1417
1415
  placement: `${menuPosition}-start`,
1418
1416
  modifiers: [
1419
1417
  {
1420
1418
  name: 'offset',
1421
1419
  options: {
1422
- offset: ({ placement, reference, popper }) => {
1420
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1421
+ offset: ({ placement, popper }) => {
1423
1422
  if (placement === 'left-start') {
1424
1423
  return [0, -popper.width]; // y, x
1425
1424
  }
@@ -1454,7 +1453,7 @@ var styles$p = {"menu":"Menu-module_menu__p8QL-"};
1454
1453
  styleInject(css_248z$p);
1455
1454
 
1456
1455
  const Menu = (props) => {
1457
- const { toggle, children, className, open, menuPosition, onClickBackdrop, onToggleClick } = props, rest = __rest(props, ["toggle", "children", "className", "open", "menuPosition", "onClickBackdrop", "onToggleClick"]);
1456
+ const { toggle, children, className, open, menuPosition, onClickBackdrop } = props, rest = __rest(props, ["toggle", "children", "className", "open", "menuPosition", "onClickBackdrop"]);
1458
1457
  const menuContainer = React.useRef(null);
1459
1458
  const toggleContainerRef = React.useRef(null);
1460
1459
  const getCssClasses = () => {
@@ -1490,9 +1489,7 @@ const MenuItem = (props) => {
1490
1489
  e.stopPropagation();
1491
1490
  onClick && onClick(e);
1492
1491
  };
1493
- return (React__default["default"].createElement(ConditionalWrapper, { condition: true, wrapper: children => ((type === 'item' ? (
1494
- // eslint-disable-next-line jsx-a11y/anchor-is-valid
1495
- React__default["default"].createElement("a", { className: getCssClasses(), onClick: handleClick }, children)) :
1492
+ return (React__default["default"].createElement(ConditionalWrapper, { condition: true, wrapper: children => ((type === 'item' ? (React__default["default"].createElement("a", { className: getCssClasses(), onClick: handleClick }, children)) :
1496
1493
  React__default["default"].createElement("div", { className: getCssClasses(), onClick: handleClick }, children))) }, children));
1497
1494
  };
1498
1495
 
@@ -1654,23 +1651,21 @@ const LoadingIndicatorContainer = ({ children }) => {
1654
1651
 
1655
1652
  class LoadingIndicatorService {
1656
1653
  show() {
1657
- return new Promise((resolve, reject) => {
1658
- if (this.container) {
1659
- this.hide();
1660
- }
1661
- this.container = document.createElement('div');
1662
- this.container.classList.add('snackbar-container');
1663
- document.body.appendChild(this.container);
1664
- reactDom.render(React__default["default"].createElement(LoadingIndicatorContainer, null,
1665
- React__default["default"].createElement(LoadingIndicator, null)), this.container);
1666
- });
1654
+ if (this.container) {
1655
+ this.hide();
1656
+ }
1657
+ this.container = document.createElement('div');
1658
+ this.container.classList.add('snackbar-container');
1659
+ document.body.appendChild(this.container);
1660
+ reactDom.render(React__default["default"].createElement(LoadingIndicatorContainer, null,
1661
+ React__default["default"].createElement(LoadingIndicator, null)), this.container);
1667
1662
  }
1668
1663
  hide() {
1669
1664
  if (this.container) {
1670
1665
  reactDom.unmountComponentAtNode(this.container);
1671
1666
  document.body.removeChild(this.container);
1672
- this.container = null;
1673
- clearTimeout(this.handler);
1667
+ this.container = undefined;
1668
+ this.handler && clearTimeout(this.handler);
1674
1669
  }
1675
1670
  }
1676
1671
  }
@@ -1681,11 +1676,11 @@ var styles$h = {"modalHeader":"ModalHeader-module_modalHeader__tw-u-"};
1681
1676
  styleInject(css_248z$h);
1682
1677
 
1683
1678
  const ModalHeader = (props) => {
1684
- const { children, isDismissable = false, onClose } = props;
1679
+ const { children, isDismissable = false, onClose } = props, rest = __rest(props, ["children", "isDismissable", "onClose"]);
1685
1680
  const handleClick = () => {
1686
1681
  onClose && onClose();
1687
1682
  };
1688
- return (React__default["default"].createElement("div", { className: "modal-header " + styles$h.modalHeader },
1683
+ return (React__default["default"].createElement("div", Object.assign({ className: "modal-header " + styles$h.modalHeader }, rest),
1689
1684
  React__default["default"].createElement("h5", { className: "modal-title" }, children),
1690
1685
  isDismissable &&
1691
1686
  React__default["default"].createElement(IconButton, { icon: React__default["default"].createElement(TimesSolidIcon, null), variant: exports.VARIANT.text, onClick: handleClick })));
@@ -1726,7 +1721,7 @@ const Modal = (props) => {
1726
1721
  return (React__default["default"].createElement(React.Fragment, null,
1727
1722
  React__default["default"].createElement("div", { className: "modal show " + styles$g.modal, style: { display: 'block' } },
1728
1723
  React__default["default"].createElement("div", { className: getCssClass() },
1729
- React__default["default"].createElement("div", { className: 'modal-content ' + (!!fullScreen ? styles$g['modalContent'] : undefined) },
1724
+ React__default["default"].createElement("div", { className: 'modal-content ' + (fullScreen ? styles$g['modalContent'] : undefined) },
1730
1725
  header &&
1731
1726
  React__default["default"].createElement(ModalHeader, { isDismissable: isDismissable, onClose: () => onHeaderCloseClick && onHeaderCloseClick() }, header),
1732
1727
  React__default["default"].createElement(ModalBody, null, children),
@@ -1955,7 +1950,7 @@ class SnackbarService {
1955
1950
  show(message, options) {
1956
1951
  const defaultOptions = { timeout: 3000, actionText: 'ok', color: exports.COLOR.dark, target: document.body };
1957
1952
  const mergedOptions = Object.assign(defaultOptions, options);
1958
- return new Promise((resolve, reject) => {
1953
+ return new Promise((resolve) => {
1959
1954
  if (this.container) {
1960
1955
  this.hide();
1961
1956
  }
@@ -1978,8 +1973,8 @@ class SnackbarService {
1978
1973
  if (this.container) {
1979
1974
  reactDom.unmountComponentAtNode(this.container);
1980
1975
  document.body.removeChild(this.container);
1981
- this.container = null;
1982
- clearTimeout(this.handler);
1976
+ this.container = undefined;
1977
+ this.handler && clearTimeout(this.handler);
1983
1978
  }
1984
1979
  }
1985
1980
  }
@@ -2133,7 +2128,7 @@ const Stepper = (props) => {
2133
2128
  isDisabled: isLinear && (activeIndex + 1 < index),
2134
2129
  showLabel: showLabel,
2135
2130
  showProgressCheckIcon: showProgressCheckIcon,
2136
- onClick: (event, val) => handleClickStep(event, val, index)
2131
+ onClick: (e) => handleClickStep(e.event, e.value, index)
2137
2132
  });
2138
2133
  };
2139
2134
  const isStepOptional = (index) => {
@@ -2225,10 +2220,11 @@ styleInject(css_248z$6);
2225
2220
 
2226
2221
  const Step = (props) => {
2227
2222
  const { className, label, showLabel, index, value, isActive, isDone, isDisabled, showProgressCheckIcon, onClick } = props;
2228
- const [hoverRef, isHovered] = useHover();
2229
- const handleClick = (e) => {
2223
+ const hoverRef = React.useRef(null);
2224
+ const isHover = useHover(hoverRef);
2225
+ const handleClick = (event) => {
2230
2226
  if (!isDisabled) {
2231
- onClick && onClick(e, value);
2227
+ onClick && onClick({ event, value });
2232
2228
  }
2233
2229
  };
2234
2230
  const getCssClasses = () => {
@@ -2246,11 +2242,18 @@ const Step = (props) => {
2246
2242
  isDisabled && cssClasses.push(styles$6['disabled']);
2247
2243
  return cssClasses.filter(css => css).join(' ');
2248
2244
  };
2245
+ const getCssClassesStepValue = () => {
2246
+ const cssClasses = [];
2247
+ cssClasses.push(styles$6.stepValue);
2248
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2249
+ isActive && cssClasses.push(styles$6.stepValue['isActive']);
2250
+ return cssClasses.filter(css => css).join(' ');
2251
+ };
2249
2252
  return (React__default["default"].createElement("div", { ref: hoverRef, className: getCssClasses(), onClick: handleClick },
2250
2253
  React__default["default"].createElement("div", { className: getCssClassesStep() },
2251
- React__default["default"].createElement(Icon, { className: styles$6.stepIconCircle, iconColor: (isHovered || isActive) && !isDisabled ? exports.COLOR.primary : exports.COLOR.secondary },
2254
+ React__default["default"].createElement(Icon, { className: styles$6.stepIconCircle, iconColor: (isHover || isActive) && !isDisabled ? exports.COLOR.primary : exports.COLOR.secondary },
2252
2255
  React__default["default"].createElement(CircleSolidIcon, null)),
2253
- React__default["default"].createElement("div", { className: styles$6.stepValue + ' ' + (isActive ? (styles$6.stepValue['isActive']) : '') }, showProgressCheckIcon && isActive && isDone ?
2256
+ React__default["default"].createElement("div", { className: getCssClassesStepValue() }, showProgressCheckIcon && isActive && isDone ?
2254
2257
  React__default["default"].createElement(Icon, null,
2255
2258
  React__default["default"].createElement(CheckSolidIcon, null))
2256
2259
  :
@@ -2323,10 +2326,10 @@ const Tabs = (props) => {
2323
2326
  key: child.props.value,
2324
2327
  isActive: child.props.value === selectedValue,
2325
2328
  fixed: fixed,
2326
- onClick: (event, newValue) => handleClickTab(event, newValue, index),
2329
+ onClick: (e) => handleClickTab(e.event, e.value, index),
2327
2330
  });
2328
2331
  };
2329
- return (React__default["default"].createElement(React.Fragment, null,
2332
+ return (React__default["default"].createElement(React__default["default"].Fragment, null,
2330
2333
  React__default["default"].createElement("div", { className: getCssClasses() },
2331
2334
  children && React__default["default"].Children.toArray(children).map((child, index) => renderTabs(child, index)),
2332
2335
  children &&
@@ -2348,11 +2351,11 @@ const Tab = (props) => {
2348
2351
  className && cssClasses.push(className);
2349
2352
  return cssClasses.filter(css => css).join(' ');
2350
2353
  };
2351
- return (React__default["default"].createElement(Button, { className: getCssClasses(), onClick: (event) => onClick && onClick(event, value), isActive: isActive, disabled: disabled }, label));
2354
+ return (React__default["default"].createElement(Button, { className: getCssClasses(), onClick: (event) => onClick && onClick({ event, value }), isActive: isActive, disabled: disabled }, label));
2352
2355
  };
2353
2356
 
2354
2357
  const TabPanel = (props) => {
2355
- const { children, className, value, index } = props, rest = __rest(props, ["children", "className", "value", "index"]);
2358
+ const { children, value, index } = props, rest = __rest(props, ["children", "value", "index"]);
2356
2359
  return (React__default["default"].createElement("div", Object.assign({ role: "tabpanel", hidden: value !== index, id: `tabpanel-${index}`, "aria-labelledby": `wrapped-tab-${index}` }, rest), value === index && children));
2357
2360
  };
2358
2361
 
@@ -2555,7 +2558,7 @@ var styles = {"treeItem":"TreeItem-module_treeItem__Mxsjr"};
2555
2558
  styleInject(css_248z);
2556
2559
 
2557
2560
  const TreeItem = (props) => {
2558
- const { nodeId, label, children, className, isExpanded, isSelected, isSelectable, onToggleExpand, onSelect } = props;
2561
+ const { nodeId, label, children, className, isExpanded, isSelected, isSelectable, onToggleExpand, onItemSelect } = props;
2559
2562
  const [_isExpanded, setIsExpanded] = React.useState(false);
2560
2563
  const [_isSelected, setIsSelected] = React.useState(false);
2561
2564
  const getCssClasses = () => {
@@ -2578,7 +2581,7 @@ const TreeItem = (props) => {
2578
2581
  };
2579
2582
  const handleOnSelect = (nodeId) => {
2580
2583
  setIsSelected(!_isSelected);
2581
- onSelect && onSelect(nodeId, !_isSelected);
2584
+ onItemSelect && onItemSelect({ id: nodeId, isSelected: !_isSelected });
2582
2585
  };
2583
2586
  return (React__default["default"].createElement("li", { className: getCssClasses(), style: { paddingLeft: `${(48 * (children ? 0 : 1))}px` } },
2584
2587
  React__default["default"].createElement("div", { className: "d-flex align-items-center" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-asc",
3
- "version": "19.0.1",
3
+ "version": "19.0.2",
4
4
  "description": "handcrafted react components",
5
5
  "main": "index.js",
6
6
  "module": "index.es.js",