react-asc 25.0.0 → 25.0.3

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.
@@ -1 +1 @@
1
- export declare const MaxValidator: (valueA: number, valueB: number) => boolean;
1
+ export declare const MaxValidator: (val: string, valueB: number) => boolean;
@@ -1 +1 @@
1
- export declare const MinValidator: (valueA: number, valueB: number) => boolean;
1
+ export declare const MinValidator: (val: string, minLength: number) => boolean;
@@ -4,6 +4,7 @@ export interface ILoadingIndicatorService {
4
4
  declare class LoadingIndicatorService implements ILoadingIndicatorService {
5
5
  private container;
6
6
  private handler;
7
+ private root;
7
8
  show(): void;
8
9
  hide(): void;
9
10
  }
@@ -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;
@@ -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
+ }
package/index.es.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import React, { useRef, useEffect, useState, useMemo, createContext, useContext, Fragment, Component, createRef, cloneElement } from 'react';
2
- import reactDom, { createPortal, render, unmountComponentAtNode } from 'react-dom';
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 = {};
@@ -1233,9 +1234,9 @@ const EmailValidator = (value) => {
1233
1234
 
1234
1235
  const IsEqualValidator = (valueA, valueB) => valueA === valueB;
1235
1236
 
1236
- const MaxValidator = (valueA, valueB) => valueA <= valueB;
1237
+ const MaxValidator = (val, valueB) => val.length <= valueB;
1237
1238
 
1238
- const MinValidator = (valueA, valueB) => valueA >= valueB;
1239
+ const MinValidator = (val, minLength) => val.length >= minLength;
1239
1240
 
1240
1241
  // values, isSubmitting, handleChange, handleBlur, handleSubmit
1241
1242
  class Form extends Component {
@@ -1288,12 +1289,12 @@ class Form extends Component {
1288
1289
  break;
1289
1290
  case 'min':
1290
1291
  if (!MinValidator(fieldValue, parseInt(validatorParam))) {
1291
- errors.push({ validator: validatorName, message: `Number is less than ${validatorParam}` });
1292
+ errors.push({ validator: validatorName, message: `Minimum number of ${validatorParam} characters not met` });
1292
1293
  }
1293
1294
  break;
1294
1295
  case 'max':
1295
1296
  if (!MaxValidator(fieldValue, parseInt(validatorParam))) {
1296
- errors.push({ validator: validatorName, message: `Number is greater than ${validatorParam}` });
1297
+ errors.push({ validator: validatorName, message: `Maximum number of ${validatorParam} characters exceeded` });
1297
1298
  }
1298
1299
  break;
1299
1300
  case 'match':
@@ -1793,6 +1794,39 @@ const LoadingIndicatorContainer = ({ children, isFixed }) => {
1793
1794
  return (React.createElement("div", { className: getCssClasses() }, children));
1794
1795
  };
1795
1796
 
1797
+ function createCommonjsModule(fn, module) {
1798
+ return module = { exports: {} }, fn(module, module.exports), module.exports;
1799
+ }
1800
+
1801
+ var client = createCommonjsModule(function (module, exports) {
1802
+
1803
+
1804
+ if (process.env.NODE_ENV === 'production') {
1805
+ exports.createRoot = reactDom.createRoot;
1806
+ exports.hydrateRoot = reactDom.hydrateRoot;
1807
+ } else {
1808
+ var i = reactDom.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
1809
+ exports.createRoot = function(c, o) {
1810
+ i.usingClientEntryPoint = true;
1811
+ try {
1812
+ return reactDom.createRoot(c, o);
1813
+ } finally {
1814
+ i.usingClientEntryPoint = false;
1815
+ }
1816
+ };
1817
+ exports.hydrateRoot = function(c, h, o) {
1818
+ i.usingClientEntryPoint = true;
1819
+ try {
1820
+ return reactDom.hydrateRoot(c, h, o);
1821
+ } finally {
1822
+ i.usingClientEntryPoint = false;
1823
+ }
1824
+ };
1825
+ }
1826
+ });
1827
+ var client_1 = client.createRoot;
1828
+ client.hydrateRoot;
1829
+
1796
1830
  class LoadingIndicatorService {
1797
1831
  show() {
1798
1832
  if (this.container) {
@@ -1801,12 +1835,14 @@ class LoadingIndicatorService {
1801
1835
  this.container = document.createElement('div');
1802
1836
  this.container.classList.add('snackbar-container');
1803
1837
  document.body.appendChild(this.container);
1804
- render(React.createElement(LoadingIndicatorContainer, { isFixed: true },
1805
- React.createElement(LoadingIndicator, null)), this.container);
1838
+ this.root = client_1(this.container);
1839
+ this.root.render(React.createElement(LoadingIndicatorContainer, { isFixed: true },
1840
+ React.createElement(LoadingIndicator, null)));
1806
1841
  }
1807
1842
  hide() {
1843
+ var _a;
1808
1844
  if (this.container) {
1809
- unmountComponentAtNode(this.container);
1845
+ (_a = this.root) === null || _a === void 0 ? void 0 : _a.unmount();
1810
1846
  document.body.removeChild(this.container);
1811
1847
  this.container = undefined;
1812
1848
  this.handler && clearTimeout(this.handler);
@@ -1879,39 +1915,6 @@ const Modal = (props) => {
1879
1915
  React.createElement(Backdrop, { onClick: handleClickBackdrop })));
1880
1916
  };
1881
1917
 
1882
- function createCommonjsModule(fn, module) {
1883
- return module = { exports: {} }, fn(module, module.exports), module.exports;
1884
- }
1885
-
1886
- var client = createCommonjsModule(function (module, exports) {
1887
-
1888
-
1889
- if (process.env.NODE_ENV === 'production') {
1890
- exports.createRoot = reactDom.createRoot;
1891
- exports.hydrateRoot = reactDom.hydrateRoot;
1892
- } else {
1893
- var i = reactDom.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
1894
- exports.createRoot = function(c, o) {
1895
- i.usingClientEntryPoint = true;
1896
- try {
1897
- return reactDom.createRoot(c, o);
1898
- } finally {
1899
- i.usingClientEntryPoint = false;
1900
- }
1901
- };
1902
- exports.hydrateRoot = function(c, h, o) {
1903
- i.usingClientEntryPoint = true;
1904
- try {
1905
- return reactDom.hydrateRoot(c, h, o);
1906
- } finally {
1907
- i.usingClientEntryPoint = false;
1908
- }
1909
- };
1910
- }
1911
- });
1912
- var client_1 = client.createRoot;
1913
- client.hydrateRoot;
1914
-
1915
1918
  var MODALTYPE;
1916
1919
  (function (MODALTYPE) {
1917
1920
  MODALTYPE["BASIC"] = "BASIC";
@@ -1966,10 +1969,10 @@ const GlobalModal = ({ title, description, formControls, onOk, onChange, onCance
1966
1969
  }
1967
1970
  button.handler && button.handler();
1968
1971
  };
1969
- return (React.createElement(Modal, { size: size, fullScreen: fullScreen, header: title, onHeaderCloseClick: onCancel, onBackdropClick: onBackdropClick, isDismissable: isDismissable, footer: React.createElement(Fragment, null, buttons.map((button, index) => (React.createElement(Button, { key: index, variant: button.variant, color: button.color, autoFocus: button.autoFocus, shadow: button.shadow, onClick: () => handleClickButton(button) }, button.label)))) },
1972
+ return (React.createElement(Modal, { size: size, fullScreen: fullScreen, header: title, onHeaderCloseClick: onCancel, onBackdropClick: onBackdropClick, isDismissable: isDismissable, footer: React.createElement(React.Fragment, null, buttons.map((button, index) => (React.createElement(Button, { key: index, variant: button.variant, color: button.color, autoFocus: button.autoFocus, shadow: button.shadow, onClick: () => handleClickButton(button) }, button.label)))) },
1970
1973
  description && React.createElement("div", null, description),
1971
1974
  modalType === MODALTYPE.FORM &&
1972
- React.createElement(Fragment, null,
1975
+ React.createElement(React.Fragment, null,
1973
1976
  React.createElement(Form, { ref: myForm, controls: myControls, validateOnBlur: true, onSubmit: onSubmit, onChange: onChange }))));
1974
1977
  };
1975
1978
 
@@ -1996,7 +1999,7 @@ class ModalService {
1996
1999
  return new Promise((resolve, reject) => {
1997
2000
  if (!this.container) {
1998
2001
  this.container = document.createElement('div');
1999
- document.body.appendChild(this.container);
2002
+ this.container.classList.add('modal-container');
2000
2003
  const handleOk = (values) => {
2001
2004
  resolve(values);
2002
2005
  this.hide();
@@ -2018,7 +2021,7 @@ class ModalService {
2018
2021
  var _a;
2019
2022
  if (this.container) {
2020
2023
  (_a = this.root) === null || _a === void 0 ? void 0 : _a.unmount();
2021
- document.body.removeChild(this.container);
2024
+ // document.body.removeChild(this.container);
2022
2025
  this.container = undefined;
2023
2026
  }
2024
2027
  }
@@ -2662,11 +2665,7 @@ const TableCell = (props) => {
2662
2665
  React.createElement("td", Object.assign({}, rest), children)) }, children));
2663
2666
  };
2664
2667
 
2665
- const TabContext = createContext({
2666
- fixed: false,
2667
- selectedValue: '',
2668
- setSelectedValue: () => { }
2669
- });
2668
+ const TabContext = createContext({});
2670
2669
  const useTabContext = () => useContext(TabContext);
2671
2670
 
2672
2671
  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}";
@@ -2703,17 +2702,20 @@ const Tabs = (props) => {
2703
2702
  const prevSelectedValueRef = useRef();
2704
2703
  useEffect(() => {
2705
2704
  if (value !== undefined && value !== prevSelectedValueRef.current) {
2705
+ prevSelectedValueRef.current = value;
2706
2706
  setSelectedValue(value);
2707
2707
  }
2708
2708
  }, [value]);
2709
2709
  useEffect(() => {
2710
- React.Children.toArray(children).forEach((child, index) => {
2711
- if (child.props.value === selectedValue) {
2712
- setSelectedIndex(index);
2713
- onChange && onChange(selectedValue);
2714
- }
2715
- });
2716
- }, [children, selectedValue]);
2710
+ if (selectedValue && children) {
2711
+ React.Children.toArray(children).forEach((child, index) => {
2712
+ if (child.props.value === selectedValue) {
2713
+ setSelectedIndex(index);
2714
+ onChange && onChange(selectedValue);
2715
+ }
2716
+ });
2717
+ }
2718
+ }, [selectedValue]);
2717
2719
  const getCssClasses = () => {
2718
2720
  const cssClasses = [];
2719
2721
  cssClasses.push(styles$3.tabs);
@@ -2743,7 +2745,7 @@ const Tab = (props) => {
2743
2745
  };
2744
2746
  const handleClick = (event) => {
2745
2747
  onClick && onClick({ event, value });
2746
- setSelectedValue(value);
2748
+ setSelectedValue && setSelectedValue(value);
2747
2749
  };
2748
2750
  return (React.createElement(Button, { className: getCssClasses(), onClick: handleClick, isActive: selectedValue === value, disabled: disabled }, label));
2749
2751
  };
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 = {};
@@ -1242,9 +1243,9 @@ const EmailValidator = (value) => {
1242
1243
 
1243
1244
  const IsEqualValidator = (valueA, valueB) => valueA === valueB;
1244
1245
 
1245
- const MaxValidator = (valueA, valueB) => valueA <= valueB;
1246
+ const MaxValidator = (val, valueB) => val.length <= valueB;
1246
1247
 
1247
- const MinValidator = (valueA, valueB) => valueA >= valueB;
1248
+ const MinValidator = (val, minLength) => val.length >= minLength;
1248
1249
 
1249
1250
  // values, isSubmitting, handleChange, handleBlur, handleSubmit
1250
1251
  class Form extends React.Component {
@@ -1297,12 +1298,12 @@ class Form extends React.Component {
1297
1298
  break;
1298
1299
  case 'min':
1299
1300
  if (!MinValidator(fieldValue, parseInt(validatorParam))) {
1300
- errors.push({ validator: validatorName, message: `Number is less than ${validatorParam}` });
1301
+ errors.push({ validator: validatorName, message: `Minimum number of ${validatorParam} characters not met` });
1301
1302
  }
1302
1303
  break;
1303
1304
  case 'max':
1304
1305
  if (!MaxValidator(fieldValue, parseInt(validatorParam))) {
1305
- errors.push({ validator: validatorName, message: `Number is greater than ${validatorParam}` });
1306
+ errors.push({ validator: validatorName, message: `Maximum number of ${validatorParam} characters exceeded` });
1306
1307
  }
1307
1308
  break;
1308
1309
  case 'match':
@@ -1766,13 +1767,13 @@ styleInject(css_248z$q);
1766
1767
 
1767
1768
  const Link = (props) => {
1768
1769
  const { href = '#', className, target, children } = props, rest = __rest(props, ["href", "className", "target", "children"]);
1769
- const [status, setStatus] = React.useState(STATUS.NORMAL);
1770
+ const [status, setStatus] = React.useState(exports.STATUS.NORMAL);
1770
1771
  const [cssClassName] = useCssClasses([styles$q.link, className, status]);
1771
1772
  const onMouseEnter = () => {
1772
- setStatus(STATUS.HOVERED);
1773
+ setStatus(exports.STATUS.HOVERED);
1773
1774
  };
1774
1775
  const onMouseLeave = () => {
1775
- setStatus(STATUS.NORMAL);
1776
+ setStatus(exports.STATUS.NORMAL);
1776
1777
  };
1777
1778
  return (React__default["default"].createElement("a", Object.assign({ className: cssClassName, href: href, target: target, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave }, rest), children));
1778
1779
  };
@@ -1802,6 +1803,39 @@ const LoadingIndicatorContainer = ({ children, isFixed }) => {
1802
1803
  return (React__default["default"].createElement("div", { className: getCssClasses() }, children));
1803
1804
  };
1804
1805
 
1806
+ function createCommonjsModule(fn, module) {
1807
+ return module = { exports: {} }, fn(module, module.exports), module.exports;
1808
+ }
1809
+
1810
+ var client = createCommonjsModule(function (module, exports) {
1811
+
1812
+
1813
+ if (process.env.NODE_ENV === 'production') {
1814
+ exports.createRoot = reactDom__default["default"].createRoot;
1815
+ exports.hydrateRoot = reactDom__default["default"].hydrateRoot;
1816
+ } else {
1817
+ var i = reactDom__default["default"].__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
1818
+ exports.createRoot = function(c, o) {
1819
+ i.usingClientEntryPoint = true;
1820
+ try {
1821
+ return reactDom__default["default"].createRoot(c, o);
1822
+ } finally {
1823
+ i.usingClientEntryPoint = false;
1824
+ }
1825
+ };
1826
+ exports.hydrateRoot = function(c, h, o) {
1827
+ i.usingClientEntryPoint = true;
1828
+ try {
1829
+ return reactDom__default["default"].hydrateRoot(c, h, o);
1830
+ } finally {
1831
+ i.usingClientEntryPoint = false;
1832
+ }
1833
+ };
1834
+ }
1835
+ });
1836
+ var client_1 = client.createRoot;
1837
+ client.hydrateRoot;
1838
+
1805
1839
  class LoadingIndicatorService {
1806
1840
  show() {
1807
1841
  if (this.container) {
@@ -1810,12 +1844,14 @@ class LoadingIndicatorService {
1810
1844
  this.container = document.createElement('div');
1811
1845
  this.container.classList.add('snackbar-container');
1812
1846
  document.body.appendChild(this.container);
1813
- reactDom.render(React__default["default"].createElement(LoadingIndicatorContainer, { isFixed: true },
1814
- React__default["default"].createElement(LoadingIndicator, null)), this.container);
1847
+ this.root = client_1(this.container);
1848
+ this.root.render(React__default["default"].createElement(LoadingIndicatorContainer, { isFixed: true },
1849
+ React__default["default"].createElement(LoadingIndicator, null)));
1815
1850
  }
1816
1851
  hide() {
1852
+ var _a;
1817
1853
  if (this.container) {
1818
- reactDom.unmountComponentAtNode(this.container);
1854
+ (_a = this.root) === null || _a === void 0 ? void 0 : _a.unmount();
1819
1855
  document.body.removeChild(this.container);
1820
1856
  this.container = undefined;
1821
1857
  this.handler && clearTimeout(this.handler);
@@ -1888,39 +1924,6 @@ const Modal = (props) => {
1888
1924
  React__default["default"].createElement(Backdrop, { onClick: handleClickBackdrop })));
1889
1925
  };
1890
1926
 
1891
- function createCommonjsModule(fn, module) {
1892
- return module = { exports: {} }, fn(module, module.exports), module.exports;
1893
- }
1894
-
1895
- var client = createCommonjsModule(function (module, exports) {
1896
-
1897
-
1898
- if (process.env.NODE_ENV === 'production') {
1899
- exports.createRoot = reactDom__default["default"].createRoot;
1900
- exports.hydrateRoot = reactDom__default["default"].hydrateRoot;
1901
- } else {
1902
- var i = reactDom__default["default"].__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
1903
- exports.createRoot = function(c, o) {
1904
- i.usingClientEntryPoint = true;
1905
- try {
1906
- return reactDom__default["default"].createRoot(c, o);
1907
- } finally {
1908
- i.usingClientEntryPoint = false;
1909
- }
1910
- };
1911
- exports.hydrateRoot = function(c, h, o) {
1912
- i.usingClientEntryPoint = true;
1913
- try {
1914
- return reactDom__default["default"].hydrateRoot(c, h, o);
1915
- } finally {
1916
- i.usingClientEntryPoint = false;
1917
- }
1918
- };
1919
- }
1920
- });
1921
- var client_1 = client.createRoot;
1922
- client.hydrateRoot;
1923
-
1924
1927
  exports.MODALTYPE = void 0;
1925
1928
  (function (MODALTYPE) {
1926
1929
  MODALTYPE["BASIC"] = "BASIC";
@@ -1975,10 +1978,10 @@ const GlobalModal = ({ title, description, formControls, onOk, onChange, onCance
1975
1978
  }
1976
1979
  button.handler && button.handler();
1977
1980
  };
1978
- return (React__default["default"].createElement(Modal, { size: size, fullScreen: fullScreen, header: title, onHeaderCloseClick: onCancel, onBackdropClick: onBackdropClick, isDismissable: isDismissable, footer: React__default["default"].createElement(React.Fragment, null, buttons.map((button, index) => (React__default["default"].createElement(Button, { key: index, variant: button.variant, color: button.color, autoFocus: button.autoFocus, shadow: button.shadow, onClick: () => handleClickButton(button) }, button.label)))) },
1981
+ return (React__default["default"].createElement(Modal, { size: size, fullScreen: fullScreen, header: title, onHeaderCloseClick: onCancel, onBackdropClick: onBackdropClick, isDismissable: isDismissable, footer: React__default["default"].createElement(React__default["default"].Fragment, null, buttons.map((button, index) => (React__default["default"].createElement(Button, { key: index, variant: button.variant, color: button.color, autoFocus: button.autoFocus, shadow: button.shadow, onClick: () => handleClickButton(button) }, button.label)))) },
1979
1982
  description && React__default["default"].createElement("div", null, description),
1980
1983
  modalType === exports.MODALTYPE.FORM &&
1981
- React__default["default"].createElement(React.Fragment, null,
1984
+ React__default["default"].createElement(React__default["default"].Fragment, null,
1982
1985
  React__default["default"].createElement(Form, { ref: myForm, controls: myControls, validateOnBlur: true, onSubmit: onSubmit, onChange: onChange }))));
1983
1986
  };
1984
1987
 
@@ -2005,7 +2008,7 @@ class ModalService {
2005
2008
  return new Promise((resolve, reject) => {
2006
2009
  if (!this.container) {
2007
2010
  this.container = document.createElement('div');
2008
- document.body.appendChild(this.container);
2011
+ this.container.classList.add('modal-container');
2009
2012
  const handleOk = (values) => {
2010
2013
  resolve(values);
2011
2014
  this.hide();
@@ -2027,7 +2030,7 @@ class ModalService {
2027
2030
  var _a;
2028
2031
  if (this.container) {
2029
2032
  (_a = this.root) === null || _a === void 0 ? void 0 : _a.unmount();
2030
- document.body.removeChild(this.container);
2033
+ // document.body.removeChild(this.container);
2031
2034
  this.container = undefined;
2032
2035
  }
2033
2036
  }
@@ -2671,11 +2674,7 @@ const TableCell = (props) => {
2671
2674
  React__default["default"].createElement("td", Object.assign({}, rest), children)) }, children));
2672
2675
  };
2673
2676
 
2674
- const TabContext = React.createContext({
2675
- fixed: false,
2676
- selectedValue: '',
2677
- setSelectedValue: () => { }
2678
- });
2677
+ const TabContext = React.createContext({});
2679
2678
  const useTabContext = () => React.useContext(TabContext);
2680
2679
 
2681
2680
  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}";
@@ -2712,17 +2711,20 @@ const Tabs = (props) => {
2712
2711
  const prevSelectedValueRef = React.useRef();
2713
2712
  React.useEffect(() => {
2714
2713
  if (value !== undefined && value !== prevSelectedValueRef.current) {
2714
+ prevSelectedValueRef.current = value;
2715
2715
  setSelectedValue(value);
2716
2716
  }
2717
2717
  }, [value]);
2718
2718
  React.useEffect(() => {
2719
- React__default["default"].Children.toArray(children).forEach((child, index) => {
2720
- if (child.props.value === selectedValue) {
2721
- setSelectedIndex(index);
2722
- onChange && onChange(selectedValue);
2723
- }
2724
- });
2725
- }, [children, selectedValue]);
2719
+ if (selectedValue && children) {
2720
+ React__default["default"].Children.toArray(children).forEach((child, index) => {
2721
+ if (child.props.value === selectedValue) {
2722
+ setSelectedIndex(index);
2723
+ onChange && onChange(selectedValue);
2724
+ }
2725
+ });
2726
+ }
2727
+ }, [selectedValue]);
2726
2728
  const getCssClasses = () => {
2727
2729
  const cssClasses = [];
2728
2730
  cssClasses.push(styles$3.tabs);
@@ -2752,7 +2754,7 @@ const Tab = (props) => {
2752
2754
  };
2753
2755
  const handleClick = (event) => {
2754
2756
  onClick && onClick({ event, value });
2755
- setSelectedValue(value);
2757
+ setSelectedValue && setSelectedValue(value);
2756
2758
  };
2757
2759
  return (React__default["default"].createElement(Button, { className: getCssClasses(), onClick: handleClick, isActive: selectedValue === value, disabled: disabled }, label));
2758
2760
  };
@@ -3038,7 +3040,6 @@ exports.PlusSolidIcon = PlusSolidIcon;
3038
3040
  exports.Portal = Portal;
3039
3041
  exports.ProgressBar = ProgressBar;
3040
3042
  exports.Row = Row;
3041
- exports.STATUS = STATUS;
3042
3043
  exports.SecondSelect = SecondSelect;
3043
3044
  exports.Select = Select;
3044
3045
  exports.Sidebar = Sidebar;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-asc",
3
- "version": "25.0.0",
3
+ "version": "25.0.3",
4
4
  "description": "handcrafted react components",
5
5
  "main": "index.js",
6
6
  "module": "index.es.js",