x-next 1.9.0 → 1.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/AI_USAGE.md +69 -7
  2. package/CHANGELOG.md +36 -0
  3. package/dist/_utils/chart/scale.d.ts +1 -1
  4. package/dist/components/_components/chart/axis-labels.d.ts +8 -0
  5. package/dist/components/_components/select-view/select-view.d.ts +9 -0
  6. package/dist/components/form-select/Select.d.ts +18 -5
  7. package/dist/components/form-select/SelectOptionGroup.vue.d.ts +1 -0
  8. package/dist/components/form-select/hooks/use-options.d.ts +1 -1
  9. package/dist/components/form-select/hooks/use-select.d.ts +1 -1
  10. package/dist/components/form-select/index.d.ts +42 -11
  11. package/dist/components/form-select/interface.d.ts +8 -0
  12. package/dist/components/link/Link.vue.d.ts +1 -1
  13. package/dist/components/link/index.d.ts +3 -3
  14. package/dist/components/pagination/page-options.vue.d.ts +60 -32
  15. package/dist/components/trigger/interface.d.ts +2 -0
  16. package/dist/components/virtual-list-v2/interface.d.ts +3 -0
  17. package/dist/components/virtual-list-v2/virtual-list.vue.d.ts +336 -1
  18. package/dist/es/_hooks/use-component-ref.js +9 -9
  19. package/dist/es/_utils/chart/scale.js +44 -39
  20. package/dist/es/components/_components/chart/ChartAxis.js +61 -36
  21. package/dist/es/components/_components/chart/axis-labels.js +26 -0
  22. package/dist/es/components/_components/select-view/select-view.js +89 -78
  23. package/dist/es/components/button/Button.js +23 -23
  24. package/dist/es/components/form-input-tag/InputTag.js +1 -1
  25. package/dist/es/components/form-select/Select.js +367 -318
  26. package/dist/es/components/form-select/SelectOption.vue.js +5 -3
  27. package/dist/es/components/form-select/SelectOption.vue2.js +54 -49
  28. package/dist/es/components/form-select/SelectOptionGroup.vue.js +17 -13
  29. package/dist/es/components/form-select/SelectOptionGroup.vue2.js +8 -5
  30. package/dist/es/components/form-select/hooks/use-options.js +40 -40
  31. package/dist/es/components/form-select/hooks/use-select.js +76 -71
  32. package/dist/es/components/trigger/Trigger.js +174 -183
  33. package/dist/es/components/virtual-list-v2/virtual-list.vue.js +22 -23
  34. package/dist/es/components/virtual-list-v2/virtual-list.vue2.js +67 -53
  35. package/dist/es/icons/icon.js +37 -36
  36. package/dist/es/icons/index.js +6 -8
  37. package/dist/es/icons/public/lucide-names.js +167 -0
  38. package/dist/es/icons/public/lucide.js +75 -188
  39. package/dist/es/index.js +152 -148
  40. package/dist/es/style.css +1 -1
  41. package/dist/icons/index.d.ts +3 -3
  42. package/dist/icons/names.d.ts +2 -2
  43. package/dist/icons/public/lucide-names.d.ts +32 -0
  44. package/dist/icons/public/lucide.d.ts +2 -2
  45. package/dist/index.cjs +3 -62
  46. package/dist/index.umd.js +3 -62
  47. package/dist/style/base.css +1 -1
  48. package/dist/style/button.css +1 -1
  49. package/dist/style/form-select.css +1 -1
  50. package/dist/style.css +1 -1
  51. package/package.json +3 -2
@@ -1,5 +1,5 @@
1
1
  import c from "./SelectOption.vue2.js";
