@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,4 +1,4 @@
1
- import { computed as e, createTextVNode as t, createVNode as n, defineComponent as r, ref as i, resolveComponent as a, watch as o } from "vue";
1
+ import { computed as e, createVNode as t, defineComponent as n, inject as r, ref as i, resolveComponent as a, watch as o } from "vue";
2
2
  //#region \0rolldown/runtime.js
3
3
  var s = Object.create, c = Object.defineProperty, l = Object.getOwnPropertyDescriptor, u = Object.getOwnPropertyNames, d = Object.getPrototypeOf, f = Object.prototype.hasOwnProperty, p = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), m = (e, t, n, r) => {
4
4
  if (t && typeof t == "object" || typeof t == "function") for (var i = u(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !f.call(e, s) && s !== n && c(e, s, {
@@ -6,10 +6,10 @@ var s = Object.create, c = Object.defineProperty, l = Object.getOwnPropertyDescr
6
6
  enumerable: !(r = l(t, s)) || r.enumerable
7
7
  });
8
8
  return e;
9
- }, h = /* @__PURE__ */ ((e, t, n) => (n = e == null ? {} : s(d(e)), m(t || !e || !e.__esModule ? c(n, "default", {
9
+ }, h = (e, t, n) => (n = e == null ? {} : s(d(e)), m(t || !e || !e.__esModule ? c(n, "default", {
10
10
  value: e,
11
11
  enumerable: !0
12
- }) : n, e)))((/* @__PURE__ */ p(((e, t) => {
12
+ }) : n, e)), g = /* @__PURE__ */ h((/* @__PURE__ */ p(((e, t) => {
13
13
  (function(n, r) {
14
14
  typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs = r();
15
15
  })(e, (function() {
@@ -304,147 +304,502 @@ var s = Object.create, c = Object.defineProperty, l = Object.getOwnPropertyDescr
304
304
  }, w.en = b[y], w.Ls = b, w.p = {}, w;
305
305
  }));
306
306
  })))(), 1);
307
- function g(e, t, n) {
307
+ function _(e, t, n) {
308
308
  let r = e;
309
309
  return t && (r += `__${t}`), n && (r += `--${n}`), r;
310
310
  }
311
- function _(e, t = !1) {
311
+ function v(e, t = !1) {
312
312
  let n = t ? `.ccui-${e}` : `ccui-${e}`;
313
313
  return {
314
- b: () => g(n),
315
- e: (e) => e ? g(n, e) : "",
316
- m: (e) => e ? g(n, "", e) : "",
317
- em: (e, t) => e && t ? g(n, e, t) : "",
314
+ b: () => _(n),
315
+ e: (e) => e ? _(n, e) : "",
316
+ m: (e) => e ? _(n, "", e) : "",
317
+ em: (e, t) => e && t ? _(n, e, t) : "",
318
318
  is: (e) => `is-${e}`
319
319
  };
320
320
  }
321
321
  //#endregion
322
- //#region ../ccui/ui/calendar/src/calendar.tsx
323
- var v = /* @__PURE__ */ r({
324
- name: "CCalendar",
325
- props: {
326
- modelValue: {
327
- type: Date,
328
- default: /* @__PURE__ */ new Date()
329
- },
330
- readOnly: {
331
- type: Boolean,
332
- default: !1
333
- },
334
- classNames: {
335
- type: Object,
336
- default: void 0
337
- },
338
- styles: {
339
- type: Object,
340
- default: void 0
322
+ //#region ../ccui/ui/locale/zh-CN.ts
323
+ var y = {
324
+ locale: "zh-CN",
325
+ Modal: {
326
+ okText: "确 定",
327
+ cancelText: "取 消",
328
+ justOkText: "知道了"
329
+ },
330
+ Popconfirm: {
331
+ okText: "确 定",
332
+ cancelText: "取 消"
333
+ },
334
+ Empty: { description: "暂无数据" },
335
+ AutoComplete: { notFoundContent: "暂无数据" },
336
+ Mentions: { notFoundContent: "暂无数据" },
337
+ Cascader: { notFoundContent: "暂无数据" },
338
+ TreeSelect: {
339
+ notFoundContent: "暂无数据",
340
+ searchPlaceholder: "搜索"
341
+ },
342
+ Select: { notFoundContent: "暂无数据" },
343
+ Pagination: {
344
+ itemsPerPage: "条/页",
345
+ jumpTo: "跳至",
346
+ page: "页",
347
+ prevPage: "上一页",
348
+ nextPage: "下一页",
349
+ total: "共 {total} 条",
350
+ pagination: "分页"
351
+ },
352
+ Image: {
353
+ loading: "加载中",
354
+ error: "加载失败"
355
+ },
356
+ DatePicker: {
357
+ placeholder: "请选择日期",
358
+ rangePlaceholder: ["开始日期", "结束日期"],
359
+ timePlaceholder: "请选择时间",
360
+ weekdaysShort: [
361
+ "日",
362
+ "一",
363
+ "二",
364
+ "三",
365
+ "四",
366
+ "五",
367
+ "六"
368
+ ],
369
+ panelLabelFormat: "YYYY 年 M 月",
370
+ monthNamesShort: [
371
+ "1 月",
372
+ "2 月",
373
+ "3 月",
374
+ "4 月",
375
+ "5 月",
376
+ "6 月",
377
+ "7 月",
378
+ "8 月",
379
+ "9 月",
380
+ "10 月",
381
+ "11 月",
382
+ "12 月"
383
+ ],
384
+ quarterNames: [
385
+ "一季度",
386
+ "二季度",
387
+ "三季度",
388
+ "四季度"
389
+ ],
390
+ weekFormat: "{weekYear} 年第 {weekNumber} 周",
391
+ weekHeader: "周",
392
+ now: "此刻",
393
+ ok: "确定",
394
+ prevYearLabel: "前一年",
395
+ prevMonthLabel: "上个月",
396
+ nextYearLabel: "后一年",
397
+ nextMonthLabel: "下个月",
398
+ clearLabel: "清除"
399
+ },
400
+ Calendar: {
401
+ weekdaysShort: [
402
+ "日",
403
+ "一",
404
+ "二",
405
+ "三",
406
+ "四",
407
+ "五",
408
+ "六"
409
+ ],
410
+ prevMonthLabel: "上个月",
411
+ nextMonthLabel: "下个月",
412
+ todayLabel: "今天",
413
+ monthFormat: "YYYY 年 M 月"
414
+ }
415
+ }, b = Symbol("ccui-config");
416
+ //#endregion
417
+ //#region ../ccui/ui/config-provider/src/config-provider.tsx
418
+ function x() {
419
+ return r(b, {
420
+ prefixCls: "ccui",
421
+ componentSize: "middle",
422
+ locale: y,
423
+ direction: "ltr",
424
+ theme: void 0,
425
+ iconPrefixCls: "ccui-icon"
426
+ });
427
+ }
428
+ //#endregion
429
+ //#region ../../node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/advancedFormat.js
430
+ var S = /* @__PURE__ */ p(((e, t) => {
431
+ (function(n, r) {
432
+ typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs_plugin_advancedFormat = r();
433
+ })(e, (function() {
434
+ return function(e, t) {
435
+ var n = t.prototype, r = n.format;
436
+ n.format = function(e) {
437
+ var t = this, n = this.$locale();
438
+ if (!this.isValid()) return r.bind(this)(e);
439
+ var i = this.$utils(), a = (e || "YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g, (function(e) {
440
+ switch (e) {
441
+ case "Q": return Math.ceil((t.$M + 1) / 3);
442
+ case "Do": return n.ordinal(t.$D);
443
+ case "gggg": return t.weekYear();
444
+ case "GGGG": return t.isoWeekYear();
445
+ case "wo": return n.ordinal(t.week(), "W");
446
+ case "w":
447
+ case "ww": return i.s(t.week(), e === "w" ? 1 : 2, "0");
448
+ case "W":
449
+ case "WW": return i.s(t.isoWeek(), e === "W" ? 1 : 2, "0");
450
+ case "k":
451
+ case "kk": return i.s(String(t.$H === 0 ? 24 : t.$H), e === "k" ? 1 : 2, "0");
452
+ case "X": return Math.floor(t.$d.getTime() / 1e3);
453
+ case "x": return t.$d.getTime();
454
+ case "z": return "[" + t.offsetName() + "]";
455
+ case "zzz": return "[" + t.offsetName("long") + "]";
456
+ default: return e;
457
+ }
458
+ }));
459
+ return r.bind(this)(a);
460
+ };
461
+ };
462
+ }));
463
+ })), C = /* @__PURE__ */ p(((e, t) => {
464
+ (function(n, r) {
465
+ typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs_plugin_customParseFormat = r();
466
+ })(e, (function() {
467
+ var e = {
468
+ LTS: "h:mm:ss A",
469
+ LT: "h:mm A",
470
+ L: "MM/DD/YYYY",
471
+ LL: "MMMM D, YYYY",
472
+ LLL: "MMMM D, YYYY h:mm A",
473
+ LLLL: "dddd, MMMM D, YYYY h:mm A"
474
+ }, t = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, n = /\d/, r = /\d\d/, i = /\d\d?/, a = /\d*[^-_:/,()\s\d]+/, o = {}, s = function(e) {
475
+ return (e = +e) + (e > 68 ? 1900 : 2e3);
476
+ }, c = function(e) {
477
+ return function(t) {
478
+ this[e] = +t;
479
+ };
480
+ }, l = [/[+-]\d\d:?(\d\d)?|Z/, function(e) {
481
+ (this.zone ||= {}).offset = function(e) {
482
+ if (!e || e === "Z") return 0;
483
+ var t = e.match(/([+-]|\d\d)/g), n = 60 * t[1] + (+t[2] || 0);
484
+ return n === 0 ? 0 : t[0] === "+" ? -n : n;
485
+ }(e);
486
+ }], u = function(e) {
487
+ var t = o[e];
488
+ return t && (t.indexOf ? t : t.s.concat(t.f));
489
+ }, d = function(e, t) {
490
+ var n, r = o.meridiem;
491
+ if (r) {
492
+ for (var i = 1; i <= 24; i += 1) if (e.indexOf(r(i, 0, t)) > -1) {
493
+ n = i > 12;
494
+ break;
495
+ }
496
+ } else n = e === (t ? "pm" : "PM");
497
+ return n;
498
+ }, f = {
499
+ A: [a, function(e) {
500
+ this.afternoon = d(e, !1);
501
+ }],
502
+ a: [a, function(e) {
503
+ this.afternoon = d(e, !0);
504
+ }],
505
+ Q: [n, function(e) {
506
+ this.month = 3 * (e - 1) + 1;
507
+ }],
508
+ S: [n, function(e) {
509
+ this.milliseconds = 100 * e;
510
+ }],
511
+ SS: [r, function(e) {
512
+ this.milliseconds = 10 * e;
513
+ }],
514
+ SSS: [/\d{3}/, function(e) {
515
+ this.milliseconds = +e;
516
+ }],
517
+ s: [i, c("seconds")],
518
+ ss: [i, c("seconds")],
519
+ m: [i, c("minutes")],
520
+ mm: [i, c("minutes")],
521
+ H: [i, c("hours")],
522
+ h: [i, c("hours")],
523
+ HH: [i, c("hours")],
524
+ hh: [i, c("hours")],
525
+ D: [i, c("day")],
526
+ DD: [r, c("day")],
527
+ Do: [a, function(e) {
528
+ var t = o.ordinal, n = e.match(/\d+/);
529
+ if (this.day = n[0], t) for (var r = 1; r <= 31; r += 1) t(r).replace(/\[|\]/g, "") === e && (this.day = r);
530
+ }],
531
+ w: [i, c("week")],
532
+ ww: [r, c("week")],
533
+ M: [i, c("month")],
534
+ MM: [r, c("month")],
535
+ MMM: [a, function(e) {
536
+ var t = u("months"), n = (u("monthsShort") || t.map((function(e) {
537
+ return e.slice(0, 3);
538
+ }))).indexOf(e) + 1;
539
+ if (n < 1) throw Error();
540
+ this.month = n % 12 || n;
541
+ }],
542
+ MMMM: [a, function(e) {
543
+ var t = u("months").indexOf(e) + 1;
544
+ if (t < 1) throw Error();
545
+ this.month = t % 12 || t;
546
+ }],
547
+ Y: [/[+-]?\d+/, c("year")],
548
+ YY: [r, function(e) {
549
+ this.year = s(e);
550
+ }],
551
+ YYYY: [/\d{4}/, c("year")],
552
+ Z: l,
553
+ ZZ: l
554
+ };
555
+ function p(n) {
556
+ for (var r = n, i = o && o.formats, a = (n = r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (function(t, n, r) {
557
+ var a = r && r.toUpperCase();
558
+ return n || i[r] || e[r] || i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(e, t, n) {
559
+ return t || n.slice(1);
560
+ }));
561
+ }))).match(t), s = a.length, c = 0; c < s; c += 1) {
562
+ var l = a[c], u = f[l], d = u && u[0], p = u && u[1];
563
+ a[c] = p ? {
564
+ regex: d,
565
+ parser: p
566
+ } : l.replace(/^\[|\]$/g, "");
567
+ }
568
+ return function(e) {
569
+ for (var t = {}, n = 0, r = 0; n < s; n += 1) {
570
+ var i = a[n];
571
+ if (typeof i == "string") r += i.length;
572
+ else {
573
+ var o = i.regex, c = i.parser, l = e.slice(r), u = o.exec(l)[0];
574
+ c.call(t, u), e = e.replace(u, "");
575
+ }
576
+ }
577
+ return function(e) {
578
+ var t = e.afternoon;
579
+ if (t !== void 0) {
580
+ var n = e.hours;
581
+ t ? n < 12 && (e.hours += 12) : n === 12 && (e.hours = 0), delete e.afternoon;
582
+ }
583
+ }(t), t;
584
+ };
341
585
  }
586
+ return function(e, t, n) {
587
+ n.p.customParseFormat = !0, e && e.parseTwoDigitYear && (s = e.parseTwoDigitYear);
588
+ var r = t.prototype, i = r.parse;
589
+ r.parse = function(e) {
590
+ var t = e.date, r = e.utc, a = e.args;
591
+ this.$u = r;
592
+ var s = a[1];
593
+ if (typeof s == "string") {
594
+ var c = !0 === a[2], l = !0 === a[3], u = c || l, d = a[2];
595
+ l && (d = a[2]), o = this.$locale(), !c && d && (o = n.Ls[d]), this.$d = function(e, t, n, r) {
596
+ try {
597
+ if (["x", "X"].indexOf(t) > -1) return /* @__PURE__ */ new Date((t === "X" ? 1e3 : 1) * e);
598
+ var i = p(t)(e), a = i.year, o = i.month, s = i.day, c = i.hours, l = i.minutes, u = i.seconds, d = i.milliseconds, f = i.zone, m = i.week, h = /* @__PURE__ */ new Date(), g = s || (a || o ? 1 : h.getDate()), _ = a || h.getFullYear(), v = 0;
599
+ a && !o || (v = o > 0 ? o - 1 : h.getMonth());
600
+ var y, b = c || 0, x = l || 0, S = u || 0, C = d || 0;
601
+ return f ? new Date(Date.UTC(_, v, g, b, x, S, C + 60 * f.offset * 1e3)) : n ? new Date(Date.UTC(_, v, g, b, x, S, C)) : (y = new Date(_, v, g, b, x, S, C), m && (y = r(y).week(m).toDate()), y);
602
+ } catch {
603
+ return /* @__PURE__ */ new Date("");
604
+ }
605
+ }(t, s, r, n), this.init(), d && !0 !== d && (this.$L = this.locale(d).$L), u && t != this.format(s) && (this.$d = /* @__PURE__ */ new Date("")), o = {};
606
+ } else if (s instanceof Array) for (var f = s.length, m = 1; m <= f; m += 1) {
607
+ a[1] = s[m - 1];
608
+ var h = n.apply(this, a);
609
+ if (h.isValid()) {
610
+ this.$d = h.$d, this.$L = h.$L, this.init();
611
+ break;
612
+ }
613
+ m === f && (this.$d = /* @__PURE__ */ new Date(""));
614
+ }
615
+ else i.call(this, e);
616
+ };
617
+ };
618
+ }));
619
+ })), w = /* @__PURE__ */ p(((e, t) => {
620
+ (function(n, r) {
621
+ typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs_plugin_quarterOfYear = r();
622
+ })(e, (function() {
623
+ var e = "month", t = "quarter";
624
+ return function(n, r) {
625
+ var i = r.prototype;
626
+ i.quarter = function(e) {
627
+ return this.$utils().u(e) ? Math.ceil((this.month() + 1) / 3) : this.month(this.month() % 3 + 3 * (e - 1));
628
+ };
629
+ var a = i.add;
630
+ i.add = function(n, r) {
631
+ return n = Number(n), this.$utils().p(r) === t ? this.add(3 * n, e) : a.bind(this)(n, r);
632
+ };
633
+ var o = i.startOf;
634
+ i.startOf = function(n, r) {
635
+ var i = this.$utils(), a = !!i.u(r) || r;
636
+ if (i.p(n) === t) {
637
+ var s = this.quarter() - 1;
638
+ return a ? this.month(3 * s).startOf(e).startOf("day") : this.month(3 * s + 2).endOf(e).endOf("day");
639
+ }
640
+ return o.bind(this)(n, r);
641
+ };
642
+ };
643
+ }));
644
+ })), T = /* @__PURE__ */ h(S(), 1), E = /* @__PURE__ */ h(C(), 1), D = /* @__PURE__ */ h(w(), 1);
645
+ g.default.extend(E.default), g.default.extend(D.default), g.default.extend(T.default);
646
+ function O(e, t) {
647
+ if (e == null || e === "") return null;
648
+ if (typeof e == "string" && t) {
649
+ let n = (0, g.default)(e, t, !0);
650
+ return n.isValid() ? n : null;
651
+ }
652
+ let n = (0, g.default)(e);
653
+ return n.isValid() ? n : null;
654
+ }
655
+ function k(e, t, n) {
656
+ return e === null ? null : t === "date" ? e.toDate() : t === "number" ? e.valueOf() : e.format(n);
657
+ }
658
+ //#endregion
659
+ //#region ../ccui/ui/calendar/src/calendar-types.ts
660
+ var A = {
661
+ modelValue: {
662
+ type: [
663
+ String,
664
+ Number,
665
+ Date,
666
+ Object
667
+ ],
668
+ default: void 0
342
669
  },
670
+ format: {
671
+ type: String,
672
+ default: "YYYY-MM-DD"
673
+ },
674
+ valueFormat: {
675
+ type: String,
676
+ default: "string"
677
+ },
678
+ readOnly: {
679
+ type: Boolean,
680
+ default: !1
681
+ },
682
+ classNames: {
683
+ type: Object,
684
+ default: void 0
685
+ },
686
+ styles: {
687
+ type: Object,
688
+ default: void 0
689
+ }
690
+ }, j = [
691
+ "周日",
692
+ "周一",
693
+ "周二",
694
+ "周三",
695
+ "周四",
696
+ "周五",
697
+ "周六"
698
+ ], M = /* @__PURE__ */ n({
699
+ name: "CCalendar",
700
+ props: A,
343
701
  emits: ["change", "update:modelValue"],
344
- setup(r, { emit: s, slots: c }) {
345
- let l = _("calendar"), u = i(r.modelValue ? (0, h.default)(r.modelValue).format("YYYY-MM-DD") : (0, h.default)().format("YYYY-MM-DD")), d = i(r.modelValue ? (0, h.default)(r.modelValue).format("YYYY-MM") : (0, h.default)().format("YYYY-MM")), f = i([]), p = [
346
- "周日",
347
- "周一",
348
- "周二",
349
- "周三",
350
- "周四",
351
- "周五",
352
- "周六"
353
- ], m = (e) => {
354
- let t = (0, h.default)(e).startOf("month").day(), n = (0, h.default)((0, h.default)(e).subtract(7 - t, "day")).format("YYYY-MM-DD");
355
- f.value = Array.from({ length: 42 }, (e, t) => t).reduce((e, t) => {
356
- let r = (0, h.default)(n).add(t + 1, "day").format("YYYY-MM-DD"), i = r.split("-"), a = (0, h.default)(r).day();
702
+ setup(n, { emit: r, slots: s }) {
703
+ let c = v("calendar"), l = x(), u = e(() => l.locale?.Calendar ?? {}), d = e(() => {
704
+ let e = u.value.weekdaysShort;
705
+ return e && e.length === 7 ? e : j;
706
+ }), f = e(() => u.value.monthFormat || "YYYY-MM"), p = e(() => u.value.prevMonthLabel || "上个月"), m = e(() => u.value.nextMonthLabel || "下个月"), h = e(() => u.value.todayLabel || "今天"), _ = () => O(n.modelValue, n.format) ?? (0, g.default)(), y = i(_().format("YYYY-MM-DD")), b = i(_().format("YYYY-MM")), S = i([]), C = (e) => {
707
+ let t = (0, g.default)(e).startOf("month").day(), n = (0, g.default)((0, g.default)(e).subtract(7 - t, "day")).format("YYYY-MM-DD");
708
+ S.value = Array.from({ length: 42 }, (e, t) => t).reduce((e, t) => {
709
+ let r = (0, g.default)(n).add(t + 1, "day").format("YYYY-MM-DD"), i = r.split("-"), a = (0, g.default)(r).day();
357
710
  return e.push({
358
711
  index: t + 1,
359
712
  date: r,
360
713
  day: i[i.length - 1],
361
- week: p[a]
714
+ week: d.value[a]
362
715
  }), e;
363
716
  }, []);
364
717
  };
365
- m(d.value);
366
- let g = (e) => {
367
- u.value = (0, h.default)(e).format("YYYY-MM-DD"), e.includes(d.value) || (d.value = (0, h.default)(e).format("YYYY-MM"), m(d.value)), s("update:modelValue", new Date(u.value)), s("change", u.value);
368
- }, v = (e) => {
718
+ C(b.value);
719
+ let w = (e) => {
720
+ y.value = (0, g.default)(e).format("YYYY-MM-DD"), e.includes(b.value) || (b.value = (0, g.default)(e).format("YYYY-MM"), C(b.value));
721
+ let t = k((0, g.default)(y.value), n.valueFormat, n.format);
722
+ r("update:modelValue", t), r("change", t);
723
+ }, T = (e) => {
369
724
  let t = "";
370
- e === "nextMonth" && (t = (0, h.default)(d.value).add(1, "month").format("YYYY-MM")), e === "lastMonth" && (t = (0, h.default)(d.value).subtract(1, "month").format("YYYY-MM")), g(t);
725
+ e === "nextMonth" && (t = (0, g.default)(b.value).add(1, "month").format("YYYY-MM")), e === "lastMonth" && (t = (0, g.default)(b.value).subtract(1, "month").format("YYYY-MM")), w(t);
371
726
  };
372
- o(() => r.modelValue, () => {
373
- u.value = (0, h.default)(r.modelValue).format("YYYY-MM-DD"), u.value.includes(d.value) || (d.value = (0, h.default)(r.modelValue).format("YYYY-MM"), m(d.value));
727
+ o(() => n.modelValue, () => {
728
+ y.value = _().format("YYYY-MM-DD"), y.value.includes(b.value) || (b.value = _().format("YYYY-MM"), C(b.value));
374
729
  });
375
- let y = e(() => f.value.map((e) => {
376
- let t = e.date.includes(d.value), i = u.value === e.date, a = {
377
- "current-month": t,
730
+ let E = e(() => S.value.map((e) => {
731
+ let r = e.date.includes(b.value), i = y.value === e.date, a = {
732
+ "current-month": r,
378
733
  "current-date": i,
379
- [l.em("day-box", "day")]: !0
734
+ [c.em("day-box", "day")]: !0
380
735
  }, o = {
381
736
  isSelected: i,
382
737
  date: e.date,
383
738
  day: Number.parseInt(e.day)
384
739
  };
385
- return n("div", {
740
+ return t("div", {
386
741
  onClick: () => {
387
- g(o.date);
742
+ w(o.date);
388
743
  },
389
- class: [a, r.classNames?.cell],
390
- style: r.styles?.cell
391
- }, [c.dateCell ? c.dateCell(o) : o.day]);
392
- })), b = p.map((e) => n("div", { class: l.em("week", "item") }, [e])), x = () => n("div", {
393
- class: [l.e("header"), r.classNames?.header],
394
- style: r.styles?.header
395
- }, [n("div", null, [d.value]), n("div", null, [
396
- n(a("c-button"), {
744
+ class: [a, n.classNames?.cell],
745
+ style: n.styles?.cell
746
+ }, [s.dateCell ? s.dateCell(o) : o.day]);
747
+ })), D = e(() => d.value.map((e) => t("div", { class: c.em("week", "item") }, [e]))), A = e(() => (0, g.default)(b.value).format(f.value)), M = () => t("div", {
748
+ class: [c.e("header"), n.classNames?.header],
749
+ style: n.styles?.header
750
+ }, [t("div", null, [A.value]), t("div", null, [
751
+ t(a("c-button"), {
397
752
  type: "primary",
398
753
  plain: !0,
399
754
  onClick: () => {
400
- v("lastMonth");
755
+ T("lastMonth");
401
756
  }
402
- }, { default: () => [t("上个月")] }),
403
- n(a("c-button"), {
757
+ }, { default: () => [p.value] }),
758
+ t(a("c-button"), {
404
759
  type: "primary",
405
760
  plain: !0,
406
761
  onClick: () => {
407
- g((0, h.default)().format("YYYY-MM-DD"));
762
+ w((0, g.default)().format("YYYY-MM-DD"));
408
763
  }
409
- }, { default: () => [t("今天")] }),
410
- n(a("c-button"), {
764
+ }, { default: () => [h.value] }),
765
+ t(a("c-button"), {
411
766
  type: "primary",
412
767
  plain: !0,
413
768
  onClick: () => {
414
- v("nextMonth");
769
+ T("nextMonth");
415
770
  }
416
- }, { default: () => [t("下个月")] })
417
- ])]), S = e(() => ({
418
- value: u.value,
419
- currentMonth: d.value,
420
- setDate: (e) => g(e),
421
- changeMonth: (e) => v(e)
771
+ }, { default: () => [m.value] })
772
+ ])]), N = e(() => ({
773
+ value: y.value,
774
+ currentMonth: b.value,
775
+ setDate: (e) => w(e),
776
+ changeMonth: (e) => T(e)
422
777
  }));
423
- return () => n("div", {
424
- class: [l.b(), r.classNames?.root],
425
- style: r.styles?.root
778
+ return () => t("div", {
779
+ class: [c.b(), n.classNames?.root],
780
+ style: n.styles?.root
426
781
  }, [
427
- c.header ? c.header(S.value) : x(),
428
- n("div", { class: l.e("week") }, [b]),
429
- n("div", {
430
- class: [l.e("day-box"), r.classNames?.body],
431
- style: r.styles?.body
432
- }, [y.value])
782
+ s.header ? s.header(N.value) : M(),
783
+ t("div", { class: c.e("week") }, [D.value]),
784
+ t("div", {
785
+ class: [c.e("day-box"), n.classNames?.body],
786
+ style: n.styles?.body
787
+ }, [E.value])
433
788
  ]);
434
789
  }
435
790
  });
436
791
  //#endregion
437
792
  //#region ../ccui/ui/calendar/index.ts
438
- v.install = function(e) {
439
- e.component(v.name, v);
793
+ M.install = function(e) {
794
+ e.component(M.name, M);
440
795
  };
441
- var y = {
796
+ var N = {
442
797
  title: "Calendar 日历",
443
798
  category: "数据展示",
444
799
  status: "100%",
445
800
  install(e) {
446
- e.component(v.name, v);
801
+ e.component(M.name, M);
447
802
  }
448
803
  };
449
804
  //#endregion
450
- export { v as Calendar, y as default };
805
+ export { M as Calendar, N as default };