@leaflink/stash 51.8.0 → 51.9.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.
package/dist/Select.js CHANGED
@@ -1,32 +1,32 @@
1
- import { defineComponent as Oe, useAttrs as Ie, useSlots as Re, ref as c, computed as v, watch as V, nextTick as Y, onMounted as Me, onUnmounted as Fe, createBlock as J, openBlock as r, mergeProps as $e, unref as g, createSlots as Pe, withCtx as E, createElementVNode as f, toDisplayString as b, withDirectives as R, createElementBlock as d, Fragment as K, renderList as G, withKeys as re, normalizeClass as M, createCommentVNode as F, renderSlot as $, createTextVNode as P, withModifiers as z, 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 T } 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 H 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 $e, useAttrs as ze, useSlots as He, ref as c, computed as h, watch as M, nextTick as Y, onMounted as Pe, onUnmounted as Ne, createBlock as J, openBlock as r, mergeProps as Ae, unref as g, createSlots as De, withCtx as T, createElementVNode as f, toDisplayString as b, withDirectives as $, createElementBlock as d, Fragment as G, renderList as q, withKeys as ue, normalizeClass as z, createCommentVNode as H, renderSlot as P, createTextVNode as N, withModifiers as A, createVNode as B, Teleport as Ue, Transition as Le, normalizeStyle as Ve, vModelText as Ke, vShow as Q } from "vue";
2
+ import { u as Ge, a as qe, f as je, o as We, s as Xe } from "./floating-ui.vue-pzUuloyX.js";
3
+ import Ye from "@leaflink/snitch";
4
+ import Z from "lodash-es/debounce";
5
+ import Je from "lodash-es/isEmpty";
6
+ import de from "lodash-es/isEqual";
7
+ import Qe from "lodash-es/isPlainObject";
8
+ import Ze from "lodash-es/uniqueId";
9
+ import et from "./useSearch.js";
10
+ import { DEBOUNCE as tt, KEY_CODES as x } from "./constants.js";
11
+ import lt from "./directives/clickoutside.js";
12
+ import { D as st } from "./MenusPlugin-Bk6UW6o9.js";
13
+ import fe from "./Chip.js";
14
+ import { _ as at } from "./Field.vue_vue_type_script_setup_true_lang-DI6z3AE9.js";
15
+ import D from "./Icon.js";
16
+ import { _ as nt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
17
+ const ot = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, rt = ["id", "aria-labelledby"], it = ["id", "aria-errormessage", "aria-invalid", "disabled", "multiple", "name"], ct = ["selected", "value", "disabled"], ut = ["aria-controls", "aria-expanded", "aria-label", "aria-disabled"], dt = ["id"], ft = ["onKeypress", "onMousedown"], pt = {
18
18
  key: 0,
19
19
  class: "stash-select__total"
20
- }, ut = {
20
+ }, ht = {
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"], vt = {
23
+ }, vt = ["data-test", "placeholder"], mt = { class: "stash-select__options options tw-my-1.5 tw-w-full tw-border-white tw-bg-white" }, yt = ["data-test", "onClick", "onMouseenter"], _t = {
24
24
  key: 0,
25
25
  class: "tw-ml-auto tw-pl-1.5"
26
- }, ht = { class: "tw-m-1.5 tw-cursor-default tw-p-1.5" }, mt = {
26
+ }, wt = { class: "tw-m-1.5 tw-cursor-default tw-p-1.5" }, gt = {
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
+ }, bt = /* @__PURE__ */ $e({
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: `#${st}` },
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, h = de, N = Ie(), fe = Re(), Z = c(null), m = c(null), x = c(null), q = c(null), ee = c(null), A = c(0), C = c(0), n = c([]), te = c(() => []), y = 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, U = ze(), ve = He(), ee = c(null), m = c(null), C = c(null), O = c(null), te = c(null), I = c(0), R = c(0), n = c([]), le = c(() => []), y = c(""), p = c(-1), u = c(!1), j = c({}), se = c(!1), { floatingStyles: me, update: ye } = Ge(ee, C, {
80
+ whileElementsMounted: qe,
81
81
  placement: t.menuPlacement,
82
82
  middleware: [
83
- Ue(),
84
- Ve(({ rects: e, placement: l }) => l.split("-")[0] === "bottom" && A.value > C.value ? A.value - e.reference.height + 6 : 6),
85
- Ke({
83
+ je(),
84
+ We(({ rects: e, placement: l }) => l.split("-")[0] === "bottom" && I.value > R.value ? I.value - e.reference.height + 6 : 6),
85
+ Xe({
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,50 +91,50 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, st = ["id
91
91
  }
92
92
  })
93
93
  ]
94
- }), W = v(() => !t.hideSearch && t.searchable !== "false" && t.searchable !== !1), D = v(() => {
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
- }), ve = v(() => n.value.length ? n.value.map((e) => e[t.displayBy] || e).join(", ") : ""), se = v(() => t.searchLoading || Object.keys(j.value).length > 0), O = v(() => t.disableFiltering || !(y.value || "").trim() ? D.value : te.value(y.value)), he = v(() => A.value <= C.value), me = v(
98
- () => !u.value && !t.single && !he.value && n.value.length
99
- ), ye = v(() => [n.value.length, t.selectItemType, "selected"].filter(Boolean).join(" ")), we = v(() => t.preventEmpty || t.allowEmpty === "false" || t.allowEmpty === !1);
100
- V(y, (e, l) => l !== e && U(-1)), V(n, () => I(), { deep: !0 }), V(
94
+ }), ae = new ResizeObserver(() => k()), W = h(() => !t.hideSearch && t.searchable !== "false" && t.searchable !== !1), L = h(() => {
95
+ let e = (se.value && t.lazy ? t.lazy() : t.options).filter(Boolean);
96
+ return Qe(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(", ") : ""), ne = h(() => t.searchLoading || Object.keys(j.value).length > 0), F = h(() => t.disableFiltering || !(y.value || "").trim() ? L.value : le.value(y.value)), we = h(() => I.value <= R.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
+ M(y, (e, l) => l !== e && K(-1)), M(n, () => k(), { deep: !0 }), M(
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 (!Je(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
- ), V(
115
+ ), M(
116
116
  () => t.options,
117
117
  () => {
118
- const { searchFor: e } = Ye({
119
- items: v(() => D.value),
118
+ const { searchFor: e } = et({
119
+ items: h(() => L.value),
120
120
  fieldNames: t.searchBy.length ? t.searchBy : [t.displayBy],
121
121
  trackBy: t.trackBy
122
122
  });
123
- te.value = (l) => e(l, { fuzzy: t.useFuzzySearch });
123
+ le.value = (l) => e(l, { fuzzy: t.useFuzzySearch });
124
124
  },
125
125
  { immediate: !0 }
126
- );
127
- const X = (e) => e && typeof e == "object" && "disabled" in e && (e == null ? void 0 : e.disabled), _e = () => {
128
- n.value = [], h("update:model-value", t.single ? void 0 : n.value), h("clear");
129
- }, L = (e) => {
130
- t.disabled || !e || X(e) || (S(e) ? w(e) : (t.single && (n.value = []), n.value.push(e), h("update:model-value", t.single ? n.value[0] : n.value), h("add", e)), t.single && k());
131
- }, ge = (e) => {
126
+ ), M(I, () => ke());
127
+ const ke = Z(() => ye(), 50), k = Z(() => ce(), 50), X = (e) => e && typeof e == "object" && "disabled" in e && (e == null ? void 0 : e.disabled), Se = () => {
128
+ n.value = [], v("update:model-value", t.single ? void 0 : n.value), v("clear");
129
+ }, V = (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
+ }, Ee = (e) => {
132
132
  if (t.single) {
133
- const a = D.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
- L(a);
137
+ V(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
- }) || w(a);
145
+ }) || _(a);
146
146
  for (const a of l) {
147
- const o = D.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
- S(o) || L(o);
153
+ E(o) || V(o);
154
154
  }
155
- }, w = (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
+ Ye.warn("ll-select: could not find option to remove", e);
161
161
  return;
162
162
  }
163
- n.value.splice(l, 1), h("update:model-value", t.single ? n.value[0] : n.value), h("remove", e, l);
164
- }, ae = () => {
165
- u.value || (I(), u.value = !0, h("opened"), W.value && Y(() => {
163
+ n.value.splice(l, 1), v("update:model-value", t.single ? n.value[0] : n.value), v("remove", e, l);
164
+ }, oe = () => {
165
+ u.value || (k(), u.value = !0, v("opened"), W.value && Y(() => {
166
166
  var e;
167
- (e = ee.value) == null || e.focus({ preventScroll: !0 });
167
+ (e = te.value) == null || e.focus({ preventScroll: !0 });
168
168
  }));
169
- }, k = () => {
169
+ }, S = () => {
170
170
  var e;
171
- u.value && h("closed", n.value), U(-1), u.value = !1, t.preserveSearchTerm || (y.value = ""), (e = m.value) == null || e.blur();
172
- }, be = async (e) => {
171
+ u.value && v("closed", n.value), K(-1), u.value = !1, t.preserveSearchTerm || (y.value = ""), (e = m.value) == null || e.blur();
172
+ }, Te = async (e) => {
173
173
  if (await Y(), !m.value)
174
174
  return;
175
- if (![T.ENTER, T.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
- }, U = (e) => {
181
+ }, K = (e) => {
182
182
  p.value = e;
183
- }, Be = (e) => {
184
- if (e.keyCode === T.ESCAPE)
185
- k();
186
- else if (e.keyCode === T.DOWN && p.value < O.value.length - 1 && u.value)
183
+ }, xe = (e) => {
184
+ if (e.keyCode === x.ESCAPE)
185
+ S();
186
+ else if (e.keyCode === x.DOWN && p.value < F.value.length - 1 && u.value)
187
187
  p.value++;
188
- else if (e.keyCode === T.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 === T.ENTER && p.value !== -1 && u.value)
191
- L(O.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
+ V(F.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(), Te(e);
195
+ }, re = Z(function() {
196
+ Ce();
197
+ }, tt.FAST), Ce = async function() {
198
198
  if (!t.onSearch)
199
199
  return;
200
- const e = Xe("search-request-");
200
+ const e = Ze("search-request-");
201
201
  try {
202
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
+ }, Oe = (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": S(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": S(e)
218
+ "tw-bg-blue-100 tw-text-ice-700": E(e)
219
219
  }
220
- ], S = (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 ie(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 Ie(e) {
229
229
  const l = e.relatedTarget;
230
- !oe(l) && l && k();
230
+ !ie(l) && l && S();
231
231
  }
232
- function Te(e) {
232
+ function Re(e) {
233
233
  const l = e.target;
234
- oe(l) || k();
234
+ ie(l) || S();
235
235
  }
236
- const xe = () => {
237
- U(-1);
238
- }, I = async () => {
239
- await Y(), q.value && m.value && (C.value = C.value === 0 ? m.value.clientHeight : C.value, A.value = q.value.clientHeight);
236
+ const Fe = () => {
237
+ K(-1);
238
+ }, ce = async () => {
239
+ await Y(), O.value && m.value && (R.value = R.value === 0 ? m.value.clientHeight : R.value, I.value = O.value.clientHeight);
240
240
  };
241
- return Me(() => {
242
- if (N.onInput)
241
+ return Pe(() => {
242
+ if (U.onInput)
243
243
  throw new Error("ll-select: use the @update:model-value event instead of @input.");
244
- window.addEventListener("resize", I), I();
245
- }), Fe(() => {
246
- window.removeEventListener("resize", I);
247
- }), (e, l) => (r(), J(et, $e(t, {
248
- class: ["input ll-select stash-select", g(N).class],
244
+ O.value && ae.observe(O.value), window.addEventListener("resize", k), k();
245
+ }), Ne(() => {
246
+ window.removeEventListener("resize", ce), ae.disconnect(), k.cancel();
247
+ }), (e, l) => (r(), J(at, Ae(t, {
248
+ class: ["input ll-select stash-select", g(U).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
+ }), De({ _: 2 }, [
253
253
  t.isReadOnly ? {
254
254
  name: "default",
255
- fn: E(({ fieldId: a, labelId: o }) => [
256
- f("div", lt, [
255
+ fn: T(({ fieldId: a, labelId: o }) => [
256
+ f("div", ot, [
257
257
  f("span", {
258
258
  id: a,
259
259
  "aria-labelledby": o,
260
260
  class: "show-empty tw-h-min"
261
- }, b(ve.value), 9, st)
261
+ }, b(_e.value), 9, rt)
262
262
  ])
263
263
  ]),
264
264
  key: "0"
265
265
  } : {
266
266
  name: "default",
267
- fn: E(({ 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: Ee
277
277
  }, [
278
- (r(!0), d(K, null, G(O.value, (s, _) => (r(), d("option", {
279
- key: `srOnlyOption-${_}`,
280
- selected: S(s),
278
+ (r(!0), d(G, null, q(F.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
- }, b(s[t.displayBy] || ""), 9, nt))), 128)),
283
+ }, b(s[t.displayBy] || ""), 9, ct))), 128)),
284
284
  l[5] || (l[5] = f("option", { value: "" }, null, -1))
285
- ], 40, at),
286
- R((r(), d("div", {
285
+ ], 40, it),
286
+ $((r(), d("div", {
287
287
  ref_key: "selectRef",
288
- ref: Z,
288
+ ref: ee,
289
289
  role: "listbox",
290
290
  "aria-hidden": "true",
291
- class: M(["stash-select__content-wrapper", [
291
+ class: z(["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(k, ["esc"])
310
+ onKeydown: xe,
311
+ onKeyup: ue(S, ["esc"])
312
312
  }, [
313
313
  f("div", {
314
314
  id: "listbox-" + a,
@@ -317,155 +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,
321
- onFocusinOnce: l[4] || (l[4] = (s) => le.value = !0),
322
- onFocusout: Ee,
323
- onKeydown: ae,
324
- onMouseleave: xe
320
+ onFocusin: oe,
321
+ onFocusinOnce: l[4] || (l[4] = (s) => se.value = !0),
322
+ onFocusout: Ie,
323
+ onKeydown: oe,
324
+ onMouseleave: Fe
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 ? F("", !0) : (r(), d("li", {
331
+ n.value.length ? H("", !0) : (r(), d("li", {
332
332
  key: 0,
333
- class: M(["stash-select__placeholder tw-mr-0 tw-pl-1.5", { "tw-truncate": !t.noTruncate }])
333
+ class: z(["stash-select__placeholder tw-mr-0 tw-pl-1.5", { "tw-truncate": !t.noTruncate }])
334
334
  }, b(t.placeholder), 3)),
335
- t.single ? (r(!0), d(K, { key: 1 }, G(n.value, (s) => (r(), d("li", {
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: M(["stash-select__selected tw-mr-0 tw-pl-1.5", { "tw-truncate": !t.noTruncate }])
337
+ class: z(["stash-select__selected tw-mr-0 tw-pl-1.5", { "tw-truncate": !t.noTruncate }])
338
338
  }, [
339
- $(e.$slots, "selected", {
339
+ P(e.$slots, "selected", {
340
340
  option: s,
341
- onRemove: () => w(s)
341
+ onRemove: () => _(s),
342
+ chipSelectedClass: "stash-select__chip"
342
343
  }, () => [
343
- P(b(s[t.displayBy] || s) + " ", 1),
344
+ N(b(s[t.displayBy] || s) + " ", 1),
344
345
  f("button", {
345
346
  tabindex: "-1",
346
347
  class: "stash-select__remove",
347
- onKeypress: re(z((_) => w(s), ["prevent"]), ["enter"]),
348
- onMousedown: z((_) => w(s), ["prevent", "stop"])
348
+ onKeypress: ue(A((w) => _(s), ["prevent"]), ["enter"]),
349
+ onMousedown: A((w) => _(s), ["prevent", "stop"])
349
350
  }, [
350
- B(H, {
351
+ B(D, {
351
352
  icon: "close",
352
353
  name: "close",
353
354
  size: "small"
354
355
  })
355
- ], 40, it)
356
+ ], 40, ft)
356
357
  ], !0)
357
- ], 2))), 128)) : (r(!0), d(K, { key: 2 }, G(n.value, (s) => (r(), d("li", {
358
+ ], 2))), 128)) : (r(!0), d(G, { key: 2 }, q(n.value, (s) => (r(), d("li", {
358
359
  key: `chip-${s[t.trackBy]}`,
359
360
  class: "tw-inline-block"
360
361
  }, [
361
- $(e.$slots, "selected", {
362
+ P(e.$slots, "selected", {
362
363
  option: s,
363
- onRemove: () => w(s)
364
+ onRemove: () => _(s),
365
+ chipSelectedClass: "stash-select__chip"
364
366
  }, () => [
365
- B(ce, {
367
+ B(fe, {
366
368
  "bg-color": "blue-500",
367
369
  "is-removable": "",
368
370
  "text-color": "white",
369
371
  class: "stash-select__chip",
370
- onRemove: (_) => w(s)
372
+ onRemove: (w) => _(s)
371
373
  }, {
372
- default: E(() => [
373
- P(b(s[t.displayBy] || s), 1)
374
+ default: T(() => [
375
+ N(b(s[t.displayBy] || s), 1)
374
376
  ]),
375
377
  _: 2
376
378
  }, 1032, ["onRemove"])
377
379
  ], !0)
378
380
  ]))), 128))
379
381
  ], 512),
380
- me.value ? (r(), d("div", ct, [
381
- B(ce, {
382
+ ge.value ? (r(), d("div", pt, [
383
+ B(fe, {
382
384
  "bg-color": "blue-500",
383
385
  "is-removable": "",
384
386
  "text-color": "white",
385
387
  class: "stash-select__chip",
386
- onRemove: _e
388
+ onRemove: Se
387
389
  }, {
388
- default: E(() => [
389
- P(b(ye.value), 1)
390
+ default: T(() => [
391
+ N(b(be.value), 1)
390
392
  ]),
391
393
  _: 1
392
394
  })
393
- ])) : F("", !0),
394
- t.icon ? (r(), J(H, {
395
+ ])) : H("", !0),
396
+ t.icon ? (r(), J(D, {
395
397
  key: 1,
396
- class: M(["stash-select__icon", { "tw-text-ice-500": t.disabled }]),
398
+ class: z(["stash-select__icon", { "tw-text-ice-500": t.disabled }]),
397
399
  "data-test": "stash-select|toggle-icon",
398
400
  name: t.icon,
399
- onMousedown: l[0] || (l[0] = z((s) => u.value && k(), ["prevent"]))
400
- }, null, 8, ["name", "class"])) : F("", !0),
401
- (r(), J(ze, {
401
+ onMousedown: l[0] || (l[0] = A((s) => u.value && S(), ["prevent"]))
402
+ }, null, 8, ["name", "class"])) : H("", !0),
403
+ (r(), J(Ue, {
402
404
  to: t.teleportTo,
403
405
  disabled: !t.enableTeleport
404
406
  }, [
405
- B(He, { name: "fade" }, {
406
- default: E(() => [
407
- R(f("div", {
407
+ B(Le, { name: "fade" }, {
408
+ default: T(() => [
409
+ $(f("div", {
408
410
  ref_key: "optionsWrapperRef",
409
- ref: x,
411
+ ref: C,
410
412
  class: "stash-select__border-selector tw-w-full tw-shadow-2xl",
411
- style: Ne(g(pe)),
412
- onClick: l[3] || (l[3] = z(() => {
413
+ style: Ve(g(me)),
414
+ onClick: l[3] || (l[3] = A(() => {
413
415
  }, ["stop"]))
414
416
  }, [
415
- W.value ? (r(), d("div", ut, [
416
- R(f("input", {
417
+ W.value ? (r(), d("div", ht, [
418
+ $(f("input", {
417
419
  ref_key: "searchRef",
418
- ref: ee,
420
+ ref: te,
419
421
  "onUpdate:modelValue": l[1] || (l[1] = (s) => y.value = s),
420
422
  type: "text",
421
423
  autocomplete: "off",
422
424
  class: "stash-select__search",
423
- "data-test": g(N)["data-test"] ? g(N)["data-test"] + "-search" : "stash-select|search",
425
+ "data-test": g(U)["data-test"] ? g(U)["data-test"] + "-search" : "stash-select|search",
424
426
  placeholder: t.searchPlaceholder,
425
427
  spellcheck: !1,
426
428
  onInput: l[2] || (l[2] = //@ts-ignore
427
- (...s) => g(ne) && g(ne)(...s))
428
- }, null, 40, dt), [
429
- [Ae, y.value]
429
+ (...s) => g(re) && g(re)(...s))
430
+ }, null, 40, vt), [
431
+ [Ke, y.value]
430
432
  ]),
431
- B(H, {
433
+ B(D, {
432
434
  name: "search",
433
435
  class: "tw-text-ice-500"
434
436
  })
435
- ])) : F("", !0),
436
- f("ul", ft, [
437
- (r(!0), d(K, null, G(O.value, (s, _) => (r(), d("li", {
437
+ ])) : H("", !0),
438
+ f("ul", mt, [
439
+ (r(!0), d(G, null, q(F.value, (s, w) => (r(), d("li", {
438
440
  key: `option-${s[t.trackBy]}`,
439
441
  "data-test": s[t.trackBy],
440
- class: M(Se(s, _)),
441
- onClick: (Ce) => L(s),
442
- onMouseenter: z((Ce) => U(_), ["self"])
442
+ class: z(Oe(s, w)),
443
+ onClick: (Me) => V(s),
444
+ onMouseenter: A((Me) => K(w), ["self"])
443
445
  }, [
444
- $(e.$slots, "option", { option: s }, () => [
445
- P(b(s[t.displayBy] || s), 1)
446
+ P(e.$slots, "option", { option: s }, () => [
447
+ N(b(s[t.displayBy] || s), 1)
446
448
  ], !0),
447
- S(s) && !t.hideCheck ? (r(), d("span", vt, [
448
- B(H, {
449
+ E(s) && !t.hideCheck ? (r(), d("span", _t, [
450
+ B(D, {
449
451
  class: "tw-text-blue-500",
450
452
  name: "check"
451
453
  })
452
- ])) : F("", !0)
453
- ], 42, pt))), 128)),
454
- R(f("li", ht, [
455
- B(H, {
454
+ ])) : H("", !0)
455
+ ], 42, yt))), 128)),
456
+ $(f("li", wt, [
457
+ B(D, {
456
458
  "data-test": "stash-select|options-loading",
457
459
  name: "working",
458
460
  class: "tw-animate-spin tw-text-ice-500"
459
461
  })
460
462
  ], 512), [
461
- [Q, t.loading || se.value]
463
+ [Q, t.loading || ne.value]
462
464
  ]),
463
- R(f("li", mt, [
464
- $(e.$slots, "no-options", {}, () => [
465
- l[6] || (l[6] = P(" No options "))
465
+ $(f("li", gt, [
466
+ P(e.$slots, "no-options", {}, () => [
467
+ l[6] || (l[6] = N(" No options "))
466
468
  ], !0)
467
469
  ], 512), [
468
- [Q, !t.loading && !se.value && !O.value.length]
470
+ [Q, !t.loading && !ne.value && !F.value.length]
469
471
  ])
470
472
  ])
471
473
  ], 4), [
@@ -475,24 +477,24 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, st = ["id
475
477
  _: 3
476
478
  })
477
479
  ], 8, ["to", "disabled"]))
478
- ], 40, rt)
479
- ], 42, ot)), [
480
- [g(Qe), Te]
480
+ ], 40, dt)
481
+ ], 42, ut)), [
482
+ [g(lt), Re]
481
483
  ])
482
484
  ]),
483
485
  key: "1"
484
486
  },
485
- fe.hint ? {
487
+ ve.hint ? {
486
488
  name: "hint",
487
- fn: E(() => [
488
- $(e.$slots, "hint", {}, void 0, !0)
489
+ fn: T(() => [
490
+ P(e.$slots, "hint", {}, void 0, !0)
489
491
  ]),
490
492
  key: "2"
491
493
  } : void 0
492
494
  ]), 1040, ["class", "error-text", "hint-text"]));
493
495
  }
494
- }), zt = /* @__PURE__ */ tt(yt, [["__scopeId", "data-v-a91abebc"]]);
496
+ }), Dt = /* @__PURE__ */ nt(bt, [["__scopeId", "data-v-f71e0e77"]]);
495
497
  export {
496
- zt as default
498
+ Dt as default
497
499
  };
498
500
  //# sourceMappingURL=Select.js.map