@aplus-frontend/ui 0.5.13 → 0.5.15

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 (33) hide show
  1. package/es/src/ap-button/interface.d.ts +1 -1
  2. package/es/src/ap-field/date/constant.d.ts +1 -1
  3. package/es/src/ap-field/date/constant.mjs +14 -2
  4. package/es/src/ap-field/date/index.vue.mjs +59 -58
  5. package/es/src/ap-field/date/interface.d.ts +1 -1
  6. package/es/src/ap-field/date-range/index.vue.mjs +67 -66
  7. package/es/src/ap-field/interface.d.ts +18 -2
  8. package/es/src/ap-field/select/index.vue.d.ts +1 -0
  9. package/es/src/ap-field/select/index.vue.mjs +98 -92
  10. package/es/src/ap-modal/index.mjs +33 -15
  11. package/es/src/ap-modal/utils/confirm.d.ts +17 -0
  12. package/es/src/ap-modal/utils/confirm.mjs +110 -0
  13. package/es/src/ap-modal/utils/createModal.mjs +2 -1
  14. package/es/src/ap-modal/utils/destroyFns.d.ts +2 -0
  15. package/es/src/ap-modal/utils/destroyFns.mjs +4 -0
  16. package/es/src/ap-table/constants.d.ts +3 -0
  17. package/lib/src/ap-button/interface.d.ts +1 -1
  18. package/lib/src/ap-field/date/constant.d.ts +1 -1
  19. package/lib/src/ap-field/date/constant.js +1 -1
  20. package/lib/src/ap-field/date/index.vue.js +1 -1
  21. package/lib/src/ap-field/date/interface.d.ts +1 -1
  22. package/lib/src/ap-field/date-range/index.vue.js +1 -1
  23. package/lib/src/ap-field/interface.d.ts +18 -2
  24. package/lib/src/ap-field/select/index.vue.d.ts +1 -0
  25. package/lib/src/ap-field/select/index.vue.js +1 -1
  26. package/lib/src/ap-modal/index.js +1 -1
  27. package/lib/src/ap-modal/utils/confirm.d.ts +17 -0
  28. package/lib/src/ap-modal/utils/confirm.js +1 -0
  29. package/lib/src/ap-modal/utils/createModal.js +1 -1
  30. package/lib/src/ap-modal/utils/destroyFns.d.ts +2 -0
  31. package/lib/src/ap-modal/utils/destroyFns.js +1 -0
  32. package/lib/src/ap-table/constants.d.ts +3 -0
  33. package/package.json +4 -4
@@ -1,12 +1,11 @@
1
- import { defineComponent as z, ref as B, onMounted as D, computed as f, unref as n, createElementBlock as E, createBlock as K, openBlock as C, toDisplayString as H, mergeProps as $, createSlots as j, renderList as W, withCtx as F, renderSlot as Y, normalizeProps as G, guardReactiveProps as J, createVNode as Q } from "vue";
2
- import { debounce as X, isFunction as b, isArray as Z, isNil as ee, omit as te } from "lodash-unified";
3
- import { Select as oe, Spin as le } from "@aplus-frontend/antdv";
1
+ import { defineComponent as z, ref as B, onMounted as E, watch as U, computed as p, unref as a, createElementBlock as K, createBlock as H, openBlock as C, toDisplayString as $, mergeProps as j, createSlots as W, renderList as Y, withCtx as F, renderSlot as G, normalizeProps as J, guardReactiveProps as Q, createVNode as X } from "vue";
2
+ import { debounce as Z, isFunction as b, isArray as ee, isNil as te, omit as oe } from "lodash-unified";
3
+ import { Select as le, Spin as ae } from "@aplus-frontend/antdv";
4
4
  import "../../hooks/index.mjs";
5
- import { omitUndefined as ne } from "../../utils/index.mjs";
6
- import { useDefaultPlaceholder as ae } from "../hooks/use-default-placeholder.mjs";
7
- import { useSelectOptions as re, SELECT_ALL_VALUE_KEY as p } from "./use-select-options.mjs";
5
+ import { useDefaultPlaceholder as ne } from "../hooks/use-default-placeholder.mjs";
6
+ import { useSelectOptions as re, SELECT_ALL_VALUE_KEY as m } from "./use-select-options.mjs";
8
7
  import { useControllableValue as ue } from "../../hooks/useControllableValue.mjs";