2
- import { resolveComponent as u, withDirectives as f, openBlock as s, createBlock as n, resolveDynamicComponent as p, normalizeClass as o, withCtx as i, createElementBlock as a, renderSlot as l, createCommentVNode as t, createTextVNode as r, toDisplayString as d, vShow as k } from "vue";
2
+ import { resolveComponent as u, withDirectives as f, openBlock as s, createBlock as n, resolveDynamicComponent as p, normalizeClass as o, withCtx as i, createElementBlock as a, renderSlot as l, createCommentVNode as t, createTextVNode as d, toDisplayString as r, vShow as k } from "vue";
3
3
  import b from "../../_virtual/_plugin-vue_export-helper.js";
4
4
  function h(e, $, v, C, N, y) {
5
5
  const m = u("checkbox");
@@ -26,11 +26,13 @@ function h(e, $, v, C, N, y) {
26
26
  class: o(e.className.element("checkbox")),
27
27
  "model-value": e.isSelected,
28
28
  disabled: e.disabled,
29
+ tabindex: -1,
30
+ "aria-hidden": "true",
29
31
  "uninject-group-context": ""
30
32
  }, {
31
33
  default: i(() => [
32
34
  l(e.$slots, "default", {}, () => [
33
- r(d(e.label), 1)
35
+ d(r(e.label), 1)
34
36
  ])
35
37
  ]),
36
38
  _: 3
@@ -39,7 +41,7 @@ function h(e, $, v, C, N, y) {
39
41
  class: o(e.className.element("content"))
40
42
  }, [
41
43
  l(e.$slots, "default", {}, () => [
42
- r(d(e.label), 1)
44
+ d(r(e.label), 1)
43
45
  ])
44
46
  ], 2)),
