@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.
@@ -4,6 +4,7 @@ import { StackedInputProps } from '../StackedInput/StackedInput';
4
4
  import { UseFormSetValue, FieldValues, Control } from 'react-hook-form';
5
5
  export interface StackedSelectProps extends StackedInputProps {
6
6
  options: FieldOptions;
7
+ fullOptions?: FieldOptions;
7
8
  setValue: UseFormSetValue<FieldValues>;
8
9
  control: Control<FieldValues, any>;
9
10
  handleOnChange: (value?: string) => void;
@@ -10,6 +10,7 @@ export interface InputProps<T extends FieldValues> extends ValidationProps {
10
10
  label?: string;
11
11
  className?: string;
12
12
  options?: FieldOptions;
13
+ fullOptions?: FieldOptions;
13
14
  maxLength?: number;
14
15
  helperText?: React.ReactNode;
15
16
  control: Control<T, any>;
@@ -26,4 +27,4 @@ export interface InputProps<T extends FieldValues> extends ValidationProps {
26
27
  * A functional React component utilized to render the `Input` component. Utilizes a switch statement
27
28
  * to render the correct input based on the `inputType`.
28
29
  */
29
- export declare function Input<T extends FieldValues>({ inputType, label, ariaLabel, className, placeholder, name, helperText, options, tooltipText, isInvalid, errorText, isRequired, maxLength, defaultValue, control, disabled, rightElement, leftElement, onChange, setValue, setError, clearErrors, }: InputProps<T>): JSX.Element;
30
+ export declare function Input<T extends FieldValues>({ inputType, label, ariaLabel, className, placeholder, name, helperText, options, tooltipText, isInvalid, errorText, isRequired, maxLength, defaultValue, fullOptions, control, disabled, rightElement, leftElement, onChange, setValue, setError, clearErrors, }: InputProps<T>): JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { ToastPosition } from '@chakra-ui/react';
2
2
  import React from 'react';
3
3
  import { ToastProps } from '../components/toast';
4
- export declare const useToast: (props: ToastProps & {
4
+ export declare const useToast: () => (props: ToastProps & {
5
5
  position: ToastPosition;
6
- }) => () => React.Key;
6
+ }) => React.Key;
@@ -808,13 +808,6 @@ var Dropdown = function Dropdown(_ref) {
808
808
  }, DropdownContent);
809
809
  };
810
810
 
811
- var useDidMountEffect = function useDidMountEffect(func, deps) {
812
- var didMount = React.useRef(false);
813
- React.useEffect(function () {
814
- if (didMount.current) func();else didMount.current = true; // eslint-disable-next-line
815
- }, deps);
816
- };
817
-
818
811
  function useOnClickOutside(ref, handler) {
819
812
  React.useEffect(function () {
820
813
  var listener = function listener(event) {
@@ -872,7 +865,7 @@ var Dropdown$1 = function Dropdown(_ref) {
872
865
  });
873
866
  };
874
867
 
875
- var _excluded$1 = ["isRequired", "options", "name", "setValue", "handleOnChange", "disabled", "value"];
868
+ var _excluded$1 = ["isRequired", "options", "name", "setValue", "handleOnChange", "disabled", "value", "fullOptions"];
876
869
  /**
877
870
  * A functional React component utilized to render the `StackedSelect` component.
878
871
  */
@@ -887,6 +880,7 @@ var StackedSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref
887
880
  handleOnChange = _ref2.handleOnChange,
888
881
  disabled = _ref2.disabled,
889
882
  value = _ref2.value,
883
+ fullOptions = _ref2.fullOptions,
890
884
  props = _objectWithoutPropertiesLoose(_ref2, _excluded$1);
891
885
 
892
886
  var dropdownRef = React.useRef(null);
@@ -930,13 +924,13 @@ var StackedSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref
930
924
  setPosition('bottom');
931
925
  }
932
926
  }, [boundingClientRect]);
933
- useDidMountEffect(function () {
934
- var _options$find$label2, _options$find2;
927
+ React.useEffect(function () {
928
+ var _find$label, _find;
935
929
 
936
- setSelectedOption((_options$find$label2 = (_options$find2 = options.find(function (option) {
930
+ setSelectedOption((_find$label = (_find = (fullOptions || options).find(function (option) {
937
931
  return option.value === value;
938
- })) == null ? void 0 : _options$find2.label) != null ? _options$find$label2 : '');
939
- }, [value]);
932
+ })) == null ? void 0 : _find.label) != null ? _find$label : '');
933
+ }, [fullOptions, value]);
940
934
  useOnClickOutside(dropdownRef, function () {
941
935
  return setIsFocussed(false);
942
936
  });
@@ -1645,7 +1639,6 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
1645
1639
  ref: inputWrapperRef,
1646
1640
  handler: function handler() {
1647
1641
  onBlur();
1648
- console.log('hi');
1649
1642
  }
1650
1643
  });
1651
1644
  return /*#__PURE__*/React__default.createElement(react.Box, {
@@ -1811,6 +1804,7 @@ function Input(_ref) {
1811
1804
  isRequired = _ref.isRequired,
1812
1805
  maxLength = _ref.maxLength,
1813
1806
  defaultValue = _ref.defaultValue,
1807
+ fullOptions = _ref.fullOptions,
1814
1808
  control = _ref.control,
1815
1809
  disabled = _ref.disabled,
1816
1810
  rightElement = _ref.rightElement,
@@ -1871,7 +1865,8 @@ function Input(_ref) {
1871
1865
  disabled: disabled,
1872
1866
  value: value,
1873
1867
  defaultValue: defaultValue,
1874
- placeholder: placeholder
1868
+ placeholder: placeholder,
1869
+ fullOptions: fullOptions
1875
1870
  });
1876
1871
 
1877
1872
  case 'textarea':
@@ -4228,7 +4223,6 @@ var ToolbarBreadcrumbItem = function ToolbarBreadcrumbItem(_ref) {
4228
4223
  var getPageLabel = React.useMemo(function () {
4229
4224
  if (breakpoint400) {
4230
4225
  if (page === 'current') {
4231
- console.log('hi');
4232
4226
  return pageLabel;
4233
4227
  }
4234
4228
  }
@@ -4407,16 +4401,16 @@ var Toast = function Toast(_ref) {
4407
4401
  }, buttonText)));
4408
4402
  };
4409
4403
 
4410
- var useToast = function useToast(props) {
4404
+ var useToast = function useToast() {
4411
4405
  var toast = react.useToast();
4412
- return function () {
4406
+ return React.useCallback(function (props) {
4413
4407
  return toast({
4414
4408
  position: props.position,
4415
4409
  render: function render() {
4416
4410
  return /*#__PURE__*/React__default.createElement(Toast, Object.assign({}, props));
4417
4411
  }
4418
4412
  });
4419
- };
4413
+ }, [toast]);
4420
4414
  };
4421
4415
 
4422
4416
  function formatErrorResponse(error) {