9
- const ie = { key: 0 }, ye = /* @__PURE__ */ z({
8
+ const ie = { key: 0 }, he = /* @__PURE__ */ z({
10
9
  name: "ApFieldSelect",
11
10
  __name: "index",
12
11
  props: {
@@ -93,34 +92,34 @@ const ie = { key: 0 }, ye = /* @__PURE__ */ z({
93
92
  searchMode: { default: "filter" },
94
93
  refetchOnFocus: { type: Boolean, default: !1 },
95
94
  lazy: { type: Boolean, default: !1 },
96
- addAll: { type: [Boolean, Number] }
95
+ addAll: { type: [Boolean, Number] },
96
+ params: {},
97
+ searchDelay: { default: 300 }
97
98
  },
98
99
  emits: ["update:value"],
99
100
  setup(N, { expose: O, emit: A }) {
100
101
  let u = 0;
101
- const V = X((e) => {
102
- if (!b(t.request))
102
+ const e = N, V = Z((t) => {
103
+ if (!b(e.request))
103
104
  return;
104
105
  u += 1;
105
106
  const o = u;
106
- s([]), r.value = !0, t.request(e).then((l) => {
107
- u === o && s(l);
108
- }).finally(() => {
109
- r.value = !1;
107
+ s([]), r.value = !0, e.request(t).then((l) => {
108
+ u === o && (s(l), r.value = !1);
110
109
  });
111
- }, 300), t = N, x = (e, o) => {
112
- var a;
113
- const l = ((a = t.fieldNames) == null ? void 0 : a.label) || "label";
114
- return typeof (o == null ? void 0 : o[l]) == "string" && o[l].toLowerCase().indexOf(e.toLowerCase()) > -1;
115
- }, { options: i, updateOptions: s } = re(t), m = B(), r = B((t == null ? void 0 : t.loading) || !1), I = A;
116
- async function v(e = !0) {
117
- if (!b(t.request))
110
+ }, e.searchDelay), x = (t, o) => {
111
+ var n;
112
+ const l = ((n = e.fieldNames) == null ? void 0 : n.label) || "label";
113
+ return typeof (o == null ? void 0 : o[l]) == "string" && o[l].toLowerCase().indexOf(t.toLowerCase()) > -1;
114
+ }, { options: i, updateOptions: s } = re(e), v = B(), r = B((e == null ? void 0 : e.loading) || !1), I = A;
115
+ async function d(t = !0) {
116
+ if (!b(e.request))
118
117
  return;
119
118
  r.value = !0, u += 1;
120
119
  const o = u;
121
120
  try {
122
- e && s([]);
123
- const l = await t.request();
121
+ t && s([]);
122
+ const l = await e.request(void 0, e.params);
124
123
  if (o !== u)
125
124
  return;
126
125
  s(l);
@@ -128,115 +127,122 @@ const ie = { key: 0 }, ye = /* @__PURE__ */ z({
128
127
  r.value = !1;
129
128
  }
130
129
  }
131
- function P(e) {
130
+ function P(t) {
132
131
  var o;
133
- (o = t.onFocus) == null || o.call(t, e), t.refetchOnFocus && u > 0 && !r.value && v(!0);
132
+ (o = e.onFocus) == null || o.call(e, t), e.refetchOnFocus && u > 0 && !r.value && d(!0);
134
133
  }
135
- D(() => {
136
- t.lazy || v();
137
- });
138
- const { value: d, updateValue: h } = ue(t, I), k = ae("Select", t), L = f(() => {
139
- var c, g;
140
- const e = n(d);
141
- if (!e)
142
- return t.emptyText;
143
- const o = ((c = t.fieldNames) == null ? void 0 : c.label) || "label", l = ((g = t.fieldNames) == null ? void 0 : g.value) || "value";
144
- if (Z(e))
145
- return e.map(
134
+ E(() => {
135
+ e.lazy || d();
136
+ }), U(
137
+ () => e.params,
138
+ () => {
139
+ d();
140
+ },
141
+ {
142
+ deep: !0
143
+ }
144
+ );
145
+ const { value: c, updateValue: h } = ue(e, I), k = ne("Select", e), L = p(() => {
146
+ var f, g;
147
+ const t = a(c);
148
+ if (!t)
149
+ return e.emptyText;
150
+ const o = ((f = e.fieldNames) == null ? void 0 : f.label) || "label", l = ((g = e.fieldNames) == null ? void 0 : g.value) || "value";
151
+ if (ee(t))
152
+ return t.map(
146
153
  (y) => {
147
154
  var w;
148
- return (w = n(i).find((U) => U[l] === y)) == null ? void 0 : w[o];
155
+ return (w = a(i).find((R) => R[l] === y)) == null ? void 0 : w[o];
149
156
  }
150
- ).filter(Boolean).join("、") || t.emptyText;
151
- const a = n(i).find(
152
- (y) => y[l] === e
157
+ ).filter(Boolean).join("、") || e.emptyText;
158
+ const n = a(i).find(
159
+ (y) => y[l] === t
153
160
  );
154
- return (a == null ? void 0 : a[o]) || t.emptyText;
155
- }), T = f(() => {
156
- const e = !!(t != null && t.showSearch), o = t.searchMode;
161
+ return (n == null ? void 0 : n[o]) || e.emptyText;
162
+ }), T = p(() => {
163
+ const t = !!(e != null && e.showSearch), o = e.searchMode;
157
164
  let l = {};
158
- return e && (l = o === "request" ? {
165
+ return t && (l = o === "request" ? {
159
166
  showArrow: !1,
160
167
  defaultActiveFirstOption: !1,
161
168
  onSearch: V,
162
- notFoundContent: r.value ? void 0 : null
169
+ notFoundContent: r.value ? void 0 : null,
170
+ filterOption: !1
163
171
  } : {
164
172
  showArrow: !0,
165
- filterOption: ee(t == null ? void 0 : t.filterOption) ? x : t == null ? void 0 : t.filterOption
173
+ filterOption: te(e == null ? void 0 : e.filterOption) ? x : e == null ? void 0 : e.filterOption
166
174
  }), {
167
- ...ne(
168
- te(t, [
169
- "mode",
170
- "value",
171
- "onUpdate:value",
172
- "onSearch",
173
- "request",
174
- "searchMode",
175
- "onFocus",
176
- "onBeforeSelect"
177
- ])
178
- ),
179
- placeholder: n(k),
175
+ ...oe(e, [
176
+ "mode",
177
+ "value",
178
+ "onUpdate:value",
179
+ "onSearch",
180
+ "request",
181
+ "searchMode",
182
+ "onFocus",
183
+ "onBeforeSelect"
184
+ ]),
185
+ placeholder: a(k),
180
186
  ...l
181
187
  };
182
- }), S = f(
183
- () => i.value.map((e) => {
188
+ }), S = p(
189
+ () => i.value.map((t) => {
184
190
  var o;
185
- return e[((o = t.fieldNames) == null ? void 0 : o.value) || "value"];
186
- }).filter((e) => e !== p)
187
- ), _ = f(() => {
188
- if (!t.multiple || !t.addAll)
189
- return n(d);
191
+ return t[((o = e.fieldNames) == null ? void 0 : o.value) || "value"];
192
+ }).filter((t) => t !== m)
193
+ ), _ = p(() => {
194
+ if (!e.multiple || !e.addAll)
195
+ return a(c);
190
196
  if (i.value.some(
191
- (e) => {
197
+ (t) => {
192
198
  var o;
193
- return e[((o = t.fieldNames) == null ? void 0 : o.value) || "value"] === p;
199
+ return t[((o = e.fieldNames) == null ? void 0 : o.value) || "value"] === m;
194
200
  }
195
201
  )) {
196
- const e = n(S), o = n(d) || [];
197
- if (e.length && e.every((l) => o == null ? void 0 : o.includes(l)))
198
- return [p];
202
+ const t = a(S), o = a(c) || [];
203
+ if (t.length && t.every((l) => o == null ? void 0 : o.includes(l)))
204
+ return [m];
199
205
  }
200
- return n(d);
206
+ return a(c);
201
207
  });
202
- function q(e) {
203
- return t.multiple && e.includes(p) ? h(n(S)) : h(e);
208
+ function q(t) {
209
+ return e.multiple && t.includes(m) ? h(a(S)) : h(t);
204
210
  }
205
211
  function M() {
206
- var e;
207
- (e = m.value) == null || e.focus();
212
+ var t;
213
+ (t = v.value) == null || t.focus();
208
214
  }
209
- function R() {
210
- var e;
211
- (e = m.value) == null || e.blur();
215
+ function D() {
216
+ var t;
217
+ (t = v.value) == null || t.blur();
212
218
  }
213
219
  return O({
214
220
  focus: M,
215
- blur: R,
216
- request: v
217
- }), (e, o) => e.mode === "read" ? (C(), E("span", ie, H(L.value), 1)) : (C(), K(n(oe), $({
221
+ blur: D,
222
+ request: d
223
+ }), (t, o) => t.mode === "read" ? (C(), K("span", ie, $(L.value), 1)) : (C(), H(a(le), j({
218
224
  key: 1,
219
225
  ref_key: "selectRef",
220
- ref: m,
226
+ ref: v,
221
227
  "allow-clear": ""
222
228
  }, T.value, {
223
- mode: e.multiple ? "multiple" : void 0,
229
+ mode: t.multiple ? "multiple" : void 0,
224
230
  value: _.value,
225
- options: n(i),
231
+ options: a(i),
226
232
  loading: r.value,
227
233
  "onUpdate:value": q,
228
234
  onFocus: P
229
- }), j({ _: 2 }, [
230
- W(e.$slots, (l, a) => ({
231
- name: a,
232
- fn: F((c) => [
233
- Y(e.$slots, a, G(J(c || {})))
235
+ }), W({ _: 2 }, [
236
+ Y(t.$slots, (l, n) => ({
237
+ name: n,
238
+ fn: F((f) => [
239
+ G(t.$slots, n, J(Q(f || {})))
234
240
  ])
235
241
  })),
236
242
  r.value ? {
237
243
  name: "notFoundContent",
238
244
  fn: F(() => [
239
- Q(n(le), { size: "small" })
245
+ X(a(ae), { size: "small" })
240
246
  ]),
241
247
  key: "0"
242
248
  } : void 0
@@ -244,5 +250,5 @@ const ie = { key: 0 }, ye = /* @__PURE__ */ z({
244
250
  }
245
251
  });
246
252
  export {
247
- ye as default
253
+ he as default
248
254
  };
@@ -1,11 +1,12 @@
1
- import { Modal as a } from "@aplus-frontend/antdv";
1
+ import { Modal as c } from "@aplus-frontend/antdv";
2
2
  import "./utils/index.mjs";
3
3
  import { omit as m } from "lodash-unified";
4
+ import t, { withWarn as f, withInfo as a, withSuccess as s, withError as l, withConfirm as u } from "./utils/confirm.mjs";
5
+ import i from "./utils/destroyFns.mjs";
4
6
  import "./interface.mjs";
5
- import { createModal as e } from "./utils/createModal.mjs";
6
- import { createModalStream as n } from "./utils/createModalStream.mjs";
7
- import { methodsFn as o } from "./utils/methods.mjs";
8
- const r = m(a, [
7
+ import { createModal as p } from "./utils/createModal.mjs";
8
+ import { createModalStream as d } from "./utils/createModalStream.mjs";
9
+ const o = m(c, [
9
10
  "confirm",
10
11
  "warning",
11
12
  "warn",
@@ -13,15 +14,32 @@ const r = m(a, [
13
14
  "success",
14
15
  "info"
15
16
  ]);
16
- r.createModal = e;
17
- r.createModalStream = n;
18
- r.confirm = o("confirm");
19
- r.warning = o("warning");
20
- r.warn = o("warning");
21
- r.error = o("error");
22
- r.success = o("success");
23
- r.info = o("info");
24
- r.name = "ApModal";
17
+ o.createModal = p;
18
+ o.createModalStream = d;
19
+ function e(n) {
20
+ return t(f(n));
21
+ }
22
+ o.info = function(r) {
23
+ return t(a(r));
24
+ };
25
+ o.success = function(r) {
26
+ return t(s(r));
27
+ };
28
+ o.error = function(r) {
29
+ return t(l(r));
30
+ };
31
+ o.warning = e;
32
+ o.warn = e;
33
+ o.confirm = function(r) {
34
+ return t(u(r));
35
+ };
36
+ o.destroyAll = function() {
37
+ for (; i.length; ) {
38
+ const r = i.pop();
39
+ r && r();
40
+ }
41
+ };
42
+ o.name = "ApModal";
25
43
  export {
26
- r as ApModal
44
+ o as ApModal
27
45
  };
@@ -0,0 +1,17 @@
1
+ import { ModalFuncProps } from '@aplus-frontend/antdv';
2
+ type ConfigUpdate = ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps);
3
+ export type ModalStaticFunctions<T = ModalFunc> = Record<NonNullable<ModalFuncProps['type']>, T>;
4
+ export type ModalFunc = (props: ModalFuncProps) => {
5
+ destroy: () => void;
6
+ update: (configUpdate: ConfigUpdate) => void;
7
+ };
8
+ declare const confirm: (config: ModalFuncProps) => {
9
+ destroy: (this: /*elided*/ any, ...args: any[]) => void;
10
+ update: (configUpdate: ConfigUpdate) => void;
11
+ };
12
+ export default confirm;
13
+ export declare function withWarn(props: ModalFuncProps): ModalFuncProps;
14
+ export declare function withInfo(props: ModalFuncProps): ModalFuncProps;
15
+ export declare function withSuccess(props: ModalFuncProps): ModalFuncProps;
16
+ export declare function withError(props: ModalFuncProps): ModalFuncProps;
17
+ export declare function withConfirm(props: ModalFuncProps): ModalFuncProps;
@@ -0,0 +1,110 @@
1
+ import { render as s, cloneVNode as h, createVNode as a, mergeProps as m } from "vue";
2
+ import P from "@aplus-frontend/antdv/es/modal/ConfirmDialog";
3
+ import { omit as b } from "lodash-unified";
4
+ import "../../config-provider/index.mjs";
5
+ import { getConfirmLocale as w } from "@aplus-frontend/antdv/es/modal/locale";
6
+ import { globalConfigForApi as v } from "@aplus-frontend/antdv/es/config-provider";
7
+ import c from "./destroyFns.mjs";
8
+ import { globalConfigCached as D, ConfigProvider as F } from "../../config-provider/config-provider.mjs";
9
+ const A = (e) => {
10
+ const f = document.createDocumentFragment();
11
+ let n = {
12
+ ...b(e, ["parentContext", "appContext"]),
13
+ close: l,
14
+ open: !0,
15
+ centered: !0
16
+ }, i = null;
17
+ function x(...t) {
18
+ i && (s(null, f), i = null);
19
+ const r = t.some((o) => o && o.triggerCancel);
20
+ e.onCancel && r && e.onCancel(() => {
21
+ }, ...t.slice(1));
22
+ for (let o = 0; o < c.length; o++)
23
+ if (c[o] === l) {
24
+ c.splice(o, 1);
25
+ break;
26
+ }
27
+ }
28
+ function l(...t) {
29
+ n = {
30
+ ...n,
31
+ open: !1,
32
+ afterClose: () => {
33
+ typeof e.afterClose == "function" && e.afterClose(), x.apply(this, t);
34
+ }
35
+ }, n.visible && delete n.visible, p(n);
36
+ }
37
+ function p(t) {
38
+ typeof t == "function" ? n = t(n) : n = {
39
+ ...n,
40
+ ...t
41
+ }, i && s(h(i, {
42
+ ...n
43
+ }), f);
44
+ }
45
+ const d = (t) => {
46
+ const r = {
47
+ ...v,
48
+ ...D.value
49
+ }, o = r.prefixCls, u = t.prefixCls || `${o}-modal`, g = r.iconPrefixCls, C = w();
50
+ return a(F, m(r, {
51
+ prefixCls: o
52
+ }), {
53
+ default: () => [a(P, m(t, {
54
+ rootPrefixCls: o,
55
+ prefixCls: u,
56
+ iconPrefixCls: g,
57
+ locale: C,
58
+ cancelText: t.cancelText || C.cancelText
59
+ }), null)]
60
+ });
61
+ };
62
+ function y(t) {
63
+ const r = a(d, {
64
+ ...t
65
+ });
66
+ return r.appContext = e.parentContext || e.appContext || r.appContext, s(r, f), r;
67
+ }
68
+ return i = y(n), c.push(l), {
69
+ destroy: l,
70
+ update: p
71
+ };
72
+ };
73
+ function E(e) {
74
+ return {
75
+ ...e,
76
+ type: "warning"
77
+ };
78
+ }
79
+ function S(e) {
80
+ return {
81
+ ...e,
82
+ type: "info"
83
+ };
84
+ }
85
+ function j(e) {
86
+ return {
87
+ ...e,
88
+ type: "success"
89
+ };
90
+ }
91
+ function q(e) {
92
+ return {
93
+ ...e,
94
+ type: "error"
95
+ };
96
+ }
97
+ function z(e) {
98
+ return {
99
+ ...e,
100
+ type: "confirm"
101
+ };
102
+ }
103
+ export {
104
+ A as default,
105
+ z as withConfirm,
106
+ q as withError,
107
+ S as withInfo,
108
+ j as withSuccess,
109
+ E as withWarn
110
+ };
@@ -86,7 +86,8 @@ const J = (c) => {
86
86
  },
87
87
  open: this.open,
88
88
  onCancel: this.handleCancel,
89
- onOk: this.handleOk
89
+ onOk: this.handleOk,
90
+ centered: !0
90
91
  }, e), {
91
92
  default: () => {
92
93
  var o;
@@ -0,0 +1,2 @@
1
+ declare const destroyFns: Array<() => void>;
2
+ export default destroyFns;
@@ -0,0 +1,4 @@
1
+ const s = [];
2
+ export {
3
+ s as default
4
+ };
@@ -2616,6 +2616,7 @@ export declare const apTableRenderItemMap: {
2616
2616
  emptyText: string;
2617
2617
  searchMode: "filter" | "request";
2618
2618
  refetchOnFocus: boolean;
2619
+ searchDelay: number;
2619
2620
  }, false, {}, {}, GlobalComponents, GlobalDirectives, string, {
2620
2621
  selectRef: CreateComponentPublicInstanceWithMixins<Readonly< ExtractPropTypes<{
2621
2622
  value: {
@@ -3053,6 +3054,7 @@ export declare const apTableRenderItemMap: {
3053
3054
  emptyText: string;
3054
3055
  searchMode: "filter" | "request";
3055
3056
  refetchOnFocus: boolean;
3057
+ searchDelay: number;
3056
3058
  }>;
3057
3059
  __isFragment?: never;
3058
3060
  __isTeleport?: never;
@@ -3085,6 +3087,7 @@ export declare const apTableRenderItemMap: {
3085
3087
  emptyText: string;
3086
3088
  searchMode: "filter" | "request";
3087
3089
  refetchOnFocus: boolean;
3090
+ searchDelay: number;
3088
3091
  }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
3089
3092
  $slots: Readonly<{
3090
3093
  notFoundContent: any;
@@ -13,6 +13,6 @@ export type ApButtonSlots = {
13
13
  };
14
14
  export type ApConfirButtonProps = ApButtonProps & {
15
15
  title: ModalFuncProps['title'];
16
- content: ModalFuncProps['content'];
16
+ content?: ModalFuncProps['content'];
17
17
  confirmProps?: ModalFuncProps;
18
18
  };
@@ -1,7 +1,7 @@
1
1
  import { PickerMode } from '@aplus-frontend/antdv/es/vc-picker/interface';
2
2
  import { ApFormatPresetType } from './interface';
3
3
  export declare const ApFieldDatePresetFormats: string[];
4
- export declare const PRESET_FORMAT_MAP: Record<ApFormatPresetType, string>;
4
+ export declare const PRESET_FORMAT_MAP: Record<ApFormatPresetType, string | undefined>;
5
5
  export declare const PRESET_FORMAT_PICK_MAP: Record<ApFormatPresetType, PickerMode>;
6
6
  export declare const PRESET_FORMAT_TIME_MAP: Record<ApFormatPresetType, {
7
7
  showTime: boolean;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=["Y","Y-M","Y-D","Y-h","Y-m","Y-s"],e={Y:"YYYY","Y-M":"YYYY-MM","Y-D":"YYYY-MM-DD","Y-h":"YYYY-MM-DD HH","Y-m":"YYYY-MM-DD HH:mm","Y-s":"YYYY-MM-DD HH:mm:ss"},s={Y:"year","Y-M":"month","Y-D":"date","Y-h":"date","Y-m":"date","Y-s":"date"},M={Y:{showTime:!1},"Y-M":{showTime:!1},"Y-D":{showTime:!1},"Y-h":{showTime:!0,showSecond:!1,showMinute:!1},"Y-m":{showTime:!0,showSecond:!1},"Y-s":{showTime:!0}};exports.ApFieldDatePresetFormats=Y;exports.PRESET_FORMAT_MAP=e;exports.PRESET_FORMAT_PICK_MAP=s;exports.PRESET_FORMAT_TIME_MAP=M;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=["Y","Y-Q","Y-M","Y-W","Y-D","Y-h","Y-m","Y-s"],e={Y:"YYYY","Y-Q":void 0,"Y-M":"YYYY-MM","Y-W":void 0,"Y-D":"YYYY-MM-DD","Y-h":"YYYY-MM-DD HH","Y-m":"YYYY-MM-DD HH:mm","Y-s":"YYYY-MM-DD HH:mm:ss"},s={Y:"year","Y-Q":"quarter","Y-M":"month","Y-W":"week","Y-D":"date","Y-h":"date","Y-m":"date","Y-s":"date"},M={Y:{showTime:!1},"Y-Q":{showTime:!1},"Y-M":{showTime:!1},"Y-W":{showTime:!1},"Y-D":{showTime:!1},"Y-h":{showTime:!0,showSecond:!1,showMinute:!1},"Y-m":{showTime:!0,showSecond:!1},"Y-s":{showTime:!0}};exports.ApFieldDatePresetFormats=Y;exports.PRESET_FORMAT_MAP=e;exports.PRESET_FORMAT_PICK_MAP=s;exports.PRESET_FORMAT_TIME_MAP=M;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("dayjs"),c=require("@aplus-frontend/antdv"),f=require("./constant.js");require("../../hooks/index.js");const y=require("lodash-unified"),O=require("./helper.js"),_=require("@aplus-frontend/utils"),A=require("../hooks/use-default-placeholder.js"),D=require("../hooks/use-date-timezone.js"),M=require("../../hooks/useControllableValue.js"),x=e.defineComponent({name:"ApFieldDate",__name:"index",props:{mode:{default:"edit"},class:{},style:{},dropdownClassName:{},dropdownAlign:{},popupStyle:{},transitionName:{},placeholder:{},allowClear:{type:Boolean,default:!0},autofocus:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},tabindex:{},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:void 0},inputReadOnly:{type:Boolean,default:void 0},id:{},presets:{},suffixIcon:{type:[Object,String,Number,Boolean,null,Array],default:void 0},clearIcon:{type:[Object,String,Number,Boolean,null,Array],default:void 0},getPopupContainer:{},panelRender:{},inputRender:{},onOpenChange:{},onPanelChange:{},onFocus:{},onBlur:{},onMousedown:{},onMouseup:{},onMouseenter:{},onMouseleave:{},onClick:{},onContextmenu:{},onKeydown:{},role:{},name:{},autocomplete:{},direction:{},showToday:{type:Boolean,default:void 0},showTime:{type:Boolean,default:void 0},picker:{},prefixCls:{},defaultPickerValue:{},disabledDate:{},dateRender:{},monthCellRender:{},renderExtraFooter:{},onSelect:{},locale:{},size:{},bordered:{type:Boolean,default:void 0},showNow:{type:Boolean,default:void 0},disabledTime:{},defaultOpenValue:{},showHour:{type:Boolean,default:void 0},showMinute:{type:Boolean,default:void 0},showSecond:{type:Boolean,default:void 0},use12Hours:{type:Boolean,default:void 0},hourStep:{},minuteStep:{},secondStep:{},hideDisabledOptions:{type:Boolean,default:void 0},disabledHours:{},disabledMinutes:{},disabledSeconds:{},valueFormat:{},emptyText:{default:"--"},value:{},defaultValue:{},onChange:{},onOk:{},format:{default:"Y-D"},formatBegins:{type:Boolean,default:!0},timezone:{}},emits:["update:value"],setup(B,{emit:k}){const o=B,g=k,{value:p,updateValue:h}=M.useControllableValue(o,g),C=A.useDefaultPlaceholder("Date",o),{currentTimezone:i}=D.useDateTimezone(o),r=e.computed(()=>f.ApFieldDatePresetFormats.indexOf(o.format)>-1),d=e.computed(()=>r.value?f.PRESET_FORMAT_MAP[o.format]:o.format),m=e.computed(()=>{if(y.isNil(e.unref(p)))return;let n=u(e.unref(p));return o.timezone&&(n=u(_.getTimeFormatToZone(e.unref(p),i.value))),n}),P=e.computed(()=>e.unref(r)?o.picker??f.PRESET_FORMAT_PICK_MAP[o.format]:o.picker),S=e.computed(()=>{const n=e.unref(r)?f.PRESET_FORMAT_TIME_MAP[o.format]:{};return{...y.omit(o,["value","defaultValue","onChange","onOk","format","onUpdate:value","mode"]),placeholder:e.unref(C),...n}}),v=(n,a,t=!0)=>O.formatDayWithTimezone(i.value)(n,a,t);function T(n){if(y.isNil(n)){h(null);return}const a=u(n);h(v(a,e.unref(r)?e.unref(d):void 0,o.formatBegins))}function b(n,a){var s;const t=u(n),l=n?v(t,e.unref(r)?e.unref(d):void 0,o.formatBegins):null;(s=o.onChange)==null||s.call(o,l,a)}function w(n){var l;const a=u(n),t=n?v(a,e.unref(r)?e.unref(d):void 0,o.formatBegins):null;(l=o.onOk)==null||l.call(o,t)}return(n,a)=>n.mode==="read"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(m.value?e.unref(u)(m.value).format(d.value):n.emptyText),1)],64)):(e.openBlock(),e.createBlock(e.unref(c.InputGroup),{key:1,compact:"",style:e.normalizeStyle({display:Array.isArray(o.timezone)&&o.timezone.length?"flex":"block"})},{default:e.withCtx(()=>[Array.isArray(o.timezone)&&o.timezone.length?(e.openBlock(),e.createBlock(e.unref(c.Select),{key:0,value:e.unref(i),"onUpdate:value":a[0]||(a[0]=t=>e.isRef(i)?i.value=t:null),"default-active-first-option":"","dropdown-match-select-width":!1,style:{"max-width":"50%"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.timezone,t=>(e.openBlock(),e.createBlock(e.unref(c.SelectOption),{key:t==null?void 0:t.value,value:t==null?void 0:t.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString((t==null?void 0:t.label)??(t==null?void 0:t.value)),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])):e.createCommentVNode("",!0),e.createVNode(e.unref(c.DatePicker),e.mergeProps(S.value,{value:m.value,format:d.value,picker:P.value,"onUpdate:value":T,onChange:b,onOk:w}),e.createSlots({_:2},[e.renderList(n.$slots,(t,l)=>({name:l,fn:e.withCtx(s=>[e.renderSlot(n.$slots,l,e.normalizeProps(e.guardReactiveProps(s||{})))])}))]),1040,["value","format","picker"])]),_:3},8,["style"]))}});exports.default=x;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("dayjs"),f=require("@aplus-frontend/antdv"),d=require("./constant.js");require("../../hooks/index.js");const y=require("lodash-unified"),O=require("./helper.js"),F=require("@aplus-frontend/utils"),A=require("../hooks/use-default-placeholder.js"),M=require("../hooks/use-date-timezone.js"),R=require("../../hooks/useControllableValue.js"),D=e.defineComponent({name:"ApFieldDate",__name:"index",props:{mode:{default:"edit"},class:{},style:{},dropdownClassName:{},dropdownAlign:{},popupStyle:{},transitionName:{},placeholder:{},allowClear:{type:Boolean,default:!0},autofocus:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},tabindex:{},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:void 0},inputReadOnly:{type:Boolean,default:void 0},id:{},presets:{},suffixIcon:{type:[Object,String,Number,Boolean,null,Array],default:void 0},clearIcon:{type:[Object,String,Number,Boolean,null,Array],default:void 0},getPopupContainer:{},panelRender:{},inputRender:{},onOpenChange:{},onPanelChange:{},onFocus:{},onBlur:{},onMousedown:{},onMouseup:{},onMouseenter:{},onMouseleave:{},onClick:{},onContextmenu:{},onKeydown:{},role:{},name:{},autocomplete:{},direction:{},showToday:{type:Boolean,default:void 0},showTime:{type:Boolean,default:void 0},picker:{},prefixCls:{},defaultPickerValue:{},disabledDate:{},dateRender:{},monthCellRender:{},renderExtraFooter:{},onSelect:{},locale:{},size:{},bordered:{type:Boolean,default:void 0},showNow:{type:Boolean,default:void 0},disabledTime:{},defaultOpenValue:{},showHour:{type:Boolean,default:void 0},showMinute:{type:Boolean,default:void 0},showSecond:{type:Boolean,default:void 0},use12Hours:{type:Boolean,default:void 0},hourStep:{},minuteStep:{},secondStep:{},hideDisabledOptions:{type:Boolean,default:void 0},disabledHours:{},disabledMinutes:{},disabledSeconds:{},valueFormat:{},emptyText:{default:"--"},value:{},defaultValue:{},onChange:{},onOk:{},format:{default:"Y-D"},shownFormat:{},formatBegins:{type:Boolean,default:!0},timezone:{}},emits:["update:value"],setup(B,{emit:k}){const o=B,g=k,{value:m,updateValue:h}=R.useControllableValue(o,g),P=A.useDefaultPlaceholder("Date",o),{currentTimezone:i}=M.useDateTimezone(o),l=e.computed(()=>d.ApFieldDatePresetFormats.indexOf(o.format)>-1),w=e.computed(()=>o.shownFormat?o.shownFormat:l.value?d.PRESET_FORMAT_MAP[o.format]:o.format),s=e.computed(()=>l.value?d.PRESET_FORMAT_MAP[o.format]:o.format),p=e.computed(()=>{if(y.isNil(e.unref(m)))return;let n=u(e.unref(m));return o.timezone&&(n=u(F.getTimeFormatToZone(e.unref(m),i.value))),n}),C=e.computed(()=>e.unref(l)?o.picker??d.PRESET_FORMAT_PICK_MAP[o.format]:o.picker),T=e.computed(()=>{const n=e.unref(l)?d.PRESET_FORMAT_TIME_MAP[o.format]:{};return{...y.omit(o,["value","defaultValue","onChange","onOk","format","onUpdate:value","mode"]),placeholder:e.unref(P),...n}}),v=(n,a,t=!0)=>O.formatDayWithTimezone(i.value)(n,a,t);function S(n){if(y.isNil(n)){h(null);return}const a=u(n);h(v(a,e.unref(l)?e.unref(s):void 0,o.formatBegins))}function _(n,a){var c;const t=u(n),r=n?v(t,e.unref(l)?e.unref(s):void 0,o.formatBegins):null;(c=o.onChange)==null||c.call(o,r,a)}function b(n){var r;const a=u(n),t=n?v(a,e.unref(l)?e.unref(s):void 0,o.formatBegins):null;(r=o.onOk)==null||r.call(o,t)}return(n,a)=>n.mode==="read"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(p.value?e.unref(u)(p.value).format(s.value):n.emptyText),1)],64)):(e.openBlock(),e.createBlock(e.unref(f.InputGroup),{key:1,compact:"",style:e.normalizeStyle({display:Array.isArray(o.timezone)&&o.timezone.length?"flex":"block"})},{default:e.withCtx(()=>[Array.isArray(o.timezone)&&o.timezone.length?(e.openBlock(),e.createBlock(e.unref(f.Select),{key:0,value:e.unref(i),"onUpdate:value":a[0]||(a[0]=t=>e.isRef(i)?i.value=t:null),"default-active-first-option":"","dropdown-match-select-width":!1,style:{"max-width":"50%"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.timezone,t=>(e.openBlock(),e.createBlock(e.unref(f.SelectOption),{key:t==null?void 0:t.value,value:t==null?void 0:t.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString((t==null?void 0:t.label)??(t==null?void 0:t.value)),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])):e.createCommentVNode("",!0),e.createVNode(e.unref(f.DatePicker),e.mergeProps(T.value,{value:p.value,format:w.value,picker:C.value,"onUpdate:value":S,onChange:_,onOk:b}),e.createSlots({_:2},[e.renderList(n.$slots,(t,r)=>({name:r,fn:e.withCtx(c=>[e.renderSlot(n.$slots,r,e.normalizeProps(e.guardReactiveProps(c||{})))])}))]),1040,["value","format","picker"])]),_:3},8,["style"]))}});exports.default=D;
@@ -1,2 +1,2 @@
1
1
  export type OmitValue<T> = Omit<T, 'value' | 'defaultValue' | 'onChange' | 'mode' | 'format'>;
2
- export type ApFormatPresetType = 'Y' | 'Y-M' | 'Y-D' | 'Y-h' | 'Y-m' | 'Y-s';
2
+ export type ApFormatPresetType = 'Y' | 'Y-Q' | 'Y-M' | 'Y-W' | 'Y-D' | 'Y-h' | 'Y-m' | 'Y-s';
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("../date/constant.js");require("../../hooks/index.js");const u=require("lodash-unified"),d=require("dayjs"),h=require("@aplus-frontend/antdv"),q=require("../date/helper.js"),E=require("@ant-design/icons-vue"),I=require("../../utils/index.js"),D=require("@aplus-frontend/utils"),U=require("../hooks/use-default-placeholder.js"),j=require("../hooks/use-default-presets.js"),H=require("../hooks/use-date-timezone.js"),K=require("../../hooks/useControllableValue.js"),L=e.defineComponent({__name:"index",props:{mode:{default:"edit"},class:{},style:{},id:{},defaultPickerValue:{},placeholder:{},disabled:{type:[Boolean,Array],default:void 0},disabledTime:{},ranges:{},separator:{type:[Object,String,Number,Boolean,null,Array],default:void 0},allowEmpty:{},onCalendarChange:{},onFocus:{},onBlur:{},onMousedown:{},onMouseup:{},onMouseenter:{},onMouseleave:{},onClick:{},direction:{},autocomplete:{},activePickerIndex:{},dateRender:{},panelRender:{},dropdownClassName:{},dropdownAlign:{},popupStyle:{},transitionName:{},allowClear:{type:Boolean,default:!0},autofocus:{type:Boolean,default:void 0},tabindex:{},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:void 0},inputReadOnly:{type:Boolean,default:void 0},suffixIcon:{type:[Object,String,Number,Boolean,null,Array],default:void 0},clearIcon:{type:[Object,String,Number,Boolean,null,Array],default:void 0},getPopupContainer:{},inputRender:{},onOpenChange:{},onContextmenu:{},onKeydown:{},role:{},name:{},picker:{},prefixCls:{},disabledDate:{},monthCellRender:{},locale:{},size:{},bordered:{type:Boolean,default:void 0},showTime:{type:Boolean,default:void 0},showNow:{type:Boolean,default:void 0},order:{type:Boolean,default:void 0},defaultOpenValue:{},showHour:{type:Boolean,default:void 0},showMinute:{type:Boolean,default:void 0},showSecond:{type:Boolean,default:void 0},use12Hours:{type:Boolean,default:void 0},hourStep:{},minuteStep:{},secondStep:{},hideDisabledOptions:{type:Boolean,default:void 0},disabledHours:{},disabledMinutes:{},disabledSeconds:{},valueFormat:{},emptyText:{default:"--"},value:{},defaultValue:{},onChange:{},onOk:{},format:{default:"Y-D"},timezone:{},readModeSeparator:{},presets:{type:[Array,Boolean]}},emits:["update:value"],setup(T,{emit:P}){const t=T,O=P,k=e.useSlots(),s=e.computed(()=>v.ApFieldDatePresetFormats.indexOf(t.format)>-1),c=e.computed(()=>s.value?v.PRESET_FORMAT_MAP[t.format]:t.format),{value:y,updateValue:S}=K.useControllableValue(t,O),M=U.useDefaultPlaceholder("DateRange",t),{currentTimezone:i}=H.useDateTimezone(t),{presets:b,changeCurrentDate:w}=j.useDefaultPresets({...t,timezone:i}),f=(n,a,r=!0)=>q.formatDayWithTimezone(i.value)(n,a,r),g=e.computed(()=>{var l,o;const n=e.unref(y);if(u.isNil(n)||!(n!=null&&n.length))return n;const a=i.value?D.getTimeFormatToZone(e.unref(y)[0],i.value):(l=e.unref(y))==null?void 0:l[0],r=t.timezone?D.getTimeFormatToZone(e.unref(y)[1],i.value):(o=e.unref(y))==null?void 0:o[1];return[d(a),d(r)]}),F=e.computed(()=>e.unref(s)?t.picker??v.PRESET_FORMAT_PICK_MAP[t.format]:t.picker),A=e.computed(()=>{const n=e.unref(s)?v.PRESET_FORMAT_TIME_MAP[t.format]:{};return{...I.omitUndefined(u.omit(t,["value","onUpdate:value","onChange","onOk","format","mode","presets"])),placeholder:e.unref(M),presets:e.unref(b),...n}});function N(n){if(!n){S(n);return}let a=u.isString(n[0])?d(n[0]):n[0],r=u.isString(n[1])?d(n[1]):n[1];const l=e.unref(s)?e.unref(c):void 0;S([f(a,l),f(r,l,!1)])}function R(n){var m;const a=u.isString(n[0])?d(n[0]):n[0],r=u.isString(n[1])?d(n[1]):n[1],l=e.unref(s)?e.unref(c):void 0,o=n[0]?f(a,l):null,p=n[1]?f(r,l,!1):null;(m=t.onOk)==null||m.call(t,[o,p])}function _(n){var a;n&&w(),(a=t.onOpenChange)==null||a.call(t,n)}function x(n,a){var B,C;if(u.isNil(n)){(B=t.onChange)==null||B.call(t,n,a);return}const r=u.isString(n[0])?d(n[0]):n[0],l=u.isString(n[1])?d(n[1]):n[1],o=e.unref(s)?e.unref(c):void 0,p=n[0]?f(r,o):null,m=n[1]?f(l,o,!1):null;(C=t.onChange)==null||C.call(t,[p,m],a)}const V=e.computed(()=>{var r;const n=t.readModeSeparator;if(n)return e.isVNode(n)||u.isFunction(n)?t.readModeSeparator:e.createVNode(e.Fragment,null,[t.readModeSeparator]);const a=(r=k.readModeSeparator)==null?void 0:r.call(k);return a?e.createVNode(e.Fragment,null,[a]):E.SwapRightOutlined});return(n,a)=>{var r,l;return n.mode==="read"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[g.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString((r=g.value[0])==null?void 0:r.format(c.value))+" ",1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(V.value))),e.createTextVNode(" "+e.toDisplayString((l=g.value[1])==null?void 0:l.format(c.value)),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(n.emptyText),1)],64))],64)):(e.openBlock(),e.createBlock(e.unref(h.InputGroup),{key:1,compact:"",style:e.normalizeStyle({display:Array.isArray(t.timezone)&&t.timezone.length?"flex":"block"})},{default:e.withCtx(()=>[Array.isArray(t.timezone)&&t.timezone.length?(e.openBlock(),e.createBlock(e.unref(h.Select),{key:0,value:e.unref(i),"onUpdate:value":a[0]||(a[0]=o=>e.isRef(i)?i.value=o:null),"default-active-first-option":"","dropdown-match-select-width":!1},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.timezone,o=>(e.openBlock(),e.createBlock(e.unref(h.SelectOption),{key:o==null?void 0:o.value,value:o==null?void 0:o.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString((o==null?void 0:o.label)??(o==null?void 0:o.value)),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])):e.createCommentVNode("",!0),e.createVNode(e.unref(h.DatePicker).RangePicker,e.mergeProps(A.value,{value:g.value,picker:F.value,format:c.value,"onUpdate:value":N,onChange:x,onOk:R,onOpenChange:_}),e.createSlots({_:2},[e.renderList(e.unref(u.omit)(n.$slots,"readModeSeparator"),(o,p)=>({name:p,fn:e.withCtx(m=>[e.renderSlot(n.$slots,p,e.normalizeProps(e.guardReactiveProps(m||{})))])}))]),1040,["value","picker","format"])]),_:3},8,["style"]))}}});exports.default=L;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),g=require("../date/constant.js");require("../../hooks/index.js");const u=require("lodash-unified"),d=require("dayjs"),v=require("@aplus-frontend/antdv"),E=require("../date/helper.js"),I=require("@ant-design/icons-vue"),U=require("../../utils/index.js"),T=require("@aplus-frontend/utils"),j=require("../hooks/use-default-placeholder.js"),H=require("../hooks/use-default-presets.js"),K=require("../hooks/use-date-timezone.js"),L=require("../../hooks/useControllableValue.js"),Z=e.defineComponent({__name:"index",props:{mode:{default:"edit"},class:{},style:{},id:{},defaultPickerValue:{},placeholder:{},disabled:{type:[Boolean,Array],default:void 0},disabledTime:{},ranges:{},separator:{type:[Object,String,Number,Boolean,null,Array],default:void 0},allowEmpty:{},onCalendarChange:{},onFocus:{},onBlur:{},onMousedown:{},onMouseup:{},onMouseenter:{},onMouseleave:{},onClick:{},direction:{},autocomplete:{},activePickerIndex:{},dateRender:{},panelRender:{},dropdownClassName:{},dropdownAlign:{},popupStyle:{},transitionName:{},allowClear:{type:Boolean,default:!0},autofocus:{type:Boolean,default:void 0},tabindex:{},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:void 0},inputReadOnly:{type:Boolean,default:void 0},suffixIcon:{type:[Object,String,Number,Boolean,null,Array],default:void 0},clearIcon:{type:[Object,String,Number,Boolean,null,Array],default:void 0},getPopupContainer:{},inputRender:{},onOpenChange:{},onContextmenu:{},onKeydown:{},role:{},name:{},picker:{},prefixCls:{},disabledDate:{},monthCellRender:{},locale:{},size:{},bordered:{type:Boolean,default:void 0},showTime:{type:Boolean,default:void 0},showNow:{type:Boolean,default:void 0},order:{type:Boolean,default:void 0},defaultOpenValue:{},showHour:{type:Boolean,default:void 0},showMinute:{type:Boolean,default:void 0},showSecond:{type:Boolean,default:void 0},use12Hours:{type:Boolean,default:void 0},hourStep:{},minuteStep:{},secondStep:{},hideDisabledOptions:{type:Boolean,default:void 0},disabledHours:{},disabledMinutes:{},disabledSeconds:{},valueFormat:{},emptyText:{default:"--"},value:{},defaultValue:{},onChange:{},onOk:{},format:{default:"Y-D"},shownFormat:{},timezone:{},readModeSeparator:{},presets:{type:[Array,Boolean]}},emits:["update:value"],setup(D,{emit:P}){const t=D,M=P,k=e.useSlots(),s=e.computed(()=>g.ApFieldDatePresetFormats.indexOf(t.format)>-1),m=e.computed(()=>s.value?g.PRESET_FORMAT_MAP[t.format]:t.format),{value:y,updateValue:S}=L.useControllableValue(t,M),O=e.computed(()=>t.shownFormat?t.shownFormat:s.value?g.PRESET_FORMAT_MAP[t.format]:t.format),w=j.useDefaultPlaceholder("DateRange",t),{currentTimezone:i}=K.useDateTimezone(t),{presets:F,changeCurrentDate:b}=H.useDefaultPresets({...t,timezone:i}),c=(n,a,r=!0)=>E.formatDayWithTimezone(i.value)(n,a,r),h=e.computed(()=>{var l,o;const n=e.unref(y);if(u.isNil(n)||!(n!=null&&n.length))return n;const a=i.value?T.getTimeFormatToZone(e.unref(y)[0],i.value):(l=e.unref(y))==null?void 0:l[0],r=t.timezone?T.getTimeFormatToZone(e.unref(y)[1],i.value):(o=e.unref(y))==null?void 0:o[1];return[d(a),d(r)]}),_=e.computed(()=>e.unref(s)?t.picker??g.PRESET_FORMAT_PICK_MAP[t.format]:t.picker),A=e.computed(()=>{const n=e.unref(s)?g.PRESET_FORMAT_TIME_MAP[t.format]:{};return{...U.omitUndefined(u.omit(t,["value","onUpdate:value","onChange","onOk","format","mode","presets"])),placeholder:e.unref(w),presets:e.unref(F),...n}});function R(n){if(!n){S(n);return}let a=u.isString(n[0])?d(n[0]):n[0],r=u.isString(n[1])?d(n[1]):n[1];const l=e.unref(s)?e.unref(m):void 0;S([c(a,l),c(r,l,!1)])}function N(n){var p;const a=u.isString(n[0])?d(n[0]):n[0],r=u.isString(n[1])?d(n[1]):n[1],l=e.unref(s)?e.unref(m):void 0,o=n[0]?c(a,l):null,f=n[1]?c(r,l,!1):null;(p=t.onOk)==null||p.call(t,[o,f])}function x(n){var a;n&&b(),(a=t.onOpenChange)==null||a.call(t,n)}function V(n,a){var B,C;if(u.isNil(n)){(B=t.onChange)==null||B.call(t,n,a);return}const r=u.isString(n[0])?d(n[0]):n[0],l=u.isString(n[1])?d(n[1]):n[1],o=e.unref(s)?e.unref(m):void 0,f=n[0]?c(r,o):null,p=n[1]?c(l,o,!1):null;(C=t.onChange)==null||C.call(t,[f,p],a)}const q=e.computed(()=>{var r;const n=t.readModeSeparator;if(n)return e.isVNode(n)||u.isFunction(n)?t.readModeSeparator:e.createVNode(e.Fragment,null,[t.readModeSeparator]);const a=(r=k.readModeSeparator)==null?void 0:r.call(k);return a?e.createVNode(e.Fragment,null,[a]):I.SwapRightOutlined});return(n,a)=>{var r,l;return n.mode==="read"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[h.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString((r=h.value[0])==null?void 0:r.format(m.value))+" ",1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(q.value))),e.createTextVNode(" "+e.toDisplayString((l=h.value[1])==null?void 0:l.format(m.value)),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(n.emptyText),1)],64))],64)):(e.openBlock(),e.createBlock(e.unref(v.InputGroup),{key:1,compact:"",style:e.normalizeStyle({display:Array.isArray(t.timezone)&&t.timezone.length?"flex":"block"})},{default:e.withCtx(()=>[Array.isArray(t.timezone)&&t.timezone.length?(e.openBlock(),e.createBlock(e.unref(v.Select),{key:0,value:e.unref(i),"onUpdate:value":a[0]||(a[0]=o=>e.isRef(i)?i.value=o:null),"default-active-first-option":"","dropdown-match-select-width":!1},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.timezone,o=>(e.openBlock(),e.createBlock(e.unref(v.SelectOption),{key:o==null?void 0:o.value,value:o==null?void 0:o.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString((o==null?void 0:o.label)??(o==null?void 0:o.value)),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])):e.createCommentVNode("",!0),e.createVNode(e.unref(v.DatePicker).RangePicker,e.mergeProps(A.value,{value:h.value,picker:_.value,format:O.value,"onUpdate:value":R,onChange:V,onOk:N,onOpenChange:x}),e.createSlots({_:2},[e.renderList(e.unref(u.omit)(n.$slots,"readModeSeparator"),(o,f)=>({name:f,fn:e.withCtx(p=>[e.renderSlot(n.$slots,f,e.normalizeProps(e.guardReactiveProps(p||{})))])}))]),1040,["value","picker","format"])]),_:3},8,["style"]))}}});exports.default=Z;