@babylonjs/node-editor 5.25.0 → 5.26.0

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.
@@ -62285,7 +62285,8 @@ const MessageDialog = (props) => {
62285
62285
  "use strict";
62286
62286
  __webpack_require__.r(__webpack_exports__);
62287
62287
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
62288
- /* harmony export */ "ClassNames": () => (/* binding */ ClassNames)
62288
+ /* harmony export */ "ClassNames": () => (/* binding */ ClassNames),
62289
+ /* harmony export */ "JoinClassNames": () => (/* binding */ JoinClassNames)
62289
62290
  /* harmony export */ });
62290
62291
  function ClassNames(names, styleObject) {
62291
62292
  let string = "";
@@ -62296,6 +62297,15 @@ function ClassNames(names, styleObject) {
62296
62297
  }
62297
62298
  return string;
62298
62299
  }
62300
+ function JoinClassNames(styleObject, ...names) {
62301
+ let string = "";
62302
+ for (const name of names) {
62303
+ if (name && styleObject[name]) {
62304
+ string += styleObject[name] + " ";
62305
+ }
62306
+ }
62307
+ return string;
62308
+ }
62299
62309
 
62300
62310
 
62301
62311
  /***/ }),
@@ -63121,8 +63131,10 @@ __webpack_require__.r(__webpack_exports__);
63121
63131
 
63122
63132
  // eslint-disable-next-line @typescript-eslint/naming-convention
63123
63133
  const Null_Value = Number.MAX_SAFE_INTEGER;
63134
+ const DEFAULT_FALLBACK_VALUE = -1;
63124
63135
  class OptionsLineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
63125
63136
  constructor(props) {
63137
+ // Initialize default props
63126
63138
  super(props);
63127
63139
  this._localChange = false;
63128
63140
  this.state = { value: this._remapValueIn(this._getValue(props)), addCustom: false };
@@ -63213,6 +63225,7 @@ class OptionsLineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component
63213
63225
  this.setState({ addCustom: false });
63214
63226
  }
63215
63227
  render() {
63228
+ const fallback = this.props.fallbackValue !== undefined ? this.props.fallbackValue : DEFAULT_FALLBACK_VALUE;
63216
63229
  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) => {
63217
63230
  event.key === "Enter" && this.props.addVal != undefined
63218
63231
  ? (this.props.addVal({ label: event.target.value, value: this.props.options.length + 1 }, Number(this.state.value)),
@@ -63225,7 +63238,7 @@ class OptionsLineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component
63225
63238
  this.updateCustomValue(),
63226
63239
  this.forceUpdate())
63227
63240
  : null;
63228
- } })) : ((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) => {
63241
+ } })) : ((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) => {
63229
63242
  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));
63230
63243
  }) })) })] }));
63231
63244
  }