react-asc 25.0.5 → 25.1.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 (48) hide show
  1. package/components/Alert/Alert.d.ts +4 -2
  2. package/components/AppBar/AppBar.d.ts +4 -2
  3. package/components/AppBar/AppBarTitle.d.ts +2 -1
  4. package/components/AutoComplete/AutoComplete.d.ts +1 -1
  5. package/components/Breadcrumb/Breadcrumb.d.ts +2 -1
  6. package/components/Button/ButtonContext.d.ts +1 -1
  7. package/components/Chip/Chip.d.ts +1 -1
  8. package/components/ConditionalWrapper/ConditionalWrapper.d.ts +1 -1
  9. package/components/ExpansionPanel/ExpansionPanel.d.ts +2 -1
  10. package/components/ExpansionPanel/ExpansionPanelContent.d.ts +1 -1
  11. package/components/ExpansionPanel/ExpansionPanelHeader.d.ts +2 -1
  12. package/components/Form/Form.d.ts +4 -4
  13. package/components/Form/FormError.d.ts +1 -1
  14. package/components/Form/FormGroup.d.ts +1 -1
  15. package/components/Form/FormInput/FormInput.d.ts +2 -2
  16. package/components/Form/form.interfaces.d.ts +1 -4
  17. package/components/Form/form.models.d.ts +2 -2
  18. package/components/Icon/Icon.d.ts +3 -2
  19. package/components/List/ListItem.d.ts +1 -1
  20. package/components/List/ListItemText.d.ts +2 -1
  21. package/components/List/list.models.d.ts +2 -2
  22. package/components/Menu/Menu.d.ts +4 -3
  23. package/components/Menu/MenuBody.d.ts +4 -3
  24. package/components/Menu/MenuContext.d.ts +1 -1
  25. package/components/Menu/MenuItem.d.ts +1 -1
  26. package/components/Menu/MenuToggle.d.ts +1 -1
  27. package/components/Modal/GlobalModal.d.ts +5 -5
  28. package/components/Modal/Modal.d.ts +2 -2
  29. package/components/Modal/ModalBody.d.ts +1 -1
  30. package/components/Modal/modal.interfaces.d.ts +2 -2
  31. package/components/Modal/modal.service.d.ts +4 -4
  32. package/components/Select/Select.d.ts +1 -1
  33. package/components/Sidebar/Sidebar.d.ts +1 -1
  34. package/components/Snackbar/Snackbar.d.ts +2 -1
  35. package/components/SpeedDial/SpeedDialIcon.d.ts +2 -1
  36. package/components/Stepper/Step/Step.d.ts +2 -1
  37. package/components/Stepper/StepPanel/StepPanel.d.ts +1 -1
  38. package/components/Stepper/Stepper.d.ts +4 -2
  39. package/components/Stepper/StepperActions/StepperActions.d.ts +2 -0
  40. package/components/Table/Table.d.ts +1 -1
  41. package/components/Table/TableContext.d.ts +1 -1
  42. package/components/Tabs/Tab.d.ts +2 -1
  43. package/components/Tabs/TabContext.d.ts +1 -1
  44. package/components/Tabs/Tabs.d.ts +2 -2
  45. package/hooks/useDebounce.d.ts +1 -1
  46. package/index.es.js +22 -23
  47. package/index.js +22 -23
  48. package/package.json +1 -1
