x-next 1.18.0 → 1.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/AI_USAGE/catalog.md +1 -1
  2. package/AI_USAGE/components/alert-api.md +1 -1
  3. package/AI_USAGE/components/alert.md +1 -1
  4. package/AI_USAGE/components/bar-chart-api.md +1 -1
  5. package/AI_USAGE/components/bar-chart.md +1 -1
  6. package/AI_USAGE/components/boxicons.md +1 -1
  7. package/AI_USAGE/components/button-api.md +1 -1
  8. package/AI_USAGE/components/button.md +4 -4
  9. package/AI_USAGE/components/charts.md +1 -1
  10. package/AI_USAGE/components/checkbox-api.md +1 -1
  11. package/AI_USAGE/components/checkbox.md +1 -1
  12. package/AI_USAGE/components/color-picker-api.md +1 -1
  13. package/AI_USAGE/components/color-picker.md +1 -1
  14. package/AI_USAGE/components/config-provider-api.md +1 -1
  15. package/AI_USAGE/components/config-provider.md +1 -1
  16. package/AI_USAGE/components/date-picker-api.md +44 -26
  17. package/AI_USAGE/components/date-picker.md +78 -3
  18. package/AI_USAGE/components/dialog-api.md +2 -2
  19. package/AI_USAGE/components/dialog.md +5 -1
  20. package/AI_USAGE/components/draggable-api.md +1 -1
  21. package/AI_USAGE/components/draggable.md +1 -1
  22. package/AI_USAGE/components/drawer-api.md +1 -1
  23. package/AI_USAGE/components/drawer.md +1 -1
  24. package/AI_USAGE/components/dropdown-api.md +6 -1
  25. package/AI_USAGE/components/dropdown.md +2 -2
  26. package/AI_USAGE/components/empty-api.md +1 -1
  27. package/AI_USAGE/components/empty.md +1 -1
  28. package/AI_USAGE/components/finicon.md +1 -1
  29. package/AI_USAGE/components/form-api.md +1 -1
  30. package/AI_USAGE/components/form.md +1 -1
  31. package/AI_USAGE/components/grid-api.md +1 -1
  32. package/AI_USAGE/components/grid.md +1 -1
  33. package/AI_USAGE/components/heatmap-api.md +1 -1
  34. package/AI_USAGE/components/heatmap.md +1 -1
  35. package/AI_USAGE/components/icon-api.md +1 -1
  36. package/AI_USAGE/components/icon.md +1 -1
  37. package/AI_USAGE/components/image-api.md +1 -1
  38. package/AI_USAGE/components/image.md +1 -1
  39. package/AI_USAGE/components/input-api.md +1 -1
  40. package/AI_USAGE/components/input-number-api.md +1 -1
  41. package/AI_USAGE/components/input-number.md +1 -1
  42. package/AI_USAGE/components/input-tag-api.md +1 -1
  43. package/AI_USAGE/components/input-tag.md +1 -1
  44. package/AI_USAGE/components/input.md +1 -1
  45. package/AI_USAGE/components/layout-api.md +1 -1
  46. package/AI_USAGE/components/layout.md +1 -1
  47. package/AI_USAGE/components/line-chart-api.md +1 -1
  48. package/AI_USAGE/components/line-chart.md +1 -1
  49. package/AI_USAGE/components/link-api.md +1 -1
  50. package/AI_USAGE/components/link.md +1 -1
  51. package/AI_USAGE/components/menu-api.md +1 -1
  52. package/AI_USAGE/components/menu.md +1 -1
  53. package/AI_USAGE/components/message-api.md +1 -1
  54. package/AI_USAGE/components/message-box-api.md +1 -1
  55. package/AI_USAGE/components/message-box.md +1 -1
  56. package/AI_USAGE/components/message.md +1 -1
  57. package/AI_USAGE/components/network-api.md +1 -1
  58. package/AI_USAGE/components/network.md +1 -1
  59. package/AI_USAGE/components/notification-api.md +1 -1
  60. package/AI_USAGE/components/notification.md +1 -1
  61. package/AI_USAGE/components/pagination-api.md +1 -1
  62. package/AI_USAGE/components/pagination.md +1 -1
  63. package/AI_USAGE/components/pie-chart-api.md +1 -1
  64. package/AI_USAGE/components/pie-chart.md +1 -1
  65. package/AI_USAGE/components/popconfirm-api.md +1 -1
  66. package/AI_USAGE/components/popconfirm.md +1 -1
  67. package/AI_USAGE/components/popover-api.md +1 -1
  68. package/AI_USAGE/components/popover.md +3 -1
  69. package/AI_USAGE/components/popup-api.md +1 -1
  70. package/AI_USAGE/components/popup.md +1 -1
  71. package/AI_USAGE/components/progress-api.md +1 -1
  72. package/AI_USAGE/components/progress.md +1 -1
  73. package/AI_USAGE/components/radio-api.md +1 -1
  74. package/AI_USAGE/components/radio.md +1 -1
  75. package/AI_USAGE/components/rate-api.md +1 -1
  76. package/AI_USAGE/components/rate.md +1 -1
  77. package/AI_USAGE/components/resize-box-api.md +1 -1
  78. package/AI_USAGE/components/resize-box.md +1 -1
  79. package/AI_USAGE/components/scrollbar-api.md +1 -1
  80. package/AI_USAGE/components/scrollbar.md +1 -1
  81. package/AI_USAGE/components/select-api.md +1 -1
  82. package/AI_USAGE/components/select.md +1 -1
  83. package/AI_USAGE/components/skeleton-api.md +1 -1
  84. package/AI_USAGE/components/skeleton.md +1 -1
  85. package/AI_USAGE/components/slider-api.md +1 -1
  86. package/AI_USAGE/components/slider.md +1 -1
  87. package/AI_USAGE/components/space-api.md +1 -1
  88. package/AI_USAGE/components/space.md +1 -1
  89. package/AI_USAGE/components/spin-api.md +1 -1
  90. package/AI_USAGE/components/spin.md +1 -1
  91. package/AI_USAGE/components/steps-api.md +1 -1
  92. package/AI_USAGE/components/steps.md +1 -1
  93. package/AI_USAGE/components/switch-api.md +1 -1
  94. package/AI_USAGE/components/switch.md +1 -1
  95. package/AI_USAGE/components/table-api.md +1 -1
  96. package/AI_USAGE/components/table.md +1 -1
  97. package/AI_USAGE/components/tabs-api.md +1 -1
  98. package/AI_USAGE/components/tabs.md +1 -1
  99. package/AI_USAGE/components/tag-api.md +1 -1
  100. package/AI_USAGE/components/tag.md +1 -1
  101. package/AI_USAGE/components/textarea-api.md +1 -1
  102. package/AI_USAGE/components/textarea.md +1 -1
  103. package/AI_USAGE/components/time-picker-api.md +1 -1
  104. package/AI_USAGE/components/time-picker.md +1 -1
  105. package/AI_USAGE/components/time-range-selector-api.md +1 -1
  106. package/AI_USAGE/components/time-range-selector.md +1 -1
  107. package/AI_USAGE/components/timeline-api.md +1 -1
  108. package/AI_USAGE/components/timeline.md +1 -1
  109. package/AI_USAGE/components/tooltip-api.md +1 -1
  110. package/AI_USAGE/components/tooltip.md +1 -1
  111. package/AI_USAGE/components/transfer-api.md +1 -1
  112. package/AI_USAGE/components/transfer.md +1 -1
  113. package/AI_USAGE/components/tree-select-api.md +1 -1
  114. package/AI_USAGE/components/tree-select.md +1 -1
  115. package/AI_USAGE/components/trend-chart-api.md +1 -1
  116. package/AI_USAGE/components/trend-chart.md +1 -1
  117. package/AI_USAGE/components/trigger-api.md +1 -1
  118. package/AI_USAGE/components/trigger.md +1 -1
  119. package/AI_USAGE/components/upload-api.md +1 -1
  120. package/AI_USAGE/components/upload.md +1 -1
  121. package/AI_USAGE/components/watermark-api.md +1 -1
  122. package/AI_USAGE/components/watermark.md +1 -1
  123. package/AI_USAGE/core.md +1 -1
  124. package/AI_USAGE/index.md +1 -1
  125. package/AI_USAGE/recipes/form-on-demand.md +1 -1
  126. package/AI_USAGE.md +138 -34
  127. package/CHANGELOG.md +16 -0
  128. package/dist/_container/render-function.d.ts +2 -2
  129. package/dist/components/_components/picker/input-range.vue.d.ts +1 -1
  130. package/dist/components/date-picker/DatePanel.vue.d.ts +10 -1
  131. package/dist/components/date-picker/DatePicker.vue.d.ts +22 -10
  132. package/dist/components/date-picker/index.d.ts +156 -54
  133. package/dist/components/date-picker/utils.d.ts +4 -4
  134. package/dist/components/dropdown/Dropdown.vue.d.ts +1 -0
  135. package/dist/components/dropdown/DropdownButton.vue.d.ts +1 -0
  136. package/dist/components/dropdown/DropdownSubmenu.vue.d.ts +1 -0
  137. package/dist/components/dropdown/context.d.ts +1 -0
  138. package/dist/components/dropdown/index.d.ts +8 -0
  139. package/dist/components/dropdown/use-keyboard.d.ts +1 -0
  140. package/dist/components/menu/MenuItem.d.ts +2 -2
  141. package/dist/components/menu/context.d.ts +3 -3
  142. package/dist/components/menu/index.d.ts +6 -6
  143. package/dist/components/menu/sub-menu-pop.vue.d.ts +2 -2
  144. package/dist/components/time-picker/TimePicker.vue.d.ts +1 -1
  145. package/dist/components/time-picker/index.d.ts +2 -2
  146. package/dist/es/components/_components/picker/input-range.vue.js +12 -12
  147. package/dist/es/components/_components/picker/input-range.vue2.js +45 -45
  148. package/dist/es/components/_components/picker/input.vue2.js +24 -24
  149. package/dist/es/components/date-picker/DatePanel.vue.js +47 -47
  150. package/dist/es/components/date-picker/DatePanel.vue2.js +68 -59
  151. package/dist/es/components/date-picker/DatePicker.vue.js +65 -59
  152. package/dist/es/components/date-picker/DatePicker.vue2.js +387 -284
  153. package/dist/es/components/date-picker/index.js +57 -36
  154. package/dist/es/components/date-picker/utils.js +132 -122
  155. package/dist/es/components/dialog/Dialog.js +43 -40
  156. package/dist/es/components/dialog/props.js +1 -1
  157. package/dist/es/components/dropdown/Dropdown.vue2.js +66 -50
  158. package/dist/es/components/dropdown/dropdown-panel.vue2.js +48 -43
  159. package/dist/es/components/dropdown/use-keyboard.js +36 -28
  160. package/dist/es/components/popover/Popover.js +72 -32
  161. package/dist/es/style.css +1 -1
  162. package/dist/index.cjs +3 -3
  163. package/dist/index.umd.js +3 -3
  164. package/dist/style/button.css +1 -1
  165. package/dist/style/date-picker.css +1 -1
  166. package/dist/style/dialog.css +1 -1
  167. package/dist/style/message-box.css +1 -1
  168. package/dist/style.css +1 -1
  169. package/package.json +2 -1
