@leaflink/stash 50.0.6 → 50.0.8

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