@vaebe/ccui 2.0.0-beta.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.
Files changed (189) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +31 -0
  3. package/affix/ccui-cli.css +2 -0
  4. package/affix/index.es.js +132 -0
  5. package/affix/index.umd.js +1 -0
  6. package/alert/ccui-cli.css +2 -0
  7. package/alert/index.es.js +127 -0
  8. package/alert/index.umd.js +1 -0
  9. package/anchor/ccui-cli.css +2 -0
  10. package/anchor/index.es.js +160 -0
  11. package/anchor/index.umd.js +1 -0
  12. package/avatar/ccui-cli.css +2 -0
  13. package/avatar/index.es.js +235 -0
  14. package/avatar/index.umd.js +1 -0
  15. package/badge/ccui-cli.css +2 -0
  16. package/badge/index.es.js +146 -0
  17. package/badge/index.umd.js +1 -0
  18. package/breadcrumb/ccui-cli.css +2 -0
  19. package/breadcrumb/index.es.js +89 -0
  20. package/breadcrumb/index.umd.js +1 -0
  21. package/button/ccui-cli.css +2 -0
  22. package/button/index.es.js +1236 -0
  23. package/button/index.umd.js +1 -0
  24. package/button-3d/ccui-cli.css +2 -0
  25. package/button-3d/index.es.js +80 -0
  26. package/button-3d/index.umd.js +1 -0
  27. package/calendar/ccui-cli.css +2 -0
  28. package/calendar/index.es.js +450 -0
  29. package/calendar/index.umd.js +1 -0
  30. package/card/ccui-cli.css +2 -0
  31. package/card/index.es.js +78 -0
  32. package/card/index.umd.js +1 -0
  33. package/ccui-cli.css +2 -0
  34. package/check-box/ccui-cli.css +2 -0
  35. package/check-box/index.es.js +173 -0
  36. package/check-box/index.umd.js +1 -0
  37. package/collapse/ccui-cli.css +2 -0
  38. package/collapse/index.es.js +176 -0
  39. package/collapse/index.umd.js +1 -0
  40. package/config-provider/index.es.js +204 -0
  41. package/config-provider/index.umd.js +1 -0
  42. package/date-picker/ccui-cli.css +2 -0
  43. package/date-picker/index.es.js +2447 -0
  44. package/date-picker/index.umd.js +1 -0
  45. package/descriptions/ccui-cli.css +2 -0
  46. package/descriptions/index.es.js +175 -0
  47. package/descriptions/index.umd.js +1 -0
  48. package/divider/ccui-cli.css +2 -0
  49. package/divider/index.es.js +78 -0
  50. package/divider/index.umd.js +1 -0
  51. package/drawer/ccui-cli.css +2 -0
  52. package/drawer/index.es.js +1320 -0
  53. package/drawer/index.umd.js +1 -0
  54. package/dropdown/ccui-cli.css +2 -0
  55. package/dropdown/index.es.js +606 -0
  56. package/dropdown/index.umd.js +1 -0
  57. package/empty/ccui-cli.css +2 -0
  58. package/empty/index.es.js +173 -0
  59. package/empty/index.umd.js +1 -0
  60. package/flex/ccui-cli.css +2 -0
  61. package/flex/index.es.js +87 -0
  62. package/flex/index.umd.js +1 -0
  63. package/float-button/ccui-cli.css +2 -0
  64. package/float-button/index.es.js +169 -0
  65. package/float-button/index.umd.js +1 -0
  66. package/form/ccui-cli.css +2 -0
  67. package/form/index.es.js +752 -0
  68. package/form/index.umd.js +1 -0
  69. package/grid/ccui-cli.css +2 -0
  70. package/grid/index.es.js +207 -0
  71. package/grid/index.umd.js +1 -0
  72. package/icon/ccui-cli.css +2 -0
  73. package/icon/index.es.js +1228 -0
  74. package/icon/index.umd.js +1 -0
  75. package/image/ccui-cli.css +2 -0
  76. package/image/index.es.js +276 -0
  77. package/image/index.umd.js +1 -0
  78. package/index.d.ts +7 -0
  79. package/input/ccui-cli.css +2 -0
  80. package/input/index.es.js +1293 -0
  81. package/input/index.umd.js +1 -0
  82. package/input-number/ccui-cli.css +2 -0
  83. package/input-number/index.es.js +263 -0
  84. package/input-number/index.umd.js +1 -0
  85. package/layout/ccui-cli.css +2 -0
  86. package/layout/index.es.js +184 -0
  87. package/layout/index.umd.js +1 -0
  88. package/masonry/ccui-cli.css +2 -0
  89. package/masonry/index.es.js +119 -0
  90. package/masonry/index.umd.js +1 -0
  91. package/menu/ccui-cli.css +2 -0
  92. package/menu/index.es.js +385 -0
  93. package/menu/index.umd.js +1 -0
  94. package/message/ccui-cli.css +2 -0
  95. package/message/index.es.js +351 -0
  96. package/message/index.umd.js +1 -0
  97. package/modal/ccui-cli.css +2 -0
  98. package/modal/index.es.js +1553 -0
  99. package/modal/index.umd.js +1 -0
  100. package/notification/ccui-cli.css +2 -0
  101. package/notification/index.es.js +347 -0
  102. package/notification/index.umd.js +1 -0
  103. package/nuxt/components/category.js +2 -0
  104. package/nuxt/components/install.js +2 -0
  105. package/nuxt/components/status.js +2 -0
  106. package/nuxt/components/title.js +2 -0
  107. package/nuxt/index.js +13 -0
  108. package/package.json +53 -0
  109. package/pagination/ccui-cli.css +2 -0
  110. package/pagination/index.es.js +296 -0
  111. package/pagination/index.umd.js +1 -0
  112. package/popconfirm/ccui-cli.css +2 -0
  113. package/popconfirm/index.es.js +735 -0
  114. package/popconfirm/index.umd.js +1 -0
  115. package/popover/ccui-cli.css +2 -0
  116. package/popover/index.es.js +530 -0
  117. package/popover/index.umd.js +1 -0
  118. package/progress/ccui-cli.css +2 -0
  119. package/progress/index.es.js +167 -0
  120. package/progress/index.umd.js +1 -0
  121. package/radio/ccui-cli.css +2 -0
  122. package/radio/index.es.js +157 -0
  123. package/radio/index.umd.js +1 -0
  124. package/rate/ccui-cli.css +2 -0
  125. package/rate/index.es.js +115 -0
  126. package/rate/index.umd.js +1 -0
  127. package/result/ccui-cli.css +2 -0
  128. package/result/index.es.js +90 -0
  129. package/result/index.umd.js +1 -0
  130. package/segmented/ccui-cli.css +2 -0
  131. package/segmented/index.es.js +99 -0
  132. package/segmented/index.umd.js +1 -0
  133. package/select/ccui-cli.css +2 -0
  134. package/select/index.es.js +1885 -0
  135. package/select/index.umd.js +1 -0
  136. package/skeleton/ccui-cli.css +2 -0
  137. package/skeleton/index.es.js +117 -0
  138. package/skeleton/index.umd.js +1 -0
  139. package/slider/ccui-cli.css +2 -0
  140. package/slider/index.es.js +1071 -0
  141. package/slider/index.umd.js +1 -0
  142. package/space/ccui-cli.css +2 -0
  143. package/space/index.es.js +108 -0
  144. package/space/index.umd.js +1 -0
  145. package/spin/ccui-cli.css +2 -0
  146. package/spin/index.es.js +86 -0
  147. package/spin/index.umd.js +1 -0
  148. package/splitter/ccui-cli.css +2 -0
  149. package/splitter/index.es.js +198 -0
  150. package/splitter/index.umd.js +1 -0
  151. package/status/ccui-cli.css +2 -0
  152. package/status/index.es.js +44 -0
  153. package/status/index.umd.js +1 -0
  154. package/steps/ccui-cli.css +2 -0
  155. package/steps/index.es.js +118 -0
  156. package/steps/index.umd.js +1 -0
  157. package/switch/ccui-cli.css +2 -0
  158. package/switch/index.es.js +118 -0
  159. package/switch/index.umd.js +1 -0
  160. package/table/ccui-cli.css +2 -0
  161. package/table/index.es.js +553 -0
  162. package/table/index.umd.js +1 -0
  163. package/tabs/ccui-cli.css +2 -0
  164. package/tabs/index.es.js +128 -0
  165. package/tabs/index.umd.js +1 -0
  166. package/tag/ccui-cli.css +2 -0
  167. package/tag/index.es.js +116 -0
  168. package/tag/index.umd.js +1 -0
  169. package/theme/darkTheme.css +352 -0
  170. package/theme/theme.scss +703 -0
  171. package/timeline/ccui-cli.css +2 -0
  172. package/timeline/index.es.js +113 -0
  173. package/timeline/index.umd.js +1 -0
  174. package/tooltip/ccui-cli.css +2 -0
  175. package/tooltip/index.es.js +423 -0
  176. package/tooltip/index.umd.js +1 -0
  177. package/tree/ccui-cli.css +2 -0
  178. package/tree/index.es.js +810 -0
  179. package/tree/index.umd.js +1 -0
  180. package/typography/ccui-cli.css +2 -0
  181. package/typography/index.es.js +270 -0
  182. package/typography/index.umd.js +1 -0
  183. package/util/index.es.js +78 -0
  184. package/util/index.umd.js +1 -0
  185. package/vue-ccui.es.js +18989 -0
  186. package/vue-ccui.umd.js +1 -0
  187. package/watermark/ccui-cli.css +2 -0
  188. package/watermark/index.es.js +179 -0
  189. package/watermark/index.umd.js +1 -0
