@ntbjs/react-components 1.1.0-beta.40 → 1.1.0-beta.41

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.
@@ -36,12 +36,11 @@ var Instructions = React__default['default'].forwardRef(function Instructions(_r
36
36
  lightBackground = _ref.lightBackground,
37
37
  options = _ref.options,
38
38
  autoSelect = _ref.autoSelect,
39
- subscribeCurrentValueProp = _ref.subscribeCurrentValue,
40
39
  onChangeProp = _ref.onChange,
41
40
  onFocusProp = _ref.onFocus,
42
41
  onBlurProp = _ref.onBlur,
43
42
  onUpdateCallback = _ref.onUpdateCallback,
44
- props = defaultTheme._objectWithoutProperties(_ref, ["clickToAdd", "customAddMessage", "selectedOption", "readOnly", "name", "lightBackground", "options", "autoSelect", "subscribeCurrentValue", "onChange", "onFocus", "onBlur", "onUpdateCallback"]);
43
+ props = defaultTheme._objectWithoutProperties(_ref, ["clickToAdd", "customAddMessage", "selectedOption", "readOnly", "name", "lightBackground", "options", "autoSelect", "onChange", "onFocus", "onBlur", "onUpdateCallback"]);
45
44
 
46
45
  var _useState = React.useState(false),
47
46
  _useState2 = defaultTheme._slicedToArray(_useState, 2),
@@ -78,6 +77,20 @@ var Instructions = React__default['default'].forwardRef(function Instructions(_r
78
77
  currentValue = _useState14[0],
79
78
  setCurrentValue = _useState14[1];
80
79
 
80
+ React.useEffect(function () {
81
+ handleChange(selected);
82
+ }, [selected]);
83
+ React.useEffect(function () {
84
+ if (selectedOption) {
85
+ setCurrentValue(selectedOption.value);
86
+ }
87
+ }, [selectedOption]);
88
+ React.useEffect(function () {
89
+ if (addInstructions) {
90
+ setCurrentValue(customMessage);
91
+ setInitialHover(true);
92
+ }
93
+ }, [addInstructions, handleOnFocus]);
81
94
  var onChange = React.useCallback(function (event) {
82
95
  setCurrentValue(event.target.value);
83
96
 
@@ -165,25 +178,6 @@ var Instructions = React__default['default'].forwardRef(function Instructions(_r
165
178
  }
166
179
  };
167
180
 
168
- React.useEffect(function () {
169
- if (lodash.isFunction(subscribeCurrentValueProp)) {
170
- subscribeCurrentValueProp(currentValue);
171
- }
172
- }, [currentValue]);
173
- React.useEffect(function () {
174
- handleChange(selected);
175
- }, [selected]);
176
- React.useEffect(function () {
177
- if (selectedOption) {
178
- setCurrentValue(selectedOption.value);
179
- }
180
- }, [selectedOption]);
181
- React.useEffect(function () {
182
- if (addInstructions) {
183
- setCurrentValue(customMessage);
184
- setInitialHover(true);
185
- }
186
- }, [addInstructions, handleOnFocus]);
187
181
  return React__default['default'].createElement(Instructions$1, defaultTheme._extends({
188
182
  ref: forwardedRef,
189
183
  initialHover: initialHover,
@@ -225,7 +219,6 @@ Instructions.propTypes = process.env.NODE_ENV !== "production" ? {
225
219
  readOnly: defaultTheme.PropTypes.bool,
226
220
  lightBackground: defaultTheme.PropTypes.bool,
227
221
  options: defaultTheme.PropTypes.array,
228
- subscribeCurrentValue: defaultTheme.PropTypes.func,
229
222
  onChange: defaultTheme.PropTypes.func,
230
223
  onFocus: defaultTheme.PropTypes.func,
231
224
  onBlur: defaultTheme.PropTypes.func,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ntbjs/react-components",
3
- "version": "1.1.0-beta.40",
3
+ "version": "1.1.0-beta.41",
4
4
  "description": "NTBs common front-end design utilities and React components.",
5
5
  "scripts": {
6
6
  "build": "cross-env NODE_ENV=production rollup -c",
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var Instructions = require('../../Instructions-8fc0fc8c.js');
3
+ var Instructions = require('../../Instructions-02b4209b.js');
4
4
  require('../../defaultTheme-870f7df1.js');
5
5
  require('styled-components');
6
6
  require('react');
package/widgets/index.js CHANGED
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var AssetGallery = require('../AssetGallery-f082c487.js');
6
6
  var ContextMenu = require('../ContextMenu-59c2a64f.js');
7
7
  var AssetPreviewTopBar = require('../AssetPreviewTopBar-020a6f96.js');
8
- var Instructions = require('../Instructions-8fc0fc8c.js');
8
+ var Instructions = require('../Instructions-02b4209b.js');
9
9
  require('../defaultTheme-870f7df1.js');
10
10
  require('styled-components');
11
11
  require('react');