bitboss-ui 2.0.102 → 2.0.103

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.
Files changed (173) hide show
  1. package/dist/components/BaseSelect/BaseSelect.vue.d.ts +10 -16
  2. package/dist/components/BaseSwitchGroup/BaseSwitchGroup.vue.d.ts +109 -7
  3. package/dist/components/BbSelect/BbSelect.vue.d.ts +2 -16
  4. package/dist/composables/useBaseOptions.d.ts +31 -0
  5. package/dist/composables/useCoherence.d.ts +20 -0
  6. package/dist/composables/useHashedWatcher.d.ts +2 -0
  7. package/dist/composables/useIndexById.d.ts +11 -0
  8. package/dist/composables/useItemsGetter.d.ts +12 -0
  9. package/dist/composables/usePrefill.d.ts +12 -0
  10. package/dist/index100.js +88 -60
  11. package/dist/index101.js +10 -13
  12. package/dist/index111.js +154 -126
  13. package/dist/index119.js +2 -2
  14. package/dist/index121.js +5 -5
  15. package/dist/index123.js +1 -1
  16. package/dist/index127.js +1 -1
  17. package/dist/index128.js +1 -1
  18. package/dist/index129.js +1 -1
  19. package/dist/index13.js +2 -2
  20. package/dist/index131.js +1 -1
  21. package/dist/index132.js +69 -65
  22. package/dist/index15.js +4 -4
  23. package/dist/index17.js +3 -3
  24. package/dist/index19.js +126 -82
  25. package/dist/index205.js +52 -80
  26. package/dist/index207.js +13 -5
  27. package/dist/index208.js +19 -15
  28. package/dist/index209.js +4 -16
  29. package/dist/index21.js +14 -14
  30. package/dist/index210.js +124 -17
  31. package/dist/index211.js +5 -19
  32. package/dist/index212.js +121 -23
  33. package/dist/index213.js +19 -3
  34. package/dist/index214.js +16 -2
  35. package/dist/index215.js +16 -8
  36. package/dist/index216.js +2 -250
  37. package/dist/index217.js +2 -52
  38. package/dist/index218.js +41 -44
  39. package/dist/index219.js +6 -5
  40. package/dist/index220.js +5 -60
  41. package/dist/index221.js +10 -51
  42. package/dist/index222.js +371 -0
  43. package/dist/index223.js +2 -13
  44. package/dist/index224.js +4 -2
  45. package/dist/index225.js +2 -4
  46. package/dist/index226.js +3 -2
  47. package/dist/index227.js +7 -20
  48. package/dist/index228.js +8 -4
  49. package/dist/index229.js +3 -3
  50. package/dist/index23.js +16 -16
  51. package/dist/index230.js +84 -168
  52. package/dist/index232.js +10 -0
  53. package/dist/index233.js +25 -8
  54. package/dist/index234.js +14 -123
  55. package/dist/index235.js +47 -124
  56. package/dist/index236.js +15 -2
  57. package/dist/index237.js +11 -40
  58. package/dist/index238.js +16 -6
  59. package/dist/index239.js +19 -5
  60. package/dist/index240.js +27 -12
  61. package/dist/index241.js +247 -366
  62. package/dist/index242.js +52 -3
  63. package/dist/index243.js +44 -7
  64. package/dist/index244.js +5 -2
  65. package/dist/index245.js +59 -17
  66. package/dist/index246.js +2 -106
  67. package/dist/index247.js +117 -0
  68. package/dist/index248.js +3 -100
  69. package/dist/index249.js +4 -0
  70. package/dist/index25.js +6 -6
  71. package/dist/index250.js +18 -2
  72. package/dist/index251.js +106 -2
  73. package/dist/index253.js +100 -3
  74. package/dist/index255.js +12 -23
  75. package/dist/index256.js +2 -89
  76. package/dist/index257.js +4 -0
  77. package/dist/index258.js +10 -9
  78. package/dist/index259.js +3 -6
  79. package/dist/index260.js +6 -16
  80. package/dist/index261.js +15 -8
  81. package/dist/index262.js +9 -8
  82. package/dist/index263.js +23 -281
  83. package/dist/index264.js +89 -6
  84. package/dist/index266.js +3 -2
  85. package/dist/index268.js +7 -2
  86. package/dist/index269.js +176 -2
  87. package/dist/index27.js +1 -1
  88. package/dist/index270.js +281 -2
  89. package/dist/index271.js +6 -2
  90. package/dist/index272.js +2 -2
  91. package/dist/index273.js +2 -2
  92. package/dist/index274.js +2 -2
  93. package/dist/index275.js +2 -28
  94. package/dist/index276.js +2 -22
  95. package/dist/index277.js +128 -0
  96. package/dist/index278.js +429 -5
  97. package/dist/index279.js +22 -3
  98. package/dist/index281.js +2 -4
  99. package/dist/index282.js +4 -224
  100. package/dist/index283.js +23 -171
  101. package/dist/index284.js +200 -3
  102. package/dist/index285.js +435 -11
  103. package/dist/index286.js +125 -7
  104. package/dist/index287.js +87 -15
  105. package/dist/index288.js +8 -3
  106. package/dist/index289.js +3 -7
  107. package/dist/index29.js +3 -3
  108. package/dist/index290.js +7 -11
  109. package/dist/index291.js +11 -2
  110. package/dist/index292.js +15 -124
  111. package/dist/index293.js +9 -431
  112. package/dist/index294.js +7 -21
  113. package/dist/index296.js +2 -2
  114. package/dist/index297.js +2 -89
  115. package/dist/index298.js +2 -200
  116. package/dist/index299.js +2 -436
  117. package/dist/index300.js +2 -127
  118. package/dist/index301.js +22 -2
  119. package/dist/index303.js +224 -3
  120. package/dist/index304.js +3 -213
  121. package/dist/index305.js +2 -65
  122. package/dist/index306.js +213 -5
  123. package/dist/index307.js +2 -3
  124. package/dist/index308.js +5 -3
  125. package/dist/index309.js +66 -3
  126. package/dist/index31.js +2 -2
  127. package/dist/index310.js +3 -58
  128. package/dist/index311.js +3 -33
  129. package/dist/index312.js +57 -7
  130. package/dist/index313.js +32 -7
  131. package/dist/index314.js +1 -1
  132. package/dist/index315.js +1 -1
  133. package/dist/index316.js +3 -7
  134. package/dist/index317.js +3 -18
  135. package/dist/index318.js +8 -7
  136. package/dist/index319.js +8 -4
  137. package/dist/index320.js +7 -2
  138. package/dist/index321.js +17 -45
  139. package/dist/index322.js +7 -480
  140. package/dist/index323.js +49 -0
  141. package/dist/index324.js +2 -424
  142. package/dist/index326.js +480 -2
  143. package/dist/index327.js +426 -0
  144. package/dist/index329.js +4 -0
  145. package/dist/index33.js +102 -61
  146. package/dist/index35.js +3 -3
  147. package/dist/index37.js +284 -244
  148. package/dist/index39.js +5 -5
  149. package/dist/index41.js +2 -2
  150. package/dist/index43.js +129 -84
  151. package/dist/index45.js +122 -120
  152. package/dist/index47.js +2 -2
  153. package/dist/index49.js +2 -2
  154. package/dist/index55.js +1 -1
  155. package/dist/index57.js +2 -2
  156. package/dist/index61.js +2 -2
  157. package/dist/index75.js +3 -3
  158. package/dist/index79.js +2 -2
  159. package/dist/index81.js +1 -1
  160. package/dist/index84.js +3 -3
  161. package/dist/index86.js +1 -1
  162. package/dist/index88.js +4 -4
  163. package/dist/index90.js +1 -1
  164. package/package.json +1 -1
  165. package/dist/composables/useOptions.d.ts +0 -43
  166. package/dist/index206.js +0 -4
  167. package/dist/index231.js +0 -86
  168. package/dist/index252.js +0 -12
  169. package/dist/index254.js +0 -11
  170. package/dist/index265.js +0 -4
  171. package/dist/index302.js +0 -5
  172. /package/dist/{index267.js → index295.js} +0 -0
  173. /package/dist/{index325.js → index328.js} +0 -0
