@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.cjs.js +23 -23
- package/dist/lib.cjs.js.map +1 -1
- package/dist/lib.cjs.min.js +2 -2
- package/dist/lib.cjs.min.js.map +1 -1
- package/dist/lib.es6.js +23 -23
- package/dist/lib.es6.js.map +1 -1
- package/dist/lib.es6.min.js +2 -2
- package/dist/lib.es6.min.js.map +1 -1
- package/dist/lib.umd.js +23 -23
- package/dist/lib.umd.js.map +1 -1
- package/dist/lib.umd.min.js +2 -2
- package/dist/lib.umd.min.js.map +1 -1
- package/lib/SelectBox.js +22 -22
- package/package.json +1 -1
- package/vue/SelectBox.vue +14 -5
package/dist/lib.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @danielgindi/selectbox 2.0.
|
|
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} [
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
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}
|
|
10335
|
+
* @param {boolean=true} readOnly Should the control be read only?
|
|
10336
10336
|
* @returns {SelectBox}
|
|
10337
10337
|
*/
|
|
10338
|
-
setReadOnly(
|
|
10338
|
+
setReadOnly(readOnly) {
|
|
10339
10339
|
const p = this._p;
|
|
10340
10340
|
|
|
10341
|
-
if (
|
|
10342
|
-
|
|
10341
|
+
if (readOnly === undefined) {
|
|
10342
|
+
readOnly = true;
|
|
10343
10343
|
}
|
|
10344
|
-
p.
|
|
10345
|
-
p.el.setAttribute('aria-
|
|
10346
|
-
p.input.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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 =
|
|
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.
|
|
13059
|
+
if (p.disabled || p.readOnly) return;
|
|
13060
13060
|
|
|
13061
13061
|
const isRtl = getComputedStyle(p.el).direction === 'rtl';
|
|
13062
13062
|
|