@danielgindi/selectbox 1.0.49 → 1.0.50

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/dist/lib.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @danielgindi/selectbox 1.0.49
2
+ * @danielgindi/selectbox 1.0.50
3
3
  * git://github.com/danielgindi/selectbox.git
4
4
  */
5
5
  'use strict';
@@ -5634,14 +5634,14 @@ var hasOwnProperty = Object.prototype.hasOwnProperty;
5634
5634
 
5635
5635
  /**
5636
5636
  * @typedef {Object} DropList.PositionOptions
5637
- * @property {Element} [target] Target element to act as anchor
5638
- * @property {{left: number, top: number}} [targetOffset=undefined] Override the offset of target. Automatically calculated if unspecified.
5639
- * @property {number} [targetHeight=undefined] Override height of the target
5640
- * @property {number} [targetWidth=undefined] Override width of the target
5641
- * @property {DropList.PositionAnchor} [position=undefined]
5642
- * @property {DropList.PositionAnchor} [anchor=undefined]
5643
- * @property {boolean} [updateWidth=false] Should update the width of the menu according to target
5644
- * @property {string} [targetRtl=undefined] Override for rtl mode of the target
5637
+ * @property {Element?} [target] Target element to act as anchor
5638
+ * @property {{left: number, top: number}?} [targetOffset] Override the offset of target. Automatically calculated if unspecified.
5639
+ * @property {number?} [targetHeight] Override height of the target
5640
+ * @property {number?} [targetWidth] Override width of the target
5641
+ * @property {DropList.PositionAnchor?} [position]
5642
+ * @property {DropList.PositionAnchor?} [anchor]
5643
+ * @property {boolean|number?} [updateWidth=false] `true` to set width of the menu according to `target`'s width, or specify an arbitrary number.
5644
+ * @property {string?} [targetRtl] Override for rtl mode of the target
5645
5645
  * @property {{x: number, y: number}} [offset=undefined] Extra rtl-aware offset to the target
5646
5646
  * */
5647
5647
  /** */
@@ -6362,7 +6362,7 @@ var DropList = /*#__PURE__*/function () {
6362
6362
  }
6363
6363
 
6364
6364
  // Now set the width of the dropdown
6365
- if (positionOptions.updateWidth) {
6365
+ if (positionOptions.updateWidth || typeof positionOptions.updateWidth === 'number') {
6366
6366
  this._updateWidth(positionOptions);
6367
6367
  }
6368
6368
 
@@ -7720,9 +7720,14 @@ var DropList = /*#__PURE__*/function () {
7720
7720
  var targetWidth = 0;
7721
7721
 
7722
7722
  if (positionOptions) {
7723
- // Measure target
7724
- targetWidth = positionOptions.targetWidth;
7725
- if (targetWidth == null) {
7723
+ if (typeof positionOptions.updateWidth === 'number') {
7724
+ // Set from width specified
7725
+ targetWidth = positionOptions.updateWidth;
7726
+ } else if (positionOptions.targetWidth != null) {
7727
+ // Set from simulated target width
7728
+ targetWidth = positionOptions.updateWidth;
7729
+ } else {
7730
+ // Measure target
7726
7731
  targetWidth = Css.getElementWidth(positionOptions.target, true, true);
7727
7732
  }
7728
7733
  }