react-asc 25.0.2 → 25.0.5

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.
@@ -4,7 +4,7 @@ export interface IAutoCompleteProps {
4
4
  id?: string;
5
5
  name?: string;
6
6
  className?: string;
7
- options?: Array<ISelectOption>;
7
+ options?: ISelectOption[];
8
8
  value?: string;
9
9
  openOnFocus?: boolean;
10
10
  disabled?: boolean;
@@ -3,5 +3,5 @@ import { COLOR } from '../component.enums';
3
3
  export interface IButtonContext {
4
4
  color: COLOR | null;
5
5
  }
6
- export declare const ButtonContext: import("react").Context<IButtonContext>;
6
+ export declare const ButtonContext: React.Context<IButtonContext>;
7
7
  export declare const useButtonContext: () => IButtonContext;
@@ -4,5 +4,5 @@ interface IConditionalWrapperProps {
4
4
  wrapper: (children: React.ReactNode) => JSX.Element;
5
5
  children: any;
6
6
  }
7
- export declare const ConditionalWrapper: ({ condition, wrapper, children }: IConditionalWrapperProps) => any;
7
+ export declare const ConditionalWrapper: ({ condition, wrapper, children }: IConditionalWrapperProps) => JSX.Element;
8
8
  export {};
@@ -2,7 +2,7 @@
2
2
  import { IFormInputError } from './form.interfaces';
3
3
  interface IFormErrorProps {
4
4
  className?: string;
5
- errors?: Array<IFormInputError>;
5
+ errors?: IFormInputError[];
6
6
  }
7
7
  export declare const FormError: (props: IFormErrorProps) => JSX.Element;
8
8
  export {};
@@ -16,7 +16,7 @@ export interface IFormInputProps {
16
16
  readonly?: boolean;
17
17
  isValid?: boolean;
18
18
  autoFocus?: boolean;
19
- options?: Array<IFormInputOptions>;
19
+ options?: IFormInputOptions[];
20
20
  textareaOptions?: IFormTextAreaOptions;
21
21
  selectOptions?: IFormSelectOptions;
22
22
  autoCompleteOptions?: IFormAutoCompleteOptions;
@@ -35,7 +35,7 @@ export interface IFormControlConfig {
35
35
  hint?: string;
36
36
  disabled?: boolean;
37
37
  readonly?: boolean;
38
- options?: Array<IFormInputOptions>;
38
+ options?: IFormInputOptions[];
39
39
  textareaOptions?: IFormTextAreaOptions;
40
40
  selectOptions?: IFormSelectOptions;
41
41
  autoCompleteOptions?: IFormAutoCompleteOptions;
@@ -2,11 +2,11 @@ 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<string>;
5
+ validators: string[];
6
6
  type: IFormControlType;
7
7
  config: IFormControlConfig;
8
- constructor(value: any, validators: Array<string>, type: IFormControlType, config: IFormControlConfig);
9
- errors: Array<IFormInputError>;
8
+ constructor(value: any, validators: string[], type: IFormControlType, config: IFormControlConfig);
9
+ errors: IFormInputError[];
10
10
  isValid: boolean;
11
11
  isDirty: boolean;
12
12
  }
@@ -4,7 +4,7 @@ import { IListItemProps } from '../List';
4
4
  export interface IMenuProps extends React.DetailedHTMLProps<React.HtmlHTMLAttributes<HTMLDivElement>, HTMLDivElement> {
5
5
  toggle?: ReactElement;
6
6
  open?: boolean;
7
- children?: ReactElement<IListItemProps> | Array<ReactElement<IListItemProps>>;
7
+ children?: ReactElement<IListItemProps> | ReactElement<IListItemProps>[];
8
8
  menuPosition?: MenuPosition;
9
9
  onClickBackdrop?: () => void;
10
10
  }
@@ -2,7 +2,7 @@ import React, { ReactElement } from 'react';
2
2
  import { MenuPosition } from './menu.types';
3
3
  import { IListItemProps } from '../List';
4
4
  export interface IMenuBodyProps {
5
- children?: ReactElement<IListItemProps> | Array<ReactElement<IListItemProps>>;
5
+ children?: ReactElement<IListItemProps> | ReactElement<IListItemProps>[];
6
6
  className?: string;
7
7
  menuPosition?: MenuPosition;
8
8
  parentRef: React.RefObject<HTMLDivElement>;
@@ -1,6 +1,6 @@
1
- import { Dispatch } from 'react';
1
+ import { Context, Dispatch } from 'react';
2
2
  export interface IMenuContext {
3
3
  isShow: boolean;
4
4
  setIsShow: Dispatch<boolean>;
5
5
  }
6
- export declare const MenuContext: import("react").Context<IMenuContext>;
6
+ export declare const MenuContext: Context<IMenuContext>;
@@ -2,5 +2,5 @@ import { ReactNode } from 'react';
2
2
  interface IMenuToggleProps {
3
3
  children?: ReactNode;
4
4
  }
5
- export declare const MenuToggle: ({ children }: IMenuToggleProps) => JSX.Element;
5
+ export declare const MenuToggle: ({ children }: IMenuToggleProps) => ReactNode;
6
6
  export {};
@@ -13,7 +13,7 @@ interface IModalProps {
13
13
  onCancel?: () => void;
14
14
  onBackdropClick?: () => void;
15
15
  isDismissable?: boolean;
16
- buttons?: Array<IModalButton>;
16
+ buttons?: IModalButton[];
17
17
  fullScreen?: boolean;
18
18
  size?: SIZE;
19
19
  }
@@ -7,7 +7,7 @@ export interface IModalService {
7
7
  }
8
8
  export interface IModalOptions {
9
9
  isDismissable?: boolean;
10
- buttons?: Array<IModalButton>;
10
+ buttons?: IModalButton[];
11
11
  fullScreen?: boolean;
12
12
  size?: SIZE;
13
13
  }
@@ -4,4 +4,4 @@ export interface IPortalProps {
4
4
  target?: HTMLElement;
5
5
  className?: string;
6
6
  }
7
- export declare const Portal: ({ children, target, className }: IPortalProps) => import("react").ReactPortal;
7
+ export declare const Portal: ({ children, target, className }: IPortalProps) => JSX.Element;
@@ -4,13 +4,13 @@ export interface ISelectProps {
4
4
  id?: string;
5
5
  name?: string;
6
6
  className?: string;
7
- options?: Array<ISelectOption>;
8
- value?: string | Array<string>;
7
+ options?: ISelectOption[];
8
+ value?: string | string[];
9
9
  multiple?: boolean;
10
10
  multipleMaxCountItems?: number;
11
11
  disabled?: boolean;
12
12
  readOnly?: boolean;
13
- onChange?: (val: string | Array<string>) => void;
13
+ onChange?: (val: string | string[]) => void;
14
14
  onKeyDown?: (event: React.KeyboardEvent<HTMLDivElement>) => void;
15
15
  }
16
16
  export declare const Select: (props: ISelectProps) => JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { ISidebarItem } from './sidebar.interfaces';
3
3
  interface ISidebarProps extends React.ComponentProps<'nav'> {
4
- items: Array<ISidebarItem>;
4
+ items: ISidebarItem[];
5
5
  currentUrl: string;
6
6
  onItemClicked: (path: string) => void;
7
7
  }
@@ -3,7 +3,7 @@ export interface ISidebarItem {
3
3
  path: string;
4
4
  label: string;
5
5
  icon?: string;
6
- items?: Array<ISidebarItem>;
6
+ items?: ISidebarItem[];
7
7
  isCollapsible?: boolean;
8
8
  isCollapsed?: boolean;
9
9
  }
@@ -1,7 +1,7 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { IStepProps } from './Step';
3
3
  export interface IStepperProps {
4
- children?: ReactElement<IStepProps> | Array<ReactElement<IStepProps>>;
4
+ children?: ReactElement<IStepProps> | ReactElement<IStepProps>[];
5
5
  isLinear?: boolean;
6
6
  isDisabled?: boolean;
7
7
  showLabel?: boolean;
@@ -1,6 +1,6 @@
1
1
  import { ReactElement } from 'react';
2
2
  export interface ITableProps {
3
- children?: ReactElement | Array<ReactElement>;
3
+ children?: ReactElement | ReactElement[];
4
4
  className?: string;
5
5
  striped?: boolean;
6
6
  bordered?: boolean;
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
1
+ import { Context } from 'react';
2
2
  export interface ITableContext {
3
3
  variant: 'head' | 'body';
4
4
  }
5
- export declare const TableContext: import("react").Context<ITableContext>;
5
+ export declare const TableContext: Context<ITableContext>;
6
6
  export declare const useTableContext: () => ITableContext;
@@ -1,8 +1,8 @@
1
- import { Dispatch } from 'react';
1
+ import { Context, Dispatch } from 'react';
2
2
  export interface ITabsContext {
3
- fixed: boolean;
4
- selectedValue: string;
5
- setSelectedValue: Dispatch<string>;
3
+ fixed?: boolean;
4
+ selectedValue?: string;
5
+ setSelectedValue?: Dispatch<string>;
6
6
  }
7
- export declare const TabContext: import("react").Context<ITabsContext>;
7
+ export declare const TabContext: Context<ITabsContext>;
8
8
  export declare const useTabContext: () => ITabsContext;
@@ -4,7 +4,7 @@ import { ITabProps } from './Tab';
4
4
  export interface ITabsProps {
5
5
  color?: COLOR;
6
6
  indicatorColor?: COLOR;
7
- children?: ReactElement<ITabProps> | Array<ReactElement<ITabProps>>;
7
+ children?: ReactElement<ITabProps> | ReactElement<ITabProps>[];
8
8
  className?: string;
9
9
  fixed?: boolean;
10
10
  onChange?: (value: string) => void;
@@ -19,7 +19,7 @@ export declare enum POSITION {
19
19
  right = "right",
20
20
  left = "left"
21
21
  }
22
- export declare const STATUS: {
23
- HOVERED: string;
24
- NORMAL: string;
25
- };
22
+ export declare enum STATUS {
23
+ HOVERED = "hovered",
24
+ NORMAL = "normal"
25
+ }
@@ -1 +1 @@
1
- export declare function useCssClasses(cssClasses: Array<string>): string[];
1
+ export declare function useCssClasses(cssClasses: string[]): string[];
@@ -1,2 +1,2 @@
1
1
  /// <reference types="react" />
2
- export declare function useHover(): (boolean | import("react").MutableRefObject<null>)[];
2
+ export declare function useHover(): (boolean | React.MutableRefObject<null>)[];
package/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './components';
2
2
  export * from './hooks';
3
3
  export * from './icons';
4
+ export * from './interfaces';
package/index.es.js CHANGED
@@ -2,7 +2,7 @@ import React, { useRef, useEffect, useState, useMemo, createContext, useContext,
2
2
  import reactDom, { createPortal } from 'react-dom';
3
3
  import { createPopper } from '@popperjs/core';
4
4
 
5
- /******************************************************************************
5
+ /*! *****************************************************************************
6
6
  Copyright (c) Microsoft Corporation.
7
7
 
8
8
  Permission to use, copy, modify, and/or distribute this software for any
@@ -55,10 +55,11 @@ var POSITION;
55
55
  POSITION["right"] = "right";
56
56
  POSITION["left"] = "left";
57
57
  })(POSITION || (POSITION = {}));
58
- const STATUS = {
59
- HOVERED: 'hovered',
60
- NORMAL: 'normal',
61
- };
58
+ var STATUS;
59
+ (function (STATUS) {
60
+ STATUS["HOVERED"] = "hovered";
61
+ STATUS["NORMAL"] = "normal";
62
+ })(STATUS || (STATUS = {}));
62
63
 
63
64
  function styleInject(css, ref) {
64
65
  if ( ref === void 0 ) ref = {};
@@ -235,8 +236,9 @@ function useDebounce(callback, timeout, deps) {
235
236
 
236
237
  const useConstructor = (callBack) => {
237
238
  const [hasBeenCalled, setHasBeenCalled] = useState(false);
238
- if (hasBeenCalled)
239
+ if (hasBeenCalled) {
239
240
  return;
241
+ }
240
242
  callBack();
241
243
  setHasBeenCalled(true);
242
244
  };
@@ -404,7 +406,7 @@ styleInject(css_248z$V);
404
406
 
405
407
  const ListItemAction = (_a) => {
406
408
  var { children, onClick } = _a, rest = __rest(_a, ["children", "onClick"]);
407
- return (React.createElement("div", Object.assign({ className: styles$V.listItemAction, onClick: e => onClick && onClick(e) }, rest), children));
409
+ return (React.createElement("div", Object.assign({ className: styles$V.listItemAction, onClick: (e) => onClick && onClick(e) }, rest), children));
408
410
  };
409
411
 
410
412
  var css_248z$U = ".ListItemTextIcon-module_listItemText__xCBLW {\n flex: 1;\n}";
@@ -636,7 +638,7 @@ const BreadcrumbItem = (props) => {
636
638
  onClick && onClick(event);
637
639
  };
638
640
  return (React.createElement("li", { className: getCssClasses(), onClick: handleClick },
639
- React.createElement(ConditionalWrapper, { condition: !isActive, wrapper: label => React.createElement("a", null, label) }, children)));
641
+ React.createElement(ConditionalWrapper, { condition: !isActive, wrapper: (label) => React.createElement("a", null, label) }, children)));
640
642
  };
641
643
 
642
644
  var css_248z$N = ".Card-module_card__TQdQq {\n background: var(--white);\n border-radius: var(--borderRadius);\n}\n.Card-module_card__TQdQq.Card-module_shadow__NxDVz {\n box-shadow: var(--shadow);\n}";
@@ -817,7 +819,7 @@ const Chip = (props) => {
817
819
  };
818
820
  return (React.createElement("div", Object.assign({ className: getCssClass() }, rest, { style: style }),
819
821
  React.createElement("span", null, children),
820
- isDeletable && (React.createElement("div", { className: styles$F.deleteIcon, onClick: e => handleClickOnDelete(e) }, deleteIcon))));
822
+ isDeletable && (React.createElement("div", { className: styles$F.deleteIcon, onClick: (e) => handleClickOnDelete(e) }, deleteIcon))));
821
823
  };
822
824
 
823
825
  const CssTransition = (props) => {
@@ -900,21 +902,9 @@ var styles$E = {"column":"Column-module_column__fcTgl"};
900
902
  styleInject(css_248z$E);
901
903
 
902
904
  const Column = (props) => {
903
- const { children, className } = props,
904
- // xs,
905
- // sm,
906
- // md,
907
- // lg,
908
- // xl,
909
- rest = __rest(props, ["children", "className"]);
910
- const getCssClasses = () => {
911
- const cssClasses = [];
912
- // !xs && !sm && !md && !lg && !xl && cssClasses.push('col');
913
- // if (xs) cssClasses.push(`col-${xs.toString()}`);
914
- // if (sm) cssClasses.push(`col-sm-${sm.toString()}`);
915
- // if (md) cssClasses.push(`col-md-${md.toString()}`);
916
- // if (lg) cssClasses.push(`col-lg-${lg.toString()}`);
917
- // if (xl) cssClasses.push(`col-xl-${xl.toString()}`);
905
+ const { children, className } = props, rest = __rest(props, ["children", "className"]);
906
+ const getCssClasses = () => {
907
+ const cssClasses = [];
918
908
  cssClasses.push(styles$E.column);
919
909
  className && cssClasses.push(className);
920
910
  return cssClasses.filter(css => css).join(' ');
@@ -1115,20 +1105,22 @@ const Select = (props) => {
1115
1105
  case 'Enter':
1116
1106
  if (hoverIndex) {
1117
1107
  const option = options[hoverIndex];
1118
- if (option)
1108
+ if (option) {
1119
1109
  handleOnClick(option);
1110
+ }
1120
1111
  }
1121
1112
  break;
1122
1113
  }
1123
1114
  }
1124
1115
  };
1125
1116
  return (React.createElement("div", { ref: selectConainter, className: styles$B.selectContainer },
1126
- React.createElement("div", { id: id, className: getCssClass(), onClick: () => show(), tabIndex: 0, onKeyDown: e => handleOnKeyDown(e) },
1127
- !multiple && renderSingleViewModel(),
1128
- multiple &&
1129
- React.createElement("div", { className: styles$B.chipContainer }, renderMultipleViewModel()),
1130
- React.createElement(Icon, { className: "ml-auto" },
1131
- React.createElement(ChevronDownSolidIcon, null))),
1117
+ React.createElement("div", { id: id, className: getCssClass(), onClick: () => show(), tabIndex: 0, onKeyDown: (e) => handleOnKeyDown(e) },
1118
+ React.createElement(React.Fragment, null,
1119
+ !multiple && renderSingleViewModel(),
1120
+ multiple &&
1121
+ React.createElement("div", { className: styles$B.chipContainer }, renderMultipleViewModel()),
1122
+ React.createElement(Icon, { className: "ml-auto" },
1123
+ React.createElement(ChevronDownSolidIcon, null)))),
1132
1124
  isShow &&
1133
1125
  React.createElement(Portal, { className: 'backdrop-root' },
1134
1126
  React.createElement("div", { className: styles$B.selectMenu, style: { left: (_a = selectConainter.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().x, top: (_b = selectConainter.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect().y, width: (_c = selectConainter.current) === null || _c === void 0 ? void 0 : _c.getBoundingClientRect().width } },
@@ -1186,20 +1178,20 @@ const FormInput = (props) => {
1186
1178
  type === 'color' ||
1187
1179
  type === 'time')
1188
1180
  &&
1189
- React.createElement("input", { id: name, name: name, type: type, className: getCssClasses(), value: value, autoFocus: autoFocus, onInput: e => handleOnInput(e.target.value, type, name), onChange: e => handleOnChange((e === null || e === void 0 ? void 0 : e.target).value, type, name), onBlur: onBlur, placeholder: placeholder, readOnly: readonly, disabled: disabled, onKeyDown: onKeyDown }),
1181
+ React.createElement("input", { id: name, name: name, type: type, className: getCssClasses(), value: value, autoFocus: autoFocus, onInput: (e) => handleOnInput(e.target.value, type, name), onChange: (e) => handleOnChange((e === null || e === void 0 ? void 0 : e.target).value, type, name), onBlur: onBlur, placeholder: placeholder, readOnly: readonly, disabled: disabled, onKeyDown: onKeyDown }),
1190
1182
  type === 'file' &&
1191
- React.createElement(FileInput, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, autoFocus: autoFocus, readOnly: readonly, disabled: disabled, onChange: e => handleOnChange(e.target.value, type, name) }, "choose a file"),
1183
+ React.createElement(FileInput, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, autoFocus: autoFocus, readOnly: readonly, disabled: disabled, onChange: (e) => handleOnChange(e.target.value, type, name) }, "choose a file"),
1192
1184
  type === 'textarea' &&
1193
- React.createElement(Textarea, { id: name, name: name, className: className, error: !isValid, 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' } }),
1185
+ React.createElement(Textarea, { id: name, name: name, className: className, error: !isValid, 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' } }),
1194
1186
  type === 'select' &&
1195
- 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), options: options }),
1187
+ 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), options: options }),
1196
1188
  type === 'autocomplete' &&
1197
- 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), onSelect: e => handleOnChange(e.value, type, name), options: options }),
1189
+ 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), onSelect: (e) => handleOnChange(e.value, type, name), options: options }),
1198
1190
  type === 'checkbox' &&
1199
- React.createElement(Checkbox, { id: name, name: name, label: label, className: (!isValid ? ' is-invalid' : ''), onChange: e => handleOnChange((e === null || e === void 0 ? void 0 : e.target).checked, type, name), checked: value }),
1191
+ React.createElement(Checkbox, { id: name, name: name, label: label, className: (!isValid ? ' is-invalid' : ''), onChange: (e) => handleOnChange((e === null || e === void 0 ? void 0 : e.target).checked, type, name), checked: value }),
1200
1192
  type === 'radio' &&
1201
1193
  React.createElement(React.Fragment, null, options.map((option) => React.createElement("div", { className: "form-check", key: option.id },
1202
- 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 }),
1194
+ 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 }),
1203
1195
  React.createElement("label", { className: "form-check-label", htmlFor: option.id }, option.label))))));
1204
1196
  };
1205
1197
 
@@ -1256,8 +1248,10 @@ class Form extends Component {
1256
1248
  const keys = Object.keys(this.state.controls);
1257
1249
  const values = keys.reduce((obj, f) => {
1258
1250
  const control = this.getControl(f);
1259
- // TODO - refactor
1260
- const newValue = ((control.type === 'date' || control.type === 'datetime-local') && control.value && isValidDate((control.value))) ? new Date((control.value)).toISOString() : control.value;
1251
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1252
+ const newValue = ((control.type === 'date' || control.type === 'datetime-local') &&
1253
+ control.value &&
1254
+ isValidDate((control.value))) ? new Date((control.value)).toISOString() : control.value;
1261
1255
  return (Object.assign(Object.assign({}, obj), { [f]: newValue }));
1262
1256
  }, {});
1263
1257
  if (this.state.isValid && this.state.isSubmitted) {
@@ -1357,7 +1351,6 @@ class Form extends Component {
1357
1351
  const cssClasses = [labelClassName, this.isRequired(fieldKey) ? 'required' : undefined];
1358
1352
  return React.createElement(FormLabel, { htmlFor: fieldKey, className: cssClasses.join(' ') }, label);
1359
1353
  }
1360
- // trigger via ref
1361
1354
  handleFormSubmit() {
1362
1355
  for (const fieldKey of Object.keys(this.state.controls)) {
1363
1356
  const field = this.getControl(fieldKey);
@@ -1398,8 +1391,7 @@ class Form extends Component {
1398
1391
  this.setState({ controls: {}, isValid: false, isChanged: false, isSubmitted: false });
1399
1392
  }
1400
1393
  getFormGroupCssClass(fieldKey) {
1401
- const result = this.getControl(fieldKey).config.formGroupClassName;
1402
- return result;
1394
+ return this.getControl(fieldKey).config.formGroupClassName;
1403
1395
  }
1404
1396
  render() {
1405
1397
  return (React.createElement("form", { ref: this.myForm }, this.state && this.state.controls && Object.keys(this.state.controls).map((fieldKey) => {
@@ -1530,13 +1522,13 @@ const DateSelect = (props) => {
1530
1522
  return (React.createElement(Row, { className: getCssClasses() },
1531
1523
  React.createElement(Column, null,
1532
1524
  React.createElement(FormLabel, null, "Year"),
1533
- React.createElement(YearSelect, { value: currDate.getFullYear(), disabled: disabled, from: yearConfig === null || yearConfig === void 0 ? void 0 : yearConfig.from, to: yearConfig === null || yearConfig === void 0 ? void 0 : yearConfig.to, onChange: e => handleOnChange(e, DATEMODE.YEAR) })),
1525
+ React.createElement(YearSelect, { value: currDate.getFullYear(), disabled: disabled, from: yearConfig === null || yearConfig === void 0 ? void 0 : yearConfig.from, to: yearConfig === null || yearConfig === void 0 ? void 0 : yearConfig.to, onChange: (e) => handleOnChange(e, DATEMODE.YEAR) })),
1534
1526
  React.createElement(Column, null,
1535
1527
  React.createElement(FormLabel, null, "Month"),
1536
- React.createElement(MonthSelect, { value: currDate.getMonth(), disabled: disabled, onChange: e => handleOnChange(e, DATEMODE.MONTH) })),
1528
+ React.createElement(MonthSelect, { value: currDate.getMonth(), disabled: disabled, onChange: (e) => handleOnChange(e, DATEMODE.MONTH) })),
1537
1529
  React.createElement(Column, null,
1538
1530
  React.createElement(FormLabel, null, "Day"),
1539
- React.createElement(DaySelect, { day: currDate.getDate(), month: currDate.getMonth(), year: currDate.getFullYear(), disabled: disabled, onChange: e => handleOnChange(e, DATEMODE.DAY) }))));
1531
+ React.createElement(DaySelect, { day: currDate.getDate(), month: currDate.getMonth(), year: currDate.getFullYear(), disabled: disabled, onChange: (e) => handleOnChange(e, DATEMODE.DAY) }))));
1540
1532
  };
1541
1533
  /*
1542
1534
  * result = { year, month, day, dayOfWeek, weekNumber }
@@ -1581,7 +1573,7 @@ const DrawerContent = (props) => {
1581
1573
  };
1582
1574
  const positionStyles = {
1583
1575
  left: { left: '0px' },
1584
- right: { right: '0px' },
1576
+ right: { right: '0px' }
1585
1577
  };
1586
1578
  const getStyles = () => {
1587
1579
  return !permanent ? positionStyles[position] : undefined;
@@ -1668,7 +1660,7 @@ const MenuItem = (props) => {
1668
1660
  };
1669
1661
 
1670
1662
  const MenuToggle = ({ children }) => {
1671
- return (React.createElement(Fragment, null, children));
1663
+ return children;
1672
1664
  };
1673
1665
 
1674
1666
  var css_248z$v = ".MenuDivider-module_menuItemDivider__oRP-j {\n height: 0;\n margin: 0.5rem 0;\n overflow: hidden;\n border-top: 1px solid #e9ecef;\n}";
@@ -1911,7 +1903,7 @@ const Modal = (props) => {
1911
1903
  React.createElement(ModalBody, null, children),
1912
1904
  footer &&
1913
1905
  React.createElement(ModalFooter, null, footer))))),
1914
- React.createElement(Backdrop, { onClick: handleClickBackdrop })));
1906
+ React.createElement(Backdrop, { onClick: handleClickBackdrop, style: { zIndex: 1040 } })));
1915
1907
  };
1916
1908
 
1917
1909
  var MODALTYPE;
@@ -2194,11 +2186,11 @@ const Sidebar = (props) => {
2194
2186
  setMenuItems(newMenuItems);
2195
2187
  }
2196
2188
  else {
2197
- navigate(e, `/${item.path}`);
2189
+ navigate(e, `${item.path}`);
2198
2190
  }
2199
2191
  };
2200
2192
  const handleClickSubItem = (itemPath, subItemPath, e) => {
2201
- navigate(e, `/${itemPath}/${subItemPath}`);
2193
+ navigate(e, `${itemPath}/${subItemPath}`);
2202
2194
  };
2203
2195
  return (React.createElement("nav", Object.assign({ className: getCssClasses() }, rest),
2204
2196
  React.createElement(List, null, menuItems.map(item => (React.createElement(React.Fragment, { key: item.id },
@@ -2299,10 +2291,12 @@ const SpeedDial = (props) => {
2299
2291
  return cssClasses.filter(css => css).join(' ');
2300
2292
  };
2301
2293
  const handleClick = (e) => {
2302
- if (open)
2294
+ if (open) {
2303
2295
  onClose && onClose(e);
2304
- else
2296
+ }
2297
+ else {
2305
2298
  onOpen && onOpen(e);
2299
+ }
2306
2300
  };
2307
2301
  return (React.createElement("div", Object.assign({ className: getCssClasses() }, rest),
2308
2302
  React.createElement("div", { style: { 'transform': open ? 'rotate(45deg)' : undefined } },
@@ -2412,7 +2406,7 @@ const Stepper = (props) => {
2412
2406
  });
2413
2407
  };
2414
2408
  const renderSteps = (child, index) => {
2415
- return React.isValidElement(child) &&
2409
+ return (React.createElement(React.Fragment, null, React.isValidElement(child) &&
2416
2410
  cloneElement(child, {
2417
2411
  index: index,
2418
2412
  isActive: activeIndex >= index,
@@ -2421,7 +2415,7 @@ const Stepper = (props) => {
2421
2415
  showLabel: showLabel,
2422
2416
  showProgressCheckIcon: showProgressCheckIcon,
2423
2417
  onClick: (e) => handleClickStep(e.event, e.value, index)
2424
- });
2418
+ })));
2425
2419
  };
2426
2420
  const isStepOptional = (index) => {
2427
2421
  return steps && steps[index].props.isOptional;
@@ -2631,7 +2625,7 @@ const Table = (props) => {
2631
2625
  className && cssClasses.push(className);
2632
2626
  return cssClasses.filter(css => css).join(' ');
2633
2627
  };
2634
- return (React.createElement(ConditionalWrapper, { condition: responsive, wrapper: children => React.createElement("div", { className: styles$5.tableResponsive }, children) },
2628
+ return (React.createElement(ConditionalWrapper, { condition: responsive, wrapper: (children) => React.createElement("div", { className: styles$5.tableResponsive }, children) },
2635
2629
  React.createElement("table", { className: getCssClasses() }, children)));
2636
2630
  };
2637
2631
 
@@ -2660,15 +2654,11 @@ const TableBody = (props) => {
2660
2654
  const TableCell = (props) => {
2661
2655
  const { variant } = useTableContext();
2662
2656
  const { children, component } = props, rest = __rest(props, ["children", "component"]);
2663
- return (React.createElement(ConditionalWrapper, { condition: true, wrapper: children => ((variant === 'head' || component === 'th') ? (React.createElement("th", Object.assign({}, rest), children)) :
2657
+ return (React.createElement(ConditionalWrapper, { condition: true, wrapper: (children) => ((variant === 'head' || component === 'th') ? (React.createElement("th", Object.assign({}, rest), children)) :
2664
2658
  React.createElement("td", Object.assign({}, rest), children)) }, children));
2665
2659
  };
2666
2660
 
2667
- const TabContext = createContext({
2668
- fixed: false,
2669
- selectedValue: '',
2670
- setSelectedValue: () => { }
2671
- });
2661
+ const TabContext = createContext({});
2672
2662
  const useTabContext = () => useContext(TabContext);
2673
2663
 
2674
2664
  var css_248z$4 = ".TabIndicator-module_tabIndicator__jSJhH {\n bottom: 0;\n height: 2px;\n position: absolute;\n transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n}\n.TabIndicator-module_tabIndicator__jSJhH.TabIndicator-module_primary__Q5jEo {\n background-color: var(--primary);\n}\n.TabIndicator-module_tabIndicator__jSJhH.TabIndicator-module_accent__qbgIG {\n background-color: var(--accent);\n}";
@@ -2704,19 +2694,21 @@ const Tabs = (props) => {
2704
2694
  });
2705
2695
  const prevSelectedValueRef = useRef();
2706
2696
  useEffect(() => {
2707
- // TODO - check if prev needs to be set
2708
2697
  if (value !== undefined && value !== prevSelectedValueRef.current) {
2698
+ prevSelectedValueRef.current = value;
2709
2699
  setSelectedValue(value);
2710
2700
  }
2711
2701
  }, [value]);
2712
2702
  useEffect(() => {
2713
- React.Children.toArray(children).forEach((child, index) => {
2714
- if (child.props.value === selectedValue) {
2715
- setSelectedIndex(index);
2716
- onChange && onChange(selectedValue);
2717
- }
2718
- });
2719
- }, [children, selectedValue]);
2703
+ if (selectedValue && children) {
2704
+ React.Children.toArray(children).forEach((child, index) => {
2705
+ if (child.props.value === selectedValue) {
2706
+ setSelectedIndex(index);
2707
+ onChange && onChange(selectedValue);
2708
+ }
2709
+ });
2710
+ }
2711
+ }, [selectedValue]);
2720
2712
  const getCssClasses = () => {
2721
2713
  const cssClasses = [];
2722
2714
  cssClasses.push(styles$3.tabs);
@@ -2746,7 +2738,7 @@ const Tab = (props) => {
2746
2738
  };
2747
2739
  const handleClick = (event) => {
2748
2740
  onClick && onClick({ event, value });
2749
- setSelectedValue(value);
2741
+ setSelectedValue && setSelectedValue(value);
2750
2742
  };
2751
2743
  return (React.createElement(Button, { className: getCssClasses(), onClick: handleClick, isActive: selectedValue === value, disabled: disabled }, label));
2752
2744
  };
@@ -2880,19 +2872,19 @@ const TimeSelect = (props) => {
2880
2872
  showHours &&
2881
2873
  React.createElement(Column, null,
2882
2874
  React.createElement(FormLabel, null, "Hours"),
2883
- React.createElement(HourSelect, { value: currDate.getHours(), disabled: disabled, onChange: e => handleOnChange(e, TIMEMODE.HOUR) })),
2875
+ React.createElement(HourSelect, { value: currDate.getHours(), disabled: disabled, onChange: (e) => handleOnChange(e, TIMEMODE.HOUR) })),
2884
2876
  showMinutes &&
2885
2877
  React.createElement(Column, null,
2886
2878
  React.createElement(FormLabel, null, "Minutes"),
2887
- React.createElement(MinuteSelect, { value: currDate.getMinutes(), disabled: disabled, onChange: e => handleOnChange(e, TIMEMODE.MINUTE) })),
2879
+ React.createElement(MinuteSelect, { value: currDate.getMinutes(), disabled: disabled, onChange: (e) => handleOnChange(e, TIMEMODE.MINUTE) })),
2888
2880
  showSeconds &&
2889
2881
  React.createElement(Column, null,
2890
2882
  React.createElement(FormLabel, null, "Seconds"),
2891
- React.createElement(SecondSelect, { value: currDate.getSeconds(), disabled: disabled, onChange: e => handleOnChange(e, TIMEMODE.SECONDS) })),
2883
+ React.createElement(SecondSelect, { value: currDate.getSeconds(), disabled: disabled, onChange: (e) => handleOnChange(e, TIMEMODE.SECONDS) })),
2892
2884
  showMilliSeconds &&
2893
2885
  React.createElement(Column, null,
2894
2886
  React.createElement(FormLabel, null, "Milliseconds"),
2895
- React.createElement(MilliSecondSelect, { value: currDate.getMilliseconds(), disabled: disabled, onChange: e => handleOnChange(e, TIMEMODE.MILLISECONDS) }))));
2887
+ React.createElement(MilliSecondSelect, { value: currDate.getMilliseconds(), disabled: disabled, onChange: (e) => handleOnChange(e, TIMEMODE.MILLISECONDS) }))));
2896
2888
  };
2897
2889
 
2898
2890
  var css_248z$1 = ".TreeView-module_treeView__VVj-4 {\n list-style-type: none;\n margin-bottom: 0;\n padding-left: 0px !important;\n margin-block-start: 0;\n margin-block-end: 0;\n margin-inline-start: 0px;\n margin-inline-end: 0px;\n padding-inline-start: 0px;\n}\n.TreeView-module_treeView__VVj-4 ul {\n padding-left: 48px !important;\n}";
@@ -2925,12 +2917,14 @@ const TreeItem = (props) => {
2925
2917
  return cssClasses.filter(css => css).join(' ');
2926
2918
  };
2927
2919
  useEffect(() => {
2928
- if (isExpanded !== undefined)
2920
+ if (isExpanded !== undefined) {
2929
2921
  setIsExpanded(isExpanded);
2922
+ }
2930
2923
  }, [isExpanded]);
2931
2924
  useEffect(() => {
2932
- if (isSelected !== undefined)
2925
+ if (isSelected !== undefined) {
2933
2926
  setIsSelected(isSelected);
2927
+ }
2934
2928
  }, [isSelected]);
2935
2929
  const handleOnToggleExpand = (nodeId) => {
2936
2930
  setIsExpanded(!_isExpanded);
package/index.js CHANGED
@@ -11,7 +11,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
11
11
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
12
12
  var reactDom__default = /*#__PURE__*/_interopDefaultLegacy(reactDom);
13
13
 
14
- /******************************************************************************
14
+ /*! *****************************************************************************
15
15
  Copyright (c) Microsoft Corporation.
16
16
 
17
17
  Permission to use, copy, modify, and/or distribute this software for any
@@ -64,10 +64,11 @@ exports.POSITION = void 0;
64
64
  POSITION["right"] = "right";
65
65
  POSITION["left"] = "left";
66
66
  })(exports.POSITION || (exports.POSITION = {}));
67
- const STATUS = {
68
- HOVERED: 'hovered',
69
- NORMAL: 'normal',
70
- };
67
+ exports.STATUS = void 0;
68
+ (function (STATUS) {
69
+ STATUS["HOVERED"] = "hovered";
70
+ STATUS["NORMAL"] = "normal";
71
+ })(exports.STATUS || (exports.STATUS = {}));
71
72
 
72
73
  function styleInject(css, ref) {
73
74
  if ( ref === void 0 ) ref = {};
@@ -244,8 +245,9 @@ function useDebounce(callback, timeout, deps) {
244
245
 
245
246
  const useConstructor = (callBack) => {
246
247
  const [hasBeenCalled, setHasBeenCalled] = React.useState(false);
247
- if (hasBeenCalled)
248
+ if (hasBeenCalled) {
248
249
  return;
250
+ }
249
251
  callBack();
250
252
  setHasBeenCalled(true);
251
253
  };
@@ -413,7 +415,7 @@ styleInject(css_248z$V);
413
415
 
414
416
  const ListItemAction = (_a) => {
415
417
  var { children, onClick } = _a, rest = __rest(_a, ["children", "onClick"]);
416
- return (React__default["default"].createElement("div", Object.assign({ className: styles$V.listItemAction, onClick: e => onClick && onClick(e) }, rest), children));
418
+ return (React__default["default"].createElement("div", Object.assign({ className: styles$V.listItemAction, onClick: (e) => onClick && onClick(e) }, rest), children));
417
419
  };
418
420
 
419
421
  var css_248z$U = ".ListItemTextIcon-module_listItemText__xCBLW {\n flex: 1;\n}";
@@ -645,7 +647,7 @@ const BreadcrumbItem = (props) => {
645
647
  onClick && onClick(event);
646
648
  };
647
649
  return (React__default["default"].createElement("li", { className: getCssClasses(), onClick: handleClick },
648
- React__default["default"].createElement(ConditionalWrapper, { condition: !isActive, wrapper: label => React__default["default"].createElement("a", null, label) }, children)));
650
+ React__default["default"].createElement(ConditionalWrapper, { condition: !isActive, wrapper: (label) => React__default["default"].createElement("a", null, label) }, children)));
649
651
  };
650
652
 
651
653
  var css_248z$N = ".Card-module_card__TQdQq {\n background: var(--white);\n border-radius: var(--borderRadius);\n}\n.Card-module_card__TQdQq.Card-module_shadow__NxDVz {\n box-shadow: var(--shadow);\n}";
@@ -826,7 +828,7 @@ const Chip = (props) => {
826
828
  };
827
829
  return (React__default["default"].createElement("div", Object.assign({ className: getCssClass() }, rest, { style: style }),
828
830
  React__default["default"].createElement("span", null, children),
829
- isDeletable && (React__default["default"].createElement("div", { className: styles$F.deleteIcon, onClick: e => handleClickOnDelete(e) }, deleteIcon))));
831
+ isDeletable && (React__default["default"].createElement("div", { className: styles$F.deleteIcon, onClick: (e) => handleClickOnDelete(e) }, deleteIcon))));
830
832
  };
831
833
 
832
834
  const CssTransition = (props) => {
@@ -909,21 +911,9 @@ var styles$E = {"column":"Column-module_column__fcTgl"};
909
911
  styleInject(css_248z$E);
910
912
 
911
913
  const Column = (props) => {
912
- const { children, className } = props,
913
- // xs,
914
- // sm,
915
- // md,
916
- // lg,
917
- // xl,
918
- rest = __rest(props, ["children", "className"]);
919
- const getCssClasses = () => {
920
- const cssClasses = [];
921
- // !xs && !sm && !md && !lg && !xl && cssClasses.push('col');
922
- // if (xs) cssClasses.push(`col-${xs.toString()}`);
923
- // if (sm) cssClasses.push(`col-sm-${sm.toString()}`);
924
- // if (md) cssClasses.push(`col-md-${md.toString()}`);
925
- // if (lg) cssClasses.push(`col-lg-${lg.toString()}`);
926
- // if (xl) cssClasses.push(`col-xl-${xl.toString()}`);
914
+ const { children, className } = props, rest = __rest(props, ["children", "className"]);
915
+ const getCssClasses = () => {
916
+ const cssClasses = [];
927
917
  cssClasses.push(styles$E.column);
928
918
  className && cssClasses.push(className);
929
919
  return cssClasses.filter(css => css).join(' ');
@@ -1124,20 +1114,22 @@ const Select = (props) => {
1124
1114
  case 'Enter':
1125
1115
  if (hoverIndex) {
1126
1116
  const option = options[hoverIndex];
1127
- if (option)
1117
+ if (option) {
1128
1118
  handleOnClick(option);
1119
+ }
1129
1120
  }
1130
1121
  break;
1131
1122
  }
1132
1123
  }
1133
1124
  };
1134
1125
  return (React__default["default"].createElement("div", { ref: selectConainter, className: styles$B.selectContainer },
1135
- React__default["default"].createElement("div", { id: id, className: getCssClass(), onClick: () => show(), tabIndex: 0, onKeyDown: e => handleOnKeyDown(e) },
1136
- !multiple && renderSingleViewModel(),
1137
- multiple &&
1138
- React__default["default"].createElement("div", { className: styles$B.chipContainer }, renderMultipleViewModel()),
1139
- React__default["default"].createElement(Icon, { className: "ml-auto" },
1140
- React__default["default"].createElement(ChevronDownSolidIcon, null))),
1126
+ React__default["default"].createElement("div", { id: id, className: getCssClass(), onClick: () => show(), tabIndex: 0, onKeyDown: (e) => handleOnKeyDown(e) },
1127
+ React__default["default"].createElement(React__default["default"].Fragment, null,
1128
+ !multiple && renderSingleViewModel(),
1129
+ multiple &&
1130
+ React__default["default"].createElement("div", { className: styles$B.chipContainer }, renderMultipleViewModel()),
1131
+ React__default["default"].createElement(Icon, { className: "ml-auto" },
1132
+ React__default["default"].createElement(ChevronDownSolidIcon, null)))),
1141
1133
  isShow &&
1142
1134
  React__default["default"].createElement(Portal, { className: 'backdrop-root' },
1143
1135
  React__default["default"].createElement("div", { className: styles$B.selectMenu, style: { left: (_a = selectConainter.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().x, top: (_b = selectConainter.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect().y, width: (_c = selectConainter.current) === null || _c === void 0 ? void 0 : _c.getBoundingClientRect().width } },
@@ -1195,20 +1187,20 @@ const FormInput = (props) => {
1195
1187
  type === 'color' ||
1196
1188
  type === 'time')
1197
1189
  &&
1198
- React__default["default"].createElement("input", { id: name, name: name, type: type, className: getCssClasses(), value: value, autoFocus: autoFocus, onInput: e => handleOnInput(e.target.value, type, name), onChange: e => handleOnChange((e === null || e === void 0 ? void 0 : e.target).value, type, name), onBlur: onBlur, placeholder: placeholder, readOnly: readonly, disabled: disabled, onKeyDown: onKeyDown }),
1190
+ React__default["default"].createElement("input", { id: name, name: name, type: type, className: getCssClasses(), value: value, autoFocus: autoFocus, onInput: (e) => handleOnInput(e.target.value, type, name), onChange: (e) => handleOnChange((e === null || e === void 0 ? void 0 : e.target).value, type, name), onBlur: onBlur, placeholder: placeholder, readOnly: readonly, disabled: disabled, onKeyDown: onKeyDown }),
1199
1191
  type === 'file' &&
1200
- React__default["default"].createElement(FileInput, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, autoFocus: autoFocus, readOnly: readonly, disabled: disabled, onChange: e => handleOnChange(e.target.value, type, name) }, "choose a file"),
1192
+ React__default["default"].createElement(FileInput, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, autoFocus: autoFocus, readOnly: readonly, disabled: disabled, onChange: (e) => handleOnChange(e.target.value, type, name) }, "choose a file"),
1201
1193
  type === 'textarea' &&
1202
- React__default["default"].createElement(Textarea, { id: name, name: name, className: className, error: !isValid, 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' } }),
1194
+ React__default["default"].createElement(Textarea, { id: name, name: name, className: className, error: !isValid, 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' } }),
1203
1195
  type === 'select' &&
1204
- 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), options: options }),
1196
+ 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), options: options }),
1205
1197
  type === 'autocomplete' &&
1206
- 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), onSelect: e => handleOnChange(e.value, type, name), options: options }),
1198
+ 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), onSelect: (e) => handleOnChange(e.value, type, name), options: options }),
1207
1199
  type === 'checkbox' &&
1208
- React__default["default"].createElement(Checkbox, { id: name, name: name, label: label, className: (!isValid ? ' is-invalid' : ''), onChange: e => handleOnChange((e === null || e === void 0 ? void 0 : e.target).checked, type, name), checked: value }),
1200
+ React__default["default"].createElement(Checkbox, { id: name, name: name, label: label, className: (!isValid ? ' is-invalid' : ''), onChange: (e) => handleOnChange((e === null || e === void 0 ? void 0 : e.target).checked, type, name), checked: value }),
1209
1201
  type === 'radio' &&
1210
1202
  React__default["default"].createElement(React__default["default"].Fragment, null, options.map((option) => React__default["default"].createElement("div", { className: "form-check", key: option.id },
1211
- 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 }),
1203
+ 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 }),
1212
1204
  React__default["default"].createElement("label", { className: "form-check-label", htmlFor: option.id }, option.label))))));
1213
1205
  };
1214
1206
 
@@ -1265,8 +1257,10 @@ class Form extends React.Component {
1265
1257
  const keys = Object.keys(this.state.controls);
1266
1258
  const values = keys.reduce((obj, f) => {
1267
1259
  const control = this.getControl(f);
1268
- // TODO - refactor
1269
- const newValue = ((control.type === 'date' || control.type === 'datetime-local') && control.value && isValidDate((control.value))) ? new Date((control.value)).toISOString() : control.value;
1260
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1261
+ const newValue = ((control.type === 'date' || control.type === 'datetime-local') &&
1262
+ control.value &&
1263
+ isValidDate((control.value))) ? new Date((control.value)).toISOString() : control.value;
1270
1264
  return (Object.assign(Object.assign({}, obj), { [f]: newValue }));
1271
1265
  }, {});
1272
1266
  if (this.state.isValid && this.state.isSubmitted) {
@@ -1366,7 +1360,6 @@ class Form extends React.Component {
1366
1360
  const cssClasses = [labelClassName, this.isRequired(fieldKey) ? 'required' : undefined];
1367
1361
  return React__default["default"].createElement(FormLabel, { htmlFor: fieldKey, className: cssClasses.join(' ') }, label);
1368
1362
  }
1369
- // trigger via ref
1370
1363
  handleFormSubmit() {
1371
1364
  for (const fieldKey of Object.keys(this.state.controls)) {
1372
1365
  const field = this.getControl(fieldKey);
@@ -1407,8 +1400,7 @@ class Form extends React.Component {
1407
1400
  this.setState({ controls: {}, isValid: false, isChanged: false, isSubmitted: false });
1408
1401
  }
1409
1402
  getFormGroupCssClass(fieldKey) {
1410
- const result = this.getControl(fieldKey).config.formGroupClassName;
1411
- return result;
1403
+ return this.getControl(fieldKey).config.formGroupClassName;
1412
1404
  }
1413
1405
  render() {
1414
1406
  return (React__default["default"].createElement("form", { ref: this.myForm }, this.state && this.state.controls && Object.keys(this.state.controls).map((fieldKey) => {
@@ -1539,13 +1531,13 @@ const DateSelect = (props) => {
1539
1531
  return (React__default["default"].createElement(Row, { className: getCssClasses() },
1540
1532
  React__default["default"].createElement(Column, null,
1541
1533
  React__default["default"].createElement(FormLabel, null, "Year"),
1542
- React__default["default"].createElement(YearSelect, { value: currDate.getFullYear(), disabled: disabled, from: yearConfig === null || yearConfig === void 0 ? void 0 : yearConfig.from, to: yearConfig === null || yearConfig === void 0 ? void 0 : yearConfig.to, onChange: e => handleOnChange(e, exports.DATEMODE.YEAR) })),
1534
+ React__default["default"].createElement(YearSelect, { value: currDate.getFullYear(), disabled: disabled, from: yearConfig === null || yearConfig === void 0 ? void 0 : yearConfig.from, to: yearConfig === null || yearConfig === void 0 ? void 0 : yearConfig.to, onChange: (e) => handleOnChange(e, exports.DATEMODE.YEAR) })),
1543
1535
  React__default["default"].createElement(Column, null,
1544
1536
  React__default["default"].createElement(FormLabel, null, "Month"),
1545
- React__default["default"].createElement(MonthSelect, { value: currDate.getMonth(), disabled: disabled, onChange: e => handleOnChange(e, exports.DATEMODE.MONTH) })),
1537
+ React__default["default"].createElement(MonthSelect, { value: currDate.getMonth(), disabled: disabled, onChange: (e) => handleOnChange(e, exports.DATEMODE.MONTH) })),
1546
1538
  React__default["default"].createElement(Column, null,
1547
1539
  React__default["default"].createElement(FormLabel, null, "Day"),
1548
- React__default["default"].createElement(DaySelect, { day: currDate.getDate(), month: currDate.getMonth(), year: currDate.getFullYear(), disabled: disabled, onChange: e => handleOnChange(e, exports.DATEMODE.DAY) }))));
1540
+ React__default["default"].createElement(DaySelect, { day: currDate.getDate(), month: currDate.getMonth(), year: currDate.getFullYear(), disabled: disabled, onChange: (e) => handleOnChange(e, exports.DATEMODE.DAY) }))));
1549
1541
  };
1550
1542
  /*
1551
1543
  * result = { year, month, day, dayOfWeek, weekNumber }
@@ -1590,7 +1582,7 @@ const DrawerContent = (props) => {
1590
1582
  };
1591
1583
  const positionStyles = {
1592
1584
  left: { left: '0px' },
1593
- right: { right: '0px' },
1585
+ right: { right: '0px' }
1594
1586
  };
1595
1587
  const getStyles = () => {
1596
1588
  return !permanent ? positionStyles[position] : undefined;
@@ -1677,7 +1669,7 @@ const MenuItem = (props) => {
1677
1669
  };
1678
1670
 
1679
1671
  const MenuToggle = ({ children }) => {
1680
- return (React__default["default"].createElement(React.Fragment, null, children));
1672
+ return children;
1681
1673
  };
1682
1674
 
1683
1675
  var css_248z$v = ".MenuDivider-module_menuItemDivider__oRP-j {\n height: 0;\n margin: 0.5rem 0;\n overflow: hidden;\n border-top: 1px solid #e9ecef;\n}";
@@ -1766,13 +1758,13 @@ styleInject(css_248z$q);
1766
1758
 
1767
1759
  const Link = (props) => {
1768
1760
  const { href = '#', className, target, children } = props, rest = __rest(props, ["href", "className", "target", "children"]);
1769
- const [status, setStatus] = React.useState(STATUS.NORMAL);
1761
+ const [status, setStatus] = React.useState(exports.STATUS.NORMAL);
1770
1762
  const [cssClassName] = useCssClasses([styles$q.link, className, status]);
1771
1763
  const onMouseEnter = () => {
1772
- setStatus(STATUS.HOVERED);
1764
+ setStatus(exports.STATUS.HOVERED);
1773
1765
  };
1774
1766
  const onMouseLeave = () => {
1775
- setStatus(STATUS.NORMAL);
1767
+ setStatus(exports.STATUS.NORMAL);
1776
1768
  };
1777
1769
  return (React__default["default"].createElement("a", Object.assign({ className: cssClassName, href: href, target: target, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave }, rest), children));
1778
1770
  };
@@ -1920,7 +1912,7 @@ const Modal = (props) => {
1920
1912
  React__default["default"].createElement(ModalBody, null, children),
1921
1913
  footer &&
1922
1914
  React__default["default"].createElement(ModalFooter, null, footer))))),
1923
- React__default["default"].createElement(Backdrop, { onClick: handleClickBackdrop })));
1915
+ React__default["default"].createElement(Backdrop, { onClick: handleClickBackdrop, style: { zIndex: 1040 } })));
1924
1916
  };
1925
1917
 
1926
1918
  exports.MODALTYPE = void 0;
@@ -2203,11 +2195,11 @@ const Sidebar = (props) => {
2203
2195
  setMenuItems(newMenuItems);
2204
2196
  }
2205
2197
  else {
2206
- navigate(e, `/${item.path}`);
2198
+ navigate(e, `${item.path}`);
2207
2199
  }
2208
2200
  };
2209
2201
  const handleClickSubItem = (itemPath, subItemPath, e) => {
2210
- navigate(e, `/${itemPath}/${subItemPath}`);
2202
+ navigate(e, `${itemPath}/${subItemPath}`);
2211
2203
  };
2212
2204
  return (React__default["default"].createElement("nav", Object.assign({ className: getCssClasses() }, rest),
2213
2205
  React__default["default"].createElement(List, null, menuItems.map(item => (React__default["default"].createElement(React__default["default"].Fragment, { key: item.id },
@@ -2308,10 +2300,12 @@ const SpeedDial = (props) => {
2308
2300
  return cssClasses.filter(css => css).join(' ');
2309
2301
  };
2310
2302
  const handleClick = (e) => {
2311
- if (open)
2303
+ if (open) {
2312
2304
  onClose && onClose(e);
2313
- else
2305
+ }
2306
+ else {
2314
2307
  onOpen && onOpen(e);
2308
+ }
2315
2309
  };
2316
2310
  return (React__default["default"].createElement("div", Object.assign({ className: getCssClasses() }, rest),
2317
2311
  React__default["default"].createElement("div", { style: { 'transform': open ? 'rotate(45deg)' : undefined } },
@@ -2421,7 +2415,7 @@ const Stepper = (props) => {
2421
2415
  });
2422
2416
  };
2423
2417
  const renderSteps = (child, index) => {
2424
- return React__default["default"].isValidElement(child) &&
2418
+ return (React__default["default"].createElement(React__default["default"].Fragment, null, React__default["default"].isValidElement(child) &&
2425
2419
  React.cloneElement(child, {
2426
2420
  index: index,
2427
2421
  isActive: activeIndex >= index,
@@ -2430,7 +2424,7 @@ const Stepper = (props) => {
2430
2424
  showLabel: showLabel,
2431
2425
  showProgressCheckIcon: showProgressCheckIcon,
2432
2426
  onClick: (e) => handleClickStep(e.event, e.value, index)
2433
- });
2427
+ })));
2434
2428
  };
2435
2429
  const isStepOptional = (index) => {
2436
2430
  return steps && steps[index].props.isOptional;
@@ -2640,7 +2634,7 @@ const Table = (props) => {
2640
2634
  className && cssClasses.push(className);
2641
2635
  return cssClasses.filter(css => css).join(' ');
2642
2636
  };
2643
- return (React__default["default"].createElement(ConditionalWrapper, { condition: responsive, wrapper: children => React__default["default"].createElement("div", { className: styles$5.tableResponsive }, children) },
2637
+ return (React__default["default"].createElement(ConditionalWrapper, { condition: responsive, wrapper: (children) => React__default["default"].createElement("div", { className: styles$5.tableResponsive }, children) },
2644
2638
  React__default["default"].createElement("table", { className: getCssClasses() }, children)));
2645
2639
  };
2646
2640
 
@@ -2669,15 +2663,11 @@ const TableBody = (props) => {
2669
2663
  const TableCell = (props) => {
2670
2664
  const { variant } = useTableContext();
2671
2665
  const { children, component } = props, rest = __rest(props, ["children", "component"]);
2672
- return (React__default["default"].createElement(ConditionalWrapper, { condition: true, wrapper: children => ((variant === 'head' || component === 'th') ? (React__default["default"].createElement("th", Object.assign({}, rest), children)) :
2666
+ return (React__default["default"].createElement(ConditionalWrapper, { condition: true, wrapper: (children) => ((variant === 'head' || component === 'th') ? (React__default["default"].createElement("th", Object.assign({}, rest), children)) :
2673
2667
  React__default["default"].createElement("td", Object.assign({}, rest), children)) }, children));
2674
2668
  };
2675
2669
 
2676
- const TabContext = React.createContext({
2677
- fixed: false,
2678
- selectedValue: '',
2679
- setSelectedValue: () => { }
2680
- });
2670
+ const TabContext = React.createContext({});
2681
2671
  const useTabContext = () => React.useContext(TabContext);
2682
2672
 
2683
2673
  var css_248z$4 = ".TabIndicator-module_tabIndicator__jSJhH {\n bottom: 0;\n height: 2px;\n position: absolute;\n transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n}\n.TabIndicator-module_tabIndicator__jSJhH.TabIndicator-module_primary__Q5jEo {\n background-color: var(--primary);\n}\n.TabIndicator-module_tabIndicator__jSJhH.TabIndicator-module_accent__qbgIG {\n background-color: var(--accent);\n}";
@@ -2713,19 +2703,21 @@ const Tabs = (props) => {
2713
2703
  });
2714
2704
  const prevSelectedValueRef = React.useRef();
2715
2705
  React.useEffect(() => {
2716
- // TODO - check if prev needs to be set
2717
2706
  if (value !== undefined && value !== prevSelectedValueRef.current) {
2707
+ prevSelectedValueRef.current = value;
2718
2708
  setSelectedValue(value);
2719
2709
  }
2720
2710
  }, [value]);
2721
2711
  React.useEffect(() => {
2722
- React__default["default"].Children.toArray(children).forEach((child, index) => {
2723
- if (child.props.value === selectedValue) {
2724
- setSelectedIndex(index);
2725
- onChange && onChange(selectedValue);
2726
- }
2727
- });
2728
- }, [children, selectedValue]);
2712
+ if (selectedValue && children) {
2713
+ React__default["default"].Children.toArray(children).forEach((child, index) => {
2714
+ if (child.props.value === selectedValue) {
2715
+ setSelectedIndex(index);
2716
+ onChange && onChange(selectedValue);
2717
+ }
2718
+ });
2719
+ }
2720
+ }, [selectedValue]);
2729
2721
  const getCssClasses = () => {
2730
2722
  const cssClasses = [];
2731
2723
  cssClasses.push(styles$3.tabs);
@@ -2755,7 +2747,7 @@ const Tab = (props) => {
2755
2747
  };
2756
2748
  const handleClick = (event) => {
2757
2749
  onClick && onClick({ event, value });
2758
- setSelectedValue(value);
2750
+ setSelectedValue && setSelectedValue(value);
2759
2751
  };
2760
2752
  return (React__default["default"].createElement(Button, { className: getCssClasses(), onClick: handleClick, isActive: selectedValue === value, disabled: disabled }, label));
2761
2753
  };
@@ -2889,19 +2881,19 @@ const TimeSelect = (props) => {
2889
2881
  showHours &&
2890
2882
  React__default["default"].createElement(Column, null,
2891
2883
  React__default["default"].createElement(FormLabel, null, "Hours"),
2892
- React__default["default"].createElement(HourSelect, { value: currDate.getHours(), disabled: disabled, onChange: e => handleOnChange(e, exports.TIMEMODE.HOUR) })),
2884
+ React__default["default"].createElement(HourSelect, { value: currDate.getHours(), disabled: disabled, onChange: (e) => handleOnChange(e, exports.TIMEMODE.HOUR) })),
2893
2885
  showMinutes &&
2894
2886
  React__default["default"].createElement(Column, null,
2895
2887
  React__default["default"].createElement(FormLabel, null, "Minutes"),
2896
- React__default["default"].createElement(MinuteSelect, { value: currDate.getMinutes(), disabled: disabled, onChange: e => handleOnChange(e, exports.TIMEMODE.MINUTE) })),
2888
+ React__default["default"].createElement(MinuteSelect, { value: currDate.getMinutes(), disabled: disabled, onChange: (e) => handleOnChange(e, exports.TIMEMODE.MINUTE) })),
2897
2889
  showSeconds &&
2898
2890
  React__default["default"].createElement(Column, null,
2899
2891
  React__default["default"].createElement(FormLabel, null, "Seconds"),
2900
- React__default["default"].createElement(SecondSelect, { value: currDate.getSeconds(), disabled: disabled, onChange: e => handleOnChange(e, exports.TIMEMODE.SECONDS) })),
2892
+ React__default["default"].createElement(SecondSelect, { value: currDate.getSeconds(), disabled: disabled, onChange: (e) => handleOnChange(e, exports.TIMEMODE.SECONDS) })),
2901
2893
  showMilliSeconds &&
2902
2894
  React__default["default"].createElement(Column, null,
2903
2895
  React__default["default"].createElement(FormLabel, null, "Milliseconds"),
2904
- React__default["default"].createElement(MilliSecondSelect, { value: currDate.getMilliseconds(), disabled: disabled, onChange: e => handleOnChange(e, exports.TIMEMODE.MILLISECONDS) }))));
2896
+ React__default["default"].createElement(MilliSecondSelect, { value: currDate.getMilliseconds(), disabled: disabled, onChange: (e) => handleOnChange(e, exports.TIMEMODE.MILLISECONDS) }))));
2905
2897
  };
2906
2898
 
2907
2899
  var css_248z$1 = ".TreeView-module_treeView__VVj-4 {\n list-style-type: none;\n margin-bottom: 0;\n padding-left: 0px !important;\n margin-block-start: 0;\n margin-block-end: 0;\n margin-inline-start: 0px;\n margin-inline-end: 0px;\n padding-inline-start: 0px;\n}\n.TreeView-module_treeView__VVj-4 ul {\n padding-left: 48px !important;\n}";
@@ -2934,12 +2926,14 @@ const TreeItem = (props) => {
2934
2926
  return cssClasses.filter(css => css).join(' ');
2935
2927
  };
2936
2928
  React.useEffect(() => {
2937
- if (isExpanded !== undefined)
2929
+ if (isExpanded !== undefined) {
2938
2930
  setIsExpanded(isExpanded);
2931
+ }
2939
2932
  }, [isExpanded]);
2940
2933
  React.useEffect(() => {
2941
- if (isSelected !== undefined)
2934
+ if (isSelected !== undefined) {
2942
2935
  setIsSelected(isSelected);
2936
+ }
2943
2937
  }, [isSelected]);
2944
2938
  const handleOnToggleExpand = (nodeId) => {
2945
2939
  setIsExpanded(!_isExpanded);
@@ -3041,7 +3035,6 @@ exports.PlusSolidIcon = PlusSolidIcon;
3041
3035
  exports.Portal = Portal;
3042
3036
  exports.ProgressBar = ProgressBar;
3043
3037
  exports.Row = Row;
3044
- exports.STATUS = STATUS;
3045
3038
  exports.SecondSelect = SecondSelect;
3046
3039
  exports.Select = Select;
3047
3040
  exports.Sidebar = Sidebar;
@@ -0,0 +1 @@
1
+ export * from './interfaces';
@@ -0,0 +1,3 @@
1
+ export interface IDictionary<T> {
2
+ [key: string]: T;
3
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-asc",
3
- "version": "25.0.2",
3
+ "version": "25.0.5",
4
4
  "description": "handcrafted react components",
5
5
  "main": "index.js",
6
6
  "module": "index.es.js",