@singularsystems/neo-react 1.3.9 → 1.3.10

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  This file details all new features and changes to functionality. If you only need to see changes that require updates to your project, see the [breaking changes](./Breaking.md) readme.
4
4
 
5
+ ## Version 1.3.10 (19 March 2026)
6
+
7
+ - AutoCompleteDropDown
8
+ - Fixed InputElement prop not being passed to underlying react-select component.
9
+
5
10
  ## Version 1.3.9 (4 March 2026)
6
11
 
7
12
  - Dropdown
@@ -2,17 +2,17 @@ import React, { JSX } from 'react';
2
2
  import { Model } from '@singularsystems/neo-core';
3
3
  import { AxiosPromise } from 'axios';
4
4
  import { DropDownBase, ItemSource } from './DropDownBase';
5
- import type { Props } from 'react-select';
5
+ import type { Props, SelectInstance } from 'react-select';
6
6
  import { ICommonEditorProps } from '../PropTypes';
7
7
  import { FormContext } from '../FormContext';
8
- interface IOption {
8
+ interface IOption<T = any> {
9
9
  value: string | number;
10
10
  label: string;
11
- item?: any;
11
+ item?: T;
12
12
  itemParent?: any;
13
13
  options?: IOption[];
14
14
  }
15
- interface IAutoCompleteCommonProps<T, TChild = T> extends ICommonEditorProps, Props<IOption, true> {
15
+ interface IAutoCompleteCommonProps<T, TChild = T> extends ICommonEditorProps<SelectInstance>, Props<IOption, true> {
16
16
  /**
17
17
  * Callback for loading data.
18
18
  */
@@ -309,11 +309,12 @@ var AutoCompleteDropDown = /** @class */ (function (_super) {
309
309
  return !input || _this.props.inputFilter(input, option.data.item, option.data.itemParent);
310
310
  };
311
311
  }
312
+ var inputRef = splitProps.editor.inputElement;
312
313
  if (this.props.itemSource !== undefined) {
313
- return Tooltip.fromDataAttributes(InputHelpers.surroundWithInputGroup(React.createElement(this.asyncSelectImplementation, __assign({}, nativeProps, { placeholder: (_h = this.props.placeholder) !== null && _h !== void 0 ? _h : "", classNamePrefix: "react-select-bs", defaultOptions: defaultItems, loadOptions: this.onKeyPress, isMulti: bindItems !== undefined, noOptionsMessage: function (c) { var _a, _b; return c.inputValue && c.inputValue.length >= (minCharacters !== null && minCharacters !== void 0 ? minCharacters : 1) ? ((_a = _this.props.noRecordsPrompt) !== null && _a !== void 0 ? _a : "No records found") : ((_b = _this.props.typeToSearchPrompt) !== null && _b !== void 0 ? _b : "Type to search..."); }, value: value, onChange: this.onItemSelected, components: components })), splitProps.editor, { disabled: nativeProps.isDisabled }), nativeProps);
314
+ return Tooltip.fromDataAttributes(InputHelpers.surroundWithInputGroup(React.createElement(this.asyncSelectImplementation, __assign({}, nativeProps, { placeholder: (_h = this.props.placeholder) !== null && _h !== void 0 ? _h : "", classNamePrefix: "react-select-bs", defaultOptions: defaultItems, loadOptions: this.onKeyPress, isMulti: bindItems !== undefined, noOptionsMessage: function (c) { var _a, _b; return c.inputValue && c.inputValue.length >= (minCharacters !== null && minCharacters !== void 0 ? minCharacters : 1) ? ((_a = _this.props.noRecordsPrompt) !== null && _a !== void 0 ? _a : "No records found") : ((_b = _this.props.typeToSearchPrompt) !== null && _b !== void 0 ? _b : "Type to search..."); }, value: value, onChange: this.onItemSelected, components: components, ref: inputRef })), splitProps.editor, { disabled: nativeProps.isDisabled }), nativeProps);
314
315
  }
315
316
  else {
316
- return Tooltip.fromDataAttributes(InputHelpers.surroundWithInputGroup(React.createElement(this.selectImplementation, __assign({}, nativeProps, { placeholder: (_j = this.props.placeholder) !== null && _j !== void 0 ? _j : "", classNamePrefix: "react-select-bs", options: defaultItems, isLoading: this.isLoading, isMulti: bindItems !== undefined, noOptionsMessage: function (c) { var _a; return (_a = _this.props.noRecordsPrompt) !== null && _a !== void 0 ? _a : "No records found"; }, value: value, onChange: this.onItemSelected, components: components })), splitProps.editor, { disabled: nativeProps.isDisabled }), nativeProps);
317
+ return Tooltip.fromDataAttributes(InputHelpers.surroundWithInputGroup(React.createElement(this.selectImplementation, __assign({}, nativeProps, { placeholder: (_j = this.props.placeholder) !== null && _j !== void 0 ? _j : "", classNamePrefix: "react-select-bs", options: defaultItems, isLoading: this.isLoading, isMulti: bindItems !== undefined, noOptionsMessage: function (c) { var _a; return (_a = _this.props.noRecordsPrompt) !== null && _a !== void 0 ? _a : "No records found"; }, value: value, onChange: this.onItemSelected, components: components, ref: inputRef })), splitProps.editor, { disabled: nativeProps.isDisabled }), nativeProps);
317
318
  }
318
319
  };
319
320
  AutoCompleteDropDown.prototype.getOption = function (content, additionalClass) {
@@ -25,7 +25,7 @@ export declare enum CheckboxType {
25
25
  Checkbox = 1,
26
26
  Switch = 2
27
27
  }
28
- export interface ICommonEditorProps {
28
+ export interface ICommonEditorProps<TInputRef = HTMLElement> {
29
29
  /** True if the editor should be readonly. This is set automatically if you use display instead of bind on a FormGroup / Column. */
30
30
  isReadOnly?: boolean;
31
31
  /** True if the editor should be readonly. This is set automatically if you use display instead of bind on a FormGroup / Column. */
@@ -49,7 +49,7 @@ export interface ICommonEditorProps {
49
49
  /** True if append / prepend is set, which means this must be an editor as part of a bs editor group. */
50
50
  requiresGroup?: boolean;
51
51
  /** Reference to the input dom element */
52
- inputElement?: React.RefObject<HTMLElement | null>;
52
+ inputElement?: React.RefObject<TInputRef | null>;
53
53
  }
54
54
  export interface IBindableEditorPropsNoBase extends ICommonEditorProps {
55
55
  bind: Model.IPropertyInstance;
@@ -141,7 +141,7 @@ export declare class BindPropsHelper {
141
141
  static getBindProperty<T>(allProps: IEditorContainerProps<T, any>): Model.IPropertyInstance;
142
142
  static splitCommonEditorProps<T extends ICommonEditorProps>(props: T): {
143
143
  editor: ICommonEditorProps;
144
- rest: Omit<T, "disabled" | "readOnly" | "isReadOnly" | "isDisabled" | "prependText" | "appendText" | "prepend" | "append" | "prependIcon" | "appendIcon" | "inputElement">;
144
+ rest: Omit<T, "disabled" | "readOnly" | "isReadOnly" | "isDisabled" | "prependText" | "appendText" | "prepend" | "append" | "prependIcon" | "appendIcon" | "requiresGroup" | "inputElement">;
145
145
  };
146
146
  static normaliseContainerProps<T, TContainerDom = React.HTMLProps<T>, TData = any>(component: IComponentBase, props: IEditorContainerProps<T, TData>, inGroup: boolean, isBootstrap?: boolean): IEditorContainerNormalisedProps<TContainerDom, TData>;
147
147
  static normaliseEditorProps<T, TDom = React.HTMLProps<T>>(component: IComponentBase, props: (IEditorAndSelectorProps<T, any> & TDom) | IEditorNormalisedProps<TDom, any>): IEditorNormalisedProps<TDom, any>;
@@ -102,7 +102,7 @@ var BindPropsHelper = /** @class */ (function () {
102
102
  return (allProps.bind || allProps.display || allProps.bindContext);
103
103
  };
104
104
  BindPropsHelper.splitCommonEditorProps = function (props) {
105
- var isReadOnly = props.isReadOnly, readOnly = props.readOnly, isDisabled = props.isDisabled, disabled = props.disabled, prependText = props.prependText, prepend = props.prepend, prependIcon = props.prependIcon, appendText = props.appendText, append = props.append, appendIcon = props.appendIcon, inputElement = props.inputElement, rest = __rest(props, ["isReadOnly", "readOnly", "isDisabled", "disabled", "prependText", "prepend", "prependIcon", "appendText", "append", "appendIcon", "inputElement"]);
105
+ var isReadOnly = props.isReadOnly, readOnly = props.readOnly, isDisabled = props.isDisabled, disabled = props.disabled, prependText = props.prependText, prepend = props.prepend, prependIcon = props.prependIcon, appendText = props.appendText, append = props.append, appendIcon = props.appendIcon, inputElement = props.inputElement, requiresGroup = props.requiresGroup, rest = __rest(props, ["isReadOnly", "readOnly", "isDisabled", "disabled", "prependText", "prepend", "prependIcon", "appendText", "append", "appendIcon", "inputElement", "requiresGroup"]);
106
106
  return {
107
107
  editor: {
108
108
  isReadOnly: (isReadOnly !== null && isReadOnly !== void 0 ? isReadOnly : readOnly), isDisabled: (isDisabled !== null && isDisabled !== void 0 ? isDisabled : disabled),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@singularsystems/neo-react",
3
- "version": "1.3.9",
3
+ "version": "1.3.10",
4
4
  "description": "React application logic and components for the Neo client library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",