vue3-extended-multiselect 2.3.0 → 2.3.2
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.
|
@@ -341,12 +341,12 @@ const _hoisted_2$e = /*#__PURE__*/createElementVNode("g", null, [
|
|
|
341
341
|
/*#__PURE__*/createElementVNode("path", { d: "M96.1,103.6c-10.4,8.4-23.5,12.4-36.8,11.1c-10.5-1-20.3-5.1-28.2-11.8H44v-8H18v26h8v-11.9c9.1,7.7,20.4,12.5,32.6,13.6 c1.9,0.2,3.7,0.3,5.5,0.3c13.5,0,26.5-4.6,37-13.2c19.1-15.4,26.6-40.5,19.1-63.9l-7.6,2.4C119,68.6,112.6,90.3,96.1,103.6z" }),
|
|
342
342
|
/*#__PURE__*/createElementVNode("path", { d: "M103,19.7c-21.2-18.7-53.5-20-76.1-1.6C7.9,33.5,0.4,58.4,7.7,81.7l7.6-2.4C9,59.2,15.5,37.6,31.9,24.4 C51.6,8.4,79.7,9.6,98,26H85v8h26V8h-8V19.7z" })
|
|
343
343
|
], -1 /* HOISTED */);
|
|
344
|
-
const _hoisted_3$
|
|
344
|
+
const _hoisted_3$8 = [
|
|
345
345
|
_hoisted_2$e
|
|
346
346
|
];
|
|
347
347
|
|
|
348
348
|
function render$8(_ctx, _cache) {
|
|
349
|
-
return (openBlock(), createElementBlock("svg", _hoisted_1$f, [..._hoisted_3$
|
|
349
|
+
return (openBlock(), createElementBlock("svg", _hoisted_1$f, [..._hoisted_3$8]))
|
|
350
350
|
}
|
|
351
351
|
|
|
352
352
|
const script$f = {};
|
|
@@ -762,6 +762,7 @@ const _hoisted_2$b = {
|
|
|
762
762
|
key: 0,
|
|
763
763
|
class: "extended__multiselect-placeholder"
|
|
764
764
|
};
|
|
765
|
+
const _hoisted_3$7 = ["onClick"];
|
|
765
766
|
|
|
766
767
|
|
|
767
768
|
var script$b = {
|
|
@@ -1107,20 +1108,20 @@ return (_ctx, _cache) => {
|
|
|
1107
1108
|
}, [
|
|
1108
1109
|
createElementVNode("span", null, toDisplayString(unref(optionCreateLabel)(option)), 1 /* TEXT */),
|
|
1109
1110
|
createElementVNode("div", {
|
|
1110
|
-
class: normalizeClass(deselectClasses.value)
|
|
1111
|
+
class: normalizeClass(deselectClasses.value),
|
|
1112
|
+
onClick: withModifiers($event => (deselectBlock(index)), ["stop"])
|
|
1111
1113
|
}, [
|
|
1112
1114
|
(!showLoaderIcon.value)
|
|
1113
1115
|
? (openBlock(), createBlock(script$d, {
|
|
1114
1116
|
key: 0,
|
|
1115
|
-
class: "extended__multiselect_deselect-block-icon"
|
|
1116
|
-
|
|
1117
|
-
}, null, 8 /* PROPS */, ["onClick"]))
|
|
1117
|
+
class: "extended__multiselect_deselect-block-icon"
|
|
1118
|
+
}))
|
|
1118
1119
|
: (openBlock(), createBlock(script$e, {
|
|
1119
1120
|
key: 1,
|
|
1120
1121
|
"icon-filter": __props.iconFilter,
|
|
1121
1122
|
"icon-size": "deselect"
|
|
1122
1123
|
}, null, 8 /* PROPS */, ["icon-filter"]))
|
|
1123
|
-
],
|
|
1124
|
+
], 10 /* CLASS, PROPS */, _hoisted_3$7)
|
|
1124
1125
|
], 2 /* CLASS */)
|
|
1125
1126
|
])
|
|
1126
1127
|
]))
|
|
@@ -1480,6 +1481,18 @@ const appropriatePlaceholder = computed(() => {
|
|
|
1480
1481
|
return createOnTheGo.value ? createOptionPlaceholder.value : placeholder.value;
|
|
1481
1482
|
});
|
|
1482
1483
|
|
|
1484
|
+
/**
|
|
1485
|
+
* Determines whether to show placeholder block
|
|
1486
|
+
* if search field is hidden
|
|
1487
|
+
* @function
|
|
1488
|
+
* @returns {boolean} display
|
|
1489
|
+
*/
|
|
1490
|
+
const hintBlockShown = computed(() => {
|
|
1491
|
+
if (selectedOptions.value.length) return false;
|
|
1492
|
+
|
|
1493
|
+
return true;
|
|
1494
|
+
});
|
|
1495
|
+
|
|
1483
1496
|
/**
|
|
1484
1497
|
* Sets "margin-top" css property to multiple option blocks
|
|
1485
1498
|
* if search field is shown
|
|
@@ -1496,7 +1509,7 @@ const multipleBlocksMargin = computed(() => {
|
|
|
1496
1509
|
* @returns {boolean} display
|
|
1497
1510
|
*/
|
|
1498
1511
|
const placeholderBlockShown = computed(() => {
|
|
1499
|
-
if (selectedOptions.value.length) return false;
|
|
1512
|
+
if (selectedOptions.value.length || searchFieldForwarding.value) return false;
|
|
1500
1513
|
|
|
1501
1514
|
return true;
|
|
1502
1515
|
});
|
|
@@ -1573,7 +1586,7 @@ watch(searchValue, (value) => {
|
|
|
1573
1586
|
* @function
|
|
1574
1587
|
* @emits extended:expand-options
|
|
1575
1588
|
*/
|
|
1576
|
-
const expand = () => {
|
|
1589
|
+
const expand = (event) => {
|
|
1577
1590
|
if (disabled.value) return;
|
|
1578
1591
|
|
|
1579
1592
|
searchFieldFocused.value = true;
|
|
@@ -1880,7 +1893,7 @@ return (_ctx, _cache) => {
|
|
|
1880
1893
|
}, null, 544 /* NEED_HYDRATION, NEED_PATCH */)
|
|
1881
1894
|
]))
|
|
1882
1895
|
: (openBlock(), createElementBlock("div", _hoisted_5$3, [
|
|
1883
|
-
(
|
|
1896
|
+
(hintBlockShown.value)
|
|
1884
1897
|
? (openBlock(), createElementBlock("span", _hoisted_6$3, toDisplayString(appropriatePlaceholder.value), 1 /* TEXT */))
|
|
1885
1898
|
: createCommentVNode("v-if", true),
|
|
1886
1899
|
renderSlot(_ctx.$slots, "labelBlock", { labelBlockValue: singleLabel.value }, () => [
|
|
@@ -3628,7 +3641,7 @@ const _hoisted_3 = { class: "extended__multiselect-cancel_wrapper" };
|
|
|
3628
3641
|
|
|
3629
3642
|
/**
|
|
3630
3643
|
* @author Ridiger Daniil Dmitrievich, 2022
|
|
3631
|
-
* @version 2.3.
|
|
3644
|
+
* @version 2.3.2
|
|
3632
3645
|
*/
|
|
3633
3646
|
|
|
3634
3647
|
var script = {
|
|
@@ -4299,6 +4312,7 @@ const togglePattern = /^extended__multiselect-toggle_wrapper/i;
|
|
|
4299
4312
|
const extendedMultiselect = ref(null);
|
|
4300
4313
|
const extendedMultiselectToggle = ref(null);
|
|
4301
4314
|
const extendedMultiselectWrapper = ref(null);
|
|
4315
|
+
const extendedMultiselectOptions = ref(null);
|
|
4302
4316
|
|
|
4303
4317
|
const {
|
|
4304
4318
|
defaultExpanded,
|
|
@@ -4848,15 +4862,17 @@ const setPreselectedOptionsByConditions = () => {
|
|
|
4848
4862
|
* @returns {string} position
|
|
4849
4863
|
*/
|
|
4850
4864
|
const toggleAppearanceRestrictor = () => {
|
|
4851
|
-
if (!window) return "under";
|
|
4865
|
+
if (!window || !extendedMultiselectOptions.value.$el) return "under";
|
|
4852
4866
|
|
|
4853
4867
|
const innerHeight = window.innerHeight;
|
|
4868
|
+
const offsetHeight = extendedMultiselectOptions.value.$el.offsetHeight
|
|
4869
|
+
+ extendedMultiselect.value.offsetHeight;
|
|
4854
4870
|
const offsetTop = extendedMultiselect.value
|
|
4855
4871
|
? extendedMultiselect.value.getBoundingClientRect().y
|
|
4856
4872
|
: 0;
|
|
4857
4873
|
const difference = innerHeight - offsetTop;
|
|
4858
4874
|
|
|
4859
|
-
if (difference >
|
|
4875
|
+
if (difference > offsetHeight) {
|
|
4860
4876
|
return "under";
|
|
4861
4877
|
} else {
|
|
4862
4878
|
return "atop";
|
|
@@ -4868,7 +4884,7 @@ const toggleAppearanceRestrictor = () => {
|
|
|
4868
4884
|
* @function
|
|
4869
4885
|
*/
|
|
4870
4886
|
const toggleAppearanceRestrictorActivate = () => {
|
|
4871
|
-
if (
|
|
4887
|
+
if (dropdownActive.value) {
|
|
4872
4888
|
chosenToggleAppearanceSide.value = toggleAppearanceSide.value !== "auto"
|
|
4873
4889
|
? toggleAppearanceSide.value
|
|
4874
4890
|
: toggleAppearanceRestrictor();
|
|
@@ -4988,15 +5004,17 @@ const toggleDetector = (mouseEvent, pattern, mode) => {
|
|
|
4988
5004
|
const toggleOptions = () => {
|
|
4989
5005
|
if (internalLoading.value || disabled.value || dropdownDisabled.value) return;
|
|
4990
5006
|
|
|
4991
|
-
|
|
5007
|
+
dropdownActive.value = !dropdownActive.value;
|
|
5008
|
+
|
|
5009
|
+
nextTick(() => {
|
|
5010
|
+
toggleAppearanceRestrictorActivate();
|
|
5011
|
+
});
|
|
4992
5012
|
|
|
4993
5013
|
if (!dropdownActive.value) {
|
|
4994
5014
|
activeEmitter();
|
|
4995
5015
|
} else {
|
|
4996
5016
|
closeEmitter();
|
|
4997
5017
|
}
|
|
4998
|
-
|
|
4999
|
-
dropdownActive.value = !dropdownActive.value;
|
|
5000
5018
|
};
|
|
5001
5019
|
|
|
5002
5020
|
/**
|
|
@@ -5263,15 +5281,21 @@ onMounted(() => {
|
|
|
5263
5281
|
&& typeof options.value !== "function"
|
|
5264
5282
|
) {
|
|
5265
5283
|
dropdownActive.value = true;
|
|
5284
|
+
|
|
5285
|
+
nextTick(() => {
|
|
5286
|
+
toggleAppearanceRestrictorActivate();
|
|
5287
|
+
});
|
|
5266
5288
|
}
|
|
5267
5289
|
|
|
5268
5290
|
emitter.value.on("extended:expand-options", () => {
|
|
5269
5291
|
if (dropdownActive.value || dropdownDisabled.value) return;
|
|
5270
|
-
|
|
5271
|
-
toggleAppearanceRestrictorActivate();
|
|
5272
|
-
activeEmitter();
|
|
5273
|
-
|
|
5292
|
+
|
|
5274
5293
|
dropdownActive.value = true;
|
|
5294
|
+
|
|
5295
|
+
nextTick(() => {
|
|
5296
|
+
toggleAppearanceRestrictorActivate();
|
|
5297
|
+
});
|
|
5298
|
+
activeEmitter();
|
|
5275
5299
|
});
|
|
5276
5300
|
|
|
5277
5301
|
emitter.value.on("extended:loader-pattern-changed", async (pattern) => {
|
|
@@ -5451,6 +5475,8 @@ return (_ctx, _cache) => {
|
|
|
5451
5475
|
(dropdownActive.value)
|
|
5452
5476
|
? (openBlock(), createBlock(script$9, {
|
|
5453
5477
|
key: 0,
|
|
5478
|
+
ref_key: "extendedMultiselectOptions",
|
|
5479
|
+
ref: extendedMultiselectOptions,
|
|
5454
5480
|
"auto-select-created-option": __props.autoSelectCreatedOption,
|
|
5455
5481
|
"clear-by-select-when-multiple": __props.clearBySelectWhenMultiple,
|
|
5456
5482
|
"create-on-the-go": __props.createOnTheGo,
|