@xqmsg/ui-core 0.19.1 → 0.19.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,4 +1,4 @@
1
- import React__default, { memo, forwardRef, createElement, useMemo, useCallback, useRef, useEffect, useState } from 'react';
1
+ import React__default, { memo, forwardRef, createElement, useMemo, useCallback, useEffect, useRef, useState } from 'react';
2
2
  import { Button as Button$2, Alert as Alert$1, AlertDescription, Flex, Box, Text as Text$2, Spinner, Checkbox, InputGroup, Input as Input$2, RadioGroup, Radio, InputRightElement, Textarea as Textarea$1, useOutsideClick, Switch as Switch$1, FormLabel as FormLabel$1, Tooltip, FormControl, FormErrorMessage, FormHelperText, SimpleGrid, useMediaQuery, Grid, GridItem, IconButton, Collapse, Link as Link$2, Table as Table$2, Tbody, Tr, Td, TableContainer, Thead, Th, Tabs as Tabs$1, TabList, Tab, extendTheme, ChakraProvider, useToast as useToast$1 } from '@chakra-ui/react';
3
3
  import { FormProvider, useWatch, Controller } from 'react-hook-form';
4
4
  import { debounce, truncate } from 'lodash-es';
@@ -801,13 +801,6 @@ var Dropdown = function Dropdown(_ref) {
801
801
  }, DropdownContent);
802
802
  };
803
803
 
804
- var useDidMountEffect = function useDidMountEffect(func, deps) {
805
- var didMount = useRef(false);
806
- useEffect(function () {
807
- if (didMount.current) func();else didMount.current = true; // eslint-disable-next-line
808
- }, deps);
809
- };
810
-
811
804
  function useOnClickOutside(ref, handler) {
812
805
  useEffect(function () {
813
806
  var listener = function listener(event) {
@@ -865,7 +858,7 @@ var Dropdown$1 = function Dropdown(_ref) {
865
858
  });
866
859
  };
867
860
 
868
- var _excluded$1 = ["isRequired", "options", "name", "setValue", "handleOnChange", "disabled", "value"];
861
+ var _excluded$1 = ["isRequired", "options", "name", "setValue", "handleOnChange", "disabled", "value", "fullOptions"];
869
862
  /**
870
863
  * A functional React component utilized to render the `StackedSelect` component.
871
864
  */
@@ -880,6 +873,7 @@ var StackedSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref
880
873
  handleOnChange = _ref2.handleOnChange,
881
874
  disabled = _ref2.disabled,
882
875
  value = _ref2.value,
876
+ fullOptions = _ref2.fullOptions,
883
877
  props = _objectWithoutPropertiesLoose(_ref2, _excluded$1);
884
878
 
885
879
  var dropdownRef = useRef(null);
@@ -923,13 +917,13 @@ var StackedSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref
923
917
  setPosition('bottom');
924
918
  }
925
919
  }, [boundingClientRect]);
926
- useDidMountEffect(function () {
927
- var _options$find$label2, _options$find2;
920
+ useEffect(function () {
921
+ var _find$label, _find;
928
922
 
929
- setSelectedOption((_options$find$label2 = (_options$find2 = options.find(function (option) {
923
+ setSelectedOption((_find$label = (_find = (fullOptions || options).find(function (option) {
930
924
  return option.value === value;
931
- })) == null ? void 0 : _options$find2.label) != null ? _options$find$label2 : '');
932
- }, [value]);
925
+ })) == null ? void 0 : _find.label) != null ? _find$label : '');
926
+ }, [fullOptions, value]);
933
927
  useOnClickOutside(dropdownRef, function () {
934
928
  return setIsFocussed(false);
935
929
  });
@@ -1638,7 +1632,6 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
1638
1632
  ref: inputWrapperRef,
1639
1633
  handler: function handler() {
1640
1634
  onBlur();
1641
- console.log('hi');
1642
1635
  }
1643
1636
  });
1644
1637
  return /*#__PURE__*/React__default.createElement(Box, {
@@ -1804,6 +1797,7 @@ function Input(_ref) {
1804
1797
  isRequired = _ref.isRequired,
1805
1798
  maxLength = _ref.maxLength,
1806
1799
  defaultValue = _ref.defaultValue,
1800
+ fullOptions = _ref.fullOptions,
1807
1801
  control = _ref.control,
1808
1802
  disabled = _ref.disabled,
1809
1803
  rightElement = _ref.rightElement,
@@ -1864,7 +1858,8 @@ function Input(_ref) {
1864
1858
  disabled: disabled,
1865
1859
  value: value,
1866
1860
  defaultValue: defaultValue,
1867
- placeholder: placeholder
1861
+ placeholder: placeholder,
1862
+ fullOptions: fullOptions
1868
1863
  });
1869
1864
 
1870
1865
  case 'textarea':
@@ -4221,7 +4216,6 @@ var ToolbarBreadcrumbItem = function ToolbarBreadcrumbItem(_ref) {
4221
4216
  var getPageLabel = useMemo(function () {
4222
4217
  if (breakpoint400) {
4223
4218
  if (page === 'current') {
4224
- console.log('hi');
4225
4219
  return pageLabel;
4226
4220
  }
4227
4221
  }
@@ -4400,16 +4394,16 @@ var Toast = function Toast(_ref) {
4400
4394
  }, buttonText)));
4401
4395
  };
4402
4396
 
4403
- var useToast = function useToast(props) {
4397
+ var useToast = function useToast() {
4404
4398
  var toast = useToast$1();
4405
- return function () {
4399
+ return useCallback(function (props) {
4406
4400
  return toast({
4407
4401
  position: props.position,
4408
4402
  render: function render() {
4409
4403
  return /*#__PURE__*/React__default.createElement(Toast, Object.assign({}, props));
4410
4404
  }
4411
4405
  });
4412
- };
4406
+ }, [toast]);
4413
4407
  };
4414
4408
 
4415
4409
  function formatErrorResponse(error) {