@@ -0,0 +1,735 @@
1
+ import * as e from "vue";
2
+ import { Fragment as t, Teleport as n, Transition as r, computed as i, createTextVNode as a, createVNode as o, defineComponent as s, getCurrentInstance as c, inject as l, isVNode as u, mergeProps as d, nextTick as f, onMounted as p, onUnmounted as m, ref as h, watch as g } from "vue";
3
+ import { arrow as _, autoUpdate as v, computePosition as y, flip as b, offset as x, shift as S } from "@floating-ui/dom";
4
+ //#region \0rolldown/runtime.js
5
+ var C = Object.defineProperty, w = Object.getOwnPropertyDescriptor, T = Object.getOwnPropertyNames, E = Object.prototype.hasOwnProperty, D = (e, t) => {
6
+ let n = {};
7
+ for (var r in e) C(n, r, {
8
+ get: e[r],
9
+ enumerable: !0
10
+ });
11
+ return t || C(n, Symbol.toStringTag, { value: "Module" }), n;
12
+ }, O = (e, t, n, r) => {
13
+ if (t && typeof t == "object" || typeof t == "function") for (var i = T(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !E.call(e, s) && s !== n && C(e, s, {
14
+ get: ((e) => t[e]).bind(null, s),
15
+ enumerable: !(r = w(t, s)) || r.enumerable
16
+ });
17
+ return e;
18
+ }, k = (e, t, n) => (O(e, t, "default"), n && O(n, t, "default"));
19
+ //#endregion
20
+ //#region ../ccui/ui/shared/hooks/use-namespace.ts
21
+ function A(e, t, n) {
22
+ let r = e;
23
+ return t && (r += `__${t}`), n && (r += `--${n}`), r;
24
+ }
25
+ function ee(e, t = !1) {
26
+ let n = t ? `.ccui-${e}` : `ccui-${e}`;
27
+ return {
28
+ b: () => A(n),
29
+ e: (e) => e ? A(n, e) : "",
30
+ m: (e) => e ? A(n, "", e) : "",
31
+ em: (e, t) => e && t ? A(n, e, t) : "",
32
+ is: (e) => `is-${e}`
33
+ };
34
+ }
35
+ //#endregion
36
+ //#region ../ccui/ui/locale/zh-CN.ts
37
+ var j = {
38
+ locale: "zh-CN",
39
+ Modal: {
40
+ okText: "确 定",
41
+ cancelText: "取 消",
42
+ justOkText: "知道了"
43
+ },
44
+ Popconfirm: {
45
+ okText: "确 定",
46
+ cancelText: "取 消"
47
+ },
48
+ Empty: { description: "暂无数据" },
49
+ AutoComplete: { notFoundContent: "暂无数据" },
50
+ Mentions: { notFoundContent: "暂无数据" },
51
+ Cascader: { notFoundContent: "暂无数据" },
52
+ TreeSelect: { notFoundContent: "暂无数据" },
53
+ Select: { notFoundContent: "暂无数据" },
54
+ Pagination: {
55
+ itemsPerPage: "条/页",
56
+ jumpTo: "跳至",
57
+ page: "页",
58
+ prevPage: "上一页",
59
+ nextPage: "下一页",
60
+ total: "共 {total} 条"
61
+ },
62
+ Image: {
63
+ loading: "加载中",
64
+ error: "加载失败"
65
+ },
66
+ DatePicker: {
67
+ placeholder: "请选择日期",
68
+ rangePlaceholder: ["开始日期", "结束日期"],
69
+ timePlaceholder: "请选择时间",
70
+ weekdaysShort: [
71
+ "日",
72
+ "一",
73
+ "二",
74
+ "三",
75
+ "四",
76
+ "五",
77
+ "六"
78
+ ],
79
+ panelLabelFormat: "YYYY 年 M 月",
80
+ monthNamesShort: [
81
+ "1 月",
82
+ "2 月",
83
+ "3 月",
84
+ "4 月",
85
+ "5 月",
86
+ "6 月",
87
+ "7 月",
88
+ "8 月",
89
+ "9 月",
90
+ "10 月",
91
+ "11 月",
92
+ "12 月"
93
+ ],
94
+ quarterNames: [
95
+ "一季度",
96
+ "二季度",
97
+ "三季度",
98
+ "四季度"
99
+ ],
100
+ weekFormat: "{weekYear} 年第 {weekNumber} 周",
101
+ weekHeader: "周",
102
+ now: "此刻",
103
+ ok: "确定",
104
+ prevYearLabel: "前一年",
105
+ prevMonthLabel: "上个月",
106
+ nextYearLabel: "后一年",
107
+ nextMonthLabel: "下个月",
108
+ clearLabel: "清除"
109
+ }
110
+ }, M = Symbol("ccui-config");
111
+ //#endregion
112
+ //#region ../ccui/ui/config-provider/src/config-provider.tsx
113
+ function N() {
114
+ return l(M, {
115
+ prefixCls: "ccui",
116
+ componentSize: "middle",
117
+ locale: j,
118
+ direction: "ltr",
119
+ theme: void 0,
120
+ iconPrefixCls: "ccui-icon"
121
+ });
122
+ }
123
+ //#endregion
124
+ //#region ../../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
125
+ function P() {
126
+ return typeof window < "u";
127
+ }
128
+ function te(e) {
129
+ return F(e) ? (e.nodeName || "").toLowerCase() : "#document";
130
+ }
131
+ function ne(e) {
132
+ var t;
133
+ return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
134
+ }
135
+ function F(e) {
136
+ return P() ? e instanceof Node || e instanceof ne(e).Node : !1;
137
+ }
138
+ //#endregion
139
+ //#region ../../node_modules/.pnpm/vue-demi@0.14.10_vue@3.5.33_typescript@5.9.3_/node_modules/vue-demi/lib/index.mjs
140
+ var I = /* @__PURE__ */ D({
141
+ Vue: () => e,
142
+ Vue2: () => void 0,
143
+ del: () => z,
144
+ install: () => re,
145
+ isVue2: () => !1,
146
+ isVue3: () => !0,
147
+ set: () => R
148
+ });
149
+ import * as L from "vue";
150
+ k(I, L);
151
+ function re() {}
152
+ function R(e, t, n) {
153
+ return Array.isArray(e) ? (e.length = Math.max(e.length, t), e.splice(t, 1, n), n) : (e[t] = n, n);
154
+ }
155
+ function z(e, t) {
156
+ if (Array.isArray(e)) {
157
+ e.splice(t, 1);
158
+ return;
159
+ }
160
+ delete e[t];
161
+ }
162
+ //#endregion
163
+ //#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
164
+ function ie(e) {
165
+ return typeof e == "object" && !!e && "$el" in e;
166
+ }
167
+ function B(e) {
168
+ if (ie(e)) {
169
+ let t = e.$el;
170
+ return F(t) && te(t) === "#comment" ? null : t;
171
+ }
172
+ return e;
173
+ }
174
+ function V(e) {
175
+ return typeof e == "function" ? e() : (0, I.unref)(e);
176
+ }
177
+ function ae(e) {
178
+ return {
179
+ name: "arrow",
180
+ options: e,
181
+ fn(t) {
182
+ let n = B(V(e.element));
183
+ return n == null ? {} : _({
184
+ element: n,
185
+ padding: e.padding
186
+ }).fn(t);
187
+ }
188
+ };
189
+ }
190
+ function H(e) {
191
+ return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
192
+ }
193
+ function U(e, t) {
194
+ let n = H(e);
195
+ return Math.round(t * n) / n;
196
+ }
197
+ function oe(e, t, n) {
198
+ n === void 0 && (n = {});
199
+ let r = n.whileElementsMounted, i = (0, I.computed)(() => V(n.open) ?? !0), a = (0, I.computed)(() => V(n.middleware)), o = (0, I.computed)(() => V(n.placement) ?? "bottom"), s = (0, I.computed)(() => V(n.strategy) ?? "absolute"), c = (0, I.computed)(() => V(n.transform) ?? !0), l = (0, I.computed)(() => B(e.value)), u = (0, I.computed)(() => B(t.value)), d = (0, I.ref)(0), f = (0, I.ref)(0), p = (0, I.ref)(s.value), m = (0, I.ref)(o.value), h = (0, I.shallowRef)({}), g = (0, I.ref)(!1), _ = (0, I.computed)(() => {
200
+ let e = {
201
+ position: p.value,
202
+ left: "0",
203
+ top: "0"
204
+ };
205
+ if (!u.value) return e;
206
+ let t = U(u.value, d.value), n = U(u.value, f.value);
207
+ return c.value ? {
208
+ ...e,
209
+ transform: "translate(" + t + "px, " + n + "px)",
210
+ ...H(u.value) >= 1.5 && { willChange: "transform" }
211
+ } : {
212
+ position: p.value,
213
+ left: t + "px",
214
+ top: n + "px"
215
+ };
216
+ }), v;
217
+ function b() {
218
+ if (l.value == null || u.value == null) return;
219
+ let e = i.value;
220
+ y(l.value, u.value, {
221
+ middleware: a.value,
222
+ placement: o.value,
223
+ strategy: s.value
224
+ }).then((t) => {
225
+ d.value = t.x, f.value = t.y, p.value = t.strategy, m.value = t.placement, h.value = t.middlewareData, g.value = e !== !1;
226
+ });
227
+ }
228
+ function x() {
229
+ typeof v == "function" && (v(), v = void 0);
230
+ }
231
+ function S() {
232
+ if (x(), r === void 0) {
233
+ b();
234
+ return;
235
+ }
236
+ if (l.value != null && u.value != null) {
237
+ v = r(l.value, u.value, b);
238
+ return;
239
+ }
240
+ }
241
+ function C() {
242
+ i.value || (g.value = !1);
243
+ }
244
+ return (0, I.watch)([
245
+ a,
246
+ o,
247
+ s,
248
+ i
249
+ ], b, { flush: "sync" }), (0, I.watch)([l, u], S, { flush: "sync" }), (0, I.watch)(i, C, { flush: "sync" }), (0, I.getCurrentScope)() && (0, I.onScopeDispose)(x), {
250
+ x: (0, I.shallowReadonly)(d),
251
+ y: (0, I.shallowReadonly)(f),
252
+ strategy: (0, I.shallowReadonly)(p),
253
+ placement: (0, I.shallowReadonly)(m),
254
+ middlewareData: (0, I.shallowReadonly)(h),
255
+ isPositioned: (0, I.shallowReadonly)(g),
256
+ floatingStyles: _,
257
+ update: b
258
+ };
259
+ }
260
+ //#endregion
261
+ //#region ../ccui/ui/shared/hooks/use-deprecation-warning.ts
262
+ var W = /* @__PURE__ */ new Set();
263
+ function G(e, t, n) {
264
+ let r = `${e}.${t}`;
265
+ W.has(r) || (W.add(r), typeof console < "u" && console.warn(`[ccui][${e}] ${t} 已 deprecated,请改用 ${n}。`));
266
+ }
267
+ function K(e, t, n) {
268
+ return e ? Object.prototype.hasOwnProperty.call(e, t) || Object.prototype.hasOwnProperty.call(e, n) : !1;
269
+ }
270
+ //#endregion
271
+ //#region ../ccui/ui/popover/src/popover-types.ts
272
+ var q = {
273
+ title: {
274
+ type: String,
275
+ default: ""
276
+ },
277
+ content: {
278
+ type: String,
279
+ default: ""
280
+ },
281
+ placement: {
282
+ type: String,
283
+ default: "bottom"
284
+ },
285
+ effect: {
286
+ type: String,
287
+ default: "light"
288
+ },
289
+ visible: {
290
+ type: Boolean,
291
+ default: void 0
292
+ },
293
+ open: {
294
+ type: Boolean,
295
+ default: void 0
296
+ },
297
+ color: {
298
+ type: String,
299
+ default: ""
300
+ },
301
+ disabled: {
302
+ type: Boolean,
303
+ default: !1
304
+ },
305
+ showArrow: {
306
+ type: Boolean,
307
+ default: !0
308
+ },
309
+ arrow: {
310
+ type: [Boolean, Object],
311
+ default: void 0
312
+ },
313
+ trigger: {
314
+ type: String,
315
+ default: "click"
316
+ },
317
+ showAfter: {
318
+ type: Number,
319
+ default: 0
320
+ },
321
+ hideAfter: {
322
+ type: Number,
323
+ default: 200
324
+ },
325
+ mouseEnterDelay: {
326
+ type: Number,
327
+ default: void 0
328
+ },
329
+ mouseLeaveDelay: {
330
+ type: Number,
331
+ default: void 0
332
+ },
333
+ popperClass: {
334
+ type: String,
335
+ default: ""
336
+ },
337
+ overlayClassName: {
338
+ type: String,
339
+ default: ""
340
+ },
341
+ offset: {
342
+ type: Number,
343
+ default: 4
344
+ },
345
+ rawContent: {
346
+ type: Boolean,
347
+ default: !1
348
+ },
349
+ enterable: {
350
+ type: Boolean,
351
+ default: !0
352
+ },
353
+ hideOnClickOutside: {
354
+ type: Boolean,
355
+ default: !0
356
+ },
357
+ closeOnEsc: {
358
+ type: Boolean,
359
+ default: !0
360
+ },
361
+ ariaLabel: {
362
+ type: String,
363
+ default: ""
364
+ },
365
+ width: {
366
+ type: [Number, String],
367
+ default: ""
368
+ },
369
+ transition: {
370
+ type: String,
371
+ default: "ccui-popover-fade"
372
+ },
373
+ autoClose: {
374
+ type: Number,
375
+ default: 0
376
+ },
377
+ tabindex: {
378
+ type: [Number, String],
379
+ default: 0
380
+ },
381
+ teleported: {
382
+ type: Boolean,
383
+ default: !0
384
+ },
385
+ getPopupContainer: {
386
+ type: Function,
387
+ default: void 0
388
+ },
389
+ fresh: {
390
+ type: Boolean,
391
+ default: !1
392
+ },
393
+ destroyTooltipOnHide: {
394
+ type: Boolean,
395
+ default: !1
396
+ },
397
+ autoAdjustOverflow: {
398
+ type: Boolean,
399
+ default: !0
400
+ },
401
+ align: {
402
+ type: Object,
403
+ default: void 0
404
+ },
405
+ persistent: {
406
+ type: Boolean,
407
+ default: !0
408
+ },
409
+ virtualTriggering: {
410
+ type: Boolean,
411
+ default: !1
412
+ },
413
+ virtualRef: {
414
+ type: Object,
415
+ default: void 0
416
+ },
417
+ triggerKeys: {
418
+ type: Array,
419
+ default: () => ["Enter", " "]
420
+ }
421
+ };
422
+ //#endregion
423
+ //#region ../ccui/ui/popover/src/popover.tsx
424
+ function se(e) {
425
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !u(e);
426
+ }
427
+ function ce(e) {
428
+ return typeof e == "object" && !!e && !Array.isArray(e);
429
+ }
430
+ var le = 0, J = /* @__PURE__ */ s({
431
+ name: "CPopover",
432
+ props: q,
433
+ emits: [
434
+ "before-show",
435
+ "show",
436
+ "before-hide",
437
+ "hide",
438
+ "update:visible",
439
+ "update:open",
440
+ "before-enter",
441
+ "after-enter",
442
+ "before-leave",
443
+ "after-leave"
444
+ ],
445
+ setup(e, { emit: t, slots: a, expose: s }) {
446
+ let l = ee("popover"), u = `${l.e("popper")}-${++le}`, _ = c()?.vnode.props;
447
+ K(_, "visible", "visible") && G("Popover", "visible", "open(v-model:open)"), K(_, "showArrow", "show-arrow") && G("Popover", "showArrow", "arrow"), K(_, "showAfter", "show-after") && G("Popover", "showAfter", "mouseEnterDelay"), K(_, "hideAfter", "hide-after") && G("Popover", "hideAfter", "mouseLeaveDelay"), K(_, "popperClass", "popper-class") && G("Popover", "popperClass", "overlayClassName"), K(_, "teleported", "teleported") && G("Popover", "teleported", "getPopupContainer");
448
+ let y = h(!1), C = h(), w = h(), T = h(), E = h(), D = h(), O = h(), k = i(() => e.open === void 0 ? e.visible : e.open), A = i(() => k.value !== void 0), j = i(() => !!(A.value ? k.value : y.value)), M = i(() => e.mouseEnterDelay === void 0 ? e.showAfter : e.mouseEnterDelay), N = i(() => e.mouseLeaveDelay === void 0 ? e.hideAfter : e.mouseLeaveDelay), P = i(() => e.arrow === void 0 ? e.showArrow : typeof e.arrow == "boolean" ? e.arrow : !0), te = i(() => ce(e.arrow) ? !!e.arrow.pointAtCenter : !1), ne = i(() => e.overlayClassName || e.popperClass), F = i(() => e.color ? { backgroundColor: e.color } : {}), I = i(() => e.virtualTriggering && e.virtualRef ? e.virtualRef : C.value), L = i(() => [
449
+ l.e("popper"),
450
+ l.em("popper", e.effect),
451
+ l.em("popper", e.placement.split("-")[0]),
452
+ te.value && l.em("popper", "arrow-center"),
453
+ ne.value
454
+ ].filter(Boolean).join(" ")), { floatingStyles: re, middlewareData: R, update: z } = oe(i(() => I.value), w, {
455
+ placement: e.placement,
456
+ middleware: [
457
+ x(e.offset),
458
+ ...e.autoAdjustOverflow ? [b()] : [],
459
+ S({ padding: 8 }),
460
+ ...P.value ? [ae({ element: T })] : []
461
+ ]
462
+ }), ie = i(() => {
463
+ if (!P.value || !R.value.arrow) return {};
464
+ let { x: t, y: n } = R.value.arrow, r = {
465
+ top: "bottom",
466
+ right: "left",
467
+ bottom: "top",
468
+ left: "right"
469
+ }[e.placement.split("-")[0]];
470
+ return {
471
+ left: t == null ? "" : `${t}px`,
472
+ top: n == null ? "" : `${n}px`,
473
+ right: "",
474
+ bottom: "",
475
+ [r]: "-4px"
476
+ };
477
+ }), B = () => {
478
+ E.value &&= (clearTimeout(E.value), void 0), D.value &&= (clearTimeout(D.value), void 0), O.value &&= (clearTimeout(O.value), void 0);
479
+ }, V = () => {
480
+ B();
481
+ let n = () => {
482
+ t("before-hide"), A.value || (y.value = !1), t("update:visible", !1), t("update:open", !1), t("hide");
483
+ };
484
+ N.value > 0 && e.trigger !== "click" ? D.value = window.setTimeout(n, N.value) : n();
485
+ }, H = () => {
486
+ if (e.disabled) return;
487
+ B();
488
+ let n = () => {
489
+ t("before-show"), A.value || (y.value = !0), t("update:visible", !0), t("update:open", !0), f(() => {
490
+ z(), t("show"), e.autoClose > 0 && (O.value = window.setTimeout(() => {
491
+ V();
492
+ }, e.autoClose));
493
+ });
494
+ };
495
+ M.value > 0 ? E.value = window.setTimeout(n, M.value) : n();
496
+ }, U = () => {
497
+ e.trigger === "hover" && H();
498
+ }, W = () => {
499
+ e.trigger === "hover" && V();
500
+ }, q = () => {
501
+ e.trigger === "click" && (j.value ? V() : H());
502
+ }, J = (t) => {
503
+ e.trigger === "contextmenu" && (t.preventDefault(), j.value ? V() : H());
504
+ }, Y = () => {
505
+ e.trigger === "focus" && H();
506
+ }, X = () => {
507
+ e.trigger === "focus" && V();
508
+ }, ue = (e) => {
509
+ if (!e) return e;
510
+ let t = e.toLowerCase();
511
+ return e === " " || t === "space" || t === "spacebar" ? "Space" : e;
512
+ }, de = (t) => {
513
+ if (e.trigger !== "focus") return;
514
+ let n = ue(t.key);
515
+ e.triggerKeys.map(ue).includes(n) && (t.preventDefault(), j.value ? V() : H());
516
+ }, fe = () => {
517
+ e.trigger === "hover" && e.enterable && B();
518
+ }, pe = () => {
519
+ e.trigger === "hover" && e.enterable && V();
520
+ }, me = i(() => [l.b(), e.disabled ? l.m("disabled") : ""].filter(Boolean).join(" ")), Z = (t) => {
521
+ if (!j.value || e.trigger === "manual" || !e.hideOnClickOutside) return;
522
+ 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));
523
+ !a && !o && V();
524
+ }, Q = (t) => {
525
+ j.value && e.trigger !== "manual" && e.closeOnEsc && t.key === "Escape" && V();
526
+ }, $;
527
+ p(() => {
528
+ e.visible && f(() => {
529
+ let e = I.value;
530
+ e && w.value && ($ = v(e, w.value, z)), window.addEventListener("mousedown", Z, !0), window.addEventListener("keydown", Q, !0);
531
+ });
532
+ }), m(() => {
533
+ if (B(), $?.(), window.removeEventListener("mousedown", Z, !0), window.removeEventListener("keydown", Q, !0), e.virtualTriggering && e.virtualRef) {
534
+ let t = e.virtualRef;
535
+ t.removeEventListener("mouseenter", U), t.removeEventListener("mouseleave", W), t.removeEventListener("click", q), t.removeEventListener("focus", Y), t.removeEventListener("blur", X), t.removeEventListener("keydown", de), t.removeEventListener("contextmenu", J);
536
+ }
537
+ }), g(k, (e) => {
538
+ if (A.value) {
539
+ let t = !!e;
540
+ t !== y.value && (y.value = t, t && f(() => z()));
541
+ }
542
+ }), g(j, (e) => {
543
+ if (e) {
544
+ let e = I.value;
545
+ e && w.value && ($?.(), $ = v(e, w.value, z)), window.addEventListener("mousedown", Z, !0), window.addEventListener("keydown", Q, !0);
546
+ } else $?.(), window.removeEventListener("mousedown", Z, !0), window.removeEventListener("keydown", Q, !0);
547
+ });
548
+ let he = () => P.value ? o("div", {
549
+ ref: T,
550
+ class: [l.e("arrow"), l.em("arrow", e.placement.split("-")[0])].join(" "),
551
+ style: ie.value
552
+ }, null) : null, ge = () => {
553
+ let t = !!a.title, n = !!e.title;
554
+ return !t && !n ? null : o("div", { class: l.e("header") }, [a.title ? a.title() : e.title]);
555
+ }, _e = () => e.rawContent ? o("div", { innerHTML: e.content }, null) : a.content ? a.content() : e.content;
556
+ return s({ hide: V }), () => {
557
+ let i = {};
558
+ e.virtualTriggering || (e.trigger === "hover" ? (i.onMouseenter = U, i.onMouseleave = W) : e.trigger === "click" ? i.onClick = q : e.trigger === "focus" ? (i.onFocus = Y, i.onBlur = X, i.onKeydown = de) : e.trigger === "contextmenu" && (i.onContextmenu = J));
559
+ let s = o("div", {
560
+ ref: w,
561
+ class: L.value,
562
+ role: "dialog",
563
+ id: u,
564
+ style: {
565
+ ...re.value,
566
+ ...F.value,
567
+ zIndex: 2e3,
568
+ pointerEvents: e.enterable ? "auto" : "none",
569
+ width: e.width || void 0
570
+ },
571
+ onMouseenter: fe,
572
+ onMouseleave: pe
573
+ }, [
574
+ he(),
575
+ ge(),
576
+ o("div", { class: l.e("content") }, [_e()])
577
+ ]), c = () => {
578
+ if (e.getPopupContainer) {
579
+ let t = e.getPopupContainer(C.value ?? null);
580
+ return t ? o(n, { to: t }, se(s) ? s : { default: () => [s] }) : s;
581
+ }
582
+ return e.teleported ? o(n, { to: "body" }, se(s) ? s : { default: () => [s] }) : s;
583
+ };
584
+ return o("div", { class: me.value }, [
585
+ !e.virtualTriggering && o("div", d({
586
+ ref: C,
587
+ class: l.e("trigger"),
588
+ "aria-describedby": j.value ? u : void 0,
589
+ "aria-label": e.ariaLabel,
590
+ tabindex: e.trigger === "focus" ? e.tabindex : void 0
591
+ }, i), [a.default?.()]),
592
+ e.virtualTriggering && a.default?.(),
593
+ o(r, {
594
+ name: e.transition,
595
+ onBeforeEnter: () => t("before-enter"),
596
+ onAfterEnter: () => t("after-enter"),
597
+ onBeforeLeave: () => t("before-leave"),
598
+ onAfterLeave: () => t("after-leave")
599
+ }, { default: () => [j.value && c()] })
600
+ ]);
601
+ };
602
+ }
603
+ }), Y = /* @__PURE__ */ s({
604
+ name: "CPopconfirm",
605
+ props: {
606
+ title: {
607
+ type: String,
608
+ default: ""
609
+ },
610
+ description: {
611
+ type: String,
612
+ default: ""
613
+ },
614
+ placement: {
615
+ type: String,
616
+ default: "top"
617
+ },
618
+ confirmText: {
619
+ type: String,
620
+ default: ""
621
+ },
622
+ okText: {
623
+ type: String,
624
+ default: ""
625
+ },
626
+ cancelText: {
627
+ type: String,
628
+ default: ""
629
+ },
630
+ confirmType: {
631
+ type: String,
632
+ default: "primary"
633
+ },
634
+ okType: {
635
+ type: String,
636
+ default: void 0
637
+ },
638
+ icon: {
639
+ type: String,
640
+ default: ""
641
+ },
642
+ iconColor: {
643
+ type: String,
644
+ default: "#faad14"
645
+ },
646
+ hideIcon: {
647
+ type: Boolean,
648
+ default: !1
649
+ },
650
+ width: {
651
+ type: [Number, String],
652
+ default: ""
653
+ },
654
+ disabled: {
655
+ type: Boolean,
656
+ default: !1
657
+ },
658
+ visible: {
659
+ type: Boolean,
660
+ default: void 0
661
+ },
662
+ open: {
663
+ type: Boolean,
664
+ default: void 0
665
+ },
666
+ trigger: {
667
+ type: String,
668
+ default: "click"
669
+ }
670
+ },
671
+ emits: [
672
+ "confirm",
673
+ "cancel",
674
+ "update:visible",
675
+ "update:open"
676
+ ],
677
+ setup(e, { emit: n, slots: r }) {
678
+ let s = ee("popconfirm"), l = N(), u = c()?.vnode.props;
679
+ K(u, "visible", "visible") && G("Popconfirm", "visible", "open(v-model:open)"), K(u, "confirmText", "confirm-text") && G("Popconfirm", "confirmText", "okText"), K(u, "confirmType", "confirm-type") && G("Popconfirm", "confirmType", "okType");
680
+ let d = i(() => e.okText || e.confirmText), f = i(() => d.value || l.locale?.Popconfirm?.okText || "确 定"), p = i(() => e.cancelText || l.locale?.Popconfirm?.cancelText || "取 消"), m = i(() => e.okType || e.confirmType), _ = i(() => e.open === void 0 ? e.visible : e.open), v = h(null), y = h(!1), b = i(() => _.value !== void 0), x = i(() => b.value ? _.value : y.value);
681
+ g(_, (e) => {
682
+ e !== void 0 && (y.value = !!e);
683
+ });
684
+ let S = () => {
685
+ b.value || (y.value = !1), n("update:visible", !1), n("update:open", !1), v.value?.hide?.();
686
+ }, C = (e) => {
687
+ n("confirm", e), S();
688
+ }, w = (e) => {
689
+ n("cancel", e), S();
690
+ };
691
+ return () => o(J, {
692
+ ref: v,
693
+ trigger: e.trigger,
694
+ placement: e.placement,
695
+ disabled: e.disabled,
696
+ open: x.value,
697
+ width: e.width,
698
+ overlayClassName: s.b(),
699
+ arrow: !0,
700
+ "onUpdate:open": (e) => {
701
+ b.value || (y.value = e), n("update:visible", e), n("update:open", e);
702
+ }
703
+ }, {
704
+ default: () => r.default?.(),
705
+ content: () => o("div", { class: s.e("inner") }, [o("div", { class: s.e("header") }, [!e.hideIcon && o("span", {
706
+ class: s.e("icon"),
707
+ style: { color: e.iconColor }
708
+ }, [e.icon ? o("i", { class: e.icon }, null) : o("span", { class: s.e("warning") }, [a("!")])]), o("div", { class: s.e("text") }, [o("div", { class: s.e("title") }, [r.title ? r.title() : e.title]), (e.description || r.description) && o("div", { class: s.e("description") }, [r.description ? r.description() : e.description])])]), o("div", { class: s.e("actions") }, [r.actions ? r.actions({
709
+ confirm: C,
710
+ cancel: w
711
+ }) : o(t, null, [o("button", {
712
+ class: [s.e("btn"), s.em("btn", "cancel")],
713
+ onClick: w
714
+ }, [p.value]), o("button", {
715
+ class: [s.e("btn"), s.em("btn", m.value)],
716
+ onClick: C
717
+ }, [f.value])])])])
718
+ });
719
+ }
720
+ });
721
+ //#endregion
722
+ //#region ../ccui/ui/popconfirm/index.ts
723
+ Y.install = function(e) {
724
+ e.component(Y.name, Y);
725
+ };
726
+ var X = {
727
+ title: "Popconfirm 气泡确认",
728
+ category: "反馈",
729
+ status: "100%",
730
+ install(e) {
731
+ e.component(Y.name, Y);
732
+ }
733
+ };
734
+ //#endregion
735
+ export { Y as Popconfirm, X as default };