@vaebe/ccui 2.0.0-beta.0 → 2.0.1-beta.2

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 (83) hide show
  1. package/README.md +4 -0
  2. package/button/index.es.js +28 -22
  3. package/button/index.umd.js +1 -1
  4. package/calendar/index.es.js +445 -90
  5. package/calendar/index.umd.js +1 -1
  6. package/ccui-cli.css +1 -1
  7. package/check-box/index.es.js +8 -2
  8. package/check-box/index.umd.js +1 -1
  9. package/chunk-Ndeg2fpE.js +20 -0
  10. package/collapse/index.es.js +10 -7
  11. package/collapse/index.umd.js +1 -1
  12. package/config-provider/chunk-C_CI6nMA.js +13 -0
  13. package/config-provider/en-BG83iZ_P.js +24 -0
  14. package/config-provider/index.es.js +408 -53
  15. package/config-provider/index.umd.js +1 -1
  16. package/config-provider/ja-B-93MQG5.js +56 -0
  17. package/config-provider/ko-86th3uXt.js +56 -0
  18. package/config-provider/zh-cn-BQE-LNg1.js +59 -0
  19. package/date-picker/ccui-cli.css +1 -1
  20. package/date-picker/index.es.js +664 -482
  21. package/date-picker/index.umd.js +1 -1
  22. package/drawer/index.es.js +271 -279
  23. package/drawer/index.umd.js +1 -1
  24. package/dropdown/index.es.js +187 -171
  25. package/dropdown/index.umd.js +1 -1
  26. package/empty/index.es.js +341 -24
  27. package/empty/index.umd.js +1 -1
  28. package/en-BVwCvuzF.js +24 -0
  29. package/float-button/index.es.js +1134 -46
  30. package/float-button/index.umd.js +1 -1
  31. package/form/index.es.js +1357 -261
  32. package/form/index.umd.js +1 -1
  33. package/icon/index.es.js +93 -10
  34. package/icon/index.umd.js +1 -1
  35. package/image/index.es.js +353 -36
  36. package/image/index.umd.js +1 -1
  37. package/input/index.es.js +24 -15
  38. package/input/index.umd.js +1 -1
  39. package/input-number/index.es.js +45 -25
  40. package/input-number/index.umd.js +1 -1
  41. package/ja-B4U4rt8A.js +56 -0
  42. package/ko-BG35I8uK.js +56 -0
  43. package/menu/index.es.js +3 -1
  44. package/menu/index.umd.js +1 -1
  45. package/message/index.es.js +1179 -86
  46. package/message/index.umd.js +1 -1
  47. package/modal/index.es.js +735 -335
  48. package/modal/index.umd.js +1 -1
  49. package/notification/index.es.js +1176 -83
  50. package/notification/index.umd.js +1 -1
  51. package/package.json +9 -9
  52. package/pagination/index.es.js +381 -60
  53. package/pagination/index.umd.js +1 -1
  54. package/popconfirm/index.es.js +469 -143
  55. package/popconfirm/index.umd.js +1 -1
  56. package/popover/index.es.js +192 -175
  57. package/popover/index.umd.js +1 -1
  58. package/radio/index.es.js +8 -2
  59. package/radio/index.umd.js +1 -1
  60. package/rate/index.es.js +22 -12
  61. package/rate/index.umd.js +1 -1
  62. package/select/index.es.js +135 -53
  63. package/select/index.umd.js +1 -1
  64. package/slider/index.es.js +165 -155
  65. package/slider/index.umd.js +1 -1
  66. package/steps/index.es.js +1140 -49
  67. package/steps/index.umd.js +1 -1
  68. package/switch/index.es.js +2 -0
  69. package/switch/index.umd.js +1 -1
  70. package/tabs/index.es.js +31 -5
  71. package/tabs/index.umd.js +1 -1
  72. package/tag/index.es.js +53 -35
  73. package/tag/index.umd.js +1 -1
  74. package/tooltip/index.es.js +78 -77
  75. package/tooltip/index.umd.js +1 -1
  76. package/tree/ccui-cli.css +1 -1
  77. package/tree/index.es.js +1491 -276
  78. package/tree/index.umd.js +1 -1
  79. package/typography/index.es.js +1213 -125
  80. package/typography/index.umd.js +1 -1
  81. package/vue-ccui.es.js +8726 -7604
  82. package/vue-ccui.umd.js +1 -1
  83. package/zh-cn-C8nbfD5S.js +59 -0
@@ -1,54 +1,54 @@
1
1
  import * as e from "vue";
2
2
  import { Teleport as t, Transition as n, computed as r, createVNode as i, defineComponent as a, getCurrentInstance as o, isVNode as s, mergeProps as c, nextTick as l, onMounted as u, onUnmounted as d, ref as f, watch as p } from "vue";
3
- import { arrow as m, autoUpdate as h, computePosition as g, flip as _, offset as v, shift as y } from "@floating-ui/dom";
3
+ import { arrow as m, autoUpdate as h, computePosition as g, flip as _, offset as ee, shift as v } from "@floating-ui/dom";
4
4
  //#region \0rolldown/runtime.js
