@rpg-engine/long-bow 0.5.57 → 0.5.58

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.
@@ -8,5 +8,6 @@ export interface IDropdownProps {
8
8
  options: IOptionsProps[];
9
9
  width?: string;
10
10
  onChange: (value: string) => void;
11
+ triggerOnChangeOnMount?: boolean;
11
12
  }
12
13
  export declare const Dropdown: React.FC<IDropdownProps>;
@@ -14800,7 +14800,9 @@ var Dropdown = function Dropdown(_ref) {
14800
14800
  var _options$, _options$2;
14801
14801
  var options = _ref.options,
14802
14802
  width = _ref.width,
14803
- onChange = _ref.onChange;
14803
+ onChange = _ref.onChange,
14804
+ _ref$triggerOnChangeO = _ref.triggerOnChangeOnMount,
14805
+ triggerOnChangeOnMount = _ref$triggerOnChangeO === void 0 ? true : _ref$triggerOnChangeO;
14804
14806
  var dropdownId = uuid.v4();
14805
14807
  var _useState = React.useState(options == null ? void 0 : (_options$ = options[0]) == null ? void 0 : _options$.value),
14806
14808
  selectedValue = _useState[0],
@@ -14818,6 +14820,11 @@ var Dropdown = function Dropdown(_ref) {
14818
14820
  onChange(value);
14819
14821
  }
14820
14822
  };
14823
+ React.useEffect(function () {
14824
+ if (triggerOnChangeOnMount) {
14825
+ onChange(selectedValue);
14826
+ }
14827
+ }, []);
14821
14828
  return React__default.createElement(Container$d, {
14822
14829
  onMouseLeave: function onMouseLeave() {
14823
14830
  return setOpened(false);