@7pmlabs/design-system 0.7.0 → 0.8.1

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 (127) hide show
  1. package/dist/design-system10.mjs +8 -8
  2. package/dist/design-system10.mjs.map +1 -1
  3. package/dist/design-system101.mjs.map +1 -1
  4. package/dist/design-system102.mjs +16 -16
  5. package/dist/design-system105.mjs +9 -9
  6. package/dist/design-system106.mjs.map +1 -1
  7. package/dist/design-system107.mjs.map +1 -1
  8. package/dist/design-system108.mjs +16 -16
  9. package/dist/design-system109.mjs +16 -16
  10. package/dist/design-system11.mjs.map +1 -1
  11. package/dist/design-system111.mjs +16 -16
  12. package/dist/design-system111.mjs.map +1 -1
  13. package/dist/design-system112.mjs.map +1 -1
  14. package/dist/design-system114.mjs.map +1 -1
  15. package/dist/design-system116.mjs +1 -1
  16. package/dist/design-system117.mjs +1 -1
  17. package/dist/design-system118.mjs +5 -5
  18. package/dist/design-system118.mjs.map +1 -1
  19. package/dist/design-system12.mjs.map +1 -1
  20. package/dist/design-system123.mjs.map +1 -1
  21. package/dist/design-system125.mjs +7 -4
  22. package/dist/design-system125.mjs.map +1 -1
  23. package/dist/design-system126.mjs +5 -8
  24. package/dist/design-system126.mjs.map +1 -1
  25. package/dist/design-system127.mjs +6 -6
  26. package/dist/design-system127.mjs.map +1 -1
  27. package/dist/design-system13.mjs.map +1 -1
  28. package/dist/design-system14.mjs.map +1 -1
  29. package/dist/design-system15.mjs.map +1 -1
  30. package/dist/design-system16.mjs.map +1 -1
  31. package/dist/design-system17.mjs +170 -146
  32. package/dist/design-system17.mjs.map +1 -1
  33. package/dist/design-system18.mjs.map +1 -1
  34. package/dist/design-system19.mjs +64 -64
  35. package/dist/design-system19.mjs.map +1 -1
  36. package/dist/design-system20.mjs +78 -78
  37. package/dist/design-system20.mjs.map +1 -1
  38. package/dist/design-system21.mjs.map +1 -1
  39. package/dist/design-system22.mjs.map +1 -1
  40. package/dist/design-system23.mjs.map +1 -1
  41. package/dist/design-system24.mjs.map +1 -1
  42. package/dist/design-system25.mjs.map +1 -1
  43. package/dist/design-system40.mjs +46 -46
  44. package/dist/design-system40.mjs.map +1 -1
  45. package/dist/design-system43.mjs +10 -10
  46. package/dist/design-system45.mjs.map +1 -1
  47. package/dist/design-system49.mjs +2 -2
  48. package/dist/design-system49.mjs.map +1 -1
  49. package/dist/design-system51.mjs +68 -68
  50. package/dist/design-system51.mjs.map +1 -1
  51. package/dist/design-system54.mjs.map +1 -1
  52. package/dist/design-system57.mjs.map +1 -1
  53. package/dist/design-system64.mjs +10 -10
  54. package/dist/design-system64.mjs.map +1 -1
  55. package/dist/design-system66.mjs.map +1 -1
  56. package/dist/design-system72.mjs.map +1 -1
  57. package/dist/design-system76.mjs.map +1 -1
  58. package/dist/design-system79.mjs.map +1 -1
  59. package/dist/design-system83.mjs +43 -43
  60. package/dist/design-system83.mjs.map +1 -1
  61. package/dist/design-system85.mjs +75 -75
  62. package/dist/design-system85.mjs.map +1 -1
  63. package/dist/design-system88.mjs.map +1 -1
  64. package/dist/design-system90.mjs.map +1 -1
  65. package/dist/design-system95.mjs +42 -42
  66. package/dist/design-system95.mjs.map +1 -1
  67. package/dist/design-system96.mjs +2 -2
  68. package/dist/design-system96.mjs.map +1 -1
  69. package/dist/design-system97.mjs +1 -1
  70. package/dist/design-system97.mjs.map +1 -1
  71. package/dist/design-system98.mjs +12 -12
  72. package/dist/design-system98.mjs.map +1 -1
  73. package/dist/design-system99.mjs.map +1 -1
  74. package/dist/style.css +1 -1
  75. package/dist/types/components/BBreadcrumb/BBreadcrumb.vue.d.ts +4 -4
  76. package/dist/types/components/BBreadcrumb/BBreadcrumbSeparator.vue.d.ts +1 -1
  77. package/dist/types/components/BButton.vue.d.ts +4 -4
  78. package/dist/types/components/BCarousel/BCarousel.vue.d.ts +6 -6
  79. package/dist/types/components/BCarousel/BCarouselItem.vue.d.ts +1 -1
  80. package/dist/types/components/BCheckbox.vue.d.ts +5 -5
  81. package/dist/types/components/BCollapse.vue.d.ts +3 -3
  82. package/dist/types/components/BCurrencyField.vue.d.ts +6 -6
  83. package/dist/types/components/BDatePicker/BDatePicker.vue.d.ts +6 -6
  84. package/dist/types/components/BDatePicker/BDatePickerButtonNext.vue.d.ts +1 -1
  85. package/dist/types/components/BDatePicker/BDatePickerButtonPrevious.vue.d.ts +1 -1
  86. package/dist/types/components/BDatePicker/BDatePickerGridDate.vue.d.ts +3 -3
  87. package/dist/types/components/BDatePicker/BDatePickerGridDateRange.vue.d.ts +3 -3
  88. package/dist/types/components/BDatePicker/BDatePickerGridMonth.vue.d.ts +3 -3
  89. package/dist/types/components/BDatePicker/BDatePickerGridYear.vue.d.ts +3 -3
  90. package/dist/types/components/BDatePicker/BDatePickerHeading.vue.d.ts +1 -1
  91. package/dist/types/components/BDatePicker/BDatePickerIcon.vue.d.ts +1 -1
  92. package/dist/types/components/BDropdown/BDropdown.vue.d.ts +5 -5
  93. package/dist/types/components/BDropdown/BDropdownContent.vue.d.ts +1 -1
  94. package/dist/types/components/BDropdown/BDropdownItem.vue.d.ts +4 -4
  95. package/dist/types/components/BErrorMessage.vue.d.ts +4 -4
  96. package/dist/types/components/BImagePicker/BImagePicker.vue.d.ts +7 -7
  97. package/dist/types/components/BImagePicker/BImagePickerCloseButton.vue.d.ts +1 -1
  98. package/dist/types/components/BImagePicker/BImagePreview.vue.d.ts +3 -3
  99. package/dist/types/components/BLabel.vue.d.ts +5 -5
  100. package/dist/types/components/BLoadingBar.vue.d.ts +4 -4
  101. package/dist/types/components/BLoadingOverlay.vue.d.ts +4 -4
  102. package/dist/types/components/BModal/BModal.vue.d.ts +5 -5
  103. package/dist/types/components/BModal/BModalBody.vue.d.ts +1 -1
  104. package/dist/types/components/BModal/BModalContainer.vue.d.ts +5 -5
  105. package/dist/types/components/BModal/BModalFooter.vue.d.ts +1 -1
  106. package/dist/types/components/BModal/BModalHeader.vue.d.ts +1 -1
  107. package/dist/types/components/BMultiSelect.vue.d.ts +9 -9
  108. package/dist/types/components/BOtpField/BOtpField.vue.d.ts +7 -7
  109. package/dist/types/components/BOtpField/BOtpFieldBox.vue.d.ts +7 -7
  110. package/dist/types/components/BOverlay.vue.d.ts +1 -1
  111. package/dist/types/components/BPagination.vue.d.ts +5 -5
  112. package/dist/types/components/BRadio.vue.d.ts +6 -6
  113. package/dist/types/components/BSelect.vue.d.ts +9 -9
  114. package/dist/types/components/BStepper.vue.d.ts +3 -3
  115. package/dist/types/components/BSwitch.vue.d.ts +5 -5
  116. package/dist/types/components/BTabs/BTab.vue.d.ts +1 -1
  117. package/dist/types/components/BTabs/BTabs.vue.d.ts +5 -5
  118. package/dist/types/components/BTextField.vue.d.ts +8 -8
  119. package/dist/types/components/BTextarea.vue.d.ts +7 -7
  120. package/dist/types/components/BTimeline/BTimeline.vue.d.ts +1 -1
  121. package/dist/types/components/BTimeline/BTimelineItem.vue.d.ts +1 -1
  122. package/dist/types/components/BToast/BToast.vue.d.ts +3 -3
  123. package/dist/types/components/BToast/BToastItem.vue.d.ts +6 -6
  124. package/dist/types/components/BTooltip.vue.d.ts +6 -6
  125. package/dist/types/composables/Validation.d.ts +6 -1
  126. package/dist/types/constants/Common.d.ts +2 -2
  127. package/package.json +3 -3
