vft 0.0.503 → 0.0.504

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 (125) hide show
  1. package/es/components/cascader/cascader.vue2.js +217 -211
  2. package/es/components/multiple-tabs/multiple-tabs.vue2.js +87 -83
  3. package/es/components/multiple-tabs/use/use-tab-dropdown.js +55 -39
  4. package/es/package.json.d.ts +1 -1
  5. package/es/package.json.js +1 -1
  6. package/lib/components/cascader/cascader.vue2.cjs +1 -1
  7. package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
  8. package/lib/components/multiple-tabs/use/use-tab-dropdown.cjs +1 -1
  9. package/lib/package.json.cjs +1 -1
  10. package/lib/package.json.d.ts +1 -1
  11. package/package.json +5 -5
  12. package/theme-style/dark/css-vars.css +1 -1
  13. package/theme-style/display.css +1 -1
  14. package/theme-style/src/common/icon.scss +3 -0
  15. package/theme-style/src/multiple-tabs.scss +8 -0
  16. package/theme-style/vft-affix.css +1 -1
  17. package/theme-style/vft-alert.css +1 -1
  18. package/theme-style/vft-aside.css +1 -1
  19. package/theme-style/vft-autocomplete.css +1 -1
  20. package/theme-style/vft-avatar-stack.css +1 -1
  21. package/theme-style/vft-avatar.css +1 -1
  22. package/theme-style/vft-backtop.css +1 -1
  23. package/theme-style/vft-badge.css +1 -1
  24. package/theme-style/vft-breadcrumb.css +1 -1
  25. package/theme-style/vft-button-group.css +1 -1
  26. package/theme-style/vft-button.css +1 -1
  27. package/theme-style/vft-calendar.css +1 -1
  28. package/theme-style/vft-card.css +1 -1
  29. package/theme-style/vft-carousel-item.css +1 -1
  30. package/theme-style/vft-carousel.css +1 -1
  31. package/theme-style/vft-cascader-panel.css +1 -1
  32. package/theme-style/vft-cascader.css +1 -1
  33. package/theme-style/vft-check-tag.css +1 -1
  34. package/theme-style/vft-checkbox-button.css +1 -1
  35. package/theme-style/vft-checkbox-group.css +1 -1
  36. package/theme-style/vft-checkbox.css +1 -1
  37. package/theme-style/vft-clamp-toggle.css +1 -1
  38. package/theme-style/vft-col.css +1 -1
  39. package/theme-style/vft-collapse.css +1 -1
  40. package/theme-style/vft-color-picker.css +1 -1
  41. package/theme-style/vft-container.css +1 -1
  42. package/theme-style/vft-date-picker.css +1 -1
  43. package/theme-style/vft-date-time-select.css +1 -1
  44. package/theme-style/vft-descriptions-item.css +1 -1
  45. package/theme-style/vft-descriptions.css +1 -1
  46. package/theme-style/vft-dialog.css +1 -1
  47. package/theme-style/vft-divider.css +1 -1
  48. package/theme-style/vft-drawer.css +1 -1
  49. package/theme-style/vft-dropdown.css +1 -1
  50. package/theme-style/vft-empty.css +1 -1
  51. package/theme-style/vft-footer-layout.css +1 -1
  52. package/theme-style/vft-footer.css +1 -1
  53. package/theme-style/vft-form.css +1 -1
  54. package/theme-style/vft-full-screen.css +1 -1
  55. package/theme-style/vft-header-layout.css +1 -1
  56. package/theme-style/vft-header.css +1 -1
  57. package/theme-style/vft-horizontal-menu.css +1 -1
  58. package/theme-style/vft-icon-text.css +1 -1
  59. package/theme-style/vft-icon.css +1 -1
  60. package/theme-style/vft-iframe-layout.css +1 -1
  61. package/theme-style/vft-image-viewer.css +1 -1
  62. package/theme-style/vft-image.css +1 -1
  63. package/theme-style/vft-input-number.css +1 -1
  64. package/theme-style/vft-input-tag.css +1 -1
  65. package/theme-style/vft-input.css +1 -1
  66. package/theme-style/vft-link.css +1 -1
  67. package/theme-style/vft-list-cell.css +1 -1
  68. package/theme-style/vft-loading.css +1 -1
  69. package/theme-style/vft-logo.css +1 -1
  70. package/theme-style/vft-main.css +1 -1
  71. package/theme-style/vft-md-code-demo.css +1 -1
  72. package/theme-style/vft-md-code-tabs.css +1 -1
  73. package/theme-style/vft-md-comment.css +1 -1
  74. package/theme-style/vft-md-container.css +1 -1
  75. package/theme-style/vft-md-tabs.css +1 -1
  76. package/theme-style/vft-md-vue-playground.css +1 -1
  77. package/theme-style/vft-menu.css +1 -1
  78. package/theme-style/vft-message-box.css +1 -1
  79. package/theme-style/vft-message.css +1 -1
  80. package/theme-style/vft-multiple-tabs.css +1 -1
  81. package/theme-style/vft-notification.css +1 -1
  82. package/theme-style/vft-option-group.css +1 -1
  83. package/theme-style/vft-option-item.css +1 -1
  84. package/theme-style/vft-option.css +1 -1
  85. package/theme-style/vft-overlay.css +1 -1
  86. package/theme-style/vft-page-wrapper.css +1 -1
  87. package/theme-style/vft-pagination.css +1 -1
  88. package/theme-style/vft-popconfirm.css +1 -1
  89. package/theme-style/vft-popover.css +1 -1
  90. package/theme-style/vft-popper.css +1 -1
  91. package/theme-style/vft-progress.css +1 -1
  92. package/theme-style/vft-radio-button.css +1 -1
  93. package/theme-style/vft-radio-group.css +1 -1
  94. package/theme-style/vft-rate.css +1 -1
  95. package/theme-style/vft-result.css +1 -1
  96. package/theme-style/vft-row.css +1 -1
  97. package/theme-style/vft-scrollbar.css +1 -1
  98. package/theme-style/vft-search.css +1 -1
  99. package/theme-style/vft-segmented.css +1 -1
  100. package/theme-style/vft-select-dropdown-v2.css +1 -1
  101. package/theme-style/vft-select-dropdown.css +1 -1
  102. package/theme-style/vft-select.css +1 -1
  103. package/theme-style/vft-side-menu.css +1 -1
  104. package/theme-style/vft-skeleton-item.css +1 -1
  105. package/theme-style/vft-skeleton.css +1 -1
  106. package/theme-style/vft-slider.css +1 -1
  107. package/theme-style/vft-space.css +1 -1
  108. package/theme-style/vft-spinner.css +1 -1
  109. package/theme-style/vft-statistic.css +1 -1
  110. package/theme-style/vft-step.css +1 -1
  111. package/theme-style/vft-steps.css +1 -1
  112. package/theme-style/vft-super-form.css +1 -1
  113. package/theme-style/vft-switch.css +1 -1
  114. package/theme-style/vft-table.css +1 -1
  115. package/theme-style/vft-tabs.css +1 -1
  116. package/theme-style/vft-tag.css +1 -1
  117. package/theme-style/vft-time-picker.css +1 -1
  118. package/theme-style/vft-time-select.css +1 -1
  119. package/theme-style/vft-timeline-item.css +1 -1
  120. package/theme-style/vft-timeline.css +1 -1
  121. package/theme-style/vft-transfer.css +1 -1
  122. package/theme-style/vft-tree-select.css +1 -1
  123. package/theme-style/vft-tree.css +1 -1
  124. package/theme-style/vft-virtual-list.css +1 -1
  125. package/web-types.json +1 -1
