wini-web-components 1.3.2 → 1.3.3

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.
@@ -233,19 +233,21 @@ var Select1 = /** @class */ (function (_super) {
233
233
  };
234
234
  Select1.prototype.componentDidUpdate = function (prevProps, prevState) {
235
235
  var _this = this;
236
- var _a, _b, _c, _d, _e, _f, _g, _h;
236
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
237
237
  if (prevProps.options !== this.props.options) {
238
238
  this.setState(__assign(__assign({}, this.state), { options: this.props.options }));
239
239
  if (this.inputRef.current)
240
240
  this.inputRef.current.value = "".concat((_b = (_a = this.props.options.find(function (e) { return e.id === _this.state.value; })) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : "");
241
241
  }
242
- if (prevProps.value !== this.props.value)
242
+ if (prevProps.value !== this.props.value && this.inputRef.current) {
243
243
  this.setState(__assign(__assign({}, this.state), { value: this.props.value }));
244
- if (prevState.value !== this.state.value && this.inputRef.current)
245
244
  this.inputRef.current.value = "".concat((_d = (_c = this.state.options.find(function (e) { return e.id === _this.state.value; })) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : "");
245
+ }
246
+ if (prevState.value !== this.state.value && this.inputRef.current)
247
+ this.inputRef.current.value = "".concat((_f = (_e = this.state.options.find(function (e) { return e.id === _this.state.value; })) === null || _e === void 0 ? void 0 : _e.name) !== null && _f !== void 0 ? _f : "");
246
248
  //
247
249
  if (this.state.isOpen && prevState.isOpen !== this.state.isOpen) {
248
- var thisPopupRect = (_e = document.body.querySelector('.select1-popup')) === null || _e === void 0 ? void 0 : _e.getBoundingClientRect();
250
+ var thisPopupRect = (_g = document.body.querySelector('.select1-popup')) === null || _g === void 0 ? void 0 : _g.getBoundingClientRect();
249
251
  if (thisPopupRect) {
250
252
  var style = void 0;
251
253
  if (thisPopupRect.right > document.body.offsetWidth) {
@@ -255,15 +257,15 @@ var Select1 = /** @class */ (function (_super) {
255
257
  };
256
258
  }
257
259
  var _bottom = thisPopupRect.bottom - 8;
258
- var thisContainerRect = (_f = this.containerRef.current) === null || _f === void 0 ? void 0 : _f.getBoundingClientRect();
260
+ var thisContainerRect = (_h = this.containerRef.current) === null || _h === void 0 ? void 0 : _h.getBoundingClientRect();
259
261
  if (thisContainerRect) {
260
262
  if (_bottom > document.body.offsetHeight) {
261
263
  style = __assign(__assign({}, (style !== null && style !== void 0 ? style : {})), { top: "".concat(thisContainerRect.y - 2 - thisPopupRect.height, "px") });
262
264
  }
263
265
  }
264
266
  if (style) {
265
- (_g = style.left) !== null && _g !== void 0 ? _g : (style.left = style.right ? undefined : "".concat(this.state.offset.x, "px"));
266
- (_h = style.width) !== null && _h !== void 0 ? _h : (style.width = "".concat(this.state.offset.width, "px"));
267
+ (_j = style.left) !== null && _j !== void 0 ? _j : (style.left = style.right ? undefined : "".concat(this.state.offset.x, "px"));
268
+ (_k = style.width) !== null && _k !== void 0 ? _k : (style.width = "".concat(this.state.offset.width, "px"));
267
269
  this.setState(__assign(__assign({}, this.state), { style: style }));
268
270
  }
269
271
  }