@singularsystems/neo-react 1.0.3 → 1.0.4
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.
|
@@ -90,6 +90,7 @@ export default class AutoCompleteDropDown<T> extends DropDownBase<T, IAutoComple
|
|
|
90
90
|
private bindIdsProperty?;
|
|
91
91
|
static getBindProp<T>(props: IAutoCompleteProps | IAutoCompleteMultiSelectProps): Model.IPropertyInstance<any>;
|
|
92
92
|
private onKeyPress;
|
|
93
|
+
private setBindProperty;
|
|
93
94
|
private mapTArrayToOptions;
|
|
94
95
|
private onItemSelected;
|
|
95
96
|
render(): React.JSX.Element;
|
|
@@ -11,29 +11,11 @@ import { NeoReactTypes } from '../../Modules/Types';
|
|
|
11
11
|
var AutoCompleteDropDown = /** @class */ (function (_super) {
|
|
12
12
|
__extends(AutoCompleteDropDown, _super);
|
|
13
13
|
function AutoCompleteDropDown(props) {
|
|
14
|
-
var _a;
|
|
15
14
|
var _this = _super.call(this, props) || this;
|
|
16
15
|
_this.asyncSelectImplementation = Misc.Globals.appService.get(NeoReactTypes.Components.AsyncSelect);
|
|
17
16
|
_this.selectImplementation = Misc.Globals.appService.get(NeoReactTypes.Components.ReactSelect);
|
|
18
17
|
_this.onKeyPress = _this.onKeyPress.bind(_this);
|
|
19
18
|
_this.onItemSelected = _this.onItemSelected.bind(_this);
|
|
20
|
-
var singleProps = _this.props, multiProps = _this.props;
|
|
21
|
-
_this.bindProperty = (_a = singleProps.bind) !== null && _a !== void 0 ? _a : multiProps.bindItems;
|
|
22
|
-
_this.fieldInfoContainer = Model.ModelFieldInfo.asModelFieldInfoContainer(_this.bindProperty.attachedTo);
|
|
23
|
-
if (multiProps.bindIds) {
|
|
24
|
-
if (multiProps.bindIds.propertyInfo) {
|
|
25
|
-
var bindIdsProperty = multiProps.bindIds;
|
|
26
|
-
_this.bindIdsProperty = bindIdsProperty;
|
|
27
|
-
_this.bindIdsList = bindIdsProperty.value;
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
_this.bindIdsList = multiProps.bindIds;
|
|
31
|
-
if (_this.fieldInfoContainer) {
|
|
32
|
-
console.error("Warning: Pass a property instance as 'bindIds', otherwise the display values will not be captured.");
|
|
33
|
-
_this.fieldInfoContainer = null;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
19
|
return _this;
|
|
38
20
|
}
|
|
39
21
|
AutoCompleteDropDown.getBindProp = function (props) {
|
|
@@ -62,6 +44,29 @@ var AutoCompleteDropDown = /** @class */ (function (_super) {
|
|
|
62
44
|
Utils.clearDebounce(this);
|
|
63
45
|
}
|
|
64
46
|
};
|
|
47
|
+
AutoCompleteDropDown.prototype.setBindProperty = function () {
|
|
48
|
+
var _a;
|
|
49
|
+
var singleProps = this.props, multiProps = this.props;
|
|
50
|
+
var newBind = (_a = singleProps.bind) !== null && _a !== void 0 ? _a : multiProps.bindItems;
|
|
51
|
+
if (this.bindProperty !== newBind) {
|
|
52
|
+
this.bindProperty = newBind;
|
|
53
|
+
this.fieldInfoContainer = Model.ModelFieldInfo.asModelFieldInfoContainer(this.bindProperty.attachedTo);
|
|
54
|
+
if (multiProps.bindIds) {
|
|
55
|
+
if (multiProps.bindIds.propertyInfo) {
|
|
56
|
+
var bindIdsProperty = multiProps.bindIds;
|
|
57
|
+
this.bindIdsProperty = bindIdsProperty;
|
|
58
|
+
this.bindIdsList = bindIdsProperty.value;
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
this.bindIdsList = multiProps.bindIds;
|
|
62
|
+
if (this.fieldInfoContainer) {
|
|
63
|
+
console.error("Warning: Pass a property instance as 'bindIds', otherwise the display values will not be captured.");
|
|
64
|
+
this.fieldInfoContainer = null;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
65
70
|
AutoCompleteDropDown.prototype.mapTArrayToOptions = function (items) {
|
|
66
71
|
var _this = this;
|
|
67
72
|
if (items.length) {
|
|
@@ -124,6 +129,7 @@ var AutoCompleteDropDown = /** @class */ (function (_super) {
|
|
|
124
129
|
var _this = this;
|
|
125
130
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
126
131
|
var _j = this.props, bind = _j.bind, bindDisplay = _j.bindDisplay, bindItems = _j.bindItems, bindIds = _j.bindIds, itemSource = _j.itemSource, items = _j.items, displayMember = _j.displayMember, valueMember = _j.valueMember, descriptionMember = _j.descriptionMember, option = _j.option, noRecordsPrompt = _j.noRecordsPrompt, typeToSearchPrompt = _j.typeToSearchPrompt, delayMs = _j.delayMs, minCharacters = _j.minCharacters, onItemSelected = _j.onItemSelected, fieldInfoLimit = _j.fieldInfoLimit, otherProps = __rest(_j, ["bind", "bindDisplay", "bindItems", "bindIds", "itemSource", "items", "displayMember", "valueMember", "descriptionMember", "option", "noRecordsPrompt", "typeToSearchPrompt", "delayMs", "minCharacters", "onItemSelected", "fieldInfoLimit"]);
|
|
132
|
+
this.setBindProperty();
|
|
127
133
|
var splitProps = BindPropsHelper.splitCommonEditorProps(otherProps);
|
|
128
134
|
var nativeProps = splitProps.rest;
|
|
129
135
|
var bindItemsProperty = bindItems;
|