@@ -1,37 +1,37 @@
1
- import { defineComponent as Ee, useAttrs as Xe, ref as c, computed as i, watch as I, nextTick as x, onMounted as Ye, createBlock as w, openBlock as r, unref as s, withCtx as v, createElementBlock as m, createCommentVNode as S, withDirectives as W, withModifiers as z, normalizeClass as d, renderSlot as E, createVNode as le, vShow as be, Fragment as se, renderList as oe, createElementVNode as F, toDisplayString as q, normalizeStyle as Ze, createSlots as _e, withKeys as et, vModelText as tt } from "vue";
2
- import { cloneDeep as lt, debounce as st } from "lodash-es";
3
- import { useResizeObserver as ot, useCssVar as at } from "@vueuse/core";
4
- import { focusNode as nt, getSibling as rt } from "../../utils/dom/aria.js";
5
- import { isPromise as it, isClient as ut } from "@vft/utils";
6
- import { debugWarn as ct } from "../../utils/error.js";
1
+ import { defineComponent as Se, useAttrs as Ye, ref as c, computed as i, unref as s, watch as x, nextTick as N, onMounted as Ze, createBlock as E, openBlock as r, withCtx as v, createElementBlock as m, createCommentVNode as P, withDirectives as q, withModifiers as F, normalizeClass as d, renderSlot as V, createVNode as te, vShow as Te, Fragment as le, renderList as se, createElementVNode as z, toDisplayString as U, normalizeStyle as _e, createSlots as et, withKeys as tt, vModelText as lt } from "vue";
2
+ import { cloneDeep as st, debounce as ot } from "lodash-es";
3
+ import { useResizeObserver as at, useCssVar as nt } from "@vueuse/core";
4
+ import { focusNode as rt, getSibling as it } from "../../utils/dom/aria.js";
5
+ import { isPromise as ut, isClient as ct } from "@vft/utils";
6
+ import { debugWarn as pt } from "../../utils/error.js";
7
7
  import "../config-provider/hooks/use-global-config.js";
8
8
  import { EVENT_CODE as h } from "../../constants/aria.js";
9
- import { UPDATE_MODEL_EVENT as pt, CHANGE_EVENT as dt } from "../../constants/event.js";
9
+ import { UPDATE_MODEL_EVENT as dt, CHANGE_EVENT as ft } from "../../constants/event.js";
10
10
  import "../form/index.js";
11
- import { VftCascaderPanel as ft } from "../cascader-panel/index.js";
12
- import { VftInput as vt } from "../input/index.js";
13
- import { VftTooltip as Te } from "../tooltip/index.js";
11
+ import { VftCascaderPanel as vt } from "../cascader-panel/index.js";
12
+ import { VftInput as mt } from "../input/index.js";
13
+ import { VftTooltip as Ee } from "../tooltip/index.js";
14
14
  import { VftScrollbar as we } from "../scrollbar/index.js";
15
- import { VftTag as Ve } from "../tag/index.js";
16
- import { VftIcon as ae } from "../icon/index.js";
17
- import { ClickOutside as mt } from "@vft/directives";
18
- import { useNamespace as $e } from "../../hooks/use-namespace/index.js";
15
+ import { VftTag as $e } from "../tag/index.js";
16
+ import { VftIcon as oe } from "../icon/index.js";
17
+ import { ClickOutside as gt } from "@vft/directives";
18
+ import { useNamespace as Ve } from "../../hooks/use-namespace/index.js";
19
19
  import "../../hooks/use-model-toggle/index.js";
20
20
  import "@popperjs/core";
21
21
  import "../../hooks/use-z-index/index.js";
