@ntbjs/react-components 1.1.0-beta.20 → 1.1.0-beta.21
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.
|
@@ -34,7 +34,8 @@ var Instructions = React__default['default'].forwardRef(function Instructions(_r
|
|
|
34
34
|
readOnly = _ref.readOnly,
|
|
35
35
|
lightBackground = _ref.lightBackground,
|
|
36
36
|
options = _ref.options,
|
|
37
|
-
|
|
37
|
+
onChangeProp = _ref.onChange,
|
|
38
|
+
props = defaultTheme._objectWithoutProperties(_ref, ["clickToAdd", "customAddMessage", "selectedOption", "readOnly", "lightBackground", "options", "onChange"]);
|
|
38
39
|
|
|
39
40
|
var filterOptions = function filterOptions(inputValue) {
|
|
40
41
|
return options.filter(function (option) {
|
|
@@ -42,6 +43,14 @@ var Instructions = React__default['default'].forwardRef(function Instructions(_r
|
|
|
42
43
|
});
|
|
43
44
|
};
|
|
44
45
|
|
|
46
|
+
var onChange = React.useCallback(function (event) {
|
|
47
|
+
setCurrentValue(event.target.value);
|
|
48
|
+
|
|
49
|
+
if (lodash.isFunction(onChangeProp)) {
|
|
50
|
+
onChangeProp(event);
|
|
51
|
+
}
|
|
52
|
+
}, [onChangeProp]);
|
|
53
|
+
|
|
45
54
|
var loadOptions = function loadOptions(inputValue, prevOptions) {
|
|
46
55
|
var pageLength = 10;
|
|
47
56
|
var filteredOptions;
|
|
@@ -160,6 +169,7 @@ var Instructions = React__default['default'].forwardRef(function Instructions(_r
|
|
|
160
169
|
return React__default['default'].createElement(Instructions$1, defaultTheme._extends({
|
|
161
170
|
ref: forwardedRef,
|
|
162
171
|
initialHover: initialHover,
|
|
172
|
+
onChange: onChange,
|
|
163
173
|
onMouseEnter: handleMouseEnter,
|
|
164
174
|
onMouseLeave: handleMouseLeave
|
|
165
175
|
}, props), React__default['default'].createElement(TopBarContainer, {
|
|
@@ -168,7 +178,7 @@ var Instructions = React__default['default'].forwardRef(function Instructions(_r
|
|
|
168
178
|
}, React__default['default'].createElement(SelectContainer, null, React__default['default'].createElement(AutocompleteSelect.AutocompleteSelect, {
|
|
169
179
|
warning: true,
|
|
170
180
|
creatable: false,
|
|
171
|
-
|
|
181
|
+
value: selectedOption,
|
|
172
182
|
loadOptions: loadOptionsPromise,
|
|
173
183
|
onChange: handleChange
|
|
174
184
|
}))), React__default['default'].createElement(InstructionsArea, null, React__default['default'].createElement(TextArea.TextArea, {
|
|
@@ -193,7 +203,8 @@ Instructions.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
193
203
|
disabled: defaultTheme.PropTypes.bool,
|
|
194
204
|
readOnly: defaultTheme.PropTypes.bool,
|
|
195
205
|
lightBackground: defaultTheme.PropTypes.bool,
|
|
196
|
-
options: defaultTheme.PropTypes.array
|
|
206
|
+
options: defaultTheme.PropTypes.array,
|
|
207
|
+
onChange: defaultTheme.PropTypes.func
|
|
197
208
|
} : {};
|
|
198
209
|
|
|
199
210
|
exports.Instructions = Instructions;
|
package/package.json
CHANGED
package/widgets/index.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var AssetGallery = require('../AssetGallery-763861f4.js');
|
|
6
6
|
var ContextMenu = require('../ContextMenu-ccb7a26a.js');
|
|
7
7
|
var AssetPreviewTopBar = require('../AssetPreviewTopBar-020a6f96.js');
|
|
8
|
-
var Instructions = require('../Instructions-
|
|
8
|
+
var Instructions = require('../Instructions-98d6fe45.js');
|
|
9
9
|
require('../defaultTheme-870f7df1.js');
|
|
10
10
|
require('styled-components');
|
|
11
11
|
require('react');
|