@@ -1,6 +1,8 @@
1
- import React, { ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
+ import React from 'react';
2
3
  import { VARIANT } from '../component.enums';
3
- import { COLOR, SIZE } from '../component.enums';
4
+ import type { SIZE } from '../component.enums';
5
+ import { COLOR } from '../component.enums';
4
6
  export interface IAlertProps extends React.ComponentProps<'div'> {
5
7
  children?: ReactNode;
6
8
  className?: string;
@@ -1,5 +1,7 @@
1
- import React, { ReactNode } from 'react';
2
- import { COLOR, SIZE } from '../component.enums';
1
+ import type { ReactNode } from 'react';
2
+ import React from 'react';
3
+ import type { SIZE } from '../component.enums';
4
+ import { COLOR } from '../component.enums';
3
5
  export interface IAppBarProps extends React.ComponentProps<'nav'> {
4
6
  children?: ReactNode;
5
7
  className?: string;
@@ -1,4 +1,5 @@
1
- import React, { ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
+ import React from 'react';
2
3
  export interface IAppBarTitleProps extends React.ComponentProps<'div'> {
3
4
  children?: ReactNode;
4
5
  }
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ISelectOption } from '../component.interfaces';
2
+ import type { ISelectOption } from '../component.interfaces';
3
3
  export interface IAutoCompleteProps {
4
4
  id?: string;
5
5
  name?: string;
@@ -1,4 +1,5 @@
1
- import React, { ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
+ import React from 'react';
2
3
  export interface IBreadcrumbProps extends React.ComponentProps<'nav'> {
3
4
  children?: ReactNode;
4
5
  }
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { COLOR } from '../component.enums';
2
+ import type { COLOR } from '../component.enums';
3
3
  export interface IButtonContext {
4
4
  color: COLOR | null;
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { COLOR } from '../component.enums';
2
+ import type { COLOR } from '../component.enums';
3
3
  export interface IChipProps extends React.ComponentProps<'div'> {
4
4
  color?: COLOR;
5
5
  shadow?: boolean;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import type React from 'react';
2
2
  interface IConditionalWrapperProps {
3
3
  condition: boolean;
4
4
  wrapper: (children: React.ReactNode) => JSX.Element;
@@ -1,4 +1,5 @@
1
- import React, { ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
+ import React from 'react';
2
3
  export interface IExpansionPanelProps {
3
4
  header: ReactNode;
4
5
  children: ReactNode;
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
2
  export interface IExpansionPanelContentProps {
3
3
  children?: ReactNode;
4
4
  }
@@ -1,4 +1,5 @@
1
- import React, { ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
+ import React from 'react';
2
3
  export interface IExpansionPanelHeaderProps {
3
4
  onClick?: (event: React.MouseEvent) => void;
4
5
  children?: ReactNode;
@@ -1,11 +1,11 @@
1
1
  import React, { Component } from 'react';
2
- import { IControls, IFormValues } from './form.interfaces';
3
- import { FormControl } from './form.models';
2
+ import type { IControls } from './form.interfaces';
3
+ import type { FormControl } from './form.models';
4
4
  export interface IFormProps {
5
5
  controls: IControls;
6
6
  validateOnBlur?: boolean;
7
- onSubmit?: (values: IFormValues) => void;
8
- onChange?: (values: IFormValues) => void;
7
+ onSubmit?: (values: unknown) => void;
8
+ onChange?: (values: unknown) => void;
9
9
  submitOnEnter?: boolean;
10
10
  }
11
11
  export interface IFormState {
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { IFormInputError } from './form.interfaces';
2
+ import type { IFormInputError } from './form.interfaces';
3
3
  interface IFormErrorProps {
4
4
  className?: string;
5
5
  errors?: IFormInputError[];
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
2
  interface IFormGroupProps {
3
3
  children?: ReactNode;
4
4
  className?: string;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { IFormInputOptions, IFormTextAreaOptions, IFormSelectOptions, IFormAutoCompleteOptions } from '../form.interfaces';
3
- import { IFormControlType } from '../form.types';
2
+ import type { IFormInputOptions, IFormTextAreaOptions, IFormSelectOptions, IFormAutoCompleteOptions } from '../form.interfaces';
3
+ import type { IFormControlType } from '../form.types';
4
4
  export interface IFormInputEvent {
5
5
  value: any;
6
6
  type?: string;
@@ -1,10 +1,7 @@
1
- import { FormControl } from './form.models';
1
+ import type { FormControl } from './form.models';
2
2
  export interface IControls {
3
3
  [key: string]: FormControl;
4
4
  }
5
- export interface IFormValues {
6
- [key: string]: unknown;
7
- }
8
5
  export interface IFormTextAreaOptions {
9
6
  rows: number;
10
7
  resize: boolean;
@@ -1,5 +1,5 @@
1
- import { IFormControlConfig, IFormInputError } from './form.interfaces';
2
- import { IFormControlType } from './form.types';
1
+ import type { IFormControlConfig, IFormInputError } from './form.interfaces';
2
+ import type { IFormControlType } from './form.types';
3
3
  export declare class FormControl {
4
4
  value: any;
5
5
  validators: string[];
@@ -1,5 +1,6 @@
1
- import React, { ComponentProps } from 'react';
2
- import { COLOR } from '../component.enums';
1
+ import type { ComponentProps } from 'react';
2
+ import React from 'react';
3
+ import type { COLOR } from '../component.enums';
3
4
  export interface IIconProps extends ComponentProps<'div'> {
4
5
  iconColor?: COLOR;
5
6
  children?: React.ReactNode;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { COLOR } from '../component.enums';
2
+ import type { COLOR } from '../component.enums';
3
3
  export interface IListItemProps extends React.ComponentProps<'li'> {
4
4
  color?: COLOR;
5
5
  active?: boolean;
@@ -1,4 +1,5 @@
1
- import React, { ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
+ import React from 'react';
2
3
  interface IListItemTextProps extends React.ComponentProps<'div'> {
3
4
  primary: ReactNode;
4
5
  secondary?: ReactNode;
@@ -1,5 +1,5 @@
1
- import { ReactElement } from 'react';
2
- import { IListItemProps } from './ListItem';
1
+ import type { ReactElement } from 'react';
2
+ import type { IListItemProps } from './ListItem';
3
3
  export declare class ListItemModel {
4
4
  constructor(dto: ReactElement<IListItemProps>);
5
5
  key: unknown;
@@ -1,6 +1,7 @@
1
- import React, { ReactElement } from 'react';
2
- import { MenuPosition } from './menu.types';
3
- import { IListItemProps } from '../List';
1
+ import type { ReactElement } from 'react';
2
+ import React from 'react';
3
+ import type { MenuPosition } from './menu.types';
4
+ import type { IListItemProps } from '../List';
4
5
  export interface IMenuProps extends React.DetailedHTMLProps<React.HtmlHTMLAttributes<HTMLDivElement>, HTMLDivElement> {
5
6
  toggle?: ReactElement;
6
7
  open?: boolean;
@@ -1,6 +1,7 @@
1
- import React, { ReactElement } from 'react';
2
- import { MenuPosition } from './menu.types';
3
- import { IListItemProps } from '../List';
1
+ import type { ReactElement } from 'react';
2
+ import React from 'react';
3
+ import type { MenuPosition } from './menu.types';
4
+ import type { IListItemProps } from '../List';
4
5
  export interface IMenuBodyProps {
5
6
  children?: ReactElement<IListItemProps> | ReactElement<IListItemProps>[];
6
7
  className?: string;
@@ -1,4 +1,4 @@
1
- import { Context, Dispatch } from 'react';
1
+ import type { Context, Dispatch } from 'react';
2
2
  export interface IMenuContext {
3
3
  isShow: boolean;
4
4
  setIsShow: Dispatch<boolean>;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
- import { IListItemProps } from '../List';
2
+ import type { IListItemProps } from '../List';
3
3
  export declare const MenuItem: (props: IListItemProps) => JSX.Element;
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
2
  interface IMenuToggleProps {
3
3
  children?: ReactNode;
4
4
  }
@@ -1,15 +1,15 @@
1
- import { ReactElement } from 'react';
1
+ import type { ReactElement } from 'react';
2
2
  import { SIZE } from '../component.enums';
3
- import { IControls, IFormValues } from '../Form';
3
+ import type { IControls } from '../Form';
4
4
  import { MODALTYPE } from './modal.enum';
5
- import { IModalButton } from './modal.interfaces';
5
+ import type { IModalButton } from './modal.interfaces';
6
6
  interface IModalProps {
7
7
  title?: string;
8
8
  description?: string | ReactElement;
9
9
  formControls?: IControls;
10
10
  modalType?: MODALTYPE;
11
- onOk: (values?: IFormValues) => void;
12
- onChange?: (values?: IFormValues) => void;
11
+ onOk: <T>(values?: T) => void;
12
+ onChange?: <T>(values?: T) => void;
13
13
  onCancel?: () => void;
14
14
  onBackdropClick?: () => void;
15
15
  isDismissable?: boolean;
@@ -1,5 +1,5 @@
1
- import { ReactElement, ReactNode } from 'react';
2
- import { SIZE } from '../component.enums';
1
+ import type { ReactElement, ReactNode } from 'react';
2
+ import type { SIZE } from '../component.enums';
3
3
  export interface IModalProps {
4
4
  target?: HTMLElement;
5
5
  className?: string;
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
2
  interface IModalBodyProps {
3
3
  children?: ReactNode;
4
4
  }
@@ -1,5 +1,5 @@
1
- import { COLOR, VARIANT } from '../component.enums';
2
- import { MODALBUTTONTYPE } from './modal.enum';
1
+ import type { COLOR, VARIANT } from '../component.enums';
2
+ import type { MODALBUTTONTYPE } from './modal.enum';
3
3
  export interface IModalButton {
4
4
  label: string;
5
5
  variant?: VARIANT;
@@ -1,7 +1,7 @@
1
- import { IControls } from '../Form';
2
- import { ReactElement } from 'react';
3
- import { IModalButton } from './modal.interfaces';
4
- import { SIZE } from '../component.enums';
1
+ import type { IControls } from '../Form';
2
+ import type { ReactElement } from 'react';
3
+ import type { IModalButton } from './modal.interfaces';
4
+ import type { SIZE } from '../component.enums';
5
5
  export interface IModalService {
6
6
  show(title: string, description: string | ReactElement, options?: IModalOptions): Promise<void>;
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ISelectOption } from '../component.interfaces';
2
+ import type { ISelectOption } from '../component.interfaces';
3
3
  export interface ISelectProps {
4
4
  id?: string;
5
5
  name?: string;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ISidebarItem } from './sidebar.interfaces';
2
+ import type { ISidebarItem } from './sidebar.interfaces';
3
3
  interface ISidebarProps extends React.ComponentProps<'nav'> {
4
4
  items: ISidebarItem[];
5
5
  currentUrl: string;
@@ -1,4 +1,5 @@
1
- import React, { ComponentProps } from 'react';
1
+ import type { ComponentProps } from 'react';
2
+ import React from 'react';
2
3
  import { COLOR } from '../component.enums';
3
4
  export interface ISnackbarProps extends ComponentProps<'div'> {
4
5
  color?: COLOR;
@@ -1,4 +1,5 @@
1
- import React, { ReactElement } from 'react';
1
+ import type { ReactElement } from 'react';
2
+ import React from 'react';
2
3
  export interface ISpeedDialIconProps extends React.DetailedHTMLProps<React.HtmlHTMLAttributes<HTMLDivElement>, HTMLDivElement> {
3
4
  openIcon?: ReactElement;
4
5
  }
@@ -1,4 +1,5 @@
1
- import React, { ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
+ import React from 'react';
2
3
  export interface IStepProps {
3
4
  value: string;
4
5
  index?: number;
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
2
  export interface IStepPanelProps {
3
3
  children?: ReactNode;
4
4
  }
@@ -1,5 +1,5 @@
1
- import { ReactElement } from 'react';
2
- import { IStepProps } from './Step';
1
+ import type { ReactElement } from 'react';
2
+ import type { IStepProps } from './Step';
3
3
  export interface IStepperProps {
4
4
  children?: ReactElement<IStepProps> | ReactElement<IStepProps>[];
5
5
  isLinear?: boolean;
@@ -12,5 +12,7 @@ export interface IStepperProps {
12
12
  alternativeLabel?: boolean;
13
13
  value?: number;
14
14
  isReadonly?: boolean;
15
+ showDoneButton?: boolean;
16
+ showResetButton?: boolean;
15
17
  }
16
18
  export declare const Stepper: (props: IStepperProps) => JSX.Element;
@@ -1,6 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  export interface IStepperActionsProps {
3
3
  className?: string;
4
+ showDoneButton?: boolean;
5
+ showResetButton?: boolean;
4
6
  isCompleted?: boolean;
5
7
  isFirstStep?: boolean;
6
8
  isStepOptional?: boolean;
@@ -1,4 +1,4 @@
1
- import { ReactElement } from 'react';
1
+ import type { ReactElement } from 'react';
2
2
  export interface ITableProps {
3
3
  children?: ReactElement | ReactElement[];
4
4
  className?: string;
@@ -1,4 +1,4 @@
1
- import { Context } from 'react';
1
+ import type { Context } from 'react';
2
2
  export interface ITableContext {
3
3
  variant: 'head' | 'body';
4
4
  }
@@ -1,4 +1,5 @@
1
- import React, { ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
+ import React from 'react';
2
3
  export interface ITabProps {
3
4
  label: ReactNode;
4
5
  value: string;
@@ -1,4 +1,4 @@
1
- import { Context, Dispatch } from 'react';
1
+ import type { Context, Dispatch } from 'react';
2
2
  export interface ITabsContext {
3
3
  fixed?: boolean;
4
4
  selectedValue?: string;
@@ -1,6 +1,6 @@
1
- import { ReactElement } from 'react';
1
+ import type { ReactElement } from 'react';
2
2
  import { COLOR } from '../component.enums';
3
- import { ITabProps } from './Tab';
3
+ import type { ITabProps } from './Tab';
4
4
  export interface ITabsProps {
5
5
  color?: COLOR;
6
6
  indicatorColor?: COLOR;
@@ -1,2 +1,2 @@
1
- import React from 'react';
1
+ import type React from 'react';
2
2
  export declare function useDebounce(callback: () => void, timeout: number, deps: React.DependencyList): void;
package/index.es.js CHANGED
@@ -235,12 +235,9 @@ function useDebounce(callback, timeout, deps) {
235
235
  }
236
236
 
237
237
  const useConstructor = (callBack) => {
238
- const [hasBeenCalled, setHasBeenCalled] = useState(false);
239
- if (hasBeenCalled) {
240
- return;
241
- }
242
- callBack();
243
- setHasBeenCalled(true);
238
+ useEffect(() => {
239
+ callBack();
240
+ }, []);
244
241
  };
245
242
 
246
243
  function useCssClasses(cssClasses) {
@@ -263,7 +260,7 @@ function useHover() {
263
260
  node.removeEventListener('mouseout', handleMouseOut);
264
261
  };
265
262
  }
266
- return;
263
+ return undefined;
267
264
  }, [ref.current] // Recall only if ref changes
268
265
  );
269
266
  return [ref, value];
@@ -879,7 +876,7 @@ const CssTransition = (props) => {
879
876
  };
880
877
  useEffect(() => {
881
878
  if (isShow !== undefined && (isShow === true || isShow === false)) {
882
- renderAnimation(isShow);
879
+ void renderAnimation(isShow);
883
880
  }
884
881
  }, [isShow]);
885
882
  const getCssClasses = () => {
@@ -1995,10 +1992,6 @@ class ModalService {
1995
1992
  resolve(values);
1996
1993
  this.hide();
1997
1994
  };
1998
- // TODO - for AutoComplete
1999
- // const handleOnChange = (values?: IFormValues) => {
2000
- // console.info(values);
2001
- // }
2002
1995
  const handleCancel = () => {
2003
1996
  reject();
2004
1997
  this.hide();
@@ -2335,7 +2328,7 @@ var styles$e = {"stepperActions":"StepperActions-module_stepperActions__hBUkh"};
2335
2328
  styleInject(css_248z$e);
2336
2329
 
2337
2330
  const StepperActions = (props) => {
2338
- const { className, isCompleted, isFirstStep, isStepOptional, onBack, onSkip, onNext, onReset } = props;
2331
+ const { className, showDoneButton, showResetButton, isCompleted, isFirstStep, isStepOptional, onBack, onSkip, onNext, onReset } = props;
2339
2332
  const getCssClasses = () => {
2340
2333
  const cssClasses = [];
2341
2334
  cssClasses.push(styles$e.stepperActions);
@@ -2343,11 +2336,15 @@ const StepperActions = (props) => {
2343
2336
  return cssClasses.filter(css => css).join(' ');
2344
2337
  };
2345
2338
  return (React.createElement("div", { className: getCssClasses() },
2346
- React.createElement(Button, { className: "mr-2", variant: VARIANT.outline, disabled: isFirstStep, startIcon: !isFirstStep ? React.createElement(ChevronLeftSolidIcon, null) : undefined, onClick: () => onBack && onBack() }, "Back"),
2339
+ !isFirstStep &&
2340
+ React.createElement(Button, { className: "mr-2", variant: VARIANT.outline, startIcon: React.createElement(ChevronLeftSolidIcon, null), onClick: () => onBack && onBack() }, "Back"),
2347
2341
  React.createElement("div", { className: "ml-auto" },
2348
- isCompleted && (React.createElement(Button, { className: "mr-2", color: COLOR.secondary, variant: VARIANT.text, onClick: () => onReset && onReset() }, "Reset")),
2349
- isStepOptional && (React.createElement(Button, { className: "mr-2", variant: VARIANT.contained, color: COLOR.primary, onClick: () => onSkip && onSkip() }, "Skip")),
2350
- React.createElement(Button, { variant: VARIANT.contained, color: COLOR.primary, startIcon: isCompleted ? React.createElement(CheckSolidIcon, null) : undefined, endIcon: !isCompleted ? React.createElement(ChevronRightSolidIcon, null) : undefined, onClick: () => onNext && onNext() }, isCompleted ? 'Done' : 'Next'))));
2342
+ isCompleted && showResetButton && (React.createElement(Button, { color: COLOR.secondary, variant: VARIANT.text, onClick: () => onReset && onReset() }, "Reset")),
2343
+ isStepOptional && (React.createElement(Button, { variant: VARIANT.contained, color: COLOR.primary, onClick: () => onSkip && onSkip() }, "Skip")),
2344
+ !isCompleted &&
2345
+ React.createElement(Button, { className: 'ml-2', variant: VARIANT.contained, color: COLOR.primary, endIcon: React.createElement(ChevronRightSolidIcon, null), onClick: () => onNext && onNext() }, "Next"),
2346
+ isCompleted && showDoneButton &&
2347
+ React.createElement(Button, { className: 'ml-2', variant: VARIANT.contained, color: COLOR.primary, startIcon: React.createElement(CheckSolidIcon, null), onClick: () => onNext && onNext() }, "Done"))));
2351
2348
  };
2352
2349
 
2353
2350
  const StepPanel = (props) => {
@@ -2382,7 +2379,7 @@ var styles$c = {"stepper":"Stepper-module_stepper__V6odG","isHorizontal":"Steppe
2382
2379
  styleInject(css_248z$c);
2383
2380
 
2384
2381
  const Stepper = (props) => {
2385
- const { children, isLinear = true, showLabel = true, showProgressCheckIcon = false, value, isHorizontal = true, onChange, onFinish } = props;
2382
+ const { children, isLinear = true, showLabel = true, showProgressCheckIcon = false, value, isHorizontal = true, showDoneButton, showResetButton, onChange, onFinish } = props;
2386
2383
  const [steps, setSteps] = useState();
2387
2384
  const [activeIndex, setActiveIndex] = React.useState(0);
2388
2385
  const [skipped, setSkipped] = React.useState(new Set());
@@ -2399,7 +2396,7 @@ const Stepper = (props) => {
2399
2396
  const isStepSkipped = (step) => {
2400
2397
  return skipped.has(step);
2401
2398
  };
2402
- const handleClickStep = (event, newValue, index) => {
2399
+ const handleClickStep = (index) => {
2403
2400
  setActiveIndex(() => {
2404
2401
  onChange && onChange(index);
2405
2402
  return index;
@@ -2414,7 +2411,7 @@ const Stepper = (props) => {
2414
2411
  isDisabled: isLinear && (activeIndex + 1 < index),
2415
2412
  showLabel: showLabel,
2416
2413
  showProgressCheckIcon: showProgressCheckIcon,
2417
- onClick: (e) => handleClickStep(e.event, e.value, index)
2414
+ onClick: () => handleClickStep(index)
2418
2415
  })));
2419
2416
  };
2420
2417
  const isStepOptional = (index) => {
@@ -2473,12 +2470,12 @@ const Stepper = (props) => {
2473
2470
  };
2474
2471
  return (React.createElement(React.Fragment, null, steps &&
2475
2472
  React.createElement(React.Fragment, null,
2476
- React.createElement("div", { className: getCssClasses() }, steps.map((child, index) => (React.createElement(React.Fragment, { key: child.props.value },
2473
+ React.createElement("div", { className: getCssClasses() }, steps.map((child, index) => (React.createElement(Fragment, { key: child.props.value },
2477
2474
  renderSteps(child, index),
2478
2475
  index !== steps.length - 1 && React.createElement(StepConnector, { isActive: activeIndex > index }))))),
2479
2476
  steps && steps.map((step, index) => React.createElement(Fragment, { key: step.props.value }, index === activeIndex &&
2480
2477
  React.createElement(StepPanel, null, step.props.children))),
2481
- React.createElement(StepperActions, { className: "mt-3", isFirstStep: activeIndex === 0, isStepOptional: isStepOptional(activeIndex), isCompleted: isLastStep(), onBack: handleBack, onSkip: handleSkip, onNext: handleNext, onReset: handleReset }))));
2478
+ React.createElement(StepperActions, { className: "mt-3", isFirstStep: activeIndex === 0, isStepOptional: isStepOptional(activeIndex), isCompleted: isLastStep(), onBack: handleBack, onSkip: handleSkip, onNext: handleNext, onReset: handleReset, showDoneButton: showDoneButton, showResetButton: showResetButton }))));
2482
2479
  };
2483
2480
 
2484
2481
  var css_248z$b = ".Typography-module_typography__sw-td {\n font-family: var(--fontFamily);\n}\n.Typography-module_typography__sw-td.Typography-module_wrap__W7G0R {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\nh1 {\n font-size: calc(1.375rem + 1.5vw);\n}\n\nh2 {\n font-size: calc(1.325rem + 0.9vw);\n}\n\nh3 {\n font-size: calc(1.3rem + 0.6vw);\n}\n\nh4 {\n font-size: calc(1.275rem + 0.3vw);\n}\n\nh5 {\n font-size: 1.25rem;\n}\n\nh6 {\n font-size: 1rem;\n}\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-weight: 500 !important;\n margin-top: 0;\n margin-bottom: 0.5rem;\n line-height: 1.2;\n}";
@@ -2906,6 +2903,8 @@ var css_248z = ".TreeItem-module_treeItem__Mxsjr {\n display: flex;\n flex-dir
2906
2903
  var styles = {"treeItem":"TreeItem-module_treeItem__Mxsjr"};
2907
2904
  styleInject(css_248z);
2908
2905
 
2906
+ // TODO - extract
2907
+ const TreeViewItemPadding = 48;
2909
2908
  const TreeItem = (props) => {
2910
2909
  const { nodeId, label, children, className, isExpanded, isSelected, isSelectable, onToggleExpand, onItemSelect } = props;
2911
2910
  const [_isExpanded, setIsExpanded] = useState(false);
@@ -2934,7 +2933,7 @@ const TreeItem = (props) => {
2934
2933
  setIsSelected(!_isSelected);
2935
2934
  onItemSelect && onItemSelect({ id: nodeId, isSelected: !_isSelected });
2936
2935
  };
2937
- return (React.createElement("li", { className: getCssClasses(), style: { paddingLeft: `${(48 * (children ? 0 : 1))}px` } },
2936
+ return (React.createElement("li", { className: getCssClasses(), style: { paddingLeft: `${(TreeViewItemPadding * (children ? 0 : 1))}px` } },
2938
2937
  React.createElement("div", { className: "d-flex align-items-center" },
2939
2938
  children && nodeId &&
2940
2939
  React.createElement(IconButton, { onClick: () => handleOnToggleExpand(nodeId), icon: !_isExpanded ? React.createElement(ChevronRightSolidIcon, null) : React.createElement(ChevronDownSolidIcon, null) }),
package/index.js CHANGED
@@ -244,12 +244,9 @@ function useDebounce(callback, timeout, deps) {
244
244
  }
245
245
 
246
246
  const useConstructor = (callBack) => {
247
- const [hasBeenCalled, setHasBeenCalled] = React.useState(false);
248
- if (hasBeenCalled) {
249
- return;
250
- }
251
- callBack();
252
- setHasBeenCalled(true);
247
+ React.useEffect(() => {
248
+ callBack();
249
+ }, []);
253
250
  };
254
251
 
255
252
  function useCssClasses(cssClasses) {
@@ -272,7 +269,7 @@ function useHover() {
272
269
  node.removeEventListener('mouseout', handleMouseOut);
273
270
  };
274
271
  }
275
- return;
272
+ return undefined;
276
273
  }, [ref.current] // Recall only if ref changes
277
274
  );
278
275
  return [ref, value];
@@ -888,7 +885,7 @@ const CssTransition = (props) => {
888
885
  };
889
886
  React.useEffect(() => {
890
887
  if (isShow !== undefined && (isShow === true || isShow === false)) {
891
- renderAnimation(isShow);
888
+ void renderAnimation(isShow);
892
889
  }
893
890
  }, [isShow]);
894
891
  const getCssClasses = () => {
@@ -2004,10 +2001,6 @@ class ModalService {
2004
2001
  resolve(values);
2005
2002
  this.hide();
2006
2003
  };
2007
- // TODO - for AutoComplete
2008
- // const handleOnChange = (values?: IFormValues) => {
2009
- // console.info(values);
2010
- // }
2011
2004
  const handleCancel = () => {
2012
2005
  reject();
2013
2006
  this.hide();
@@ -2344,7 +2337,7 @@ var styles$e = {"stepperActions":"StepperActions-module_stepperActions__hBUkh"};
2344
2337
  styleInject(css_248z$e);
2345
2338
 
2346
2339
  const StepperActions = (props) => {
2347
- const { className, isCompleted, isFirstStep, isStepOptional, onBack, onSkip, onNext, onReset } = props;
2340
+ const { className, showDoneButton, showResetButton, isCompleted, isFirstStep, isStepOptional, onBack, onSkip, onNext, onReset } = props;
2348
2341
  const getCssClasses = () => {
2349
2342
  const cssClasses = [];
2350
2343
  cssClasses.push(styles$e.stepperActions);
@@ -2352,11 +2345,15 @@ const StepperActions = (props) => {
2352
2345
  return cssClasses.filter(css => css).join(' ');
2353
2346
  };
2354
2347
  return (React__default["default"].createElement("div", { className: getCssClasses() },
2355
- React__default["default"].createElement(Button, { className: "mr-2", variant: exports.VARIANT.outline, disabled: isFirstStep, startIcon: !isFirstStep ? React__default["default"].createElement(ChevronLeftSolidIcon, null) : undefined, onClick: () => onBack && onBack() }, "Back"),
2348
+ !isFirstStep &&
2349
+ React__default["default"].createElement(Button, { className: "mr-2", variant: exports.VARIANT.outline, startIcon: React__default["default"].createElement(ChevronLeftSolidIcon, null), onClick: () => onBack && onBack() }, "Back"),
2356
2350
  React__default["default"].createElement("div", { className: "ml-auto" },
2357
- isCompleted && (React__default["default"].createElement(Button, { className: "mr-2", color: exports.COLOR.secondary, variant: exports.VARIANT.text, onClick: () => onReset && onReset() }, "Reset")),
2358
- isStepOptional && (React__default["default"].createElement(Button, { className: "mr-2", variant: exports.VARIANT.contained, color: exports.COLOR.primary, onClick: () => onSkip && onSkip() }, "Skip")),
2359
- React__default["default"].createElement(Button, { variant: exports.VARIANT.contained, color: exports.COLOR.primary, startIcon: isCompleted ? React__default["default"].createElement(CheckSolidIcon, null) : undefined, endIcon: !isCompleted ? React__default["default"].createElement(ChevronRightSolidIcon, null) : undefined, onClick: () => onNext && onNext() }, isCompleted ? 'Done' : 'Next'))));
2351
+ isCompleted && showResetButton && (React__default["default"].createElement(Button, { color: exports.COLOR.secondary, variant: exports.VARIANT.text, onClick: () => onReset && onReset() }, "Reset")),
2352
+ isStepOptional && (React__default["default"].createElement(Button, { variant: exports.VARIANT.contained, color: exports.COLOR.primary, onClick: () => onSkip && onSkip() }, "Skip")),
2353
+ !isCompleted &&
2354
+ React__default["default"].createElement(Button, { className: 'ml-2', variant: exports.VARIANT.contained, color: exports.COLOR.primary, endIcon: React__default["default"].createElement(ChevronRightSolidIcon, null), onClick: () => onNext && onNext() }, "Next"),
2355
+ isCompleted && showDoneButton &&
2356
+ React__default["default"].createElement(Button, { className: 'ml-2', variant: exports.VARIANT.contained, color: exports.COLOR.primary, startIcon: React__default["default"].createElement(CheckSolidIcon, null), onClick: () => onNext && onNext() }, "Done"))));
2360
2357
  };
2361
2358
 
2362
2359
  const StepPanel = (props) => {
@@ -2391,7 +2388,7 @@ var styles$c = {"stepper":"Stepper-module_stepper__V6odG","isHorizontal":"Steppe
2391
2388
  styleInject(css_248z$c);
2392
2389
 
2393
2390
  const Stepper = (props) => {
2394
- const { children, isLinear = true, showLabel = true, showProgressCheckIcon = false, value, isHorizontal = true, onChange, onFinish } = props;
2391
+ const { children, isLinear = true, showLabel = true, showProgressCheckIcon = false, value, isHorizontal = true, showDoneButton, showResetButton, onChange, onFinish } = props;
2395
2392
  const [steps, setSteps] = React.useState();
2396
2393
  const [activeIndex, setActiveIndex] = React__default["default"].useState(0);
2397
2394
  const [skipped, setSkipped] = React__default["default"].useState(new Set());
@@ -2408,7 +2405,7 @@ const Stepper = (props) => {
2408
2405
  const isStepSkipped = (step) => {
2409
2406
  return skipped.has(step);
2410
2407
  };
2411
- const handleClickStep = (event, newValue, index) => {
2408
+ const handleClickStep = (index) => {
2412
2409
  setActiveIndex(() => {
2413
2410
  onChange && onChange(index);
2414
2411
  return index;
@@ -2423,7 +2420,7 @@ const Stepper = (props) => {
2423
2420
  isDisabled: isLinear && (activeIndex + 1 < index),
2424
2421
  showLabel: showLabel,
2425
2422
  showProgressCheckIcon: showProgressCheckIcon,
2426
- onClick: (e) => handleClickStep(e.event, e.value, index)
2423
+ onClick: () => handleClickStep(index)
2427
2424
  })));
2428
2425
  };
2429
2426
  const isStepOptional = (index) => {
@@ -2482,12 +2479,12 @@ const Stepper = (props) => {
2482
2479
  };
2483
2480
  return (React__default["default"].createElement(React__default["default"].Fragment, null, steps &&
2484
2481
  React__default["default"].createElement(React__default["default"].Fragment, null,
2485
- React__default["default"].createElement("div", { className: getCssClasses() }, steps.map((child, index) => (React__default["default"].createElement(React__default["default"].Fragment, { key: child.props.value },
2482
+ React__default["default"].createElement("div", { className: getCssClasses() }, steps.map((child, index) => (React__default["default"].createElement(React.Fragment, { key: child.props.value },
2486
2483
  renderSteps(child, index),
2487
2484
  index !== steps.length - 1 && React__default["default"].createElement(StepConnector, { isActive: activeIndex > index }))))),
2488
2485
  steps && steps.map((step, index) => React__default["default"].createElement(React.Fragment, { key: step.props.value }, index === activeIndex &&
2489
2486
  React__default["default"].createElement(StepPanel, null, step.props.children))),
2490
- React__default["default"].createElement(StepperActions, { className: "mt-3", isFirstStep: activeIndex === 0, isStepOptional: isStepOptional(activeIndex), isCompleted: isLastStep(), onBack: handleBack, onSkip: handleSkip, onNext: handleNext, onReset: handleReset }))));
2487
+ React__default["default"].createElement(StepperActions, { className: "mt-3", isFirstStep: activeIndex === 0, isStepOptional: isStepOptional(activeIndex), isCompleted: isLastStep(), onBack: handleBack, onSkip: handleSkip, onNext: handleNext, onReset: handleReset, showDoneButton: showDoneButton, showResetButton: showResetButton }))));
2491
2488
  };
2492
2489
 
2493
2490
  var css_248z$b = ".Typography-module_typography__sw-td {\n font-family: var(--fontFamily);\n}\n.Typography-module_typography__sw-td.Typography-module_wrap__W7G0R {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\nh1 {\n font-size: calc(1.375rem + 1.5vw);\n}\n\nh2 {\n font-size: calc(1.325rem + 0.9vw);\n}\n\nh3 {\n font-size: calc(1.3rem + 0.6vw);\n}\n\nh4 {\n font-size: calc(1.275rem + 0.3vw);\n}\n\nh5 {\n font-size: 1.25rem;\n}\n\nh6 {\n font-size: 1rem;\n}\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-weight: 500 !important;\n margin-top: 0;\n margin-bottom: 0.5rem;\n line-height: 1.2;\n}";
@@ -2915,6 +2912,8 @@ var css_248z = ".TreeItem-module_treeItem__Mxsjr {\n display: flex;\n flex-dir
2915
2912
  var styles = {"treeItem":"TreeItem-module_treeItem__Mxsjr"};
2916
2913
  styleInject(css_248z);
2917
2914
 
2915
+ // TODO - extract
2916
+ const TreeViewItemPadding = 48;
2918
2917
  const TreeItem = (props) => {
2919
2918
  const { nodeId, label, children, className, isExpanded, isSelected, isSelectable, onToggleExpand, onItemSelect } = props;
2920
2919
  const [_isExpanded, setIsExpanded] = React.useState(false);
@@ -2943,7 +2942,7 @@ const TreeItem = (props) => {
2943
2942
  setIsSelected(!_isSelected);
2944
2943
  onItemSelect && onItemSelect({ id: nodeId, isSelected: !_isSelected });
2945
2944
  };
2946
- return (React__default["default"].createElement("li", { className: getCssClasses(), style: { paddingLeft: `${(48 * (children ? 0 : 1))}px` } },
2945
+ return (React__default["default"].createElement("li", { className: getCssClasses(), style: { paddingLeft: `${(TreeViewItemPadding * (children ? 0 : 1))}px` } },
2947
2946
  React__default["default"].createElement("div", { className: "d-flex align-items-center" },
2948
2947
  children && nodeId &&
2949
2948
  React__default["default"].createElement(IconButton, { onClick: () => handleOnToggleExpand(nodeId), icon: !_isExpanded ? React__default["default"].createElement(ChevronRightSolidIcon, null) : React__default["default"].createElement(ChevronDownSolidIcon, null) }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-asc",
3
- "version": "25.0.5",
3
+ "version": "25.1.0",
4
4
  "description": "handcrafted react components",
5
5
  "main": "index.js",
6
6
  "module": "index.es.js",