@keyblade/pro-components 1.13.8-alpha.23 → 1.13.8-alpha.25

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.
@@ -1,5 +1,6 @@
1
1
  import { IProCalendarProps } from './inerface';
2
2
  import { EMode } from './enum';
3
+ declare function changePageShowDate(type: 'prev' | 'next', unit: EMode): void;
3
4
  declare function __VLS_template(): {
4
5
  attrs: Partial<{}>;
5
6
  slots: Readonly<{
@@ -45,7 +46,9 @@ declare function __VLS_template(): {
45
46
  rootEl: HTMLDivElement;
46
47
  };
47
48
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
48
- declare const __VLS_component: import('vue').DefineComponent<IProCalendarProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
49
+ declare const __VLS_component: import('vue').DefineComponent<IProCalendarProps, {
50
+ changePageShowDate: typeof changePageShowDate;
51
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
49
52
  change: (date: Date) => any;
50
53
  "update:modelValue": (date: Date) => any;
51
54
  panelChange: (date: Date) => any;
@@ -54,11 +57,7 @@ declare const __VLS_component: import('vue').DefineComponent<IProCalendarProps,
54
57
  "onUpdate:modelValue"?: ((date: Date) => any) | undefined;
55
58
  onPanelChange?: ((date: Date) => any) | undefined;
56
59
  }>, {
57
- header: boolean | {
58
- hideLeft?: boolean;
59
- hideRight?: boolean;
60
- slot?: "start" | "date" | "end";
61
- };
60
+ header: boolean | import('./inerface').IHeaderObjProps;
62
61
  modes: (EMode.month | EMode.year)[];
63
62
  defaultMode: EMode.month | EMode.year;
64
63
  allowSelect: boolean;
@@ -1,16 +1,16 @@
1
- import { defineComponent as Q, useSlots as R, ref as k, computed as r, watch as U, createElementBlock as i, openBlock as m, mergeProps as v, createVNode as X, createCommentVNode as S, createSlots as b, withCtx as O, unref as u, renderSlot as P, normalizeClass as w, createBlock as x, toDisplayString as Z } from "vue";
1
+ import { defineComponent as R, useSlots as U, ref as k, computed as r, watch as X, createElementBlock as i, openBlock as m, mergeProps as v, createVNode as Z, createCommentVNode as S, createSlots as O, withCtx as P, unref as u, renderSlot as x, normalizeClass as w, createBlock as A, toDisplayString as ee } from "vue";
2
2
  import "dayjs";
3
- import ee from "./month.vue.js";
4
- import ae from "./year.vue.js";
5
- import te from "./header.vue.js";
6
- import { getDayjsValue as A, getNow as oe, pickDataAttributes as le, methods as h } from "@arco-design/web-vue/es/_utils/date";
7
- import { getPrefixCls as ne } from "@arco-design/web-vue/es/_utils/global-config";
8
- import { useI18n as re } from "@arco-design/web-vue/es/locale";
9
- import { getAllDaysByTime as ue } from "./month.js";
3
+ import ae from "./month.vue.js";
4
+ import te from "./year.vue.js";
5
+ import oe from "./header.vue.js";
6
+ import { getDayjsValue as N, getNow as le, pickDataAttributes as ne, methods as h } from "@arco-design/web-vue/es/_utils/date";
7
+ import { getPrefixCls as re } from "@arco-design/web-vue/es/_utils/global-config";
8
+ import { useI18n as ue } from "@arco-design/web-vue/es/locale";
9
+ import { getAllDaysByTime as de } from "./month.js";
10
10
  import { EMode as l } from "./enum.js";
11
- import { conclude as de } from "vue-global-config";
11
+ import { conclude as se } from "vue-global-config";
12
12
  import { globalProps as C } from "../global-props.js";
13
- const we = /* @__PURE__ */ Q({
13
+ const Ce = /* @__PURE__ */ R({
14
14
  __name: "calendar",
15
15
  props: {
16
16
  modelValue: {},
@@ -27,51 +27,51 @@ const we = /* @__PURE__ */ Q({
27
27
  panel: { type: Boolean, default: !1 }
28
28
  },
29
29
  emits: ["update:modelValue", "change", "panelChange"],
30
- setup(N, { emit: T }) {
31
- function j(e, o) {
30
+ setup(T, { expose: j, emit: E }) {
31
+ function F(e, o) {
32
32
  return e === l.month || e === l.year && !o ? "YYYY-MM-DD" : "YYYY-MM";
33
33
  }
34
- const t = N, s = T, D = R(), d = ne("calendar"), { t: g } = re(), V = k(t.defaultMode), n = r(() => t.mode ? t.mode : V.value), W = r(() => j(n.value, t.panel)), M = k(A(t.defaultValue || Date.now(), W.value)), p = r(() => t.modelValue ? A(t.modelValue, W.value) : M.value), a = k(p.value || oe());
35
- U(p, (e) => {
34
+ const t = T, s = E, D = U(), d = re("calendar"), { t: g } = ue(), V = k(t.defaultMode), n = r(() => t.mode ? t.mode : V.value), W = r(() => F(n.value, t.panel)), M = k(N(t.defaultValue || Date.now(), W.value)), p = r(() => t.modelValue ? N(t.modelValue, W.value) : M.value), a = k(p.value || le());
35
+ X(p, (e) => {
36
36
  a.value = e;
37
37
  });
38
- const B = r(() => ue(a.value, {
38
+ const B = r(() => de(a.value, {
39
39
  dayStartOfWeek: t.dayStartOfWeek,
40
40
  isWeek: t.isWeek
41
41
  }));
42
- function E(e) {
42
+ function z(e) {
43
43
  a.value = e, s("panelChange", e.toDate());
44
44
  }
45
45
  function Y(e) {
46
- M.value = e, s("change", e.toDate()), s("update:modelValue", e.toDate()), E(e);
46
+ M.value = e, s("change", e.toDate()), s("update:modelValue", e.toDate()), z(e);
47
47
  }
48
48
  function _(e, o = !1) {
49
49
  o || Y(e);
50
50
  }
51
- const F = r(() => n.value === l.month ? g("calendar.formatMonth") : n.value === l.year ? g("calendar.formatYear") : "");
52
- function z(e, o) {
51
+ const H = r(() => n.value === l.month ? g("calendar.formatMonth") : n.value === l.year ? g("calendar.formatYear") : "");
52
+ function $(e, o) {
53
53
  e.includes("prev") && (a.value = h.subtract(a.value, 1, o)), e.includes("next") && (a.value = h.add(a.value, 1, o)), s("panelChange", a.value.toDate());
54
54
  }
55
- function H(e) {
55
+ function I(e) {
56
56
  const o = h.set(a.value, l.year, e);
57
57
  a.value = o, s("panelChange", o.toDate());
58
58
  }
59
- function I(e) {
59
+ function q(e) {
60
60
  const o = h.set(a.value, l.month, e - 1);
61
61
  a.value = o, s("panelChange", o.toDate());
62
62
  }
63
- function q(e) {
63
+ function G(e) {
64
64
  V.value = e;
65
65
  }
66
- const G = r(() => [
66
+ const J = r(() => [
67
67
  d,
68
68
  n.value === l.month ? `${d}-mode-month` : `${d}-mode-year`,
69
69
  {
70
70
  [`${d}-panel`]: t.panel && (n.value === l.month || n.value === l.year)
71
71
  }
72
- ]), J = r(() => t.panel ? { width: t.panelWidth } : {}), K = r(() => le(t)), L = r(() => {
72
+ ]), K = r(() => t.panel ? { width: t.panelWidth } : {}), L = r(() => ne(t)), Q = r(() => {
73
73
  var e;
74
- return de([t.header, ((e = C.calendar) == null ? void 0 : e.header) || {}]);
74
+ return se([t.header, ((e = C.calendar) == null ? void 0 : e.header) || {}]);
75
75
  }), y = r(() => {
76
76
  var e, o;
77
77
  return {
@@ -79,26 +79,28 @@ const we = /* @__PURE__ */ Q({
79
79
  isWeek: ((o = C.calendar) == null ? void 0 : o.isWeek) || t.isWeek
80
80
  };
81
81
  });
82
- return (e, o) => (m(), i("div", v({
83
- class: G.value,
84
- style: J.value
85
- }, K.value), [
86
- X(te, v(y.value, {
87
- header: L.value,
82
+ return j({
83
+ changePageShowDate: $
84
+ }), (e, o) => (m(), i("div", v({
85
+ class: J.value,
86
+ style: K.value
87
+ }, L.value), [
88
+ Z(oe, v(y.value, {
89
+ header: Q.value,
88
90
  move: Y,
89
- "header-value-format": F.value,
91
+ "header-value-format": H.value,
90
92
  modes: e.modes,
91
93
  mode: n.value,
92
94
  "page-show-date": a.value,
93
- onModeChange: q,
94
- onYearChange: H,
95
- onMonthChange: I,
96
- onChangePageShowDate: z
97
- }), b({ _: 2 }, [
95
+ onModeChange: G,
96
+ onYearChange: I,
97
+ onMonthChange: q,
98
+ onChangePageShowDate: $
99
+ }), O({ _: 2 }, [
98
100
  u(D).header ? {
99
101
  name: "default",
100
- fn: O(({ year: c, month: f }) => [
101
- P(e.$slots, "header", {
102
+ fn: P(({ year: c, month: f }) => [
103
+ x(e.$slots, "header", {
102
104
  value: { year: c, month: f },
103
105
  year: c.toString(),
104
106
  month: f.toString().padStart(2, "0")
@@ -111,22 +113,22 @@ const we = /* @__PURE__ */ Q({
111
113
  key: 0,
112
114
  class: w(`${u(d)}-body`)
113
115
  }, [
114
- (m(), x(ee, v(y.value, {
116
+ (m(), A(ae, v(y.value, {
115
117
  key: a.value.month(),
116
118
  "page-data": B.value,
117
119
  value: p.value,
118
120
  mode: n.value,
119
121
  "select-handler": _,
120
122
  "page-show-date": a.value
121
- }), b({ _: 2 }, [
123
+ }), O({ _: 2 }, [
122
124
  u(D).default ? {
123
125
  name: "default",
124
- fn: O(({ year: c, month: f, date: $ }) => [
125
- P(e.$slots, "default", {
126
+ fn: P(({ year: c, month: f, date: b }) => [
127
+ x(e.$slots, "default", {
126
128
  year: c.toString(),
127
129
  month: f.toString().padStart(2, "0"),
128
- date: $.toString().padStart(2, "0"),
129
- value: { year: c, month: f, date: $ }
130
+ date: b.toString().padStart(2, "0"),
131
+ value: { year: c, month: f, date: b }
130
132
  })
131
133
  ]),
132
134
  key: "0"
@@ -137,7 +139,7 @@ const we = /* @__PURE__ */ Q({
137
139
  key: 1,
138
140
  class: w(`${u(d)}-body`)
139
141
  }, [
140
- (m(), x(ae, v(y.value, {
142
+ (m(), A(te, v(y.value, {
141
143
  key: a.value.year(),
142
144
  "page-data": B.value,
143
145
  "page-show-date": a.value,
@@ -149,10 +151,10 @@ const we = /* @__PURE__ */ Q({
149
151
  e.panel && e.panelTodayBtn ? (m(), i("div", {
150
152
  key: 2,
151
153
  class: w(`${u(d)}-footer-btn-wrapper`)
152
- }, Z(u(g)("today")), 3)) : S("", !0)
154
+ }, ee(u(g)("today")), 3)) : S("", !0)
153
155
  ], 16));
154
156
  }
155
157
  });
156
158
  export {
157
- we as default
159
+ Ce as default
158
160
  };
@@ -1,7 +1,7 @@
1
- import { defineComponent as z, useSlots as T, computed as s, withDirectives as v, createElementBlock as h, openBlock as d, normalizeClass as n, unref as o, renderSlot as g, createCommentVNode as y, createElementVNode as i, createVNode as u, Fragment as C, createBlock as Y, createTextVNode as D, toDisplayString as b, withCtx as E, vShow as c } from "vue";
2
- import { Select as F, Radio as I } from "@arco-design/web-vue";
3
- import O from "@arco-design/web-vue/es/button";
4
- import R from "@arco-design/web-vue/es/icon/icon-left";
1
+ import { defineComponent as z, useSlots as Y, computed as s, withDirectives as v, createElementBlock as m, openBlock as d, normalizeClass as n, unref as o, renderSlot as g, createCommentVNode as y, createElementVNode as i, createVNode as u, Fragment as C, createBlock as E, createTextVNode as D, toDisplayString as b, withCtx as I, vShow as c } from "vue";
2
+ import { Select as F, Radio as O } from "@arco-design/web-vue";
3
+ import R from "@arco-design/web-vue/es/button";
4
+ import T from "@arco-design/web-vue/es/icon/icon-left";
5
5
  import L from "@arco-design/web-vue/es/icon/icon-right";
6
6
  import { getNow as W } from "@arco-design/web-vue/es/_utils/date";
7
7
  import { isArray as j } from "@arco-design/web-vue/es/_utils/is";
@@ -13,7 +13,6 @@ const ee = /* @__PURE__ */ z({
13
13
  props: {
14
14
  mode: {},
15
15
  modes: {},
16
- headerType: {},
17
16
  pageShowDate: {},
18
17
  move: { type: Function },
19
18
  onYearChange: { type: Function },
@@ -28,10 +27,13 @@ const ee = /* @__PURE__ */ z({
28
27
  },
29
28
  emits: ["yearChange", "monthChange"],
30
29
  setup(B) {
31
- const l = B, m = T(), t = A("calendar"), { t: S } = G(), M = s(() => j(l.modes) ? l.modes.map((e) => ({
30
+ const l = B, h = Y(), t = A("calendar"), { t: S } = G(), M = s(() => j(l.modes) ? l.modes.map((e) => ({
32
31
  label: S(`datePicker.view.${e}`),
33
32
  value: e
34
- })) : []), N = s(() => l.headerType === "select"), r = s(() => l.pageShowDate.year()), p = s(() => l.pageShowDate.month() + 1), P = s(() => {
33
+ })) : []), N = s(() => {
34
+ var e;
35
+ return ((e = l.header) == null ? void 0 : e.headerType) === "select";
36
+ }), r = s(() => l.pageShowDate.year()), p = s(() => l.pageShowDate.month() + 1), P = s(() => {
35
37
  const e = [r.value];
36
38
  for (let a = 1; a <= 10; a++)
37
39
  e.unshift(r.value - a);
@@ -41,10 +43,10 @@ const ee = /* @__PURE__ */ z({
41
43
  }), V = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
42
44
  return (e, a) => {
43
45
  var w, $;
44
- return v((d(), h("div", {
46
+ return v((d(), m("div", {
45
47
  class: n(`${o(t)}-header`)
46
48
  }, [
47
- o(m).default && e.header.slot === "start" ? g(e.$slots, "default", {
49
+ o(h).default && e.header.slot === "start" ? g(e.$slots, "default", {
48
50
  key: 0,
49
51
  year: r.value,
50
52
  month: p.value
@@ -52,45 +54,45 @@ const ee = /* @__PURE__ */ z({
52
54
  v(i("div", {
53
55
  class: n(`${o(t)}-header-left`)
54
56
  }, [
55
- N.value ? (d(), h(C, { key: 0 }, [
57
+ N.value ? (d(), m(C, { key: 0 }, [
56
58
  u(o(F), {
57
59
  size: "small",
58
60
  class: n(`${o(t)}-header-value-year`),
59
61
  "default-value": r.value,
60
62
  options: P.value,
61
63
  onChange: a[0] || (a[0] = (f) => {
62
- console.log("change"), e.onYearChange(Number(f));
64
+ e.onYearChange(Number(f));
63
65
  }),
64
66
  "popup-container": `${o(t)}-header`
65
67
  }, null, 8, ["class", "default-value", "options", "popup-container"]),
66
- e.mode === o(k).month ? (d(), Y(o(F), {
68
+ e.mode === o(k).month ? (d(), E(o(F), {
67
69
  key: 0,
68
70
  size: "small",
69
71
  class: n(`${o(t)}-header-value-month`),
70
72
  "default-value": p.value,
71
73
  options: V,
72
74
  onChange: a[1] || (a[1] = (f) => {
73
- console.log("change"), e.onMonthChange(Number(f));
75
+ e.onMonthChange(Number(f));
74
76
  }),
75
77
  "popup-container": `${o(t)}-header`
76
78
  }, null, 8, ["class", "default-value", "popup-container"])) : y("", !0)
77
- ], 64)) : (d(), h(C, { key: 1 }, [
79
+ ], 64)) : (d(), m(C, { key: 1 }, [
78
80
  i("div", {
79
81
  class: n(`${o(t)}-header-icon`),
80
82
  role: "button",
81
83
  tabindex: "0",
82
84
  onClick: a[2] || (a[2] = () => e.onChangePageShowDate("prev", e.mode || o(k).month))
83
85
  }, [
84
- u(o(R))
86
+ u(o(T))
85
87
  ], 2),
86
88
  i("div", {
87
89
  class: n(`${o(t)}-header-value`)
88
90
  }, [
89
- o(m).default && (e.header.slot === "date" || !e.header.slot) ? g(e.$slots, "default", {
91
+ o(h).default && (e.header.slot === "date" || !e.header.slot) ? g(e.$slots, "default", {
90
92
  key: 0,
91
93
  year: r.value,
92
94
  month: p.value
93
- }) : (d(), h(C, { key: 1 }, [
95
+ }) : (d(), m(C, { key: 1 }, [
94
96
  D(b(e.pageShowDate.format(e.headerValueFormat)), 1)
95
97
  ], 64))
96
98
  ], 2),
@@ -103,11 +105,11 @@ const ee = /* @__PURE__ */ z({
103
105
  u(o(L))
104
106
  ], 2)
105
107
  ], 64)),
106
- u(o(O), {
108
+ u(o(R), {
107
109
  size: "small",
108
110
  onClick: a[4] || (a[4] = () => e.move(o(W)()))
109
111
  }, {
110
- default: E(() => [
112
+ default: I(() => [
111
113
  D(b(o(S)("datePicker.today")), 1)
112
114
  ]),
113
115
  _: 1
@@ -118,7 +120,7 @@ const ee = /* @__PURE__ */ z({
118
120
  v(i("div", {
119
121
  class: n(`${o(t)}-header-right`)
120
122
  }, [
121
- u(o(I).Group, {
123
+ u(o(O).Group, {
122
124
  size: "small",
123
125
  type: "button",
124
126
  options: M.value,
@@ -128,7 +130,7 @@ const ee = /* @__PURE__ */ z({
128
130
  ], 2), [
129
131
  [c, !(($ = e.header) != null && $.hideRight)]
130
132
  ]),
131
- o(m).default && e.header.slot === "end" ? g(e.$slots, "default", {
133
+ o(h).default && e.header.slot === "end" ? g(e.$slots, "default", {
132
134
  key: 1,
133
135
  year: r.value,
134
136
  month: p.value
@@ -7,16 +7,14 @@ declare const ProCalendar: {
7
7
  onChange?: ((date: Date) => any) | undefined;
8
8
  "onUpdate:modelValue"?: ((date: Date) => any) | undefined;
9
9
  onPanelChange?: ((date: Date) => any) | undefined;
10
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
10
+ }>, {
11
+ changePageShowDate: (type: "prev" | "next", unit: import('./enum').EMode) => void;
12
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
11
13
  change: (date: Date) => any;
12
14
  "update:modelValue": (date: Date) => any;
13
15
  panelChange: (date: Date) => any;
14
16
  }, import('vue').PublicProps, {
15
- header: boolean | {
16
- hideLeft?: boolean;
17
- hideRight?: boolean;
18
- slot?: "start" | "date" | "end";
19
- };
17
+ header: boolean | import('./inerface').IHeaderObjProps;
20
18
  modes: (import("./enum").EMode.month | import("./enum").EMode.year)[];
21
19
  defaultMode: import("./enum").EMode.month | import("./enum").EMode.year;
22
20
  allowSelect: boolean;
@@ -35,12 +33,10 @@ declare const ProCalendar: {
35
33
  onChange?: ((date: Date) => any) | undefined;
36
34
  "onUpdate:modelValue"?: ((date: Date) => any) | undefined;
37
35
  onPanelChange?: ((date: Date) => any) | undefined;
38
- }>, {}, {}, {}, {}, {
39
- header: boolean | {
40
- hideLeft?: boolean;
41
- hideRight?: boolean;
42
- slot?: "start" | "date" | "end";
43
- };
36
+ }>, {
37
+ changePageShowDate: (type: "prev" | "next", unit: import('./enum').EMode) => void;
38
+ }, {}, {}, {}, {
39
+ header: boolean | import('./inerface').IHeaderObjProps;
44
40
  modes: (import("./enum").EMode.month | import("./enum").EMode.year)[];
45
41
  defaultMode: import("./enum").EMode.month | import("./enum").EMode.year;
46
42
  allowSelect: boolean;
@@ -56,16 +52,14 @@ declare const ProCalendar: {
56
52
  onChange?: ((date: Date) => any) | undefined;
57
53
  "onUpdate:modelValue"?: ((date: Date) => any) | undefined;
58
54
  onPanelChange?: ((date: Date) => any) | undefined;
59
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
55
+ }>, {
56
+ changePageShowDate: (type: "prev" | "next", unit: import('./enum').EMode) => void;
57
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
60
58
  change: (date: Date) => any;
61
59
  "update:modelValue": (date: Date) => any;
62
60
  panelChange: (date: Date) => any;
63
61
  }, string, {
64
- header: boolean | {
65
- hideLeft?: boolean;
66
- hideRight?: boolean;
67
- slot?: "start" | "date" | "end";
68
- };
62
+ header: boolean | import('./inerface').IHeaderObjProps;
69
63
  modes: (import("./enum").EMode.month | import("./enum").EMode.year)[];
70
64
  defaultMode: import("./enum").EMode.month | import("./enum").EMode.year;
71
65
  allowSelect: boolean;
@@ -1,13 +1,15 @@
1
1
  import { Dayjs } from 'dayjs';
2
2
  import { EMode } from './enum';
3
- /**
4
- * @zh 隐藏头部
5
- */
6
- type IHeaderProps = boolean | {
3
+ export type IHeaderObjProps = {
7
4
  hideLeft?: boolean;
8
5
  hideRight?: boolean;
6
+ headerType?: 'select';
9
7
  slot?: 'start' | 'date' | 'end';
10
8
  };
9
+ /**
10
+ * @zh 隐藏头部
11
+ */
12
+ type IHeaderProps = boolean | IHeaderObjProps;
11
13
  interface IProCalendarBase {
12
14
  /** 0:周末开始 | 1:周一开始 */
13
15
  dayStartOfWeek?: 0 | 1;
@@ -25,7 +27,6 @@ export interface IProCalendarHeader extends IProCalendarBase {
25
27
  /** 模式 */
26
28
  mode?: EMode.month | EMode.year;
27
29
  modes?: (EMode.month | EMode.year)[];
28
- headerType?: string;
29
30
  pageShowDate: Dayjs;
30
31
  move: (time: Dayjs) => void;
31
32
  /** 年变化 */
@@ -21,9 +21,9 @@ export interface IProDateRangePickerProps {
21
21
  hideLabel?: boolean;
22
22
  formItemProps?: FormItemInstance;
23
23
  /** 日期选择器配置 */
24
- datePickerProps?: RangePickerProps;
24
+ datePickerProps?: Partial<RangePickerProps>;
25
25
  /** 时间选择器配置 */
26
- timePickerProps?: TimePickerProps;
26
+ timePickerProps?: Partial<TimePickerProps>;
27
27
  /** 自定义禁用开始日期 */
28
28
  disabledStartDate?: (params: {
29
29
  current: Date;
@@ -1,9 +1,9 @@
1
- import { defineComponent as N, ref as m, useSlots as A, useAttrs as j, computed as Y, resolveComponent as f, createElementBlock as O, openBlock as T, normalizeClass as U, createVNode as v, withCtx as u, mergeProps as _, unref as P, withModifiers as W, createSlots as q, createElementVNode as M, normalizeStyle as F, toDisplayString as G, renderList as H, renderSlot as J, normalizeProps as K, guardReactiveProps as Q } from "vue";
1
+ import { defineComponent as N, ref as m, useSlots as A, useAttrs as j, computed as Y, onMounted as O, resolveComponent as f, createElementBlock as T, openBlock as U, normalizeClass as W, createVNode as v, withCtx as u, mergeProps as _, unref as P, withModifiers as q, createSlots as F, createElementVNode as M, normalizeStyle as G, toDisplayString as H, renderList as J, renderSlot as K, normalizeProps as Q, guardReactiveProps as X } from "vue";
2
2
  import { conclude as h } from "vue-global-config";
3
3
  import { globalProps as C } from "../global-props.js";
4
- import n from "dayjs";
5
- import { initSelected as X, transDatesString as S } from "./util.js";
6
- const Z = ["onClick"], ee = "keyblade-pro-dates-picker", ne = /* @__PURE__ */ N({
4
+ import s from "dayjs";
5
+ import { initSelected as Z, transDatesString as S } from "./util.js";
6
+ const ee = ["onClick"], te = "keyblade-pro-dates-picker", se = /* @__PURE__ */ N({
7
7
  __name: "index",
8
8
  props: {
9
9
  modelValue: {},
@@ -31,39 +31,43 @@ const Z = ["onClick"], ee = "keyblade-pro-dates-picker", ne = /* @__PURE__ */ N(
31
31
  datePickerProps: {
32
32
  hideTrigger: !0
33
33
  }
34
- }, g = $, i = V, D = m(), x = m(null), s = m(X(i.modelValue)), b = A(), w = j(), k = m(), B = Y(() => {
35
- const { datePickerProps: e, ...a } = i, { datePickerProps: l, ...c } = y;
36
- return h([a, C.datesPicker || {}, c]);
34
+ }, g = $, l = V, D = m(), x = m(null), c = m(Z(l.modelValue)), b = A(), w = j(), k = m(), B = Y(() => {
35
+ const { datePickerProps: e, ...a } = l, { datePickerProps: n, ...i } = y;
36
+ return h([a, C.datesPicker || {}, i]);
37
37
  }), L = Y(() => {
38
38
  var e;
39
- return h([i.datePickerProps, ((e = C.datesPicker) == null ? void 0 : e.datePickerProps) || {}, y.datePickerProps]);
40
- }), r = Y({
41
- get: () => i.modelValue,
39
+ return h([l.datePickerProps, ((e = C.datesPicker) == null ? void 0 : e.datePickerProps) || {}, y.datePickerProps]);
40
+ }), o = Y({
41
+ get: () => l.modelValue,
42
42
  set: (e) => {
43
43
  typeof e == "string" ? g("update:modelValue", e || "") : g("update:modelValue", e || []);
44
44
  }
45
- }), R = (e) => {
46
- var c, p, d;
47
- const a = n(e).format("YYYY-MM-DD"), l = s.value.findIndex((o) => n(o).format("YYYY-MM-DD") === n(e).format("YYYY-MM-DD"));
48
- if (l !== -1) {
49
- if (s.value.splice(l, 1), typeof r.value == "string") {
50
- const o = a.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
51
- let t = (c = S(r.value)) == null ? void 0 : c.replace(new RegExp(`${o}, `, "g"), "");
52
- t = t == null ? void 0 : t.replace(new RegExp(`${o}`, "g"), ""), t = t == null ? void 0 : t.replace(/^, |, $/g, "").replace(/,{2,}/g, ",").trim(), r.value = t || "";
53
- } else if (r.value) {
54
- const o = (p = r.value) == null ? void 0 : p.findIndex((t) => n(t).format("YYYY-MM-DD") === n(e).format("YYYY-MM-DD"));
55
- o !== -1 && r.value.splice(o, 1);
45
+ });
46
+ O(() => {
47
+ (l.modelValue === null || l.modelValue === void 0) && (o.value = []);
48
+ });
49
+ const R = (e) => {
50
+ var i, p, d;
51
+ const a = s(e).format("YYYY-MM-DD"), n = c.value.findIndex((r) => s(r).format("YYYY-MM-DD") === s(e).format("YYYY-MM-DD"));
52
+ if (n !== -1) {
53
+ if (c.value.splice(n, 1), typeof o.value == "string") {
54
+ const r = a.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
55
+ let t = (i = S(o.value)) == null ? void 0 : i.replace(new RegExp(`${r}, `, "g"), "");
56
+ t = t == null ? void 0 : t.replace(new RegExp(`${r}`, "g"), ""), t = t == null ? void 0 : t.replace(/^, |, $/g, "").replace(/,{2,}/g, ",").trim(), o.value = t || "";
57
+ } else if (o.value) {
58
+ const r = (p = o.value) == null ? void 0 : p.findIndex((t) => s(t).format("YYYY-MM-DD") === s(e).format("YYYY-MM-DD"));
59
+ r !== -1 && o.value.splice(r, 1);
56
60
  }
57
61
  k.value = e.getDate();
58
62
  } else
59
- s.value.length < i.maxLength && (s.value.push(e), typeof r.value == "string" ? r.value += r.value ? `, ${a}` : a : (d = r.value) == null || d.push(a)), k.value = void 0;
60
- }, z = (e) => k.value === e.getDate() ? { backgroundColor: "transparent", color: "var(--color-text-1)" } : s.value.some((l) => n(l).format("YYYY-MM-DD") === n(e).format("YYYY-MM-DD")) ? { backgroundColor: "rgb(var(--primary-6))", color: "var(--color-white)" } : {}, E = (e) => {
61
- s.value = [], r.value = typeof r.value == "string" ? "" : [], g("clear", e);
63
+ c.value.length < l.maxLength && (c.value.push(e), typeof o.value == "string" ? o.value += o.value ? `, ${a}` : a : (d = o.value) == null || d.push(a)), k.value = void 0;
64
+ }, z = (e) => k.value === e.getDate() ? { backgroundColor: "transparent", color: "var(--color-text-1)" } : c.value.some((n) => s(n).format("YYYY-MM-DD") === s(e).format("YYYY-MM-DD")) ? { backgroundColor: "rgb(var(--primary-6))", color: "var(--color-white)" } : {}, E = (e) => {
65
+ c.value = [], o.value = typeof o.value == "string" ? "" : [], g("clear", e);
62
66
  };
63
67
  return (e, a) => {
64
- const l = f("icon-calendar"), c = f("a-input"), p = f("a-date-picker"), d = f("a-popover");
65
- return T(), O("div", {
66
- class: U(ee),
68
+ const n = f("icon-calendar"), i = f("a-input"), p = f("a-date-picker"), d = f("a-popover");
69
+ return U(), T("div", {
70
+ class: W(te),
67
71
  ref_key: "datePickerRef",
68
72
  ref: D
69
73
  }, [
@@ -75,37 +79,37 @@ const Z = ["onClick"], ee = "keyblade-pro-dates-picker", ne = /* @__PURE__ */ N(
75
79
  content: u(() => [
76
80
  v(p, _(L.value, {
77
81
  pickerValue: x.value,
78
- "onUpdate:pickerValue": a[0] || (a[0] = (o) => x.value = o),
82
+ "onUpdate:pickerValue": a[0] || (a[0] = (r) => x.value = r),
79
83
  style: { width: "268px" }
80
- }), q({
81
- cell: u(({ date: o }) => [
84
+ }), F({
85
+ cell: u(({ date: r }) => [
82
86
  M("div", {
83
87
  class: "arco-picker-date",
84
- onClick: (t) => R(o)
88
+ onClick: (t) => R(r)
85
89
  }, [
86
90
  M("div", {
87
- style: F(z(o)),
91
+ style: G(z(r)),
88
92
  class: "arco-picker-date-value"
89
- }, G(o.getDate()), 5)
90
- ], 8, Z)
93
+ }, H(r.getDate()), 5)
94
+ ], 8, ee)
91
95
  ]),
92
96
  _: 2
93
97
  }, [
94
- H(P(b), (o, t) => ({
98
+ J(P(b), (r, t) => ({
95
99
  name: t,
96
100
  fn: u((I) => [
97
- J(e.$slots, t, K(Q(I ?? {})))
101
+ K(e.$slots, t, Q(X(I ?? {})))
98
102
  ])
99
103
  }))
100
104
  ]), 1040, ["pickerValue"])
101
105
  ]),
102
106
  default: u(() => [
103
- v(c, _(_(B.value, P(w)), {
104
- "model-value": P(S)(r.value),
105
- onClear: W(E, ["stop"])
107
+ v(i, _(_(B.value, P(w)), {
108
+ "model-value": P(S)(o.value),
109
+ onClear: q(E, ["stop"])
106
110
  }), {
107
111
  suffix: u(() => [
108
- v(l)
112
+ v(n)
109
113
  ]),
110
114
  _: 1
111
115
  }, 16, ["model-value"])
@@ -117,5 +121,5 @@ const Z = ["onClick"], ee = "keyblade-pro-dates-picker", ne = /* @__PURE__ */ N(
117
121
  }
118
122
  });
119
123
  export {
120
- ne as default
124
+ se as default
121
125
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@keyblade/pro-components",
3
3
  "description": "KeyBlade Pro Components",
4
4
  "author": "yangshuai <704807396@qq.com>",
5
- "version": "1.13.8-alpha.23",
5
+ "version": "1.13.8-alpha.25",
6
6
  "private": false,
7
7
  "type": "module",
8
8
  "main": "es/index.js",