@danielgindi/selectbox 1.0.46 → 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 +63 -14
- 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 +63 -14
- 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 +63 -14
- 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/DropList.js +62 -13
- package/package.json +2 -1
- package/vue/DropList.vue +21 -0
- package/vue/SelectBox.vue +19 -2
package/dist/lib.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @danielgindi/selectbox 1.0.
|
|
2
|
+
* @danielgindi/selectbox 1.0.50
|
|
3
3
|
* git://github.com/danielgindi/selectbox.git
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
@@ -5628,14 +5628,14 @@
|
|
|
5628
5628
|
|
|
5629
5629
|
/**
|
|
5630
5630
|
* @typedef {Object} DropList.PositionOptions
|
|
5631
|
-
* @property {Element} [target] Target element to act as anchor
|
|
5632
|
-
* @property {{left: number, top: number}} [targetOffset
|
|
5633
|
-
* @property {number} [targetHeight
|
|
5634
|
-
* @property {number} [targetWidth
|
|
5635
|
-
* @property {DropList.PositionAnchor} [position
|
|
5636
|
-
* @property {DropList.PositionAnchor} [anchor
|
|
5637
|
-
* @property {boolean} [updateWidth=false]
|
|
5638
|
-
* @property {string} [targetRtl
|
|
5631
|
+
* @property {Element?} [target] Target element to act as anchor
|
|
5632
|
+
* @property {{left: number, top: number}?} [targetOffset] Override the offset of target. Automatically calculated if unspecified.
|
|
5633
|
+
* @property {number?} [targetHeight] Override height of the target
|
|
5634
|
+
* @property {number?} [targetWidth] Override width of the target
|
|
5635
|
+
* @property {DropList.PositionAnchor?} [position]
|
|
5636
|
+
* @property {DropList.PositionAnchor?} [anchor]
|
|
5637
|
+
* @property {boolean|number?} [updateWidth=false] `true` to set width of the menu according to `target`'s width, or specify an arbitrary number.
|
|
5638
|
+
* @property {string?} [targetRtl] Override for rtl mode of the target
|
|
5639
5639
|
* @property {{x: number, y: number}} [offset=undefined] Extra rtl-aware offset to the target
|
|
5640
5640
|
* */
|
|
5641
5641
|
/** */
|
|
@@ -5741,7 +5741,7 @@
|
|
|
5741
5741
|
var classes = [p.baseClassName];
|
|
5742
5742
|
|
|
5743
5743
|
if (p.additionalClasses) {
|
|
5744
|
-
classes = classes.concat((p.additionalClasses + '').split('').filter(function (x) {return x;}));
|
|
5744
|
+
classes = classes.concat((p.additionalClasses + '').split(' ').filter(function (x) {return x;}));
|
|
5745
5745
|
}
|
|
5746
5746
|
|
|
5747
5747
|
var initialCss = {
|
|
@@ -5944,6 +5944,50 @@
|
|
|
5944
5944
|
return this;
|
|
5945
5945
|
}
|
|
5946
5946
|
|
|
5947
|
+
/**
|
|
5948
|
+
*
|
|
5949
|
+
* @property {function(item: DropList.ItemBase, itemEl: Element):(*|false)} [fn] Function to call when rendering an item element
|
|
5950
|
+
* @returns {DropList}
|
|
5951
|
+
*/ }, { key: "setRenderItem", value:
|
|
5952
|
+
function setRenderItem(fn) {
|
|
5953
|
+
var p = this._p;
|
|
5954
|
+
p.renderItem = fn;
|
|
5955
|
+
return this;
|
|
5956
|
+
}
|
|
5957
|
+
|
|
5958
|
+
/**
|
|
5959
|
+
*
|
|
5960
|
+
* @property {function(item: DropList.ItemBase, itemEl: Element)} [fn] Function to call when rendering an item element
|
|
5961
|
+
* @returns {DropList}
|
|
5962
|
+
*/ }, { key: "setUnrenderItem", value:
|
|
5963
|
+
function setUnrenderItem(fn) {
|
|
5964
|
+
var p = this._p;
|
|
5965
|
+
|
|
5966
|
+
p.unrenderItem = fn;
|
|
5967
|
+
|
|
5968
|
+
if (typeof p.unrenderItem === 'function') {
|
|
5969
|
+
var _fn = p.unrenderItem;
|
|
5970
|
+
p.virtualListHelper.setOnItemUnrender(function (el) {
|
|
5971
|
+
try {
|
|
5972
|
+
_fn(el[ItemSymbol$1][ItemSymbol$1], el);
|
|
5973
|
+
} catch (err) {console.error(err);} // eslint-disable-line no-console
|
|
5974
|
+
delete el[ItemSymbol$1];
|
|
5975
|
+
|
|
5976
|
+
if (p.focusItemEl === el)
|
|
5977
|
+
p.focusItemEl = null;
|
|
5978
|
+
});
|
|
5979
|
+
} else {
|
|
5980
|
+
p.virtualListHelper.setOnItemUnrender(function (el) {
|
|
5981
|
+
delete el[ItemSymbol$1];
|
|
5982
|
+
|
|
5983
|
+
if (p.focusItemEl === el)
|
|
5984
|
+
p.focusItemEl = null;
|
|
5985
|
+
});
|
|
5986
|
+
}
|
|
5987
|
+
|
|
5988
|
+
return this;
|
|
5989
|
+
}
|
|
5990
|
+
|
|
5947
5991
|
/**
|
|
5948
5992
|
* @param {string} prop
|
|
5949
5993
|
* @returns {DropList}
|
|
@@ -6312,7 +6356,7 @@
|
|
|
6312
6356
|
}
|
|
6313
6357
|
|
|
6314
6358
|
// Now set the width of the dropdown
|
|
6315
|
-
if (positionOptions.updateWidth) {
|
|
6359
|
+
if (positionOptions.updateWidth || typeof positionOptions.updateWidth === 'number') {
|
|
6316
6360
|
this._updateWidth(positionOptions);
|
|
6317
6361
|
}
|
|
6318
6362
|
|
|
@@ -7670,9 +7714,14 @@
|
|
|
7670
7714
|
var targetWidth = 0;
|
|
7671
7715
|
|
|
7672
7716
|
if (positionOptions) {
|
|
7673
|
-
|
|
7674
|
-
|
|
7675
|
-
|
|
7717
|
+
if (typeof positionOptions.updateWidth === 'number') {
|
|
7718
|
+
// Set from width specified
|
|
7719
|
+
targetWidth = positionOptions.updateWidth;
|
|
7720
|
+
} else if (positionOptions.targetWidth != null) {
|
|
7721
|
+
// Set from simulated target width
|
|
7722
|
+
targetWidth = positionOptions.updateWidth;
|
|
7723
|
+
} else {
|
|
7724
|
+
// Measure target
|
|
7676
7725
|
targetWidth = Css.getElementWidth(positionOptions.target, true, true);
|
|
7677
7726
|
}
|
|
7678
7727
|
}
|