@@ -1,19 +1,13 @@
1
- import { defineComponent as se, ref as m, computed as h, watch as B, nextTick as E, onMounted as le, onBeforeUnmount as te, openBlock as d, createElementBlock as o, createElementVNode as i, createVNode as S, normalizeClass as r, unref as x, Fragment as z, renderList as P, toDisplayString as y, createBlock as D, createCommentVNode as T, createTextVNode as de, withDirectives as ae, withModifiers as oe, vShow as ne } from "vue";
2
- import { useValidationField as ue } from "./design-system3.mjs";
3
- import { lockScrollBody as ie, unlockScrollBody as F, ensureVisiblePosition as re, resetPosition as ce } from "./design-system6.mjs";
4
- import { useI18n as ve } from "./design-system49.mjs";
5
- import pe from "./design-system28.mjs";
6
- import fe from "./design-system14.mjs";
7
- import me from "./design-system15.mjs";
8
- import he from "./design-system39.mjs";
9
- import ge from "./design-system98.mjs";
10
- const be = { class: "ds-absolute ds-right-3 ds-z-[1]" }, we = /* @__PURE__ */ i("path", { d: "M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z" }, null, -1), ke = [
11
- we
12
- ], xe = ["onClick"], ye = /* @__PURE__ */ i("path", { d: "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z" }, null, -1), Ce = [
13
- ye
14
- ], _e = ["id", "disabled"], $e = /* @__PURE__ */ i("path", { d: "M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z" }, null, -1), Me = [
15
- $e
16
- ], Be = ["id", "data-cy", "data-ut"], Ee = { class: "ds-max-h-72 ds-overflow-y-auto ds-rounded-lg ds-bg-white ds-shadow" }, Ie = { class: "ds-py-1 ds-text-sm ds-text-black/[0.85]" }, Ve = ["onClick"], Oe = /* @__PURE__ */ se({
1
+ import { defineComponent as ae, ref as v, computed as h, watch as q, nextTick as C, onMounted as oe, onBeforeUnmount as ne, openBlock as d, createElementBlock as n, createElementVNode as i, createVNode as F, normalizeClass as f, unref as M, Fragment as N, renderList as O, toDisplayString as I, createBlock as U, createCommentVNode as _, createTextVNode as ue, withDirectives as re, withModifiers as ie, vShow as ce } from "vue";
2
+ import { useValidationField as ve } from "./design-system3.mjs";
3
+ import { lockScrollBody as fe, unlockScrollBody as A, ensureVisiblePosition as pe, resetPosition as me, ensureVisibleY as ge } from "./design-system6.mjs";
4
+ import { useI18n as be } from "./design-system49.mjs";
5
+ import we from "./design-system28.mjs";
6
+ import he from "./design-system14.mjs";
7
+ import ke from "./design-system15.mjs";
8
+ import ye from "./design-system39.mjs";
9
+ import xe from "./design-system98.mjs";
10
+ const Ce = { class: "ds-absolute ds-right-3 ds-z-[1]" }, Me = ["onClick"], $e = ["id", "disabled"], Ie = ["id", "data-cy", "data-ut"], Be = { class: "ds-max-h-72 ds-overflow-y-auto ds-rounded-lg ds-bg-white ds-shadow" }, Ve = { class: "ds-py-1 ds-text-sm ds-text-black/[0.85]" }, Ee = ["onClick"], Oe = /* @__PURE__ */ ae({
17
11
  __name: "BMultiSelect",
18
12
  props: {
19
13
  inputId: { default: "" },
@@ -32,221 +26,251 @@ const be = { class: "ds-absolute ds-right-3 ds-z-[1]" }, we = /* @__PURE__ */ i(
32
26
  allowInput: { type: Boolean, default: !1 }
33
27
  },
34
28
  emits: ["change", "open", "close", "change:input", "update:modelValue"],
35
- setup(N, { expose: O, emit: U }) {
36
- const t = N, v = U, g = m(null), C = m(null), b = m(null), n = m(!1), { t: I } = ve(), j = {
29
+ setup(j, { expose: K, emit: W }) {
30
+ const l = j, m = W, g = v(null), B = v(null), b = v(null), u = v(!1), { t: L } = be(), Y = {
37
31
  validateRule: (e) => !!e && e.length > 0,
38
- errorMessage: () => t.requiredErrorMessage || I("ds.global.field_required")
39
- }, _ = m(""), c = m([]), w = h(() => t.inputId || `id-${ge()}`), a = h({
32
+ errorMessage: () => l.requiredErrorMessage || L("ds.global.field_required")
33
+ }, V = v(""), p = v([]), k = h(() => l.inputId || `id-${xe()}`), a = h({
40
34
  get() {
41
- return t.modelValue;
35
+ return l.modelValue;
42
36
  },
43
37
  set(e) {
44
- v("update:modelValue", e);
38
+ m("update:modelValue", e);
45
39
  }
46
- }), W = h(() => {
40
+ }), G = h(() => {
47
41
  let e = "ds-border ds-drop-shadow-light ds-text-sm ds-h-[40px] ds-px-3 ds-rounded-lg ds-block ds-w-full ds-inline-flex ds-items-center ds-justify-between ";
48
- return e += t.disabled ? "ds-cursor-not-allowed ds-bg-[#f2f2f2] ds-text-black/[0.4] " : "ds-bg-white ds-text-black/[0.85] ", e += p.value.valid ? "ds-border-black/10 focus:ds-border-focus focus:ds-ring-1 focus:ds-ring-focus " : "ds-border-error focus:ds-ring-1 focus:ds-ring-error ", e;
49
- }), A = h(() => {
42
+ return e += l.disabled ? "ds-cursor-not-allowed ds-bg-[#f2f2f2] ds-text-black/[0.4] " : "ds-bg-white ds-text-black/[0.85] ", e += w.value.valid ? "ds-border-black/10 focus:ds-border-focus focus:ds-ring-1 focus:ds-ring-focus " : "ds-border-error focus:ds-ring-1 focus:ds-ring-error ", e;
43
+ }), H = h(() => {
50
44
  let e = [];
51
- return t.required && e.push(j), t.validationRules && (e = e.concat(t.validationRules)), e.length ? e : void 0;
52
- }), G = h(
45
+ return l.required && e.push(Y), l.validationRules && (e = e.concat(l.validationRules)), e.length ? e : void 0;
46
+ }), J = h(
53
47
  () => {
54
48
  var e, s;
55
- return ((e = a.value) == null ? void 0 : e.length) > 1 ? ` (${I("ds.components.base.multi_select.selected_item_count", {
49
+ return ((e = a.value) == null ? void 0 : e.length) > 1 ? ` (${L("ds.components.base.multi_select.selected_item_count", {
56
50
  count: (s = a.value) == null ? void 0 : s.length
57
51
  })})` : "";
58
52
  }
59
- ), H = h(
60
- () => t.showSelectedItemCount ? `${t.label}${G.value}` : t.label
61
- ), { validate: $, validationResult: p } = ue(
62
- w.value,
53
+ ), Q = h(
54
+ () => l.showSelectedItemCount ? `${l.label}${J.value}` : l.label
55
+ ), { validate: E, validationResult: w } = ve(
56
+ k.value,
63
57
  a,
64
- A.value
58
+ H.value
65
59
  );
66
- B(n, (e) => {
67
- e ? (ie(), Y(), v("open")) : (F(), L(), v("close"));
68
- }), B(
60
+ q(u, (e) => {
61
+ e ? (fe(), se(), m("open")) : (A(), T(), m("close"));
62
+ }), q(
69
63
  a,
70
64
  () => {
71
- M();
65
+ R();
72
66
  },
73
67
  {
74
68
  deep: !0
75
69
  }
76
- ), B(
77
- () => t.items,
70
+ ), q(
71
+ () => l.items,
78
72
  () => {
79
- a.value.length !== 0 && c.value.length === 0 && M();
73
+ a.value.length !== 0 && p.value.length === 0 && R();
80
74
  },
81
75
  {
82
76
  deep: !0
83
77
  }
84
78
  );
85
- const M = () => {
86
- c.value = a.value.map((e) => {
87
- let s = c.value.find((u) => u.value === e);
88
- return s || (s = t.items.find((u) => u.value === e)), { text: s == null ? void 0 : s.text, value: e, cssClass: s == null ? void 0 : s.cssClass };
79
+ const R = () => {
80
+ p.value = a.value.map((e) => {
81
+ let s = p.value.find((r) => r.value === e);
82
+ return s || (s = l.items.find((r) => r.value === e)), { text: s == null ? void 0 : s.text, value: e, cssClass: s == null ? void 0 : s.cssClass };
89
83
  });
90
- }, J = () => {
91
- document.addEventListener("keydown", V);
92
- }, V = (e) => {
93
- e.key === "Escape" && R();
94
- }, K = () => {
95
- document.addEventListener("click", q);
96
- }, q = (e) => {
97
- [g.value, b.value].some((l) => e.composedPath().includes(l)) || R();
98
- }, Q = (e) => {
99
- const s = a.value.findIndex((u) => u === e.value);
100
- s !== -1 ? a.value.splice(s, 1) : a.value.push(e.value), v("change", e.value), E(() => {
101
- $();
102
- });
103
- }, X = (e, s) => {
84
+ }, X = () => {
85
+ document.addEventListener("keydown", S);
86
+ }, S = (e) => {
87
+ e.key === "Escape" && (D(), $());
88
+ }, Z = () => {
89
+ document.addEventListener("click", z);
90
+ }, z = (e) => {
91
+ [g.value, b.value].some((t) => e.composedPath().includes(t)) || (D(), $());
92
+ }, P = (e) => {
93
+ const s = a.value.findIndex((r) => r === e.value);
94
+ s !== -1 ? a.value.splice(s, 1) : a.value.push(e.value), m("change", e.value), C(() => {
95
+ E();
96
+ }), ge(g.value, b.value);
97
+ }, ee = (e, s) => {
104
98
  s.style.width = `${e.offsetWidth}px`;
105
- }, Y = () => {
106
- E(() => {
107
- re(g.value, b.value), X(g.value, b.value);
99
+ }, se = () => {
100
+ C(() => {
101
+ pe(g.value, b.value), ee(g.value, b.value);
108
102
  });
109
- }, L = () => {
110
- ce(g.value, b.value);
111
- }, Z = (e) => {
112
- v("change:input", e);
113
- }, R = () => {
103
+ }, T = () => {
104
+ me(g.value, b.value);
105
+ }, le = (e) => {
106
+ m("change:input", e), $();
107
+ }, D = () => {
114
108
  var e;
115
- n.value = !1, (e = C.value) == null || e.blur(), _.value = "";
116
- }, ee = (e) => {
117
- const s = a.value.findIndex((u) => u === e.value);
118
- s !== -1 && (a.value.splice(s, 1), v("change", e.value), E(() => {
119
- $();
109
+ u.value = !1, (e = B.value) == null || e.blur(), V.value = "";
110
+ }, te = (e) => {
111
+ const s = a.value.findIndex((r) => r === e.value);
112
+ s !== -1 && (a.value.splice(s, 1), m("change", e.value), C(() => {
113
+ E();
120
114
  }));
121
115
  };
122
- return (() => {
116
+ (() => {
123
117
  var e;
124
- ((e = t.items) == null ? void 0 : e.length) > 0 && M();
125
- })(), le(() => {
126
- J(), K();
127
- }), te(() => {
128
- document.removeEventListener("keydown", V), document.removeEventListener("click", q), F(), L();
129
- }), O({ validate: $, selectMenu: n }), (e, s) => {
130
- var u;
131
- return d(), o("div", null, [
118
+ ((e = l.items) == null ? void 0 : e.length) > 0 && R();
119
+ })(), oe(() => {
120
+ X(), Z();
121
+ }), ne(() => {
122
+ document.removeEventListener("keydown", S), document.removeEventListener("click", z), A(), T();
123
+ }), K({ validate: E, selectMenu: u });
124
+ const y = v(null), o = v(-1), $ = () => {
125
+ o.value = -1;
126
+ }, de = (e) => {
127
+ e.key === "ArrowDown" ? (e.preventDefault(), o.value < l.items.length - 1 && (o.value++, C(() => {
128
+ var s;
129
+ y.value && ((s = y.value[o.value]) == null || s.scrollIntoView({
130
+ block: "nearest"
131
+ }));
132
+ }))) : e.key === "ArrowUp" ? (e.preventDefault(), o.value > 0 ? (o.value--, C(() => {
133
+ var s;
134
+ y.value && ((s = y.value[o.value]) == null || s.scrollIntoView({
135
+ block: "nearest"
136
+ }));
137
+ })) : o.value = -1) : e.key === "Enter" && o.value >= 0 ? (e.preventDefault(), P(l.items[o.value])) : e.key === "Tab" && D();
138
+ };
139
+ return (e, s) => {
140
+ var r;
141
+ return d(), n("div", null, [
132
142
  i("div", {
133
143
  ref_key: "selectEl",
134
144
  ref: g
135
145
  }, [
136
- S(me, {
137
- id: w.value,
138
- label: H.value,
146
+ F(ke, {
147
+ id: k.value,
148
+ label: Q.value,
139
149
  required: e.required
140
150
  }, null, 8, ["id", "label", "required"]),
141
- t.allowInput ? (d(), o("div", {
151
+ l.allowInput ? (d(), n("div", {
142
152
  key: 0,
143
- class: r([{
144
- "ds-border-focus ds-ring-1 ds-ring-focus": n.value && x(p).valid,
145
- "ds-ring-1 ds-ring-error": n.value && !x(p).valid,
146
- "ds-border-black/10": x(p).valid,
147
- "ds-border-error": !x(p).valid
153
+ class: f([{
154
+ "ds-border-focus ds-ring-1 ds-ring-focus": u.value && M(w).valid,
155
+ "ds-ring-1 ds-ring-error": u.value && !M(w).valid,
156
+ "ds-border-black/10": M(w).valid,
157
+ "ds-border-error": !M(w).valid
148
158
  }, "ds-relative ds-flex ds-flex-wrap ds-items-center ds-gap-x-1 ds-rounded-lg ds-border ds-bg-white ds-px-3 ds-py-1 ds-drop-shadow-light"])
149
159
  }, [
150
- i("div", be, [
151
- (d(), o("svg", {
152
- class: r([[n.value ? "ds-rotate-180" : ""], "ds-h-4 ds-min-h-4 ds-w-4 ds-min-w-4 ds-transition-transform"]),
160
+ i("div", Ce, [
161
+ (d(), n("svg", {
162
+ class: f([[u.value ? "ds-rotate-180" : ""], "ds-h-4 ds-min-h-4 ds-w-4 ds-min-w-4 ds-transition-transform"]),
153
163
  viewBox: "0 0 320 512",
154
164
  xmlns: "http://www.w3.org/2000/svg",
155
- onClick: s[0] || (s[0] = (l) => {
156
- var f;
157
- return (f = C.value) == null ? void 0 : f.focus();
165
+ onClick: s[0] || (s[0] = (t) => {
166
+ var c;
167
+ return (c = B.value) == null ? void 0 : c.focus();
158
168
  })
159
- }, ke, 2))
169
+ }, s[5] || (s[5] = [
170
+ i("path", { d: "M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z" }, null, -1)
171
+ ]), 2))
160
172
  ]),
161
- (d(!0), o(z, null, P(c.value, (l, f) => (d(), o("div", {
162
- key: `item${f}`,
173
+ (d(!0), n(N, null, O(p.value, (t, c) => (d(), n("div", {
174
+ key: `item${c}`,
163
175
  class: "ds-my-0.5 ds-flex-initial ds-space-x-1 ds-rounded-lg ds-bg-black/10 ds-px-2"
164
176
  }, [
165
- i("span", null, y(l.text), 1),
166
- (d(), o("svg", {
177
+ i("span", null, I(t.text), 1),
178
+ (d(), n("svg", {
167
179
  class: "ds-mb-1 ds-inline ds-h-4 ds-w-4 ds-cursor-pointer ds-fill-black/60 hover:ds-fill-black/40",
168
180
  viewBox: "0 0 512 512",
169
181
  xmlns: "http://www.w3.org/2000/svg",
170
- onClick: (k) => ee(l)
171
- }, Ce, 8, xe))
182
+ onClick: (x) => te(t)
183
+ }, s[6] || (s[6] = [
184
+ i("path", { d: "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z" }, null, -1)
185
+ ]), 8, Me))
172
186
  ]))), 128)),
173
- t.allowInput ? (d(), D(he, {
187
+ l.allowInput ? (d(), U(ye, {
174
188
  key: 0,
175
- id: w.value,
189
+ id: k.value,
176
190
  ref_key: "inputRef",
177
- ref: C,
178
- modelValue: _.value,
191
+ ref: B,
192
+ modelValue: V.value,
179
193
  "onUpdate:modelValue": [
180
- s[1] || (s[1] = (l) => _.value = l),
181
- Z
194
+ s[1] || (s[1] = (t) => V.value = t),
195
+ le
182
196
  ],
183
- disabled: t.disabled,
197
+ disabled: l.disabled,
184
198
  class: "ds-flex-auto",
185
199
  "hide-details": "",
186
200
  "input-css-class": "ds-drop-shadow-none ds-border-none !ds-ring-0 ds-px-0 !ds-h-[30px] ds-pl-0",
187
- onFocus: s[2] || (s[2] = (l) => n.value = !0)
188
- }, null, 8, ["id", "modelValue", "disabled"])) : T("", !0)
189
- ], 2)) : (d(), o("button", {
201
+ onChange: $,
202
+ onFocus: s[2] || (s[2] = (t) => u.value = !0),
203
+ onKeydown: de
204
+ }, null, 8, ["id", "modelValue", "disabled"])) : _("", !0)
205
+ ], 2)) : (d(), n("button", {
190
206
  key: 1,
191
- id: w.value,
192
- class: r(W.value),
207
+ id: k.value,
208
+ class: f(G.value),
193
209
  disabled: e.disabled,
194
210
  type: "button",
195
- onClick: s[3] || (s[3] = (l) => n.value = !n.value)
211
+ onClick: s[3] || (s[3] = (t) => u.value = !u.value)
196
212
  }, [
197
- c.value.length > 0 ? (d(), o("span", {
213
+ p.value.length > 0 ? (d(), n("span", {
198
214
  key: 0,
199
- class: r([e.valueCssClass, "ds-truncate ds-text-sm"])
200
- }, y((u = c.value) == null ? void 0 : u.map((l) => l.text).join(", ")), 3)) : (d(), o("span", {
215
+ class: f([e.valueCssClass, "ds-truncate ds-text-sm"])
216
+ }, I((r = p.value) == null ? void 0 : r.map((t) => t.text).join(", ")), 3)) : (d(), n("span", {
201
217
  key: 1,
202
- class: r([e.valueCssClass, "ds-truncate ds-text-sm ds-text-black/[0.4]"])
203
- }, y(t.placeholder), 3)),
204
- de("   "),
205
- (d(), o("svg", {
206
- class: r([[n.value ? "ds-rotate-180" : ""], "ds-h-4 ds-min-h-4 ds-w-4 ds-min-w-4 ds-transition-transform"]),
218
+ class: f([e.valueCssClass, "ds-truncate ds-text-sm ds-text-black/[0.4]"])
219
+ }, I(l.placeholder), 3)),
220
+ s[8] || (s[8] = ue("   ")),
221
+ (d(), n("svg", {
222
+ class: f([[u.value ? "ds-rotate-180" : ""], "ds-h-4 ds-min-h-4 ds-w-4 ds-min-w-4 ds-transition-transform"]),
207
223
  viewBox: "0 0 320 512",
208
224
  xmlns: "http://www.w3.org/2000/svg"
209
- }, Me, 2))
210
- ], 10, _e)),
211
- ae(i("div", {
212
- id: `${w.value}Menu`,
225
+ }, s[7] || (s[7] = [
226
+ i("path", { d: "M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z" }, null, -1)
227
+ ]), 2))
228
+ ], 10, $e)),
229
+ re(i("div", {
230
+ id: `${k.value}Menu`,
213
231
  ref_key: "selectMenuEl",
214
232
  ref: b,
215
- class: r([e.menuCssClass, "ds-absolute ds-z-50 ds-min-w-[8rem] ds-py-1"]),
233
+ class: f([e.menuCssClass, "ds-absolute ds-z-50 ds-min-w-[8rem] ds-py-1"]),
216
234
  "data-cy": e.$attrs["data-cy"] ? `${e.$attrs["data-cy"]}Menu` : void 0,
217
235
  "data-ut": e.$attrs["data-ut"] ? `${e.$attrs["data-ut"]}Menu` : void 0
218
236
  }, [
219
- i("div", Ee, [
220
- i("ul", Ie, [
221
- (d(!0), o(z, null, P(e.items, (l, f) => (d(), o("li", {
222
- key: `item${f}`,
237
+ i("div", Be, [
238
+ i("ul", Ve, [
239
+ (d(!0), n(N, null, O(e.items, (t, c) => (d(), n("li", {
240
+ key: `item${c}`,
241
+ ref_for: !0,
242
+ ref_key: "itemRefs",
243
+ ref: y,
223
244
  class: "ds-cursor-pointer",
224
- onClick: oe((k) => Q(l), ["prevent"])
245
+ onClick: ie((x) => P(t), ["prevent"])
225
246
  }, [
226
247
  i("a", {
227
- class: r([
228
- l.cssClass + `${c.value.some((k) => k.value === l.value) ? " ds-bg-slate-100" : ""}`,
229
- "ds-flex ds-items-center ds-space-x-2 ds-px-4 ds-py-2 hover:ds-bg-slate-100"
230
- ])
248
+ class: f([[
249
+ t.cssClass,
250
+ {
251
+ "ds-bg-slate-100": o.value !== c && p.value.some((x) => x.value === t.value),
252
+ "ds-bg-slate-300": o.value === c
253
+ }
254
+ ], "ds-flex ds-items-center ds-space-x-2 ds-px-4 ds-py-2 hover:ds-bg-slate-300"])
231
255
  }, [
232
- S(pe, {
256
+ F(we, {
233
257
  modelValue: a.value,
234
- "onUpdate:modelValue": s[4] || (s[4] = (k) => a.value = k),
235
- value: l.value,
258
+ "onUpdate:modelValue": s[4] || (s[4] = (x) => a.value = x),
259
+ value: t.value,
236
260
  size: "sm"
237
261
  }, null, 8, ["modelValue", "value"]),
238
- i("span", null, y(l == null ? void 0 : l.text), 1)
262
+ i("span", null, I(t == null ? void 0 : t.text), 1)
239
263
  ], 2)
240
- ], 8, Ve))), 128))
264
+ ], 8, Ee))), 128))
241
265
  ])
242
266
  ])
243
- ], 10, Be), [
244
- [ne, n.value]
267
+ ], 10, Ie), [
268
+ [ce, u.value]
245
269
  ])
246
270
  ], 512),
247
- e.hideDetails ? T("", !0) : (d(), D(fe, {
271
+ e.hideDetails ? _("", !0) : (d(), U(he, {
248
272
  key: 0,
249
- "error-message": x(p).errorMessage(),
273
+ "error-message": M(w).errorMessage(),
250
274
  class: "ds-mt-1"
251
275
  }, null, 8, ["error-message"]))
252
276
  ]);
@@ -1 +1 @@
1
- {"version":3,"file":"design-system17.mjs","sources":["../src/components/BMultiSelect.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { createVNode as _createVNode, unref as _unref, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock, renderList as _renderList, Fragment as _Fragment, toDisplayString as _toDisplayString, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createTextVNode as _createTextVNode, withModifiers as _withModifiers, vShow as _vShow, withDirectives as _withDirectives } from \"vue\"\n\nconst _hoisted_1 = { class: \"ds-absolute ds-right-3 ds-z-[1]\" }\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", { d: \"M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z\" }, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\nconst _hoisted_4 = [\"onClick\"]\nconst _hoisted_5 = /*#__PURE__*/_createElementVNode(\"path\", { d: \"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z\" }, null, -1)\nconst _hoisted_6 = [\n _hoisted_5\n]\nconst _hoisted_7 = [\"id\", \"disabled\"]\nconst _hoisted_8 = /*#__PURE__*/_createElementVNode(\"path\", { d: \"M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z\" }, null, -1)\nconst _hoisted_9 = [\n _hoisted_8\n]\nconst _hoisted_10 = [\"id\", \"data-cy\", \"data-ut\"]\nconst _hoisted_11 = { class: \"ds-max-h-72 ds-overflow-y-auto ds-rounded-lg ds-bg-white ds-shadow\" }\nconst _hoisted_12 = { class: \"ds-py-1 ds-text-sm ds-text-black/[0.85]\" }\nconst _hoisted_13 = [\"onClick\"]\n\nimport {\n useValidationField,\n type ValidationRule,\n} from '@/composables/Validation';\nimport {\n ensureVisiblePosition,\n lockScrollBody,\n resetPosition,\n unlockScrollBody,\n} from '@/helpers/ComponentHelper';\nimport { v4 as uuid } from 'uuid';\nimport {\n computed,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n watch,\n} from 'vue';\nimport { useI18n } from 'vue-i18n';\nimport BCheckbox from './BCheckbox.vue';\nimport BErrorMessage from './BErrorMessage.vue';\nimport BLabel from './BLabel.vue';\nimport BTextField from './BTextField.vue';\nimport type { DisplayItem } from '@/types';\n\n//#region Props\nexport interface BMultiSelectProps {\n inputId?: string;\n modelValue: Array<string | number>;\n label?: string;\n items: DisplayItem[];\n disabled?: boolean;\n placeholder?: string;\n valueCssClass?: string;\n menuCssClass?: string;\n /**\n * Array of custom validation rules.\n */\n validationRules?: ValidationRule[];\n /**\n * Validate if the field is left empty.\n */\n required?: boolean;\n requiredErrorMessage?: string;\n /**\n * Hide the validation error message.\n */\n hideDetails?: boolean;\n /**\n * Show number of selected items.\n */\n showSelectedItemCount?: boolean;\n /**\n * Allow to type to search.\n */\n allowInput?: boolean;\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BMultiSelect',\n props: {\n inputId: { default: '' },\n modelValue: {},\n label: { default: '' },\n items: {},\n disabled: { type: Boolean, default: false },\n placeholder: { default: '' },\n valueCssClass: { default: '' },\n menuCssClass: { default: '' },\n validationRules: { default: undefined },\n required: { type: Boolean, default: false },\n requiredErrorMessage: { default: '' },\n hideDetails: { type: Boolean, default: false },\n showSelectedItemCount: { type: Boolean, default: false },\n allowInput: { type: Boolean, default: false }\n },\n emits: [\"change\", \"open\", \"close\", \"change:input\", \"update:modelValue\"],\n setup(__props: any, { expose: __expose, emit: __emit }) {\n\n// https://vuejs.org/guide/essentials/event-handling.html#event-modifiers\nconst props = __props;\n//#endregion\n\n//#region Events\nconst emit = __emit;\n//#endregion\n\n//#region Data\nconst selectEl = ref<HTMLElement | null>(null);\nconst inputRef = ref<InstanceType<typeof BTextField> | null>(null);\nconst selectMenuEl = ref<HTMLElement | null>(null);\nconst selectMenu = ref(false);\nconst { t } = useI18n();\nconst validateRequired: ValidationRule = {\n validateRule: (val: Array<string | number>) => !!val && val.length > 0,\n errorMessage: () =>\n props.requiredErrorMessage || t('ds.global.field_required'),\n};\nconst inputText = ref('');\nconst selectedItems = ref<DisplayItem[]>([]);\nconst id = computed(() => props.inputId || `id-${uuid()}`);\nconst value = computed({\n get() {\n return props.modelValue;\n },\n set(val) {\n emit('update:modelValue', val);\n },\n});\nconst btnCssClass = computed(() => {\n let result = `ds-border ds-drop-shadow-light ds-text-sm ds-h-[40px] ds-px-3 ds-rounded-lg ds-block ds-w-full ds-inline-flex ds-items-center ds-justify-between `;\n result += props.disabled\n ? `ds-cursor-not-allowed ds-bg-[#f2f2f2] ds-text-black/[0.4] `\n : `ds-bg-white ds-text-black/[0.85] `;\n result += !validationResult.value.valid\n ? `ds-border-error focus:ds-ring-1 focus:ds-ring-error `\n : `ds-border-black/10 focus:ds-border-focus focus:ds-ring-1 focus:ds-ring-focus `;\n\n return result;\n});\nconst vRules = computed(() => {\n let result: ValidationRule[] = [];\n\n if (props.required) {\n result.push(validateRequired);\n }\n if (props.validationRules) {\n result = result.concat(props.validationRules);\n }\n\n return result.length ? result : undefined;\n});\nconst selectedItemCount = computed(() =>\n value.value?.length > 1\n ? ` (${t('ds.components.base.multi_select.selected_item_count', {\n count: value.value?.length,\n })})`\n : '',\n);\nconst labelDisplay = computed(() =>\n props.showSelectedItemCount\n ? `${props.label}${selectedItemCount.value}`\n : props.label,\n);\nconst { validate, validationResult } = useValidationField(\n id.value,\n value,\n vRules.value,\n);\n//#endregion\n\n//#region Watchers\nwatch(selectMenu, (val) => {\n if (val) {\n lockScrollBody();\n ensureMenuPosition();\n emit('open');\n } else {\n unlockScrollBody();\n resetMenuPosition();\n emit('close');\n }\n});\nwatch(\n value,\n () => {\n ensureSelectedItems();\n },\n {\n deep: true,\n },\n);\nwatch(\n () => props.items,\n () => {\n if (value.value.length !== 0 && selectedItems.value.length === 0) {\n ensureSelectedItems();\n }\n },\n {\n deep: true,\n },\n);\n//#endregion\n\n//#region Methods\nconst ensureSelectedItems = () => {\n selectedItems.value = value.value.map((v) => {\n let item = selectedItems.value.find((i) => i.value === v);\n if (!item) {\n item = props.items.find((i) => i.value === v);\n }\n return { text: item?.text, value: v, cssClass: item?.cssClass };\n });\n};\nconst initPressEscapeEventListener = () => {\n document.addEventListener('keydown', closeOnEscapePressed);\n};\nconst closeOnEscapePressed = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n closeSelectMenu();\n }\n};\nconst initClickOutsideEventListener = () => {\n document.addEventListener('click', closeOnClickOutside);\n};\nconst closeOnClickOutside = (event: any) => {\n const refs = [selectEl.value, selectMenuEl.value];\n const withinBoundaries = refs.some((r) => event.composedPath().includes(r));\n if (!withinBoundaries) {\n closeSelectMenu();\n }\n};\nconst onClickItem = (item: DisplayItem) => {\n const index = value.value.findIndex((v) => v === item.value);\n if (index !== -1) {\n value.value.splice(index, 1);\n } else {\n value.value.push(item.value);\n }\n emit('change', item.value);\n nextTick(() => {\n validate();\n });\n};\nconst ensureMenuWidth = (parentEl: HTMLElement, menuEl: HTMLElement) => {\n menuEl.style.width = `${parentEl.offsetWidth}px`;\n};\nconst ensureMenuPosition = () => {\n nextTick(() => {\n ensureVisiblePosition(selectEl.value!, selectMenuEl.value!);\n ensureMenuWidth(selectEl.value!, selectMenuEl.value!);\n });\n};\nconst resetMenuPosition = () => {\n resetPosition(selectEl.value!, selectMenuEl.value!);\n};\nconst onChangeInputText = (text: string) => {\n emit('change:input', text);\n};\nconst closeSelectMenu = () => {\n selectMenu.value = false;\n inputRef.value?.blur();\n inputText.value = '';\n};\nconst deselectItem = (item: DisplayItem) => {\n const index = value.value.findIndex((v) => v === item.value);\n if (index !== -1) {\n value.value.splice(index, 1);\n emit('change', item.value);\n nextTick(() => {\n validate();\n });\n }\n};\nconst init = () => {\n if (props.items?.length > 0) {\n ensureSelectedItems();\n }\n};\ninit();\n//#endregion\n\n//#region Lifecycle Hooks\nonMounted(() => {\n initPressEscapeEventListener();\n initClickOutsideEventListener();\n});\nonBeforeUnmount(() => {\n document.removeEventListener('keydown', closeOnEscapePressed);\n document.removeEventListener('click', closeOnClickOutside);\n unlockScrollBody();\n // Make sure dropdown menu unmounted with itself\n resetMenuPosition();\n});\n//#endregion\n\n__expose({ validate, selectMenu });\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", null, [\n _createElementVNode(\"div\", {\n ref_key: \"selectEl\",\n ref: selectEl\n }, [\n _createVNode(BLabel, {\n id: id.value,\n label: labelDisplay.value,\n required: _ctx.required\n }, null, 8, [\"id\", \"label\", \"required\"]),\n (props.allowInput)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n class: _normalizeClass([{\n 'ds-border-focus ds-ring-1 ds-ring-focus':\n selectMenu.value && _unref(validationResult).valid,\n 'ds-ring-1 ds-ring-error': selectMenu.value && !_unref(validationResult).valid,\n 'ds-border-black/10': _unref(validationResult).valid,\n 'ds-border-error': !_unref(validationResult).valid,\n }, \"ds-relative ds-flex ds-flex-wrap ds-items-center ds-gap-x-1 ds-rounded-lg ds-border ds-bg-white ds-px-3 ds-py-1 ds-drop-shadow-light\"])\n }, [\n _createElementVNode(\"div\", _hoisted_1, [\n (_openBlock(), _createElementBlock(\"svg\", {\n class: _normalizeClass([[selectMenu.value ? 'ds-rotate-180' : ''], \"ds-h-4 ds-min-h-4 ds-w-4 ds-min-w-4 ds-transition-transform\"]),\n viewBox: \"0 0 320 512\",\n xmlns: \"http://www.w3.org/2000/svg\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (inputRef.value?.focus()))\n }, _hoisted_3, 2))\n ]),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(selectedItems.value, (item, i) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n key: `item${i}`,\n class: \"ds-my-0.5 ds-flex-initial ds-space-x-1 ds-rounded-lg ds-bg-black/10 ds-px-2\"\n }, [\n _createElementVNode(\"span\", null, _toDisplayString(item.text), 1),\n (_openBlock(), _createElementBlock(\"svg\", {\n class: \"ds-mb-1 ds-inline ds-h-4 ds-w-4 ds-cursor-pointer ds-fill-black/60 hover:ds-fill-black/40\",\n viewBox: \"0 0 512 512\",\n xmlns: \"http://www.w3.org/2000/svg\",\n onClick: ($event: any) => (deselectItem(item))\n }, _hoisted_6, 8, _hoisted_4))\n ]))\n }), 128)),\n (props.allowInput)\n ? (_openBlock(), _createBlock(BTextField, {\n key: 0,\n id: id.value,\n ref_key: \"inputRef\",\n ref: inputRef,\n modelValue: inputText.value,\n \"onUpdate:modelValue\": [\n _cache[1] || (_cache[1] = ($event: any) => ((inputText).value = $event)),\n onChangeInputText\n ],\n disabled: props.disabled,\n class: \"ds-flex-auto\",\n \"hide-details\": \"\",\n \"input-css-class\": \"ds-drop-shadow-none ds-border-none !ds-ring-0 ds-px-0 !ds-h-[30px] ds-pl-0\",\n onFocus: _cache[2] || (_cache[2] = ($event: any) => (selectMenu.value = true))\n }, null, 8, [\"id\", \"modelValue\", \"disabled\"]))\n : _createCommentVNode(\"\", true)\n ], 2))\n : (_openBlock(), _createElementBlock(\"button\", {\n key: 1,\n id: id.value,\n class: _normalizeClass(btnCssClass.value),\n disabled: _ctx.disabled,\n type: \"button\",\n onClick: _cache[3] || (_cache[3] = ($event: any) => (selectMenu.value = !selectMenu.value))\n }, [\n (selectedItems.value.length > 0)\n ? (_openBlock(), _createElementBlock(\"span\", {\n key: 0,\n class: _normalizeClass([_ctx.valueCssClass, \"ds-truncate ds-text-sm\"])\n }, _toDisplayString(selectedItems.value?.map((s) => s.text).join(', ')), 3))\n : (_openBlock(), _createElementBlock(\"span\", {\n key: 1,\n class: _normalizeClass([_ctx.valueCssClass, \"ds-truncate ds-text-sm ds-text-black/[0.4]\"])\n }, _toDisplayString(props.placeholder), 3)),\n _createTextVNode(\"   \"),\n (_openBlock(), _createElementBlock(\"svg\", {\n class: _normalizeClass([[selectMenu.value ? 'ds-rotate-180' : ''], \"ds-h-4 ds-min-h-4 ds-w-4 ds-min-w-4 ds-transition-transform\"]),\n viewBox: \"0 0 320 512\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, _hoisted_9, 2))\n ], 10, _hoisted_7)),\n _withDirectives(_createElementVNode(\"div\", {\n id: `${id.value}Menu`,\n ref_key: \"selectMenuEl\",\n ref: selectMenuEl,\n class: _normalizeClass([_ctx.menuCssClass, \"ds-absolute ds-z-50 ds-min-w-[8rem] ds-py-1\"]),\n \"data-cy\": _ctx.$attrs['data-cy'] ? `${_ctx.$attrs['data-cy']}Menu` : undefined,\n \"data-ut\": _ctx.$attrs['data-ut'] ? `${_ctx.$attrs['data-ut']}Menu` : undefined\n }, [\n _createElementVNode(\"div\", _hoisted_11, [\n _createElementVNode(\"ul\", _hoisted_12, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.items, (item, index) => {\n return (_openBlock(), _createElementBlock(\"li\", {\n key: `item${index}`,\n class: \"ds-cursor-pointer\",\n onClick: _withModifiers(($event: any) => (onClickItem(item)), [\"prevent\"])\n }, [\n _createElementVNode(\"a\", {\n class: _normalizeClass([\n item.cssClass +\n `${\n selectedItems.value.some((s) => s.value === item.value)\n ? ' ds-bg-slate-100'\n : ''\n }`\n , \"ds-flex ds-items-center ds-space-x-2 ds-px-4 ds-py-2 hover:ds-bg-slate-100\"])\n }, [\n _createVNode(BCheckbox, {\n modelValue: value.value,\n \"onUpdate:modelValue\": _cache[4] || (_cache[4] = ($event: any) => ((value).value = $event)),\n value: item.value,\n size: \"sm\"\n }, null, 8, [\"modelValue\", \"value\"]),\n _createElementVNode(\"span\", null, _toDisplayString(item?.text), 1)\n ], 2)\n ], 8, _hoisted_13))\n }), 128))\n ])\n ])\n ], 10, _hoisted_10), [\n [_vShow, selectMenu.value]\n ])\n ], 512),\n (!_ctx.hideDetails)\n ? (_openBlock(), _createBlock(BErrorMessage, {\n key: 0,\n \"error-message\": _unref(validationResult).errorMessage(),\n class: \"ds-mt-1\"\n }, null, 8, [\"error-message\"]))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_sfc_main","_defineComponent","__props","__expose","__emit","props","emit","selectEl","ref","inputRef","selectMenuEl","selectMenu","t","useI18n","validateRequired","val","inputText","selectedItems","id","computed","uuid","value","btnCssClass","result","validationResult","vRules","selectedItemCount","_a","_b","labelDisplay","validate","useValidationField","watch","lockScrollBody","ensureMenuPosition","unlockScrollBody","resetMenuPosition","ensureSelectedItems","v","item","i","initPressEscapeEventListener","closeOnEscapePressed","event","closeSelectMenu","initClickOutsideEventListener","closeOnClickOutside","r","onClickItem","index","nextTick","ensureMenuWidth","parentEl","menuEl","ensureVisiblePosition","resetPosition","onChangeInputText","text","deselectItem","onMounted","onBeforeUnmount","_ctx","_cache","_openBlock","_createElementBlock","_createElementVNode","_createVNode","BLabel","_normalizeClass","_unref","$event","_Fragment","_renderList","_toDisplayString","_createBlock","BTextField","_createCommentVNode","s","_createTextVNode","_withDirectives","_withModifiers","BCheckbox","_vShow","BErrorMessage"],"mappings":";;;;;;;;;AAGA,MAAMA,KAAa,EAAE,OAAO,qCACtBC,uBAA8C,QAAQ,EAAE,GAAG,mKAAmK,MAAM,EAAE,GACtOC,KAAa;AAAA,EACjBD;AACF,GACME,KAAa,CAAC,SAAS,GACvBC,uBAA8C,QAAQ,EAAE,GAAG,8RAA8R,MAAM,EAAE,GACjWC,KAAa;AAAA,EACjBD;AACF,GACME,KAAa,CAAC,MAAM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;AAAA,kBACD0B,EAAoB,KAAK;AAAA,oBACvB,OAAOG,EAAgB;AAAA,sBACvB7B,EAAK,WACL,GACEtB,EAAc,MAAM,KAAK,CAAC4D,MAAMA,EAAE,UAAUtC,EAAK,KAAK,IAClD,qBACA,EACN;AAAA,sBACA;AAAA,oBAAA,CAA6E;AAAA,kBAAA,GAC5E;AAAA,oBACD2B,EAAae,IAAW;AAAA,sBACtB,YAAY5D,EAAM;AAAA,sBAClB,uBAAuByC,EAAO,CAAC,MAAMA,EAAO,CAAC,IAAI,CAACQ,MAAkBjD,EAAO,QAAQiD;AAAA,sBACnF,OAAO/B,EAAK;AAAA,sBACZ,MAAM;AAAA,uBACL,MAAM,GAAG,CAAC,cAAc,OAAO,CAAC;AAAA,oBACnC0B,EAAoB,QAAQ,MAAMQ,EAAiBlC,KAAA,gBAAAA,EAAM,IAAI,GAAG,CAAC;AAAA,qBAChE,CAAC;AAAA,gBAAA,GACH,GAAGxC,EAAW,EAClB,GAAG,GAAG;AAAA,cAAA,CACR;AAAA,YAAA,CACF;AAAA,UAAA,GACA,IAAIH,EAAW,GAAG;AAAA,YACnB,CAACsF,IAAQvE,EAAW,KAAK;AAAA,UAAA,CAC1B;AAAA,WACA,GAAG;AAAA,QACJkD,EAAK,cAMHe,EAAoB,IAAI,EAAI,KAL3Bb,EAAW,GAAGW,EAAaS,IAAe;AAAA,UACzC,KAAK;AAAA,UACL,iBAAiBd,EAAO7C,CAAgB,EAAE,aAAa;AAAA,UACvD,OAAO;AAAA,QAAA,GACN,MAAM,GAAG,CAAC,eAAe,CAAC;AAAA,MACD,CACjC;AAAA,IAAA;AAAA,EAEH;AAEA,CAAC;"}
1
+ {"version":3,"file":"design-system17.mjs","sources":["../src/components/BMultiSelect.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { createVNode as _createVNode, unref as _unref, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock, renderList as _renderList, Fragment as _Fragment, toDisplayString as _toDisplayString, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createTextVNode as _createTextVNode, withModifiers as _withModifiers, vShow as _vShow, withDirectives as _withDirectives } from \"vue\"\n\nconst _hoisted_1 = { class: \"ds-absolute ds-right-3 ds-z-[1]\" }\nconst _hoisted_2 = [\"onClick\"]\nconst _hoisted_3 = [\"id\", \"disabled\"]\nconst _hoisted_4 = [\"id\", \"data-cy\", \"data-ut\"]\nconst _hoisted_5 = { class: \"ds-max-h-72 ds-overflow-y-auto ds-rounded-lg ds-bg-white ds-shadow\" }\nconst _hoisted_6 = { class: \"ds-py-1 ds-text-sm ds-text-black/[0.85]\" }\nconst _hoisted_7 = [\"onClick\"]\n\nimport {\n useValidationField,\n type ValidationRule,\n} from '@/composables/Validation';\nimport {\n ensureVisiblePosition,\n ensureVisibleY,\n lockScrollBody,\n resetPosition,\n unlockScrollBody,\n} from '@/helpers/ComponentHelper';\nimport { v4 as uuid } from 'uuid';\nimport {\n computed,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n watch,\n} from 'vue';\nimport { useI18n } from 'vue-i18n';\nimport BCheckbox from './BCheckbox.vue';\nimport BErrorMessage from './BErrorMessage.vue';\nimport BLabel from './BLabel.vue';\nimport BTextField from './BTextField.vue';\nimport type { DisplayItem } from '@/types';\n\n//#region Props\nexport interface BMultiSelectProps {\n inputId?: string;\n modelValue: Array<string | number>;\n label?: string;\n items: DisplayItem[];\n disabled?: boolean;\n placeholder?: string;\n valueCssClass?: string;\n menuCssClass?: string;\n /**\n * Array of custom validation rules.\n */\n validationRules?: ValidationRule[];\n /**\n * Validate if the field is left empty.\n */\n required?: boolean;\n requiredErrorMessage?: string;\n /**\n * Hide the validation error message.\n */\n hideDetails?: boolean;\n /**\n * Show number of selected items.\n */\n showSelectedItemCount?: boolean;\n /**\n * Allow to type to search.\n */\n allowInput?: boolean;\n}\n\n\nexport default /*@__PURE__*/_defineComponent({\n __name: 'BMultiSelect',\n props: {\n inputId: { default: '' },\n modelValue: {},\n label: { default: '' },\n items: {},\n disabled: { type: Boolean, default: false },\n placeholder: { default: '' },\n valueCssClass: { default: '' },\n menuCssClass: { default: '' },\n validationRules: { default: undefined },\n required: { type: Boolean, default: false },\n requiredErrorMessage: { default: '' },\n hideDetails: { type: Boolean, default: false },\n showSelectedItemCount: { type: Boolean, default: false },\n allowInput: { type: Boolean, default: false }\n },\n emits: [\"change\", \"open\", \"close\", \"change:input\", \"update:modelValue\"],\n setup(__props: any, { expose: __expose, emit: __emit }) {\n\n// https://vuejs.org/guide/essentials/event-handling.html#event-modifiers\nconst props = __props;\n//#endregion\n\n//#region Events\nconst emit = __emit;\n//#endregion\n\n//#region Data\nconst selectEl = ref<HTMLElement | null>(null);\nconst inputRef = ref<InstanceType<typeof BTextField> | null>(null);\nconst selectMenuEl = ref<HTMLElement | null>(null);\nconst selectMenu = ref(false);\nconst { t } = useI18n();\nconst validateRequired: ValidationRule = {\n validateRule: (val: Array<string | number>) => !!val && val.length > 0,\n errorMessage: () =>\n props.requiredErrorMessage || t('ds.global.field_required'),\n};\nconst inputText = ref('');\nconst selectedItems = ref<DisplayItem[]>([]);\nconst id = computed(() => props.inputId || `id-${uuid()}`);\nconst value = computed({\n get() {\n return props.modelValue;\n },\n set(val) {\n emit('update:modelValue', val);\n },\n});\nconst btnCssClass = computed(() => {\n let result = `ds-border ds-drop-shadow-light ds-text-sm ds-h-[40px] ds-px-3 ds-rounded-lg ds-block ds-w-full ds-inline-flex ds-items-center ds-justify-between `;\n result += props.disabled\n ? `ds-cursor-not-allowed ds-bg-[#f2f2f2] ds-text-black/[0.4] `\n : `ds-bg-white ds-text-black/[0.85] `;\n result += !validationResult.value.valid\n ? `ds-border-error focus:ds-ring-1 focus:ds-ring-error `\n : `ds-border-black/10 focus:ds-border-focus focus:ds-ring-1 focus:ds-ring-focus `;\n\n return result;\n});\nconst vRules = computed(() => {\n let result: ValidationRule[] = [];\n\n if (props.required) {\n result.push(validateRequired);\n }\n if (props.validationRules) {\n result = result.concat(props.validationRules);\n }\n\n return result.length ? result : undefined;\n});\nconst selectedItemCount = computed(() =>\n value.value?.length > 1\n ? ` (${t('ds.components.base.multi_select.selected_item_count', {\n count: value.value?.length,\n })})`\n : '',\n);\nconst labelDisplay = computed(() =>\n props.showSelectedItemCount\n ? `${props.label}${selectedItemCount.value}`\n : props.label,\n);\nconst { validate, validationResult } = useValidationField(\n id.value,\n value,\n vRules.value,\n);\n//#endregion\n\n//#region Watchers\nwatch(selectMenu, (val) => {\n if (val) {\n lockScrollBody();\n ensureMenuPosition();\n emit('open');\n } else {\n unlockScrollBody();\n resetMenuPosition();\n emit('close');\n }\n});\nwatch(\n value,\n () => {\n ensureSelectedItems();\n },\n {\n deep: true,\n },\n);\nwatch(\n () => props.items,\n () => {\n if (value.value.length !== 0 && selectedItems.value.length === 0) {\n ensureSelectedItems();\n }\n },\n {\n deep: true,\n },\n);\n//#endregion\n\n//#region Methods\nconst ensureSelectedItems = () => {\n selectedItems.value = value.value.map((v) => {\n let item = selectedItems.value.find((i) => i.value === v);\n if (!item) {\n item = props.items.find((i) => i.value === v);\n }\n return { text: item?.text, value: v, cssClass: item?.cssClass };\n });\n};\nconst initPressEscapeEventListener = () => {\n document.addEventListener('keydown', closeOnEscapePressed);\n};\nconst closeOnEscapePressed = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n closeSelectMenu();\n resetFocusedIndex();\n }\n};\nconst initClickOutsideEventListener = () => {\n document.addEventListener('click', closeOnClickOutside);\n};\nconst closeOnClickOutside = (event: any) => {\n const refs = [selectEl.value, selectMenuEl.value];\n const withinBoundaries = refs.some((r) => event.composedPath().includes(r));\n if (!withinBoundaries) {\n closeSelectMenu();\n resetFocusedIndex();\n }\n};\nconst onClickItem = (item: DisplayItem) => {\n const index = value.value.findIndex((v) => v === item.value);\n if (index !== -1) {\n value.value.splice(index, 1);\n } else {\n value.value.push(item.value);\n }\n emit('change', item.value);\n nextTick(() => {\n validate();\n });\n\n // Reset calculate the position of the menu\n ensureVisibleY(selectEl.value!, selectMenuEl.value!);\n};\nconst ensureMenuWidth = (parentEl: HTMLElement, menuEl: HTMLElement) => {\n menuEl.style.width = `${parentEl.offsetWidth}px`;\n};\nconst ensureMenuPosition = () => {\n nextTick(() => {\n ensureVisiblePosition(selectEl.value!, selectMenuEl.value!);\n ensureMenuWidth(selectEl.value!, selectMenuEl.value!);\n });\n};\nconst resetMenuPosition = () => {\n resetPosition(selectEl.value!, selectMenuEl.value!);\n};\nconst onChangeInputText = (text: string) => {\n emit('change:input', text);\n resetFocusedIndex();\n};\nconst closeSelectMenu = () => {\n selectMenu.value = false;\n inputRef.value?.blur();\n inputText.value = '';\n};\nconst deselectItem = (item: DisplayItem) => {\n const index = value.value.findIndex((v) => v === item.value);\n if (index !== -1) {\n value.value.splice(index, 1);\n emit('change', item.value);\n nextTick(() => {\n validate();\n });\n }\n};\nconst init = () => {\n if (props.items?.length > 0) {\n ensureSelectedItems();\n }\n};\ninit();\n//#endregion\n\n//#region Lifecycle Hooks\nonMounted(() => {\n initPressEscapeEventListener();\n initClickOutsideEventListener();\n});\nonBeforeUnmount(() => {\n document.removeEventListener('keydown', closeOnEscapePressed);\n document.removeEventListener('click', closeOnClickOutside);\n unlockScrollBody();\n // Make sure dropdown menu unmounted with itself\n resetMenuPosition();\n});\n//#endregion\n\n__expose({ validate, selectMenu });\n\nconst itemRefs = ref<HTMLLIElement[] | null>(null);\nconst focusedIndex = ref(-1);\nconst resetFocusedIndex = () => {\n focusedIndex.value = -1;\n};\nconst onKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n if (focusedIndex.value < props.items.length - 1) {\n focusedIndex.value++;\n nextTick(() => {\n if (itemRefs.value) {\n itemRefs.value[focusedIndex.value]?.scrollIntoView({\n block: 'nearest',\n });\n }\n });\n }\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n if (focusedIndex.value > 0) {\n focusedIndex.value--;\n nextTick(() => {\n if (itemRefs.value) {\n itemRefs.value[focusedIndex.value]?.scrollIntoView({\n block: 'nearest',\n });\n }\n });\n } else {\n // If at the top of the list, leave the list\n focusedIndex.value = -1;\n }\n } else if (event.key === 'Enter' && focusedIndex.value >= 0) {\n event.preventDefault();\n onClickItem(props.items[focusedIndex.value]);\n } else if (event.key === 'Tab') {\n closeSelectMenu();\n }\n};\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", null, [\n _createElementVNode(\"div\", {\n ref_key: \"selectEl\",\n ref: selectEl\n }, [\n _createVNode(BLabel, {\n id: id.value,\n label: labelDisplay.value,\n required: _ctx.required\n }, null, 8, [\"id\", \"label\", \"required\"]),\n (props.allowInput)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n class: _normalizeClass([{\n 'ds-border-focus ds-ring-1 ds-ring-focus':\n selectMenu.value && _unref(validationResult).valid,\n 'ds-ring-1 ds-ring-error': selectMenu.value && !_unref(validationResult).valid,\n 'ds-border-black/10': _unref(validationResult).valid,\n 'ds-border-error': !_unref(validationResult).valid,\n }, \"ds-relative ds-flex ds-flex-wrap ds-items-center ds-gap-x-1 ds-rounded-lg ds-border ds-bg-white ds-px-3 ds-py-1 ds-drop-shadow-light\"])\n }, [\n _createElementVNode(\"div\", _hoisted_1, [\n (_openBlock(), _createElementBlock(\"svg\", {\n class: _normalizeClass([[selectMenu.value ? 'ds-rotate-180' : ''], \"ds-h-4 ds-min-h-4 ds-w-4 ds-min-w-4 ds-transition-transform\"]),\n viewBox: \"0 0 320 512\",\n xmlns: \"http://www.w3.org/2000/svg\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (inputRef.value?.focus()))\n }, _cache[5] || (_cache[5] = [\n _createElementVNode(\"path\", { d: \"M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z\" }, null, -1)\n ]), 2))\n ]),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(selectedItems.value, (item, i) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n key: `item${i}`,\n class: \"ds-my-0.5 ds-flex-initial ds-space-x-1 ds-rounded-lg ds-bg-black/10 ds-px-2\"\n }, [\n _createElementVNode(\"span\", null, _toDisplayString(item.text), 1),\n (_openBlock(), _createElementBlock(\"svg\", {\n class: \"ds-mb-1 ds-inline ds-h-4 ds-w-4 ds-cursor-pointer ds-fill-black/60 hover:ds-fill-black/40\",\n viewBox: \"0 0 512 512\",\n xmlns: \"http://www.w3.org/2000/svg\",\n onClick: ($event: any) => (deselectItem(item))\n }, _cache[6] || (_cache[6] = [\n _createElementVNode(\"path\", { d: \"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z\" }, null, -1)\n ]), 8, _hoisted_2))\n ]))\n }), 128)),\n (props.allowInput)\n ? (_openBlock(), _createBlock(BTextField, {\n key: 0,\n id: id.value,\n ref_key: \"inputRef\",\n ref: inputRef,\n modelValue: inputText.value,\n \"onUpdate:modelValue\": [\n _cache[1] || (_cache[1] = ($event: any) => ((inputText).value = $event)),\n onChangeInputText\n ],\n disabled: props.disabled,\n class: \"ds-flex-auto\",\n \"hide-details\": \"\",\n \"input-css-class\": \"ds-drop-shadow-none ds-border-none !ds-ring-0 ds-px-0 !ds-h-[30px] ds-pl-0\",\n onChange: resetFocusedIndex,\n onFocus: _cache[2] || (_cache[2] = ($event: any) => (selectMenu.value = true)),\n onKeydown: onKeyDown\n }, null, 8, [\"id\", \"modelValue\", \"disabled\"]))\n : _createCommentVNode(\"\", true)\n ], 2))\n : (_openBlock(), _createElementBlock(\"button\", {\n key: 1,\n id: id.value,\n class: _normalizeClass(btnCssClass.value),\n disabled: _ctx.disabled,\n type: \"button\",\n onClick: _cache[3] || (_cache[3] = ($event: any) => (selectMenu.value = !selectMenu.value))\n }, [\n (selectedItems.value.length > 0)\n ? (_openBlock(), _createElementBlock(\"span\", {\n key: 0,\n class: _normalizeClass([_ctx.valueCssClass, \"ds-truncate ds-text-sm\"])\n }, _toDisplayString(selectedItems.value?.map((s) => s.text).join(', ')), 3))\n : (_openBlock(), _createElementBlock(\"span\", {\n key: 1,\n class: _normalizeClass([_ctx.valueCssClass, \"ds-truncate ds-text-sm ds-text-black/[0.4]\"])\n }, _toDisplayString(props.placeholder), 3)),\n _cache[8] || (_cache[8] = _createTextVNode(\"   \")),\n (_openBlock(), _createElementBlock(\"svg\", {\n class: _normalizeClass([[selectMenu.value ? 'ds-rotate-180' : ''], \"ds-h-4 ds-min-h-4 ds-w-4 ds-min-w-4 ds-transition-transform\"]),\n viewBox: \"0 0 320 512\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, _cache[7] || (_cache[7] = [\n _createElementVNode(\"path\", { d: \"M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z\" }, null, -1)\n ]), 2))\n ], 10, _hoisted_3)),\n _withDirectives(_createElementVNode(\"div\", {\n id: `${id.value}Menu`,\n ref_key: \"selectMenuEl\",\n ref: selectMenuEl,\n class: _normalizeClass([_ctx.menuCssClass, \"ds-absolute ds-z-50 ds-min-w-[8rem] ds-py-1\"]),\n \"data-cy\": _ctx.$attrs['data-cy'] ? `${_ctx.$attrs['data-cy']}Menu` : undefined,\n \"data-ut\": _ctx.$attrs['data-ut'] ? `${_ctx.$attrs['data-ut']}Menu` : undefined\n }, [\n _createElementVNode(\"div\", _hoisted_5, [\n _createElementVNode(\"ul\", _hoisted_6, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.items, (item, index) => {\n return (_openBlock(), _createElementBlock(\"li\", {\n key: `item${index}`,\n ref_for: true,\n ref_key: \"itemRefs\",\n ref: itemRefs,\n class: \"ds-cursor-pointer\",\n onClick: _withModifiers(($event: any) => (onClickItem(item)), [\"prevent\"])\n }, [\n _createElementVNode(\"a\", {\n class: _normalizeClass([[\n item.cssClass,\n {\n 'ds-bg-slate-100':\n focusedIndex.value !== index &&\n selectedItems.value.some((s) => s.value === item.value),\n 'ds-bg-slate-300': focusedIndex.value === index,\n },\n ], \"ds-flex ds-items-center ds-space-x-2 ds-px-4 ds-py-2 hover:ds-bg-slate-300\"])\n }, [\n _createVNode(BCheckbox, {\n modelValue: value.value,\n \"onUpdate:modelValue\": _cache[4] || (_cache[4] = ($event: any) => ((value).value = $event)),\n value: item.value,\n size: \"sm\"\n }, null, 8, [\"modelValue\", \"value\"]),\n _createElementVNode(\"span\", null, _toDisplayString(item?.text), 1)\n ], 2)\n ], 8, _hoisted_7))\n }), 128))\n ])\n ])\n ], 10, _hoisted_4), [\n [_vShow, selectMenu.value]\n ])\n ], 512),\n (!_ctx.hideDetails)\n ? (_openBlock(), _createBlock(BErrorMessage, {\n key: 0,\n \"error-message\": _unref(validationResult).errorMessage(),\n class: \"ds-mt-1\"\n }, null, 8, [\"error-message\"]))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_sfc_main","_defineComponent","__props","__expose","__emit","props","emit","selectEl","ref","inputRef","selectMenuEl","selectMenu","t","useI18n","validateRequired","val","inputText","selectedItems","id","computed","uuid","value","btnCssClass","result","validationResult","vRules","selectedItemCount","_a","_b","labelDisplay","validate","useValidationField","watch","lockScrollBody","ensureMenuPosition","unlockScrollBody","resetMenuPosition","ensureSelectedItems","v","item","i","initPressEscapeEventListener","closeOnEscapePressed","event","closeSelectMenu","resetFocusedIndex","initClickOutsideEventListener","closeOnClickOutside","r","onClickItem","index","nextTick","ensureVisibleY","ensureMenuWidth","parentEl","menuEl","ensureVisiblePosition","resetPosition","onChangeInputText","text","deselectItem","onMounted","onBeforeUnmount","itemRefs","focusedIndex","onKeyDown","_ctx","_cache","_openBlock","_createElementBlock","_createElementVNode","_createVNode","BLabel","_normalizeClass","_unref","$event","_Fragment","_renderList","_toDisplayString","_createBlock","BTextField","_createCommentVNode","s","_createTextVNode","_withDirectives","_withModifiers","BCheckbox","_vShow","BErrorMessage"],"mappings":";;;;;;;;;AAGA,MAAMA,KAAa,EAAE,OAAO,qCACtBC,KAAa,CAAC,SAAS,GACvBC,KAAa,CAAC,MAAM,UAAU,GAC9BC,KAAa,CAAC,MAAM,WAAW,SAAS,GACxCC,KAAa,EAAE,OAAO,wEACtBC,KAAa,EAAE,OAAO,6CACtBC,KAAa,CAAC,SAAS,GA+DDC,KAAiBC,gBAAAA,GAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,SAAS,EAAE,SAAS,GAAG;AAAA,IACvB,YAAY,CAAC;AAAA,IACb,OAAO,EAAE,SAAS,GAAG;AAAA,IACrB,OAAO,CAAC;AAAA,IACR,UAAU,EAAE,MAAM,SAAS,SAAS,GAAM;AAAA,IAC1C,aAAa,EAAE,SAAS,GAAG;AAAA,IAC3B,eAAe,EAAE,SAAS,GAAG;AAAA,IAC7B,cAAc,EAAE,SAAS,GAAG;AAAA,IAC5B,iBAAiB,EAAE,SAAS,OAAU;AAAA,IACtC,UAAU,EAAE,MAAM,SAAS,SAAS,GAAM;AAAA,IAC1C,sBAAsB,EAAE,SAAS,GAAG;AAAA,IACpC,aAAa,EAAE,MAAM,SAAS,SAAS,GAAM;AAAA,IAC7C,uBAAuB,EAAE,MAAM,SAAS,SAAS,GAAM;AAA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