22
- import { useComposition as gt } from "../../hooks/use-composition/index.js";
23
- import { useEmptyValues as ht } from "../../hooks/use-empty-values/index.js";
24
- import { cascaderEmits as kt, cascaderProps as Ct } from "./cascader.js";
25
- import { useFormItem as yt } from "../form/hooks/use-form-item.js";
26
- import { useFormSize as bt } from "../form/hooks/use-form-common-props.js";
27
- const Tt = { key: 0 }, wt = ["placeholder"], Vt = ["onClick"], $t = "VftCascader", Et = Ee({
28
- name: $t
29
- }), _t = /* @__PURE__ */ Ee({
30
- ...Et,
31
- props: Ct,
32
- emits: kt,
33
- setup(Se, { expose: Ne, emit: Pe }) {
34
- const n = Se, C = Pe, De = {
22
+ import { useComposition as ht } from "../../hooks/use-composition/index.js";
23
+ import { useEmptyValues as kt } from "../../hooks/use-empty-values/index.js";
24
+ import { cascaderEmits as Ct, cascaderProps as yt } from "./cascader.js";
25
+ import { useFormItem as bt } from "../form/hooks/use-form-item.js";
26
+ import { useFormSize as Tt } from "../form/hooks/use-form-common-props.js";
27
+ const Et = { key: 0 }, wt = ["placeholder"], $t = ["onClick"], Vt = "VftCascader", St = Se({
28
+ name: Vt
29
+ }), el = /* @__PURE__ */ Se({
30
+ ...St,
31
+ props: yt,
32
+ emits: Ct,
33
+ setup(Ne, { expose: Pe, emit: De }) {
34
+ const a = Ne, C = De, Ie = {
35
35
  modifiers: [
36
36
  {
37
37
  name: "arrowPosition",
@@ -44,47 +44,51 @@ const Tt = { key: 0 }, wt = ["placeholder"], Vt = ["onClick"], $t = "VftCascader
44
44
  requires: ["arrow"]
45
45
  }
46
46
  ]
47
- }, ne = Xe();
48
- let N = 0, U = 0;
49
- const a = $e("cascader"), G = $e("input"), { form: Ie, formItem: re } = yt(), { valueOnClear: xe } = ht(n), { isComposing: ie, handleComposition: k } = gt({
47
+ }, ae = Ye();
48
+ let D = 0, G = 0;
49
+ const n = Ve("cascader"), j = Ve("input"), { form: xe, formItem: ne } = bt(), { valueOnClear: Fe } = kt(a), { isComposing: re, handleComposition: k } = ht({
50
50
  afterComposition(e) {
51
51
  const t = e.target?.value;
52
- te(t);
52
+ ee(t);
53
53
  }
54
- }), j = c(null), P = c(null), ue = c(null), f = c(null), M = c(null), g = c(!1), J = c(!1), y = c(!1), Q = c(!1), B = c(""), V = c(""), $ = c([]), H = c([]), X = c([]), ze = i(() => ne.style), b = i(() => n.disabled || Ie?.disabled), ce = i(() => n.placeholder ?? "请选择"), Fe = i(
55
- () => V.value || $.value.length > 0 || ie.value ? "" : ce.value
56
- ), K = bt(), pe = i(
57
- () => K.value === "small" ? "small" : "default"
58
- ), T = i(() => !!n.props.multiple), de = i(() => !n.filterable || T.value), fe = i(
59
- () => T.value ? V.value : B.value
60
- ), O = i(
61
- () => f.value?.checkedNodes || []
62
- ), Me = i(() => !n.clearable || b.value || y.value || !J.value ? !1 : !!O.value.length), A = i(() => {
63
- const { showAllLevels: e, separator: t } = n, l = O.value;
54
+ }), A = c(null), S = c(null), ie = c(null), f = c(null), K = c(null), g = c(!1), ue = c(!1), y = c(!1), J = c(!1), B = c(""), w = c(""), $ = c([]), H = c([]), Q = c([]), ze = i(() => ae.style), b = i(() => a.disabled || xe?.disabled), ce = i(() => a.placeholder ?? "请选择"), Ae = i(
55
+ () => w.value || $.value.length > 0 || re.value ? "" : ce.value
56
+ ), M = Tt(), pe = i(
57
+ () => M.value === "small" ? "small" : "default"
58
+ ), T = i(() => !!a.props.multiple), de = i(() => !a.filterable || T.value), fe = i(
59
+ () => T.value ? w.value : B.value
60
+ ), ve = [], O = i(() => {
61
+ const e = f.value;
62
+ if (!e)
63
+ return ve;
64
+ const t = e.checkedNodes, l = s(t);
65
+ return Array.isArray(l) && l.length ? l : ve;
66
+ }), Ke = i(() => !a.clearable || b.value || y.value ? !1 : !!O.value.length), L = i(() => {
67
+ const { showAllLevels: e, separator: t } = a, l = O.value;
64
68
  return l.length ? T.value ? "" : l[0].calcText(e, t) : "";
65
- }), Be = i(() => re?.validateState || ""), ve = i({
69
+ }), Be = i(() => ne?.validateState || ""), me = i({
66
70
  get() {
67
- return lt(n.modelValue);
71
+ return st(a.modelValue);
68
72
  },
69
73
  set(e) {
70
- const t = e ?? xe.value;
71
- C(pt, t), C(dt, t), n.validateEvent && re?.validate("change").catch((l) => ct(l));
74
+ const t = e ?? Fe.value;
75
+ C(dt, t), C(ft, t), a.validateEvent && ne?.validate("change").catch((l) => pt(l));
72
76
  }
73
77
  }), He = i(() => [
74
- a.b(),
75
- a.m(K.value),
76
- a.is("disabled", b.value),
77
- ne.class
78
- ]), Ke = i(() => [G.e("icon"), a.is("reverse", g.value)]), Oe = i(() => a.is("focus", g.value || Q.value)), me = i(() => j.value?.popperRef?.contentRef), p = (e) => {
79
- b.value || (e = e ?? !g.value, e !== g.value && (g.value = e, P.value?.input?.setAttribute("aria-expanded", `${e}`), e ? (D(), x(f.value?.scrollToExpandingNode)) : n.filterable && ee(), C("visibleChange", e)));
80
- }, D = () => {
81
- x(() => {
82
- j.value?.updatePopper();
78
+ n.b(),
79
+ n.m(M.value),
80
+ n.is("disabled", b.value),
81
+ ae.class
82
+ ]), Me = i(() => [j.e("icon"), n.is("reverse", g.value)]), Oe = i(() => n.is("focus", g.value || J.value)), ge = i(() => A.value?.popperRef?.contentRef), p = (e) => {
83
+ b.value || (e = e ?? !g.value, e !== g.value && (g.value = e, S.value?.input?.setAttribute("aria-expanded", `${e}`), e ? (I(), N(f.value?.scrollToExpandingNode)) : a.filterable && _(), C("visibleChange", e)));
84
+ }, I = () => {
85
+ N(() => {
86
+ A.value?.updatePopper();
83
87
  });
84
- }, Y = () => {
88
+ }, X = () => {
85
89
  y.value = !1;
86
- }, Z = (e) => {
87
- const { showAllLevels: t, separator: l } = n;
90
+ }, Y = (e) => {
91
+ const { showAllLevels: t, separator: l } = a;
88
92
  return {
89
93
  node: e,
90
94
  key: e.uid,
@@ -96,12 +100,12 @@ const Tt = { key: 0 }, wt = ["placeholder"], Vt = ["onClick"], $t = "VftCascader
96
100
  }, R = (e) => {
97
101
  const t = e.node;
98
102
  t.doCheck(!1), f.value?.calculateCheckedValue(), C("removeTag", t.valueByOption);
99
- }, Ae = () => {
100
- switch (n.showCheckedStrategy) {
103
+ }, Le = () => {
104
+ switch (a.showCheckedStrategy) {
101
105
  case "child":
102
106
  return O.value;
103
107
  case "parent": {
104
- const e = he(!1), t = e.map((o) => o.value);
108
+ const e = ke(!1), t = e.map((o) => o.value);
105
109
  return e.filter(
106
110
  (o) => !o.parent || !t.includes(o.parent.value)
107
111
  );
@@ -111,57 +115,57 @@ const Tt = { key: 0 }, wt = ["placeholder"], Vt = ["onClick"], $t = "VftCascader
111
115
  }
112
116
  }, Re = () => {
113
117
  if (!T.value) return;
114
- const e = Ae(), t = [], l = [];
115
- if (e.forEach((o) => l.push(Z(o))), H.value = l, e.length) {
116
- e.slice(0, n.maxCollapseTags).forEach((L) => t.push(Z(L)));
117
- const o = e.slice(n.maxCollapseTags), u = o.length;
118
- u && (n.collapseTags ? t.push({
118
+ const e = Le(), t = [], l = [];
119
+ if (e.forEach((o) => l.push(Y(o))), H.value = l, e.length) {
120
+ e.slice(0, a.maxCollapseTags).forEach((W) => t.push(Y(W)));
121
+ const o = e.slice(a.maxCollapseTags), u = o.length;
122
+ u && (a.collapseTags ? t.push({
119
123
  key: -1,
120
124
  text: `+ ${u}`,
121
125
  closable: !1,
122
126
  isCollapseTag: !0
123
- }) : o.forEach((L) => t.push(Z(L))));
127
+ }) : o.forEach((W) => t.push(Y(W))));
124
128
  }
125
129
  $.value = t;
126
- }, ge = () => {
127
- const { filterMethod: e, showAllLevels: t, separator: l } = n, o = f.value?.getFlattedNodes(!n.props.checkStrictly)?.filter((u) => u.isDisabled ? !1 : (u.calcText(t, l), e(u, fe.value)));
130
+ }, he = () => {
131
+ const { filterMethod: e, showAllLevels: t, separator: l } = a, o = f.value?.getFlattedNodes(!a.props.checkStrictly)?.filter((u) => u.isDisabled ? !1 : (u.calcText(t, l), e(u, fe.value)));
128
132
  T.value && ($.value.forEach((u) => {
129
133
  u.hitState = !1;
130
134
  }), H.value.forEach((u) => {
131
135
  u.hitState = !1;
132
- })), y.value = !0, X.value = o, D();
133
- }, Le = () => {
136
+ })), y.value = !0, Q.value = o, I();
137
+ }, We = () => {
134
138
  let e;
135
- y.value && M.value ? e = M.value.$el.querySelector(
136
- `.${a.e("suggestion-item")}`
139
+ y.value && K.value ? e = K.value.$el.querySelector(
140
+ `.${n.e("suggestion-item")}`
137
141
  ) : e = f.value?.$el.querySelector(
138
- `.${a.b("node")}[tabindex="-1"]`
142
+ `.${n.b("node")}[tabindex="-1"]`
139
143
  ), e && (e.focus(), !y.value && e.click());
140
- }, _ = () => {
141
- const e = P.value?.input, t = ue.value, l = M.value?.$el;
142
- if (!(!ut || !e)) {
144
+ }, Z = () => {
145
+ const e = S.value?.input, t = ie.value, l = K.value?.$el;
146
+ if (!(!ct || !e)) {
143
147
  if (l) {
144
148
  const o = l.querySelector(
145
- `.${a.e("suggestion-list")}`
149
+ `.${n.e("suggestion-list")}`
146
150
  );
147
151
  o.style.minWidth = `${e.offsetWidth}px`;
148
152
  }
149
153
  if (t) {
150
- const { offsetHeight: o } = t, u = $.value.length > 0 ? `${Math.max(o, N) - 2}px` : `${N}px`;
151
- e.style.height = u, D();
154
+ const { offsetHeight: o } = t, u = $.value.length > 0 ? `${Math.max(o, D) - 2}px` : `${D}px`;
155
+ e.style.height = u, I();
152
156
  }
153
157
  }
154
- }, he = (e) => f.value?.getCheckedNodes(e), We = (e) => {
155
- D(), C("expandChange", e);
156
- }, qe = (e) => {
157
- if (!ie.value)
158
+ }, ke = (e) => f.value?.getCheckedNodes(e), qe = (e) => {
159
+ I(), C("expandChange", e);
160
+ }, Ue = (e) => {
161
+ if (!re.value)
158
162
  switch (e.code) {
159
163
  case h.enter:
160
164
  case h.numpadEnter:
161
165
  p();
162
166
  break;
163
167
  case h.down:
164
- p(!0), x(Le), e.preventDefault();
168
+ p(!0), N(We), e.preventDefault();
165
169
  break;
166
170
  case h.esc:
167
171
  g.value === !0 && (e.preventDefault(), e.stopPropagation(), p(!1));
@@ -170,26 +174,26 @@ const Tt = { key: 0 }, wt = ["placeholder"], Vt = ["onClick"], $t = "VftCascader
170
174
  p(!1);
171
175
  break;
172
176
  }
173
- }, Ue = () => {
174
- f.value?.clearCheckedNodes(), !g.value && n.filterable && ee(), p(!1), C("clear");
175
- }, ee = () => {
176
- const { value: e } = A;
177
- B.value = e, V.value = e;
178
- }, Ge = (e) => {
177
+ }, Ge = () => {
178
+ f.value?.clearCheckedNodes(), !g.value && a.filterable && _(), p(!1), C("clear");
179
+ }, _ = () => {
180
+ const { value: e } = L;
181
+ B.value = e, w.value = e;
182
+ }, je = (e) => {
179
183
  const { checked: t } = e;
180
184
  T.value ? f.value?.handleCheckChange(e, !t, !1) : (!t && f.value?.handleCheckChange(e, !0, !1), p(!1));
181
- }, je = (e) => {
185
+ }, Je = (e) => {
182
186
  const t = e.target, { code: l } = e;
183
187
  switch (l) {
184
188
  case h.up:
185
189
  case h.down: {
186
190
  e.preventDefault();
187
191
  const o = l === h.up ? -1 : 1;
188
- nt(
189
- rt(
192
+ rt(
193
+ it(
190
194
  t,
191
195
  o,
192
- `.${a.e("suggestion-item")}[tabindex="-1"]`
196
+ `.${n.e("suggestion-item")}[tabindex="-1"]`
193
197
  )
194
198
  );
195
199
  break;
@@ -199,42 +203,44 @@ const Tt = { key: 0 }, wt = ["placeholder"], Vt = ["onClick"], $t = "VftCascader
199
203
  t.click();
200
204
  break;
201
205
  }
202
- }, Je = () => {
206
+ }, Qe = () => {
203
207
  const e = $.value, t = e[e.length - 1];
204
- U = V.value ? 0 : U + 1, !(!t || !U || n.collapseTags && e.length > 1) && (t.hitState ? R(t) : t.hitState = !0);
205
- }, ke = (e) => {
206
- const t = e.target, l = a.e("search-input");
207
- t.className === l && (Q.value = !0), C("focus", e);
208
+ G = w.value ? 0 : G + 1, !(!t || !G || a.collapseTags && e.length > 1) && (t.hitState ? R(t) : t.hitState = !0);
208
209
  }, Ce = (e) => {
209
- Q.value = !1, C("blur", e);
210
- }, Qe = st(() => {
210
+ J.value = !0, C("focus", e);
211
+ }, ye = (e) => {
212
+ N(() => {
213
+ const t = S.value?.$el, l = document.activeElement;
214
+ t?.contains(l) || A.value?.isFocusInsideContent?.(e) || (J.value = !1);
215
+ }), C("blur", e);
216
+ }, Xe = ot(() => {
211
217
  const { value: e } = fe;
212
218
  if (!e) return;
213
- const t = n.beforeFilter(e);
214
- it(t) ? t.then(ge).catch(() => {
215
- }) : t !== !1 ? ge() : Y();
216
- }, n.debounce), te = (e, t) => {
217
- !g.value && p(!0), !t?.isComposing && (e ? Qe() : Y());
218
- }, ye = (e) => Number.parseFloat(
219
- at(G.cssVarName("input-height"), e).value
219
+ const t = a.beforeFilter(e);
220
+ ut(t) ? t.then(he).catch(() => {
221
+ }) : t !== !1 ? he() : X();
222
+ }, a.debounce), ee = (e, t) => {
223
+ !g.value && p(!0), !t?.isComposing && (e ? Xe() : X());
224
+ }, be = (e) => Number.parseFloat(
225
+ nt(j.cssVarName("input-height"), e).value
220
226
  ) - 2;
221
- return I(y, D), I(
222
- [O, b, () => n.collapseTags],
227
+ return x(y, I), x(
228
+ [O, b, () => a.collapseTags],
223
229
  Re
224
- ), I($, () => {
225
- x(() => _());
226
- }), I(K, async () => {
227
- await x();
228
- const e = P.value.input;
229
- N = ye(e) || N, _();
230
- }), I(A, ee, { immediate: !0 }), Ye(() => {
231
- const e = P.value.input, t = ye(e);
232
- N = e.offsetHeight || t, ot(e, _);
233
- }), Ne({
230
+ ), x($, () => {
231
+ N(() => Z());
232
+ }), x(M, async () => {
233
+ await N();
234
+ const e = S.value.input;
235
+ D = be(e) || D, Z();
236
+ }), x(L, _, { immediate: !0 }), Ze(() => {
237
+ const e = S.value.input, t = be(e);
238
+ D = e.offsetHeight || t, at(e, Z);
239
+ }), Pe({
234
240
  /**
235
241
  * @description get an array of currently selected node,(leafOnly) whether only return the leaf checked nodes, default is `false`
236
242
  */
237
- getCheckedNodes: he,
243
+ getCheckedNodes: ke,
238
244
  /**
239
245
  * @description cascader panel ref
240
246
  */
@@ -246,67 +252,67 @@ const Tt = { key: 0 }, wt = ["placeholder"], Vt = ["onClick"], $t = "VftCascader
246
252
  /**
247
253
  * @description cascader content ref
248
254
  */
249
- contentRef: me,
255
+ contentRef: ge,
250
256
  /**
251
257
  * @description selected content text
252
258
  */
253
- presentText: A
254
- }), (e, t) => (r(), w(s(Te), {
259
+ presentText: L
260
+ }), (e, t) => (r(), E(s(Ee), {
255
261
  ref_key: "tooltipRef",
256
- ref: j,
262
+ ref: A,
257
263
  visible: g.value,
258
264
  teleported: e.teleported,
259
- "popper-class": [s(a).e("dropdown"), e.popperClass],
260
- "popper-options": De,
265
+ "popper-class": [s(n).e("dropdown"), e.popperClass],
266
+ "popper-options": Ie,
261
267
  "fallback-placements": e.fallbackPlacements,
262
268
  "stop-popper-mouse-event": !1,
263
269
  "gpu-acceleration": !1,
264
270
  placement: e.placement,
265
- transition: `${s(a).namespace.value}-zoom-in-top`,
271
+ transition: `${s(n).namespace.value}-zoom-in-top`,
266
272
  effect: e.effect,
267
273
  pure: "",
268
274
  persistent: e.persistent,
269
- onHide: Y
275
+ onHide: X
270
276
  }, {
271
277
  default: v(() => [
272
- W((r(), m("div", {
278
+ q((r(), m("div", {
273
279
  class: d(He.value),
274
- style: Ze(ze.value),
280
+ style: _e(ze.value),
275
281
  onClick: t[8] || (t[8] = () => p(de.value ? void 0 : !0)),
276
- onKeydown: qe,
277
- onMouseenter: t[9] || (t[9] = (l) => J.value = !0),
278
- onMouseleave: t[10] || (t[10] = (l) => J.value = !1)
282
+ onKeydown: Ue,
283
+ onMouseenter: t[9] || (t[9] = (l) => ue.value = !0),
284
+ onMouseleave: t[10] || (t[10] = (l) => ue.value = !1)
279
285
  }, [
280
- le(s(vt), {
286
+ te(s(mt), {
281
287
  ref_key: "input",
282
- ref: P,
288
+ ref: S,
283
289
  modelValue: B.value,
284
290
  "onUpdate:modelValue": t[1] || (t[1] = (l) => B.value = l),
285
- placeholder: Fe.value,
291
+ placeholder: Ae.value,
286
292
  readonly: de.value,
287
293
  disabled: b.value,
288
294
  "validate-event": !1,
289
- size: s(K),
295
+ size: s(M),
290
296
  class: d(Oe.value),
291
297
  tabindex: T.value && e.filterable && !b.value ? -1 : void 0,
292
298
  onCompositionstart: s(k),
293
299
  onCompositionupdate: s(k),
294
300
  onCompositionend: s(k),
295
- onFocus: ke,
296
- onBlur: Ce,
297
- onInput: te
298
- }, _e({
301
+ onFocus: Ce,
302
+ onBlur: ye,
303
+ onInput: ee
304
+ }, et({
299
305
  suffix: v(() => [
300
- Me.value ? (r(), w(s(ae), {
306
+ Ke.value ? (r(), E(s(oe), {
301
307
  key: "clear",
302
308
  icon: "icon-circle-close",
303
- class: d(["icon-circle-close", [s(G).e("icon")]]),
304
- onClick: z(Ue, ["stop"])
305
- }, null, 8, ["class"])) : (r(), w(s(ae), {
309
+ class: d(["icon-circle-close", [s(j).e("icon")]]),
310
+ onClick: F(Ge, ["stop"])
311
+ }, null, 8, ["class"])) : (r(), E(s(oe), {
306
312
  icon: "icon-arrow-down",
307
313
  key: "arrow-down",
308
- class: d(Ke.value),
309
- onClick: t[0] || (t[0] = z((l) => p(), ["stop"]))
314
+ class: d(Me.value),
315
+ onClick: t[0] || (t[0] = F((l) => p(), ["stop"]))
310
316
  }, null, 8, ["class"]))
311
317
  ]),
312
318
  _: 2
@@ -314,7 +320,7 @@ const Tt = { key: 0 }, wt = ["placeholder"], Vt = ["onClick"], $t = "VftCascader
314
320
  e.$slots.prefix ? {
315
321
  name: "prefix",
316
322
  fn: v(() => [
317
- E(e.$slots, "prefix")
323
+ V(e.$slots, "prefix")
318
324
  ]),
319
325
  key: "0"
320
326
  } : void 0
@@ -322,17 +328,17 @@ const Tt = { key: 0 }, wt = ["placeholder"], Vt = ["onClick"], $t = "VftCascader
322
328
  T.value ? (r(), m("div", {
323
329
  key: 0,
324
330
  ref_key: "tagWrapper",
325
- ref: ue,
331
+ ref: ie,
326
332
  class: d([
327
- s(a).e("tags"),
328
- s(a).is("validate", !!Be.value)
333
+ s(n).e("tags"),
334
+ s(n).is("validate", !!Be.value)
329
335
  ])
330
336
  }, [
331
- E(e.$slots, "tag", {
337
+ V(e.$slots, "tag", {
332
338
  data: H.value,
333
339
  deleteTag: R
334
340
  }, () => [
335
- (r(!0), m(se, null, oe($.value, (l) => (r(), w(s(Ve), {
341
+ (r(!0), m(le, null, se($.value, (l) => (r(), E(s($e), {
336
342
  key: l.key,
337
343
  type: e.tagType,
338
344
  size: pe.value,
@@ -343,7 +349,7 @@ const Tt = { key: 0 }, wt = ["placeholder"], Vt = ["onClick"], $t = "VftCascader
343
349
  onClose: (o) => R(l)
344
350
  }, {
345
351
  default: v(() => [
346
- l.isCollapseTag === !1 ? (r(), m("span", Tt, q(l.text), 1)) : (r(), w(s(Te), {
352
+ l.isCollapseTag === !1 ? (r(), m("span", Et, U(l.text), 1)) : (r(), E(s(Ee), {
347
353
  key: 1,
348
354
  disabled: g.value || !e.collapseTagsTooltip,
349
355
  "fallback-placements": ["bottom", "top", "right", "left"],
@@ -351,21 +357,21 @@ const Tt = { key: 0 }, wt = ["placeholder"], Vt = ["onClick"], $t = "VftCascader
351
357
  effect: e.effect
352
358
  }, {
353
359
  default: v(() => [
354
- F("span", null, q(l.text), 1)
360
+ z("span", null, U(l.text), 1)
355
361
  ]),
356
362
  content: v(() => [
357
- le(s(we), { "max-height": e.maxCollapseTagsTooltipHeight }, {
363
+ te(s(we), { "max-height": e.maxCollapseTagsTooltipHeight }, {
358
364
  default: v(() => [
359
- F("div", {
360
- class: d(s(a).e("collapse-tags"))
365
+ z("div", {
366
+ class: d(s(n).e("collapse-tags"))
361
367
  }, [
362
- (r(!0), m(se, null, oe(H.value.slice(
368
+ (r(!0), m(le, null, se(H.value.slice(
363
369
  e.maxCollapseTags
364
370
  ), (o, u) => (r(), m("div", {
365
371
  key: u,
366
- class: d(s(a).e("collapse-tag"))
372
+ class: d(s(n).e("collapse-tag"))
367
373
  }, [
368
- (r(), w(s(Ve), {
374
+ (r(), E(s($e), {
369
375
  key: o.key,
370
376
  class: "in-tooltip",
371
377
  type: e.tagType,
@@ -374,10 +380,10 @@ const Tt = { key: 0 }, wt = ["placeholder"], Vt = ["onClick"], $t = "VftCascader
374
380
  hit: o.hitState,
375
381
  closable: o.closable,
376
382
  "disable-transitions": "",
377
- onClose: (L) => R(o)
383
+ onClose: (W) => R(o)
378
384
  }, {
379
385
  default: v(() => [
380
- F("span", null, q(o.text), 1)
386
+ z("span", null, U(o.text), 1)
381
387
  ]),
382
388
  _: 2
383
389
  }, 1032, ["type", "size", "effect", "hit", "closable", "onClose"]))
@@ -393,108 +399,108 @@ const Tt = { key: 0 }, wt = ["placeholder"], Vt = ["onClick"], $t = "VftCascader
393
399
  _: 2
394
400
  }, 1032, ["type", "size", "effect", "hit", "closable", "onClose"]))), 128))
395
401
  ]),
396
- e.filterable && !b.value ? W((r(), m("input", {
402
+ e.filterable && !b.value ? q((r(), m("input", {
397
403
  key: 0,
398
- "onUpdate:modelValue": t[2] || (t[2] = (l) => V.value = l),
404
+ "onUpdate:modelValue": t[2] || (t[2] = (l) => w.value = l),
399
405
  type: "text",
400
- class: d(s(a).e("search-input")),
401
- placeholder: A.value ? "" : ce.value,
402
- onInput: t[3] || (t[3] = (l) => te(V.value, l)),
403
- onClick: t[4] || (t[4] = z((l) => p(!0), ["stop"])),
404
- onKeydown: et(Je, ["delete"]),
406
+ class: d(s(n).e("search-input")),
407
+ placeholder: L.value ? "" : ce.value,
408
+ onInput: t[3] || (t[3] = (l) => ee(w.value, l)),
409
+ onClick: t[4] || (t[4] = F((l) => p(!0), ["stop"])),
410
+ onKeydown: tt(Qe, ["delete"]),
405
411
  onCompositionstart: t[5] || (t[5] = //@ts-ignore
406
412
  (...l) => s(k) && s(k)(...l)),
407
413
  onCompositionupdate: t[6] || (t[6] = //@ts-ignore
408
414
  (...l) => s(k) && s(k)(...l)),
409
415
  onCompositionend: t[7] || (t[7] = //@ts-ignore
410
416
  (...l) => s(k) && s(k)(...l)),
411
- onFocus: ke,
412
- onBlur: Ce
417
+ onFocus: Ce,
418
+ onBlur: ye
413
419
  }, null, 42, wt)), [
414
- [tt, V.value]
415
- ]) : S("", !0)
416
- ], 2)) : S("", !0)
420
+ [lt, w.value]
421
+ ]) : P("", !0)
422
+ ], 2)) : P("", !0)
417
423
  ], 38)), [
418
- [s(mt), () => p(!1), me.value]
424
+ [s(gt), () => p(!1), ge.value]
419
425
  ])
420
426
  ]),
421
427
  content: v(() => [
422
428
  e.$slots.header ? (r(), m("div", {
423
429
  key: 0,
424
- class: d(s(a).e("header")),
425
- onClick: t[11] || (t[11] = z(() => {
430
+ class: d(s(n).e("header")),
431
+ onClick: t[11] || (t[11] = F(() => {
426
432
  }, ["stop"]))
427
433
  }, [
428
- E(e.$slots, "header")
429
- ], 2)) : S("", !0),
430
- W(le(s(ft), {
434
+ V(e.$slots, "header")
435
+ ], 2)) : P("", !0),
436
+ q(te(s(vt), {
431
437
  ref_key: "cascaderPanelRef",
432
438
  ref: f,
433
- modelValue: ve.value,
434
- "onUpdate:modelValue": t[12] || (t[12] = (l) => ve.value = l),
439
+ modelValue: me.value,
440
+ "onUpdate:modelValue": t[12] || (t[12] = (l) => me.value = l),
435
441
  options: e.options,
436
- props: n.props,
442
+ props: a.props,
437
443
  border: !1,
438
444
  "render-label": e.$slots.default,
439
- onExpandChange: We,
445
+ onExpandChange: qe,
440
446
  onClose: t[13] || (t[13] = (l) => e.$nextTick(() => p(!1)))
441
447
  }, {
442
448
  empty: v(() => [
443
- E(e.$slots, "empty")
449
+ V(e.$slots, "empty")
444
450
  ]),
445
451
  _: 3
446
452
  }, 8, ["modelValue", "options", "props", "render-label"]), [
447
- [be, !y.value]
453
+ [Te, !y.value]
448
454
  ]),
449
- e.filterable ? W((r(), w(s(we), {
455
+ e.filterable ? q((r(), E(s(we), {
450
456
  key: 1,
451
457
  ref_key: "suggestionPanel",
452
- ref: M,
458
+ ref: K,
453
459
  tag: "ul",
454
- class: d(s(a).e("suggestion-panel")),
455
- "view-class": s(a).e("suggestion-list"),
456
- onKeydown: je
460
+ class: d(s(n).e("suggestion-panel")),
461
+ "view-class": s(n).e("suggestion-list"),
462
+ onKeydown: Je
457
463
  }, {
458
464
  default: v(() => [
459
- X.value.length ? (r(!0), m(se, { key: 0 }, oe(X.value, (l) => (r(), m("li", {
465
+ Q.value.length ? (r(!0), m(le, { key: 0 }, se(Q.value, (l) => (r(), m("li", {
460
466
  key: l.uid,
461
467
  class: d([
462
- s(a).e("suggestion-item"),
463
- s(a).is("checked", l.checked)
468
+ s(n).e("suggestion-item"),
469
+ s(n).is("checked", l.checked)
464
470
  ]),
465
471
  tabindex: -1,
466
- onClick: (o) => Ge(l)
472
+ onClick: (o) => je(l)
467
473
  }, [
468
- E(e.$slots, "suggestion-item", { item: l }, () => [
469
- F("span", null, q(l.text), 1),
470
- l.checked ? (r(), w(s(ae), {
474
+ V(e.$slots, "suggestion-item", { item: l }, () => [
475
+ z("span", null, U(l.text), 1),
476
+ l.checked ? (r(), E(s(oe), {
471
477
  key: 0,
472
478
  icon: "icon-check"
473
- })) : S("", !0)
479
+ })) : P("", !0)
474
480
  ])
475
- ], 10, Vt))), 128)) : E(e.$slots, "empty", { key: 1 }, () => [
476
- F("li", {
477
- class: d(s(a).e("empty-text"))
481
+ ], 10, $t))), 128)) : V(e.$slots, "empty", { key: 1 }, () => [
482
+ z("li", {
483
+ class: d(s(n).e("empty-text"))
478
484
  }, "无匹配数据", 2)
479
485
  ])
480
486
  ]),
481
487
  _: 3
482
488
  }, 8, ["class", "view-class"])), [
483
- [be, y.value]
484
- ]) : S("", !0),
489
+ [Te, y.value]
490
+ ]) : P("", !0),
485
491
  e.$slots.footer ? (r(), m("div", {
486
492
  key: 2,
487
- class: d(s(a).e("footer")),
488
- onClick: t[14] || (t[14] = z(() => {
493
+ class: d(s(n).e("footer")),
494
+ onClick: t[14] || (t[14] = F(() => {
489
495
  }, ["stop"]))
490
496
  }, [
491
- E(e.$slots, "footer")
492
- ], 2)) : S("", !0)
497
+ V(e.$slots, "footer")
498
+ ], 2)) : P("", !0)
493
499
  ]),
494
500
  _: 3
495
501
  }, 8, ["visible", "teleported", "popper-class", "fallback-placements", "placement", "transition", "effect", "persistent"]));
496
502
  }
497
503
  });
498
504
  export {
499
- _t as default
505
+ el as default
500
506
  };