@@ -1,57 +1,78 @@
1
1
  import n from "./DatePicker.vue.js";
2
- import { defineComponent as c, h as k } from "vue";
3
- import { generateComponent as e } from "../../_utils/vue-eco.js";
4
- import { getComponentPrefix as r } from "../../_utils/config.js";
5
- import { getRangePickerType as s } from "./utils.js";
6
- import { inheritComponentType as P } from "../../_utils/inherit-component-type.js";
7
- const R = e(r("DatePicker"), n), i = (t, o) => P(c({
8
- name: t,
2
+ import { defineComponent as k, h as s } from "vue";
3
+ import { generateComponent as t } from "../../_utils/vue-eco.js";
4
+ import { getComponentPrefix as i } from "../../_utils/config.js";
5
+ import { getRangePickerType as f } from "./utils.js";
6
+ import { inheritComponentType as a } from "../../_utils/inherit-component-type.js";
7
+ const R = t(i("DatePicker"), n), o = (e, c) => a(k({
8
+ name: e,
9
9
  inheritAttrs: !1,
10
- setup(a, { attrs: m, slots: p }) {
11
- return () => k(n, { ...m, type: o }, p);
10
+ methods: {
11
+ focus() {
12
+ var r;
13
+ (r = this.$refs.picker) == null || r.focus();
14
+ },
15
+ blur() {
16
+ var r;
17
+ (r = this.$refs.picker) == null || r.blur();
18
+ }
19
+ },
20
+ setup(r, { attrs: p, slots: m }) {
21
+ return () => s(n, { ...p, type: c, ref: "picker" }, m);
12
22
  }
13
- })), C = e(
14
- r("MonthPicker"),
15
- i("MonthPicker", "month")
16
- ), D = e(
17
- r("YearPicker"),
18
- i("YearPicker", "year")
19
- ), M = e(
20
- r("QuarterPicker"),
21
- i("QuarterPicker", "quarter")
22
- ), Q = e(
23
- r("WeekPicker"),
24
- i("WeekPicker", "week")
25
- ), f = c({
23
+ })), b = t(
24
+ i("MonthPicker"),
25
+ o("MonthPicker", "month")
26
+ ), C = t(
27
+ i("YearPicker"),
28
+ o("YearPicker", "year")
29
+ ), $ = t(
30
+ i("QuarterPicker"),
31
+ o("QuarterPicker", "quarter")
32
+ ), D = t(
33
+ i("WeekPicker"),
34
+ o("WeekPicker", "week")
35
+ ), P = k({
26
36
  name: "RangePicker",
27
37
  inheritAttrs: !1,
28
38
  props: {
29
39
  mode: {
30
40
  type: String,
31
41
  default: "date",
32
- validator: (t) => ["date", "month", "year", "quarter", "week"].includes(t)
42
+ validator: (e) => ["date", "month", "year", "quarter", "week"].includes(e)
43
+ }
44
+ },
45
+ methods: {
46
+ focus() {
47
+ var e;
48
+ (e = this.$refs.picker) == null || e.focus();
49
+ },
50
+ blur() {
51
+ var e;
52
+ (e = this.$refs.picker) == null || e.blur();
33
53
  }
34
54
  },
35
- setup(t, { attrs: o, slots: a }) {
36
- return () => k(
55
+ setup(e, { attrs: c, slots: r }) {
56
+ return () => s(
37
57
  n,
38
58
  {
39
- ...o,
40
- type: s(t.mode)
59
+ ...c,
60
+ ref: "picker",
61
+ type: f(e.mode)
41
62
  },
42
- a
63
+ r
43
64
  );
44
65
  }
45
- }), T = e(
46
- r("RangePicker"),
47
- P(f)
66
+ }), M = t(
67
+ i("RangePicker"),
68
+ a(P)
48
69
  );
49
70
  export {
50
71
  R as DatePicker,
51
- C as MonthPicker,
52
- M as QuarterPicker,
53
- T as RangePicker,
54
- Q as WeekPicker,
55
- D as YearPicker,
72
+ b as MonthPicker,
73
+ $ as QuarterPicker,
74
+ M as RangePicker,
75
+ D as WeekPicker,
76
+ C as YearPicker,
56
77
  R as default
57
78
  };
@@ -1,9 +1,9 @@
1
- import { dayjs as q, getDayjsValue as G } from "../../_utils/date.js";
2
- import { isArray as S } from "../../_utils/is.js";
3
- import { formatMessage as I } from "../../locale/index.js";
4
- import { getLunarInfo as J } from "./lunar/index.js";
5
- import b from "../../locale/zh-CN.js";
6
- const K = {
1
+ import { dayjs as C, getDayjsValue as K } from "../../_utils/date.js";
2
+ import { isArray as p } from "../../_utils/is.js";
3
+ import { formatMessage as U } from "../../locale/index.js";
4
+ import { getLunarInfo as X } from "./lunar/index.js";
5
+ import B from "../../locale/zh-CN.js";
6
+ const Z = {
7
7
  date: "date",
8
8
  month: "month",
9
9
  year: "year",
@@ -14,110 +14,113 @@ const K = {
14
14
  "year-range": "year",
15
15
  "quarter-range": "quarter",
16
16
  "week-range": "week"
17
- }, X = /* @__PURE__ */ new Set([
17
+ }, W = /* @__PURE__ */ new Set([
18
18
  "date-range",
19
19
  "month-range",
20
20
  "year-range",
21
21
  "quarter-range",
22
22
  "week-range"
23
- ]), Z = {
23
+ ]), v = {
24
24
  date: "date-range",
25
25
  month: "month-range",
26
26
  year: "year-range",
27
27
  quarter: "quarter-range",
28
28
  week: "week-range"
29
- }, x = {
29
+ }, F = {
30
30
  date: "YYYY-MM-DD",
31
31
  month: "YYYY-MM",
32
32
  year: "YYYY",
33
33
  quarter: "YYYY-[Q]Q",
34
34
  week: "YYYY-wo"
35
- }, ce = (e) => K[e] ?? "date", ue = (e) => X.has(e), ge = (e, t = !1) => e === "date" && t ? "YYYY-MM-DD HH:mm:ss" : x[e], we = (e = "date") => Z[e] ?? "date-range", O = (e) => e === "quarter" ? "quarter" : e === "week" ? "week" : e, C = (e, t) => {
36
- var n, i;
35
+ }, ge = (e) => Z[e] ?? "date", de = (e) => W.has(e), we = (e, t = !1) => e === "date" && t ? "YYYY-MM-DD HH:mm:ss" : F[e], Ye = (e = "date") => v[e] ?? "date-range", z = (e) => e === "quarter" ? "quarter" : e === "week" ? "week" : e, H = (e, t, r = 0) => {
36
+ var a, f;
37
37
  if (e == null || e === "") return;
38
- if (typeof e == "string" && T(t)) {
39
- const s = U(e);
40
- return (n = s == null ? void 0 : s.isValid) != null && n.call(s) ? s : void 0;
38
+ if (typeof e == "string" && _(t)) {
39
+ const u = G(e, r);
40
+ return (a = u == null ? void 0 : u.isValid) != null && a.call(u) ? u : void 0;
41
41
  }
42
- const r = G(e, t);
43
- return (i = r == null ? void 0 : r.isValid) != null && i.call(r) ? r : void 0;
44
- }, v = (e, t, r) => {
42
+ const n = K(e, t);
43
+ return (f = n == null ? void 0 : n.isValid) != null && f.call(n) ? n : void 0;
44
+ }, ee = (e, t, r, n = 0) => {
45
45
  if (r) {
46
- const n = S(e) ? e : [];
47
- return [C(n[0], t), C(n[1], t)];
46
+ const a = p(e) ? e : [];
47
+ return [
48
+ H(a[0], t, n),
49
+ H(a[1], t, n)
50
+ ];
48
51
  }
49
- return S(e) ? void 0 : C(e, t);
50
- }, E = (e, t, r) => {
52
+ return p(e) ? void 0 : H(e, t, n);
53
+ }, O = (e, t, r) => {
51
54
  if (e)
52
- return r === "timestamp" ? e.valueOf() : r === "Date" ? e.toDate() : T(r || t) ? ne(e, r || t) : e.format(r || t);
53
- }, ke = (e, t, r) => S(e) ? e.map((n) => E(n, t, r)) : E(e, t, r), de = (e) => S(e) ? e.map((t) => t == null ? void 0 : t.toDate()) : e == null ? void 0 : e.toDate(), Ye = (e, t, r, n = !1) => {
54
- const i = O(r), s = (c, k) => !c && !k ? !0 : !c || !k ? !1 : n ? c.valueOf() === k.valueOf() : c.isSame(k, i);
55
- return S(e) && S(t) ? s(e[0], t[0]) && s(e[1], t[1]) : !S(e) && !S(t) ? s(e, t) : !1;
56
- }, H = (e) => {
55
+ return r === "timestamp" ? e.valueOf() : r === "Date" ? e.toDate() : _(r || t) ? oe(e, r || t) : e.format(r || t);
56
+ }, me = (e, t, r) => p(e) ? e.map((n) => O(n, t, r)) : O(e, t, r), ke = (e) => p(e) ? e.map((t) => t == null ? void 0 : t.toDate()) : e == null ? void 0 : e.toDate(), le = (e, t, r, n = !1) => {
57
+ const a = z(r), f = (u, m) => !u && !m ? !0 : !u || !m ? !1 : n ? u.valueOf() === m.valueOf() : u.isSame(m, a);
58
+ return p(e) && p(t) ? f(e[0], t[0]) && f(e[1], t[1]) : !p(e) && !p(t) ? f(e, t) : !1;
59
+ }, te = (e) => {
57
60
  const [t, r] = e;
58
61
  return t && r && t.isAfter(r) ? [r, t] : [t, r];
59
- }, j = (e, t, r = 0) => {
62
+ }, A = (e, t, r = 0) => {
60
63
  if (t === "week") {
61
- const i = (e.day() - r + 7) % 7;
62
- return e.subtract(i, "day");
64
+ const a = (e.day() - r + 7) % 7;
65
+ return e.subtract(a, "day").startOf("day");
63
66
  }
64
- const n = O(t);
67
+ const n = z(t);
65
68
  return e.startOf(n);
66
- }, ye = (e, t, r) => {
67
- const n = typeof e.value == "function" ? e.value() : e.value, i = e.format || t;
68
- return v(n, i, r);
69
- }, me = (e, t) => {
69
+ }, ye = (e, t, r, n = 0) => {
70
+ const a = typeof e.value == "function" ? e.value() : e.value, f = e.format || t;
71
+ return ee(a, f, r, n);
72
+ }, he = (e, t) => {
70
73
  if (t === "year") {
71
74
  const r = Math.floor(e.year() / 12) * 12;
72
75
  return `${r} - ${r + 11}`;
73
76
  }
74
77
  return t === "date" || t === "week" ? e.format("YYYY-MM") : e.format("YYYY");
75
- }, D = (e, t = b.datePicker) => I(t.weekLabel, { week: e.week() }), ee = (e, t, r = b.datePicker) => t === "quarter" ? e.format("YYYY [Q]Q") : t === "week" ? `${e.format("YYYY-MM-DD")} ${D(e, r)}` : e.format(x[t]), le = ({
78
+ }, Q = (e, t = B.datePicker) => U(t.weekLabel, { week: e.week() }), re = (e, t, r = B.datePicker) => t === "quarter" ? e.format("YYYY [Q]Q") : t === "week" ? `${e.format("YYYY-MM-DD")} ${Q(e, r)}` : e.format(F[t]), Me = ({
76
79
  mode: e,
77
80
  viewDate: t,
78
81
  selectedValue: r,
79
82
  rangeValue: n,
80
- previewRangeValue: i,
81
- dayStartOfWeek: s,
82
- hideNotInViewDates: c,
83
- disabledDate: k,
84
- showLunar: W,
85
- locale: P = b.datePicker
83
+ previewRangeValue: a,
84
+ dayStartOfWeek: f,
85
+ hideNotInViewDates: u,
86
+ disabledDate: m,
87
+ showLunar: s,
88
+ locale: d = B.datePicker
86
89
  }) => {
87
- const f = O(e), $ = q(), [d, Y] = H(n ?? []), [y, m] = H(i ?? []), B = (g, w = !0) => {
88
- const u = j(g, e), V = !w, o = w, h = o && !!(r != null && r.isSame(u, f)), M = o && !!(d != null && d.isSame(u, f)), a = o && !!(Y != null && Y.isSame(u, f)), l = !!(o && d && Y && u.isAfter(d, f) && u.isBefore(Y, f)), R = o && !!(y != null && y.isSame(u, f)), p = o && !!(m != null && m.isSame(u, f)), L = !!(o && y && m && u.isAfter(y, f) && u.isBefore(m, f));
90
+ const i = z(e), P = C(), k = r && A(r, e, f), N = (w) => te(w).map((g) => g && A(g, e, f)), [l, y] = N(n ?? []), [h, M] = N(a ?? []), b = (w, g = !0) => {
91
+ const Y = A(w, e, f), L = !g, c = g, D = c && !!(k != null && k.isSame(Y, i)), R = c && !!(l != null && l.isSame(Y, i)), o = c && !!(y != null && y.isSame(Y, i)), S = !!(c && l && y && Y.isAfter(l, i) && Y.isBefore(y, i)), V = c && !!(h != null && h.isSame(Y, i)), q = c && !!(M != null && M.isSame(Y, i)), T = !!(c && h && M && Y.isAfter(h, i) && Y.isBefore(M, i));
89
92
  return {
90
- value: g,
91
- label: te(g, e, P),
92
- title: ee(g, e, P),
93
- inView: c ? w : !0,
94
- outView: V,
95
- selected: h,
96
- rangeStart: M,
97
- rangeEnd: a,
98
- inRange: l,
99
- previewRangeStart: R,
100
- previewRangeEnd: p,
101
- inPreviewRange: L,
102
- today: $.isSame(u, f),
103
- disabled: !!(k != null && k(u.toDate())),
104
- lunar: e === "date" ? J(g, W) : void 0
93
+ value: w,
94
+ label: ne(w, e, d),
95
+ title: re(w, e, d),
96
+ inView: u ? g : !0,
97
+ outView: L,
98
+ selected: D,
99
+ rangeStart: R,
100
+ rangeEnd: o,
101
+ inRange: S,
102
+ previewRangeStart: V,
103
+ previewRangeEnd: q,
104
+ inPreviewRange: T,
105
+ today: P.isSame(Y, i),
106
+ disabled: !!(m != null && m(Y.toDate())),
107
+ lunar: e === "date" ? X(w, s) : void 0
105
108
  };
106
109
  };
107
110
  if (e === "date" || e === "week") {
108
- const g = t.startOf("month"), w = (g.day() - s + 7) % 7, u = g.subtract(w, "day"), V = Array.from({ length: 42 }, (o, h) => {
109
- const M = u.add(h, "day"), a = B(M, M.month() === t.month());
111
+ const w = t.startOf("month"), g = (w.day() - f + 7) % 7, Y = w.subtract(g, "day"), L = Array.from({ length: 42 }, (c, D) => {
112
+ const R = Y.add(D, "day"), o = b(R, R.month() === t.month());
110
113
  if (e === "week") {
111
- const l = h % 7 === 0, R = j(M, e, s), p = a.inView, L = p && !!(r != null && r.isSame(R, f)), Q = p && !!(d != null && d.isSame(R, f)), _ = p && !!(Y != null && Y.isSame(R, f)), z = p && !!(y != null && y.isSame(R, f)), N = p && !!(m != null && m.isSame(R, f)), A = L || Q || _;
112
- a.selected = A, a.rangeStart = Q && l, a.rangeEnd = _ && l, a.previewRangeStart = z && l, a.previewRangeEnd = N && l, a.inRange = A || a.inRange, a.inPreviewRange = z || N || a.inPreviewRange, a.today = $.isSame(M, "day"), a.weekStart = l, a.weekEnd = h % 7 === 6, a.weekSelected = A, a.weekLabel = l ? D(M, P) : void 0;
114
+ const S = D % 7 === 0, V = A(R, e, f), q = o.inView, T = q && !!(k != null && k.isSame(V, i)), E = q && !!(l != null && l.isSame(V, i)), j = q && !!(y != null && y.isSame(V, i)), x = q && !!(h != null && h.isSame(V, i)), I = q && !!(M != null && M.isSame(V, i)), $ = T || E || j;
115
+ o.selected = $, o.rangeStart = E && S, o.rangeEnd = j && S, o.previewRangeStart = x && S, o.previewRangeEnd = I && S, o.inRange = $ || o.inRange, o.inPreviewRange = x || I || o.inPreviewRange, o.today = P.isSame(R, "day"), o.weekStart = S, o.weekEnd = D % 7 === 6, o.weekSelected = $, o.weekLabel = S ? Q(R, d) : void 0;
113
116
  }
114
- return a;
117
+ return o;
115
118
  });
116
- return e === "week" ? V.flatMap((o, h) => h % 7 !== 0 ? [o] : [
119
+ return e === "week" ? L.flatMap((c, D) => D % 7 !== 0 ? [c] : [
117
120
  {
118
- ...o,
119
- label: o.weekLabel || D(o.value, P),
120
- title: o.weekLabel || D(o.value, P),
121
+ ...c,
122
+ label: c.weekLabel || Q(c.value, d),
123
+ title: c.weekLabel || Q(c.value, d),
121
124
  isWeekLabel: !0,
122
125
  selected: !1,
123
126
  rangeStart: !1,
@@ -126,75 +129,82 @@ const K = {
126
129
  previewRangeEnd: !1,
127
130
  today: !1,
128
131
  disabled: !0,
129
- weekSelected: o.weekSelected
132
+ weekSelected: c.weekSelected
130
133
  },
131
- o
132
- ]) : V;
134
+ c
135
+ ]) : L;
133
136
  }
134
137
  if (e === "month")
135
- return Array.from({ length: 12 }, (g, w) => B(t.month(w), !0));
138
+ return Array.from({ length: 12 }, (w, g) => b(t.month(g), !0));
136
139
  if (e === "quarter")
137
- return Array.from({ length: 4 }, (g, w) => B(t.quarter(w + 1), !0));
138
- const F = Math.floor(t.year() / 12) * 12;
139
- return Array.from({ length: 12 }, (g, w) => B(t.year(F + w), !0));
140
- }, te = (e, t, r = b.datePicker) => t === "date" || t === "week" ? String(e.date()) : t === "month" ? I(r.monthLabel, {
140
+ return Array.from({ length: 4 }, (w, g) => b(t.quarter(g + 1), !0));
141
+ const J = Math.floor(t.year() / 12) * 12;
142
+ return Array.from({ length: 12 }, (w, g) => b(t.year(J + g), !0));
143
+ }, ne = (e, t, r = B.datePicker) => t === "date" || t === "week" ? String(e.date()) : t === "month" ? U(r.monthLabel, {
141
144
  month: e.format("M"),
142
145
  monthName: e.format("MMM")
143
- }) : t === "quarter" ? `Q${e.quarter()}` : e.format("YYYY"), re = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"], Se = (e, t = b.datePicker) => {
144
- const r = re.map((n) => t.weekdays[n]);
145
- return Array.from({ length: 7 }, (n, i) => r[(i + e) % 7]);
146
- }, he = (e, t, r, n = !1) => t === "date" || t === "week" ? e.add(r, n ? "year" : "month") : t === "month" || t === "quarter" ? e.add(r, "year") : e.add(r * 12, "year"), Me = (e, t, r = 1) => {
147
- const n = e || q();
146
+ }) : t === "quarter" ? `Q${e.quarter()}` : e.format("YYYY"), ae = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"], Se = (e, t = B.datePicker) => {
147
+ const r = ae.map((n) => t.weekdays[n]);
148
+ return Array.from({ length: 7 }, (n, a) => r[(a + e) % 7]);
149
+ }, pe = (e, t, r, n = !1) => t === "date" || t === "week" ? e.add(r, n ? "year" : "month") : t === "month" || t === "quarter" ? e.add(r, "year") : e.add(r * 12, "year"), De = (e, t, r = 1) => {
150
+ const n = e || C();
148
151
  return t === "date" || t === "week" ? n.add(r, "month") : t === "month" || t === "quarter" ? n.add(r, "year") : n.add(r * 12, "year");
149
- }, Re = (e, t) => {
150
- var s;
152
+ }, Re = (e, t, r = 0) => {
153
+ var u, m;
151
154
  if (!e) return;
152
- if (T(t)) {
153
- const c = U(e);
154
- return (s = c == null ? void 0 : c.isValid) != null && s.call(c) ? c : void 0;
155
+ if (_(t)) {
156
+ const s = G(e, r);
157
+ return (u = s == null ? void 0 : s.isValid) != null && u.call(s) ? s : void 0;
155
158
  }
156
- const r = q(e, t, !0);
157
- if (r.isValid()) return r;
158
- const n = q(e, t);
159
- if (n.isValid()) return n;
160
- const i = q(e);
161
- return i.isValid() ? i : void 0;
162
- }, T = (e) => /w|W/.test(e), U = (e) => {
163
- const t = /^(\d{4})\D+(\d{1,2})(?:st|nd|rd|th|周)?$/i.exec(e.trim());
164
- if (!t) return;
165
- const r = Number(t[1]), n = Number(t[2]);
166
- if (!(n < 1 || n > 53))
167
- return q().year(r).week(n).startOf("week");
168
- }, ne = (e, t) => {
159
+ const n = e.trim();
160
+ if ((m = t.match(/\[[^\]]*]|Q/g)) != null && m.includes("Q")) {
161
+ const s = H(n, t);
162
+ return (s == null ? void 0 : s.format(t)) === n ? s : void 0;
163
+ }
164
+ const f = (t.match(/\[[^\]]*]|MMMM|MMM|DDDD|DDD|MM|DD|HH|hh|mm|ss|./g) ?? []).reduce((s, d) => {
165
+ const i = ["MM", "DD", "HH", "hh", "mm", "ss"].includes(d) ? [d, d[0]] : [d];
166
+ return s.flatMap((P) => i.map((k) => P + k));
167
+ }, [""]);
168
+ for (const s of f) {
169
+ const d = C(n, s, !0);
170
+ if (d.isValid()) return d;
171
+ }
172
+ }, _ = (e) => /w|W/.test(e), G = (e, t = 0) => {
173
+ const r = /^(\d{4})\D+(\d{1,2})(?:st|nd|rd|th|周)?$/i.exec(e.trim());
174
+ if (!r) return;
175
+ const n = Number(r[1]), a = Number(r[2]);
176
+ if (!(a < 1 || a > 53))
177
+ return C().year(n).week(a).startOf("week").add(t, "day");
178
+ }, oe = (e, t) => {
169
179
  const r = e.format("wo");
170
180
  return t.includes("gggg") ? t.replace("gggg", String(e.weekYear())).replace("wo", r).replace("w", String(e.week())) : t.replace("YYYY", String(e.weekYear())).replace("wo", r).replace("w", String(e.week()));
171
181
  };
172
182
  export {
173
- le as createDateCells,
174
- x as defaultFormatMap,
175
- E as formatDateValue,
176
- ke as formatPanelValue,
177
- te as getCellLabel,
178
- ee as getCellTitle,
179
- ce as getDatePickerMode,
180
- de as getDateValueFromPanel,
181
- ge as getDefaultFormat,
182
- me as getHeaderLabel,
183
- O as getModeUnit,
184
- we as getRangePickerType,
185
- Me as getRangeViewDate,
183
+ Me as createDateCells,
184
+ F as defaultFormatMap,
185
+ O as formatDateValue,
186
+ me as formatPanelValue,
187
+ ne as getCellLabel,
188
+ re as getCellTitle,
189
+ ge as getDatePickerMode,
190
+ ke as getDateValueFromPanel,
191
+ we as getDefaultFormat,
192
+ he as getHeaderLabel,
193
+ z as getModeUnit,
194
+ Ye as getRangePickerType,
195
+ De as getRangeViewDate,
186
196
  ye as getShortcutValue,
187
- H as getSortedRange,
188
- D as getWeekLabel,
197
+ te as getSortedRange,
198
+ Q as getWeekLabel,
189
199
  Se as getWeekdayLabels,
190
- ue as isRangeType,
191
- Ye as isSameDateValue,
192
- K as modeMap,
193
- he as moveViewDate,
194
- j as normalizePanelValue,
195
- v as parseDateModelValue,
196
- C as parseDateValue,
200
+ de as isRangeType,
201
+ le as isSameDateValue,
202
+ Z as modeMap,
203
+ pe as moveViewDate,
204
+ A as normalizePanelValue,
205
+ ee as parseDateModelValue,
206
+ H as parseDateValue,
197
207
  Re as parseInputValue,
198
- Z as rangeTypeMap,
199
- X as rangeTypes
208
+ v as rangeTypeMap,
209
+ W as rangeTypes
200
210
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as oe, computed as s, ref as C, onBeforeUnmount as le, watch as P, createVNode as l, Teleport as ne, withDirectives as ae, mergeProps as ie, Transition as L, vShow as se } from "vue";
1
+ import { defineComponent as oe, computed as s, ref as C, onBeforeUnmount as le, watch as P, createVNode as o, Teleport as ne, withDirectives as ae, mergeProps as ie, Transition as L, vShow as se } from "vue";
2
2
  import { useLocale as de } from "../../locale/index.js";
3
3
  import { getComponentPrefix as re, getClassNameMixin as S } from "../../_utils/config.js";
4
4
  import { addUnit as _ } from "../../_utils/helpers.js";
@@ -10,13 +10,14 @@ import { useDialogFocus as be } from "../../_hooks/use-dialog-focus.js";
10
10
  import { usePopupTheme as ge } from "../../_hooks/use-popup-theme.js";
11
11
  import { KEYBOARD_KEY as ve } from "../../_utils/keyboard.js";
12
12
  import { getElement as ye, on as he, off as Ce } from "../../_utils/dom.js";
13
- import { dialogProps as we } from "./props.js";
14
- const xe = ["width", "minWidth", "height", "minHeight"];
15
- let ke = 0;
16
- const Ie = /* @__PURE__ */ oe({
13
+ import we from "../../icons/default/close.js";
14
+ import { dialogProps as xe } from "./props.js";
15
+ const ke = ["width", "minWidth", "height", "minHeight"];
16
+ let Te = 0;
17
+ const Me = /* @__PURE__ */ oe({
17
18
  name: re("Dialog"),
18
19
  inheritAttrs: !1,
19
- props: we,
20
+ props: xe,
20
21
  slots: Object,
21
22
  emits: ["closed", "close", "open", "opened", "update:modelValue"],
22
23
  setup(e, {
@@ -27,28 +28,28 @@ const Ie = /* @__PURE__ */ oe({
27
28
  const i = S("dialog"), {
28
29
  t: V
29
30
  } = de(), A = i.block, {
30
- popupThemeStyle: N,
31
- popupThemeName: R
32
- } = ge(), c = S("message-box"), m = `x-dialog-title-${++ke}`, j = () => [A, e.messageBox && "is-message-box", e.messageBox && c.block, e.popupClass && e.popupClass, d.class], F = () => {
31
+ popupThemeStyle: I,
32
+ popupThemeName: N
33
+ } = ge(), c = S("message-box"), m = `x-dialog-title-${++Te}`, R = () => [A, e.messageBox && "is-message-box", e.messageBox && c.block, e.popupClass && e.popupClass, d.class], j = () => {
33
34
  const {
34
35
  class: t,
35
- style: o,
36
+ style: l,
36
37
  id: O,
37
- "aria-label": Te,
38
- "aria-labelledby": Be,
39
- "aria-describedby": De,
38
+ "aria-label": Be,
39
+ "aria-labelledby": De,
40
+ "aria-describedby": Ee,
40
41
  ...te
41
42
  } = d;
42
43
  return te;
43
44
  }, f = s(() => {
44
45
  if (!(typeof document > "u"))
45
46
  return ye(e.renderTo) || document.body;
46
- }), b = C(), w = C(), I = s(() => e.disabled || !f.value), M = s(() => [N.value, {
47
+ }), b = C(), w = C(), z = s(() => e.disabled || !f.value), F = s(() => [I.value, {
47
48
  zIndex: U.value
48
- }, d.style]), z = s(() => {
49
+ }, d.style]), M = s(() => {
49
50
  const t = {};
50
- return e.fullscreen || (!e.center && e.top && (t.top = _(e.top)), xe.forEach((o) => {
51
- e[o] && (t[o] = _(e[o]));
51
+ return e.fullscreen || (!e.center && e.top && (t.top = _(e.top)), ke.forEach((l) => {
52
+ e[l] && (t[l] = _(e[l]));
52
53
  })), t;
53
54
  }), g = C(!1), n = s(() => e.modelValue), x = s(() => n.value || g.value), G = s(() => !e.destroyOnClosed || x.value), H = s(() => x.value), {
54
55
  zIndex: U,
@@ -59,8 +60,8 @@ const Ie = /* @__PURE__ */ oe({
59
60
  }), {
60
61
  setOverflowHidden: q,
61
62
  resetOverflow: T
62
- } = me(f, b), W = (t, o) => {
63
- r("update:modelValue", !1), r("close", t, o);
63
+ } = me(f, b), W = (t, l) => {
64
+ r("update:modelValue", !1), r("close", t, l);
64
65
  };
65
66
  let v = !1;
66
67
  const {
@@ -76,8 +77,8 @@ const Ie = /* @__PURE__ */ oe({
76
77
  requestClose: u
77
78
  } = fe(n, (t) => {
78
79
  if (!ce(e.onBeforeCancel)) return !0;
79
- const o = e.onBeforeCancel(t);
80
- return o && typeof o == "object" && "then" in o ? Promise.resolve(o).then((O) => !!O) : !!o;
80
+ const l = e.onBeforeCancel(t);
81
+ return l && typeof l == "object" && "then" in l ? Promise.resolve(l).then((O) => !!O) : !!l;
81
82
  }, W), Z = () => {
82
83
  e.maskToClose && e.mask && u("cancel");
83
84
  }, p = (t) => {
@@ -101,40 +102,40 @@ const Ie = /* @__PURE__ */ oe({
101
102
  immediate: !0
102
103
  }), P(() => e.escToClose, (t) => {
103
104
  n.value && (t ? K() : h());
104
- }), () => l(ne, {
105
+ }), () => o(ne, {
105
106
  to: f.value,
106
- disabled: I.value
107
+ disabled: z.value
107
108
  }, {
108
- default: () => [G.value && ae(l("div", ie({
109
+ default: () => [G.value && ae(o("div", ie({
109
110
  ref: b,
110
- "data-theme": R.value,
111
- class: j(),
112
- style: M.value,
111
+ "data-theme": N.value,
112
+ class: R(),
113
+ style: F.value,
113
114
  id: d.id
114
- }, F()), [l(L, {
115
+ }, j()), [o(L, {
115
116
  name: "x-fade-in-standard",
116
117
  appear: !0
117
118
  }, {
118
- default: () => [e.mask && n.value && l("div", {
119
+ default: () => [e.mask && n.value && o("div", {
119
120
  class: i.element("mask")
120
121
  }, null)]
121
- }), l("div", {
122
+ }), o("div", {
122
123
  class: [i.element("wrapper"), {
123
124
  "is-center": e.center
124
125
  }],
125
126
  onClick: (t) => t.target === t.currentTarget && Z()
126
- }, [l(L, {
127
+ }, [o(L, {
127
128
  name: "x-zoom-in",
128
129
  appear: !0,
129
130
  onAfterEnter: X,
130
131
  onAfterLeave: Q
131
132
  }, {
132
- default: () => [n.value && l("div", {
133
+ default: () => [n.value && o("div", {
133
134
  ref: w,
134
135
  class: [i.element("container"), {
135
136
  "is-fullscreen": e.fullscreen
136
137
  }],
137
- style: z.value,
138
+ style: M.value,
138
139
  role: "dialog",
139
140
  "aria-modal": e.mask ? "true" : void 0,
140
141
  "aria-label": e.title || a.title ? void 0 : d["aria-label"],
@@ -142,33 +143,35 @@ const Ie = /* @__PURE__ */ oe({
142
143
  "aria-describedby": d["aria-describedby"],
143
144
  tabindex: -1,
144
145
  onKeydown: J
145
- }, [l("div", {
146
+ }, [o("div", {
146
147
  class: [e.messageBox ? c.element("header") : i.element("header"), e.showHeaderBottomLine && "is-bottom-line"],
147
148
  id: a.title ? m : void 0
148
- }, [a.title ? a.title() : l("div", {
149
+ }, [a.title ? a.title() : o("div", {
149
150
  id: e.title ? m : void 0,
150
151
  class: [i.element("header-title")]
151
- }, [e.title])]), l("div", {
152
+ }, [e.title])]), o("div", {
152
153
  class: [e.messageBox ? c.element("body") : i.element("body")]
153
- }, [a.default && a.default()]), !e.hideFooter && a.footer && l("div", {
154
+ }, [a.default && a.default()]), !e.hideFooter && a.footer && o("div", {
154
155
  class: [e.messageBox ? c.element("footer") : i.element("footer")]
155
156
  }, [a.footer({
156
157
  cancel: p,
157
158
  ok: ee,
158
159
  loadingObj: D,
159
160
  "loading-obj": D
160
- })]), e.showClose && l("button", {
161
+ })]), e.showClose && o("button", {
161
162
  type: "button",
162
163
  class: [i.element("close-icon"), e.messageBox && c.element("close-icon")],
163
164
  "aria-label": V("common.closeTarget", {
164
165
  target: "对话框"
165
166
  }),
166
167
  onClick: (t) => u("cancel", t)
167
- }, null)])]
168
+ }, [o(we, {
169
+ size: "18px"
170
+ }, null)])])]
168
171
  })])]), [[se, H.value]])]
169
172
  });
170
173
  }
171
174
  });
172
175
  export {
173
- Ie as default
176
+ Me as default
174
177
  };
@@ -14,7 +14,7 @@ const o = {
14
14
  },
15
15
  top: {
16
16
  type: [String, Number],
17
- default: "3vh"
17
+ default: "100px"
18
18
  },
19
19
  center: {
20
20
  type: Boolean,