@xqmsg/ui-core 0.19.2 → 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;
@@ -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
  });
@@ -1810,6 +1804,7 @@ function Input(_ref) {
1810
1804
  isRequired = _ref.isRequired,
1811
1805
  maxLength = _ref.maxLength,
1812
1806
  defaultValue = _ref.defaultValue,
1807
+ fullOptions = _ref.fullOptions,
1813
1808
  control = _ref.control,
1814
1809
  disabled = _ref.disabled,
1815
1810
  rightElement = _ref.rightElement,
@@ -1870,7 +1865,8 @@ function Input(_ref) {
1870
1865
  disabled: disabled,
1871
1866
  value: value,
1872
1867
  defaultValue: defaultValue,
1873
- placeholder: placeholder
1868
+ placeholder: placeholder,
1869
+ fullOptions: fullOptions
1874
1870
  });
1875
1871
 
1876
1872
  case 'textarea':