@danielgindi/selectbox 1.0.69 → 1.0.70

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.69
2
+ * @danielgindi/selectbox 1.0.70
3
3
  * git://github.com/danielgindi/selectbox.git
4
4
  */
5
5
  'use strict';
@@ -9681,6 +9681,7 @@ var inputBackbufferCssProps = [
9681
9681
  * @property {boolean|'touch'} [blurOnSingleSelection='touch']
9682
9682
  * @property {boolean} [multi=false] can multiple values be selected?
9683
9683
  * @property {boolean} [showSelection=true] show selection? if false, the placeholder will take effect
9684
+ * @property {boolean} [showPlaceholderInTooltip=false] show placeholder in title attribute
9684
9685
  * @property {function(items: DropList.ItemBase[]):string} [multiPlaceholderFormatter] formatter for placeholder for multi items mode
9685
9686
  * @property {boolean} [searchable=false] is it searchable?
9686
9687
  * @property {string} [noResultsText='No matching results'] text for no results (empty for none)
@@ -9724,6 +9725,7 @@ var defaultOptions = {
9724
9725
  blurOnSingleSelection: 'touch',
9725
9726
  multi: false,
9726
9727
  showSelection: true,
9728
+ showPlaceholderInTooltip: false,
9727
9729
  multiPlaceholderFormatter: null,
9728
9730
  searchable: true,
9729
9731
  noResultsText: 'No matching results',
@@ -9814,6 +9816,7 @@ var SelectBox = /*#__PURE__*/function () {
9814
9816
  blurOnSingleSelection: o.blurOnSingleSelection,
9815
9817
  multi: o.multi,
9816
9818
  showSelection: o.showSelection,
9819
+ showPlaceholderInTooltip: o.showPlaceholderInTooltip,
9817
9820
  multiPlaceholderFormatter: o.multiPlaceholderFormatter,
9818
9821
  searchable: o.searchable,
9819
9822
  noResultsText: o.noResultsText,
@@ -10415,7 +10418,7 @@ var SelectBox = /*#__PURE__*/function () {
10415
10418
  if (p.showSelection === showSelection)
10416
10419
  return this;
10417
10420
 
10418
- this._p.showSelection = showSelection;
10421
+ p.showSelection = showSelection;
10419
10422
  this._scheduleSync('full');
10420
10423
  return this;
10421
10424
  }
@@ -10427,6 +10430,28 @@ var SelectBox = /*#__PURE__*/function () {
10427
10430
  return this._p.showSelection;
10428
10431
  }
10429
10432
 
10433
+ /**
10434
+ * @param {boolean} showPlaceholderInTooltip
10435
+ * @returns {SelectBox}
10436
+ */ }, { key: "setShowPlaceholderInTooltip", value:
10437
+ function setShowPlaceholderInTooltip(showPlaceholderInTooltip) {
10438
+ var p = this._p;
10439
+ showPlaceholderInTooltip = !!showPlaceholderInTooltip;
10440
+ if (p.showPlaceholderInTooltip === showPlaceholderInTooltip)
10441
+ return this;
10442
+
10443
+ p.showPlaceholderInTooltip = showPlaceholderInTooltip;
10444
+ this._scheduleSync('full');
10445
+ return this;
10446
+ }
10447
+
10448
+ /**
10449
+ * @returns {boolean}
10450
+ */ }, { key: "isShowPlaceholderInTooltipEnabled", value:
10451
+ function isShowPlaceholderInTooltipEnabled() {
10452
+ return this._p.showPlaceholderInTooltip;
10453
+ }
10454
+
10430
10455
  /**
10431
10456
  * @param {function(items: DropList.ItemBase[]):string} formatter
10432
10457
  * @returns {SelectBox}
@@ -10437,7 +10462,7 @@ var SelectBox = /*#__PURE__*/function () {
10437
10462
  if (p.multiPlaceholderFormatter === formatter)
10438
10463
  return this;
10439
10464
 
10440
- this._p.multiPlaceholderFormatter = formatter;
10465
+ p.multiPlaceholderFormatter = formatter;
10441
10466
  this._scheduleSync('full');
10442
10467
  return this;
10443
10468
  }
@@ -10451,7 +10476,7 @@ var SelectBox = /*#__PURE__*/function () {
10451
10476
  if (p.blurOnSingleSelection === value)
10452
10477
  return this;
10453
10478
 
10454
- this._p.blurOnSingleSelection = value;
10479
+ p.blurOnSingleSelection = value;
10455
10480
  return this;
10456
10481
  }
10457
10482
 
@@ -12212,6 +12237,12 @@ var SelectBox = /*#__PURE__*/function () {
12212
12237
 
12213
12238
  // Set input placeholder
12214
12239
  p.input.setAttribute('placeholder', placeholder);
12240
+
12241
+ if (p.showPlaceholderInTooltip) {
12242
+ p.input.setAttribute('title', placeholder);
12243
+ } else {
12244
+ p.input.removeAttribute('title');
12245
+ }
12215
12246
  }
12216
12247
 
12217
12248
  /** @private */ }, { key: "_syncSingleItem", value: