@onereach/ui-components 25.1.2 → 25.1.3-beta.5772.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.
@@ -1,24 +1,24 @@
1
- import { DropdownClose as Te, DropdownOpen as Ee } from "@onereach/ui-components-common/directives";
2
- import { searchItemsByLabel as Pe } from "@onereach/ui-components-common/helpers";
3
- import { useProxyModelValue as ee, useResponsive as Le } from "@onereach/ui-components-common/hooks";
4
- import { isNil as Re, toArray as Z, isEqual as pe, isEmpty as ce, include as de, exclude as ie } from "@onereach/ui-components-common/utils";
5
- import { O as De } from "./OrCheckbox-WPBzlvaV.mjs";
6
- import { O as Fe } from "./OrError-B5ihH6-3.mjs";
1
+ import { DropdownClose as Ee, DropdownOpen as Pe } from "@onereach/ui-components-common/directives";
2
+ import { searchItemsByLabel as Le } from "@onereach/ui-components-common/helpers";
3
+ import { useProxyModelValue as ee, useResponsive as Re } from "@onereach/ui-components-common/hooks";
4
+ import { isNil as De, toArray as Z, isEqual as ce, isEmpty as me, include as de, exclude as ie } from "@onereach/ui-components-common/utils";
5
+ import { O as Fe } from "./OrCheckbox-WPBzlvaV.mjs";
6
+ import { O as Ae } from "./OrError-B5ihH6-3.mjs";
7
7
  import { O as Ue } from "./OrExpansionPanel-BNGPdEnp.mjs";
8
- import { O as ze } from "./OrHint-NvbZyURY.mjs";
9
- import { O as Ne } from "./OrIconButton-BlHCLpeW.mjs";
10
- import { O as qe } from "./OrIcon-k8cyvh-D.mjs";
11
- import { O as Ae } from "./OrInputBox-6ciokFdU.mjs";
12
- import { a as He } from "./OrInputBox.vue_vue_type_script_lang-q2L7rmth.mjs";
13
- import { O as je } from "./OrInput-BqDsy3wR.mjs";
14
- import { O as We } from "./OrLabel-K7_HgvcK.mjs";
15
- import { O as Ge } from "./OrLoader-2SaTMxmZ.mjs";
16
- import { O as Je } from "./OrMenuItem-puiy5rFO.mjs";
17
- import { O as Ke } from "./OrPopover-DbygLPtT.mjs";
18
- import { O as Qe, T as ae } from "./OrTags-DxQDW443.mjs";
19
- import { defineComponent as W, ref as m, toRefs as oe, computed as a, withDirectives as N, openBlock as n, createElementBlock as g, normalizeStyle as Xe, normalizeClass as y, vModelDynamic as Ye, renderSlot as C, watch as _, resolveComponent as i, createVNode as L, createSlots as Ze, withCtx as b, createTextVNode as T, toDisplayString as E, createElementVNode as z, vShow as x, createBlock as k, createCommentVNode as j, Fragment as F, getCurrentInstance as xe, nextTick as _e, resolveDirective as ue, withModifiers as Y, renderList as H } from "vue";
8
+ import { O as qe } from "./OrHint-NvbZyURY.mjs";
9
+ import { O as ze } from "./OrIconButton-BlHCLpeW.mjs";
10
+ import { O as Ne } from "./OrIcon-k8cyvh-D.mjs";
11
+ import { O as He } from "./OrInputBox-6ciokFdU.mjs";
12
+ import { a as je } from "./OrInputBox.vue_vue_type_script_lang-q2L7rmth.mjs";
13
+ import { O as We } from "./OrInput-BqDsy3wR.mjs";
14
+ import { O as Ge } from "./OrLabel-K7_HgvcK.mjs";
15
+ import { O as Je } from "./OrLoader-2SaTMxmZ.mjs";
16
+ import { O as Ke } from "./OrMenuItem-puiy5rFO.mjs";
17
+ import { O as Qe } from "./OrPopover-DbygLPtT.mjs";
18
+ import { O as Xe, T as ae } from "./OrTags-DxQDW443.mjs";
19
+ import { defineComponent as G, ref as m, toRefs as oe, computed as a, withDirectives as z, openBlock as r, createElementBlock as O, normalizeStyle as Ye, normalizeClass as y, vModelDynamic as Ze, renderSlot as C, watch as _, resolveComponent as i, createVNode as L, createSlots as xe, withCtx as h, createTextVNode as T, toDisplayString as E, createElementVNode as q, vShow as x, createBlock as k, createCommentVNode as W, Fragment as F, getCurrentInstance as _e, nextTick as ue, resolveDirective as pe, withModifiers as Y, renderList as j } from "vue";
20
20
  import { useFocus as eo } from "@vueuse/core";
21
- import { _ as G } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
21
+ import { _ as J } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
22
22
  import { O as oo } from "./OrTooltip-DqwjoE82.mjs";
