@danielgindi/selectbox 2.0.15 → 2.0.17
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/css/selectbox.css +1 -1
- package/css/selectbox.css.map +1 -1
- package/dist/lib.cjs.js +8 -43
- 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 +7 -42
- 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 +8 -43
- 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 +6 -41
- package/package.json +5 -3
- package/scss/selectbox.scss +129 -128
- package/vite.config.js +9 -0
- package/vue/SelectBox.vue +13 -2
package/dist/lib.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @danielgindi/selectbox 2.0.
|
|
2
|
+
* @danielgindi/selectbox 2.0.17
|
|
3
3
|
* git://github.com/danielgindi/selectbox.git
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
@@ -9884,7 +9884,7 @@
|
|
|
9884
9884
|
* @property {boolean} [treatGroupSelectionAsItems=false] Treat group items as normal items
|
|
9885
9885
|
* @property {*[]} [stickyValues]
|
|
9886
9886
|
* @property {function(a: DropList.ItemBase, b: DropList.ItemBase):number} [sortItemComparator]
|
|
9887
|
-
* @property {boolean} [splitListCheckedGroups=true] Split groups to "checked" and "unchecked", works with `
|
|
9887
|
+
* @property {boolean} [splitListCheckedGroups=true] Split groups to "checked" and "unchecked", works with `sortListCheckedFirst` only
|
|
9888
9888
|
* @property {boolean|'touch'} [blurOnSingleSelection='touch']
|
|
9889
9889
|
* @property {boolean} [multi=false] can multiple values be selected?
|
|
9890
9890
|
* @property {boolean} [showSelection=true] show selection? if false, the placeholder will take effect
|
|
@@ -9904,8 +9904,6 @@
|
|
|
9904
9904
|
* @property {function(item: DropList.ItemBase, itemEl: Element)} [unrenderMultiItem]
|
|
9905
9905
|
* @property {function(item: DropList.ItemBase, itemEl: Element):(*|false)} [renderRestMultiItem]
|
|
9906
9906
|
* @property {function(item: DropList.ItemBase, itemEl: Element)} [unrenderRestMultiItem]
|
|
9907
|
-
* @property {function(item: DropList.ItemBase, itemEl: Element):(*|false)} [renderNoResultsItem]
|
|
9908
|
-
* @property {function(item: DropList.ItemBase, itemEl: Element)} [unrenderNoResultsItem]
|
|
9909
9907
|
* @property {boolean} [searchable=false] is it searchable?
|
|
9910
9908
|
* @property {string} [noResultsText='No matching results'] text for no results (empty for none)
|
|
9911
9909
|
* @property {boolean} [autoSelectTextOnCheck=true] automatically select text in input when an item is checked (multi mode). Used to allow the user to quickly type multiple items.
|
|
@@ -10050,8 +10048,7 @@
|
|
|
10050
10048
|
unrenderMultiItem: o.unrenderMultiItem,
|
|
10051
10049
|
renderRestMultiItem: o.renderRestMultiItem,
|
|
10052
10050
|
unrenderRestMultiItem: o.unrenderRestMultiItem,
|
|
10053
|
-
|
|
10054
|
-
unrenderNoResultsItem: o.unrenderNoResultsItem,
|
|
10051
|
+
|
|
10055
10052
|
on: o.on || null,
|
|
10056
10053
|
silenceEvents: true,
|
|
10057
10054
|
mitt: mitt(),
|
|
@@ -10551,10 +10548,10 @@
|
|
|
10551
10548
|
setSortListCheckedFirst(sortListCheckedFirst) {
|
|
10552
10549
|
const p = this._p;
|
|
10553
10550
|
sortListCheckedFirst = !!sortListCheckedFirst;
|
|
10554
|
-
if (p.
|
|
10551
|
+
if (p.sortListCheckedFirst === sortListCheckedFirst)
|
|
10555
10552
|
return this;
|
|
10556
10553
|
|
|
10557
|
-
p.
|
|
10554
|
+
p.sortListCheckedFirst = sortListCheckedFirst;
|
|
10558
10555
|
p.itemsChanged = true;
|
|
10559
10556
|
this._scheduleSync('render_list');
|
|
10560
10557
|
return this;
|
|
@@ -10912,18 +10909,6 @@
|
|
|
10912
10909
|
return this;
|
|
10913
10910
|
}
|
|
10914
10911
|
|
|
10915
|
-
/**
|
|
10916
|
-
* @param {(function(item: DropList.ItemBase, itemEl: Element):(*|false))|null} render
|
|
10917
|
-
* @param {(function(item: DropList.ItemBase, itemEl: Element))|null} unrender
|
|
10918
|
-
* @returns {SelectBox}
|
|
10919
|
-
*/
|
|
10920
|
-
setRenderNoResultsItem(render, unrender) {
|
|
10921
|
-
const p = this._p;
|
|
10922
|
-
p.renderNoResultsItem = render;
|
|
10923
|
-
p.unrenderNoResultsItem = unrender;
|
|
10924
|
-
return this;
|
|
10925
|
-
}
|
|
10926
|
-
|
|
10927
10912
|
/**
|
|
10928
10913
|
* @param {string} prop
|
|
10929
10914
|
* @returns {SelectBox}
|
|
@@ -11619,38 +11604,18 @@
|
|
|
11619
11604
|
p.resortBySelectionNeeded = true;
|
|
11620
11605
|
}
|
|
11621
11606
|
|
|
11622
|
-
const renderNoResultsItem = p.renderNoResultsItem;
|
|
11623
|
-
const unrenderNoResultsItem = p.unrenderNoResultsItem;
|
|
11624
|
-
const customRenderItem = (p.listOptions || {}).renderItem;
|
|
11625
|
-
const customUnrenderItem = (p.listOptions || {}).unrenderItem;
|
|
11626
|
-
|
|
11627
|
-
const renderItem = renderNoResultsItem || customRenderItem ? (item, itemEl) => {
|
|
11628
|
-
if (customRenderItem)
|
|
11629
|
-
return customRenderItem(item, itemEl);
|
|
11630
|
-
return false;
|
|
11631
|
-
} : null;
|
|
11632
|
-
|
|
11633
|
-
const unrenderItem = unrenderNoResultsItem || customRenderItem ? (item, itemEl) => {
|
|
11634
|
-
if (customUnrenderItem)
|
|
11635
|
-
return customUnrenderItem(item, itemEl);
|
|
11636
|
-
return false;
|
|
11637
|
-
} : null;
|
|
11638
|
-
|
|
11639
11607
|
const dropList = p.dropList = new DropList(_objectSpread2(_objectSpread2({
|
|
11640
|
-
virtualMinItems: 10
|
|
11608
|
+
virtualMinItems: 10,
|
|
11641
11609
|
|
|
11610
|
+
searchable: false },
|
|
11642
11611
|
p.listOptions), {}, {
|
|
11643
11612
|
|
|
11644
|
-
renderItem: renderItem,
|
|
11645
|
-
unrenderItem: unrenderItem,
|
|
11646
|
-
|
|
11647
11613
|
multi: p.multi,
|
|
11648
11614
|
capturesFocus: false,
|
|
11649
11615
|
|
|
11650
11616
|
labelProp: p.labelProp,
|
|
11651
11617
|
valueProp: p.valueProp,
|
|
11652
11618
|
|
|
11653
|
-
searchable: false,
|
|
11654
11619
|
noResultsText: p.noResultsText,
|
|
11655
11620
|
filterThrottleWindow: p.filterThrottleWindow,
|
|
11656
11621
|
filterOnEmptyTerm: p.filterOnEmptyTerm,
|
|
@@ -12655,7 +12620,7 @@
|
|
|
12655
12620
|
DomCompat.toggleClass(p.el, "".concat(p.baseClassName, "__empty_selection"), p.selectedValues.length === 0);
|
|
12656
12621
|
DomCompat.toggleClass(p.el, "".concat(p.baseClassName, "__has_selection"), p.selectedValues.length > 0);
|
|
12657
12622
|
|
|
12658
|
-
if (p.searchable
|
|
12623
|
+
if (p.searchable) {
|
|
12659
12624
|
if (p.input) p.input.readOnly = false;
|
|
12660
12625
|
p.el.classList.add("".concat(p.baseClassName, "__searchable"));
|
|
12661
12626
|
} else {
|