5
- var b = Object.defineProperty, x = Object.getOwnPropertyDescriptor, S = Object.getOwnPropertyNames, C = Object.prototype.hasOwnProperty, w = (e, t) => {
5
+ var y = Object.defineProperty, b = Object.getOwnPropertyDescriptor, x = Object.getOwnPropertyNames, S = Object.prototype.hasOwnProperty, C = (e, t) => {
6
6
  let n = {};
7
- for (var r in e) b(n, r, {
7
+ for (var r in e) y(n, r, {
8
8
  get: e[r],
9
9
  enumerable: !0
10
10
  });
11
- return t || b(n, Symbol.toStringTag, { value: "Module" }), n;
12
- }, T = (e, t, n, r) => {
13
- if (t && typeof t == "object" || typeof t == "function") for (var i = S(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !C.call(e, s) && s !== n && b(e, s, {
11
+ return t || y(n, Symbol.toStringTag, { value: "Module" }), n;
12
+ }, w = (e, t, n, r) => {
13
+ if (t && typeof t == "object" || typeof t == "function") for (var i = x(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !S.call(e, s) && s !== n && y(e, s, {
14
14
  get: ((e) => t[e]).bind(null, s),
15
- enumerable: !(r = x(t, s)) || r.enumerable
15
+ enumerable: !(r = b(t, s)) || r.enumerable
16
16
  });
17
17
  return e;
18
- }, E = (e, t, n) => (T(e, t, "default"), n && T(n, t, "default"));
18
+ }, T = (e, t, n) => (w(e, t, "default"), n && w(n, t, "default"));
19
19
  //#endregion
20
20
  //#region ../../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
21
- function D() {
21
+ function E() {
22
22
  return typeof window < "u";
23
23
  }
24
- function O(e) {
25
- return A(e) ? (e.nodeName || "").toLowerCase() : "#document";
24
+ function D(e) {
25
+ return k(e) ? (e.nodeName || "").toLowerCase() : "#document";
26
26
  }
27
- function k(e) {
27
+ function O(e) {
28
28
  var t;
29
29
  return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
30
30
  }
31
- function A(e) {
32
- return D() ? e instanceof Node || e instanceof k(e).Node : !1;
31
+ function k(e) {
32
+ return E() ? e instanceof Node || e instanceof O(e).Node : !1;
33
33
  }
34
34
  //#endregion
35
35
  //#region ../../node_modules/.pnpm/vue-demi@0.14.10_vue@3.5.33_typescript@5.9.3_/node_modules/vue-demi/lib/index.mjs
36
- var j = /* @__PURE__ */ w({
36
+ var A = /* @__PURE__ */ C({
37
37
  Vue: () => e,
38
38
  Vue2: () => void 0,
39
- del: () => ee,
40
- install: () => N,
39
+ del: () => P,
40
+ install: () => M,
41
41
  isVue2: () => !1,
42
42
  isVue3: () => !0,
43
- set: () => P
43
+ set: () => N
44
44
  });
45
- import * as M from "vue";
46
- E(j, M);
47
- function N() {}
48
- function P(e, t, n) {
45
+ import * as j from "vue";
46
+ T(A, j);
47
+ function M() {}
48
+ function N(e, t, n) {
49
49
  return Array.isArray(e) ? (e.length = Math.max(e.length, t), e.splice(t, 1, n), n) : (e[t] = n, n);
50
50
  }
51
- function ee(e, t) {
51
+ function P(e, t) {
52
52
  if (Array.isArray(e)) {
53
53
  e.splice(t, 1);
54
54
  return;
@@ -57,25 +57,25 @@ function ee(e, t) {
57
57
  }
58
58
  //#endregion
59
59
  //#region ../../node_modules/.pnpm/@floating-ui+vue@1.1.9_vue@3.5.33_typescript@5.9.3_/node_modules/@floating-ui/vue/dist/floating-ui.vue.mjs
60
- function te(e) {
60
+ function F(e) {
61
61
  return typeof e == "object" && !!e && "$el" in e;
62
62
  }
63
- function F(e) {
64
- if (te(e)) {
63
+ function I(e) {
64
+ if (F(e)) {
65
65
  let t = e.$el;
66
- return A(t) && O(t) === "#comment" ? null : t;
66
+ return k(t) && D(t) === "#comment" ? null : t;
67
67
  }
68
68
  return e;
69
69
  }
70
- function I(e) {
71
- return typeof e == "function" ? e() : (0, j.unref)(e);
70
+ function L(e) {
71
+ return typeof e == "function" ? e() : (0, A.unref)(e);
72
72
  }
73
- function ne(e) {
73
+ function te(e) {
74
74
  return {
75
75
  name: "arrow",
76
76
  options: e,
77
77
  fn(t) {
78
- let n = F(I(e.element));
78
+ let n = I(L(e.element));
79
79
  return n == null ? {} : m({
80
80
  element: n,
81
81
  padding: e.padding
@@ -83,34 +83,34 @@ function ne(e) {
83
83
  }
84
84
  };
85
85
  }
86
- function L(e) {
86
+ function R(e) {
87
87
  return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
88
88
  }
89
- function R(e, t) {
90
- let n = L(e);
89
+ function z(e, t) {
90
+ let n = R(e);
91
91
  return Math.round(t * n) / n;
92
92
  }
93
- function re(e, t, n) {
93
+ function ne(e, t, n) {
94
94
  n === void 0 && (n = {});
95
- let r = n.whileElementsMounted, i = (0, j.computed)(() => I(n.open) ?? !0), a = (0, j.computed)(() => I(n.middleware)), o = (0, j.computed)(() => I(n.placement) ?? "bottom"), s = (0, j.computed)(() => I(n.strategy) ?? "absolute"), c = (0, j.computed)(() => I(n.transform) ?? !0), l = (0, j.computed)(() => F(e.value)), u = (0, j.computed)(() => F(t.value)), d = (0, j.ref)(0), f = (0, j.ref)(0), p = (0, j.ref)(s.value), m = (0, j.ref)(o.value), h = (0, j.shallowRef)({}), _ = (0, j.ref)(!1), v = (0, j.computed)(() => {
95
+ let r = n.whileElementsMounted, i = (0, A.computed)(() => L(n.open) ?? !0), a = (0, A.computed)(() => L(n.middleware)), o = (0, A.computed)(() => L(n.placement) ?? "bottom"), s = (0, A.computed)(() => L(n.strategy) ?? "absolute"), c = (0, A.computed)(() => L(n.transform) ?? !0), l = (0, A.computed)(() => I(e.value)), u = (0, A.computed)(() => I(t.value)), d = (0, A.ref)(0), f = (0, A.ref)(0), p = (0, A.ref)(s.value), m = (0, A.ref)(o.value), h = (0, A.shallowRef)({}), _ = (0, A.ref)(!1), ee = (0, A.computed)(() => {
96
96
  let e = {
97
97
  position: p.value,
98
98
  left: "0",
99
99
  top: "0"
100
100
  };
101
101
  if (!u.value) return e;
102
- let t = R(u.value, d.value), n = R(u.value, f.value);
102
+ let t = z(u.value, d.value), n = z(u.value, f.value);
103
103
  return c.value ? {
104
104
  ...e,
105
105
  transform: "translate(" + t + "px, " + n + "px)",
106
- ...L(u.value) >= 1.5 && { willChange: "transform" }
106
+ ...R(u.value) >= 1.5 && { willChange: "transform" }
107
107
  } : {
108
108
  position: p.value,
109
109
  left: t + "px",
110
110
  top: n + "px"
111
111
  };
112
- }), y;
113
- function b() {
112
+ }), v;
113
+ function y() {
114
114
  if (l.value == null || u.value == null) return;
115
115
  let e = i.value;
116
116
  g(l.value, u.value, {
@@ -121,67 +121,73 @@ function re(e, t, n) {
121
121
  d.value = t.x, f.value = t.y, p.value = t.strategy, m.value = t.placement, h.value = t.middlewareData, _.value = e !== !1;
122
122
  });
123
123
  }
124
- function x() {
125
- typeof y == "function" && (y(), y = void 0);
124
+ function b() {
125
+ typeof v == "function" && (v(), v = void 0);
126
126
  }
127
- function S() {
128
- if (x(), r === void 0) {
129
- b();
127
+ function x() {
128
+ if (b(), r === void 0) {
129
+ y();
130
130
  return;
131
131
  }
132
132
  if (l.value != null && u.value != null) {
133
- y = r(l.value, u.value, b);
133
+ v = r(l.value, u.value, y);
134
134
  return;
135
135
  }
136
136
  }
137
- function C() {
137
+ function S() {
138
138
  i.value || (_.value = !1);
139
139
  }
140
- return (0, j.watch)([
140
+ return (0, A.watch)([
141
141
  a,
142
142
  o,
143
143
  s,
144
144
  i
145
- ], b, { flush: "sync" }), (0, j.watch)([l, u], S, { flush: "sync" }), (0, j.watch)(i, C, { flush: "sync" }), (0, j.getCurrentScope)() && (0, j.onScopeDispose)(x), {
146
- x: (0, j.shallowReadonly)(d),
147
- y: (0, j.shallowReadonly)(f),
148
- strategy: (0, j.shallowReadonly)(p),
149
- placement: (0, j.shallowReadonly)(m),
150
- middlewareData: (0, j.shallowReadonly)(h),
151
- isPositioned: (0, j.shallowReadonly)(_),
152
- floatingStyles: v,
153
- update: b
145
+ ], y, { flush: "sync" }), (0, A.watch)([l, u], x, { flush: "sync" }), (0, A.watch)(i, S, { flush: "sync" }), (0, A.getCurrentScope)() && (0, A.onScopeDispose)(b), {
146
+ x: (0, A.shallowReadonly)(d),
147
+ y: (0, A.shallowReadonly)(f),
148
+ strategy: (0, A.shallowReadonly)(p),
149
+ placement: (0, A.shallowReadonly)(m),
150
+ middlewareData: (0, A.shallowReadonly)(h),
151
+ isPositioned: (0, A.shallowReadonly)(_),
152
+ floatingStyles: ee,
153
+ update: y
154
154
  };
155
155
  }
156
156
  //#endregion
157
- //#region ../ccui/ui/shared/hooks/use-deprecation-warning.ts
158
- var z = /* @__PURE__ */ new Set();
159
- function B(e, t, n) {
160
- let r = `${e}.${t}`;
161
- z.has(r) || (z.add(r), typeof console < "u" && console.warn(`[ccui][${e}] ${t} 已 deprecated,请改用 ${n}。`));
157
+ //#region ../ccui/ui/shared/utils/deprecated.ts
158
+ var B = /* @__PURE__ */ new Set();
159
+ function re() {
160
+ return globalThis.process?.env?.NODE_ENV !== "production";
162
161
  }
163
162
  function V(e, t, n) {
163
+ if (!re()) return;
164
+ let r = n ? `${n}.${e}` : e;
165
+ if (B.has(r) || (B.add(r), typeof console > "u")) return;
166
+ let i = n ? `[ccui][${n}]` : "[ccui]", a = t ? `,请改用 ${t}` : "";
167
+ console.warn(`${i} ${e} 已 deprecated${a}。`);
168
+ }
169
+ function H(e, t, n) {
164
170
  return e ? Object.prototype.hasOwnProperty.call(e, t) || Object.prototype.hasOwnProperty.call(e, n) : !1;
165
171
  }
166
172
  //#endregion
167
173
  //#region ../ccui/ui/shared/hooks/use-namespace.ts
168
- function H(e, t, n) {
174
+ function U(e, t, n) {
169
175
  let r = e;
170
176
  return t && (r += `__${t}`), n && (r += `--${n}`), r;
171
177
  }
172
- function U(e, t = !1) {
178
+ function W(e, t = !1) {
173
179
  let n = t ? `.ccui-${e}` : `ccui-${e}`;
174
180
  return {
175
- b: () => H(n),
176
- e: (e) => e ? H(n, e) : "",
177
- m: (e) => e ? H(n, "", e) : "",
178
- em: (e, t) => e && t ? H(n, e, t) : "",
181
+ b: () => U(n),
182
+ e: (e) => e ? U(n, e) : "",
183
+ m: (e) => e ? U(n, "", e) : "",
184
+ em: (e, t) => e && t ? U(n, e, t) : "",
179
185
  is: (e) => `is-${e}`
180
186
  };
181
187
  }
182
188
  //#endregion
183
189
  //#region ../ccui/ui/popover/src/popover-types.ts
184
- var W = {
190
+ var G = {
185
191
  title: {
186
192
  type: String,
187
193
  default: ""
@@ -202,10 +208,6 @@ var W = {
202
208
  type: Boolean,
203
209
  default: void 0
204
210
  },
205
- open: {
206
- type: Boolean,
207
- default: void 0
208
- },
209
211
  color: {
210
212
  type: String,
211
213
  default: ""
@@ -329,51 +331,58 @@ var W = {
329
331
  triggerKeys: {
330
332
  type: Array,
331
333
  default: () => ["Enter", " "]
334
+ },
335
+ role: {
336
+ type: String,
337
+ default: "dialog"
338
+ },
339
+ ariaHasPopup: {
340
+ type: String,
341
+ default: "dialog"
332
342
  }
333
343
  };
334
344
  //#endregion
335
345
  //#region ../ccui/ui/popover/src/popover.tsx
336
- function G(e) {
346
+ function K(e) {
337
347
  return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !s(e);
338
348
  }
339
349
  function ie(e) {
340
350
  return typeof e == "object" && !!e && !Array.isArray(e);
341
351
  }
342
- var ae = 0, K = /* @__PURE__ */ a({
352
+ var ae = 0, q = /* @__PURE__ */ a({
343
353
  name: "CPopover",
344
- props: W,
354
+ props: G,
345
355
  emits: [
346
356
  "before-show",
347
357
  "show",
348
358
  "before-hide",
349
359
  "hide",
350
360
  "update:visible",
351
- "update:open",
352
361
  "before-enter",
353
362
  "after-enter",
354
363
  "before-leave",
355
364
  "after-leave"
356
365
  ],
357
366
  setup(e, { emit: a, slots: s, expose: m }) {
358
- let g = U("popover"), b = `${g.e("popper")}-${++ae}`, x = o()?.vnode.props;
359
- V(x, "visible", "visible") && B("Popover", "visible", "open(v-model:open)"), V(x, "showArrow", "show-arrow") && B("Popover", "showArrow", "arrow"), V(x, "showAfter", "show-after") && B("Popover", "showAfter", "mouseEnterDelay"), V(x, "hideAfter", "hide-after") && B("Popover", "hideAfter", "mouseLeaveDelay"), V(x, "popperClass", "popper-class") && B("Popover", "popperClass", "overlayClassName"), V(x, "teleported", "teleported") && B("Popover", "teleported", "getPopupContainer");
360
- let S = f(!1), C = f(), w = f(), T = f(), E = f(), D = f(), O = f(), k = r(() => e.open === void 0 ? e.visible : e.open), A = r(() => k.value !== void 0), j = r(() => !!(A.value ? k.value : S.value)), M = r(() => e.mouseEnterDelay === void 0 ? e.showAfter : e.mouseEnterDelay), N = r(() => e.mouseLeaveDelay === void 0 ? e.hideAfter : e.mouseLeaveDelay), P = r(() => e.arrow === void 0 ? e.showArrow : typeof e.arrow == "boolean" ? e.arrow : !0), ee = r(() => ie(e.arrow) ? !!e.arrow.pointAtCenter : !1), te = r(() => e.overlayClassName || e.popperClass), F = r(() => e.color ? { backgroundColor: e.color } : {}), I = r(() => e.virtualTriggering && e.virtualRef ? e.virtualRef : C.value), L = r(() => [
367
+ let g = W("popover"), y = `${g.e("popper")}-${++ae}`, b = `${y}-title`, x = r(() => !!s.title || !!e.title), S = o()?.vnode.props;
368
+ H(S, "showArrow", "show-arrow") && V("showArrow", "arrow", "Popover"), H(S, "showAfter", "show-after") && V("showAfter", "mouseEnterDelay", "Popover"), H(S, "hideAfter", "hide-after") && V("hideAfter", "mouseLeaveDelay", "Popover"), H(S, "popperClass", "popper-class") && V("popperClass", "overlayClassName", "Popover"), H(S, "teleported", "teleported") && V("teleported", "getPopupContainer", "Popover");
369
+ let C = f(!1), w = f(), T = f(), E = f(), D = f(), O = f(), k = f(), A = r(() => e.visible), j = r(() => A.value !== void 0), M = r(() => !!(j.value ? A.value : C.value)), N = r(() => e.mouseEnterDelay === void 0 ? e.showAfter : e.mouseEnterDelay), P = r(() => e.mouseLeaveDelay === void 0 ? e.hideAfter : e.mouseLeaveDelay), F = r(() => e.arrow === void 0 ? e.showArrow : typeof e.arrow == "boolean" ? e.arrow : !0), I = r(() => ie(e.arrow) ? !!e.arrow.pointAtCenter : !1), L = r(() => e.overlayClassName || e.popperClass), R = r(() => e.color ? { backgroundColor: e.color } : {}), z = r(() => e.virtualTriggering && e.virtualRef ? e.virtualRef : w.value), B = r(() => [
361
370
  g.e("popper"),
362
371
  g.em("popper", e.effect),
363
372
  g.em("popper", e.placement.split("-")[0]),
364
- ee.value && g.em("popper", "arrow-center"),
365
- te.value
366
- ].filter(Boolean).join(" ")), { floatingStyles: R, middlewareData: z, update: H } = re(r(() => I.value), w, {
373
+ I.value && g.em("popper", "arrow-center"),
374
+ L.value
375
+ ].filter(Boolean).join(" ")), { floatingStyles: re, middlewareData: U, update: G } = ne(r(() => z.value), T, {
367
376
  placement: e.placement,
368
377
  middleware: [
369
- v(e.offset),
378
+ ee(e.offset),
370
379
  ...e.autoAdjustOverflow ? [_()] : [],
371
- y({ padding: 8 }),
372
- ...P.value ? [ne({ element: T })] : []
380
+ v({ padding: 8 }),
381
+ ...F.value ? [te({ element: E })] : []
373
382
  ]
374
- }), W = r(() => {
375
- if (!P.value || !z.value.arrow) return {};
376
- let { x: t, y: n } = z.value.arrow, r = {
383
+ }), q = r(() => {
384
+ if (!F.value || !U.value.arrow) return {};
385
+ let { x: t, y: n } = U.value.arrow, r = {
377
386
  top: "bottom",
378
387
  right: "left",
379
388
  bottom: "top",
@@ -386,118 +395,126 @@ var ae = 0, K = /* @__PURE__ */ a({
386
395
  bottom: "",
387
396
  [r]: "-4px"
388
397
  };
389
- }), K = () => {
390
- E.value &&= (clearTimeout(E.value), void 0), D.value &&= (clearTimeout(D.value), void 0), O.value &&= (clearTimeout(O.value), void 0);
391
- }, q = () => {
392
- K();
398
+ }), J = () => {
399
+ D.value &&= (clearTimeout(D.value), void 0), O.value &&= (clearTimeout(O.value), void 0), k.value &&= (clearTimeout(k.value), void 0);
400
+ }, Y = () => {
401
+ J();
393
402
  let t = () => {
394
- a("before-hide"), A.value || (S.value = !1), a("update:visible", !1), a("update:open", !1), a("hide");
403
+ a("before-hide"), j.value || (C.value = !1), a("update:visible", !1), a("hide");
395
404
  };
396
- N.value > 0 && e.trigger !== "click" ? D.value = window.setTimeout(t, N.value) : t();
397
- }, J = () => {
405
+ P.value > 0 && e.trigger !== "click" ? O.value = window.setTimeout(t, P.value) : t();
406
+ }, X = () => {
398
407
  if (e.disabled) return;
399
- K();
408
+ J();
400
409
  let t = () => {
401
- a("before-show"), A.value || (S.value = !0), a("update:visible", !0), a("update:open", !0), l(() => {
402
- H(), a("show"), e.autoClose > 0 && (O.value = window.setTimeout(() => {
403
- q();
410
+ a("before-show"), j.value || (C.value = !0), a("update:visible", !0), l(() => {
411
+ G(), a("show"), e.autoClose > 0 && (k.value = window.setTimeout(() => {
412
+ Y();
404
413
  }, e.autoClose));
405
414
  });
406
415
  };
407
- M.value > 0 ? E.value = window.setTimeout(t, M.value) : t();
408
- }, Y = () => {
409
- e.trigger === "hover" && J();
410
- }, X = () => {
411
- e.trigger === "hover" && q();
416
+ N.value > 0 ? D.value = window.setTimeout(t, N.value) : t();
412
417
  }, oe = () => {
413
- e.trigger === "click" && (j.value ? q() : J());
414
- }, se = (t) => {
415
- e.trigger === "contextmenu" && (t.preventDefault(), j.value ? q() : J());
418
+ e.trigger === "hover" && X();
419
+ }, se = () => {
420
+ e.trigger === "hover" && Y();
416
421
  }, ce = () => {
417
- e.trigger === "focus" && J();
418
- }, le = () => {
419
- e.trigger === "focus" && q();
420
- }, ue = (e) => {
422
+ e.trigger === "click" && (M.value ? Y() : X());
423
+ }, le = (t) => {
424
+ e.trigger === "contextmenu" && (t.preventDefault(), M.value ? Y() : X());
425
+ }, ue = () => {
426
+ e.trigger === "focus" && X();
427
+ }, de = () => {
428
+ e.trigger === "focus" && Y();
429
+ }, fe = (e) => {
421
430
  if (!e) return e;
422
431
  let t = e.toLowerCase();
423
432
  return e === " " || t === "space" || t === "spacebar" ? "Space" : e;
424
- }, de = (t) => {
433
+ }, pe = (t) => {
425
434
  if (e.trigger !== "focus") return;
426
- let n = ue(t.key);
427
- e.triggerKeys.map(ue).includes(n) && (t.preventDefault(), j.value ? q() : J());
428
- }, fe = () => {
429
- e.trigger === "hover" && e.enterable && K();
430
- }, pe = () => {
431
- e.trigger === "hover" && e.enterable && q();
432
- }, me = r(() => [g.b(), e.disabled ? g.m("disabled") : ""].filter(Boolean).join(" ")), Z = (t) => {
433
- if (!j.value || e.trigger === "manual" || !e.hideOnClickOutside) return;
434
- let n = t.target, r = n instanceof Node ? n : null, i = e.virtualTriggering && e.virtualRef ? e.virtualRef : C.value, a = !!(r && i && i.contains(r)), o = !!(r && w.value && w.value.contains(r));
435
- !a && !o && q();
435
+ let n = fe(t.key);
436
+ e.triggerKeys.map(fe).includes(n) && (t.preventDefault(), M.value ? Y() : X());
437
+ }, me = () => {
438
+ e.trigger === "hover" && e.enterable && J();
439
+ }, he = () => {
440
+ e.trigger === "hover" && e.enterable && Y();
441
+ }, ge = r(() => [g.b(), e.disabled ? g.m("disabled") : ""].filter(Boolean).join(" ")), Z = (t) => {
442
+ if (!M.value || e.trigger === "manual" || !e.hideOnClickOutside) return;
443
+ let n = t.target, r = n instanceof Node ? n : null, i = e.virtualTriggering && e.virtualRef ? e.virtualRef : w.value, a = !!(r && i && i.contains(r)), o = !!(r && T.value && T.value.contains(r));
444
+ !a && !o && Y();
436
445
  }, Q = (t) => {
437
- j.value && e.trigger !== "manual" && e.closeOnEsc && t.key === "Escape" && q();
446
+ M.value && e.trigger !== "manual" && e.closeOnEsc && t.key === "Escape" && Y();
438
447
  }, $;
439
448
  u(() => {
440
449
  e.visible && l(() => {
441
- let e = I.value;
442
- e && w.value && ($ = h(e, w.value, H)), window.addEventListener("mousedown", Z, !0), window.addEventListener("keydown", Q, !0);
450
+ let e = z.value;
451
+ e && T.value && ($ = h(e, T.value, G)), window.addEventListener("mousedown", Z, !0), window.addEventListener("keydown", Q, !0);
443
452
  });
444
453
  }), d(() => {
445
- if (K(), $?.(), window.removeEventListener("mousedown", Z, !0), window.removeEventListener("keydown", Q, !0), e.virtualTriggering && e.virtualRef) {
454
+ if (J(), $?.(), window.removeEventListener("mousedown", Z, !0), window.removeEventListener("keydown", Q, !0), e.virtualTriggering && e.virtualRef) {
446
455
  let t = e.virtualRef;
447
- t.removeEventListener("mouseenter", Y), t.removeEventListener("mouseleave", X), t.removeEventListener("click", oe), t.removeEventListener("focus", ce), t.removeEventListener("blur", le), t.removeEventListener("keydown", de), t.removeEventListener("contextmenu", se);
456
+ t.removeEventListener("mouseenter", oe), t.removeEventListener("mouseleave", se), t.removeEventListener("click", ce), t.removeEventListener("focus", ue), t.removeEventListener("blur", de), t.removeEventListener("keydown", pe), t.removeEventListener("contextmenu", le);
448
457
  }
449
- }), p(k, (e) => {
450
- if (A.value) {
458
+ }), p(A, (e) => {
459
+ if (j.value) {
451
460
  let t = !!e;
452
- t !== S.value && (S.value = t, t && l(() => H()));
461
+ t !== C.value && (C.value = t, t && l(() => G()));
453
462
  }
454
- }), p(j, (e) => {
463
+ }), p(M, (e) => {
455
464
  if (e) {
456
- let e = I.value;
457
- e && w.value && ($?.(), $ = h(e, w.value, H)), window.addEventListener("mousedown", Z, !0), window.addEventListener("keydown", Q, !0);
465
+ let e = z.value;
466
+ e && T.value && ($?.(), $ = h(e, T.value, G)), window.addEventListener("mousedown", Z, !0), window.addEventListener("keydown", Q, !0);
458
467
  } else $?.(), window.removeEventListener("mousedown", Z, !0), window.removeEventListener("keydown", Q, !0);
459
468
  });
460
- let he = () => P.value ? i("div", {
461
- ref: T,
469
+ let _e = () => F.value ? i("div", {
470
+ ref: E,
462
471
  class: [g.e("arrow"), g.em("arrow", e.placement.split("-")[0])].join(" "),
463
- style: W.value
464
- }, null) : null, ge = () => {
472
+ style: q.value
473
+ }, null) : null, ve = () => {
465
474
  let t = !!s.title, n = !!e.title;
466
- return !t && !n ? null : i("div", { class: g.e("header") }, [s.title ? s.title() : e.title]);
467
- }, _e = () => e.rawContent ? i("div", { innerHTML: e.content }, null) : s.content ? s.content() : e.content;
468
- return m({ hide: q }), () => {
475
+ return !t && !n ? null : i("div", {
476
+ class: g.e("header"),
477
+ id: b
478
+ }, [s.title ? s.title() : e.title]);
479
+ }, ye = () => e.rawContent ? i("div", { innerHTML: e.content }, null) : s.content ? s.content() : e.content;
480
+ return m({ hide: Y }), () => {
469
481
  let r = {};
470
- e.virtualTriggering || (e.trigger === "hover" ? (r.onMouseenter = Y, r.onMouseleave = X) : e.trigger === "click" ? r.onClick = oe : e.trigger === "focus" ? (r.onFocus = ce, r.onBlur = le, r.onKeydown = de) : e.trigger === "contextmenu" && (r.onContextmenu = se));
482
+ e.virtualTriggering || (e.trigger === "hover" ? (r.onMouseenter = oe, r.onMouseleave = se) : e.trigger === "click" ? r.onClick = ce : e.trigger === "focus" ? (r.onFocus = ue, r.onBlur = de, r.onKeydown = pe) : e.trigger === "contextmenu" && (r.onContextmenu = le));
471
483
  let o = i("div", {
472
- ref: w,
473
- class: L.value,
474
- role: "dialog",
475
- id: b,
484
+ ref: T,
485
+ class: B.value,
486
+ role: e.role,
487
+ id: y,
488
+ "aria-labelledby": x.value ? b : void 0,
489
+ "aria-label": !x.value && e.ariaLabel ? e.ariaLabel : void 0,
476
490
  style: {
491
+ ...re.value,
477
492
  ...R.value,
478
- ...F.value,
479
493
  zIndex: 2e3,
480
494
  pointerEvents: e.enterable ? "auto" : "none",
481
495
  width: e.width || void 0
482
496
  },
483
- onMouseenter: fe,
484
- onMouseleave: pe
497
+ onMouseenter: me,
498
+ onMouseleave: he
485
499
  }, [
486
- he(),
487
- ge(),
488
- i("div", { class: g.e("content") }, [_e()])
500
+ _e(),
501
+ ve(),
502
+ i("div", { class: g.e("content") }, [ye()])
489
503
  ]), l = () => {
490
504
  if (e.getPopupContainer) {
491
- let n = e.getPopupContainer(C.value ?? null);
492
- return n ? i(t, { to: n }, G(o) ? o : { default: () => [o] }) : o;
505
+ let n = e.getPopupContainer(w.value ?? null);
506
+ return n ? i(t, { to: n }, K(o) ? o : { default: () => [o] }) : o;
493
507
  }
494
- return e.teleported ? i(t, { to: "body" }, G(o) ? o : { default: () => [o] }) : o;
508
+ return e.teleported ? i(t, { to: "body" }, K(o) ? o : { default: () => [o] }) : o;
495
509
  };
496
- return i("div", { class: me.value }, [
510
+ return i("div", { class: ge.value }, [
497
511
  !e.virtualTriggering && i("div", c({
498
- ref: C,
512
+ ref: w,
499
513
  class: g.e("trigger"),
500
- "aria-describedby": j.value ? b : void 0,
514
+ "aria-describedby": M.value ? y : void 0,
515
+ "aria-haspopup": e.ariaHasPopup,
516
+ "aria-expanded": M.value ? "true" : "false",
517
+ "aria-controls": M.value ? y : void 0,
501
518
  "aria-label": e.ariaLabel,
502
519
  tabindex: e.trigger === "focus" ? e.tabindex : void 0
503
520
  }, r), [s.default?.()]),
@@ -508,11 +525,11 @@ var ae = 0, K = /* @__PURE__ */ a({
508
525
  onAfterEnter: () => a("after-enter"),
509
526
  onBeforeLeave: () => a("before-leave"),
510
527
  onAfterLeave: () => a("after-leave")
511
- }, { default: () => [j.value && l()] })
528
+ }, { default: () => [M.value && l()] })
512
529
  ]);
513
530
  };
514
531
  }
515
- }), q = /* @__PURE__ */ a({
532
+ }), J = /* @__PURE__ */ a({
516
533
  name: "CDropdown",
517
534
  props: {
518
535
  items: {
@@ -550,14 +567,14 @@ var ae = 0, K = /* @__PURE__ */ a({
550
567
  "visible-change"
551
568
  ],
552
569
  setup(e, { emit: t, slots: n }) {
553
- let a = U("dropdown"), o = f(null), s = f(!1), c = r(() => e.visible !== void 0), l = r(() => c.value ? e.visible : s.value);
570
+ let a = W("dropdown"), o = f(null), s = f(!1), c = r(() => e.visible !== void 0), l = r(() => c.value ? e.visible : s.value);
554
571
  p(() => e.visible, (e) => {
555
572
  e !== void 0 && (s.value = !!e);
556
573
  });
557
574
  let u = (n) => {
558
575
  n.disabled || (t("select", n), e.hideOnClick && (c.value || (s.value = !1), t("update:visible", !1), t("visible-change", !1), o.value?.hide?.()));
559
576
  };
560
- return () => i(K, {
577
+ return () => i(q, {
561
578
  ref: o,
562
579
  trigger: e.trigger,
563
580
  placement: e.placement,
@@ -567,15 +584,14 @@ var ae = 0, K = /* @__PURE__ */ a({
567
584
  offset: 4,
568
585
  popperClass: a.b(),
569
586
  width: e.width,
587
+ role: "menu",
588
+ ariaHasPopup: "menu",
570
589
  "onUpdate:visible": (e) => {
571
590
  c.value || (s.value = e), t("update:visible", e), t("visible-change", e);
572
591
  }
573
592
  }, {
574
593
  default: () => n.default?.(),
575
- content: () => i("ul", {
576
- class: a.e("menu"),
577
- role: "menu"
578
- }, [n.menu ? n.menu({ select: u }) : e.items.map((e) => i("li", {
594
+ content: () => i("ul", { class: a.e("menu") }, [n.menu ? n.menu({ select: u }) : e.items.map((e) => i("li", {
579
595
  key: e.key,
580
596
  class: [
581
597
  a.e("item"),
@@ -591,16 +607,16 @@ var ae = 0, K = /* @__PURE__ */ a({
591
607
  });
592
608
  //#endregion
593
609
  //#region ../ccui/ui/dropdown/index.ts
594
- q.install = function(e) {
595
- e.component(q.name, q);
610
+ J.install = function(e) {
611
+ e.component(J.name, J);
596
612
  };
597
- var J = {
613
+ var Y = {
598
614
  title: "Dropdown 下拉菜单",
599
615
  category: "导航",
600
616
  status: "100%",
601
617
  install(e) {
602
- e.component(q.name, q);
618
+ e.component(J.name, J);
603
619
  }
604
620
  };
605
621
  //#endregion
606
- export { q as Dropdown, J as default };
622
+ export { J as Dropdown, Y as default };