23
23
  const lo = [
24
24
  // Base
@@ -30,7 +30,7 @@ const lo = [
30
30
  "dark:placeholder:theme-foreground-outline-dark",
31
31
  "theme-background-transparent",
32
32
  "outline-none"
33
- ], to = W({
33
+ ], to = G({
34
34
  name: "OrSelectControlInput",
35
35
  model: {
36
36
  prop: "modelValue",
@@ -63,13 +63,13 @@ const lo = [
63
63
  "focused"
64
64
  ],
65
65
  setup(e, o) {
66
- const w = m(), { placeholder: f, modelValue: v } = oe(e), u = ee(v, o.emit), { focused: p } = eo(w), h = a(() => [
66
+ const w = m(), { placeholder: f, modelValue: v } = oe(e), u = ee(v, o.emit), { focused: p } = eo(w), S = a(() => [
67
67
  ...lo
68
- ]), O = a(() => {
68
+ ]), V = a(() => {
69
69
  var M;
70
- const S = u.value.length > 0 ? u.value.length : (M = f.value) == null ? void 0 : M.length;
70
+ const g = u.value.length > 0 ? u.value.length : (M = f.value) == null ? void 0 : M.length;
71
71
  return {
72
- width: `${Math.max(S + 1 || 0, 2)}ch`
72
+ width: `${Math.max(g + 1 || 0, 2)}ch`
73
73
  };
74
74
  });
75
75
  function s() {
@@ -78,18 +78,18 @@ const lo = [
78
78
  return {
79
79
  root: w,
80
80
  proxyModelValue: u,
81
- controlStyles: h,
82
- controlInlineStyles: O,
81
+ controlStyles: S,
82
+ controlInlineStyles: V,
83
83
  focused: p,
84
84
  focus: s
85
85
  };
86
86
  }
87
87
  }), ao = ["placeholder", "readonly", "disabled"];
88
88
  function no(e, o, w, f, v, u) {
89
- return N((n(), g("input", {
89
+ return z((r(), O("input", {
90
90
  ref: "root",
91
91
  "onUpdate:modelValue": o[0] || (o[0] = (p) => e.proxyModelValue = p),
92
- style: Xe(e.controlInlineStyles),
92
+ style: Ye(e.controlInlineStyles),
93
93
  class: y(e.controlStyles),
94
94
  type: "text",
95
95
  placeholder: e.placeholder,
@@ -99,10 +99,10 @@ function no(e, o, w, f, v, u) {
99
99
  minlength: void 0,
100
100
  maxlength: void 0
101
101
  }, null, 14, ao)), [
102
- [Ye, e.proxyModelValue]
102
+ [Ze, e.proxyModelValue]
103
103
  ]);
104
104
  }
105
- const me = /* @__PURE__ */ G(to, [["render", no]]), ro = [
105
+ const fe = /* @__PURE__ */ J(to, [["render", no]]), ro = [
106
106
  // Interactivity
107
107
  "interactivity-click",
108
108
  // Typography
@@ -110,7 +110,7 @@ const me = /* @__PURE__ */ G(to, [["render", no]]), ro = [
110
110
  // Theme
111
111
  "theme-foreground-outline",
112
112
  "dark:theme-foreground-outline-dark"
113
- ], so = W({
113
+ ], so = G({
114
114
  name: "OrSelectPlaceholder",
115
115
  props: {
116
116
  disabled: {
@@ -133,7 +133,7 @@ const me = /* @__PURE__ */ G(to, [["render", no]]), ro = [
133
133
  }
134
134
  }), io = ["disabled"];
135
135
  function uo(e, o, w, f, v, u) {
136
- return n(), g("div", {
136
+ return r(), O("div", {
137
137
  ref: "root",
138
138
  class: y(e.rootStyles),
139
139
  disabled: e.disabled
@@ -141,16 +141,16 @@ function uo(e, o, w, f, v, u) {
141
141
  C(e.$slots, "default")
142
142
  ], 10, io);
143
143
  }
144
- const fe = /* @__PURE__ */ G(so, [["render", uo]]), po = [
144
+ const ve = /* @__PURE__ */ J(so, [["render", uo]]), po = [
145
145
  // Layout
146
146
  "layout-row",
147
147
  "w-full"
148
- ], co = W({
148
+ ], co = G({
149
149
  name: "OrSelectMultipleControl",
150
150
  components: {
151
- OrSelectPlaceholder: fe,
152
- OrSelectControlInput: me,
153
- OrTags: Qe
151
+ OrSelectPlaceholder: ve,
152
+ OrSelectControlInput: fe,
153
+ OrTags: Xe
154
154
  },
155
155
  model: {
156
156
  prop: "modelValue",
@@ -204,21 +204,21 @@ const fe = /* @__PURE__ */ G(so, [["render", uo]]), po = [
204
204
  "focused"
205
205
  ],
206
206
  setup(e, o) {
207
- const w = m(), f = m(), v = m(), { modelValue: u, model: p, options: h, overflow: O } = oe(e), s = ee(u, o.emit), S = a(() => {
207
+ const w = m(), f = m(), v = m(), { modelValue: u, model: p, options: S, overflow: V } = oe(e), s = ee(u, o.emit), g = a(() => {
208
208
  var c;
209
209
  return (c = f.value) == null ? void 0 : c.focused;
210
210
  }), M = a(() => [
211
211
  "or-select-multiple-control-v3",
212
212
  ...po
213
- ]), I = a(() => Re(p.value) ? [] : Z(p.value)), P = a(() => I.value.length === 0), $ = a(() => p.value === void 0 || p.value === null ? [] : I.value.map((c) => h.value.find((B) => pe(B.value, c))).filter((c) => !!c).map((c) => ({
213
+ ]), I = a(() => De(p.value) ? [] : Z(p.value)), P = a(() => I.value.length === 0), $ = a(() => p.value === void 0 || p.value === null ? [] : I.value.map((c) => S.value.find((B) => ce(B.value, c))).filter((c) => !!c).map((c) => ({
214
214
  value: c.value,
215
215
  label: c.label,
216
216
  tagProps: c.disabled && { disabled: c.disabled }
217
217
  })));
218
218
  _($, (c, B) => {
219
- c.length != B.length && O.value === ae.Scroll && v.value && v.value.scrollToEnd();
219
+ c.length != B.length && V.value === ae.Scroll && v.value && v.value.scrollToEnd();
220
220
  });
221
- function U() {
221
+ function A() {
222
222
  f.value && f.value.focus();
223
223
  }
224
224
  return {
@@ -230,18 +230,18 @@ const fe = /* @__PURE__ */ G(so, [["render", uo]]), po = [
230
230
  isEmpty: P,
231
231
  selection: $,
232
232
  value: I,
233
- focus: U,
234
- focused: S
233
+ focus: A,
234
+ focused: g
235
235
  };
236
236
  }
237
237
  }), mo = { class: "inline-flex w-fit max-w-full" };
238
238
  function fo(e, o, w, f, v, u) {
239
- const p = i("OrSelectControlInput"), h = i("OrTags"), O = i("OrSelectPlaceholder");
240
- return n(), g("div", {
239
+ const p = i("OrSelectControlInput"), S = i("OrTags"), V = i("OrSelectPlaceholder");
240
+ return r(), O("div", {
241
241
  ref: "root",
242
242
  class: y(e.rootStyles)
243
243
  }, [
244
- N(L(h, {
244
+ z(L(S, {
245
245
  ref: "tags",
246
246
  items: e.selection,
247
247
  class: "grow",
@@ -252,8 +252,8 @@ function fo(e, o, w, f, v, u) {
252
252
  },
253
253
  overflow: e.overflow,
254
254
  onReset: o[1] || (o[1] = (s) => e.$emit("reset", s))
255
- }, Ze({
256
- tag: b(({ item: s }) => [
255
+ }, xe({
256
+ tag: h(({ item: s }) => [
257
257
  C(e.$slots, "tag", { item: s }, () => [
258
258
  T(E(s.label), 1)
259
259
  ])
@@ -262,8 +262,8 @@ function fo(e, o, w, f, v, u) {
262
262
  }, [
263
263
  e.enableSearch ? {
264
264
  name: "tail",
265
- fn: b(() => [
266
- z("div", mo, [
265
+ fn: h(() => [
266
+ q("div", mo, [
267
267
  L(p, {
268
268
  ref: "searchControl",
269
269
  modelValue: e.searchModelValue,
@@ -279,25 +279,25 @@ function fo(e, o, w, f, v, u) {
279
279
  ]), 1032, ["items", "disabled", "tag-props", "overflow"]), [
280
280
  [x, !e.isEmpty || e.enableSearch]
281
281
  ]),
282
- e.isEmpty && !e.enableSearch ? (n(), k(O, {
282
+ e.isEmpty && !e.enableSearch ? (r(), k(V, {
283
283
  key: 0,
284
284
  disabled: e.disabled
285
285
  }, {
286
- default: b(() => [
286
+ default: h(() => [
287
287
  T(E(e.placeholder), 1)
288
288
  ]),
289
289
  _: 1
290
- }, 8, ["disabled"])) : j("", !0)
290
+ }, 8, ["disabled"])) : W("", !0)
291
291
  ], 2);
292
292
  }
293
- const vo = /* @__PURE__ */ G(co, [["render", fo]]), yo = [
293
+ const vo = /* @__PURE__ */ J(co, [["render", fo]]), yo = [
294
294
  // Layout
295
295
  "w-full"
296
- ], bo = W({
296
+ ], bo = G({
297
297
  name: "OrSelectSingleControl",
298
298
  components: {
299
- OrSelectPlaceholder: fe,
300
- OrSelectControlInput: me,
299
+ OrSelectPlaceholder: ve,
300
+ OrSelectControlInput: fe,
301
301
  OrTooltip: oo
302
302
  },
303
303
  model: {
@@ -343,23 +343,23 @@ const vo = /* @__PURE__ */ G(co, [["render", fo]]), yo = [
343
343
  "focused"
344
344
  ],
345
345
  setup(e, o) {
346
- const w = m(), f = m(), v = m(), u = m(), { modelValue: p, model: h, options: O } = oe(e), s = ee(p, o.emit), S = a(() => ce(h.value)), M = a(() => O.value.find((r) => pe(r.value, h.value))), I = a(() => {
347
- var r;
348
- return (r = M.value) == null ? void 0 : r.label;
346
+ const w = m(), f = m(), v = m(), u = m(), { modelValue: p, model: S, options: V } = oe(e), s = ee(p, o.emit), g = a(() => me(S.value)), M = a(() => V.value.find((n) => ce(n.value, S.value))), I = a(() => {
347
+ var n;
348
+ return (n = M.value) == null ? void 0 : n.label;
349
349
  });
350
350
  _(
351
351
  () => e.isOpen,
352
352
  () => {
353
- var r;
354
- (r = u.value) == null || r.close();
353
+ var n;
354
+ (n = u.value) == null || n.close();
355
355
  }
356
356
  );
357
357
  const P = a(() => {
358
- var r;
359
- return (r = f.value) == null ? void 0 : r.focused;
358
+ var n;
359
+ return (n = f.value) == null ? void 0 : n.focused;
360
360
  }), $ = () => {
361
361
  u.value && u.value.open();
362
- }, U = () => {
362
+ }, A = () => {
363
363
  u.value && u.value.close();
364
364
  }, c = a(() => [
365
365
  "or-select-single-control-v3",
@@ -368,7 +368,7 @@ const vo = /* @__PURE__ */ G(co, [["render", fo]]), yo = [
368
368
  function B() {
369
369
  f.value && f.value.focus();
370
370
  }
371
- function q() {
371
+ function N() {
372
372
  if (!v.value) return;
373
373
  v.value.scrollWidth > v.value.clientWidth && $();
374
374
  }
@@ -377,7 +377,7 @@ const vo = /* @__PURE__ */ G(co, [["render", fo]]), yo = [
377
377
  rootStyles: c,
378
378
  searchControl: f,
379
379
  searchModelValue: s,
380
- isEmptyModelValue: S,
380
+ isEmptyModelValue: g,
381
381
  selection: M,
382
382
  selectionLabel: I,
383
383
  focus: B,
@@ -385,8 +385,8 @@ const vo = /* @__PURE__ */ G(co, [["render", fo]]), yo = [
385
385
  selectionLabelRef: v,
386
386
  tooltipRef: u,
387
387
  openTooltip: $,
388
- closeTooltip: U,
389
- checkTooltip: q
388
+ closeTooltip: A,
389
+ checkTooltip: N
390
390
  };
391
391
  }
392
392
  }), ho = {
@@ -394,34 +394,34 @@ const vo = /* @__PURE__ */ G(co, [["render", fo]]), yo = [
394
394
  class: "flex"
395
395
  };
396
396
  function So(e, o, w, f, v, u) {
397
- const p = i("OrSelectControlInput"), h = i("OrSelectPlaceholder"), O = i("OrTooltip");
398
- return n(), g("div", {
397
+ const p = i("OrSelectControlInput"), S = i("OrSelectPlaceholder"), V = i("OrTooltip");
398
+ return r(), O("div", {
399
399
  ref: "root",
400
400
  class: y(e.rootStyles)
401
401
  }, [
402
- e.isOpen && e.enableSearch ? (n(), k(p, {
402
+ e.isOpen && e.enableSearch ? (r(), k(p, {
403
403
  key: 0,
404
404
  ref: "searchControl",
405
405
  modelValue: e.searchModelValue,
406
406
  "onUpdate:modelValue": o[0] || (o[0] = (s) => e.searchModelValue = s),
407
407
  placeholder: e.isEmptyModelValue ? e.placeholder : e.selectionLabel
408
- }, null, 8, ["modelValue", "placeholder"])) : (n(), g(F, { key: 1 }, [
409
- e.isEmptyModelValue ? (n(), k(h, {
408
+ }, null, 8, ["modelValue", "placeholder"])) : (r(), O(F, { key: 1 }, [
409
+ e.isEmptyModelValue ? (r(), k(S, {
410
410
  key: 0,
411
411
  disabled: e.disabled
412
412
  }, {
413
- default: b(() => [
413
+ default: h(() => [
414
414
  T(E(e.placeholder), 1)
415
415
  ]),
416
416
  _: 1
417
- }, 8, ["disabled"])) : (n(), g("div", ho, [
418
- z("div", {
417
+ }, 8, ["disabled"])) : (r(), O("div", ho, [
418
+ q("div", {
419
419
  ref: "selectionLabelRef",
420
420
  class: "truncate w-full",
421
421
  onMouseenter: o[1] || (o[1] = (...s) => e.checkTooltip && e.checkTooltip(...s)),
422
422
  onMouseleave: o[2] || (o[2] = (...s) => e.closeTooltip && e.closeTooltip(...s))
423
423
  }, E(e.selectionLabel), 545),
424
- L(O, {
424
+ L(V, {
425
425
  ref: "tooltipRef",
426
426
  content: e.selectionLabel,
427
427
  trigger: e.selectionLabelRef
@@ -430,7 +430,7 @@ function So(e, o, w, f, v, u) {
430
430
  ], 64))
431
431
  ], 2);
432
432
  }
433
- const go = /* @__PURE__ */ G(bo, [["render", So]]), Oo = [
433
+ const go = /* @__PURE__ */ J(bo, [["render", So]]), Oo = [
434
434
  // Layout
435
435
  "layout-column",
436
436
  // Spacing
@@ -508,27 +508,27 @@ const go = /* @__PURE__ */ G(bo, [["render", So]]), Oo = [
508
508
  "typography-body-2-regular",
509
509
  // Theme
510
510
  "text-outline dark:text-outline-dark"
511
- ], Lo = W({
511
+ ], Lo = G({
512
512
  name: "OrSelect",
513
513
  components: {
514
- OrCheckbox: De,
515
- OrError: Fe,
514
+ OrCheckbox: Fe,
515
+ OrError: Ae,
516
516
  OrExpansionPanel: Ue,
517
- OrHint: ze,
518
- OrIcon: qe,
519
- OrIconButton: Ne,
520
- OrInput: je,
521
- OrInputBox: Ae,
522
- OrLabel: We,
523
- OrMenuItem: Je,
524
- OrPopover: Ke,
517
+ OrHint: qe,
518
+ OrIcon: Ne,
519
+ OrIconButton: ze,
520
+ OrInput: We,
521
+ OrInputBox: He,
522
+ OrLabel: Ge,
523
+ OrMenuItem: Ke,
524
+ OrPopover: Qe,
525
525
  OrSelectMultipleControl: vo,
526
526
  OrSelectSingleControl: go,
527
- OrLoader: Ge
527
+ OrLoader: Je
528
528
  },
529
529
  directives: {
530
- DropdownClose: Te,
531
- DropdownOpen: Ee
530
+ DropdownClose: Ee,
531
+ DropdownOpen: Pe
532
532
  },
533
533
  model: {
534
534
  prop: "modelValue",
@@ -609,7 +609,7 @@ const go = /* @__PURE__ */ G(bo, [["render", So]]), Oo = [
609
609
  },
610
610
  searchFunction: {
611
611
  type: Function,
612
- default: Pe
612
+ default: Le
613
613
  },
614
614
  groupByFunction: {
615
615
  type: Function,
@@ -637,151 +637,159 @@ const go = /* @__PURE__ */ G(bo, [["render", So]]), Oo = [
637
637
  "popoverState"
638
638
  ],
639
639
  setup(e, o) {
640
- const w = xe(), f = m(), v = m(), u = a(() => {
640
+ const w = _e(), f = m(), v = m(), u = a(() => {
641
641
  var l;
642
642
  return (l = v.value) == null ? void 0 : l.root;
643
- }), p = m(), h = m(), O = m(), s = m(), S = m(), M = a(() => {
643
+ }), p = m(), S = m(), V = m(), s = m(), g = m(), M = a(() => {
644
644
  var l;
645
- return (l = S.value) == null ? void 0 : l.root;
645
+ return (l = g.value) == null ? void 0 : l.root;
646
646
  }), I = a(() => {
647
647
  var l;
648
- return (l = S.value) == null ? void 0 : l.state;
649
- }), P = a(() => I.value === "open"), { enableClear: $, enableSearch: U, modelValue: c, multiple: B } = oe(e), q = m(o.attrs.id ?? w.uid.toString()), r = ee(c, o.emit), le = a(() => {
650
- var l, V;
651
- return (V = (l = S.value) == null ? void 0 : l.bottomSheet) == null ? void 0 : V.fullscreen;
652
- }), J = a(() => ce(r.value)), t = a(() => $.value && !J.value), R = a(() => {
653
- var l, V;
654
- return B.value ? (l = h.value) == null ? void 0 : l.focused : (V = O.value) == null ? void 0 : V.focused;
655
- }), d = a(() => o.attrs.readonly), D = m(e.options), K = a(() => e.externalControl ? e.searchOptions : D.value), te = m("");
648
+ return (l = g.value) == null ? void 0 : l.state;
649
+ }), P = a(() => I.value === "open"), { enableClear: $, enableSearch: A, modelValue: c, multiple: B } = oe(e), N = m(o.attrs.id ?? w.uid.toString()), n = ee(c, o.emit), le = a(() => {
650
+ var l, b;
651
+ return (b = (l = g.value) == null ? void 0 : l.bottomSheet) == null ? void 0 : b.fullscreen;
652
+ }), K = a(() => me(n.value)), t = a(() => $.value && !K.value), R = a(() => {
653
+ var l, b;
654
+ return B.value ? (l = S.value) == null ? void 0 : l.focused : (b = V.value) == null ? void 0 : b.focused;
655
+ }), d = a(() => o.attrs.readonly), D = m(e.options), Q = a(() => e.externalControl ? e.searchOptions : D.value), te = m("");
656
656
  _([
657
657
  () => e.externalControl,
658
658
  te,
659
659
  () => e.options
660
- ], async ([l, V, X]) => {
661
- l ? o.emit("search", V) : D.value = await e.searchFunction(V, X);
660
+ ], async ([l, b, U]) => {
661
+ l ? o.emit("search", b) : D.value = await e.searchFunction(b, U);
662
662
  }, { deep: !0 }), _(P, (l) => {
663
- l || Q();
663
+ l || X();
664
664
  });
665
- const ve = a(() => {
665
+ const ye = a(() => {
666
666
  const l = e.groupByFunction;
667
- return l ? D.value.reduce((V, X) => {
668
- const se = l(X);
667
+ return l ? D.value.reduce((b, U) => {
668
+ const se = l(U);
669
669
  return {
670
- ...V,
670
+ ...b,
671
671
  [se]: [
672
- ...V[se] ?? [],
673
- X
672
+ ...b[se] ?? [],
673
+ U
674
674
  ]
675
675
  };
676
676
  }, {}) : {
677
677
  "": e.options
678
678
  };
679
- }), ye = a(() => [
679
+ }), be = a(() => [
680
680
  "or-select-v3",
681
681
  ...Oo,
682
- ...e.variant === He.Embedded ? ["grow"] : []
683
- ]), be = a(() => [
684
- ...Vo
682
+ ...e.variant === je.Embedded ? ["grow"] : []
685
683
  ]), he = a(() => [
684
+ ...Vo
685
+ ]), Se = a(() => [
686
686
  ...ko
687
- ]), Se = a(() => {
687
+ ]), ge = a(() => {
688
688
  var l;
689
689
  return [
690
690
  "or-select-popover-v3",
691
- ...A.value ? [] : [
691
+ ...H.value ? [] : [
692
692
  ...wo,
693
- ...(l = S.value) != null && l.isFlipped ? $o : Co
693
+ ...(l = g.value) != null && l.isFlipped ? $o : Co
694
694
  ]
695
695
  ];
696
- }), ge = a(() => [
697
- A.value ? "layout-column" : "contains",
696
+ }), Oe = a(() => [
697
+ H.value ? "layout-column" : "contains",
698
698
  le.value ? "overflow-y-auto" : "overflow-hidden"
699
- ]), Oe = a(() => [
699
+ ]), Ve = a(() => [
700
700
  ...Mo,
701
701
  ...e.multiple ? Bo : Io,
702
- ...A.value ? To : []
703
- ]), Ve = a(() => [
704
- ...Eo
702
+ ...H.value ? To : []
705
703
  ]), ke = a(() => [
704
+ ...Eo
705
+ ]), we = a(() => [
706
706
  ...Po
707
707
  ]);
708
- function we() {
709
- !d.value && !e.disabled && S.value && (I.value === "open" && !R.value ? re() : (ne(), setTimeout(() => {
710
- Ce();
708
+ function Ce() {
709
+ !d.value && !e.disabled && g.value && (I.value === "open" && !R.value ? re() : (ne(), setTimeout(() => {
710
+ $e();
711
711
  })));
712
712
  }
713
713
  function ne() {
714
- const l = S.value;
715
- l && l.open();
714
+ const l = g.value;
715
+ l && l.open(), ue(() => {
716
+ if (n.value) {
717
+ const b = Array.isArray(n.value) ? n.value[0] : n.value, U = document.querySelector(`[data-value="${b}"]`);
718
+ U && U.scrollIntoView({
719
+ behavior: "auto",
720
+ block: "start"
721
+ });
722
+ }
723
+ });
716
724
  }
717
725
  function re() {
718
- const l = S.value;
726
+ const l = g.value;
719
727
  l && l.close();
720
728
  }
721
- function Ce() {
722
- if (U.value) {
723
- const l = A.value ? s.value : B.value ? h.value : O.value;
729
+ function $e() {
730
+ if (A.value) {
731
+ const l = H.value ? s.value : B.value ? S.value : V.value;
724
732
  l && l.focus();
725
733
  }
726
734
  }
727
- function $e(l) {
728
- e.multiple ? r.value = de(l, Z(r.value)) : r.value = l, Q();
729
- }
730
735
  function Me(l) {
731
- e.multiple ? r.value = ie(l, Z(r.value)) : r.value = void 0;
736
+ e.multiple ? n.value = de(l, Z(n.value)) : n.value = l, X();
732
737
  }
733
738
  function Ie(l) {
739
+ e.multiple ? n.value = ie(l, Z(n.value)) : n.value = void 0;
740
+ }
741
+ function Be(l) {
734
742
  if (e.multiple) {
735
- const V = Z(r.value);
736
- V.includes(l) ? r.value = ie(l, V) : r.value = de(l, V);
743
+ const b = Z(n.value);
744
+ b.includes(l) ? n.value = ie(l, b) : n.value = de(l, b);
737
745
  } else
738
- r.value = r.value !== l ? l : void 0;
739
- Q();
746
+ n.value = n.value !== l ? l : void 0;
747
+ X();
740
748
  }
741
- function Q() {
742
- _e(() => {
749
+ function X() {
750
+ ue(() => {
743
751
  setTimeout(() => te.value = "");
744
752
  });
745
753
  }
746
- const { isDesktop: Be, isMobile: A } = Le();
754
+ const { isDesktop: Te, isMobile: H } = Re();
747
755
  return {
748
756
  root: f,
749
757
  inputBox: v,
750
758
  inputBoxRoot: u,
751
759
  control: p,
752
- multipleControl: h,
753
- singleControl: O,
760
+ multipleControl: S,
761
+ singleControl: V,
754
762
  searchControl: s,
755
- popover: S,
763
+ popover: g,
756
764
  popoverRoot: M,
757
765
  popoverState: I,
758
- rootStyles: ye,
759
- controlStyles: be,
760
- searchControlStyles: he,
761
- dropdownStyles: Se,
762
- dropdownContainerStyles: ge,
763
- dropdownItemStyles: Oe,
764
- noSearchResultsStyles: Ve,
765
- loaderStyles: ke,
766
- controlId: q,
767
- proxyModelValue: r,
766
+ rootStyles: be,
767
+ controlStyles: he,
768
+ searchControlStyles: Se,
769
+ dropdownStyles: ge,
770
+ dropdownContainerStyles: Oe,
771
+ dropdownItemStyles: Ve,
772
+ noSearchResultsStyles: ke,
773
+ loaderStyles: we,
774
+ controlId: N,
775
+ proxyModelValue: n,
768
776
  readonly: d,
769
- isEmptyModelValue: J,
777
+ isEmptyModelValue: K,
770
778
  isOpen: P,
771
779
  showClear: t,
772
780
  searchText: te,
773
781
  internalSearchOptions: D,
774
- resolvedSearchOptions: K,
775
- groupedOptions: ve,
776
- toggle: we,
782
+ resolvedSearchOptions: Q,
783
+ groupedOptions: ye,
784
+ toggle: Ce,
777
785
  close: re,
778
786
  open: ne,
779
- selectOption: $e,
780
- deselectOption: Me,
781
- toggleOption: Ie,
782
- resetSearch: Q,
783
- isDesktop: Be,
784
- isMobile: A
787
+ selectOption: Me,
788
+ deselectOption: Ie,
789
+ toggleOption: Be,
790
+ resetSearch: X,
791
+ isDesktop: Te,
792
+ isMobile: H
785
793
  };
786
794
  }
787
795
  }), Ro = ["id", "disabled"], Do = {
@@ -789,31 +797,31 @@ const go = /* @__PURE__ */ G(bo, [["render", So]]), Oo = [
789
797
  }, Fo = {
790
798
  key: 0,
791
799
  class: /* @__PURE__ */ y(["px-sm+", "py-xs"])
792
- }, Uo = ["onClick"];
793
- function zo(e, o, w, f, v, u) {
794
- const p = i("OrLabel"), h = i("OrSelectMultipleControl"), O = i("OrSelectSingleControl"), s = i("OrIconButton"), S = i("OrIcon"), M = i("OrInput"), I = i("OrLoader"), P = i("OrCheckbox"), $ = i("OrMenuItem"), U = i("OrExpansionPanel"), c = i("OrPopover"), B = i("OrInputBox"), q = i("OrHint"), r = i("OrError"), le = ue("dropdown-open"), J = ue("dropdown-close");
795
- return n(), g("div", {
800
+ }, Ao = ["onClick"];
801
+ function Uo(e, o, w, f, v, u) {
802
+ const p = i("OrLabel"), S = i("OrSelectMultipleControl"), V = i("OrSelectSingleControl"), s = i("OrIconButton"), g = i("OrIcon"), M = i("OrInput"), I = i("OrLoader"), P = i("OrCheckbox"), $ = i("OrMenuItem"), A = i("OrExpansionPanel"), c = i("OrPopover"), B = i("OrInputBox"), N = i("OrHint"), n = i("OrError"), le = pe("dropdown-open"), K = pe("dropdown-close");
803
+ return r(), O("div", {
796
804
  ref: "root",
797
805
  class: y(e.rootStyles)
798
806
  }, [
799
- e.$slots.label || e.$slots.addon || e.label ? (n(), k(p, {
807
+ e.$slots.label || e.$slots.addon || e.label ? (r(), k(p, {
800
808
  key: 0,
801
809
  "control-id": e.controlId,
802
810
  variant: "input",
803
811
  required: e.required,
804
812
  disabled: e.disabled
805
813
  }, {
806
- addon: b(() => [
814
+ addon: h(() => [
807
815
  C(e.$slots, "addon")
808
816
  ]),
809
- default: b(() => [
817
+ default: h(() => [
810
818
  C(e.$slots, "label", {}, () => [
811
819
  T(E(e.label), 1)
812
820
  ])
813
821
  ]),
814
822
  _: 3
815
- }, 8, ["control-id", "required", "disabled"])) : j("", !0),
816
- N((n(), k(B, {
823
+ }, 8, ["control-id", "required", "disabled"])) : W("", !0),
824
+ z((r(), k(B, {
817
825
  ref: "inputBox",
818
826
  class: y(["interactivity-click", [e.popoverState === "open" && (e.popover && e.popover.isFlipped ? "rounded-t-0" : "rounded-b-0"), { "outline-none": e.variant === "embedded" }]]),
819
827
  variant: e.variant,
@@ -824,8 +832,8 @@ function zo(e, o, w, f, v, u) {
824
832
  "force-state": e.isOpen ? "focus-within" : void 0,
825
833
  tabindex: e.disabled ? null : 0
826
834
  }, {
827
- default: b(() => [
828
- z("div", {
835
+ default: h(() => [
836
+ q("div", {
829
837
  id: e.controlId,
830
838
  ref: "control",
831
839
  class: y(e.controlStyles),
@@ -834,7 +842,7 @@ function zo(e, o, w, f, v, u) {
834
842
  onBlur: o[4] || (o[4] = (t) => e.$emit("blur", t))
835
843
  }, [
836
844
  C(e.$slots, "valueTemplate", { model: e.proxyModelValue }, () => [
837
- e.multiple ? (n(), k(h, {
845
+ e.multiple ? (r(), k(S, {
838
846
  key: 0,
839
847
  ref: "multipleControl",
840
848
  modelValue: e.searchText,
@@ -849,11 +857,11 @@ function zo(e, o, w, f, v, u) {
849
857
  "is-open": e.popoverState === "open",
850
858
  onReset: o[1] || (o[1] = (t) => e.deselectOption(t))
851
859
  }, {
852
- tag: b(({ item: t }) => [
860
+ tag: h(({ item: t }) => [
853
861
  C(e.$slots, "tag", { item: t })
854
862
  ]),
855
863
  _: 3
856
- }, 8, ["modelValue", "model", "options", "overflow", "placeholder", "readonly", "disabled", "enable-search", "is-open"])) : (n(), k(O, {
864
+ }, 8, ["modelValue", "model", "options", "overflow", "placeholder", "readonly", "disabled", "enable-search", "is-open"])) : (r(), k(V, {
857
865
  key: 1,
858
866
  ref: "singleControl",
859
867
  modelValue: e.searchText,
@@ -867,16 +875,16 @@ function zo(e, o, w, f, v, u) {
867
875
  }, null, 8, ["modelValue", "model", "options", "placeholder", "disabled", "enable-search", "is-open"]))
868
876
  ])
869
877
  ], 42, Ro),
870
- z("div", Do, [
871
- e.showClear ? (n(), k(s, {
878
+ q("div", Do, [
879
+ e.showClear ? (r(), k(s, {
872
880
  key: 0,
873
881
  icon: "close",
874
882
  color: "inherit",
875
883
  "additional-styles": ["!text-outline", "!dark:text-outline-dark"],
876
884
  disabled: e.readonly || e.disabled,
877
885
  onClick: o[5] || (o[5] = Y((t) => e.$emit("update:modelValue", e.multiple ? [] : void 0), ["stop"]))
878
- }, null, 8, ["disabled"])) : j("", !0),
879
- N(L(S, {
886
+ }, null, 8, ["disabled"])) : W("", !0),
887
+ z(L(g, {
880
888
  icon: e.popoverState === "open" ? e.enableSearch ? "search" : "arrow_drop_up" : "arrow_drop_down",
881
889
  class: y(e.popoverState === "open" && e.enableSearch ? "!text-outline !dark:text-outline-dark" : ""),
882
890
  variant: "outlined"
@@ -893,11 +901,11 @@ function zo(e, o, w, f, v, u) {
893
901
  "full-width": !0,
894
902
  "disable-default-styles": !0
895
903
  }, {
896
- default: b(() => [
897
- z("div", {
904
+ default: h(() => [
905
+ q("div", {
898
906
  class: y(e.dropdownStyles)
899
907
  }, [
900
- e.popoverState === "open" && e.enableSearch && e.isMobile ? (n(), k(M, {
908
+ e.popoverState === "open" && e.enableSearch && e.isMobile ? (r(), k(M, {
901
909
  key: 0,
902
910
  ref: "searchControl",
903
911
  modelValue: e.searchText,
@@ -905,11 +913,11 @@ function zo(e, o, w, f, v, u) {
905
913
  class: y(e.searchControlStyles),
906
914
  type: "search",
907
915
  placeholder: e.placeholder
908
- }, null, 8, ["modelValue", "class", "placeholder"])) : j("", !0),
909
- z("div", {
916
+ }, null, 8, ["modelValue", "class", "placeholder"])) : W("", !0),
917
+ q("div", {
910
918
  class: y(e.dropdownContainerStyles)
911
919
  }, [
912
- e.loading ? (n(), g("div", Fo, [
920
+ e.loading ? (r(), O("div", Fo, [
913
921
  C(e.$slots, "loading", {}, () => [
914
922
  L(I, {
915
923
  class: y(e.loaderStyles),
@@ -917,26 +925,26 @@ function zo(e, o, w, f, v, u) {
917
925
  text: e.loadingText
918
926
  }, null, 8, ["class", "text"])
919
927
  ])
920
- ])) : e.resolvedSearchOptions.length > 0 ? (n(), g(F, { key: 1 }, [
921
- e.groupByFunction ? (n(!0), g(F, { key: 0 }, H(e.groupedOptions, (t, R) => (n(), k(U, {
928
+ ])) : e.resolvedSearchOptions.length > 0 ? (r(), O(F, { key: 1 }, [
929
+ e.groupByFunction ? (r(!0), O(F, { key: 0 }, j(e.groupedOptions, (t, R) => (r(), k(A, {
922
930
  key: R,
923
931
  label: R
924
932
  }, {
925
- default: b(() => [
926
- e.multiple ? (n(!0), g(F, { key: 0 }, H(t, (d, D) => (n(), k($, {
933
+ default: h(() => [
934
+ e.multiple ? (r(!0), O(F, { key: 0 }, j(t, (d, D) => (r(), k($, {
927
935
  key: D,
928
936
  "tooltip-text": d.label,
929
937
  selected: e.proxyModelValue && e.proxyModelValue.includes(d.value),
930
938
  disabled: d.disabled
931
939
  }, {
932
- default: b(() => [
940
+ default: h(() => [
933
941
  C(e.$slots, "optionTemplate", {
934
942
  model: e.proxyModelValue,
935
943
  option: d
936
944
  }, () => [
937
945
  L(P, {
938
946
  modelValue: e.proxyModelValue,
939
- "onUpdate:modelValue": o[7] || (o[7] = (K) => e.proxyModelValue = K),
947
+ "onUpdate:modelValue": o[7] || (o[7] = (Q) => e.proxyModelValue = Q),
940
948
  value: d.value,
941
949
  label: d.label,
942
950
  "label-variant": "menu-item",
@@ -945,15 +953,15 @@ function zo(e, o, w, f, v, u) {
945
953
  ])
946
954
  ]),
947
955
  _: 2
948
- }, 1032, ["tooltip-text", "selected", "disabled"]))), 128)) : (n(!0), g(F, { key: 1 }, H(t, (d, D) => (n(), k($, {
956
+ }, 1032, ["tooltip-text", "selected", "disabled"]))), 128)) : (r(!0), O(F, { key: 1 }, j(t, (d, D) => (r(), k($, {
949
957
  key: D,
950
958
  class: y(e.dropdownItemStyles),
951
959
  "tooltip-text": d.label,
952
960
  selected: e.proxyModelValue === d.value,
953
961
  disabled: d.disabled,
954
- onClick: Y((K) => e.selectOption(d.value), ["stop"])
962
+ onClick: Y((Q) => e.selectOption(d.value), ["stop"])
955
963
  }, {
956
- default: b(() => [
964
+ default: h(() => [
957
965
  C(e.$slots, "optionTemplate", {
958
966
  model: e.proxyModelValue,
959
967
  option: d
@@ -965,24 +973,25 @@ function zo(e, o, w, f, v, u) {
965
973
  }, 1032, ["class", "tooltip-text", "selected", "disabled", "onClick"]))), 128))
966
974
  ]),
967
975
  _: 2
968
- }, 1032, ["label"]))), 128)) : (n(), g(F, { key: 1 }, [
969
- e.multiple ? (n(!0), g(F, { key: 0 }, H(e.resolvedSearchOptions, (t, R) => (n(), k($, {
976
+ }, 1032, ["label"]))), 128)) : (r(), O(F, { key: 1 }, [
977
+ e.multiple ? (r(!0), O(F, { key: 0 }, j(e.resolvedSearchOptions, (t, R) => (r(), k($, {
970
978
  key: R,
971
979
  "tooltip-text": t.label,
972
980
  class: y(e.dropdownItemStyles),
973
981
  selected: e.proxyModelValue && e.proxyModelValue.includes(t.value),
974
982
  disabled: t.disabled,
983
+ "data-value": t.value,
975
984
  onClick: Y((d) => !t.disabled && e.toggleOption(t.value), ["stop"])
976
985
  }, {
977
- default: b(() => [
986
+ default: h(() => [
978
987
  L(P, {
979
988
  "model-value": e.proxyModelValue,
980
989
  value: t.value,
981
990
  "label-variant": "menu-item",
982
991
  disabled: t.disabled
983
992
  }, {
984
- default: b(() => [
985
- z("div", {
993
+ default: h(() => [
994
+ q("div", {
986
995
  onClick: (d) => !t.disabled && e.toggleOption(t.value)
987
996
  }, [
988
997
  C(e.$slots, "optionTemplate", {
@@ -991,23 +1000,24 @@ function zo(e, o, w, f, v, u) {
991
1000
  }, () => [
992
1001
  T(E(t.label), 1)
993
1002
  ])
994
- ], 8, Uo)
1003
+ ], 8, Ao)
995
1004
  ]),
996
1005
  _: 2
997
1006
  }, 1032, ["model-value", "value", "disabled"])
998
1007
  ]),
999
1008
  _: 2
1000
- }, 1032, ["tooltip-text", "class", "selected", "disabled", "onClick"]))), 128)) : (n(!0), g(F, { key: 1 }, H(e.resolvedSearchOptions, (t, R) => (n(), k($, {
1009
+ }, 1032, ["tooltip-text", "class", "selected", "disabled", "data-value", "onClick"]))), 128)) : (r(!0), O(F, { key: 1 }, j(e.resolvedSearchOptions, (t, R) => (r(), k($, {
1001
1010
  key: R,
1002
1011
  class: y(e.dropdownItemStyles),
1003
1012
  selected: e.proxyModelValue === t.value,
1004
1013
  "tooltip-text": t.label,
1014
+ "data-value": t.value,
1005
1015
  disabled: t.disabled,
1006
1016
  onClick: Y((d) => {
1007
1017
  e.selectOption(t.value), e.close();
1008
1018
  }, ["stop"])
1009
1019
  }, {
1010
- default: b(() => [
1020
+ default: h(() => [
1011
1021
  C(e.$slots, "optionTemplate", {
1012
1022
  model: e.proxyModelValue,
1013
1023
  option: t
@@ -1016,9 +1026,9 @@ function zo(e, o, w, f, v, u) {
1016
1026
  ])
1017
1027
  ]),
1018
1028
  _: 2
1019
- }, 1032, ["class", "selected", "tooltip-text", "disabled", "onClick"]))), 128))
1029
+ }, 1032, ["class", "selected", "tooltip-text", "data-value", "disabled", "onClick"]))), 128))
1020
1030
  ], 64))
1021
- ], 64)) : (n(), g("div", {
1031
+ ], 64)) : (r(), O("div", {
1022
1032
  key: 2,
1023
1033
  class: y(e.noSearchResultsStyles)
1024
1034
  }, [
@@ -1035,13 +1045,13 @@ function zo(e, o, w, f, v, u) {
1035
1045
  _: 3
1036
1046
  }, 8, ["class", "variant", "size", "invalid", "readonly", "disabled", "force-state", "tabindex"])), [
1037
1047
  [le, e.toggle],
1038
- [J, e.close]
1048
+ [K, e.close]
1039
1049
  ]),
1040
- e.$slots.hint || e.hint ? N((n(), k(q, {
1050
+ e.$slots.hint || e.hint ? z((r(), k(N, {
1041
1051
  key: 1,
1042
1052
  disabled: e.disabled
1043
1053
  }, {
1044
- default: b(() => [
1054
+ default: h(() => [
1045
1055
  C(e.$slots, "hint", {}, () => [
1046
1056
  T(E(e.hint), 1)
1047
1057
  ])
@@ -1049,9 +1059,9 @@ function zo(e, o, w, f, v, u) {
1049
1059
  _: 3
1050
1060
  }, 8, ["disabled"])), [
1051
1061
  [x, !e.error]
1052
- ]) : j("", !0),
1053
- N(L(r, { disabled: e.disabled }, {
1054
- default: b(() => [
1062
+ ]) : W("", !0),
1063
+ z(L(n, { disabled: e.disabled }, {
1064
+ default: h(() => [
1055
1065
  T(E(e.error), 1)
1056
1066
  ]),
1057
1067
  _: 1
@@ -1060,8 +1070,8 @@ function zo(e, o, w, f, v, u) {
1060
1070
  ])
1061
1071
  ], 2);
1062
1072
  }
1063
- const sl = /* @__PURE__ */ G(Lo, [["render", zo]]);
1073
+ const sl = /* @__PURE__ */ J(Lo, [["render", Uo]]);
1064
1074
  export {
1065
1075
  sl as O
1066
1076
  };
1067
- //# sourceMappingURL=OrSelect-DU7MIxsd.mjs.map
1077
+ //# sourceMappingURL=OrSelect-DPoXgLko.mjs.map