@quoreadmin/ui 1.10.33 → 1.11.0
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/index.css +1 -1
- package/dist/index.js +29 -27
- package/dist/index10.js +2 -2
- package/dist/index101.js +20 -25
- package/dist/index102.js +34 -0
- package/dist/{index103.js → index104.js} +1 -1
- package/dist/index106.js +147 -2
- package/dist/index107.js +2 -37
- package/dist/index108.js +39 -0
- package/dist/index11.js +2 -2
- package/dist/{index109.js → index110.js} +2 -2
- package/dist/{index111.js → index112.js} +1 -1
- package/dist/{index113.js → index114.js} +3 -3
- package/dist/{index115.js → index116.js} +5 -5
- package/dist/{index117.js → index118.js} +1 -1
- package/dist/index12.js +2 -2
- package/dist/{index119.js → index120.js} +5 -5
- package/dist/index13.js +2 -2
- package/dist/{index131.js → index132.js} +2 -2
- package/dist/{index136.js → index137.js} +1 -1
- package/dist/{index138.js → index139.js} +2 -2
- package/dist/index14.js +2 -2
- package/dist/index142.js +167 -0
- package/dist/{index143.js → index146.js} +1 -1
- package/dist/index15.js +2 -2
- package/dist/{index147.js → index150.js} +379 -399
- package/dist/{index149.js → index152.js} +1 -1
- package/dist/{index151.js → index154.js} +10 -10
- package/dist/index16.js +2 -2
- package/dist/index160.js +581 -86
- package/dist/index163.js +93 -0
- package/dist/index165.js +87 -356
- package/dist/index168.js +389 -0
- package/dist/index17.js +2 -2
- package/dist/{index167.js → index170.js} +1 -1
- package/dist/index172.js +205 -111
- package/dist/index175.js +110 -87
- package/dist/index176.js +478 -844
- package/dist/index177.js +5520 -36
- package/dist/index178.js +90 -279
- package/dist/index179.js +833 -122
- package/dist/index18.js +2 -2
- package/dist/index180.js +36 -1197
- package/dist/index181.js +268 -760
- package/dist/index182.js +146 -1304
- package/dist/index183.js +1151 -228
- package/dist/index184.js +754 -88
- package/dist/index185.js +1308 -2
- package/dist/index186.js +259 -1359
- package/dist/index187.js +108 -0
- package/dist/index188.js +2 -18
- package/dist/index189.js +1372 -14
- package/dist/index19.js +2 -2
- package/dist/index191.js +8 -8
- package/dist/index192.js +10 -17
- package/dist/index193.js +18 -759
- package/dist/index194.js +18 -1177
- package/dist/index195.js +22 -1231
- package/dist/index196.js +740 -11258
- package/dist/index197.js +1177 -36
- package/dist/index198.js +1233 -43
- package/dist/index199.js +11258 -1209
- package/dist/index2.js +2 -2
- package/dist/index20.js +3 -3
- package/dist/index200.js +38 -0
- package/dist/index201.js +44 -5938
- package/dist/index202.js +1149 -128
- package/dist/index204.js +5933 -13
- package/dist/index205.js +205 -76
- package/dist/index206.js +28 -246
- package/dist/index207.js +14 -13680
- package/dist/index208.js +77 -26
- package/dist/index209.js +245 -55
- package/dist/index21.js +2 -2
- package/dist/index210.js +13655 -209
- package/dist/index211.js +26 -310
- package/dist/index212.js +43 -277
- package/dist/index213.js +231 -81
- package/dist/index214.js +291 -387
- package/dist/index215.js +296 -21
- package/dist/index219.js +2 -2
- package/dist/index22.js +2 -2
- package/dist/index220.js +1 -1
- package/dist/index222.js +4 -4
- package/dist/index224.js +1 -1
- package/dist/index225.js +1 -1
- package/dist/index226.js +1 -1
- package/dist/index227.js +4 -4
- package/dist/index229.js +1 -1
- package/dist/index23.js +2 -2
- package/dist/index230.js +84 -157
- package/dist/index231.js +384 -205
- package/dist/index232.js +22 -37
- package/dist/index233.js +127 -10
- package/dist/index234.js +25 -148
- package/dist/index235.js +80 -20
- package/dist/index236.js +1 -1
- package/dist/index237.js +13 -15
- package/dist/index238.js +19 -198
- package/dist/index239.js +18 -68
- package/dist/index24.js +2 -2
- package/dist/index240.js +20 -34
- package/dist/index241.js +143 -22
- package/dist/index242.js +11 -13
- package/dist/index243.js +12 -12
- package/dist/index244.js +198 -19
- package/dist/index245.js +48 -814
- package/dist/index246.js +34 -702
- package/dist/index247.js +39 -175
- package/dist/index248.js +253 -20
- package/dist/index249.js +8 -20
- package/dist/index250.js +138 -22
- package/dist/index251.js +83 -20
- package/dist/index252.js +160 -19
- package/dist/index253.js +228 -3
- package/dist/index254.js +31 -181
- package/dist/index255.js +10 -133
- package/dist/index256.js +22 -1223
- package/dist/index257.js +21 -126
- package/dist/index258.js +12 -12
- package/dist/index259.js +836 -22
- package/dist/index26.js +2 -2
- package/dist/index260.js +701 -21
- package/dist/index261.js +174 -36
- package/dist/index262.js +15 -22
- package/dist/index263.js +7 -7
- package/dist/index264.js +13 -13
- package/dist/index265.js +2 -1
- package/dist/index266.js +187 -2
- package/dist/index267.js +131 -78
- package/dist/index268.js +1223 -20
- package/dist/index269.js +11 -11
- package/dist/index27.js +2 -2
- package/dist/index270.js +22 -253
- package/dist/index271.js +21 -7
- package/dist/index272.js +29 -138
- package/dist/index273.js +20 -83
- package/dist/index274.js +20 -3709
- package/dist/index275.js +2 -60
- package/dist/index276.js +2 -83
- package/dist/index277.js +3690 -33
- package/dist/index278.js +34 -189
- package/dist/index279.js +82 -9
- package/dist/index28.js +2 -2
- package/dist/index280.js +34 -39
- package/dist/index281.js +186 -32
- package/dist/index282.js +9 -53
- package/dist/index283.js +39 -63
- package/dist/index284.js +35 -702
- package/dist/index285.js +40 -33
- package/dist/index286.js +40 -23
- package/dist/index287.js +727 -10
- package/dist/index288.js +38 -696
- package/dist/index289.js +62 -818
- package/dist/index29.js +2 -2
- package/dist/index290.js +10 -53
- package/dist/index291.js +694 -68
- package/dist/index292.js +820 -26
- package/dist/index293.js +2 -22
- package/dist/index294.js +78 -21
- package/dist/index295.js +52 -14
- package/dist/index296.js +26 -17
- package/dist/index297.js +22 -23
- package/dist/index298.js +22 -3
- package/dist/index299.js +16 -27
- package/dist/index3.js +2 -2
- package/dist/index30.js +2 -2
- package/dist/index300.js +17 -2
- package/dist/index301.js +21 -77
- package/dist/index302.js +78 -21
- package/dist/index303.js +22 -935
- package/dist/index304.js +935 -22
- package/dist/index305.js +15 -13
- package/dist/index306.js +5 -5
- package/dist/index307.js +19 -68
- package/dist/index308.js +68 -18
- package/dist/index309.js +14 -14
- package/dist/index31.js +3 -3
- package/dist/index310.js +19 -22
- package/dist/index311.js +14 -14
- package/dist/index312.js +21 -62
- package/dist/index313.js +63 -1534
- package/dist/index314.js +79 -381
- package/dist/index315.js +3 -2731
- package/dist/index316.js +24 -83
- package/dist/index317.js +1294 -3558
- package/dist/index318.js +379 -53
- package/dist/index319.js +2730 -14
- package/dist/index32.js +2 -2
- package/dist/index320.js +82 -80
- package/dist/index321.js +3749 -153
- package/dist/index322.js +54 -240
- package/dist/index323.js +15 -37
- package/dist/index324.js +75 -226
- package/dist/index325.js +200 -4
- package/dist/index326.js +236 -124
- package/dist/index327.js +36 -67
- package/dist/index328.js +124 -81
- package/dist/index329.js +397 -26
- package/dist/index33.js +2 -2
- package/dist/index330.js +235 -9
- package/dist/index331.js +5 -74
- package/dist/index332.js +133 -3
- package/dist/index333.js +68 -2
- package/dist/index334.js +83 -79
- package/dist/index335.js +27 -52
- package/dist/index336.js +8 -5
- package/dist/index337.js +74 -4
- package/dist/index338.js +3 -178
- package/dist/index339.js +2 -63
- package/dist/index34.js +2 -2
- package/dist/index340.js +82 -74
- package/dist/index341.js +53 -8
- package/dist/index342.js +5 -12
- package/dist/index343.js +4 -54
- package/dist/index344.js +176 -9
- package/dist/index345.js +61 -12
- package/dist/index346.js +75 -58
- package/dist/index347.js +19 -51
- package/dist/index348.js +19 -30
- package/dist/index349.js +64 -2
- package/dist/index35.js +2 -2
- package/dist/index350.js +37 -5
- package/dist/index351.js +9 -2
- package/dist/index352.js +13 -23
- package/dist/index353.js +52 -38
- package/dist/index354.js +12 -2
- package/dist/index355.js +14 -11
- package/dist/index356.js +54 -16
- package/dist/index357.js +52 -10
- package/dist/index358.js +31 -10
- package/dist/index359.js +2 -17
- package/dist/index36.js +2 -2
- package/dist/index360.js +5 -2
- package/dist/index361.js +2 -9
- package/dist/index362.js +23 -10
- package/dist/index363.js +39 -12
- package/dist/index364.js +2 -20
- package/dist/index365.js +11 -20
- package/dist/index366.js +18 -62
- package/dist/index367.js +10 -37
- package/dist/index368.js +10 -21
- package/dist/index369.js +16 -55
- package/dist/index37.js +2 -2
- package/dist/index370.js +2 -29
- package/dist/index371.js +9 -7
- package/dist/index372.js +9 -51
- package/dist/index373.js +13 -5
- package/dist/index374.js +19 -10
- package/dist/index375.js +56 -7
- package/dist/index376.js +29 -28
- package/dist/index377.js +7 -2
- package/dist/index378.js +50 -68
- package/dist/index379.js +5 -166
- package/dist/index38.js +2 -2
- package/dist/index380.js +12 -17
- package/dist/index381.js +6 -100
- package/dist/index382.js +28 -91
- package/dist/index383.js +2 -98
- package/dist/index384.js +69 -12
- package/dist/index385.js +167 -7
- package/dist/index386.js +131 -28
- package/dist/index387.js +17 -11
- package/dist/index388.js +98 -1
- package/dist/index389.js +90 -3
- package/dist/index39.js +2 -2
- package/dist/index390.js +98 -12
- package/dist/index391.js +30 -4
- package/dist/index392.js +11 -33
- package/dist/index393.js +4 -31
- package/dist/index394.js +4 -28
- package/dist/index395.js +12 -60
- package/dist/index396.js +7 -3
- package/dist/index397.js +12 -2
- package/dist/index398.js +5 -2
- package/dist/index399.js +33 -17
- package/dist/index4.js +2 -2
- package/dist/index40.js +2 -2
- package/dist/index400.js +31 -13
- package/dist/index401.js +28 -6
- package/dist/index402.js +57 -28
- package/dist/index403.js +489 -0
- package/dist/index404.js +128 -0
- package/dist/index405.js +5 -0
- package/dist/index406.js +4 -0
- package/dist/index407.js +4 -0
- package/dist/index408.js +19 -0
- package/dist/index409.js +15 -0
- package/dist/index41.js +2 -2
- package/dist/index410.js +8 -0
- package/dist/index411.js +34 -0
- package/dist/index42.js +4 -29
- package/dist/index43.js +25 -32
- package/dist/index44.js +32 -37
- package/dist/index45.js +37 -1391
- package/dist/index46.js +1350 -348
- package/dist/index47.js +367 -145
- package/dist/index48.js +155 -18
- package/dist/index49.js +16 -42
- package/dist/index5.js +2 -2
- package/dist/index50.js +45 -5
- package/dist/index51.js +5 -69
- package/dist/index52.js +67 -61
- package/dist/index53.js +57 -175
- package/dist/index54.js +173 -77
- package/dist/index55.js +79 -200
- package/dist/index56.js +206 -68
- package/dist/index57.js +69 -20
- package/dist/index58.js +20 -11
- package/dist/index59.js +10 -6
- package/dist/index6.js +2 -2
- package/dist/index60.js +5 -209
- package/dist/index61.js +210 -12
- package/dist/index62.js +12 -184
- package/dist/index63.js +176 -68
- package/dist/index64.js +79 -0
- package/dist/index66.js +7 -91
- package/dist/index67.js +93 -0
- package/dist/index7.js +2 -2
- package/dist/{index74.js → index75.js} +2 -2
- package/dist/index79.js +38 -395
- package/dist/index8.js +3 -3
- package/dist/index80.js +419 -0
- package/dist/{index83.js → index84.js} +4 -4
- package/dist/{index85.js → index86.js} +1 -1
- package/dist/index88.js +23 -143
- package/dist/index89.js +156 -0
- package/dist/index9.js +2 -2
- package/dist/{index90.js → index91.js} +5 -5
- package/dist/{index92.js → index93.js} +5 -5
- package/dist/{index98.js → index99.js} +4 -4
- package/dist/src/components/popper/popper.vue.d.ts +90 -0
- package/dist/src/components/popper/use-popper.d.ts +37 -0
- package/dist/src/index.d.ts +1 -0
- package/package.json +2 -1
- package/dist/index100.js +0 -29
- package/dist/index105.js +0 -149
- package/dist/index157.js +0 -588
- package/dist/index162.js +0 -120
- package/dist/index169.js +0 -210
- package/dist/index173.js +0 -497
- package/dist/index174.js +0 -5524
- package/dist/index190.js +0 -20
- package/dist/index203.js +0 -37
- package/dist/index65.js +0 -9
- package/dist/index78.js +0 -62
- package/dist/index87.js +0 -36
- package/dist/src/components/room-details-popover/room-details-popover.d.ts +0 -2167
- /package/dist/{index121.js → index122.js} +0 -0
- /package/dist/{index123.js → index124.js} +0 -0
- /package/dist/{index125.js → index126.js} +0 -0
- /package/dist/{index127.js → index128.js} +0 -0
- /package/dist/{index129.js → index130.js} +0 -0
- /package/dist/{index134.js → index135.js} +0 -0
- /package/dist/{index141.js → index144.js} +0 -0
- /package/dist/{index145.js → index148.js} +0 -0
- /package/dist/{index153.js → index156.js} +0 -0
- /package/dist/{index155.js → index158.js} +0 -0
- /package/dist/{index68.js → index69.js} +0 -0
- /package/dist/{index70.js → index71.js} +0 -0
- /package/dist/{index72.js → index73.js} +0 -0
- /package/dist/{index76.js → index77.js} +0 -0
- /package/dist/{index81.js → index82.js} +0 -0
- /package/dist/{index94.js → index95.js} +0 -0
- /package/dist/{index96.js → index97.js} +0 -0
package/dist/index202.js
CHANGED
|
@@ -1,209 +1,1230 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { openBlock as d, createElementBlock as p, withKeys as f, withModifiers as r, normalizeClass as y, renderSlot as o, createElementVNode as u, withDirectives as v, Fragment as L, renderList as $, toDisplayString as g, vShow as w, createCommentVNode as c, createVNode as B, Transition as k, withCtx as T, normalizeStyle as S, createTextVNode as b, createBlock as E, Teleport as A } from "vue";
|
|
2
|
+
function V(e) {
|
|
3
|
+
return e === 0 ? !1 : Array.isArray(e) && e.length === 0 ? !0 : !e;
|
|
4
|
+
}
|
|
5
|
+
function M(e) {
|
|
6
|
+
return (...t) => !e(...t);
|
|
7
|
+
}
|
|
8
|
+
function P(e, t) {
|
|
9
|
+
return e === void 0 && (e = "undefined"), e === null && (e = "null"), e === !1 && (e = "false"), e.toString().toLowerCase().indexOf(t.trim()) !== -1;
|
|
10
|
+
}
|
|
11
|
+
function C(e) {
|
|
12
|
+
return e.filter((t) => !t.$isLabel);
|
|
13
|
+
}
|
|
14
|
+
function O(e, t) {
|
|
15
|
+
return (i) => i.reduce((l, a) => a[e] && a[e].length ? (l.push({
|
|
16
|
+
$groupLabel: a[t],
|
|
17
|
+
$isLabel: !0
|
|
18
|
+
}), l.concat(a[e])) : l, []);
|
|
19
|
+
}
|
|
20
|
+
const D = (...e) => (t) => e.reduce((i, l) => l(i), t);
|
|
21
|
+
var F = {
|
|
22
|
+
data() {
|
|
23
|
+
return {
|
|
24
|
+
search: "",
|
|
25
|
+
isOpen: !1,
|
|
26
|
+
preferredOpenDirection: "below",
|
|
27
|
+
optimizedHeight: this.maxHeight
|
|
28
|
+
};
|
|
29
|
+
},
|
|
6
30
|
props: {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Decide whether to filter the results based on search query.
|
|
33
|
+
* Useful for async filtering, where we search through more complex data.
|
|
34
|
+
* @type {Boolean}
|
|
35
|
+
*/
|
|
36
|
+
internalSearch: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: !0
|
|
10
39
|
},
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Array of available options: Objects, Strings or Integers.
|
|
42
|
+
* If array of objects, visible label will default to option.label.
|
|
43
|
+
* If `labal` prop is passed, label will equal option['label']
|
|
44
|
+
* @type {Array}
|
|
45
|
+
*/
|
|
46
|
+
options: {
|
|
47
|
+
type: Array,
|
|
48
|
+
required: !0
|
|
14
49
|
},
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
50
|
+
/**
|
|
51
|
+
* Equivalent to the `multiple` attribute on a `<select>` input.
|
|
52
|
+
* @default false
|
|
53
|
+
* @type {Boolean}
|
|
54
|
+
*/
|
|
55
|
+
multiple: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: !1
|
|
18
58
|
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Key to compare objects
|
|
61
|
+
* @default 'id'
|
|
62
|
+
* @type {String}
|
|
63
|
+
*/
|
|
64
|
+
trackBy: {
|
|
65
|
+
type: String
|
|
66
|
+
},
|
|
67
|
+
/**
|
|
68
|
+
* Label to look for in option Object
|
|
69
|
+
* @default 'label'
|
|
70
|
+
* @type {String}
|
|
71
|
+
*/
|
|
72
|
+
label: {
|
|
73
|
+
type: String
|
|
74
|
+
},
|
|
75
|
+
/**
|
|
76
|
+
* Enable/disable search in options
|
|
77
|
+
* @default true
|
|
78
|
+
* @type {Boolean}
|
|
79
|
+
*/
|
|
80
|
+
searchable: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: !0
|
|
83
|
+
},
|
|
84
|
+
/**
|
|
85
|
+
* Clear the search input after `)
|
|
86
|
+
* @default true
|
|
87
|
+
* @type {Boolean}
|
|
88
|
+
*/
|
|
89
|
+
clearOnSelect: {
|
|
90
|
+
type: Boolean,
|
|
91
|
+
default: !0
|
|
92
|
+
},
|
|
93
|
+
/**
|
|
94
|
+
* Hide already selected options
|
|
95
|
+
* @default false
|
|
96
|
+
* @type {Boolean}
|
|
97
|
+
*/
|
|
98
|
+
hideSelected: {
|
|
99
|
+
type: Boolean,
|
|
100
|
+
default: !1
|
|
22
101
|
},
|
|
23
|
-
|
|
102
|
+
/**
|
|
103
|
+
* Equivalent to the `placeholder` attribute on a `<select>` input.
|
|
104
|
+
* @default 'Select option'
|
|
105
|
+
* @type {String}
|
|
106
|
+
*/
|
|
107
|
+
placeholder: {
|
|
24
108
|
type: String,
|
|
25
|
-
default: "
|
|
109
|
+
default: "Select option"
|
|
110
|
+
},
|
|
111
|
+
/**
|
|
112
|
+
* Allow to remove all selected values
|
|
113
|
+
* @default true
|
|
114
|
+
* @type {Boolean}
|
|
115
|
+
*/
|
|
116
|
+
allowEmpty: {
|
|
117
|
+
type: Boolean,
|
|
118
|
+
default: !0
|
|
26
119
|
},
|
|
27
|
-
|
|
120
|
+
/**
|
|
121
|
+
* Reset this.internalValue, this.search after this.internalValue changes.
|
|
122
|
+
* Useful if want to create a stateless dropdown.
|
|
123
|
+
* @default false
|
|
124
|
+
* @type {Boolean}
|
|
125
|
+
*/
|
|
126
|
+
resetAfter: {
|
|
28
127
|
type: Boolean,
|
|
29
128
|
default: !1
|
|
30
129
|
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
130
|
+
/**
|
|
131
|
+
* Enable/disable closing after selecting an option
|
|
132
|
+
* @default true
|
|
133
|
+
* @type {Boolean}
|
|
134
|
+
*/
|
|
135
|
+
closeOnSelect: {
|
|
136
|
+
type: Boolean,
|
|
137
|
+
default: !0
|
|
34
138
|
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
139
|
+
/**
|
|
140
|
+
* Function to interpolate the custom label
|
|
141
|
+
* @default false
|
|
142
|
+
* @type {Function}
|
|
143
|
+
*/
|
|
144
|
+
customLabel: {
|
|
145
|
+
type: Function,
|
|
146
|
+
default(e, t) {
|
|
147
|
+
return V(e) ? "" : t ? e[t] : e;
|
|
148
|
+
}
|
|
38
149
|
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
150
|
+
/**
|
|
151
|
+
* Disable / Enable tagging
|
|
152
|
+
* @default false
|
|
153
|
+
* @type {Boolean}
|
|
154
|
+
*/
|
|
155
|
+
taggable: {
|
|
156
|
+
type: Boolean,
|
|
157
|
+
default: !1
|
|
42
158
|
},
|
|
43
|
-
|
|
159
|
+
/**
|
|
160
|
+
* String to show when highlighting a potential tag
|
|
161
|
+
* @default 'Press enter to create a tag'
|
|
162
|
+
* @type {String}
|
|
163
|
+
*/
|
|
164
|
+
tagPlaceholder: {
|
|
44
165
|
type: String,
|
|
45
|
-
default:
|
|
166
|
+
default: "Press enter to create a tag"
|
|
46
167
|
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
168
|
+
/**
|
|
169
|
+
* By default new tags will appear above the search results.
|
|
170
|
+
* Changing to 'bottom' will revert this behaviour
|
|
171
|
+
* and will proritize the search results
|
|
172
|
+
* @default 'top'
|
|
173
|
+
* @type {String}
|
|
174
|
+
*/
|
|
175
|
+
tagPosition: {
|
|
52
176
|
type: String,
|
|
53
|
-
default:
|
|
177
|
+
default: "top"
|
|
54
178
|
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
179
|
+
/**
|
|
180
|
+
* Number of allowed selected options. No limit if 0.
|
|
181
|
+
* @default 0
|
|
182
|
+
* @type {Number}
|
|
183
|
+
*/
|
|
184
|
+
max: {
|
|
185
|
+
type: [Number, Boolean],
|
|
186
|
+
default: !1
|
|
58
187
|
},
|
|
59
|
-
|
|
60
|
-
|
|
188
|
+
/**
|
|
189
|
+
* Will be passed with all events as second param.
|
|
190
|
+
* Useful for identifying events origin.
|
|
191
|
+
* @default null
|
|
192
|
+
* @type {String|Integer}
|
|
193
|
+
*/
|
|
194
|
+
id: {
|
|
61
195
|
default: null
|
|
62
196
|
},
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
197
|
+
/**
|
|
198
|
+
* Limits the options displayed in the dropdown
|
|
199
|
+
* to the first X options.
|
|
200
|
+
* @default 1000
|
|
201
|
+
* @type {Integer}
|
|
202
|
+
*/
|
|
203
|
+
optionsLimit: {
|
|
204
|
+
type: Number,
|
|
205
|
+
default: 1e3
|
|
66
206
|
},
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
207
|
+
/**
|
|
208
|
+
* Name of the property containing
|
|
209
|
+
* the group values
|
|
210
|
+
* @default 1000
|
|
211
|
+
* @type {String}
|
|
212
|
+
*/
|
|
213
|
+
groupValues: {
|
|
214
|
+
type: String
|
|
70
215
|
},
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
216
|
+
/**
|
|
217
|
+
* Name of the property containing
|
|
218
|
+
* the group label
|
|
219
|
+
* @default 1000
|
|
220
|
+
* @type {String}
|
|
221
|
+
*/
|
|
222
|
+
groupLabel: {
|
|
223
|
+
type: String
|
|
74
224
|
},
|
|
75
|
-
|
|
225
|
+
/**
|
|
226
|
+
* Allow to select all group values
|
|
227
|
+
* by selecting the group label
|
|
228
|
+
* @default false
|
|
229
|
+
* @type {Boolean}
|
|
230
|
+
*/
|
|
231
|
+
groupSelect: {
|
|
76
232
|
type: Boolean,
|
|
77
|
-
default: !
|
|
233
|
+
default: !1
|
|
78
234
|
},
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
235
|
+
/**
|
|
236
|
+
* Array of keyboard keys to block
|
|
237
|
+
* when selecting
|
|
238
|
+
* @default 1000
|
|
239
|
+
* @type {String}
|
|
240
|
+
*/
|
|
241
|
+
blockKeys: {
|
|
242
|
+
type: Array,
|
|
243
|
+
default() {
|
|
244
|
+
return [];
|
|
245
|
+
}
|
|
82
246
|
},
|
|
83
|
-
|
|
247
|
+
/**
|
|
248
|
+
* Prevent from wiping up the search value
|
|
249
|
+
* @default false
|
|
250
|
+
* @type {Boolean}
|
|
251
|
+
*/
|
|
252
|
+
preserveSearch: {
|
|
84
253
|
type: Boolean,
|
|
85
|
-
default: !
|
|
254
|
+
default: !1
|
|
86
255
|
},
|
|
87
|
-
|
|
256
|
+
/**
|
|
257
|
+
* Select 1st options if value is empty
|
|
258
|
+
* @default false
|
|
259
|
+
* @type {Boolean}
|
|
260
|
+
*/
|
|
261
|
+
preselectFirst: {
|
|
88
262
|
type: Boolean,
|
|
89
|
-
default: !
|
|
263
|
+
default: !1
|
|
90
264
|
},
|
|
91
|
-
|
|
265
|
+
/**
|
|
266
|
+
* Prevent autofocus
|
|
267
|
+
* @default false
|
|
268
|
+
* @type {Boolean}
|
|
269
|
+
*/
|
|
270
|
+
preventAutofocus: {
|
|
92
271
|
type: Boolean,
|
|
93
|
-
default: !
|
|
272
|
+
default: !1
|
|
94
273
|
},
|
|
95
|
-
|
|
96
|
-
|
|
274
|
+
/**
|
|
275
|
+
* Allows a custom function for sorting search/filtered results.
|
|
276
|
+
* @default null
|
|
277
|
+
* @type {Function}
|
|
278
|
+
*/
|
|
279
|
+
filteringSortFunc: {
|
|
280
|
+
type: Function,
|
|
97
281
|
default: null
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
mounted() {
|
|
285
|
+
!this.multiple && this.max && console.warn("[Vue-Multiselect warn]: Max prop should not be used when prop Multiple equals false."), this.preselectFirst && !this.internalValue.length && this.options.length && this.select(this.filteredOptions[0]);
|
|
286
|
+
},
|
|
287
|
+
computed: {
|
|
288
|
+
internalValue() {
|
|
289
|
+
return this.modelValue || this.modelValue === 0 ? Array.isArray(this.modelValue) ? this.modelValue : [this.modelValue] : [];
|
|
98
290
|
},
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
291
|
+
filteredOptions() {
|
|
292
|
+
const e = this.search || "", t = e.toLowerCase().trim();
|
|
293
|
+
let i = this.options.concat();
|
|
294
|
+
return this.internalSearch ? i = this.groupValues ? this.filterAndFlat(i, t, this.label) : this.filterOptions(i, t, this.label, this.customLabel) : i = this.groupValues ? O(this.groupValues, this.groupLabel)(i) : i, i = this.hideSelected ? i.filter(M(this.isSelected)) : i, this.taggable && t.length && !this.isExistingOption(t) && (this.tagPosition === "bottom" ? i.push({ isTag: !0, label: e }) : i.unshift({ isTag: !0, label: e })), i.slice(0, this.optionsLimit);
|
|
295
|
+
},
|
|
296
|
+
valueKeys() {
|
|
297
|
+
return this.trackBy ? this.internalValue.map((e) => e[this.trackBy]) : this.internalValue;
|
|
298
|
+
},
|
|
299
|
+
optionKeys() {
|
|
300
|
+
return (this.groupValues ? this.flatAndStrip(this.options) : this.options).map((t) => this.customLabel(t, this.label).toString().toLowerCase());
|
|
301
|
+
},
|
|
302
|
+
currentOptionLabel() {
|
|
303
|
+
return this.multiple ? this.searchable ? "" : this.placeholder : this.internalValue.length ? this.getOptionLabel(this.internalValue[0]) : this.searchable ? "" : this.placeholder;
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
watch: {
|
|
307
|
+
internalValue: {
|
|
308
|
+
handler() {
|
|
309
|
+
this.resetAfter && this.internalValue.length && (this.search = "", this.$emit("update:modelValue", this.multiple ? [] : null));
|
|
310
|
+
},
|
|
311
|
+
deep: !0
|
|
312
|
+
},
|
|
313
|
+
search() {
|
|
314
|
+
this.$emit("search-change", this.search);
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
emits: ["open", "search-change", "close", "select", "update:modelValue", "remove", "tag"],
|
|
318
|
+
methods: {
|
|
319
|
+
/**
|
|
320
|
+
* Returns the internalValue in a way it can be emited to the parent
|
|
321
|
+
* @returns {Object||Array||String||Integer}
|
|
322
|
+
*/
|
|
323
|
+
getValue() {
|
|
324
|
+
return this.multiple ? this.internalValue : this.internalValue.length === 0 ? null : this.internalValue[0];
|
|
325
|
+
},
|
|
326
|
+
/**
|
|
327
|
+
* Filters and then flattens the options list
|
|
328
|
+
* @param {Array}
|
|
329
|
+
* @return {Array} returns a filtered and flat options list
|
|
330
|
+
*/
|
|
331
|
+
filterAndFlat(e, t, i) {
|
|
332
|
+
return D(
|
|
333
|
+
this.filterGroups(t, i, this.groupValues, this.groupLabel, this.customLabel),
|
|
334
|
+
O(this.groupValues, this.groupLabel)
|
|
335
|
+
)(e);
|
|
336
|
+
},
|
|
337
|
+
/**
|
|
338
|
+
* Flattens and then strips the group labels from the options list
|
|
339
|
+
* @param {Array}
|
|
340
|
+
* @return {Array} returns a flat options list without group labels
|
|
341
|
+
*/
|
|
342
|
+
flatAndStrip(e) {
|
|
343
|
+
return D(
|
|
344
|
+
O(this.groupValues, this.groupLabel),
|
|
345
|
+
C
|
|
346
|
+
)(e);
|
|
347
|
+
},
|
|
348
|
+
/**
|
|
349
|
+
* Updates the search value
|
|
350
|
+
* @param {String}
|
|
351
|
+
*/
|
|
352
|
+
updateSearch(e) {
|
|
353
|
+
this.search = e;
|
|
354
|
+
},
|
|
355
|
+
/**
|
|
356
|
+
* Finds out if the given query is already present
|
|
357
|
+
* in the available options
|
|
358
|
+
* @param {String}
|
|
359
|
+
* @return {Boolean} returns true if element is available
|
|
360
|
+
*/
|
|
361
|
+
isExistingOption(e) {
|
|
362
|
+
return this.options ? this.optionKeys.indexOf(e) > -1 : !1;
|
|
363
|
+
},
|
|
364
|
+
/**
|
|
365
|
+
* Finds out if the given element is already present
|
|
366
|
+
* in the result value
|
|
367
|
+
* @param {Object||String||Integer} option passed element to check
|
|
368
|
+
* @returns {Boolean} returns true if element is selected
|
|
369
|
+
*/
|
|
370
|
+
isSelected(e) {
|
|
371
|
+
const t = this.trackBy ? e[this.trackBy] : e;
|
|
372
|
+
return this.valueKeys.indexOf(t) > -1;
|
|
373
|
+
},
|
|
374
|
+
/**
|
|
375
|
+
* Finds out if the given option is disabled
|
|
376
|
+
* @param {Object||String||Integer} option passed element to check
|
|
377
|
+
* @returns {Boolean} returns true if element is disabled
|
|
378
|
+
*/
|
|
379
|
+
isOptionDisabled(e) {
|
|
380
|
+
return !!e.$isDisabled;
|
|
381
|
+
},
|
|
382
|
+
/**
|
|
383
|
+
* Returns empty string when options is null/undefined
|
|
384
|
+
* Returns tag query if option is tag.
|
|
385
|
+
* Returns the customLabel() results and casts it to string.
|
|
386
|
+
*
|
|
387
|
+
* @param {Object||String||Integer} Passed option
|
|
388
|
+
* @returns {Object||String}
|
|
389
|
+
*/
|
|
390
|
+
getOptionLabel(e) {
|
|
391
|
+
if (V(e)) return "";
|
|
392
|
+
if (e.isTag) return e.label;
|
|
393
|
+
if (e.$isLabel) return e.$groupLabel;
|
|
394
|
+
const t = this.customLabel(e, this.label);
|
|
395
|
+
return V(t) ? "" : t;
|
|
396
|
+
},
|
|
397
|
+
/**
|
|
398
|
+
* Add the given option to the list of selected options
|
|
399
|
+
* or sets the option as the selected option.
|
|
400
|
+
* If option is already selected -> remove it from the results.
|
|
401
|
+
*
|
|
402
|
+
* @param {Object||String||Integer} option to select/deselect
|
|
403
|
+
* @param {Boolean} block removing
|
|
404
|
+
*/
|
|
405
|
+
select(e, t) {
|
|
406
|
+
if (e.$isLabel && this.groupSelect) {
|
|
407
|
+
this.selectGroup(e);
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
if (!(this.blockKeys.indexOf(t) !== -1 || this.disabled || e.$isDisabled || e.$isLabel) && !(this.max && this.multiple && this.internalValue.length === this.max) && !(t === "Tab" && !this.pointerDirty)) {
|
|
411
|
+
if (e.isTag)
|
|
412
|
+
this.$emit("tag", e.label, this.id), this.search = "", this.closeOnSelect && !this.multiple && this.deactivate();
|
|
413
|
+
else {
|
|
414
|
+
if (this.isSelected(e)) {
|
|
415
|
+
t !== "Tab" && this.removeElement(e);
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
this.multiple ? this.$emit("update:modelValue", this.internalValue.concat([e])) : this.$emit("update:modelValue", e), this.$emit("select", e, this.id), this.clearOnSelect && (this.search = "");
|
|
419
|
+
}
|
|
420
|
+
this.closeOnSelect && this.deactivate();
|
|
421
|
+
}
|
|
422
|
+
},
|
|
423
|
+
/**
|
|
424
|
+
* Add the given group options to the list of selected options
|
|
425
|
+
* If all group optiona are already selected -> remove it from the results.
|
|
426
|
+
*
|
|
427
|
+
* @param {Object||String||Integer} group to select/deselect
|
|
428
|
+
*/
|
|
429
|
+
selectGroup(e) {
|
|
430
|
+
const t = this.options.find((i) => i[this.groupLabel] === e.$groupLabel);
|
|
431
|
+
if (t) {
|
|
432
|
+
if (this.wholeGroupSelected(t)) {
|
|
433
|
+
this.$emit("remove", t[this.groupValues], this.id);
|
|
434
|
+
const i = this.trackBy ? t[this.groupValues].map((a) => a[this.trackBy]) : t[this.groupValues], l = this.internalValue.filter(
|
|
435
|
+
(a) => i.indexOf(this.trackBy ? a[this.trackBy] : a) === -1
|
|
436
|
+
);
|
|
437
|
+
this.$emit("update:modelValue", l);
|
|
438
|
+
} else {
|
|
439
|
+
const i = t[this.groupValues].filter(
|
|
440
|
+
(l) => !(this.isOptionDisabled(l) || this.isSelected(l))
|
|
441
|
+
);
|
|
442
|
+
this.max && i.splice(this.max - this.internalValue.length), this.$emit("select", i, this.id), this.$emit(
|
|
443
|
+
"update:modelValue",
|
|
444
|
+
this.internalValue.concat(i)
|
|
445
|
+
);
|
|
446
|
+
}
|
|
447
|
+
this.closeOnSelect && this.deactivate();
|
|
448
|
+
}
|
|
449
|
+
},
|
|
450
|
+
/**
|
|
451
|
+
* Helper to identify if all values in a group are selected
|
|
452
|
+
*
|
|
453
|
+
* @param {Object} group to validated selected values against
|
|
454
|
+
*/
|
|
455
|
+
wholeGroupSelected(e) {
|
|
456
|
+
return e[this.groupValues].every(
|
|
457
|
+
(t) => this.isSelected(t) || this.isOptionDisabled(t)
|
|
458
|
+
);
|
|
459
|
+
},
|
|
460
|
+
/**
|
|
461
|
+
* Helper to identify if all values in a group are disabled
|
|
462
|
+
*
|
|
463
|
+
* @param {Object} group to check for disabled values
|
|
464
|
+
*/
|
|
465
|
+
wholeGroupDisabled(e) {
|
|
466
|
+
return e[this.groupValues].every(this.isOptionDisabled);
|
|
102
467
|
},
|
|
103
|
-
|
|
468
|
+
/**
|
|
469
|
+
* Removes the given option from the selected options.
|
|
470
|
+
* Additionally checks this.allowEmpty prop if option can be removed when
|
|
471
|
+
* it is the last selected option.
|
|
472
|
+
*
|
|
473
|
+
* @param {type} option description
|
|
474
|
+
* @return {type} description
|
|
475
|
+
*/
|
|
476
|
+
removeElement(e, t = !0) {
|
|
477
|
+
if (this.disabled || e.$isDisabled) return;
|
|
478
|
+
if (!this.allowEmpty && this.internalValue.length <= 1) {
|
|
479
|
+
this.deactivate();
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
const i = typeof e == "object" ? this.valueKeys.indexOf(e[this.trackBy]) : this.valueKeys.indexOf(e);
|
|
483
|
+
if (this.multiple) {
|
|
484
|
+
const l = this.internalValue.slice(0, i).concat(this.internalValue.slice(i + 1));
|
|
485
|
+
this.$emit("update:modelValue", l);
|
|
486
|
+
} else
|
|
487
|
+
this.$emit("update:modelValue", null);
|
|
488
|
+
this.$emit("remove", e, this.id), this.closeOnSelect && t && this.deactivate();
|
|
489
|
+
},
|
|
490
|
+
/**
|
|
491
|
+
* Calls this.removeElement() with the last element
|
|
492
|
+
* from this.internalValue (selected element Array)
|
|
493
|
+
*
|
|
494
|
+
* @fires this#removeElement
|
|
495
|
+
*/
|
|
496
|
+
removeLastElement() {
|
|
497
|
+
this.blockKeys.indexOf("Delete") === -1 && this.search.length === 0 && Array.isArray(this.internalValue) && this.internalValue.length && this.removeElement(this.internalValue[this.internalValue.length - 1], !1);
|
|
498
|
+
},
|
|
499
|
+
/**
|
|
500
|
+
* Opens the multiselect’s dropdown.
|
|
501
|
+
* Sets this.isOpen to TRUE
|
|
502
|
+
*/
|
|
503
|
+
activate() {
|
|
504
|
+
this.isOpen || this.disabled || (this.adjustPosition(), this.groupValues && this.pointer === 0 && this.filteredOptions.length && (this.pointer = 1), this.isOpen = !0, this.searchable ? (this.preserveSearch || (this.search = ""), this.preventAutofocus || this.$nextTick(() => this.$refs.search && this.$refs.search.focus())) : this.preventAutofocus || typeof this.$el < "u" && this.$el.focus(), this.$emit("open", this.id));
|
|
505
|
+
},
|
|
506
|
+
/**
|
|
507
|
+
* Closes the multiselect’s dropdown.
|
|
508
|
+
* Sets this.isOpen to FALSE
|
|
509
|
+
*/
|
|
510
|
+
deactivate() {
|
|
511
|
+
this.isOpen && (this.isOpen = !1, this.searchable ? this.$refs.search !== null && typeof this.$refs.search < "u" && this.$refs.search.blur() : typeof this.$el < "u" && this.$el.blur(), this.preserveSearch || (this.search = ""), this.$emit("close", this.getValue(), this.id));
|
|
512
|
+
},
|
|
513
|
+
/**
|
|
514
|
+
* Call this.activate() or this.deactivate()
|
|
515
|
+
* depending on this.isOpen value.
|
|
516
|
+
*
|
|
517
|
+
* @fires this#activate || this#deactivate
|
|
518
|
+
* @property {Boolean} isOpen indicates if dropdown is open
|
|
519
|
+
*/
|
|
520
|
+
toggle() {
|
|
521
|
+
this.isOpen ? this.deactivate() : this.activate();
|
|
522
|
+
},
|
|
523
|
+
/**
|
|
524
|
+
* Updates the hasEnoughSpace variable used for
|
|
525
|
+
* detecting where to expand the dropdown
|
|
526
|
+
*/
|
|
527
|
+
adjustPosition() {
|
|
528
|
+
if (typeof window > "u") return;
|
|
529
|
+
const e = this.$el.getBoundingClientRect().top, t = window.innerHeight - this.$el.getBoundingClientRect().bottom;
|
|
530
|
+
t > this.maxHeight || t > e || this.openDirection === "below" || this.openDirection === "bottom" ? (this.preferredOpenDirection = "below", this.optimizedHeight = Math.min(t - 40, this.maxHeight)) : (this.preferredOpenDirection = "above", this.optimizedHeight = Math.min(e - 40, this.maxHeight));
|
|
531
|
+
},
|
|
532
|
+
/**
|
|
533
|
+
* Filters and sorts the options ready for selection
|
|
534
|
+
* @param {Array} options
|
|
535
|
+
* @param {String} search
|
|
536
|
+
* @param {String} label
|
|
537
|
+
* @param {Function} customLabel
|
|
538
|
+
* @returns {Array}
|
|
539
|
+
*/
|
|
540
|
+
filterOptions(e, t, i, l) {
|
|
541
|
+
return t ? e.filter((a) => P(l(a, i), t)).sort((a, n) => typeof this.filteringSortFunc == "function" ? this.filteringSortFunc(a, n) : l(a, i).length - l(n, i).length) : e;
|
|
542
|
+
},
|
|
543
|
+
/**
|
|
544
|
+
*
|
|
545
|
+
* @param {String} search
|
|
546
|
+
* @param {String} label
|
|
547
|
+
* @param {String} values
|
|
548
|
+
* @param {String} groupLabel
|
|
549
|
+
* @param {function} customLabel
|
|
550
|
+
* @returns {function(*): *}
|
|
551
|
+
*/
|
|
552
|
+
filterGroups(e, t, i, l, a) {
|
|
553
|
+
return (n) => n.map((s) => {
|
|
554
|
+
if (!s[i])
|
|
555
|
+
return console.warn("Options passed to vue-multiselect do not contain groups, despite the config."), [];
|
|
556
|
+
const h = this.filterOptions(s[i], e, t, a);
|
|
557
|
+
return h.length ? {
|
|
558
|
+
[l]: s[l],
|
|
559
|
+
[i]: h
|
|
560
|
+
} : [];
|
|
561
|
+
});
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
}, G = {
|
|
565
|
+
data() {
|
|
566
|
+
return {
|
|
567
|
+
pointer: 0,
|
|
568
|
+
pointerDirty: !1
|
|
569
|
+
};
|
|
570
|
+
},
|
|
571
|
+
props: {
|
|
572
|
+
/**
|
|
573
|
+
* Enable/disable highlighting of the pointed value.
|
|
574
|
+
* @type {Boolean}
|
|
575
|
+
* @default true
|
|
576
|
+
*/
|
|
577
|
+
showPointer: {
|
|
104
578
|
type: Boolean,
|
|
105
|
-
default: !
|
|
579
|
+
default: !0
|
|
580
|
+
},
|
|
581
|
+
optionHeight: {
|
|
582
|
+
type: Number,
|
|
583
|
+
default: 40
|
|
584
|
+
}
|
|
585
|
+
},
|
|
586
|
+
computed: {
|
|
587
|
+
pointerPosition() {
|
|
588
|
+
return this.pointer * this.optionHeight;
|
|
589
|
+
},
|
|
590
|
+
visibleElements() {
|
|
591
|
+
return this.optimizedHeight / this.optionHeight;
|
|
592
|
+
}
|
|
593
|
+
},
|
|
594
|
+
watch: {
|
|
595
|
+
filteredOptions() {
|
|
596
|
+
this.pointerAdjust();
|
|
106
597
|
},
|
|
107
|
-
|
|
598
|
+
isOpen() {
|
|
599
|
+
this.pointerDirty = !1;
|
|
600
|
+
},
|
|
601
|
+
pointer() {
|
|
602
|
+
this.$refs.search && this.$refs.search.setAttribute("aria-activedescendant", this.id + "-" + this.pointer.toString());
|
|
603
|
+
}
|
|
604
|
+
},
|
|
605
|
+
methods: {
|
|
606
|
+
optionHighlight(e, t) {
|
|
607
|
+
return {
|
|
608
|
+
"multiselect__option--highlight": e === this.pointer && this.showPointer,
|
|
609
|
+
"multiselect__option--selected": this.isSelected(t)
|
|
610
|
+
};
|
|
611
|
+
},
|
|
612
|
+
groupHighlight(e, t) {
|
|
613
|
+
if (!this.groupSelect)
|
|
614
|
+
return [
|
|
615
|
+
"multiselect__option--disabled",
|
|
616
|
+
{ "multiselect__option--group": t.$isLabel }
|
|
617
|
+
];
|
|
618
|
+
const i = this.options.find((l) => l[this.groupLabel] === t.$groupLabel);
|
|
619
|
+
return i && !this.wholeGroupDisabled(i) ? [
|
|
620
|
+
"multiselect__option--group",
|
|
621
|
+
{ "multiselect__option--highlight": e === this.pointer && this.showPointer },
|
|
622
|
+
{ "multiselect__option--group-selected": this.wholeGroupSelected(i) }
|
|
623
|
+
] : "multiselect__option--disabled";
|
|
624
|
+
},
|
|
625
|
+
addPointerElement({ key: e } = "Enter") {
|
|
626
|
+
this.filteredOptions.length > 0 && this.select(this.filteredOptions[this.pointer], e), this.pointerReset();
|
|
627
|
+
},
|
|
628
|
+
pointerForward() {
|
|
629
|
+
this.pointer < this.filteredOptions.length - 1 && (this.pointer++, this.$refs.list?.scrollTop <= this.pointerPosition - (this.visibleElements - 1) * this.optionHeight && (this.$refs.list.scrollTop = this.pointerPosition - (this.visibleElements - 1) * this.optionHeight), this.filteredOptions[this.pointer] && this.filteredOptions[this.pointer].$isLabel && !this.groupSelect && this.pointerForward()), this.pointerDirty = !0;
|
|
630
|
+
},
|
|
631
|
+
pointerBackward() {
|
|
632
|
+
this.pointer > 0 ? (this.pointer--, this.$refs.list?.scrollTop >= this.pointerPosition && (this.$refs.list.scrollTop = this.pointerPosition), this.filteredOptions[this.pointer] && this.filteredOptions[this.pointer].$isLabel && !this.groupSelect && this.pointerBackward()) : this.filteredOptions[this.pointer] && this.filteredOptions[0].$isLabel && !this.groupSelect && this.pointerForward(), this.pointerDirty = !0;
|
|
633
|
+
},
|
|
634
|
+
pointerReset() {
|
|
635
|
+
this.closeOnSelect && (this.pointer = 0, this.$refs.list && (this.$refs.list.scrollTop = 0));
|
|
636
|
+
},
|
|
637
|
+
pointerAdjust() {
|
|
638
|
+
this.pointer >= this.filteredOptions.length - 1 && (this.pointer = this.filteredOptions.length ? this.filteredOptions.length - 1 : 0), this.filteredOptions.length > 0 && this.filteredOptions[this.pointer].$isLabel && !this.groupSelect && this.pointerForward();
|
|
639
|
+
},
|
|
640
|
+
pointerSet(e) {
|
|
641
|
+
this.pointer = e, this.pointerDirty = !0;
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
}, H = {
|
|
645
|
+
name: "vue-multiselect",
|
|
646
|
+
mixins: [F, G],
|
|
647
|
+
compatConfig: {
|
|
648
|
+
MODE: 3,
|
|
649
|
+
ATTR_ENUMERATED_COERCION: !1
|
|
650
|
+
},
|
|
651
|
+
props: {
|
|
652
|
+
/**
|
|
653
|
+
* name attribute to match optional label element
|
|
654
|
+
* @default ''
|
|
655
|
+
* @type {String}
|
|
656
|
+
*/
|
|
657
|
+
name: {
|
|
108
658
|
type: String,
|
|
109
|
-
default:
|
|
659
|
+
default: ""
|
|
110
660
|
},
|
|
111
|
-
|
|
661
|
+
/**
|
|
662
|
+
* Presets the selected options value.
|
|
663
|
+
* @type {Object||Array||String||Integer}
|
|
664
|
+
*/
|
|
665
|
+
modelValue: {
|
|
112
666
|
type: null,
|
|
113
|
-
default
|
|
667
|
+
default() {
|
|
668
|
+
return [];
|
|
669
|
+
}
|
|
114
670
|
},
|
|
115
|
-
|
|
671
|
+
/**
|
|
672
|
+
* String to show when pointing to an option
|
|
673
|
+
* @default 'Press enter to select'
|
|
674
|
+
* @type {String}
|
|
675
|
+
*/
|
|
676
|
+
selectLabel: {
|
|
116
677
|
type: String,
|
|
117
|
-
default:
|
|
678
|
+
default: "Press enter to select"
|
|
118
679
|
},
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
680
|
+
/**
|
|
681
|
+
* String to show when pointing to an option
|
|
682
|
+
* @default 'Press enter to select'
|
|
683
|
+
* @type {String}
|
|
684
|
+
*/
|
|
685
|
+
selectGroupLabel: {
|
|
686
|
+
type: String,
|
|
687
|
+
default: "Press enter to select group"
|
|
122
688
|
},
|
|
123
|
-
|
|
689
|
+
/**
|
|
690
|
+
* String to show next to selected option
|
|
691
|
+
* @default 'Selected'
|
|
692
|
+
* @type {String}
|
|
693
|
+
*/
|
|
694
|
+
selectedLabel: {
|
|
124
695
|
type: String,
|
|
125
|
-
default:
|
|
696
|
+
default: "Selected"
|
|
126
697
|
},
|
|
127
|
-
|
|
698
|
+
/**
|
|
699
|
+
* String to show when pointing to an already selected option
|
|
700
|
+
* @default 'Press enter to remove'
|
|
701
|
+
* @type {String}
|
|
702
|
+
*/
|
|
703
|
+
deselectLabel: {
|
|
704
|
+
type: String,
|
|
705
|
+
default: "Press enter to remove"
|
|
706
|
+
},
|
|
707
|
+
/**
|
|
708
|
+
* String to show when pointing to an already selected option
|
|
709
|
+
* @default 'Press enter to remove'
|
|
710
|
+
* @type {String}
|
|
711
|
+
*/
|
|
712
|
+
deselectGroupLabel: {
|
|
713
|
+
type: String,
|
|
714
|
+
default: "Press enter to deselect group"
|
|
715
|
+
},
|
|
716
|
+
/**
|
|
717
|
+
* Decide whether to show pointer labels
|
|
718
|
+
* @default true
|
|
719
|
+
* @type {Boolean}
|
|
720
|
+
*/
|
|
721
|
+
showLabels: {
|
|
128
722
|
type: Boolean,
|
|
129
|
-
default: !
|
|
723
|
+
default: !0
|
|
130
724
|
},
|
|
131
|
-
|
|
725
|
+
/**
|
|
726
|
+
* Limit the display of selected options. The rest will be hidden within the limitText string.
|
|
727
|
+
* @default 99999
|
|
728
|
+
* @type {Integer}
|
|
729
|
+
*/
|
|
730
|
+
limit: {
|
|
132
731
|
type: Number,
|
|
133
|
-
default:
|
|
732
|
+
default: 99999
|
|
134
733
|
},
|
|
135
|
-
|
|
734
|
+
/**
|
|
735
|
+
* Sets maxHeight style value of the dropdown
|
|
736
|
+
* @default 300
|
|
737
|
+
* @type {Integer}
|
|
738
|
+
*/
|
|
739
|
+
maxHeight: {
|
|
136
740
|
type: Number,
|
|
137
|
-
default:
|
|
138
|
-
},
|
|
139
|
-
rowReorder: {
|
|
140
|
-
type: Boolean,
|
|
141
|
-
default: !1
|
|
741
|
+
default: 300
|
|
142
742
|
},
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
743
|
+
/**
|
|
744
|
+
* Function that process the message shown when selected
|
|
745
|
+
* elements pass the defined limit.
|
|
746
|
+
* @default 'and * more'
|
|
747
|
+
* @param {Int} count Number of elements more than limit
|
|
748
|
+
* @type {Function}
|
|
749
|
+
*/
|
|
750
|
+
limitText: {
|
|
751
|
+
type: Function,
|
|
752
|
+
default: (e) => `and ${e} more`
|
|
146
753
|
},
|
|
147
|
-
|
|
754
|
+
/**
|
|
755
|
+
* Set true to trigger the loading spinner.
|
|
756
|
+
* @default False
|
|
757
|
+
* @type {Boolean}
|
|
758
|
+
*/
|
|
759
|
+
loading: {
|
|
148
760
|
type: Boolean,
|
|
149
|
-
default: !
|
|
761
|
+
default: !1
|
|
150
762
|
},
|
|
151
|
-
|
|
763
|
+
/**
|
|
764
|
+
* Disables the multiselect if true.
|
|
765
|
+
* @default false
|
|
766
|
+
* @type {Boolean}
|
|
767
|
+
*/
|
|
768
|
+
disabled: {
|
|
152
769
|
type: Boolean,
|
|
153
770
|
default: !1
|
|
154
771
|
},
|
|
155
|
-
|
|
772
|
+
/**
|
|
773
|
+
* Enables search input's spellcheck if true.
|
|
774
|
+
* @default false
|
|
775
|
+
* @type {Boolean}
|
|
776
|
+
*/
|
|
777
|
+
spellcheck: {
|
|
156
778
|
type: Boolean,
|
|
157
779
|
default: !1
|
|
158
780
|
},
|
|
159
|
-
|
|
781
|
+
/**
|
|
782
|
+
* Fixed opening direction
|
|
783
|
+
* @default ''
|
|
784
|
+
* @type {String}
|
|
785
|
+
*/
|
|
786
|
+
openDirection: {
|
|
160
787
|
type: String,
|
|
161
|
-
default: "
|
|
788
|
+
default: ""
|
|
162
789
|
},
|
|
163
|
-
|
|
790
|
+
/**
|
|
791
|
+
* Shows slot with message about empty options
|
|
792
|
+
* @default true
|
|
793
|
+
* @type {Boolean}
|
|
794
|
+
*/
|
|
795
|
+
showNoOptions: {
|
|
164
796
|
type: Boolean,
|
|
165
797
|
default: !0
|
|
166
798
|
},
|
|
167
|
-
|
|
168
|
-
type:
|
|
169
|
-
default:
|
|
799
|
+
showNoResults: {
|
|
800
|
+
type: Boolean,
|
|
801
|
+
default: !0
|
|
170
802
|
},
|
|
171
|
-
|
|
172
|
-
type:
|
|
173
|
-
default:
|
|
803
|
+
tabindex: {
|
|
804
|
+
type: Number,
|
|
805
|
+
default: 0
|
|
174
806
|
},
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
807
|
+
/**
|
|
808
|
+
* Adds Required attribute to the input element when there is no value selected
|
|
809
|
+
* @default false
|
|
810
|
+
* @type {Boolean}
|
|
811
|
+
*/
|
|
812
|
+
required: {
|
|
813
|
+
type: Boolean,
|
|
814
|
+
default: !1
|
|
178
815
|
},
|
|
179
|
-
|
|
816
|
+
/**
|
|
817
|
+
* Uses Vue Teleport's feature. Teleports the open dropdown to the bottom of the body element
|
|
818
|
+
* @default false
|
|
819
|
+
* @type {Boolean}
|
|
820
|
+
*/
|
|
821
|
+
useTeleport: {
|
|
180
822
|
type: Boolean,
|
|
181
823
|
default: !1
|
|
824
|
+
},
|
|
825
|
+
/**
|
|
826
|
+
* Classes to apply to the `multiselect__content-wrapper` element. This element is a teleport element (when enabled), so can be used to specifically target
|
|
827
|
+
* the teleported element
|
|
828
|
+
*/
|
|
829
|
+
contentWrapperClass: {
|
|
830
|
+
type: [String, Array, Object],
|
|
831
|
+
default: ""
|
|
182
832
|
}
|
|
183
833
|
},
|
|
184
|
-
|
|
185
|
-
provide: function() {
|
|
834
|
+
data() {
|
|
186
835
|
return {
|
|
187
|
-
|
|
836
|
+
dropdownStyles: {},
|
|
837
|
+
ready: !1
|
|
188
838
|
};
|
|
189
|
-
}
|
|
190
|
-
}, r = {
|
|
191
|
-
name: "Column",
|
|
192
|
-
extends: u,
|
|
193
|
-
inheritAttrs: !1,
|
|
194
|
-
inject: ["$columns"],
|
|
195
|
-
mounted: function() {
|
|
196
|
-
var e;
|
|
197
|
-
(e = this.$columns) === null || e === void 0 || e.add(this.$);
|
|
198
839
|
},
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
840
|
+
computed: {
|
|
841
|
+
hasOptionGroup() {
|
|
842
|
+
return this.groupValues && this.groupLabel && this.groupSelect;
|
|
843
|
+
},
|
|
844
|
+
isSingleLabelVisible() {
|
|
845
|
+
return (this.singleValue || this.singleValue === 0) && (!this.isOpen || !this.searchable) && !this.visibleValues.length;
|
|
846
|
+
},
|
|
847
|
+
isPlaceholderVisible() {
|
|
848
|
+
return !this.internalValue.length && (!this.searchable || !this.isOpen);
|
|
849
|
+
},
|
|
850
|
+
visibleValues() {
|
|
851
|
+
return this.multiple ? this.internalValue.slice(0, this.limit) : [];
|
|
852
|
+
},
|
|
853
|
+
singleValue() {
|
|
854
|
+
return this.internalValue[0];
|
|
855
|
+
},
|
|
856
|
+
deselectLabelText() {
|
|
857
|
+
return this.showLabels ? this.deselectLabel : "";
|
|
858
|
+
},
|
|
859
|
+
deselectGroupLabelText() {
|
|
860
|
+
return this.showLabels ? this.deselectGroupLabel : "";
|
|
861
|
+
},
|
|
862
|
+
selectLabelText() {
|
|
863
|
+
return this.showLabels ? this.selectLabel : "";
|
|
864
|
+
},
|
|
865
|
+
selectGroupLabelText() {
|
|
866
|
+
return this.showLabels ? this.selectGroupLabel : "";
|
|
867
|
+
},
|
|
868
|
+
selectedLabelText() {
|
|
869
|
+
return this.showLabels ? this.selectedLabel : "";
|
|
870
|
+
},
|
|
871
|
+
inputStyle() {
|
|
872
|
+
return this.searchable || this.multiple && this.modelValue && this.modelValue.length ? this.isOpen ? { width: "100%" } : { width: "0", position: "absolute", padding: "0" } : "";
|
|
873
|
+
},
|
|
874
|
+
contentStyle() {
|
|
875
|
+
return this.options.length ? { display: "inline-block" } : { display: "block" };
|
|
876
|
+
},
|
|
877
|
+
isAbove() {
|
|
878
|
+
return this.openDirection === "above" || this.openDirection === "top" ? !0 : this.openDirection === "below" || this.openDirection === "bottom" ? !1 : this.preferredOpenDirection === "above";
|
|
879
|
+
},
|
|
880
|
+
showSearchInput() {
|
|
881
|
+
return this.searchable && (this.hasSingleSelectedSlot && (this.visibleSingleValue || this.visibleSingleValue === 0) ? this.isOpen : !0);
|
|
882
|
+
},
|
|
883
|
+
isRequired() {
|
|
884
|
+
return this.required === !1 ? !1 : this.internalValue.length <= 0;
|
|
885
|
+
}
|
|
202
886
|
},
|
|
203
|
-
|
|
204
|
-
|
|
887
|
+
watch: {
|
|
888
|
+
isOpen(e) {
|
|
889
|
+
e && (this.useTeleport ? (this.ready = !1, this.$nextTick(() => {
|
|
890
|
+
const t = this.$el.getBoundingClientRect();
|
|
891
|
+
this.dropdownStyles = {
|
|
892
|
+
position: "absolute",
|
|
893
|
+
top: `${t.bottom + window.scrollY}px`,
|
|
894
|
+
left: `${t.left + window.scrollX}px`,
|
|
895
|
+
width: `${t.width}px`,
|
|
896
|
+
zIndex: 9999
|
|
897
|
+
}, this.ready = !0;
|
|
898
|
+
})) : this.ready = !0);
|
|
899
|
+
}
|
|
205
900
|
}
|
|
206
901
|
};
|
|
902
|
+
const N = ["tabindex", "aria-expanded", "aria-owns", "aria-activedescendant"], K = {
|
|
903
|
+
ref: "tags",
|
|
904
|
+
class: "multiselect__tags"
|
|
905
|
+
}, R = { class: "multiselect__tags-wrap" }, q = ["textContent"], z = ["onKeydown", "onMousedown"], j = ["textContent"], I = { class: "multiselect__spinner" }, W = ["name", "id", "spellcheck", "placeholder", "required", "value", "disabled", "tabindex", "aria-label", "aria-controls"], U = ["id", "aria-multiselectable"], X = { key: 0 }, Y = { class: "multiselect__option" }, J = ["aria-selected", "id", "role"], Q = ["onClick", "onMouseenter", "data-select", "data-selected", "data-deselect"], Z = ["data-select", "data-deselect", "onMouseenter", "onMousedown"], x = { class: "multiselect__option" }, _ = { class: "multiselect__option" };
|
|
906
|
+
function ee(e, t, i, l, a, n) {
|
|
907
|
+
return d(), p("div", {
|
|
908
|
+
tabindex: e.searchable ? -1 : i.tabindex,
|
|
909
|
+
class: y([{ "multiselect--active": e.isOpen, "multiselect--disabled": i.disabled, "multiselect--above": n.isAbove, "multiselect--has-options-group": n.hasOptionGroup }, "multiselect"]),
|
|
910
|
+
onFocus: t[14] || (t[14] = (s) => e.activate()),
|
|
911
|
+
onBlur: t[15] || (t[15] = (s) => e.searchable ? !1 : e.deactivate()),
|
|
912
|
+
onKeydown: [
|
|
913
|
+
t[16] || (t[16] = f(r((s) => e.pointerForward(), ["self", "prevent"]), ["down"])),
|
|
914
|
+
t[17] || (t[17] = f(r((s) => e.pointerBackward(), ["self", "prevent"]), ["up"])),
|
|
915
|
+
t[18] || (t[18] = f(r((s) => e.addPointerElement(s), ["stop", "self"]), ["enter", "tab"]))
|
|
916
|
+
],
|
|
917
|
+
onKeyup: t[19] || (t[19] = f((s) => e.deactivate(), ["esc"])),
|
|
918
|
+
role: "combobox",
|
|
919
|
+
"aria-expanded": e.isOpen,
|
|
920
|
+
"aria-owns": "listbox-" + e.id,
|
|
921
|
+
"aria-activedescendant": e.isOpen && e.pointer !== null ? e.id + "-" + e.pointer : null
|
|
922
|
+
}, [
|
|
923
|
+
o(e.$slots, "caret", { toggle: e.toggle }, () => [
|
|
924
|
+
u(
|
|
925
|
+
"div",
|
|
926
|
+
{
|
|
927
|
+
onMousedown: t[0] || (t[0] = r((s) => e.toggle(), ["prevent", "stop"])),
|
|
928
|
+
class: "multiselect__select"
|
|
929
|
+
},
|
|
930
|
+
null,
|
|
931
|
+
32
|
|
932
|
+
/* NEED_HYDRATION */
|
|
933
|
+
)
|
|
934
|
+
]),
|
|
935
|
+
o(e.$slots, "clear", { search: e.search }),
|
|
936
|
+
u(
|
|
937
|
+
"div",
|
|
938
|
+
K,
|
|
939
|
+
[
|
|
940
|
+
o(e.$slots, "selection", {
|
|
941
|
+
search: e.search,
|
|
942
|
+
remove: e.removeElement,
|
|
943
|
+
values: n.visibleValues,
|
|
944
|
+
isOpen: e.isOpen
|
|
945
|
+
}, () => [
|
|
946
|
+
v(u(
|
|
947
|
+
"div",
|
|
948
|
+
R,
|
|
949
|
+
[
|
|
950
|
+
(d(!0), p(
|
|
951
|
+
L,
|
|
952
|
+
null,
|
|
953
|
+
$(n.visibleValues, (s, h) => o(e.$slots, "tag", {
|
|
954
|
+
option: s,
|
|
955
|
+
search: e.search,
|
|
956
|
+
remove: e.removeElement
|
|
957
|
+
}, () => [
|
|
958
|
+
(d(), p(
|
|
959
|
+
"span",
|
|
960
|
+
{
|
|
961
|
+
class: "multiselect__tag",
|
|
962
|
+
key: h,
|
|
963
|
+
onMousedown: t[1] || (t[1] = r(() => {
|
|
964
|
+
}, ["prevent"]))
|
|
965
|
+
},
|
|
966
|
+
[
|
|
967
|
+
u("span", {
|
|
968
|
+
textContent: g(e.getOptionLabel(s))
|
|
969
|
+
}, null, 8, q),
|
|
970
|
+
u("i", {
|
|
971
|
+
tabindex: "1",
|
|
972
|
+
onKeydown: f(r((m) => e.removeElement(s), ["prevent"]), ["enter"]),
|
|
973
|
+
onMousedown: r((m) => e.removeElement(s), ["prevent"]),
|
|
974
|
+
class: "multiselect__tag-icon"
|
|
975
|
+
}, null, 40, z)
|
|
976
|
+
],
|
|
977
|
+
32
|
|
978
|
+
/* NEED_HYDRATION */
|
|
979
|
+
))
|
|
980
|
+
])),
|
|
981
|
+
256
|
|
982
|
+
/* UNKEYED_FRAGMENT */
|
|
983
|
+
))
|
|
984
|
+
],
|
|
985
|
+
512
|
|
986
|
+
/* NEED_PATCH */
|
|
987
|
+
), [
|
|
988
|
+
[w, n.visibleValues.length > 0]
|
|
989
|
+
]),
|
|
990
|
+
e.internalValue && e.internalValue.length > i.limit ? o(e.$slots, "limit", { key: 0 }, () => [
|
|
991
|
+
u("strong", {
|
|
992
|
+
class: "multiselect__strong",
|
|
993
|
+
textContent: g(i.limitText(e.internalValue.length - i.limit))
|
|
994
|
+
}, null, 8, j)
|
|
995
|
+
]) : c("v-if", !0)
|
|
996
|
+
]),
|
|
997
|
+
B(k, { name: "multiselect__loading" }, {
|
|
998
|
+
default: T(() => [
|
|
999
|
+
o(e.$slots, "loading", {}, () => [
|
|
1000
|
+
v(u(
|
|
1001
|
+
"div",
|
|
1002
|
+
I,
|
|
1003
|
+
null,
|
|
1004
|
+
512
|
|
1005
|
+
/* NEED_PATCH */
|
|
1006
|
+
), [
|
|
1007
|
+
[w, i.loading]
|
|
1008
|
+
])
|
|
1009
|
+
])
|
|
1010
|
+
]),
|
|
1011
|
+
_: 3
|
|
1012
|
+
/* FORWARDED */
|
|
1013
|
+
}),
|
|
1014
|
+
e.searchable ? (d(), p("input", {
|
|
1015
|
+
key: 0,
|
|
1016
|
+
ref: "search",
|
|
1017
|
+
name: i.name,
|
|
1018
|
+
id: e.id,
|
|
1019
|
+
type: "text",
|
|
1020
|
+
autocomplete: "off",
|
|
1021
|
+
spellcheck: i.spellcheck,
|
|
1022
|
+
placeholder: e.placeholder,
|
|
1023
|
+
required: n.isRequired,
|
|
1024
|
+
style: S(n.inputStyle),
|
|
1025
|
+
value: e.search,
|
|
1026
|
+
disabled: i.disabled,
|
|
1027
|
+
tabindex: i.tabindex,
|
|
1028
|
+
"aria-label": i.name + "-searchbox",
|
|
1029
|
+
onInput: t[2] || (t[2] = (s) => e.updateSearch(s.target.value)),
|
|
1030
|
+
onFocus: t[3] || (t[3] = r((s) => e.activate(), ["prevent"])),
|
|
1031
|
+
onBlur: t[4] || (t[4] = r((s) => e.deactivate(), ["prevent"])),
|
|
1032
|
+
onKeyup: t[5] || (t[5] = f((s) => e.deactivate(), ["esc"])),
|
|
1033
|
+
onKeydown: [
|
|
1034
|
+
t[6] || (t[6] = f(r((s) => e.pointerForward(), ["prevent"]), ["down"])),
|
|
1035
|
+
t[7] || (t[7] = f(r((s) => e.pointerBackward(), ["prevent"]), ["up"])),
|
|
1036
|
+
t[8] || (t[8] = f(r((s) => e.addPointerElement(s), ["prevent", "stop", "self"]), ["enter"])),
|
|
1037
|
+
t[9] || (t[9] = f(r((s) => e.removeLastElement(), ["stop"]), ["delete"]))
|
|
1038
|
+
],
|
|
1039
|
+
class: "multiselect__input",
|
|
1040
|
+
"aria-controls": "listbox-" + e.id
|
|
1041
|
+
}, null, 44, W)) : c("v-if", !0),
|
|
1042
|
+
n.isSingleLabelVisible ? (d(), p(
|
|
1043
|
+
"span",
|
|
1044
|
+
{
|
|
1045
|
+
key: 1,
|
|
1046
|
+
class: "multiselect__single",
|
|
1047
|
+
onMousedown: t[10] || (t[10] = r((...s) => e.toggle && e.toggle(...s), ["prevent"]))
|
|
1048
|
+
},
|
|
1049
|
+
[
|
|
1050
|
+
o(e.$slots, "singleLabel", { option: n.singleValue }, () => [
|
|
1051
|
+
b(
|
|
1052
|
+
g(e.currentOptionLabel),
|
|
1053
|
+
1
|
|
1054
|
+
/* TEXT */
|
|
1055
|
+
)
|
|
1056
|
+
])
|
|
1057
|
+
],
|
|
1058
|
+
32
|
|
1059
|
+
/* NEED_HYDRATION */
|
|
1060
|
+
)) : c("v-if", !0),
|
|
1061
|
+
n.isPlaceholderVisible ? (d(), p(
|
|
1062
|
+
"span",
|
|
1063
|
+
{
|
|
1064
|
+
key: 2,
|
|
1065
|
+
class: "multiselect__placeholder",
|
|
1066
|
+
onMousedown: t[11] || (t[11] = r((...s) => e.toggle && e.toggle(...s), ["prevent"]))
|
|
1067
|
+
},
|
|
1068
|
+
[
|
|
1069
|
+
o(e.$slots, "placeholder", {}, () => [
|
|
1070
|
+
b(
|
|
1071
|
+
g(e.placeholder),
|
|
1072
|
+
1
|
|
1073
|
+
/* TEXT */
|
|
1074
|
+
)
|
|
1075
|
+
])
|
|
1076
|
+
],
|
|
1077
|
+
32
|
|
1078
|
+
/* NEED_HYDRATION */
|
|
1079
|
+
)) : c("v-if", !0)
|
|
1080
|
+
],
|
|
1081
|
+
512
|
|
1082
|
+
/* NEED_PATCH */
|
|
1083
|
+
),
|
|
1084
|
+
(d(), E(A, {
|
|
1085
|
+
to: "body",
|
|
1086
|
+
disabled: !i.useTeleport
|
|
1087
|
+
}, [
|
|
1088
|
+
B(k, { name: "multiselect" }, {
|
|
1089
|
+
default: T(() => [
|
|
1090
|
+
e.isOpen && a.ready ? (d(), p(
|
|
1091
|
+
"div",
|
|
1092
|
+
{
|
|
1093
|
+
key: 0,
|
|
1094
|
+
class: y(["multiselect__content-wrapper", i.contentWrapperClass]),
|
|
1095
|
+
onFocus: t[12] || (t[12] = (...s) => e.activate && e.activate(...s)),
|
|
1096
|
+
tabindex: "-1",
|
|
1097
|
+
onMousedown: t[13] || (t[13] = r(() => {
|
|
1098
|
+
}, ["prevent"])),
|
|
1099
|
+
style: S([a.dropdownStyles, { maxHeight: e.optimizedHeight + "px" }]),
|
|
1100
|
+
ref: "list"
|
|
1101
|
+
},
|
|
1102
|
+
[
|
|
1103
|
+
u("ul", {
|
|
1104
|
+
class: "multiselect__content",
|
|
1105
|
+
style: S(n.contentStyle),
|
|
1106
|
+
role: "listbox",
|
|
1107
|
+
id: "listbox-" + e.id,
|
|
1108
|
+
"aria-multiselectable": e.multiple
|
|
1109
|
+
}, [
|
|
1110
|
+
o(e.$slots, "beforeList"),
|
|
1111
|
+
e.multiple && e.max === e.internalValue.length ? (d(), p("li", X, [
|
|
1112
|
+
u("span", Y, [
|
|
1113
|
+
o(e.$slots, "maxElements", {}, () => [
|
|
1114
|
+
b(
|
|
1115
|
+
"Maximum of " + g(e.max) + " options selected. First remove a selected option to select another.",
|
|
1116
|
+
1
|
|
1117
|
+
/* TEXT */
|
|
1118
|
+
)
|
|
1119
|
+
])
|
|
1120
|
+
])
|
|
1121
|
+
])) : c("v-if", !0),
|
|
1122
|
+
!e.max || e.internalValue.length < e.max ? (d(!0), p(
|
|
1123
|
+
L,
|
|
1124
|
+
{ key: 1 },
|
|
1125
|
+
$(e.filteredOptions, (s, h) => (d(), p("li", {
|
|
1126
|
+
class: "multiselect__element",
|
|
1127
|
+
key: h,
|
|
1128
|
+
"aria-selected": e.isSelected(s),
|
|
1129
|
+
id: e.id + "-" + h,
|
|
1130
|
+
role: s && (s.$isLabel || s.$isDisabled) ? null : "option"
|
|
1131
|
+
}, [
|
|
1132
|
+
s && (s.$isLabel || s.$isDisabled) ? c("v-if", !0) : (d(), p("span", {
|
|
1133
|
+
key: 0,
|
|
1134
|
+
class: y([e.optionHighlight(h, s), "multiselect__option"]),
|
|
1135
|
+
onClick: r((m) => e.select(s), ["stop"]),
|
|
1136
|
+
onMouseenter: r((m) => e.pointerSet(h), ["self"]),
|
|
1137
|
+
"data-select": s && s.isTag ? e.tagPlaceholder : n.selectLabelText,
|
|
1138
|
+
"data-selected": n.selectedLabelText,
|
|
1139
|
+
"data-deselect": n.deselectLabelText
|
|
1140
|
+
}, [
|
|
1141
|
+
o(e.$slots, "option", {
|
|
1142
|
+
option: s,
|
|
1143
|
+
search: e.search,
|
|
1144
|
+
index: h
|
|
1145
|
+
}, () => [
|
|
1146
|
+
u(
|
|
1147
|
+
"span",
|
|
1148
|
+
null,
|
|
1149
|
+
g(e.getOptionLabel(s)),
|
|
1150
|
+
1
|
|
1151
|
+
/* TEXT */
|
|
1152
|
+
)
|
|
1153
|
+
])
|
|
1154
|
+
], 42, Q)),
|
|
1155
|
+
s && (s.$isLabel || s.$isDisabled) ? (d(), p("span", {
|
|
1156
|
+
key: 1,
|
|
1157
|
+
"data-select": e.groupSelect && n.selectGroupLabelText,
|
|
1158
|
+
"data-deselect": e.groupSelect && n.deselectGroupLabelText,
|
|
1159
|
+
class: y([e.groupHighlight(h, s), "multiselect__option"]),
|
|
1160
|
+
onMouseenter: r((m) => e.groupSelect && e.pointerSet(h), ["self"]),
|
|
1161
|
+
onMousedown: r((m) => e.selectGroup(s), ["prevent"])
|
|
1162
|
+
}, [
|
|
1163
|
+
o(e.$slots, "option", {
|
|
1164
|
+
option: s,
|
|
1165
|
+
search: e.search,
|
|
1166
|
+
index: h
|
|
1167
|
+
}, () => [
|
|
1168
|
+
u(
|
|
1169
|
+
"span",
|
|
1170
|
+
null,
|
|
1171
|
+
g(e.getOptionLabel(s)),
|
|
1172
|
+
1
|
|
1173
|
+
/* TEXT */
|
|
1174
|
+
)
|
|
1175
|
+
])
|
|
1176
|
+
], 42, Z)) : c("v-if", !0)
|
|
1177
|
+
], 8, J))),
|
|
1178
|
+
128
|
|
1179
|
+
/* KEYED_FRAGMENT */
|
|
1180
|
+
)) : c("v-if", !0),
|
|
1181
|
+
v(u(
|
|
1182
|
+
"li",
|
|
1183
|
+
null,
|
|
1184
|
+
[
|
|
1185
|
+
u("span", x, [
|
|
1186
|
+
o(e.$slots, "noResult", { search: e.search }, () => [
|
|
1187
|
+
t[20] || (t[20] = b("No elements found. Consider changing the search query."))
|
|
1188
|
+
])
|
|
1189
|
+
])
|
|
1190
|
+
],
|
|
1191
|
+
512
|
|
1192
|
+
/* NEED_PATCH */
|
|
1193
|
+
), [
|
|
1194
|
+
[w, i.showNoResults && e.filteredOptions.length === 0 && e.search && !i.loading]
|
|
1195
|
+
]),
|
|
1196
|
+
v(u(
|
|
1197
|
+
"li",
|
|
1198
|
+
null,
|
|
1199
|
+
[
|
|
1200
|
+
u("span", _, [
|
|
1201
|
+
o(e.$slots, "noOptions", {}, () => [
|
|
1202
|
+
t[21] || (t[21] = b("List is empty."))
|
|
1203
|
+
])
|
|
1204
|
+
])
|
|
1205
|
+
],
|
|
1206
|
+
512
|
|
1207
|
+
/* NEED_PATCH */
|
|
1208
|
+
), [
|
|
1209
|
+
[w, i.showNoOptions && (e.options.length === 0 || n.hasOptionGroup === !0 && e.filteredOptions.length === 0) && !e.search && !i.loading]
|
|
1210
|
+
]),
|
|
1211
|
+
o(e.$slots, "afterList")
|
|
1212
|
+
], 12, U)
|
|
1213
|
+
],
|
|
1214
|
+
38
|
|
1215
|
+
/* CLASS, STYLE, NEED_HYDRATION */
|
|
1216
|
+
)) : c("v-if", !0)
|
|
1217
|
+
]),
|
|
1218
|
+
_: 3
|
|
1219
|
+
/* FORWARDED */
|
|
1220
|
+
})
|
|
1221
|
+
], 8, ["disabled"]))
|
|
1222
|
+
], 42, N);
|
|
1223
|
+
}
|
|
1224
|
+
H.render = ee;
|
|
207
1225
|
export {
|
|
208
|
-
|
|
1226
|
+
H as Multiselect,
|
|
1227
|
+
H as default,
|
|
1228
|
+
F as multiselectMixin,
|
|
1229
|
+
G as pointerMixin
|
|
209
1230
|
};
|