@danielgindi/selectbox 2.0.28 → 2.0.30

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.umd.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @danielgindi/selectbox 2.0.28
2
+ * @danielgindi/selectbox 2.0.30
3
3
  * git://github.com/danielgindi/selectbox.git
4
4
  */
5
5
  (function (global, factory) {
@@ -9875,7 +9875,7 @@
9875
9875
  * @property {string|string[]} [additionalClasses]
9876
9876
  * @property {'ltr'|'rtl'|'auto'} [direction='auto']
9877
9877
  * @property {boolean} [disabled=false] Should start as disabled?
9878
- * @property {boolean} [readonly=false] Should start as readonly?
9878
+ * @property {boolean} [readOnly=false] Should start as readOnly?
9879
9879
  * @property {boolean} [clearable=true] Has clear button?
9880
9880
  * @property {boolean} [hasOpenIndicator=true] has open/close indicator?
9881
9881
  * @property {string} [placeholder=''] Placeholder text
@@ -9921,7 +9921,7 @@
9921
9921
  el: null,
9922
9922
  baseClassName: 'selectbox',
9923
9923
  disabled: false,
9924
- readonly: false,
9924
+ readOnly: false,
9925
9925
  clearable: true,
9926
9926
  hasOpenIndicator: true,
9927
9927
  placeholder: '',
@@ -10020,7 +10020,7 @@
10020
10020
  listOptions: o.listOptions,
10021
10021
 
10022
10022
  disabled: !!o.disabled,
10023
- readonly: !!o.readonly,
10023
+ readOnly: !!o.readOnly,
10024
10024
  clearable: !!o.clearable,
10025
10025
  hasOpenIndicator: !!o.hasOpenIndicator,
10026
10026
  placeholder: o.placeholder,
@@ -10103,7 +10103,7 @@
10103
10103
  p.multiItemEls = [];
10104
10104
 
10105
10105
  this.enable(!p.disabled);
10106
- this.setReadOnly(!p.readonly);
10106
+ this.setReadOnly(!p.readOnly);
10107
10107
 
10108
10108
  this._setupDropdownMenu();
10109
10109
 
@@ -10332,18 +10332,18 @@
10332
10332
 
10333
10333
  /**
10334
10334
  * Sets read only mode
10335
- * @param {boolean=true} readonly Should the control be read only?
10335
+ * @param {boolean=true} readOnly Should the control be read only?
10336
10336
  * @returns {SelectBox}
10337
10337
  */
10338
- setReadOnly(readonly) {
10338
+ setReadOnly(readOnly) {
10339
10339
  const p = this._p;
10340
10340
 
10341
- if (readonly === undefined) {
10342
- readonly = true;
10341
+ if (readOnly === undefined) {
10342
+ readOnly = true;
10343
10343
  }
10344
- p.readonly = !readonly;
10345
- p.el.setAttribute('aria-readonly', p.readonly.toString());
10346
- p.input.readonly = !!p.readonly;
10344
+ p.readOnly = readOnly;
10345
+ p.el.setAttribute('aria-readOnly', p.readOnly.toString());
10346
+ p.input.readOnly = !(p.searchable || p.multi) || !!p.readOnly;
10347
10347
 
10348
10348
  return this;
10349
10349
  }
@@ -10353,7 +10353,7 @@
10353
10353
  * @returns {boolean}
10354
10354
  */
10355
10355
  isReadOnly() {
10356
- return !this._p.readonly;
10356
+ return !this._p.readOnly;
10357
10357
  }
10358
10358
 
10359
10359
  /**
@@ -11483,7 +11483,7 @@
11483
11483
  spellcheck: 'false',
11484
11484
  role: 'textbox',
11485
11485
  'aria-autocomplete': 'list',
11486
- readOnly: !(p.searchable || p.multi)
11486
+ readOnly: !(p.searchable || p.multi) || !!p.readOnly
11487
11487
  })
11488
11488
  );
11489
11489
  }
@@ -11517,7 +11517,7 @@
11517
11517
  if (!Dom.closestUntil(evt.target, ".".concat(p.baseClassName, "__item_remove"), evt.currentTarget))
11518
11518
  return;
11519
11519
 
11520
- if (p.disabled || p.readonly) return;
11520
+ if (p.disabled || p.readOnly) return;
11521
11521
 
11522
11522
  this._removeMultiItemFromEvent(
11523
11523
  /**@type Element*/
@@ -11885,7 +11885,7 @@
11885
11885
 
11886
11886
  setTimeout(() => {
11887
11887
  if (this[DestroyedSymbol]) return; // destroyed by event handler
11888
- if (p.disabled || p.readonly) return;
11888
+ if (p.disabled || p.readOnly) return;
11889
11889
 
11890
11890
  this._trigger('search:blur');
11891
11891
 
@@ -12029,7 +12029,7 @@
12029
12029
  !p.multi &&
12030
12030
  !dropList.hasFocusedItem() &&
12031
12031
  !p.disabled &&
12032
- !p.readonly)
12032
+ !p.readOnly)
12033
12033
  {
12034
12034
  this.toggleList();
12035
12035
  evt.preventDefault();
@@ -12041,20 +12041,20 @@
12041
12041
  if (p.input) {
12042
12042
  p.sink.
12043
12043
  add(p.input, 'input.dropdown', () => {var _p$dropList9;
12044
- if (p.disabled || p.readonly) return;
12044
+ if (p.disabled || p.readOnly) return;
12045
12045
 
12046
12046
  p.filterTerm = p.input.value.trim();
12047
12047
  (_p$dropList9 = p.dropList) === null || _p$dropList9 === void 0 || _p$dropList9.setSearchTerm(p.filterTerm, true);
12048
12048
  }).
12049
12049
  add(p.input, 'click.dropdown', () => {
12050
- if (p.disabled || p.readonly) return;
12050
+ if (p.disabled || p.readOnly) return;
12051
12051
 
12052
12052
  if (!p.multi && p.searchable) {
12053
12053
  this.openList();
12054
12054
  }
12055
12055
  }).
12056
12056
  add(p.input, 'focus.dropdown', () => {
12057
- if (p.disabled || p.readonly) return;
12057
+ if (p.disabled || p.readOnly) return;
12058
12058
 
12059
12059
  this._trigger('search:focus');
12060
12060
 
@@ -12071,7 +12071,7 @@
12071
12071
 
12072
12072
  p.sink.
12073
12073
  add(p.el, 'mousedown.dropdown', () => {
12074
- if (!p.multi && !p.searchable && !avoidToggleFromClick && !p.disabled && !p.readonly) {
12074
+ if (!p.multi && !p.searchable && !avoidToggleFromClick && !p.disabled && !p.readOnly) {
12075
12075
  this.toggleList();
12076
12076
  }
12077
12077
  avoidToggleFromClick = false;
@@ -12674,7 +12674,7 @@
12674
12674
  if (p.input) p.input.readOnly = false;
12675
12675
  p.el.classList.add("".concat(p.baseClassName, "__searchable"));
12676
12676
  } else {
12677
- if (p.input) p.input.readOnly = true;
12677
+ if (p.input) p.input.readOnly = p.readOnly;
12678
12678
  p.el.classList.remove("".concat(p.baseClassName, "__searchable"));
12679
12679
  }
12680
12680
 
@@ -13056,7 +13056,7 @@
13056
13056
  _handleMultiKeydown(event) {
13057
13057
  const p = this._p;
13058
13058
 
13059
- if (p.disabled || p.readonly) return;
13059
+ if (p.disabled || p.readOnly) return;
13060
13060
 
13061
13061
  const isRtl = getComputedStyle(p.el).direction === 'rtl';
13062
13062