bitboss-ui 2.0.5 → 2.0.8
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/components/BaseDialog/BaseDialog.vue.d.ts +1 -3
- package/dist/composables/useOptions.d.ts +1 -1
- package/dist/index.js +89 -87
- package/dist/index.js.map +1 -1
- package/dist/index10.js +7 -39
- package/dist/index10.js.map +1 -1
- package/dist/index101.js +60 -87
- package/dist/index101.js.map +1 -1
- package/dist/index103.js +113 -258
- package/dist/index103.js.map +1 -1
- package/dist/index105.js +254 -388
- package/dist/index105.js.map +1 -1
- package/dist/index107.js +387 -98
- package/dist/index107.js.map +1 -1
- package/dist/index109.js +52 -48
- package/dist/index109.js.map +1 -1
- package/dist/index11.js +74 -188
- package/dist/index11.js.map +1 -1
- package/dist/index111.js +35 -34
- package/dist/index111.js.map +1 -1
- package/dist/index113.js +105 -23
- package/dist/index113.js.map +1 -1
- package/dist/index115.js +23 -156
- package/dist/index115.js.map +1 -1
- package/dist/index117.js +153 -112
- package/dist/index117.js.map +1 -1
- package/dist/index119.js +115 -39
- package/dist/index119.js.map +1 -1
- package/dist/index12.js +38 -80
- package/dist/index12.js.map +1 -1
- package/dist/index121.js +36 -40
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +34 -37
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +30 -21
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +47 -2
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +35 -21
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +2 -2
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +21 -312
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +2 -24
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +312 -2
- package/dist/index129.js.map +1 -1
- package/dist/index13.js +196 -0
- package/dist/index13.js.map +1 -0
- package/dist/index130.js +24 -5
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +2 -9
- package/dist/index131.js.map +1 -1
- package/dist/index132.js +5 -6
- package/dist/index132.js.map +1 -1
- package/dist/index133.js +9 -3
- package/dist/index133.js.map +1 -1
- package/dist/index134.js +6 -3
- package/dist/index134.js.map +1 -1
- package/dist/index135.js +1 -1
- package/dist/index136.js +1 -1
- package/dist/index137.js +1 -1
- package/dist/index138.js +1 -1
- package/dist/index139.js +1 -1
- package/dist/index14.js +73 -121
- package/dist/index14.js.map +1 -1
- package/dist/index140.js +1 -1
- package/dist/index141.js +1 -1
- package/dist/index142.js +1 -1
- package/dist/index143.js +1 -1
- package/dist/index144.js +1 -1
- package/dist/index145.js +1 -1
- package/dist/index146.js +1 -1
- package/dist/index147.js +1 -1
- package/dist/index148.js +1 -1
- package/dist/index149.js +1 -1
- package/dist/index150.js +1 -1
- package/dist/index151.js +1 -1
- package/dist/index152.js +1 -1
- package/dist/index153.js +1 -1
- package/dist/index154.js +1 -1
- package/dist/index155.js +1 -1
- package/dist/index156.js +1 -1
- package/dist/index157.js +1 -1
- package/dist/index158.js +1 -1
- package/dist/index159.js +2 -2
- package/dist/index16.js +119 -118
- package/dist/index16.js.map +1 -1
- package/dist/index160.js +6 -0
- package/dist/index160.js.map +1 -0
- package/dist/index161.js +1 -1
- package/dist/index163.js +2 -2
- package/dist/index165.js +1 -1
- package/dist/index166.js +1 -1
- package/dist/index167.js +1 -1
- package/dist/index168.js +1 -1
- package/dist/index169.js +2 -2
- package/dist/index170.js +6 -0
- package/dist/index170.js.map +1 -0
- package/dist/index171.js +3 -2
- package/dist/index171.js.map +1 -1
- package/dist/index173.js +2 -3
- package/dist/index173.js.map +1 -1
- package/dist/index174.js +1 -1
- package/dist/index175.js +1 -1
- package/dist/index176.js +1 -1
- package/dist/index177.js +1 -1
- package/dist/index178.js +1 -1
- package/dist/index179.js +1 -1
- package/dist/index18.js +120 -208
- package/dist/index18.js.map +1 -1
- package/dist/index180.js +1 -1
- package/dist/index181.js +1 -1
- package/dist/index182.js +1 -1
- package/dist/index183.js +2 -2
- package/dist/index184.js +6 -0
- package/dist/index184.js.map +1 -0
- package/dist/index185.js +1 -1
- package/dist/index187.js +1 -1
- package/dist/index189.js +1 -1
- package/dist/index190.js +1 -1
- package/dist/index191.js +1 -1
- package/dist/index192.js +1 -1
- package/dist/index193.js +1 -1
- package/dist/index194.js +1 -1
- package/dist/index195.js +1 -1
- package/dist/index196.js +1 -1
- package/dist/index197.js +3 -81
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +3 -3
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +81 -5
- package/dist/index199.js.map +1 -1
- package/dist/index20.js +193 -275
- package/dist/index20.js.map +1 -1
- package/dist/index200.js +2 -16
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +3 -16
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +124 -17
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +5 -19
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +119 -23
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +19 -3
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +16 -2
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +16 -8
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +2 -249
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +5 -0
- package/dist/index209.js.map +1 -0
- package/dist/index210.js +35 -52
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +173 -36
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +6 -5
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +39 -36
- package/dist/index213.js.map +1 -1
- package/dist/index215.js +13 -4
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +5 -2
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +369 -2
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +6 -40
- package/dist/index218.js.map +1 -1
- package/dist/{index214.js → index219.js} +1 -1
- package/dist/{index214.js.map → index219.js.map} +1 -1
- package/dist/index22.js +287 -247
- package/dist/index22.js.map +1 -1
- package/dist/index220.js +4 -13
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +2 -158
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +3 -84
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +10 -0
- package/dist/index223.js.map +1 -0
- package/dist/index224.js +19 -3
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +26 -34
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +3 -6
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +249 -7
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +49 -123
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +44 -123
- package/dist/index229.js.map +1 -1
- package/dist/index230.js +5 -2
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +49 -174
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +158 -5
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +83 -368
- package/dist/index233.js.map +1 -1
- package/dist/index235.js +2 -18
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +17 -105
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +109 -0
- package/dist/index237.js.map +1 -0
- package/dist/{index238.js → index239.js} +3 -3
- package/dist/{index238.js.map → index239.js.map} +1 -1
- package/dist/index24.js +249 -120
- package/dist/index24.js.map +1 -1
- package/dist/index241.js +2 -10
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +9 -2
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +3 -224
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +9 -281
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +23 -6
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +6 -2
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +16 -2
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +224 -2
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +281 -2
- package/dist/index249.js.map +1 -1
- package/dist/index250.js +6 -2
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +2 -2
- package/dist/index252.js +2 -3
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +2 -2
- package/dist/index254.js +2 -2
- package/dist/index255.js +2 -2
- package/dist/index256.js +122 -24
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +429 -20
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +6 -0
- package/dist/index258.js.map +1 -0
- package/dist/index26.js +119 -142
- package/dist/index26.js.map +1 -1
- package/dist/index260.js +6 -3
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +21 -8
- package/dist/index261.js.map +1 -1
- package/dist/index263.js +9 -3
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +439 -0
- package/dist/index264.js.map +1 -0
- package/dist/index265.js +127 -6
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +199 -15
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +4 -9
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +89 -3
- package/dist/index268.js.map +1 -1
- package/dist/index269.js +2 -12
- package/dist/index269.js.map +1 -1
- package/dist/index270.js +2 -9
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +2 -9
- package/dist/index271.js.map +1 -1
- package/dist/index272.js +2 -17
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +2 -431
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +2 -89
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +28 -2
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +17 -64
- package/dist/index276.js.map +1 -1
- package/dist/index278.js +3 -200
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +12 -2
- package/dist/index279.js.map +1 -1
- package/dist/index28.js +138 -83
- package/dist/index28.js.map +1 -1
- package/dist/index280.js +7 -124
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +7 -20
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +20 -0
- package/dist/index282.js.map +1 -0
- package/dist/index283.js +2 -436
- package/dist/index283.js.map +1 -1
- package/dist/index284.js +68 -126
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +5 -3
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +1 -1
- package/dist/index287.js +3 -211
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +214 -0
- package/dist/index288.js.map +1 -0
- package/dist/index290.js +4 -7
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +4 -19
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +58 -6
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +35 -4
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +7 -4
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +6 -58
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +18 -34
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +2 -11
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +47 -2
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +10 -46
- package/dist/index299.js.map +1 -1
- package/dist/index30.js +85 -115
- package/dist/index30.js.map +1 -1
- package/dist/index32.js +111 -112
- package/dist/index32.js.map +1 -1
- package/dist/index34.js +114 -365
- package/dist/index34.js.map +1 -1
- package/dist/index36.js +361 -283
- package/dist/index36.js.map +1 -1
- package/dist/index38.js +288 -106
- package/dist/index38.js.map +1 -1
- package/dist/index40.js +114 -121
- package/dist/index40.js.map +1 -1
- package/dist/index42.js +113 -200
- package/dist/index42.js.map +1 -1
- package/dist/index44.js +180 -90
- package/dist/index44.js.map +1 -1
- package/dist/index46.js +110 -78
- package/dist/index46.js.map +1 -1
- package/dist/index48.js +89 -54
- package/dist/index48.js.map +1 -1
- package/dist/index5.js +14 -78
- package/dist/index5.js.map +1 -1
- package/dist/index50.js +54 -84
- package/dist/index50.js.map +1 -1
- package/dist/index52.js +86 -60
- package/dist/index52.js.map +1 -1
- package/dist/index54.js +59 -40
- package/dist/index54.js.map +1 -1
- package/dist/index56.js +42 -55
- package/dist/index56.js.map +1 -1
- package/dist/index58.js +53 -103
- package/dist/index58.js.map +1 -1
- package/dist/index6.js +36 -58
- package/dist/index6.js.map +1 -1
- package/dist/index60.js +103 -89
- package/dist/index60.js.map +1 -1
- package/dist/index62.js +61 -88
- package/dist/index62.js.map +1 -1
- package/dist/index64.js +119 -77
- package/dist/index64.js.map +1 -1
- package/dist/index66.js +77 -91
- package/dist/index66.js.map +1 -1
- package/dist/index68.js +88 -49
- package/dist/index68.js.map +1 -1
- package/dist/index7.js +78 -20
- package/dist/index7.js.map +1 -1
- package/dist/index70.js +51 -304
- package/dist/index70.js.map +1 -1
- package/dist/index72.js +299 -115
- package/dist/index72.js.map +1 -1
- package/dist/index74.js +120 -214
- package/dist/index74.js.map +1 -1
- package/dist/index76.js +213 -36
- package/dist/index76.js.map +1 -1
- package/dist/index78.js +47 -0
- package/dist/index78.js.map +1 -0
- package/dist/index79.js +119 -230
- package/dist/index79.js.map +1 -1
- package/dist/index8.js +61 -7
- package/dist/index8.js.map +1 -1
- package/dist/index81.js +227 -154
- package/dist/index81.js.map +1 -1
- package/dist/index83.js +154 -207
- package/dist/index83.js.map +1 -1
- package/dist/index85.js +215 -26
- package/dist/index85.js.map +1 -1
- package/dist/index87.js +27 -88
- package/dist/index87.js.map +1 -1
- package/dist/index89.js +53 -88
- package/dist/index89.js.map +1 -1
- package/dist/index9.js +17 -76
- package/dist/index9.js.map +1 -1
- package/dist/index91.js +75 -44
- package/dist/index91.js.map +1 -1
- package/dist/index93.js +89 -15
- package/dist/index93.js.map +1 -1
- package/dist/index95.js +15 -166
- package/dist/index95.js.map +1 -1
- package/dist/index97.js +120 -59
- package/dist/index97.js.map +1 -1
- package/dist/index99.js +66 -52
- package/dist/index99.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/dist/index120.js +0 -47
- package/dist/index120.js.map +0 -1
- package/dist/index164.js +0 -6
- package/dist/index164.js.map +0 -1
- package/dist/index172.js +0 -6
- package/dist/index172.js.map +0 -1
- package/dist/index188.js +0 -6
- package/dist/index188.js.map +0 -1
- package/dist/index234.js +0 -6
- package/dist/index234.js.map +0 -1
- package/dist/index240.js +0 -5
- package/dist/index240.js.map +0 -1
- package/dist/index259.js +0 -10
- package/dist/index259.js.map +0 -1
- package/dist/index262.js +0 -26
- package/dist/index262.js.map +0 -1
- package/dist/index277.js +0 -8
- package/dist/index277.js.map +0 -1
- package/dist/index3.js +0 -17
- package/dist/index3.js.map +0 -1
- package/dist/index4.js +0 -43
- package/dist/index4.js.map +0 -1
- package/dist/index77.js +0 -130
- package/dist/index77.js.map +0 -1
package/dist/index42.js
CHANGED
|
@@ -1,222 +1,135 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
3
|
-
import
|
|
1
|
+
import { defineComponent as $, ref as p, toRef as l, openBlock as w, createBlock as B, unref as f, withCtx as i, renderSlot as s, normalizeProps as b, guardReactiveProps as h, createVNode as O, mergeProps as v, createSlots as z } from "vue";
|
|
2
|
+
import { useOptions as F } from "./index232.js";
|
|
3
|
+
import M from "./index40.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import S from "./index233.js";
|
|
4
6
|
/* empty css */
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import { useOptions as pe } from "./index221.js";
|
|
8
|
-
import ce from "./index236.js";
|
|
9
|
-
/* empty css */
|
|
10
|
-
import me from "./index238.js";
|
|
11
|
-
/* empty css */
|
|
12
|
-
import fe from "./index218.js";
|
|
13
|
-
/* empty css */
|
|
14
|
-
import ve from "./index220.js";
|
|
15
|
-
const ye = { class: "bb-base-tag__input-container" }, be = ["id", "aria-describedby", "autocomplete", "autofocus", "disabled", "placeholder", "readonly", "required", "onKeydown"], Ke = /* @__PURE__ */ Z({
|
|
16
|
-
__name: "BaseTag",
|
|
7
|
+
const I = /* @__PURE__ */ $({
|
|
8
|
+
__name: "BaseSwitchGroup",
|
|
17
9
|
props: {
|
|
18
|
-
"append:icon": {},
|
|
19
10
|
ariaDescribedby: {},
|
|
20
|
-
autocomplete: {},
|
|
21
11
|
autofocus: {},
|
|
22
|
-
|
|
12
|
+
color: {},
|
|
13
|
+
dependencies: {},
|
|
14
|
+
depsDebounceTime: { default: 0 },
|
|
15
|
+
direction: { default: "horizontal" },
|
|
23
16
|
disabled: { type: Boolean },
|
|
24
|
-
|
|
17
|
+
enforceCoherence: { type: Boolean },
|
|
25
18
|
hasErrors: { type: Boolean },
|
|
19
|
+
hideLabel: { type: Boolean },
|
|
26
20
|
id: {},
|
|
27
|
-
|
|
21
|
+
items: { type: [Array, Function], default: () => [] },
|
|
22
|
+
itemText: {},
|
|
23
|
+
itemValue: {},
|
|
24
|
+
loadingText: { default: "Caricamento..." },
|
|
28
25
|
modelValue: {},
|
|
29
|
-
|
|
26
|
+
modelValueDebounceTime: { default: 0 },
|
|
30
27
|
name: {},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
readonly: {},
|
|
34
|
-
required: { type: Boolean }
|
|
28
|
+
noDataText: { default: "Nessun elemento da visualizzare" },
|
|
29
|
+
readonly: {}
|
|
35
30
|
},
|
|
36
|
-
emits: ["blur", "change", "click", "
|
|
37
|
-
setup(
|
|
38
|
-
const o =
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
itemText: void 0,
|
|
57
|
-
itemValue: void 0,
|
|
58
|
-
modelValue: B(o, "modelValue"),
|
|
59
|
-
multiple: o.multiple,
|
|
60
|
-
resetQueryOnOptionSelected: !0,
|
|
61
|
-
stash: !1,
|
|
62
|
-
items: B(o, "modelValue"),
|
|
63
|
-
enforceCoherence: !1,
|
|
64
|
-
prefill: K,
|
|
65
|
-
modelValueDebounceTime: 0,
|
|
66
|
-
dependencies: N,
|
|
67
|
-
depsDebounceTime: 0,
|
|
31
|
+
emits: ["blur", "change", "click", "focus", "inactive", "input", "keydown", "mousedown", "mouseup", "update:modelValue"],
|
|
32
|
+
setup(g, { emit: y }) {
|
|
33
|
+
const a = g, o = y, m = p(), r = p(!1), {
|
|
34
|
+
innerLoading: T,
|
|
35
|
+
options: k,
|
|
36
|
+
selectOption: D,
|
|
37
|
+
unselectOption: L
|
|
38
|
+
} = F({
|
|
39
|
+
dependencies: l(a, "dependencies"),
|
|
40
|
+
depsDebounceTime: a.depsDebounceTime,
|
|
41
|
+
disabled: l(a, "disabled"),
|
|
42
|
+
emit: o,
|
|
43
|
+
enforceCoherence: a.enforceCoherence,
|
|
44
|
+
items: l(a, "items"),
|
|
45
|
+
itemText: a.itemText,
|
|
46
|
+
itemValue: a.itemValue,
|
|
47
|
+
modelValue: l(a, "modelValue"),
|
|
48
|
+
modelValueDebounceTime: a.modelValueDebounceTime,
|
|
49
|
+
multiple: !0,
|
|
50
|
+
prefill: !0,
|
|
68
51
|
queryDebounceTime: 0,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
},
|
|
84
|
-
var
|
|
85
|
-
|
|
86
|
-
},
|
|
87
|
-
var
|
|
88
|
-
|
|
89
|
-
e.preventDefault();
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
if ((n = i.value) == null || n.blur(), e.key === o.divider || e.key === "Unidentified" && t.value.includes(o.divider)) {
|
|
93
|
-
if (o.divider.length === 1 && t.value.includes(o.divider)) {
|
|
94
|
-
const m = t.value.split(o.divider)[0];
|
|
95
|
-
if (m)
|
|
96
|
-
t.value = m;
|
|
97
|
-
else {
|
|
98
|
-
t.value = "";
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
if (!t.value) return;
|
|
103
|
-
A(t.value) ? (l("duplicate", t.value), t.value = "") : (M(), G(de(S.value)));
|
|
104
|
-
}
|
|
105
|
-
}, G = (e) => {
|
|
106
|
-
P(e), E(), o.multiple || close();
|
|
107
|
-
}, J = (e) => {
|
|
108
|
-
_(e), E();
|
|
109
|
-
}, W = (e) => {
|
|
110
|
-
l("focus", e), F(), document.addEventListener("click", c), document.addEventListener("focusin", c);
|
|
111
|
-
}, X = (e) => {
|
|
112
|
-
l("click", e), !(o.disabled || o.readonly) && d.value instanceof HTMLElement && d.value.focus();
|
|
113
|
-
}, c = async (e) => {
|
|
114
|
-
if (e.target instanceof Node && b.value && !b.value.$el.contains(e.target)) {
|
|
115
|
-
close(), H(), document.removeEventListener("click", c), document.removeEventListener("focusin", c), q();
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
}, Y = {
|
|
119
|
-
onBlur: (e) => l("blur", e),
|
|
120
|
-
onChange: (e) => l("change", e),
|
|
121
|
-
onKeydown: (e) => l("keydown", e),
|
|
122
|
-
onInput: (e) => l("input", e)
|
|
52
|
+
resetQueryOnOptionSelected: !1,
|
|
53
|
+
stash: !1
|
|
54
|
+
}), C = (e, t) => {
|
|
55
|
+
o("change", e), t.selected ? L(t) : D(t);
|
|
56
|
+
}, E = {
|
|
57
|
+
onBlur: (e) => o("blur", e),
|
|
58
|
+
onClick: (e) => o("click", e),
|
|
59
|
+
onFocus: (e) => {
|
|
60
|
+
o("focus", e), r.value || (document.addEventListener("focusin", d, { passive: !0 }), document.addEventListener("click", u, { passive: !0 }), r.value = !0);
|
|
61
|
+
},
|
|
62
|
+
onInput: (e) => o("input", e),
|
|
63
|
+
onKeydown: (e) => o("keydown", e),
|
|
64
|
+
onMousedown: (e) => o("mousedown", e),
|
|
65
|
+
onMouseup: (e) => o("mouseup", e)
|
|
66
|
+
}, d = (e) => {
|
|
67
|
+
var t;
|
|
68
|
+
e.target instanceof HTMLElement && ((t = m.value) != null && t.contains(e.target) || (o("inactive"), r.value = !1, document.removeEventListener("focusin", d), document.removeEventListener("click", u)));
|
|
69
|
+
}, u = (e) => {
|
|
70
|
+
var t;
|
|
71
|
+
e.target instanceof HTMLElement && ((t = m.value) != null && t.contains(e.target) || (o("inactive"), r.value = !1, document.removeEventListener("focusin", d), document.removeEventListener("click", u)));
|
|
123
72
|
};
|
|
124
|
-
return (e,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
"bb-base-tag--readonly": e.readonly
|
|
134
|
-
}),
|
|
135
|
-
onClick: X
|
|
73
|
+
return (e, t) => (w(), B(S, {
|
|
74
|
+
class: "bb-base-switch-group",
|
|
75
|
+
direction: e.direction,
|
|
76
|
+
"has-errors": e.hasErrors,
|
|
77
|
+
"hide-label": e.hideLabel,
|
|
78
|
+
loading: !!f(T),
|
|
79
|
+
"loading-text": e.loadingText,
|
|
80
|
+
"no-data-text": e.noDataText,
|
|
81
|
+
options: f(k)
|
|
136
82
|
}, {
|
|
137
|
-
|
|
138
|
-
|
|
83
|
+
prepend: i(() => [
|
|
84
|
+
s(e.$slots, "prepend")
|
|
85
|
+
]),
|
|
86
|
+
loading: i(() => [
|
|
87
|
+
s(e.$slots, "loading")
|
|
88
|
+
]),
|
|
89
|
+
"no-data": i(() => [
|
|
90
|
+
s(e.$slots, "no-data")
|
|
91
|
+
]),
|
|
92
|
+
"option:prepend": i((n) => [
|
|
93
|
+
s(e.$slots, "option:prepend", b(h(n)))
|
|
94
|
+
]),
|
|
95
|
+
input: i(({ option: n, index: V }) => [
|
|
96
|
+
O(M, v({
|
|
97
|
+
id: n.valueHash,
|
|
98
|
+
"aria-describedby": e.ariaDescribedby,
|
|
99
|
+
autofocus: e.autofocus && !V,
|
|
100
|
+
checked: n.selected,
|
|
101
|
+
color: e.color,
|
|
102
|
+
disabled: n.disabled,
|
|
103
|
+
"has-errors": e.hasErrors,
|
|
104
|
+
name: e.name,
|
|
105
|
+
readonly: e.readonly,
|
|
106
|
+
"true-value": n.value
|
|
107
|
+
}, E, {
|
|
108
|
+
onChange: (c) => C(c, n)
|
|
109
|
+
}), z({ _: 2 }, [
|
|
110
|
+
e.$slots.icon ? {
|
|
111
|
+
name: "icon",
|
|
112
|
+
fn: i((c) => [
|
|
113
|
+
s(e.$slots, "icon", v({
|
|
114
|
+
item: n.item,
|
|
115
|
+
text: n.text
|
|
116
|
+
}, c))
|
|
117
|
+
]),
|
|
118
|
+
key: "0"
|
|
119
|
+
} : void 0
|
|
120
|
+
]), 1040, ["id", "aria-describedby", "autofocus", "checked", "color", "disabled", "has-errors", "name", "readonly", "true-value", "onChange"])
|
|
139
121
|
]),
|
|
140
|
-
"append
|
|
141
|
-
|
|
122
|
+
"option:append": i((n) => [
|
|
123
|
+
s(e.$slots, "option:prepend", b(h(n)))
|
|
142
124
|
]),
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
ref_key: "innerContainer",
|
|
146
|
-
ref: T,
|
|
147
|
-
"append:icon": o["append:icon"],
|
|
148
|
-
"prepend:icon": o["prepend:icon"]
|
|
149
|
-
}, {
|
|
150
|
-
prepend: a(() => [
|
|
151
|
-
u(e.$slots, "prepend")
|
|
152
|
-
]),
|
|
153
|
-
prefix: a(() => [
|
|
154
|
-
u(e.$slots, "prefix")
|
|
155
|
-
]),
|
|
156
|
-
append: a(() => [
|
|
157
|
-
u(e.$slots, "append")
|
|
158
|
-
]),
|
|
159
|
-
suffix: a(() => [
|
|
160
|
-
u(e.$slots, "suffix")
|
|
161
|
-
]),
|
|
162
|
-
default: a(() => [
|
|
163
|
-
O(v(ue), { tag: "span" }, {
|
|
164
|
-
default: a(() => [
|
|
165
|
-
I("span", ye, [
|
|
166
|
-
e.multiple ? (f(), ee(oe, { key: 0 }, [
|
|
167
|
-
e.comma ? (f(), C(me, {
|
|
168
|
-
key: 0,
|
|
169
|
-
ref_key: "commaBox",
|
|
170
|
-
ref: V,
|
|
171
|
-
options: v(p)
|
|
172
|
-
}, null, 8, ["options"])) : (f(), C(ce, {
|
|
173
|
-
key: 1,
|
|
174
|
-
ref_key: "chipsBox",
|
|
175
|
-
ref: w,
|
|
176
|
-
options: v(p),
|
|
177
|
-
"onOption:unselected": J
|
|
178
|
-
}, null, 8, ["options"]))
|
|
179
|
-
], 64)) : te("", !0),
|
|
180
|
-
ne(I("input", le({
|
|
181
|
-
id: e.id,
|
|
182
|
-
ref_key: "input",
|
|
183
|
-
ref: d
|
|
184
|
-
}, Y, {
|
|
185
|
-
"onUpdate:modelValue": n[0] || (n[0] = (m) => ae(t) ? t.value = m : null),
|
|
186
|
-
"aria-describedby": e.ariaDescribedby,
|
|
187
|
-
autocomplete: e.autocomplete,
|
|
188
|
-
autofocus: e.autofocus,
|
|
189
|
-
class: "bb-base-tag__text-input",
|
|
190
|
-
disabled: e.disabled,
|
|
191
|
-
"enter-key-hint": "next",
|
|
192
|
-
placeholder: L.value,
|
|
193
|
-
readonly: e.readonly,
|
|
194
|
-
required: e.required && !e.multiple || e.multiple && !e.modelValue.length,
|
|
195
|
-
type: "text",
|
|
196
|
-
onFocus: s(W, ["stop"]),
|
|
197
|
-
onKeydown: [
|
|
198
|
-
y(s(U, ["stop"]), ["delete"]),
|
|
199
|
-
y(s(Q, ["stop"]), ["left"]),
|
|
200
|
-
y(s(z, ["stop", "prevent"]), ["esc"]),
|
|
201
|
-
y(s(R, ["stop"]), ["right"])
|
|
202
|
-
],
|
|
203
|
-
onKeyup: s(j, ["stop"])
|
|
204
|
-
}), null, 16, be), [
|
|
205
|
-
[ie, v(t)]
|
|
206
|
-
])
|
|
207
|
-
])
|
|
208
|
-
]),
|
|
209
|
-
_: 1
|
|
210
|
-
})
|
|
211
|
-
]),
|
|
212
|
-
_: 3
|
|
213
|
-
}, 8, ["append:icon", "prepend:icon"])
|
|
125
|
+
append: i(() => [
|
|
126
|
+
s(e.$slots, "prepend")
|
|
214
127
|
]),
|
|
215
128
|
_: 3
|
|
216
|
-
}, 8, ["
|
|
129
|
+
}, 8, ["direction", "has-errors", "hide-label", "loading", "loading-text", "no-data-text", "options"]));
|
|
217
130
|
}
|
|
218
131
|
});
|
|
219
132
|
export {
|
|
220
|
-
|
|
133
|
+
I as default
|
|
221
134
|
};
|
|
222
135
|
//# sourceMappingURL=index42.js.map
|
package/dist/index42.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index42.js","sources":["../src/components/BaseTag/BaseTag.vue"],"sourcesContent":["<template>\n\t<CommonInputOuterContainer\n\t\tref=\"outerContainer\"\n\t\t:class=\"{\n\t\t\t'bb-base-tag': true,\n\t\t\t'bb-base-tag--active': active,\n\t\t\t'bb-base-tag--disabled': disabled,\n\t\t\t'bb-base-tag--loading': loading,\n\t\t\t'bb-base-tag--errors': hasErrors,\n\t\t\t'bb-base-tag--readonly': readonly,\n\t\t}\"\n\t\t@click=\"onOuterContainerClick\"\n\t>\n\t\t<template #prepend-outer><slot name=\"prepend-outer\"></slot></template>\n\t\t<CommonInputInnerContainer\n\t\t\tref=\"innerContainer\"\n\t\t\t:append:icon=\"props['append:icon']\"\n\t\t\t:prepend:icon=\"props['prepend:icon']\"\n\t\t>\n\t\t\t<template #prepend><slot name=\"prepend\" /></template>\n\t\t\t<template #prefix><slot name=\"prefix\" /></template>\n\t\t\t<BbSmoothHeight tag=\"span\">\n\t\t\t\t<span class=\"bb-base-tag__input-container\">\n\t\t\t\t\t<template v-if=\"multiple\">\n\t\t\t\t\t\t<template v-if=\"comma\">\n\t\t\t\t\t\t\t<CommaBox ref=\"commaBox\" :options=\"selectedOptions\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<template v-else>\n\t\t\t\t\t\t\t<ChipsBox\n\t\t\t\t\t\t\t\tref=\"chipsBox\"\n\t\t\t\t\t\t\t\t:options=\"selectedOptions\"\n\t\t\t\t\t\t\t\t@option:unselected=\"onOptionUnselected\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</template>\n\n\t\t\t\t\t<input\n\t\t\t\t\t\t:id=\"id\"\n\t\t\t\t\t\tref=\"input\"\n\t\t\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t\t\t\tv-model=\"query\"\n\t\t\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t\t\t:autocomplete=\"autocomplete\"\n\t\t\t\t\t\t:autofocus=\"autofocus\"\n\t\t\t\t\t\t:class=\"'bb-base-tag__text-input'\"\n\t\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\t\tenter-key-hint=\"next\"\n\t\t\t\t\t\t:placeholder=\"computedPlaceholder\"\n\t\t\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t\t\t:required=\"\n\t\t\t\t\t\t\t(required && !multiple) || (multiple && !modelValue.length)\n\t\t\t\t\t\t\"\n\t\t\t\t\t\t:type=\"'text'\"\n\t\t\t\t\t\t@focus.stop=\"onInputFocus\"\n\t\t\t\t\t\t@keydown.stop.delete=\"onBackspace\"\n\t\t\t\t\t\t@keydown.stop.left=\"onArrowLeft\"\n\t\t\t\t\t\t@keydown.stop.prevent.esc=\"onEscape\"\n\t\t\t\t\t\t@keydown.stop.right=\"onArrowRight\"\n\t\t\t\t\t\t@keyup.stop=\"onInputKeyup\"\n\t\t\t\t\t/>\n\t\t\t\t</span>\n\t\t\t</BbSmoothHeight>\n\t\t\t<template #append><slot name=\"append\" /></template>\n\t\t\t<template #suffix><slot name=\"suffix\" /></template>\n\t\t</CommonInputInnerContainer>\n\n\t\t<template #append-outer><slot name=\"append-outer\"></slot></template>\n\t</CommonInputOuterContainer>\n</template>\n\n<script setup lang=\"ts\">\nimport { BbSmoothHeight } from '@/index';\nimport { computed, ref } from 'vue';\nimport { isNotNil } from '@/utilities/functions/isNotNil';\nimport { last } from '@/utilities/functions/last';\nimport { nextTick } from 'vue';\nimport { toRef } from 'vue';\nimport { useOptions } from '@/composables/useOptions';\nimport ChipsBox from '../ChipsBox.vue';\nimport CommaBox from '../CommaBox.vue';\nimport CommonInputInnerContainer from '../CommonInputInnerContainer.vue';\nimport CommonInputOuterContainer from '../CommonInputOuterContainer.vue';\nimport type { InputHTMLAttributes, HTMLAttributes } from 'vue';\nimport type { Option as BaseOption } from '@/types/Option';\n\nexport type BaseTagProps = {\n\t/**\n\t * Name of the icon to be added at the end of the input.\n\t */\n\t// eslint-disable-next-line vue/prop-name-casing\n\t'append:icon'?: string;\n\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tariaDescribedby?: InputHTMLAttributes['aria-describedby'];\n\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tautocomplete?: InputHTMLAttributes['autocomplete'];\n\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Sets the display model for selected values to a list\n\t * of comma separated string. In this mode the user\n\t * cannot deselect an option by pressing the close button.\n\t */\n\tcomma?: boolean;\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * The divider key used to separate values from one another. By default it is \"Enter\"\n\t */\n\tdivider?: KeyboardEvent['key'];\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Sets the component in a loading state, usually triggering some visual styles.\n\t */\n\tloading?: boolean;\n\n\t/**\n\t * Used by v-model. Can be any serializable type.\n\t */\n\tmodelValue: any;\n\n\t/**\n\t * Allows the selection of multiple items.\n\t */\n\tmultiple?: boolean;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * String displayed when there's no data.\n\t */\n\tplaceholder?: InputHTMLAttributes['placeholder'];\n\n\t/**\n\t * Name of the icon to be added at the start of the input.\n\t */\n\t// eslint-disable-next-line vue/prop-name-casing\n\t'prepend:icon'?: string;\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: InputHTMLAttributes['readonly'];\n\n\t/**\n\t * Sets the input as required.\n\t */\n\trequired?: boolean;\n};\n\nconst props = withDefaults(defineProps<BaseTagProps>(), {\n\tdivider: 'Enter',\n\tmultiple: true,\n});\n\nexport type BaseTagEvents = {\n\t(e: 'blur', event: FocusEvent): void;\n\t(e: 'change', event: Event): void;\n\t(e: 'click', event: MouseEvent): void;\n\t(e: 'duplicate', string: string): void;\n\t(e: 'focus', event: FocusEvent): void;\n\t(e: 'inactive'): void;\n\t(e: 'input', event: Event): void;\n\t(e: 'keydown', event: KeyboardEvent): void;\n\t(e: 'keyup', event: KeyboardEvent): void;\n\t(e: 'update:modelValue', value: any): void;\n};\n\nconst emit = defineEmits<BaseTagEvents>();\n\nexport type BaseTagSlots = {\n\tappend?: (props: object) => any;\n\t'append-outer'?: (props: object) => any;\n\tprepend?: (props: object) => any;\n\t'prepend-outer'?: (props: object) => any;\n\tprefix?: (props: object) => any;\n\tsuffix?: (props: object) => any;\n};\n\ndefineSlots<BaseTagSlots>();\n\nif (props.multiple && !Array.isArray(props.modelValue)) {\n\tthrow new Error('Multiple is set to \"true\" but modelValue is not an array.');\n}\n\nconst outerContainer = ref<InstanceType<\n\ttypeof CommonInputOuterContainer\n> | null>(null);\nconst innerContainer = ref<InstanceType<\n\ttypeof CommonInputInnerContainer\n> | null>(null);\nconst computedPlaceholder = computed(() => {\n\treturn props.placeholder;\n});\nconst commaBox = ref<InstanceType<typeof CommaBox> | null>(null);\nconst chipsBox = ref<InstanceType<typeof ChipsBox> | null>(null);\nconst selectedBox = computed(() =>\n\tprops.comma ? commaBox.value : chipsBox.value\n);\n\nconst input = ref<HTMLElement | null>(null);\nconst focusInput = () => {\n\tif (input.value instanceof HTMLInputElement) {\n\t\tinput.value.focus();\n\t}\n};\n/**\n * It should prefill if asked, or\n * when single if modelValue is not null\n * when multiple if modelValue is not empty\n */\nconst shouldPrefill =\n\t(!props.multiple && isNotNil(props.modelValue)) ||\n\t(props.multiple && !!props.modelValue.length);\n\nconst dependencies = ref([]);\n\nconst {\n\tquery,\n\talignQueryToState,\n\taddCurrentQueryToManualItems,\n\tselectedOptions,\n\tselectOption,\n\tunselectOption,\n\tvalueIsSelected,\n\tmanualItems,\n} = useOptions({\n\temit,\n\titemText: undefined,\n\titemValue: undefined,\n\tmodelValue: toRef(props, 'modelValue'),\n\tmultiple: props.multiple,\n\tresetQueryOnOptionSelected: true,\n\tstash: false,\n\titems: toRef(props, 'modelValue'),\n\tenforceCoherence: false,\n\tprefill: shouldPrefill,\n\tmodelValueDebounceTime: 0,\n\tdependencies,\n\tdepsDebounceTime: 0,\n\tqueryDebounceTime: 0,\n\tdisabled: toRef(props, 'disabled'),\n});\n\n/**\n * Applies a class when the user is inside this whole component.\n * We cannot use focus within as it doesn't work for elements that are teleported.\n * Also we cannot use the <input/> if we physically move focus to the options so\n * we track it manually.\n */\nconst active = ref(false);\n\nconst setActive = () => {\n\tactive.value = true;\n};\nconst setInactive = () => {\n\tactive.value = false;\n\temit('inactive');\n};\n\nconst canProcessKeyboardBindings = computed(() => {\n\tif (props.readonly) return false;\n\tif (props.disabled) return false;\n\tif (!selectedBox.value && props.multiple) return false;\n\treturn true;\n});\n\nconst onArrowLeft = (event: KeyboardEvent) => {\n\tif (!canProcessKeyboardBindings.value) {\n\t\treturn;\n\t}\n\tif (!props.multiple || query.value) {\n\t\treturn;\n\t}\n\tevent.preventDefault();\n\tif (!selectedOptions.value.length) return;\n\tselectedBox.value?.focusPrevious();\n};\nconst onArrowRight = (event: KeyboardEvent) => {\n\tif (!canProcessKeyboardBindings.value) {\n\t\treturn;\n\t}\n\tif (!props.multiple || query.value) {\n\t\treturn;\n\t}\n\tevent.preventDefault();\n\tif (!selectedOptions.value.length) return;\n\tselectedBox.value?.focusNext();\n};\n\nconst onBackspace = async () => {\n\tif (\n\t\t!canProcessKeyboardBindings.value ||\n\t\tquery.value ||\n\t\t!selectedOptions.value.length\n\t) {\n\t\treturn;\n\t}\n\tif (selectedBox.value?.getHighlighted()) {\n\t\tselectedBox.value.confirmOption();\n\t}\n\tawait nextTick();\n\tselectedBox.value?.focusPrevious();\n};\n\nconst onEscape = () => {\n\tselectedBox.value?.blur();\n};\n\nconst onInputKeyup = async (event: KeyboardEvent) => {\n\temit('keyup', event);\n\tif (props.readonly || props.disabled) {\n\t\tevent.preventDefault();\n\t\treturn;\n\t}\n\tselectedBox.value?.blur();\n\tif (\n\t\tevent.key === props.divider ||\n\t\t(event.key === 'Unidentified' && query.value.includes(props.divider))\n\t) {\n\t\tif (props.divider.length === 1 && query.value.includes(props.divider)) {\n\t\t\tconst found = query.value.split(props.divider)[0];\n\t\t\tif (found) {\n\t\t\t\tquery.value = found;\n\t\t\t} else {\n\t\t\t\tquery.value = '';\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (!query.value) return;\n\t\tif (valueIsSelected(query.value)) {\n\t\t\temit('duplicate', query.value);\n\t\t\tquery.value = '';\n\t\t} else {\n\t\t\taddCurrentQueryToManualItems();\n\t\t\tonOptionSelected(last(manualItems.value)!);\n\t\t}\n\t}\n};\n\nconst onOptionSelected = (option: BaseOption) => {\n\tselectOption(option);\n\tfocusInput();\n\tif (!props.multiple) {\n\t\tclose();\n\t}\n};\n\nconst onOptionUnselected = (option: BaseOption) => {\n\tunselectOption(option);\n\tfocusInput();\n};\n\nconst onInputFocus = (event: FocusEvent) => {\n\temit('focus', event);\n\tsetActive();\n\tdocument.addEventListener('click', onOutsideInteraction);\n\tdocument.addEventListener('focusin', onOutsideInteraction);\n};\n\n/**\n * When clicking on the outside container seamlessly move focus to the input and open the panel\n */\nconst onOuterContainerClick = (event: MouseEvent) => {\n\temit('click', event);\n\tif (props.disabled || props.readonly) return;\n\tif (input.value instanceof HTMLElement) {\n\t\tinput.value.focus();\n\t}\n};\n\n/**\n * On click outside of the container close the panel, remove active state.\n * In multiple selection clear query after a timeout\n */\nconst onOutsideInteraction = async (event: Event) => {\n\tif (event.target instanceof Node) {\n\t\tif (outerContainer.value) {\n\t\t\tif (!outerContainer.value.$el.contains(event.target)) {\n\t\t\t\tclose();\n\t\t\t\tsetInactive();\n\t\t\t\tdocument.removeEventListener('click', onOutsideInteraction);\n\t\t\t\tdocument.removeEventListener('focusin', onOutsideInteraction);\n\t\t\t\talignQueryToState();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n};\nconst eventListeners = {\n\tonBlur: (event: FocusEvent) => emit('blur', event),\n\tonChange: (event: Event) => emit('change', event),\n\tonKeydown: (event: KeyboardEvent) => emit('keydown', event),\n\tonInput: (event: Event) => emit('input', event),\n};\n</script>\n<style lang=\"postcss\">\n@import '@/assets/css/BaseTag';\n</style>\n"],"names":["props","__props","emit","__emit","outerContainer","ref","innerContainer","computedPlaceholder","computed","commaBox","chipsBox","selectedBox","input","focusInput","shouldPrefill","isNotNil","dependencies","query","alignQueryToState","addCurrentQueryToManualItems","selectedOptions","selectOption","unselectOption","valueIsSelected","manualItems","useOptions","toRef","active","setActive","setInactive","canProcessKeyboardBindings","onArrowLeft","event","_a","onArrowRight","onBackspace","nextTick","_b","onEscape","onInputKeyup","found","onOptionSelected","last","option","onOptionUnselected","onInputFocus","onOutsideInteraction","onOuterContainerClick","eventListeners"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiLA,UAAMA,IAAQC,GAkBRC,IAAOC;AAab,QAAIH,EAAM,YAAY,CAAC,MAAM,QAAQA,EAAM,UAAU;AAC9C,YAAA,IAAI,MAAM,2DAA2D;AAGtE,UAAAI,IAAiBC,EAEb,IAAI,GACRC,IAAiBD,EAEb,IAAI,GACRE,IAAsBC,EAAS,MAC7BR,EAAM,WACb,GACKS,IAAWJ,EAA0C,IAAI,GACzDK,IAAWL,EAA0C,IAAI,GACzDM,IAAcH;AAAA,MAAS,MAC5BR,EAAM,QAAQS,EAAS,QAAQC,EAAS;AAAA,IAAA,GAGnCE,IAAQP,EAAwB,IAAI,GACpCQ,IAAa,MAAM;AACpB,MAAAD,EAAM,iBAAiB,oBAC1BA,EAAM,MAA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AAuB;AAClD,MAAArB,EAAeqB,CAAM,GACV9B;IAAA,GAGNgC,IAAe,CAACb,MAAsB;AAC3C,MAAA9B,EAAK,SAAS8B,CAAK,GACTJ,KACD,SAAA,iBAAiB,SAASkB,CAAoB,GAC9C,SAAA,iBAAiB,WAAWA,CAAoB;AAAA,IAAA,GAMpDC,IAAwB,CAACf,MAAsB;AAEhD,MADJ9B,EAAK,SAAS8B,CAAK,GACf,EAAAhC,EAAM,YAAYA,EAAM,aACxBY,EAAM,iBAAiB,eAC1BA,EAAM,MAAM;IACb,GAOKkC,IAAuB,OAAOd,MAAiB;AAChD,UAAAA,EAAM,kBAAkB,QACvB5B,EAAe,SACd,CAACA,EAAe,MAAM,IAAI,SAAS4B,EAAM,MAAM,GAAG;AAC/C,iBACMH,KACH,SAAA,oBAAoB,SAASiB,CAAoB,GACjD,SAAA,oBAAoB,WAAWA,CAAoB,GAC1C5B;AAClB;AAAA,MACD;AAAA,IAEF,GAEK8B,IAAiB;AAAA,MACtB,QAAQ,CAAChB,MAAsB9B,EAAK,QAAQ8B,CAAK;AAAA,MACjD,UAAU,CAACA,MAAiB9B,EAAK,UAAU8B,CAAK;AAAA,MAChD,WAAW,CAACA,MAAyB9B,EAAK,WAAW8B,CAAK;AAAA,MAC1D,SAAS,CAACA,MAAiB9B,EAAK,SAAS8B,CAAK;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index42.js","sources":["../src/components/BaseSwitchGroup/BaseSwitchGroup.vue"],"sourcesContent":["<template>\n\t<OptionsContainer\n\t\tclass=\"bb-base-switch-group\"\n\t\t:direction=\"direction\"\n\t\t:has-errors=\"hasErrors\"\n\t\t:hide-label=\"hideLabel\"\n\t\t:loading=\"!!loading\"\n\t\t:loading-text=\"loadingText\"\n\t\t:no-data-text=\"noDataText\"\n\t\t:options=\"options\"\n\t>\n\t\t<template #prepend><slot name=\"prepend\"></slot></template>\n\t\t<template #loading><slot name=\"loading\"></slot></template>\n\t\t<template #no-data><slot name=\"no-data\"></slot></template>\n\t\t<template #option:prepend=\"data\"\n\t\t\t><slot name=\"option:prepend\" v-bind=\"data\"></slot\n\t\t></template>\n\t\t<template #input=\"{ option, index }\">\n\t\t\t<BaseSwitch\n\t\t\t\t:id=\"option.valueHash\"\n\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t:autofocus=\"autofocus && !index\"\n\t\t\t\t:checked=\"option.selected\"\n\t\t\t\t:color=\"color\"\n\t\t\t\t:disabled=\"option.disabled\"\n\t\t\t\t:has-errors=\"hasErrors\"\n\t\t\t\t:name=\"name\"\n\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t:true-value=\"option.value\"\n\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t\t@change=\"(event: Event) => onChange(event, option)\"\n\t\t\t>\n\t\t\t\t<template v-if=\"$slots.icon\" #icon=\"data\">\n\t\t\t\t\t<slot\n\t\t\t\t\t\t:item=\"option.item\"\n\t\t\t\t\t\tname=\"icon\"\n\t\t\t\t\t\t:text=\"option.text\"\n\t\t\t\t\t\tv-bind=\"data\"\n\t\t\t\t\t/>\n\t\t\t\t</template>\n\t\t\t</BaseSwitch>\n\t\t</template>\n\t\t<template #option:append=\"data\"\n\t\t\t><slot name=\"option:prepend\" v-bind=\"data\"></slot\n\t\t></template>\n\t\t<template #append><slot name=\"prepend\"></slot></template>\n\t</OptionsContainer>\n</template>\n\n<script setup lang=\"ts\" generic=\"T = any\">\nimport { ref, toRef } from 'vue';\nimport { useOptions } from '@/composables/useOptions';\nimport BaseSwitch from '../BaseSwitch/BaseSwitch.vue';\nimport type { Option } from '@/types/Option';\nimport type { SlotAttributes } from '../BaseCheckbox/BaseCheckbox.vue';\nimport type {\n\tBaseCheckboxGroupEvents,\n\tBaseCheckboxGroupProps,\n} from '../BaseCheckboxGroup/BaseCheckboxGroup.vue';\nimport OptionsContainer from '../OptionsContainer.vue';\n\nexport type BaseSwitchGroupEvents = BaseCheckboxGroupEvents;\n\nexport type BaseSwitchGroupProps<T> = BaseCheckboxGroupProps<T>;\n\nconst props = withDefaults(defineProps<BaseSwitchGroupProps<T>>(), {\n\tdepsDebounceTime: 0,\n\tdirection: 'horizontal',\n\titems: () => [],\n\tloadingText: 'Caricamento...',\n\tmodelValueDebounceTime: 0,\n\tnoDataText: 'Nessun elemento da visualizzare',\n});\n\nconst emit = defineEmits<BaseSwitchGroupEvents>();\n\ndefineSlots<{\n\tprepend?: (props: object) => any;\n\tloading?: (props: object) => any;\n\t'no-data'?: (props: object) => any;\n\t'option:prepend'?: (props: {\n\t\tchecked: boolean;\n\t\tdisabled: boolean;\n\t\tid?: string;\n\t\titem: T;\n\t\ttext: string;\n\t}) => any;\n\ticon?: (\n\t\tprops: SlotAttributes & {\n\t\t\titem: T;\n\t\t\ttext: string;\n\t\t}\n\t) => any;\n\tlabel?: (props: { item: T; text: string; checked: boolean }) => any;\n\t'option:append'?: (props: {\n\t\tchecked: boolean;\n\t\tdisabled: boolean;\n\t\tid?: string;\n\t\titem: T;\n\t\ttext: string;\n\t}) => any;\n\tappend?: (props: object) => any;\n}>();\n\nconst container = ref<HTMLElement>();\nconst active = ref(false);\n\nconst {\n\tinnerLoading: loading,\n\toptions,\n\tselectOption,\n\tunselectOption,\n} = useOptions({\n\tdependencies: toRef(props, 'dependencies'),\n\tdepsDebounceTime: props.depsDebounceTime,\n\tdisabled: toRef(props, 'disabled'),\n\temit,\n\tenforceCoherence: props.enforceCoherence,\n\titems: toRef(props, 'items'),\n\titemText: props.itemText,\n\titemValue: props.itemValue,\n\tmodelValue: toRef(props, 'modelValue'),\n\tmodelValueDebounceTime: props.modelValueDebounceTime,\n\tmultiple: true,\n\tprefill: true,\n\tqueryDebounceTime: 0,\n\tresetQueryOnOptionSelected: false,\n\tstash: false,\n});\n\nconst onChange = (event: Event, option: Option) => {\n\temit('change', event);\n\tif (!option.selected) {\n\t\tselectOption(option);\n\t} else {\n\t\tunselectOption(option);\n\t}\n};\n\nconst onFocus = (event: FocusEvent) => {\n\temit('focus', event);\n\tif (!active.value) {\n\t\tdocument.addEventListener('focusin', onDocumentFocus, { passive: true });\n\t\tdocument.addEventListener('click', onDocumentClick, { passive: true });\n\t\tactive.value = true;\n\t}\n};\n\nconst eventListeners = {\n\tonBlur: (event: FocusEvent) => emit('blur', event),\n\tonClick: (event: MouseEvent) => emit('click', event),\n\tonFocus,\n\tonInput: (event: Event) => emit('input', event),\n\tonKeydown: (event: KeyboardEvent) => emit('keydown', event),\n\tonMousedown: (event: MouseEvent) => emit('mousedown', event),\n\tonMouseup: (event: MouseEvent) => emit('mouseup', event),\n};\n\nconst onDocumentFocus = (event: FocusEvent) => {\n\tif (event.target instanceof HTMLElement) {\n\t\tif (!container.value?.contains(event.target)) {\n\t\t\temit('inactive');\n\t\t\tactive.value = false;\n\t\t\tdocument.removeEventListener('focusin', onDocumentFocus);\n\t\t\tdocument.removeEventListener('click', onDocumentClick);\n\t\t}\n\t}\n};\n\nconst onDocumentClick = (event: MouseEvent) => {\n\tif (event.target instanceof HTMLElement) {\n\t\tif (!container.value?.contains(event.target)) {\n\t\t\temit('inactive');\n\t\t\tactive.value = false;\n\t\t\tdocument.removeEventListener('focusin', onDocumentFocus);\n\t\t\tdocument.removeEventListener('click', onDocumentClick);\n\t\t}\n\t}\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BaseSwitchGroup';\n</style>\n"],"names":["props","__props","emit","__emit","container","ref","active","loading","options","selectOption","unselectOption","useOptions","toRef","onChange","event","option","eventListeners","onDocumentFocus","onDocumentClick","_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,UAAMA,IAAQC,GASRC,IAAOC,GA8BPC,IAAYC,KACZC,IAASD,EAAI,EAAK,GAElB;AAAA,MACL,cAAcE;AAAA,MACd,SAAAC;AAAA,MACA,cA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