@rpg-engine/long-bow 0.5.56 → 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>;
@@ -14797,14 +14797,17 @@ var ItemTypes = /*#__PURE__*/styled__default.div.withConfig({
14797
14797
  })(["display:flex;overflow-y:scroll;overflow-x:hidden;width:max-content;flex-direction:column;padding-right:5px;@media (max-width:", "){overflow-x:scroll;overflow-y:hidden;padding-right:0;width:100%;}"], mobilePortrait.width);
14798
14798
 
14799
14799
  var Dropdown = function Dropdown(_ref) {
14800
+ var _options$, _options$2;
14800
14801
  var options = _ref.options,
14801
14802
  width = _ref.width,
14802
- onChange = _ref.onChange;
14803
+ onChange = _ref.onChange,
14804
+ _ref$triggerOnChangeO = _ref.triggerOnChangeOnMount,
14805
+ triggerOnChangeOnMount = _ref$triggerOnChangeO === void 0 ? true : _ref$triggerOnChangeO;
14803
14806
  var dropdownId = uuid.v4();
14804
- var _useState = React.useState(options[0].value),
14807
+ var _useState = React.useState(options == null ? void 0 : (_options$ = options[0]) == null ? void 0 : _options$.value),
14805
14808
  selectedValue = _useState[0],
14806
14809
  setSelectedValue = _useState[1];
14807
- var _useState2 = React.useState(options[0].option),
14810
+ var _useState2 = React.useState(options == null ? void 0 : (_options$2 = options[0]) == null ? void 0 : _options$2.option),
14808
14811
  selectedOption = _useState2[0],
14809
14812
  setSelectedOption = _useState2[1];
14810
14813
  var _useState3 = React.useState(false),
@@ -14817,6 +14820,11 @@ var Dropdown = function Dropdown(_ref) {
14817
14820
  onChange(value);
14818
14821
  }
14819
14822
  };
14823
+ React.useEffect(function () {
14824
+ if (triggerOnChangeOnMount) {
14825
+ onChange(selectedValue);
14826
+ }
14827
+ }, []);
14820
14828
  return React__default.createElement(Container$d, {
14821
14829
  onMouseLeave: function onMouseLeave() {
14822
14830
  return setOpened(false);