@babylonjs/inspector 5.25.0 → 5.26.1

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.
@@ -70976,8 +70976,10 @@ __webpack_require__.r(__webpack_exports__);
70976
70976
 
70977
70977
  // eslint-disable-next-line @typescript-eslint/naming-convention
70978
70978
  const Null_Value = Number.MAX_SAFE_INTEGER;
70979
+ const DEFAULT_FALLBACK_VALUE = -1;
70979
70980
  class OptionsLineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
70980
70981
  constructor(props) {
70982
+ // Initialize default props
70981
70983
  super(props);
70982
70984
  this._localChange = false;
70983
70985
  this.state = { value: this._remapValueIn(this._getValue(props)), addCustom: false };
@@ -71068,6 +71070,7 @@ class OptionsLineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component
71068
71070
  this.setState({ addCustom: false });
71069
71071
  }
71070
71072
  render() {
71073
+ const fallback = this.props.fallbackValue !== undefined ? this.props.fallbackValue : DEFAULT_FALLBACK_VALUE;
71071
71074
  return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: `listLine ${this.props.className ?? ""}`, children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, color: "black", className: "icon" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "label", title: this.props.label, children: this.props.label }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "options", children: this.state.addCustom ? ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", placeholder: "Enter a custom font here", onKeyDown: (event) => {
71072
71075
  event.key === "Enter" && this.props.addVal != undefined
71073
71076
  ? (this.props.addVal({ label: event.target.value, value: this.props.options.length + 1 }, Number(this.state.value)),
@@ -71080,7 +71083,7 @@ class OptionsLineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component
71080
71083
  this.updateCustomValue(),
71081
71084
  this.forceUpdate())
71082
71085
  : null;
71083
- } })) : ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("select", { onChange: (evt) => this.updateValue(evt.target.value), value: this.state.value === -1 || this.state.value === null || this.state.value === undefined ? 1 : this.state.value, children: this.props.options.map((option, i) => {
71086
+ } })) : ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("select", { onChange: (evt) => this.updateValue(evt.target.value), value: this.state.value === null || this.state.value === undefined ? fallback : this.state.value, children: this.props.options.map((option, i) => {
71084
71087
  return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { selected: option.selected, value: option.value, title: option.label, children: option.label }, option.label + i));
71085
71088
  }) })) })] }));
71086
71089
  }