45
47
  e.$slots.suffix ? (s(), a("span", {
@@ -1,10 +1,11 @@
1
- import { defineComponent as B, toRefs as M, inject as N, getCurrentInstance as P, ref as r, watch as A, computed as i, onMounted as _, onUpdated as w, reactive as E, onBeforeUnmount as R } from "vue";
1
+ import { defineComponent as B, toRefs as M, inject as N, provide as P, getCurrentInstance as A, ref as f, watch as _, computed as i, onMounted as q, onUpdated as w, reactive as E, onBeforeUnmount as R } from "vue";
2
2
  import U from "../form-checkbox/Checkbox.js";
3
- import { selectInjectionKey as q } from "./context.js";
4
- import { getKeyFromValue as F, isValidOption as L } from "./utils.js";
5
- import { isEqual as T } from "../../_utils/is-equal.js";
6
- import { getClassNameMixin as z } from "../../_utils/config.js";
7
- const X = B({
3
+ import { selectInjectionKey as F } from "./context.js";
4
+ import { getKeyFromValue as L, isValidOption as T } from "./utils.js";
5
+ import { isEqual as z } from "../../_utils/is-equal.js";
6
+ import { getClassNameMixin as D } from "../../_utils/config.js";
7
+ import { formItemInjectionKey as G } from "../form/context.js";
8
+ const $ = B({
8
9
  name: "Option",
9
10
  components: {
10
11
  Checkbox: U
@@ -55,76 +56,80 @@ const X = B({
55
56
  // private
56
57
  internal: Boolean
57
58
  },
58
- setup(o) {
59
- const { disabled: v, tagProps: s, index: g } = M(o), a = z("select--option"), e = N(q, void 0), l = P(), u = r(), f = r(s.value);
60
- A(s, (n, k) => {
61
- T(n, k) || (f.value = n);
59
+ setup(n) {
60
+ const { disabled: v, tagProps: s, index: O } = M(n), t = D("select--option"), e = N(F, void 0);
61
+ e && P(G, {});
62
+ const l = A(), u = f(), m = f(s.value);
63
+ _(s, (o, r) => {
64
+ z(o, r) || (m.value = o);
62
65
  });
63
- const d = r(""), m = i(() => o.value ?? o.label ?? d.value), c = i(() => o.label ?? d.value), t = i(() => F(m.value, e == null ? void 0 : e.valueKey)), O = i(() => (e == null ? void 0 : e.component) ?? "li"), I = i(() => e == null ? void 0 : e.getOptionId(t.value)), p = () => {
64
- if (!o.label && u.value) {
65
- const n = u.value.textContent ?? "";
66
- d.value !== n && (d.value = n);
66
+ const d = f(""), c = i(() => n.value ?? n.label ?? d.value), p = i(() => n.label ?? d.value), a = i(() => L(c.value, e == null ? void 0 : e.valueKey)), I = i(() => (e == null ? void 0 : e.component) ?? "li"), K = i(() => e == null ? void 0 : e.getOptionId(a.value)), b = () => {
67
+ if (!n.label && u.value) {
68
+ const o = u.value.querySelector(
69
+ ".x-select--option--content, .x-checkbox--label"
70
+ ), r = (o == null ? void 0 : o.textContent) ?? "";
71
+ d.value !== r && (d.value = r);
67
72
  }
68
73
  };
69
- _(() => p()), w(() => p());
70
- const b = i(() => (e == null ? void 0 : e.valueKeys.includes(t.value)) ?? !1), K = i(() => (e == null ? void 0 : e.activeKey) === t.value);
71
- let y = r(!0);
72
- if (!o.internal) {
73
- const n = E({
74
+ q(() => b()), w(() => b());
75
+ const y = i(() => (e == null ? void 0 : e.valueKeys.includes(a.value)) ?? !1), S = i(() => (e == null ? void 0 : e.activeKey) === a.value);
76
+ let g = f(!0);
77
+ if (!n.internal) {
78
+ const o = E({
74
79
  raw: {
75
- value: m,
76
- label: c,
80
+ value: c,
81
+ label: p,
77
82
  disabled: v,
78
- tagProps: f
83
+ tagProps: m
79
84
  },
80
85
  ref: u,
81
- index: g,
82
- key: t,
86
+ index: O,
87
+ key: a,
83
88
  origin: "slot",
84
- value: m,
85
- label: c,
89
+ value: c,
90
+ label: p,
86
91
  disabled: v,
87
- tagProps: f
92
+ tagProps: m
88
93
  });
89
- y = i(
90
- () => L(n, {
94
+ g = i(
95
+ () => T(o, {
91
96
  inputValue: e == null ? void 0 : e.inputValue,
92
97
  filterOption: e == null ? void 0 : e.filterOption
93
98
  })
94
- ), l && (e == null || e.addSlotOptionInfo(l.uid, n)), R(() => {
99
+ ), l && (e == null || e.addSlotOptionInfo(l.uid, o)), R(() => {
95
100
  l && (e == null || e.removeSlotOptionInfo(l.uid));
96
101
  });
97
102
  }
98
- const S = (n) => {
99
- o.disabled || e == null || e.onSelect(t.value, n);
100
- }, h = () => {
101
- o.disabled || e == null || e.setActiveKey(t.value);
103
+ const h = (o) => {
104
+ n.disabled || e == null || e.onSelect(a.value, o);
102
105
  }, j = () => {
103
- o.disabled || e == null || e.setActiveKey();
106
+ n.disabled || e == null || e.setActiveKey(a.value);
107
+ }, k = () => {
108
+ n.disabled || e == null || e.setActiveKey();
104
109
  }, V = i(() => [
105
- a.block,
110
+ t.block,
106
111
  {
107
- [a.modifier("disabled")]: o.disabled,
108
- [a.modifier("selected")]: b.value,
109
- [a.modifier("active")]: K.value,
110
- [a.modifier("multiple")]: e == null ? void 0 : e.multiple
112
+ [t.modifier("disabled")]: n.disabled,
113
+ [t.modifier("selected")]: y.value,
114
+ [t.modifier("active")]: S.value,
115
+ [t.modifier("multiple")]: e == null ? void 0 : e.multiple
111
116
  }
112
117
  ]);
113
118
  return {
114
- className: a,
119
+ className: t,
115
120
  cls: V,
116
121
  selectCtx: e,
117
122
  itemRef: u,
118
- component: O,
119
- optionId: I,
120
- isSelected: b,
121
- isValid: y,
122
- handleClick: S,
123
- handleMouseEnter: h,
124
- handleMouseLeave: j
123
+ component: I,
124
+ optionId: K,
125
+ isSelected: y,
126
+ isValid: g,
127
+ handleClick: h,
128
+ handleMouseEnter: j,
129
+ handleMouseLeave: k
125
130
  };
126
131
  }
127
132
  });
128
133
  export {
129
- X as default
134
+ $ as default
130
135
  };
@@ -1,19 +1,23 @@
1
- import o from "./SelectOptionGroup.vue2.js";
2
- import { openBlock as l, createElementBlock as r, Fragment as a, createElementVNode as s, normalizeClass as n, renderSlot as t, createTextVNode as m, toDisplayString as p } from "vue";
3
- import c from "../../_virtual/_plugin-vue_export-helper.js";
4
- function i(e, f, d, u, $, _) {
5
- return l(), r(a, null, [
6
- s("li", {
7
- class: n(e.className.element("title"))
8
- }, [
9
- t(e.$slots, "label", {}, () => [
10
- m(p(e.label), 1)
11
- ])
12
- ], 2),
1
+ import l from "./SelectOptionGroup.vue2.js";
2
+ import { openBlock as o, createElementBlock as r, Fragment as n, createBlock as a, resolveDynamicComponent as s, normalizeClass as p, withCtx as c, renderSlot as t, createTextVNode as m, toDisplayString as i } from "vue";
3
+ import f from "../../_virtual/_plugin-vue_export-helper.js";
4
+ function d(e, u, $, _, k, B) {
5
+ return o(), r(n, null, [
6
+ (o(), a(s(e.component), {
7
+ class: p(e.className.element("title")),
8
+ role: "presentation"
9
+ }, {
10
+ default: c(() => [
11
+ t(e.$slots, "label", {}, () => [
12
+ m(i(e.label), 1)
13
+ ])
14
+ ]),
15
+ _: 3
16
+ }, 8, ["class"])),
13
17
  t(e.$slots, "default")
14
18
  ], 64);
15
19
  }
16
- const g = /* @__PURE__ */ c(o, [["render", i]]);
20
+ const g = /* @__PURE__ */ f(l, [["render", d]]);
17
21
  export {
18
22
  g as default
19
23
  };
@@ -1,6 +1,7 @@
1
- import { defineComponent as e } from "vue";
2
- import { getClassNameMixin as t } from "../../_utils/config.js";
3
- const p = e({
1
+ import { defineComponent as n, inject as p, computed as i } from "vue";
2
+ import { getClassNameMixin as m } from "../../_utils/config.js";
3
+ import { selectInjectionKey as c } from "./context.js";
4
+ const l = n({
4
5
  name: "SelectOptionGroup",
5
6
  props: {
6
7
  /**
@@ -18,11 +19,13 @@ const p = e({
18
19
  * @version 2.10.0
19
20
  */
20
21
  setup() {
22
+ const e = m("select--option--group"), o = p(c, void 0), t = i(() => (o == null ? void 0 : o.component) ?? "li");
21
23
  return {
22
- className: t("select--option--group")
24
+ className: e,
25
+ component: t
23
26
  };
24
27
  }
25
28
  });
26
29
  export {
27
- p as default
30
+ l as default
28
31
  };
@@ -1,95 +1,95 @@
1
- import { computed as s, reactive as g, watch as z, ref as f } from "vue";
2
- import { getOptionInfos as S, getValidOptions as b, isValidOption as F } from "../utils.js";
3
- import { isNumber as k } from "../../../_utils/is.js";
4
- const N = {
1
+ import { computed as r, reactive as u, watch as D } from "vue";
2
+ import { getOptionInfos as g, getValidOptions as S, isValidOption as z } from "../utils.js";
3
+ import { isNumber as b } from "../../../_utils/is.js";
4
+ const F = {
5
5
  value: "value",
6
6
  label: "label",
7
7
  disabled: "disabled",
8
8
  tagProps: "tagProps",
9
9
  render: "render"
10
- }, j = ({
11
- options: c,
12
- extraOptions: v,
10
+ }, T = ({
11
+ options: v,
12
+ extraOptions: I,
13
13
  inputValue: n,
14
14
  filterOption: a,
15
- showExtraOptions: d,
16
- valueKey: r,
15
+ showExtraOptions: s,
16
+ valueKey: d,
17
17
  fieldNames: l
18
18
  }) => {
19
- const p = s(() => ({
20
- ...N,
19
+ const m = r(() => ({
20
+ ...F,
21
21
  ...l == null ? void 0 : l.value
22
- })), I = g(/* @__PURE__ */ new Map()), m = s(
23
- () => Array.from(I.values()).sort((o, t) => k(o.index) && k(t.index) ? o.index - t.index : 0)
24
- ), M = s(() => {
22
+ })), c = u(/* @__PURE__ */ new Map()), M = r(
23
+ () => Array.from(c.values()).sort((o, t) => b(o.index) && b(t.index) ? o.index - t.index : 0)
24
+ ), p = r(() => {
25
25
  const o = /* @__PURE__ */ new Map();
26
26
  return {
27
- optionInfos: S((c == null ? void 0 : c.value) ?? [], {
28
- valueKey: (r == null ? void 0 : r.value) ?? "value",
29
- fieldNames: p.value,
27
+ optionInfos: g((v == null ? void 0 : v.value) ?? [], {
28
+ valueKey: (d == null ? void 0 : d.value) ?? "value",
29
+ fieldNames: m.value,
30
30
  origin: "options",
31
31
  optionInfoMap: o
32
32
  }),
33
33
  optionInfoMap: o
34
34
  };
35
- }), u = s(() => {
35
+ }), f = r(() => {
36
36
  const o = /* @__PURE__ */ new Map();
37
37
  return {
38
- optionInfos: S((v == null ? void 0 : v.value) ?? [], {
39
- valueKey: (r == null ? void 0 : r.value) ?? "value",
40
- fieldNames: p.value,
38
+ optionInfos: g((I == null ? void 0 : I.value) ?? [], {
39
+ valueKey: (d == null ? void 0 : d.value) ?? "value",
40
+ fieldNames: m.value,
41
41
  origin: "extraOptions",
42
42
  optionInfoMap: o
43
43
  }),
44
44
  optionInfoMap: o
45
45
  };
46
- }), e = g(/* @__PURE__ */ new Map());
47
- z(
48
- [m, c ?? f([]), v ?? f([]), r ?? f("value")],
46
+ }), e = u(/* @__PURE__ */ new Map());
47
+ D(
48
+ [M, p, f],
49
49
  () => {
50
- e.clear(), m.value.forEach((o, t) => {
50
+ e.clear(), M.value.forEach((o, t) => {
51
51
  e.set(o.key, { ...o, index: t });
52
- }), M.value.optionInfoMap.forEach((o) => {
52
+ }), p.value.optionInfoMap.forEach((o) => {
53
53
  e.has(o.key) || (o.index = e.size, e.set(o.key, o));
54
- }), u.value.optionInfoMap.forEach((o) => {
54
+ }), f.value.optionInfoMap.forEach((o) => {
55
55
  e.has(o.key) || (o.index = e.size, e.set(o.key, o));
56
56
  });
57
57
  },
58
58
  { immediate: !0, deep: !0 }
59
59
  );
60
- const A = s(() => {
61
- const o = b(M.value.optionInfos, {
60
+ const k = r(() => {
61
+ const o = S(p.value.optionInfos, {
62
62
  inputValue: n == null ? void 0 : n.value,
63
63
  filterOption: a == null ? void 0 : a.value
64
64
  });
65
- return ((d == null ? void 0 : d.value) ?? !0) && o.push(
66
- ...b(u.value.optionInfos, {
65
+ return ((s == null ? void 0 : s.value) ?? !0) && o.push(
66
+ ...S(f.value.optionInfos, {
67
67
  inputValue: n == null ? void 0 : n.value,
68
68
  filterOption: a == null ? void 0 : a.value
69
69
  })
70
70
  ), o;
71
- }), i = s(
72
- () => Array.from(e.values()).filter((o) => o.origin === "extraOptions" && (d == null ? void 0 : d.value) === !1 ? !1 : F(o, {
71
+ }), i = r(
72
+ () => Array.from(e.values()).filter((o) => o.origin === "extraOptions" && (s == null ? void 0 : s.value) === !1 ? !1 : z(o, {
73
73
  inputValue: n == null ? void 0 : n.value,
74
74
  filterOption: a == null ? void 0 : a.value
75
75
  }))
76
- ), D = s(
76
+ ), A = r(
77
77
  () => i.value.filter((o) => !o.disabled).map((o) => o.key)
78
78
  );
79
79
  return {
80
- validOptions: A,
80
+ validOptions: k,
81
81
  optionInfoMap: e,
82
82
  validOptionInfos: i,
83
- enabledOptionKeys: D,
84
- getNextSlotOptionIndex: () => I.size,
83
+ enabledOptionKeys: A,
84
+ getNextSlotOptionIndex: () => c.size,
85
85
  addSlotOptionInfo: (o, t) => {
86
- I.set(o, t);
86
+ c.set(o, t);
87
87
  },
88
88
  removeSlotOptionInfo: (o) => {
89
- I.delete(o);
89
+ c.delete(o);
90
90
  }
91
91
  };
92
92
  };
93
93
  export {
94
- j as useOptions
94
+ T as useOptions
95
95
  };
@@ -1,130 +1,135 @@
1
- import { ref as X, watch as U, nextTick as Z, provide as $, reactive as p } from "vue";
2
- import { getRelativeRect as R } from "../../../_utils/dom.js";
3
- import { useOptions as F } from "./use-options.js";
1
+ import { ref as X, watch as W, nextTick as Z, provide as $, reactive as R } from "vue";
2
+ import { getRelativeRect as F } from "../../../_utils/dom.js";
3
+ import { useOptions as L } from "./use-options.js";
4
4
  import { KEYBOARD_KEY as a } from "../../../_utils/keyboard.js";
5
- import { selectInjectionKey as L } from "../context.js";
5
+ import { selectInjectionKey as p } from "../context.js";
6
6
  import { isUndefined as f } from "../../../_utils/is.js";
7
7
  const le = ({
8
- multiple: B,
9
- options: H,
8
+ multiple: U,
9
+ options: B,
10
10
  extraOptions: Y,
11
- inputValue: T,
12
- filterOption: E,
11
+ inputValue: v,
12
+ filterOption: T,
13
13
  showExtraOptions: j,
14
14
  component: M,
15
15
  valueKey: h,
16
16
  fieldNames: q,
17
- loading: m,
18
- disabled: y,
19
- popupVisible: c,
17
+ loading: k,
18
+ disabled: K,
19
+ popupVisible: u,
20
20
  valueKeys: x,
21
- dropdownRef: K,
21
+ dropdownRef: g,
22
22
  optionRefs: O,
23
- virtualListRef: v,
24
- onSelect: k,
23
+ virtualListRef: s,
24
+ onSelect: d,
25
25
  onPopupVisibleChange: i,
26
26
  getOptionId: z,
27
27
  enterToOpen: C = !0,
28
- defaultActiveFirstOption: g
28
+ defaultActiveFirstOption: E
29
29
  }) => {
30
30
  const {
31
31
  validOptions: G,
32
32
  optionInfoMap: D,
33
33
  validOptionInfos: J,
34
- enabledOptionKeys: l,
34
+ enabledOptionKeys: c,
35
35
  getNextSlotOptionIndex: P,
36
36
  addSlotOptionInfo: S,
37
37
  removeSlotOptionInfo: _
38
- } = F({
39
- options: H,
38
+ } = L({
39
+ options: B,
40
40
  extraOptions: Y,
41
- inputValue: T,
42
- filterOption: E,
41
+ inputValue: v,
42
+ filterOption: T,
43
43
  showExtraOptions: j,
44
44
  valueKey: h,
45
45
  fieldNames: q
46
- }), t = X();
47
- let u;
48
- const w = () => {
49
- const e = l.value, r = x.value[x.value.length - 1];
50
- return e.includes(r) ? r : u ? u === "up" ? e[e.length - 1] : e[0] : (g == null ? void 0 : g.value) ?? !0 ? e[0] : void 0;
46
+ }), r = X();
47
+ let n;
48
+ const I = () => {
49
+ const e = c.value, t = x.value[x.value.length - 1];
50
+ return e.includes(t) ? t : n ? n === "up" ? e[e.length - 1] : e[0] : (E == null ? void 0 : E.value) ?? !0 ? e[0] : void 0;
51
51
  };
52
- U(l, (e) => {
53
- c.value && u ? t.value = w() : (f(t.value) || !e.includes(t.value)) && (t.value = e[0]);
52
+ W(c, (e) => {
53
+ (u.value && n || f(r.value) || !e.includes(r.value)) && (r.value = I());
54
54
  });
55
- const A = (e) => {
56
- t.value = e;
57
- }, N = (e) => {
58
- const r = l.value.length;
59
- if (r === 0)
55
+ const w = (e) => {
56
+ r.value = e;
57
+ }, A = (e) => {
58
+ const t = c.value.length;
59
+ if (t === 0)
60
60
  return;
61
- if (f(t.value))
62
- return e === "down" ? l.value[0] : l.value[r - 1];
63
- const o = l.value.indexOf(t.value), n = (r + o + (e === "up" ? -1 : 1)) % r;
64
- return l.value[n];
65
- }, I = (e) => {
66
- var d;
67
- v != null && v.value && v.value.scrollTo({ key: e });
68
- const r = D.get(e), o = (d = K == null ? void 0 : K.value) == null ? void 0 : d.wrapperRef, n = (O == null ? void 0 : O.value[e]) ?? (r == null ? void 0 : r.ref);
69
- if (!o || !n || o.scrollHeight === o.offsetHeight)
61
+ if (f(r.value))
62
+ return e === "down" ? c.value[0] : c.value[t - 1];
63
+ const o = c.value.indexOf(r.value), l = (t + o + (e === "up" ? -1 : 1)) % t;
64
+ return c.value[l];
65
+ }, m = (e) => {
66
+ var N;
67
+ s != null && s.value && s.value.scrollTo({ key: e });
68
+ const t = D.get(e), o = (N = g == null ? void 0 : g.value) == null ? void 0 : N.wrapperRef, l = (O == null ? void 0 : O.value[e]) ?? (t == null ? void 0 : t.ref);
69
+ if (!o || !l || o.scrollHeight === o.offsetHeight)
70
70
  return;
71
- const s = R(n, o), W = o.scrollTop;
72
- s.top < 0 ? o.scrollTo(0, W + s.top) : s.bottom < 0 && o.scrollTo(0, W - s.bottom);
71
+ const y = F(l, o), H = o.scrollTop;
72
+ y.top < 0 ? o.scrollTo(0, H + y.top) : y.bottom < 0 && o.scrollTo(0, H - y.bottom);
73
73
  };
74
- U(
75
- c,
74
+ W(
75
+ u,
76
76
  (e) => {
77
- e ? (t.value = w(), Z(() => {
78
- u = void 0, c.value && !f(t.value) && I(t.value);
79
- })) : u = void 0;
77
+ e ? (r.value = I(), Z(() => {
78
+ n = void 0, u.value && !f(r.value) && m(r.value);
79
+ })) : n = void 0;
80
80
  },
81
81
  { immediate: !0 }
82
82
  );
83
83
  const Q = (e) => {
84
- if (y != null && y.value || e.isComposing || e.keyCode === 229 || e.ctrlKey || e.altKey || e.metaKey)
84
+ if (K != null && K.value || e.isComposing || e.keyCode === 229 || e.ctrlKey || e.altKey || e.metaKey)
85
85
  return;
86
86
  if (e.key === a.TAB) {
87
- u = void 0, c.value && i(!1);
87
+ n = void 0, u.value && i(!1);
88
88
  return;
89
89
  }
90
90
  if (e.shiftKey)
91
91
  return;
92
- const r = () => {
92
+ const t = () => {
93
93
  e.stopPropagation(), e.preventDefault();
94
94
  };
95
95
  if (e.key === a.ESC) {
96
- u = void 0, c.value && (r(), i(!1));
96
+ n = void 0, u.value && (t(), i(!1));
97
97
  return;
98
98
  }
99
- if (!(m != null && m.value)) {
99
+ if (!(k != null && k.value)) {
100
+ if (u.value && !(v != null && v.value) && (e.key === "Home" || e.key === "End")) {
101
+ const o = c.value, l = e.key === "Home" ? o[0] : o[o.length - 1];
102
+ f(l) || (t(), r.value = l, m(l));
103
+ return;
104
+ }
100
105
  if (e.key === a.ENTER) {
101
- c.value ? !f(t.value) && l.value.includes(t.value) && (r(), k(t.value, e)) : C && (u = void 0, r(), i(!0));
106
+ u.value ? !f(r.value) && c.value.includes(r.value) && (t(), d(r.value, e)) : C && (n = void 0, t(), i(!0));
102
107
  return;
103
108
  }
104
109
  if (e.key === a.ARROW_DOWN || e.key === a.ARROW_UP) {
105
110
  const o = e.key === a.ARROW_UP ? "up" : "down";
106
- if (r(), !c.value)
107
- u = o, i(!0);
111
+ if (t(), !u.value)
112
+ n = o, i(!0);
108
113
  else {
109
- const n = N(o);
110
- f(n) || (t.value = n, I(n));
114
+ const l = A(o);
115
+ f(l) || (r.value = l, m(l));
111
116
  }
112
117
  }
113
118
  }
114
119
  };
115
120
  return $(
116
- L,
117
- p({
118
- multiple: B,
121
+ p,
122
+ R({
123
+ multiple: U,
119
124
  valueKey: h,
120
- inputValue: T,
121
- filterOption: E,
125
+ inputValue: v,
126
+ filterOption: T,
122
127
  component: M,
123
128
  valueKeys: x,
124
- activeKey: t,
129
+ activeKey: r,
125
130
  getOptionId: z,
126
- setActiveKey: A,
127
- onSelect: k,
131
+ setActiveKey: w,
132
+ onSelect: d,
128
133
  getNextSlotOptionIndex: P,
129
134
  addSlotOptionInfo: S,
130
135
  removeSlotOptionInfo: _
@@ -133,13 +138,13 @@ const le = ({
133
138
  validOptions: G,
134
139
  optionInfoMap: D,
135
140
  validOptionInfos: J,
136
- enabledOptionKeys: l,
137
- activeKey: t,
138
- setActiveKey: A,
141
+ enabledOptionKeys: c,
142
+ activeKey: r,
143
+ setActiveKey: w,
139
144
  addSlotOptionInfo: S,
140
145
  removeSlotOptionInfo: _,
141
- getNextActiveKey: N,
142
- scrollIntoView: I,
146
+ getNextActiveKey: A,
147
+ scrollIntoView: m,
143
148
  handleKeyDown: Q
144
149
  };
145
150
  };