@leaflink/stash 51.7.0 → 51.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Select.js CHANGED
@@ -1,32 +1,32 @@
1
- import { defineComponent as Oe, useAttrs as Ie, useSlots as Me, ref as c, computed as h, watch as U, nextTick as Y, onMounted as Fe, onUnmounted as Re, createBlock as J, openBlock as r, mergeProps as $e, unref as y, createSlots as Pe, withCtx as S, createElementVNode as f, toDisplayString as g, withDirectives as M, createElementBlock as d, Fragment as V, renderList as K, withKeys as re, normalizeClass as F, createCommentVNode as R, renderSlot as G, createTextVNode as $, withModifiers as P, createVNode as b, Teleport as ze, Transition as He, normalizeStyle as Ne, vModelText as Ae, vShow as Q } from "vue";
2
- import { u as De, a as Le, f as Ue, o as Ve, s as Ke } from "./floating-ui.vue-pzUuloyX.js";
3
- import Ge from "@leaflink/snitch";
4
- import qe from "lodash-es/debounce";
5
- import je from "lodash-es/isEmpty";
6
- import ie from "lodash-es/isEqual";
7
- import We from "lodash-es/isPlainObject";
8
- import Xe from "lodash-es/uniqueId";
9
- import Ye from "./useSearch.js";
10
- import { DEBOUNCE as Je, KEY_CODES as E } from "./constants.js";
11
- import Qe from "./directives/clickoutside.js";
12
- import { D as Ze } from "./MenusPlugin-Bk6UW6o9.js";
13
- import ce from "./Chip.js";
14
- import z from "./Icon.js";
15
- import { _ as et } from "./Field.vue_vue_type_script_setup_true_lang-DI6z3AE9.js";
16
- import { _ as tt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
17
- const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, st = ["id", "aria-labelledby"], at = ["id", "aria-errormessage", "aria-invalid", "disabled", "multiple", "name"], nt = ["selected", "value", "disabled"], ot = ["aria-controls", "aria-expanded", "aria-label", "aria-disabled"], rt = ["id"], it = ["onKeypress", "onMousedown"], ct = {
1
+ import { defineComponent as Me, useAttrs as $e, useSlots as ze, ref as c, computed as h, watch as K, nextTick as Y, onMounted as He, onUnmounted as Pe, createBlock as J, openBlock as r, mergeProps as Ne, unref as g, createSlots as Ae, withCtx as T, createElementVNode as f, toDisplayString as b, withDirectives as F, createElementBlock as d, Fragment as G, renderList as q, withKeys as ce, normalizeClass as M, createCommentVNode as $, renderSlot as z, createTextVNode as H, withModifiers as P, createVNode as B, Teleport as De, Transition as Le, normalizeStyle as Ue, vModelText as Ve, vShow as Q } from "vue";
2
+ import { u as Ke, a as Ge, f as qe, o as je, s as We } from "./floating-ui.vue-pzUuloyX.js";
3
+ import Xe from "@leaflink/snitch";
4
+ import ue from "lodash-es/debounce";
5
+ import Ye from "lodash-es/isEmpty";
6
+ import de from "lodash-es/isEqual";
7
+ import Je from "lodash-es/isPlainObject";
8
+ import Qe from "lodash-es/uniqueId";
9
+ import Ze from "./useSearch.js";
10
+ import { DEBOUNCE as et, KEY_CODES as x } from "./constants.js";
11
+ import tt from "./directives/clickoutside.js";
12
+ import { D as lt } from "./MenusPlugin-Bk6UW6o9.js";
13
+ import fe from "./Chip.js";
14
+ import { _ as st } from "./Field.vue_vue_type_script_setup_true_lang-DI6z3AE9.js";
15
+ import N from "./Icon.js";
16
+ import { _ as at } from "./_plugin-vue_export-helper-CHgC5LLL.js";
17
+ const nt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, ot = ["id", "aria-labelledby"], rt = ["id", "aria-errormessage", "aria-invalid", "disabled", "multiple", "name"], it = ["selected", "value", "disabled"], ct = ["aria-controls", "aria-expanded", "aria-label", "aria-disabled"], ut = ["id"], dt = ["onKeypress", "onMousedown"], ft = {
18
18
  key: 0,
19
19
  class: "stash-select__total"
20
- }, ut = {
20
+ }, pt = {
21
21
  key: 0,
22
22
  class: "tw-flex tw-items-center tw-border-b tw-border-blue-500 tw-pr-1.5"
23
- }, dt = ["data-test", "placeholder"], ft = { class: "stash-select__options options tw-my-1.5 tw-w-full tw-border-white tw-bg-white" }, pt = ["data-test", "onClick", "onMouseenter"], ht = {
23
+ }, ht = ["data-test", "placeholder"], vt = { class: "stash-select__options options tw-my-1.5 tw-w-full tw-border-white tw-bg-white" }, mt = ["data-test", "onClick", "onMouseenter"], yt = {
24
24
  key: 0,
25
25
  class: "tw-ml-auto tw-pl-1.5"
26
- }, vt = { class: "tw-m-1.5 tw-cursor-default tw-p-1.5" }, mt = {
26
+ }, _t = { class: "tw-m-1.5 tw-cursor-default tw-p-1.5" }, wt = {
27
27
  class: "tw-m-1.5 tw-cursor-default tw-p-1.5",
28
28
  "data-test": "stash-select|no-options"
29
- }, yt = /* @__PURE__ */ Oe({
29
+ }, gt = /* @__PURE__ */ Me({
30
30
  name: "ll-select",
31
31
  __name: "Select",
32
32
  props: {
@@ -59,7 +59,7 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, st = ["id
59
59
  useFuzzySearch: { type: Boolean, default: !1 },
60
60
  menuPlacement: { default: "bottom-start" },
61
61
  enableTeleport: { type: Boolean, default: !1 },
62
- teleportTo: { default: `#${Ze}` },
62
+ teleportTo: { default: `#${lt}` },
63
63
  addBottomSpace: { type: Boolean },
64
64
  errorText: {},
65
65
  hintText: {},
@@ -75,14 +75,14 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, st = ["id
75
75
  disabled: { type: Boolean }
76
76
  },
77
77
  emits: ["update:model-value", "clear", "add", "remove", "opened", "closed"],
78
- setup(ue, { emit: de }) {
79
- const t = ue, v = de, H = Ie(), fe = Me(), Z = c(null), m = c(null), x = c(null), q = c(null), ee = c(null), N = c(0), T = c(0), n = c([]), te = c(() => []), w = c(""), p = c(-1), u = c(!1), j = c({}), le = c(!1), { floatingStyles: pe } = De(Z, x, {
80
- whileElementsMounted: Le,
78
+ setup(pe, { emit: he }) {
79
+ const t = pe, v = he, A = $e(), ve = ze(), Z = c(null), m = c(null), C = c(null), O = c(null), ee = c(null), D = c(0), I = c(0), n = c([]), te = c(() => []), y = c(""), p = c(-1), u = c(!1), j = c({}), le = c(!1), { floatingStyles: me, update: ye } = Ke(Z, C, {
80
+ whileElementsMounted: Ge,
81
81
  placement: t.menuPlacement,
82
82
  middleware: [
83
- Ue(),
84
- Ve(({ rects: e, placement: l }) => l.split("-")[0] === "bottom" && N.value > T.value ? N.value - e.reference.height + 6 : 6),
85
- Ke({
83
+ qe(),
84
+ je(({ rects: e, placement: l }) => l.split("-")[0] === "bottom" && D.value > I.value ? D.value - e.reference.height + 6 : 6),
85
+ We({
86
86
  apply({ availableHeight: e, elements: l, rects: a }) {
87
87
  t.enableTeleport && Object.assign(l.floating.style, {
88
88
  maxWidth: `${a.reference.width}px`,
@@ -91,32 +91,32 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, st = ["id
91
91
  }
92
92
  })
93
93
  ]
94
- }), W = h(() => !t.hideSearch && t.searchable !== "false" && t.searchable !== !1), A = h(() => {
94
+ }), se = new ResizeObserver(() => k()), W = h(() => !t.hideSearch && t.searchable !== "false" && t.searchable !== !1), L = h(() => {
95
95
  let e = (le.value && t.lazy ? t.lazy() : t.options).filter(Boolean);
96
- return We(e[0]) || (e = e.map((l, a) => ({ name: l, id: a }))), e;
97
- }), he = h(() => n.value.length ? n.value.map((e) => e[t.displayBy] || e).join(", ") : ""), se = h(() => t.searchLoading || Object.keys(j.value).length > 0), C = h(() => t.disableFiltering || !(w.value || "").trim() ? A.value : te.value(w.value)), ve = h(() => N.value <= T.value), me = h(
98
- () => !u.value && !t.single && !ve.value && n.value.length
99
- ), ye = h(() => [n.value.length, t.selectItemType, "selected"].filter(Boolean).join(" ")), we = h(() => t.preventEmpty || t.allowEmpty === "false" || t.allowEmpty === !1);
100
- U(w, (e, l) => l !== e && L(-1)), U(n, () => I(), { deep: !0 }), U(
96
+ return Je(e[0]) || (e = e.map((l, a) => ({ name: l, id: a }))), e;
97
+ }), _e = h(() => n.value.length ? n.value.map((e) => e[t.displayBy] || e).join(", ") : ""), ae = h(() => t.searchLoading || Object.keys(j.value).length > 0), R = h(() => t.disableFiltering || !(y.value || "").trim() ? L.value : te.value(y.value)), we = h(() => D.value <= I.value), ge = h(
98
+ () => !u.value && !t.single && !we.value && n.value.length
99
+ ), be = h(() => [n.value.length, t.selectItemType, "selected"].filter(Boolean).join(" ")), Be = h(() => t.preventEmpty || t.allowEmpty === "false" || t.allowEmpty === !1);
100
+ K(y, (e, l) => l !== e && V(-1)), K(n, () => k(), { deep: !0 }), K(
101
101
  () => t.modelValue,
102
102
  (e) => {
103
103
  if (Array.isArray(e)) {
104
104
  const l = e.filter(Boolean);
105
- ie(l, n.value) || (n.value = l);
105
+ de(l, n.value) || (n.value = l);
106
106
  return;
107
107
  }
108
- if (!je(e)) {
109
- ie(e, n.value[0]) || (n.value[0] = e);
108
+ if (!Ye(e)) {
109
+ de(e, n.value[0]) || (n.value[0] = e);
110
110
  return;
111
111
  }
112
112
  n.value = [];
113
113
  },
114
114
  { immediate: !0 }
115
- ), U(
115
+ ), K(
116
116
  () => t.options,
117
117
  () => {
118
- const { searchFor: e } = Ye({
119
- items: h(() => A.value),
118
+ const { searchFor: e } = Ze({
119
+ items: h(() => L.value),
120
120
  fieldNames: t.searchBy.length ? t.searchBy : [t.displayBy],
121
121
  trackBy: t.trackBy
122
122
  });
@@ -124,17 +124,17 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, st = ["id
124
124
  },
125
125
  { immediate: !0 }
126
126
  );
127
- const X = (e) => e && typeof e == "object" && "disabled" in e && (e == null ? void 0 : e.disabled), _e = () => {
127
+ const k = ue(() => ie(), 50), X = (e) => e && typeof e == "object" && "disabled" in e && (e == null ? void 0 : e.disabled), ke = () => {
128
128
  n.value = [], v("update:model-value", t.single ? void 0 : n.value), v("clear");
129
- }, D = (e) => {
130
- t.disabled || !e || X(e) || (k(e) ? O(e) : (t.single && (n.value = []), n.value.push(e), v("update:model-value", t.single ? n.value[0] : n.value), v("add", e)), t.single && B());
131
- }, ge = (e) => {
129
+ }, U = (e) => {
130
+ t.disabled || !e || X(e) || (E(e) ? _(e) : (t.single && (n.value = []), n.value.push(e), v("update:model-value", t.single ? n.value[0] : n.value), v("add", e)), t.single && S());
131
+ }, Se = (e) => {
132
132
  if (t.single) {
133
- const a = A.value.find((o) => {
133
+ const a = L.value.find((o) => {
134
134
  var i;
135
135
  return ((i = o[t.trackBy]) == null ? void 0 : i.toString()) === e.target.value;
136
136
  });
137
- D(a);
137
+ U(a);
138
138
  return;
139
139
  }
140
140
  const l = [...e.target.selectedOptions];
@@ -142,129 +142,129 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, st = ["id
142
142
  l.find((i) => {
143
143
  var s;
144
144
  return i.value === ((s = a[t.trackBy]) == null ? void 0 : s.toString());
145
- }) || O(a);
145
+ }) || _(a);
146
146
  for (const a of l) {
147
- const o = A.value.find(
147
+ const o = L.value.find(
148
148
  (i) => {
149
149
  var s;
150
150
  return ((s = i[t.trackBy]) == null ? void 0 : s.toString()) === a.value;
151
151
  }
152
152
  );
153
- k(o) || D(o);
153
+ E(o) || U(o);
154
154
  }
155
- }, O = (e) => {
156
- if (t.disabled || we.value && n.value.length === 1)
155
+ }, _ = (e) => {
156
+ if (t.disabled || Be.value && n.value.length === 1)
157
157
  return;
158
158
  const l = n.value.findIndex((a) => a[t.trackBy] === e[t.trackBy]);
159
159
  if (l === -1) {
160
- Ge.warn("ll-select: could not find option to remove", e);
160
+ Xe.warn("ll-select: could not find option to remove", e);
161
161
  return;
162
162
  }
163
163
  n.value.splice(l, 1), v("update:model-value", t.single ? n.value[0] : n.value), v("remove", e, l);
164
- }, ae = () => {
165
- u.value || (I(), u.value = !0, v("opened"), W.value && Y(() => {
164
+ }, ne = () => {
165
+ u.value || (k(), u.value = !0, v("opened"), W.value && Y(() => {
166
166
  var e;
167
167
  (e = ee.value) == null || e.focus({ preventScroll: !0 });
168
168
  }));
169
- }, B = () => {
169
+ }, S = () => {
170
170
  var e;
171
- u.value && v("closed", n.value), L(-1), u.value = !1, t.preserveSearchTerm || (w.value = ""), (e = m.value) == null || e.blur();
172
- }, be = async (e) => {
171
+ u.value && v("closed", n.value), V(-1), u.value = !1, t.preserveSearchTerm || (y.value = ""), (e = m.value) == null || e.blur();
172
+ }, Ee = async (e) => {
173
173
  if (await Y(), !m.value)
174
174
  return;
175
- if (![E.ENTER, E.ESCAPE].includes(e.keyCode)) {
175
+ if (![x.ENTER, x.ESCAPE].includes(e.keyCode)) {
176
176
  const a = m.value.querySelector(".stash-select__option--highlighted"), o = a == null ? void 0 : a.getBoundingClientRect(), i = m.value.getBoundingClientRect();
177
177
  if (!o || !i)
178
178
  return;
179
179
  (o.bottom >= i.bottom || o.top <= i.top + o.height) && (a == null || a.scrollIntoView({ block: "nearest", inline: "nearest" }));
180
180
  }
181
- }, L = (e) => {
181
+ }, V = (e) => {
182
182
  p.value = e;
183
- }, Be = (e) => {
184
- if (e.keyCode === E.ESCAPE)
185
- B();
186
- else if (e.keyCode === E.DOWN && p.value < C.value.length - 1 && u.value)
183
+ }, Te = (e) => {
184
+ if (e.keyCode === x.ESCAPE)
185
+ S();
186
+ else if (e.keyCode === x.DOWN && p.value < R.value.length - 1 && u.value)
187
187
  p.value++;
188
- else if (e.keyCode === E.UP && p.value > 0)
189
- u.value && p.value--, x.value && W.value && p.value === 0 && (x.value.scrollTop -= 100);
190
- else if (e.keyCode === E.ENTER && p.value !== -1 && u.value)
191
- D(C.value[p.value]);
188
+ else if (e.keyCode === x.UP && p.value > 0)
189
+ u.value && p.value--, C.value && W.value && p.value === 0 && (C.value.scrollTop -= 100);
190
+ else if (e.keyCode === x.ENTER && p.value !== -1 && u.value)
191
+ U(R.value[p.value]);
192
192
  else
193
193
  return;
194
- e.preventDefault(), be(e);
195
- }, ne = qe(function() {
196
- ke();
197
- }, Je.FAST), ke = async function() {
194
+ e.preventDefault(), Ee(e);
195
+ }, oe = ue(function() {
196
+ xe();
197
+ }, et.FAST), xe = async function() {
198
198
  if (!t.onSearch)
199
199
  return;
200
- const e = Xe("search-request-");
200
+ const e = Qe("search-request-");
201
201
  try {
202
- j.value[e] = !0, await t.onSearch(w.value);
202
+ j.value[e] = !0, await t.onSearch(y.value);
203
203
  } finally {
204
204
  delete j.value[e];
205
205
  }
206
- }, Se = (e, l) => [
206
+ }, Ce = (e, l) => [
207
207
  {
208
208
  "stash-select__option": !0,
209
209
  "stash-select__option--disabled": X(e),
210
210
  "stash-select__option--highlighted": p.value === l,
211
- "stash-select__option--selected": k(e)
211
+ "stash-select__option--selected": E(e)
212
212
  },
213
213
  // @deprecated
214
214
  // backwards compatibility
215
215
  {
216
216
  "is-selected": p.value === l,
217
217
  "tw-bg-ice-200": p.value === l,
218
- "tw-bg-blue-100 tw-text-ice-700": k(e)
218
+ "tw-bg-blue-100 tw-text-ice-700": E(e)
219
219
  }
220
- ], k = (e) => e == null ? !1 : n.value.some((l) => (l == null ? void 0 : l[t.trackBy]) === e[t.trackBy]);
221
- function oe(e) {
220
+ ], E = (e) => e == null ? !1 : n.value.some((l) => (l == null ? void 0 : l[t.trackBy]) === e[t.trackBy]);
221
+ function re(e) {
222
222
  var o, i;
223
223
  if (!e)
224
224
  return !1;
225
- const l = (o = m.value) == null ? void 0 : o.contains(e), a = (i = x.value) == null ? void 0 : i.contains(e);
225
+ const l = (o = m.value) == null ? void 0 : o.contains(e), a = (i = C.value) == null ? void 0 : i.contains(e);
226
226
  return l || a;
227
227
  }
228
- function Ee(e) {
228
+ function Oe(e) {
229
229
  const l = e.relatedTarget;
230
- !oe(l) && l && B();
230
+ !re(l) && l && S();
231
231
  }
232
- function xe(e) {
232
+ function Ie(e) {
233
233
  const l = e.target;
234
- oe(l) || B();
234
+ re(l) || S();
235
235
  }
236
- const Te = () => {
237
- L(-1);
238
- }, I = async () => {
239
- await Y(), q.value && m.value && (T.value = T.value === 0 ? m.value.clientHeight : T.value, N.value = q.value.clientHeight);
236
+ const Re = () => {
237
+ V(-1);
238
+ }, ie = async () => {
239
+ await Y(), O.value && m.value && (I.value = I.value === 0 ? m.value.clientHeight : I.value, D.value = O.value.clientHeight), ye();
240
240
  };
241
- return Fe(() => {
242
- if (H.onInput)
241
+ return He(() => {
242
+ if (A.onInput)
243
243
  throw new Error("ll-select: use the @update:model-value event instead of @input.");
244
- window.addEventListener("resize", I), I();
245
- }), Re(() => {
246
- window.removeEventListener("resize", I);
247
- }), (e, l) => (r(), J(et, $e(t, {
248
- class: ["input ll-select stash-select", y(H).class],
244
+ O.value && se.observe(O.value), window.addEventListener("resize", k), k();
245
+ }), Pe(() => {
246
+ window.removeEventListener("resize", ie), se.disconnect(), k.cancel();
247
+ }), (e, l) => (r(), J(st, Ne(t, {
248
+ class: ["input ll-select stash-select", g(A).class],
249
249
  "data-test": "stash-select",
250
250
  "error-text": t.errorText || t.error,
251
251
  "hint-text": t.hintText || t.hint
252
- }), Pe({ _: 2 }, [
252
+ }), Ae({ _: 2 }, [
253
253
  t.isReadOnly ? {
254
254
  name: "default",
255
- fn: S(({ fieldId: a, labelId: o }) => [
256
- f("div", lt, [
255
+ fn: T(({ fieldId: a, labelId: o }) => [
256
+ f("div", nt, [
257
257
  f("span", {
258
258
  id: a,
259
259
  "aria-labelledby": o,
260
260
  class: "show-empty tw-h-min"
261
- }, g(he.value), 9, st)
261
+ }, b(_e.value), 9, ot)
262
262
  ])
263
263
  ]),
264
264
  key: "0"
265
265
  } : {
266
266
  name: "default",
267
- fn: S(({ fieldId: a, fieldErrorId: o, hasError: i }) => [
267
+ fn: T(({ fieldId: a, fieldErrorId: o, hasError: i }) => [
268
268
  f("select", {
269
269
  id: a,
270
270
  "aria-errormessage": o,
@@ -273,22 +273,22 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, st = ["id
273
273
  disabled: t.disabled,
274
274
  multiple: !t.single,
275
275
  name: t.name,
276
- onChange: ge
276
+ onChange: Se
277
277
  }, [
278
- (r(!0), d(V, null, K(C.value, (s, _) => (r(), d("option", {
279
- key: `srOnlyOption-${_}`,
280
- selected: k(s),
278
+ (r(!0), d(G, null, q(R.value, (s, w) => (r(), d("option", {
279
+ key: `srOnlyOption-${w}`,
280
+ selected: E(s),
281
281
  value: s[t.trackBy],
282
282
  disabled: X(s)
283
- }, g(s[t.displayBy] || ""), 9, nt))), 128)),
283
+ }, b(s[t.displayBy] || ""), 9, it))), 128)),
284
284
  l[5] || (l[5] = f("option", { value: "" }, null, -1))
285
- ], 40, at),
286
- M((r(), d("div", {
285
+ ], 40, rt),
286
+ F((r(), d("div", {
287
287
  ref_key: "selectRef",
288
288
  ref: Z,
289
289
  role: "listbox",
290
290
  "aria-hidden": "true",
291
- class: F(["stash-select__content-wrapper", [
291
+ class: M(["stash-select__content-wrapper", [
292
292
  {
293
293
  "stash-select--disabled": !!t.disabled,
294
294
  "stash-select--error": !!(t.errorText || t.error),
@@ -307,8 +307,8 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, st = ["id
307
307
  "aria-expanded": u.value,
308
308
  "aria-label": t.placeholder,
309
309
  "aria-disabled": t.disabled || void 0,
310
- onKeydown: Be,
311
- onKeyup: re(B, ["esc"])
310
+ onKeydown: Te,
311
+ onKeyup: ce(S, ["esc"])
312
312
  }, [
313
313
  f("div", {
314
314
  id: "listbox-" + a,
@@ -317,147 +317,157 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, st = ["id
317
317
  class: "input-field stash-select__content",
318
318
  tabindex: "0",
319
319
  "data-test": "stash-select|dropdown-trigger",
320
- onFocusin: ae,
320
+ onFocusin: ne,
321
321
  onFocusinOnce: l[4] || (l[4] = (s) => le.value = !0),
322
- onFocusout: Ee,
323
- onKeydown: ae,
324
- onMouseleave: Te
322
+ onFocusout: Oe,
323
+ onKeydown: ne,
324
+ onMouseleave: Re
325
325
  }, [
326
326
  f("ul", {
327
327
  ref_key: "chipsRef",
328
- ref: q,
328
+ ref: O,
329
329
  class: "stash-select__chips"
330
330
  }, [
331
- n.value.length ? R("", !0) : (r(), d("li", {
331
+ n.value.length ? $("", !0) : (r(), d("li", {
332
332
  key: 0,
333
- class: F(["stash-select__placeholder tw-mr-0 tw-pl-1.5", { "tw-truncate": !t.noTruncate }])
334
- }, g(t.placeholder), 3)),
335
- t.single ? (r(!0), d(V, { key: 1 }, K(n.value, (s) => (r(), d("li", {
333
+ class: M(["stash-select__placeholder tw-mr-0 tw-pl-1.5", { "tw-truncate": !t.noTruncate }])
334
+ }, b(t.placeholder), 3)),
335
+ t.single ? (r(!0), d(G, { key: 1 }, q(n.value, (s) => (r(), d("li", {
336
336
  key: `chip-${s[t.trackBy]}`,
337
- class: F(["stash-select__selected tw-mr-0 tw-pl-1.5", { "tw-truncate": !t.noTruncate }])
337
+ class: M(["stash-select__selected tw-mr-0 tw-pl-1.5", { "tw-truncate": !t.noTruncate }])
338
338
  }, [
339
- G(e.$slots, "selected", { option: s }, () => [
340
- $(g(s[t.displayBy] || s) + " ", 1),
339
+ z(e.$slots, "selected", {
340
+ option: s,
341
+ onRemove: () => _(s),
342
+ chipSelectedClass: "stash-select__chip"
343
+ }, () => [
344
+ H(b(s[t.displayBy] || s) + " ", 1),
341
345
  f("button", {
342
346
  tabindex: "-1",
343
347
  class: "stash-select__remove",
344
- onKeypress: re(P((_) => O(s), ["prevent"]), ["enter"]),
345
- onMousedown: P((_) => O(s), ["prevent", "stop"])
348
+ onKeypress: ce(P((w) => _(s), ["prevent"]), ["enter"]),
349
+ onMousedown: P((w) => _(s), ["prevent", "stop"])
346
350
  }, [
347
- b(z, {
351
+ B(N, {
348
352
  icon: "close",
349
353
  name: "close",
350
354
  size: "small"
351
355
  })
352
- ], 40, it)
356
+ ], 40, dt)
353
357
  ], !0)
354
- ], 2))), 128)) : (r(!0), d(V, { key: 2 }, K(n.value, (s) => (r(), d("li", {
358
+ ], 2))), 128)) : (r(!0), d(G, { key: 2 }, q(n.value, (s) => (r(), d("li", {
355
359
  key: `chip-${s[t.trackBy]}`,
356
360
  class: "tw-inline-block"
357
361
  }, [
358
- b(ce, {
359
- "bg-color": "blue-500",
360
- "is-removable": "",
361
- "text-color": "white",
362
- class: "stash-select__chip",
363
- onRemove: (_) => O(s)
364
- }, {
365
- default: S(() => [
366
- $(g(s[t.displayBy] || s), 1)
367
- ]),
368
- _: 2
369
- }, 1032, ["onRemove"])
362
+ z(e.$slots, "selected", {
363
+ option: s,
364
+ onRemove: () => _(s),
365
+ chipSelectedClass: "stash-select__chip"
366
+ }, () => [
367
+ B(fe, {
368
+ "bg-color": "blue-500",
369
+ "is-removable": "",
370
+ "text-color": "white",
371
+ class: "stash-select__chip",
372
+ onRemove: (w) => _(s)
373
+ }, {
374
+ default: T(() => [
375
+ H(b(s[t.displayBy] || s), 1)
376
+ ]),
377
+ _: 2
378
+ }, 1032, ["onRemove"])
379
+ ], !0)
370
380
  ]))), 128))
371
381
  ], 512),
372
- me.value ? (r(), d("div", ct, [
373
- b(ce, {
382
+ ge.value ? (r(), d("div", ft, [
383
+ B(fe, {
374
384
  "bg-color": "blue-500",
375
385
  "is-removable": "",
376
386
  "text-color": "white",
377
387
  class: "stash-select__chip",
378
- onRemove: _e
388
+ onRemove: ke
379
389
  }, {
380
- default: S(() => [
381
- $(g(ye.value), 1)
390
+ default: T(() => [
391
+ H(b(be.value), 1)
382
392
  ]),
383
393
  _: 1
384
394
  })
385
- ])) : R("", !0),
386
- t.icon ? (r(), J(z, {
395
+ ])) : $("", !0),
396
+ t.icon ? (r(), J(N, {
387
397
  key: 1,
388
- class: F(["stash-select__icon", { "tw-text-ice-500": t.disabled }]),
398
+ class: M(["stash-select__icon", { "tw-text-ice-500": t.disabled }]),
389
399
  "data-test": "stash-select|toggle-icon",
390
400
  name: t.icon,
391
- onMousedown: l[0] || (l[0] = P((s) => u.value && B(), ["prevent"]))
392
- }, null, 8, ["name", "class"])) : R("", !0),
393
- (r(), J(ze, {
401
+ onMousedown: l[0] || (l[0] = P((s) => u.value && S(), ["prevent"]))
402
+ }, null, 8, ["name", "class"])) : $("", !0),
403
+ (r(), J(De, {
394
404
  to: t.teleportTo,
395
405
  disabled: !t.enableTeleport
396
406
  }, [
397
- b(He, { name: "fade" }, {
398
- default: S(() => [
399
- M(f("div", {
407
+ B(Le, { name: "fade" }, {
408
+ default: T(() => [
409
+ F(f("div", {
400
410
  ref_key: "optionsWrapperRef",
401
- ref: x,
411
+ ref: C,
402
412
  class: "stash-select__border-selector tw-w-full tw-shadow-2xl",
403
- style: Ne(y(pe)),
413
+ style: Ue(g(me)),
404
414
  onClick: l[3] || (l[3] = P(() => {
405
415
  }, ["stop"]))
406
416
  }, [
407
- W.value ? (r(), d("div", ut, [
408
- M(f("input", {
417
+ W.value ? (r(), d("div", pt, [
418
+ F(f("input", {
409
419
  ref_key: "searchRef",
410
420
  ref: ee,
411
- "onUpdate:modelValue": l[1] || (l[1] = (s) => w.value = s),
421
+ "onUpdate:modelValue": l[1] || (l[1] = (s) => y.value = s),
412
422
  type: "text",
413
423
  autocomplete: "off",
414
424
  class: "stash-select__search",
415
- "data-test": y(H)["data-test"] ? y(H)["data-test"] + "-search" : "stash-select|search",
425
+ "data-test": g(A)["data-test"] ? g(A)["data-test"] + "-search" : "stash-select|search",
416
426
  placeholder: t.searchPlaceholder,
417
427
  spellcheck: !1,
418
428
  onInput: l[2] || (l[2] = //@ts-ignore
419
- (...s) => y(ne) && y(ne)(...s))
420
- }, null, 40, dt), [
421
- [Ae, w.value]
429
+ (...s) => g(oe) && g(oe)(...s))
430
+ }, null, 40, ht), [
431
+ [Ve, y.value]
422
432
  ]),
423
- b(z, {
433
+ B(N, {
424
434
  name: "search",
425
435
  class: "tw-text-ice-500"
426
436
  })
427
- ])) : R("", !0),
428
- f("ul", ft, [
429
- (r(!0), d(V, null, K(C.value, (s, _) => (r(), d("li", {
437
+ ])) : $("", !0),
438
+ f("ul", vt, [
439
+ (r(!0), d(G, null, q(R.value, (s, w) => (r(), d("li", {
430
440
  key: `option-${s[t.trackBy]}`,
431
441
  "data-test": s[t.trackBy],
432
- class: F(Se(s, _)),
433
- onClick: (Ce) => D(s),
434
- onMouseenter: P((Ce) => L(_), ["self"])
442
+ class: M(Ce(s, w)),
443
+ onClick: (Fe) => U(s),
444
+ onMouseenter: P((Fe) => V(w), ["self"])
435
445
  }, [
436
- G(e.$slots, "option", { option: s }, () => [
437
- $(g(s[t.displayBy] || s), 1)
446
+ z(e.$slots, "option", { option: s }, () => [
447
+ H(b(s[t.displayBy] || s), 1)
438
448
  ], !0),
439
- k(s) && !t.hideCheck ? (r(), d("span", ht, [
440
- b(z, {
449
+ E(s) && !t.hideCheck ? (r(), d("span", yt, [
450
+ B(N, {
441
451
  class: "tw-text-blue-500",
442
452
  name: "check"
443
453
  })
444
- ])) : R("", !0)
445
- ], 42, pt))), 128)),
446
- M(f("li", vt, [
447
- b(z, {
454
+ ])) : $("", !0)
455
+ ], 42, mt))), 128)),
456
+ F(f("li", _t, [
457
+ B(N, {
448
458
  "data-test": "stash-select|options-loading",
449
459
  name: "working",
450
460
  class: "tw-animate-spin tw-text-ice-500"
451
461
  })
452
462
  ], 512), [
453
- [Q, t.loading || se.value]
463
+ [Q, t.loading || ae.value]
454
464
  ]),
455
- M(f("li", mt, [
456
- G(e.$slots, "no-options", {}, () => [
457
- l[6] || (l[6] = $(" No options "))
465
+ F(f("li", wt, [
466
+ z(e.$slots, "no-options", {}, () => [
467
+ l[6] || (l[6] = H(" No options "))
458
468
  ], !0)
459
469
  ], 512), [
460
- [Q, !t.loading && !se.value && !C.value.length]
470
+ [Q, !t.loading && !ae.value && !R.value.length]
461
471
  ])
462
472
  ])
463
473
  ], 4), [
@@ -467,24 +477,24 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, st = ["id
467
477
  _: 3
468
478
  })
469
479
  ], 8, ["to", "disabled"]))
470
- ], 40, rt)
471
- ], 42, ot)), [
472
- [y(Qe), xe]
480
+ ], 40, ut)
481
+ ], 42, ct)), [
482
+ [g(tt), Ie]
473
483
  ])
474
484
  ]),
475
485
  key: "1"
476
486
  },
477
- y(fe).hint ? {
487
+ ve.hint ? {
478
488
  name: "hint",
479
- fn: S(() => [
480
- G(e.$slots, "hint", {}, void 0, !0)
489
+ fn: T(() => [
490
+ z(e.$slots, "hint", {}, void 0, !0)
481
491
  ]),
482
492
  key: "2"
483
493
  } : void 0
484
494
  ]), 1040, ["class", "error-text", "hint-text"]));
485
495
  }
486
- }), zt = /* @__PURE__ */ tt(yt, [["__scopeId", "data-v-c5883dfe"]]);
496
+ }), At = /* @__PURE__ */ at(gt, [["__scopeId", "data-v-cb7a2d07"]]);
487
497
  export {
488
- zt as default
498
+ At as default
489
499
  };
490
500
  //# sourceMappingURL=Select.js.map