@spothero/ui 14.8.1 → 14.8.2

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
@@ -1,3 +1,13 @@
1
+ # 14.8.2 - 05/24/2022
2
+
3
+ ## Miscellaneous Updates
4
+ * [[e1703b6](https://github.com/spothero/fe-ui/commit/e1703b6)] - `fix:` Update components with optional chaining and required props ([#298](https://github.com/spothero/fe-ui/pull/298)) (Janavi Anand)
5
+
6
+ # 14.8.2-beta.0 - 05/23/2022
7
+
8
+ ## Miscellaneous Updates
9
+ * [[910c646](https://github.com/spothero/fe-ui/commit/910c646)] - `fix:` Update components with optional chaining and required props (JanaviAnand_SpotHero)
10
+
1
11
  # 14.8.1 - 05/20/2022
2
12
  ## Miscellaneous Updates
3
13
  * [[63d43ff](https://github.com/spothero/fe-ui/commit/63d43ff)] - Sear 2077 - replace rollup with dex ([#297](https://github.com/spothero/fe-ui/pull/297)) (Tyler Williams)
package/CHANGELOG.tmp CHANGED
@@ -1,4 +1,5 @@
1
- # 14.8.1 - 05/20/2022
1
+ # 14.8.2 - 05/24/2022
2
+
2
3
  ## Miscellaneous Updates
3
- * [[63d43ff](https://github.com/spothero/fe-ui/commit/63d43ff)] - Sear 2077 - replace rollup with dex ([#297](https://github.com/spothero/fe-ui/pull/297)) (Tyler Williams)
4
+ * [[e1703b6](https://github.com/spothero/fe-ui/commit/e1703b6)] - `fix:` Update components with optional chaining and required props ([#298](https://github.com/spothero/fe-ui/pull/298)) (Janavi Anand)
4
5
 
@@ -241,9 +241,10 @@ var AutoSuggestInput = /*#__PURE__*/function (_Component) {
241
241
  (0, _createClass2.default)(AutoSuggestInput, [{
242
242
  key: "componentDidMount",
243
243
  value: function componentDidMount() {
244
- var suggestions = this.props.suggestions;
244
+ var _this$_input, _this$_input$node;
245
245
 
246
- this._input.node.addEventListener('invalid', this._onInvalid);
246
+ var suggestions = this.props.suggestions;
247
+ (_this$_input = this._input) === null || _this$_input === void 0 ? void 0 : (_this$_input$node = _this$_input.node) === null || _this$_input$node === void 0 ? void 0 : _this$_input$node.addEventListener('invalid', this._onInvalid);
247
248
 
248
249
  if (suggestions.length) {
249
250
  this._showSuggests();
@@ -262,7 +263,9 @@ var AutoSuggestInput = /*#__PURE__*/function (_Component) {
262
263
 
263
264
  if (prevState.value !== value) {
264
265
  if (!value) {
265
- this._input.node.focus();
266
+ var _this$_input2, _this$_input2$node;
267
+
268
+ (_this$_input2 = this._input) === null || _this$_input2 === void 0 ? void 0 : (_this$_input2$node = _this$_input2.node) === null || _this$_input2$node === void 0 ? void 0 : _this$_input2$node.focus();
266
269
  }
267
270
  }
268
271
 
@@ -283,7 +286,9 @@ var AutoSuggestInput = /*#__PURE__*/function (_Component) {
283
286
  }, {
284
287
  key: "componentWillUnmount",
285
288
  value: function componentWillUnmount() {
286
- this._input.node.removeEventListener('invalid', this._onInvalid);
289
+ var _this$_input3, _this$_input3$node;
290
+
291
+ (_this$_input3 = this._input) === null || _this$_input3 === void 0 ? void 0 : (_this$_input3$node = _this$_input3.node) === null || _this$_input3$node === void 0 ? void 0 : _this$_input3$node.removeEventListener('invalid', this._onInvalid);
287
292
  }
288
293
  }, {
289
294
  key: "_nextSuggest",
@@ -398,7 +403,9 @@ var AutoSuggestInput = /*#__PURE__*/function (_Component) {
398
403
  }, {
399
404
  key: "node",
400
405
  get: function get() {
401
- return this._input.node;
406
+ var _this$_input4;
407
+
408
+ return (_this$_input4 = this._input) === null || _this$_input4 === void 0 ? void 0 : _this$_input4.node;
402
409
  }
403
410
  }, {
404
411
  key: "render",
@@ -104,7 +104,9 @@ var TextInput = /*#__PURE__*/function (_Component) {
104
104
  (0, _createClass2.default)(TextInput, [{
105
105
  key: "componentDidMount",
106
106
  value: function componentDidMount() {
107
- this._input.getInputDOMNode().addEventListener('invalid', this._onInvalid);
107
+ var _this$_input, _this$_input$getInput;
108
+
109
+ (_this$_input = this._input) === null || _this$_input === void 0 ? void 0 : (_this$_input$getInput = _this$_input.getInputDOMNode()) === null || _this$_input$getInput === void 0 ? void 0 : _this$_input$getInput.addEventListener('invalid', this._onInvalid);
108
110
  }
109
111
  }, {
110
112
  key: "componentDidUpdate",
@@ -116,13 +118,17 @@ var TextInput = /*#__PURE__*/function (_Component) {
116
118
  }, {
117
119
  key: "componentWillUnmount",
118
120
  value: function componentWillUnmount() {
119
- this._input.getInputDOMNode().removeEventListener('invalid', this._onInvalid);
121
+ var _this$_input2, _this$_input2$getInpu;
122
+
123
+ (_this$_input2 = this._input) === null || _this$_input2 === void 0 ? void 0 : (_this$_input2$getInpu = _this$_input2.getInputDOMNode()) === null || _this$_input2$getInpu === void 0 ? void 0 : _this$_input2$getInpu.removeEventListener('invalid', this._onInvalid);
120
124
  }
121
125
  }, {
122
126
  key: "_checkFocus",
123
127
  value: function _checkFocus() {
124
128
  if (this.props.focus) {
125
- this._input.getInputDOMNode().focus();
129
+ var _this$_input3, _this$_input3$getInpu;
130
+
131
+ (_this$_input3 = this._input) === null || _this$_input3 === void 0 ? void 0 : (_this$_input3$getInpu = _this$_input3.getInputDOMNode()) === null || _this$_input3$getInpu === void 0 ? void 0 : _this$_input3$getInpu.focus();
126
132
  }
127
133
  }
128
134
  /**
@@ -135,7 +141,9 @@ var TextInput = /*#__PURE__*/function (_Component) {
135
141
  }, {
136
142
  key: "node",
137
143
  get: function get() {
138
- return this._input.getInputDOMNode();
144
+ var _this$_input4;
145
+
146
+ return (_this$_input4 = this._input) === null || _this$_input4 === void 0 ? void 0 : _this$_input4.getInputDOMNode();
139
147
  }
140
148
  }, {
141
149
  key: "render",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spothero/ui",
3
- "version": "14.8.1",
3
+ "version": "14.8.2",
4
4
  "description": "SpotHero's React component UI library.",
5
5
  "main": "v2/index.js",
6
6
  "module": "v2/index.js",
@@ -86,7 +86,7 @@ export default class AutoSuggestInput extends Component {
86
86
  componentDidMount() {
87
87
  const {suggestions} = this.props;
88
88
 
89
- this._input.node.addEventListener('invalid', this._onInvalid);
89
+ this._input?.node?.addEventListener('invalid', this._onInvalid);
90
90
 
91
91
  if (suggestions.length) {
92
92
  this._showSuggests();
@@ -102,7 +102,7 @@ export default class AutoSuggestInput extends Component {
102
102
 
103
103
  if (prevState.value !== value) {
104
104
  if (!value) {
105
- this._input.node.focus();
105
+ this._input?.node?.focus();
106
106
  }
107
107
  }
108
108
 
@@ -120,7 +120,7 @@ export default class AutoSuggestInput extends Component {
120
120
  }
121
121
 
122
122
  componentWillUnmount() {
123
- this._input.node.removeEventListener('invalid', this._onInvalid);
123
+ this._input?.node?.removeEventListener('invalid', this._onInvalid);
124
124
  }
125
125
 
126
126
  _onInvalid = evt => {
@@ -350,7 +350,7 @@ export default class AutoSuggestInput extends Component {
350
350
  * @returns {Element} - The input element.
351
351
  */
352
352
  get node() {
353
- return this._input.node;
353
+ return this._input?.node;
354
354
  }
355
355
 
356
356
  render() {
@@ -20,7 +20,7 @@ class AutoSuggestList extends PureComponent {
20
20
  /** The suggestion object which is currently active. */
21
21
  activeSuggestion: PropTypes.object,
22
22
  /** A custom element to display at the bottom of the suggestion list */
23
- suggestionBoxFooter: PropTypes.element,
23
+ suggestionBoxFooter: PropTypes.element.isRequired,
24
24
  /** Function to execute when a suggestion is selected. */
25
25
  onSuggestionSelect: PropTypes.func.isRequired,
26
26
  /** Optional function to execute for suggestion list item's mousedown event. */
@@ -24,7 +24,7 @@ export default class GooglePlacesSearchInput extends Component {
24
24
  /** Used to limit the suggestion results by lat/long bounds. */
25
25
  bounds: PropTypes.object,
26
26
  /** The `google maps` object for using the autocomplete service. */
27
- googleMaps: PropTypes.object,
27
+ googleMaps: PropTypes.object.isRequired,
28
28
  /** A custom element (typically a PoweredByGoogle component) to display at the bottom of the suggestion list. */
29
29
  poweredByGoogleFooter: PropTypes.element.isRequired,
30
30
  /** An object containing the bias options */
@@ -17,8 +17,8 @@ export default class TextInput extends Component {
17
17
 
18
18
  componentDidMount() {
19
19
  this._input
20
- .getInputDOMNode()
21
- .addEventListener('invalid', this._onInvalid);
20
+ ?.getInputDOMNode()
21
+ ?.addEventListener('invalid', this._onInvalid);
22
22
  }
23
23
 
24
24
  componentDidUpdate(prevProps, prevState) {
@@ -29,8 +29,8 @@ export default class TextInput extends Component {
29
29
 
30
30
  componentWillUnmount() {
31
31
  this._input
32
- .getInputDOMNode()
33
- .removeEventListener('invalid', this._onInvalid);
32
+ ?.getInputDOMNode()
33
+ ?.removeEventListener('invalid', this._onInvalid);
34
34
  }
35
35
 
36
36
  _onInvalid = evt => {
@@ -62,7 +62,7 @@ export default class TextInput extends Component {
62
62
 
63
63
  _checkFocus() {
64
64
  if (this.props.focus) {
65
- this._input.getInputDOMNode().focus();
65
+ this._input?.getInputDOMNode()?.focus();
66
66
  }
67
67
  }
68
68
 
@@ -73,7 +73,7 @@ export default class TextInput extends Component {
73
73
  * @returns {Element} - The input element.
74
74
  */
75
75
  get node() {
76
- return this._input.getInputDOMNode();
76
+ return this._input?.getInputDOMNode();
77
77
  }
78
78
 
79
79
  render() {