package/dist/index39.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { defineComponent as U, ref as d, computed as h, onMounted as W, watch as Z, openBlock as g, createElementBlock as w, mergeProps as T, renderSlot as f, createElementVNode as c, Fragment as ee, renderList as ae, createCommentVNode as H, normalizeProps as re, guardReactiveProps as te, unref as b, normalizeClass as F, normalizeStyle as I } from "vue";
2
- import { clamp as le } from "./index206.js";
3
- import { head as O } from "./index250.js";
4
- import { isCssColor as Y } from "./index224.js";
5
- import { isNil as P } from "./index251.js";
2
+ import { clamp as le } from "./index246.js";
3
+ import { head as O } from "./index256.js";
4
+ import { isCssColor as Y } from "./index223.js";
5
+ import { isNil as P } from "./index257.js";
6
6
  import { isNotNil as ne } from "./index134.js";
7
7
  import { transposeValue as y } from "./index131.js";
8
- import { hash as J } from "./index213.js";
8
+ import { hash as J } from "./index229.js";
9
9
  const oe = { class: "bb-base-slider__slider-container" }, ie = {
10
10
  key: 0,
11
11
  class: "bb-base-slider__ticks-container"
package/dist/index41.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as I, ref as f, computed as n, watch as S, openBlock as h, createElementBlock as y, normalizeProps as r, guardReactiveProps as d, mergeProps as V, createCommentVNode as A, createElementVNode as l, renderSlot as F } from "vue";
2
- import { isCssColor as b } from "./index224.js";
3
- import { when as N } from "./index225.js";
2
+ import { isCssColor as b } from "./index223.js";
3
+ import { when as N } from "./index224.js";
4
4
  const x = { class: "bb-base-switch-container" }, $ = /* @__PURE__ */ I({
5
5
  __name: "BaseSwitch",
6
6
  props: {
package/dist/index43.js CHANGED
@@ -1,10 +1,17 @@
1
- import { defineComponent as B, ref as b, toRef as l, openBlock as w, createBlock as O, unref as v, withCtx as i, renderSlot as s, normalizeProps as m, guardReactiveProps as p, createVNode as z, mergeProps as h, createSlots as F } from "vue";
2
- import { useOptions as M } from "./index230.js";
3
- import S from "./index41.js";
1
+ import { defineComponent as z, ref as B, toRef as d, openBlock as G, createBlock as R, unref as u, withCtx as s, renderSlot as l, normalizeProps as v, guardReactiveProps as b, createVNode as W, mergeProps as w, createSlots as K } from "vue";
2
+ import N from "./index41.js";
4
3
  /* empty css */
5
- import H from "./index231.js";
4
+ import U from "./index230.js";
6
5
  /* empty css */
7
- const G = /* @__PURE__ */ B({
6
+ import { useLocale as q } from "./index232.js";
7
+ import { useItemsGetter as J } from "./index233.js";
8
+ import { useIndexById as E } from "./index234.js";
9
+ import { useBaseOptions as Q } from "./index235.js";
10
+ import { useCoherence as X } from "./index236.js";
11
+ import { hash as Y } from "./index229.js";
12
+ import { useHashedWatcher as L } from "./index237.js";
13
+ import { usePrefill as Z } from "./index238.js";
14
+ const pe = /* @__PURE__ */ z({
8
15
  __name: "BaseSwitchGroup",
9
16
  props: {
10
17
  ariaDescribedby: {},
@@ -21,122 +28,160 @@ const G = /* @__PURE__ */ B({
21
28
  items: { type: [Array, Function], default: () => [] },
22
29
  itemText: {},
23
30
  itemValue: {},
24
- loadingText: { default: "Caricamento..." },
25
- max: {},
31
+ loadingText: {},
32
+ max: { default: 1 / 0 },
26
33
  modelValue: {},
27
34
  modelValueDebounceTime: { default: 0 },
28
35
  name: {},
29
- noDataText: { default: "Nessun elemento da visualizzare" },
36
+ noDataText: {},
30
37
  readonly: { type: Boolean }
31
38
  },
32
39
  emits: ["blur", "change", "click", "focus", "inactive", "input", "keydown", "mousedown", "mouseup", "update:modelValue"],
33
- setup(g, { emit: y }) {
34
- const n = g, a = y, f = b(), r = b(!1), {
35
- innerLoading: T,
36
- options: k,
37
- selectOption: D,
38
- unselectOption: L
39
- } = M({
40
- dependencies: l(n, "dependencies"),
41
- depsDebounceTime: n.depsDebounceTime,
42
- disabled: l(n, "disabled"),
43
- emit: a,
44
- enforceCoherence: n.enforceCoherence,
45
- items: l(n, "items"),
46
- itemText: n.itemText,
47
- itemValue: n.itemValue,
48
- max: n.max,
49
- modelValue: l(n, "modelValue"),
50
- modelValueDebounceTime: n.modelValueDebounceTime,
40
+ setup(C, { emit: D }) {
41
+ const o = C, t = D;
42
+ if (!Array.isArray(o.modelValue))
43
+ throw new Error("Model value must be an array in checkbox group.");
44
+ const { t: y } = q(), g = B(), r = B(!1), {
45
+ getter: c,
46
+ items: $,
47
+ loading: I
48
+ } = J({
49
+ items: d(o, "items"),
50
+ debounce: 0
51
+ }), m = () => {
52
+ o.enforceCoherence && !T.value && t("update:modelValue", P.value.coherent);
53
+ }, { hasPrefilled: H } = Z({
54
+ onStart: !0,
55
+ currentValue: o.modelValue,
51
56
  multiple: !0,
52
- prefill: !0,
53
- queryDebounceTime: 0,
54
- resetQueryOnOptionSelected: !1,
55
- stash: !1
56
- }), C = (e) => {
57
- if (n.id)
58
- return [n.id, e.valueHash].filter(Boolean).join("-");
59
- }, E = (e, t) => {
60
- a("change", e), t.selected ? L(t) : D(t);
61
- }, V = {
62
- onBlur: (e) => a("blur", e),
63
- onClick: (e) => a("click", e),
57
+ fn: async ({ prefill: e }) => {
58
+ await c(e, o.modelValue), m();
59
+ }
60
+ }), { data: V } = E({
61
+ items: d(o, "modelValue")
62
+ }), { options: k } = Q({
63
+ disabled: d(o, "disabled"),
64
+ items: $,
65
+ itemText: o.itemText,
66
+ itemValue: o.itemValue,
67
+ max: o.max,
68
+ selectable: !0,
69
+ selectedIndexedByHash: V
70
+ }), x = async (e) => {
71
+ t("update:modelValue", o.modelValue.concat(e.value));
72
+ }, S = async (e) => {
73
+ const a = { ...V.value };
74
+ delete a[e.valueHash], t("update:modelValue", Object.values(a));
75
+ }, { data: M } = E({
76
+ items: k,
77
+ key: "valueHash"
78
+ }), { coherent: T, status: P } = X({
79
+ modelValue: d(o, "modelValue"),
80
+ multiple: !0,
81
+ iteratee: (e) => !!M.value[Y(e)]
82
+ });
83
+ let i = 0;
84
+ L(
85
+ () => o.modelValue,
86
+ async () => {
87
+ i++, T.value || (await c(!1, o.modelValue), m()), i--;
88
+ },
89
+ {
90
+ debounce: o.modelValueDebounceTime
91
+ }
92
+ ), L(
93
+ () => [o.dependencies, o.items],
94
+ async () => {
95
+ H.value && (i++, await c(!1, o.modelValue), i === 1 && m(), i--);
96
+ },
97
+ {
98
+ debounce: o.depsDebounceTime
99
+ }
100
+ );
101
+ const F = (e) => {
102
+ if (o.id)
103
+ return [o.id, e.valueHash].filter(Boolean).join("-");
104
+ }, O = (e, a) => {
105
+ t("change", e), a.selected ? S(a) : x(a);
106
+ }, A = {
107
+ onBlur: (e) => t("blur", e),
108
+ onClick: (e) => t("click", e),
64
109
  onFocus: (e) => {
65
- a("focus", e), r.value || (document.addEventListener("focusin", d, { passive: !0 }), document.addEventListener("click", u, { passive: !0 }), r.value = !0);
110
+ t("focus", e), r.value || (document.addEventListener("focusin", p, { passive: !0 }), document.addEventListener("click", f, { passive: !0 }), r.value = !0);
66
111
  },
67
- onInput: (e) => a("input", e),
68
- onKeydown: (e) => a("keydown", e),
69
- onMousedown: (e) => a("mousedown", e),
70
- onMouseup: (e) => a("mouseup", e)
71
- }, d = (e) => {
72
- var t;
73
- e.target instanceof HTMLElement && ((t = f.value) != null && t.contains(e.target) || (a("inactive"), r.value = !1, document.removeEventListener("focusin", d), document.removeEventListener("click", u)));
74
- }, u = (e) => {
75
- var t;
76
- e.target instanceof HTMLElement && ((t = f.value) != null && t.contains(e.target) || (a("inactive"), r.value = !1, document.removeEventListener("focusin", d), document.removeEventListener("click", u)));
112
+ onInput: (e) => t("input", e),
113
+ onKeydown: (e) => t("keydown", e),
114
+ onMousedown: (e) => t("mousedown", e),
115
+ onMouseup: (e) => t("mouseup", e)
116
+ }, p = (e) => {
117
+ var a;
118
+ e.target instanceof HTMLElement && ((a = g.value) != null && a.contains(e.target) || (t("inactive"), r.value = !1, document.removeEventListener("focusin", p), document.removeEventListener("click", f)));
119
+ }, f = (e) => {
120
+ var a;
121
+ e.target instanceof HTMLElement && ((a = g.value) != null && a.contains(e.target) || (t("inactive"), r.value = !1, document.removeEventListener("focusin", p), document.removeEventListener("click", f)));
77
122
  };
78
- return (e, t) => (w(), O(H, {
123
+ return (e, a) => (G(), R(U, {
79
124
  class: "bb-base-switch-group",
80
125
  direction: e.direction,
81
126
  "has-errors": e.hasErrors,
82
127
  "hide-label": e.hideLabel,
83
- loading: !!v(T),
84
- "loading-text": e.loadingText,
85
- "no-data-text": e.noDataText,
86
- options: v(k)
128
+ loading: !!u(I),
129
+ "loading-text": e.loadingText || u(y)("common.loadingText"),
130
+ "no-data-text": e.noDataText || u(y)("common.noDataText"),
131
+ options: u(k)
87
132
  }, {
88
- prepend: i(() => [
89
- s(e.$slots, "prepend")
133
+ prepend: s(() => [
134
+ l(e.$slots, "prepend")
90
135
  ]),
91
- loading: i(() => [
92
- s(e.$slots, "loading")
136
+ loading: s(() => [
137
+ l(e.$slots, "loading")
93
138
  ]),
94
- "no-data": i(() => [
95
- s(e.$slots, "no-data")
139
+ "no-data": s(() => [
140
+ l(e.$slots, "no-data")
96
141
  ]),
97
- label: i((o) => [
98
- s(e.$slots, "label", m(p(o)))
142
+ label: s((n) => [
143
+ l(e.$slots, "label", v(b(n)))
99
144
  ]),
100
- "option:prepend": i((o) => [
101
- s(e.$slots, "option:prepend", m(p(o)))
145
+ "option:prepend": s((n) => [
146
+ l(e.$slots, "option:prepend", v(b(n)))
102
147
  ]),
103
- input: i(({ option: o, index: $ }) => [
104
- z(S, h({
105
- id: C(o),
148
+ input: s(({ option: n, index: j }) => [
149
+ W(N, w({
150
+ id: F(n),
106
151
  "aria-describedby": e.ariaDescribedby,
107
- autofocus: e.autofocus && !$,
108
- checked: o.selected,
152
+ autofocus: e.autofocus && !j,
153
+ checked: n.selected,
109
154
  color: e.color,
110
- disabled: o.disabled,
155
+ disabled: n.disabled,
111
156
  "has-errors": e.hasErrors,
112
157
  name: e.name,
113
158
  readonly: e.readonly,
114
- "true-value": o.value
115
- }, V, {
116
- onChange: (c) => E(c, o)
117
- }), F({ _: 2 }, [
159
+ "true-value": n.value
160
+ }, A, {
161
+ onChange: (h) => O(h, n)
162
+ }), K({ _: 2 }, [
118
163
  e.$slots.icon ? {
119
164
  name: "icon",
120
- fn: i((c) => [
121
- s(e.$slots, "icon", h({
122
- item: o.item,
123
- text: o.text
124
- }, c))
165
+ fn: s((h) => [
166
+ l(e.$slots, "icon", w({
167
+ item: n.item,
168
+ text: n.text
169
+ }, h))
125
170
  ]),
126
171
  key: "0"
127
172
  } : void 0
128
173
  ]), 1040, ["id", "aria-describedby", "autofocus", "checked", "color", "disabled", "has-errors", "name", "readonly", "true-value", "onChange"])
129
174
  ]),
130
- "option:append": i((o) => [
131
- s(e.$slots, "option:append", m(p(o)))
175
+ "option:append": s((n) => [
176
+ l(e.$slots, "option:append", v(b(n)))
132
177
  ]),
133
- append: i(() => [
134
- s(e.$slots, "append")
178
+ append: s(() => [
179
+ l(e.$slots, "append")
135
180
  ]),
136
181
  _: 3
137
182
  }, 8, ["direction", "has-errors", "hide-label", "loading", "loading-text", "no-data-text", "options"]));
138
183
  }
139
184
  });
140
185
  export {
141
- G as default
186
+ pe as default
142
187
  };
package/dist/index45.js CHANGED
@@ -1,19 +1,19 @@
1
- import { defineComponent as Y, ref as i, computed as k, toRef as B, openBlock as f, createBlock as C, normalizeClass as x, withCtx as a, renderSlot as s, createVNode as O, unref as v, createElementVNode as $, createElementBlock as ee, Fragment as oe, createCommentVNode as te, withDirectives as ne, mergeProps as le, isRef as ae, withModifiers as d, withKeys as y, vModelDynamic as re, nextTick as ie } from "vue";
1
+ import { defineComponent as R, ref as u, computed as f, toRef as E, watch as j, openBlock as v, createBlock as k, normalizeClass as Q, withCtx as l, renderSlot as s, createVNode as I, unref as Z, createElementVNode as $, createElementBlock as G, Fragment as J, createCommentVNode as W, withDirectives as X, mergeProps as Y, withModifiers as d, withKeys as y, vModelDynamic as ee, nextTick as te } from "vue";
2
2
  /* empty css */
3
3
  /* empty css */
4
- import ue from "./index128.js";
4
+ import oe from "./index128.js";
5
5
  /* empty css */
6
- import { isNotNil as se } from "./index134.js";
7
- import { last as de } from "./index214.js";
8
- import { useOptions as pe } from "./index230.js";
9
- import ce from "./index246.js";
6
+ import { last as ae } from "./index217.js";
7
+ import { useBaseOptions as ne } from "./index235.js";
8
+ import { useIndexById as le } from "./index234.js";
9
+ import re from "./index251.js";
10
10
  /* empty css */
11
- import me from "./index248.js";
11
+ import ie from "./index253.js";
12
12
  /* empty css */
13
- import fe from "./index221.js";
13
+ import ue from "./index205.js";
14
14
  /* empty css */
15
- import ve from "./index223.js";
16
- const ye = { class: "bb-base-tag__input-container" }, be = ["id", "aria-describedby", "autocomplete", "autofocus", "disabled", "placeholder", "readonly", "required", "onKeydown"], qe = /* @__PURE__ */ Y({
15
+ import se from "./index207.js";
16
+ const de = { class: "bb-base-tag__input-container" }, pe = ["id", "aria-describedby", "autocomplete", "autofocus", "disabled", "placeholder", "readonly", "required", "onKeydown"], $e = /* @__PURE__ */ R({
17
17
  __name: "BaseTag",
18
18
  props: {
19
19
  "append:icon": {},
@@ -37,106 +37,108 @@ const ye = { class: "bb-base-tag__input-container" }, be = ["id", "aria-describe
37
37
  required: { type: Boolean }
38
38
  },
39
39
  emits: ["blur", "change", "click", "duplicate", "focus", "inactive", "input", "keydown", "keyup", "update:modelValue"],
40
- setup(D, { emit: I }) {
41
- const o = D, l = I;
42
- if (o.multiple && !Array.isArray(o.modelValue))
40
+ setup(O, { emit: D }) {
41
+ const t = O, n = D;
42
+ if (t.multiple && !Array.isArray(t.modelValue))
43
43
  throw new Error('Multiple is set to "true" but modelValue is not an array.');
44
- const b = i(null), T = i(null), L = k(() => o.placeholder), V = i(null), w = i(null), r = k(
45
- () => o.comma ? V.value : w.value
46
- ), p = i(null), E = () => {
44
+ const b = u(null), L = u(null), B = u(null), V = u(null), r = f(
45
+ () => t.comma ? B.value : V.value
46
+ ), p = u(null), A = () => {
47
47
  p.value instanceof HTMLInputElement && p.value.focus();
48
- }, N = !o.multiple && se(o.modelValue) || o.multiple && !!o.modelValue.length, q = i([]), {
49
- query: t,
50
- alignQueryToState: A,
51
- addCurrentQueryToManualItems: K,
52
- selectedOptions: u,
53
- selectOption: M,
54
- unselectOption: P,
55
- valueIsSelected: S,
56
- manualItems: _
57
- } = pe({
58
- emit: l,
48
+ }, o = u(""), i = f(() => K.value.filter((e) => e.selected)), { data: w, get: H } = le({
49
+ items: E(t, "modelValue")
50
+ }), { options: K } = ne({
51
+ disabled: E(t, "disabled"),
52
+ items: f(() => [].concat(t.modelValue)),
59
53
  itemText: void 0,
60
54
  itemValue: void 0,
61
- modelValue: B(o, "modelValue"),
62
- multiple: o.multiple,
63
- resetQueryOnOptionSelected: !0,
64
- stash: !1,
65
- items: B(o, "modelValue"),
66
- enforceCoherence: !1,
67
- prefill: N,
68
- modelValueDebounceTime: 0,
69
- dependencies: q,
70
- depsDebounceTime: 0,
71
- queryDebounceTime: 0,
72
- disabled: B(o, "disabled")
73
- }), g = i(!1), F = () => {
55
+ max: t.max,
56
+ selectable: !0,
57
+ selectedIndexedByHash: w
58
+ }), C = () => {
59
+ if (t.multiple) {
60
+ o.value = "";
61
+ return;
62
+ }
63
+ let e;
64
+ i.value && (e = ae(i.value)), o.value = (e == null ? void 0 : e.text) || "";
65
+ }, T = async (e) => {
66
+ if (t.multiple) {
67
+ const a = { ...w.value };
68
+ delete a[e.valueHash], n("update:modelValue", Object.values(a));
69
+ } else
70
+ n("update:modelValue", null);
71
+ A();
72
+ };
73
+ j(
74
+ () => t.modelValue,
75
+ async () => {
76
+ C();
77
+ }
78
+ );
79
+ const g = u(!1), q = () => {
74
80
  g.value = !0;
75
- }, H = () => {
76
- g.value = !1, l("inactive");
77
- }, h = k(() => !(o.readonly || o.disabled || !r.value && o.multiple)), Q = (e) => {
78
- var n;
79
- h.value && (!o.multiple || t.value || (e.preventDefault(), u.value.length && ((n = r.value) == null || n.focusPrevious())));
80
- }, R = (e) => {
81
- var n;
82
- h.value && (!o.multiple || t.value || (e.preventDefault(), u.value.length && ((n = r.value) == null || n.focusNext())));
83
- }, U = async () => {
84
- var e, n;
85
- !h.value || t.value || !u.value.length || ((e = r.value) != null && e.getHighlighted() && r.value.confirmOption(), await ie(), (n = r.value) == null || n.focusPrevious());
86
- }, z = () => {
81
+ }, M = () => {
82
+ g.value = !1, n("inactive");
83
+ }, h = f(() => !(t.readonly || t.disabled || !r.value && t.multiple)), N = (e) => {
84
+ var a;
85
+ h.value && (!t.multiple || o.value || (e.preventDefault(), i.value.length && ((a = r.value) == null || a.focusPrevious())));
86
+ }, P = (e) => {
87
+ var a;
88
+ h.value && (!t.multiple || o.value || (e.preventDefault(), i.value.length && ((a = r.value) == null || a.focusNext())));
89
+ }, _ = async () => {
90
+ var e, a;
91
+ !h.value || o.value || !i.value.length || ((e = r.value) != null && e.getHighlighted() && r.value.confirmOption(), await te(), (a = r.value) == null || a.focusPrevious());
92
+ }, F = () => {
87
93
  var e;
88
94
  (e = r.value) == null || e.blur();
89
- }, Z = async (e) => {
90
- var n;
91
- if (l("keydown", e), o.readonly || o.disabled) {
95
+ }, S = async (e) => {
96
+ var a;
97
+ if (n("keydown", e), t.readonly || t.disabled) {
92
98
  e.preventDefault();
93
99
  return;
94
100
  }
95
- if (/^[A-Za-z0-9]$/.test(e.key) && ((n = r.value) == null || n.blur()), e.key === o.divider || e.key === "Unidentified" && t.value.includes(o.divider)) {
96
- if (o.divider.length === 1 && t.value.includes(o.divider)) {
97
- const m = t.value.split(o.divider)[0];
101
+ if (/^[A-Za-z0-9]$/.test(e.key) && ((a = r.value) == null || a.blur()), e.key === t.divider || e.key === "Unidentified" && o.value.includes(t.divider)) {
102
+ if (t.divider.length === 1 && o.value.includes(t.divider)) {
103
+ const m = o.value.split(t.divider)[0];
98
104
  if (m)
99
- t.value = m;
105
+ o.value = m;
100
106
  else {
101
- t.value = "";
107
+ o.value = "";
102
108
  return;
103
109
  }
104
110
  }
105
- if (!t.value) {
106
- l("keydown", e);
111
+ if (!o.value) {
112
+ n("keydown", e);
107
113
  return;
108
114
  }
109
- if (e.preventDefault(), S(t.value))
110
- l("duplicate", t.value), t.value = "";
115
+ if (e.preventDefault(), H(o.value))
116
+ n("duplicate", o.value), o.value = "";
111
117
  else {
112
- if (o.max && u.value.length >= o.max)
118
+ if (t.max && i.value.length >= t.max)
113
119
  return;
114
- K(), j(de(_.value));
120
+ t.multiple ? n("update:modelValue", t.modelValue.concat(o.value)) : n("update:modelValue", o.value);
115
121
  }
116
122
  }
117
- }, j = (e) => {
118
- M(e), E();
119
- }, G = (e) => {
120
- P(e), E();
121
- }, J = (e) => {
122
- l("focus", e), F(), document.addEventListener("click", c), document.addEventListener("focusin", c);
123
- }, W = (e) => {
124
- l("click", e), !(o.disabled || o.readonly) && p.value instanceof HTMLElement && p.value.focus();
123
+ }, U = (e) => {
124
+ n("focus", e), q(), document.addEventListener("click", c), document.addEventListener("focusin", c);
125
+ }, x = (e) => {
126
+ n("click", e), !(t.disabled || t.readonly) && p.value instanceof HTMLElement && p.value.focus();
125
127
  }, c = async (e) => {
126
128
  if (e.target instanceof Node && b.value && !b.value.$el.contains(e.target)) {
127
- H(), document.removeEventListener("click", c), document.removeEventListener("focusin", c), A();
129
+ M(), document.removeEventListener("click", c), document.removeEventListener("focusin", c), C();
128
130
  return;
129
131
  }
130
- }, X = {
131
- onBlur: (e) => l("blur", e),
132
- onChange: (e) => l("change", e),
133
- onKeyup: (e) => l("keyup", e),
134
- onInput: (e) => l("input", e)
132
+ }, z = {
133
+ onBlur: (e) => n("blur", e),
134
+ onChange: (e) => n("change", e),
135
+ onKeyup: (e) => n("keyup", e),
136
+ onInput: (e) => n("input", e)
135
137
  };
136
- return (e, n) => (f(), C(ve, {
138
+ return (e, a) => (v(), k(se, {
137
139
  ref_key: "outerContainer",
138
140
  ref: b,
139
- class: x({
141
+ class: Q({
140
142
  "bb-base-tag": !0,
141
143
  "bb-base-tag--active": g.value,
142
144
  "bb-base-tag--disabled": e.disabled,
@@ -145,78 +147,78 @@ const ye = { class: "bb-base-tag__input-container" }, be = ["id", "aria-describe
145
147
  "bb-base-tag--readonly": e.readonly,
146
148
  "bb-base-tag--compact": e.compact
147
149
  }),
148
- onClick: W
150
+ onClick: x
149
151
  }, {
150
- "prepend-outer": a(() => [
152
+ "prepend-outer": l(() => [
151
153
  s(e.$slots, "prepend-outer")
152
154
  ]),
153
- "append-outer": a(() => [
155
+ "append-outer": l(() => [
154
156
  s(e.$slots, "append-outer")
155
157
  ]),
156
- default: a(() => [
157
- O(fe, {
158
+ default: l(() => [
159
+ I(ue, {
158
160
  ref_key: "innerContainer",
159
- ref: T,
160
- "append:icon": o["append:icon"],
161
- "prepend:icon": o["prepend:icon"],
161
+ ref: L,
162
+ "append:icon": t["append:icon"],
163
+ "prepend:icon": t["prepend:icon"],
162
164
  "prevent-focus": !0
163
165
  }, {
164
- prepend: a(() => [
166
+ prepend: l(() => [
165
167
  s(e.$slots, "prepend")
166
168
  ]),
167
- prefix: a(() => [
169
+ prefix: l(() => [
168
170
  s(e.$slots, "prefix")
169
171
  ]),
170
- append: a(() => [
172
+ append: l(() => [
171
173
  s(e.$slots, "append")
172
174
  ]),
173
- suffix: a(() => [
175
+ suffix: l(() => [
174
176
  s(e.$slots, "suffix")
175
177
  ]),
176
- default: a(() => [
177
- O(v(ue), { tag: "span" }, {
178
- default: a(() => [
179
- $("span", ye, [
180
- e.multiple ? (f(), ee(oe, { key: 0 }, [
181
- e.comma ? (f(), C(me, {
178
+ default: l(() => [
179
+ I(Z(oe), { tag: "span" }, {
180
+ default: l(() => [
181
+ $("span", de, [
182
+ e.multiple ? (v(), G(J, { key: 0 }, [
183
+ e.comma ? (v(), k(ie, {
182
184
  key: 0,
183
185
  ref_key: "commaBox",
184
- ref: V,
185
- options: v(u)
186
- }, null, 8, ["options"])) : (f(), C(ce, {
186
+ ref: B,
187
+ options: i.value
188
+ }, null, 8, ["options"])) : (v(), k(re, {
187
189
  key: 1,
188
190
  ref_key: "chipsBox",
189
- ref: w,
190
- options: v(u),
191
- "onOption:unselected": G
191
+ ref: V,
192
+ options: i.value,
193
+ "onOption:unselected": T
192
194
  }, null, 8, ["options"]))
193
- ], 64)) : te("", !0),
194
- ne($("input", le({
195
+ ], 64)) : W("", !0),
196
+ X($("input", Y({
195
197
  id: e.id,
196
198
  ref_key: "input",
197
199
  ref: p
198
- }, X, {
199
- "onUpdate:modelValue": n[0] || (n[0] = (m) => ae(t) ? t.value = m : null),
200
+ }, z, {
201
+ "onUpdate:modelValue": a[0] || (a[0] = (m) => o.value = m),
200
202
  "aria-describedby": e.ariaDescribedby,
201
203
  autocomplete: e.autocomplete,
202
204
  autofocus: e.autofocus,
203
205
  class: "bb-base-tag__text-input",
204
206
  disabled: e.disabled,
205
207
  enterkeyhint: "done",
206
- placeholder: L.value,
208
+ placeholder: e.placeholder,
207
209
  readonly: e.readonly,
208
210
  required: e.required && !e.multiple || e.multiple && !e.modelValue.length,
209
211
  type: "text",
210
- onFocus: d(J, ["stop"]),
212
+ onFocus: d(U, ["stop"]),
211
213
  onKeydown: [
212
- d(Z, ["stop"]),
213
- y(d(U, ["stop"]), ["delete"]),
214
- y(d(Q, ["stop"]), ["left"]),
215
- y(d(z, ["stop", "prevent"]), ["esc"]),
216
- y(d(R, ["stop"]), ["right"])
214
+ d(S, ["stop"]),
215
+ y(d(_, ["stop"]), ["delete"]),
216
+ y(d(N, ["stop"]), ["left"]),
217
+ y(d(F, ["stop", "prevent"]), ["esc"]),
218
+ y(d(P, ["stop"]), ["right"])
217
219
  ]
218
- }), null, 16, be), [
219
- [re, v(t)]
220
+ }), null, 16, pe), [
221
+ [ee, o.value]
220
222
  ])
221
223
  ])
222
224
  ]),
@@ -231,5 +233,5 @@ const ye = { class: "bb-base-tag__input-container" }, be = ["id", "aria-describe
231
233
  }
232
234
  });
233
235
  export {
234
- qe as default
236
+ $e as default
235
237
  };
package/dist/index47.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as w, ref as y, computed as u, onMounted as g, watch as B, nextTick as x, openBlock as V, createBlock as k, normalizeClass as $, withCtx as t, renderSlot as r, createVNode as i, createElementVNode as C, mergeProps as T } from "vue";
2
- import v from "./index223.js";
3
- import E from "./index221.js";
2
+ import v from "./index207.js";
3
+ import E from "./index205.js";
4
4
  /* empty css */
5
5
  import G from "./index128.js";
6
6
  /* empty css */