@aplus-frontend/ui 0.0.17 → 0.0.19

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 (91) hide show
  1. package/es/index.mjs +18 -14
  2. package/es/src/ap-field/date/helper.d.ts +7 -0
  3. package/es/src/ap-field/date/helper.mjs +17 -7
  4. package/es/src/ap-field/date/index.vue.d.ts +3 -1
  5. package/es/src/ap-field/date/index.vue.mjs +46 -39
  6. package/es/src/ap-field/date-range/index.vue.d.ts +3 -3
  7. package/es/src/ap-field/date-range/index.vue.mjs +64 -62
  8. package/es/src/ap-field/interface.d.ts +10 -1
  9. package/es/src/ap-form/ap-form-item.vue.mjs +61 -57
  10. package/es/src/ap-form/search-form/index.vue.mjs +1 -1
  11. package/es/src/ap-form/style/ap-form-item.css +11 -0
  12. package/es/src/ap-modal/index.d.ts +9 -0
  13. package/es/src/ap-modal/index.mjs +10 -0
  14. package/es/src/ap-modal/type.d.ts +13 -0
  15. package/es/src/ap-modal/type.mjs +1 -0
  16. package/es/src/ap-modal/utils/createModal.d.ts +3 -0
  17. package/es/src/ap-modal/utils/createModal.mjs +74 -0
  18. package/es/src/ap-modal/utils/index.d.ts +1 -0
  19. package/es/src/ap-modal/utils/index.mjs +4 -0
  20. package/es/src/ap-table/ap-table.vue.mjs +151 -141
  21. package/es/src/ap-table/constants.d.ts +41 -15
  22. package/es/src/ap-table/interface.d.ts +22 -4
  23. package/es/src/ap-table/style/ap-table.css +1 -0
  24. package/es/src/ap-table/utils.d.ts +6831 -845
  25. package/es/src/business/ap-label/ApLabel.vue.d.ts +38 -0
  26. package/es/src/business/ap-label/ApLabel.vue.mjs +4 -0
  27. package/es/src/business/ap-label/ApLabel.vue2.mjs +52 -0
  28. package/es/src/business/ap-label/index.d.ts +4 -0
  29. package/es/src/business/ap-label/interface.d.ts +8 -0
  30. package/es/src/business/ap-label/style.css +4 -0
  31. package/es/src/business/expandAlert/ApExpandAlert.vue.d.ts +81 -0
  32. package/es/src/business/expandAlert/ApExpandAlert.vue.mjs +4 -0
  33. package/es/src/business/expandAlert/ApExpandAlert.vue2.mjs +113 -0
  34. package/es/src/business/expandAlert/interface.d.ts +26 -0
  35. package/es/src/business/expandAlert/style.css +42 -0
  36. package/es/src/business/index.d.ts +416 -1
  37. package/es/src/business/index.mjs +10 -4
  38. package/es/src/editable-table/interface.d.ts +1 -1
  39. package/es/src/index.d.ts +1 -0
  40. package/es/src/index.mjs +192 -188
  41. package/es/src/theme/ap-expand-alert/ap-expand-alert.css +42 -0
  42. package/es/src/theme/ap-form/ap-form-item.css +11 -0
  43. package/es/src/theme/ap-label/ap-label.css +4 -0
  44. package/es/src/theme/ap-table/ap-table.css +1 -0
  45. package/es/src/type.d.ts +3 -1
  46. package/lib/index.js +1 -1
  47. package/lib/src/ap-field/date/helper.d.ts +7 -0
  48. package/lib/src/ap-field/date/helper.js +1 -1
  49. package/lib/src/ap-field/date/index.vue.d.ts +3 -1
  50. package/lib/src/ap-field/date/index.vue.js +1 -1
  51. package/lib/src/ap-field/date-range/index.vue.d.ts +3 -3
  52. package/lib/src/ap-field/date-range/index.vue.js +1 -1
  53. package/lib/src/ap-field/interface.d.ts +10 -1
  54. package/lib/src/ap-form/ap-form-item.vue.js +1 -1
  55. package/lib/src/ap-form/search-form/index.vue.js +1 -1
  56. package/lib/src/ap-form/style/ap-form-item.css +11 -0
  57. package/lib/src/ap-modal/index.d.ts +9 -0
  58. package/lib/src/ap-modal/index.js +1 -0
  59. package/lib/src/ap-modal/type.d.ts +13 -0
  60. package/lib/src/ap-modal/type.js +1 -0
  61. package/lib/src/ap-modal/utils/createModal.d.ts +3 -0
  62. package/lib/src/ap-modal/utils/createModal.js +1 -0
  63. package/lib/src/ap-modal/utils/index.d.ts +1 -0
  64. package/lib/src/ap-modal/utils/index.js +1 -0
  65. package/lib/src/ap-table/ap-table.vue.js +1 -1
  66. package/lib/src/ap-table/constants.d.ts +41 -15
  67. package/lib/src/ap-table/interface.d.ts +22 -4
  68. package/lib/src/ap-table/style/ap-table.css +1 -0
  69. package/lib/src/ap-table/utils.d.ts +6831 -845
  70. package/lib/src/business/ap-label/ApLabel.vue.d.ts +38 -0
  71. package/lib/src/business/ap-label/ApLabel.vue.js +1 -0
  72. package/lib/src/business/ap-label/ApLabel.vue2.js +1 -0
  73. package/lib/src/business/ap-label/index.d.ts +4 -0
  74. package/lib/src/business/ap-label/interface.d.ts +8 -0
  75. package/lib/src/business/ap-label/style.css +4 -0
  76. package/lib/src/business/expandAlert/ApExpandAlert.vue.d.ts +81 -0
  77. package/lib/src/business/expandAlert/ApExpandAlert.vue.js +1 -0
  78. package/lib/src/business/expandAlert/ApExpandAlert.vue2.js +1 -0
  79. package/lib/src/business/expandAlert/interface.d.ts +26 -0
  80. package/lib/src/business/expandAlert/style.css +42 -0
  81. package/lib/src/business/index.d.ts +416 -1
  82. package/lib/src/business/index.js +1 -1
  83. package/lib/src/editable-table/interface.d.ts +1 -1
  84. package/lib/src/index.d.ts +1 -0
  85. package/lib/src/index.js +1 -1
  86. package/lib/src/theme/ap-expand-alert/ap-expand-alert.css +42 -0
  87. package/lib/src/theme/ap-form/ap-form-item.css +11 -0
  88. package/lib/src/theme/ap-label/ap-label.css +4 -0
  89. package/lib/src/theme/ap-table/ap-table.css +1 -0
  90. package/lib/src/type.d.ts +3 -1
  91. package/package.json +3 -3
package/es/index.mjs CHANGED
@@ -99,13 +99,14 @@ import { default as ut } from "./src/ap-upload/apUpload.vue.mjs";
99
99
  import { default as ct } from "./src/ap-download/ap-download.vue.mjs";
100
100
  import { CheckCard as Tt } from "./src/check-card/index.mjs";
101
101
  import { default as St } from "./src/check-card/group.vue.mjs";
102
- import { ApTitle as bt } from "./src/business/index.mjs";
103
- import { useTablePaging as Pt } from "./src/ap-table/hooks/use-table-paging.mjs";
104
- import { default as Rt } from "./src/ap-table/ap-table.vue.mjs";
105
- import { default as vt } from "./src/editable-table/index.vue.mjs";
106
- import { default as kt } from "./src/editable-table/form-item.vue.mjs";
107
- import { useMessage as Bt } from "./src/hooks/useMessage.mjs";
108
- import { useControllableValue as Nt } from "./src/hooks/useControllableValue.mjs";
102
+ import { ApModal as bt } from "./src/ap-modal/index.mjs";
103
+ import { ApExpandAlert as Pt, ApLabel as Dt, ApTitle as Rt } from "./src/business/index.mjs";
104
+ import { useTablePaging as vt } from "./src/ap-table/hooks/use-table-paging.mjs";
105
+ import { default as kt } from "./src/ap-table/ap-table.vue.mjs";
106
+ import { default as Bt } from "./src/editable-table/index.vue.mjs";
107
+ import { default as Nt } from "./src/editable-table/form-item.vue.mjs";
108
+ import { useMessage as Et } from "./src/hooks/useMessage.mjs";
109
+ import { useControllableValue as Xt } from "./src/hooks/useControllableValue.mjs";
109
110
  const p = {
110
111
  install: (r) => {
111
112
  for (const t in o) {
@@ -124,6 +125,7 @@ export {
124
125
  Jr as ApCustomColumn,
125
126
  Zr as ApCustomSelect,
126
127
  ct as ApDownload,
128
+ Pt as ApExpandAlert,
127
129
  pr as ApField,
128
130
  sr as ApFieldCheckbox,
129
131
  xr as ApFieldDate,
@@ -155,10 +157,12 @@ export {
155
157
  tr as ApFormModalForm,
156
158
  or as ApFormSearchForm,
157
159
  dt as ApInfoLayout,
158
- Rt as ApTable,
160
+ Dt as ApLabel,
161
+ bt as ApModal,
162
+ kt as ApTable,
159
163
  ft as ApTag,
160
164
  lt as ApTagGroup,
161
- bt as ApTitle,
165
+ Rt as ApTitle,
162
166
  ut as ApUpload,
163
167
  De as ApiCascader,
164
168
  he as ApiRadioGroup,
@@ -184,8 +188,8 @@ export {
184
188
  et as DictCode,
185
189
  Ao as Dropdown,
186
190
  Io as EditTableHeaderIcon,
187
- vt as EditableTable,
188
- kt as EditableTableFormItem,
191
+ Bt as EditableTable,
192
+ Nt as EditableTableFormItem,
189
193
  Z as ExpandTransition,
190
194
  _ as ExpandXTransition,
191
195
  ee as FadeTransition,
@@ -239,18 +243,18 @@ export {
239
243
  g as translate,
240
244
  jr as useCacheColumnSetting,
241
245
  ce as useComponentRegister,
242
- Nt as useControllableValue,
246
+ Xt as useControllableValue,
243
247
  ie as useDescription,
244
248
  Te as useForm,
245
249
  v as useGetDerivedNamespace,
246
250
  T as useGlobalConfig,
247
251
  P as useLocale,
248
- Bt as useMessage,
252
+ Et as useMessage,
249
253
  oo as useModal,
250
254
  _e as useModalContext,
251
255
  ro as useModalInner,
252
256
  M as useNamespace,
253
257
  Do as useTable,
254
- Pt as useTablePaging,
258
+ vt as useTablePaging,
255
259
  H as zhCn
256
260
  };
@@ -1,5 +1,12 @@
1
+ import { ZoneAlias } from '@aplus-frontend/utils';
1
2
  import { EventValue } from 'ant-design-vue/es/vc-picker/interface';
2
3
  import { Dayjs } from 'dayjs';
3
4
 
4
5
  export declare const formatDay: (d: Dayjs, f: string, begin?: boolean) => number | null;
6
+ /**
7
+ * 带timezone的日期格式化生成函数
8
+ * @param timezone
9
+ * @returns
10
+ */
11
+ export declare function formatDayWithTimezone(timezone?: ZoneAlias): (d: Dayjs, f: string, begin?: boolean) => number | null;
5
12
  export declare const formatValue: (v: EventValue<Dayjs>) => number | null;
@@ -1,10 +1,20 @@
1
- const o = (e, n, f = !0) => {
2
- if (!e)
1
+ import { getUtcTimestamp as m } from "@aplus-frontend/utils";
2
+ import n from "dayjs";
3
+ const i = (o, r, e = !0) => {
4
+ if (!o)
3
5
  return null;
4
- let t = e.clone();
5
- return t = t.millisecond(0), n.indexOf("ss") === -1 && (t = t.second(f ? 0 : 59)), n.indexOf("mm") === -1 && (t = t.minute(f ? 0 : 59)), n.indexOf("HH") === -1 && (t = t.hour(f ? 0 : 23)), n.indexOf("DD") === -1 && (t = t.date(f ? 1 : 0), f || (t = t.month(t.month() + 1))), n.indexOf("MM") === -1 && (t = t.month(f ? 0 : 12)), t.valueOf();
6
- }, i = (e) => e && e.valueOf();
6
+ let t = o.clone();
7
+ return t = t.millisecond(0), r.indexOf("ss") === -1 && (t = t.second(e ? 0 : 59)), r.indexOf("mm") === -1 && (t = t.minute(e ? 0 : 59)), r.indexOf("HH") === -1 && (t = t.hour(e ? 0 : 23)), r.indexOf("DD") === -1 && (t = t.date(e ? 1 : 0), e || (t = t.month(t.month() + 1))), r.indexOf("MM") === -1 && (t = t.month(e ? 0 : 12)), t.valueOf();
8
+ };
9
+ function d(o) {
10
+ return (r, e, t = !0) => {
11
+ const f = o ? n(m(r, o)) : n(r);
12
+ return i(f, e, t);
13
+ };
14
+ }
15
+ const l = (o) => o && o.valueOf();
7
16
  export {
8
- o as formatDay,
9
- i as formatValue
17
+ i as formatDay,
18
+ d as formatDayWithTimezone,
19
+ l as formatValue
10
20
  };
@@ -1,6 +1,8 @@
1
1
  import { default as dayjs } from 'dayjs';
2
2
  import { ApFieldDateProps, FieldMode } from '../interface';
3
+ import { ApFormatPresetType } from './interface';
3
4
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, VNode, RendererNode, RendererElement, PropType } from 'vue';
5
+ import { LiteralUnion } from '../../type';
4
6
  import { SharedTimeProps } from 'ant-design-vue/es/vc-picker/panels/TimePanel';
5
7
 
6
8
  type ApFieldDataSlots = {
@@ -84,7 +86,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
84
86
  }> | null;
85
87
  allowClear: boolean;
86
88
  defaultOpen: boolean;
87
- format: string;
89
+ format: LiteralUnion<ApFormatPresetType, string>;
88
90
  inputReadOnly: boolean;
89
91
  showToday: boolean;
90
92
  showTime: boolean | SharedTimeProps<dayjs.Dayjs>;
@@ -1,12 +1,13 @@
1
- import { defineComponent as b, computed as u, unref as t, openBlock as c, createElementBlock as _, Fragment as w, createTextVNode as M, toDisplayString as R, createBlock as T, mergeProps as A, createSlots as F, renderList as x, withCtx as E, renderSlot as V, normalizeProps as D, guardReactiveProps as N } from "vue";
2
- import i from "dayjs";
3
- import { DatePicker as j } from "ant-design-vue";
4
- import { ApFieldDatePresetFormats as I, PRESET_FORMAT_MAP as H, PRESET_FORMAT_PICK_MAP as U, PRESET_FORMAT_TIME_MAP as z } from "./constant.mjs";
1
+ import { defineComponent as S, computed as s, unref as t, openBlock as c, createElementBlock as b, Fragment as _, createTextVNode as w, toDisplayString as M, createBlock as R, mergeProps as F, createSlots as A, renderList as x, withCtx as D, renderSlot as E, normalizeProps as V, guardReactiveProps as z } from "vue";
2
+ import r from "dayjs";
3
+ import { DatePicker as N } from "ant-design-vue";
4
+ import { ApFieldDatePresetFormats as j, PRESET_FORMAT_MAP as I, PRESET_FORMAT_PICK_MAP as H, PRESET_FORMAT_TIME_MAP as U } from "./constant.mjs";
5
5
  import "../../hooks/index.mjs";
6
6
  import { isNil as v, omit as K } from "lodash-unified";
7
- import { formatDay as f } from "./helper.mjs";
8
- import { useControllableValue as $ } from "../../hooks/useControllableValue.mjs";
9
- const Z = /* @__PURE__ */ b({
7
+ import { formatDayWithTimezone as $ } from "./helper.mjs";
8
+ import { getTimeFormatToZone as L } from "@aplus-frontend/utils";
9
+ import { useControllableValue as W } from "../../hooks/useControllableValue.mjs";
10
+ const te = /* @__PURE__ */ S({
10
11
  name: "ApFieldDate",
11
12
  __name: "index",
12
13
  props: {
@@ -80,16 +81,22 @@ const Z = /* @__PURE__ */ b({
80
81
  defaultValue: {},
81
82
  onChange: {},
82
83
  onOk: {},
83
- format: { default: "Y-D" }
84
+ format: { default: "Y-D" },
85
+ timezone: {}
84
86
  },
85
87
  emits: ["update:value"],
86
88
  setup(y, { emit: h }) {
87
- const e = y, B = h, { value: s, updateValue: m } = $(e, B), l = u(
88
- () => I.indexOf(e.format) > -1
89
- ), r = u(
90
- () => l.value ? H[e.format] : e.format
91
- ), k = u(() => v(t(s)) ? void 0 : i(t(s))), O = u(() => t(l) ? e.picker ?? U[e.format] : e.picker), P = u(() => {
92
- const o = t(l) ? z[e.format] : {};
89
+ const e = y, B = h, { value: d, updateValue: p } = W(e, B), l = s(
90
+ () => j.indexOf(e.format) > -1
91
+ ), u = s(
92
+ () => l.value ? I[e.format] : e.format
93
+ ), k = s(() => {
94
+ if (v(t(d)))
95
+ return;
96
+ let o = r(t(d));
97
+ return e.timezone && (o = r(L(t(d), e.timezone))), o;
98
+ }), g = s(() => t(l) ? e.picker ?? H[e.format] : e.picker), O = s(() => {
99
+ const o = t(l) ? U[e.format] : {};
93
100
  return {
94
101
  ...K(e, [
95
102
  "value",
@@ -102,44 +109,44 @@ const Z = /* @__PURE__ */ b({
102
109
  ]),
103
110
  ...o
104
111
  };
105
- });
106
- function C(o) {
112
+ }), f = $(e.timezone);
113
+ function P(o) {
107
114
  if (v(o)) {
108
- m(null);
115
+ p(null);
109
116
  return;
110
117
  }
111
- const a = i(o);
112
- t(l) ? m(f(a, t(r))) : m(a.valueOf());
118
+ const a = r(o);
119
+ t(l) ? p(f(a, t(u))) : p(a.valueOf());
113
120
  }
114
- function g(o, a) {
115
- var p;
116
- const d = i(o), n = t(l) ? f(d, t(r)) : o ? d.valueOf() : null;
117
- (p = e.onChange) == null || p.call(e, n, a);
121
+ function C(o, a) {
122
+ var m;
123
+ const i = r(o), n = o ? t(l) ? f(i, t(u)) : i.valueOf() : null;
124
+ (m = e.onChange) == null || m.call(e, n, a);
118
125
  }
119
- function S(o) {
126
+ function T(o) {
120
127
  var n;
121
- const a = i(o), d = t(l) ? f(a, t(r)) : o ? a.valueOf() : null;
122
- (n = e.onOk) == null || n.call(e, d);
128
+ const a = r(o), i = o ? t(l) ? f(a, t(u)) : a.valueOf() : null;
129
+ (n = e.onOk) == null || n.call(e, i);
123
130
  }
124
- return (o, a) => o.mode === "read" ? (c(), _(w, { key: 0 }, [
125
- M(R(t(s) ? t(i)(t(s)).format(r.value) : o.emptyText), 1)
126
- ], 64)) : (c(), T(t(j), A({ key: 1 }, P.value, {
131
+ return (o, a) => o.mode === "read" ? (c(), b(_, { key: 0 }, [
132
+ w(M(t(d) ? t(r)(t(d)).format(u.value) : o.emptyText), 1)
133
+ ], 64)) : (c(), R(t(N), F({ key: 1 }, O.value, {
127
134
  value: k.value,
128
- format: r.value,
129
- "onUpdate:value": C,
130
- onChange: g,
131
- onOk: S,
132
- picker: O.value
133
- }), F({ _: 2 }, [
134
- x(o.$slots, (d, n) => ({
135
+ format: u.value,
136
+ "onUpdate:value": P,
137
+ onChange: C,
138
+ onOk: T,
139
+ picker: g.value
140
+ }), A({ _: 2 }, [
141
+ x(o.$slots, (i, n) => ({
135
142
  name: n,
136
- fn: E((p) => [
137
- V(o.$slots, n, D(N(p || {})))
143
+ fn: D((m) => [
144
+ E(o.$slots, n, V(z(m || {})))
138
145
  ])
139
146
  }))
140
147
  ]), 1040, ["value", "format", "picker"]));
141
148
  }
142
149
  });
143
150
  export {
144
- Z as default
151
+ te as default
145
152
  };
@@ -1,7 +1,7 @@
1
1
  import { ApFieldDateRangeProps, FieldMode } from '../interface';
2
- import { default as dayjs } from 'dayjs';
2
+ import { ApFormatPresetType } from '../date/interface';
3
3
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, VNode, RendererNode, RendererElement, PropType } from 'vue';
4
- import { CustomFormat } from 'ant-design-vue/es/vc-picker/interface';
4
+ import { LiteralUnion } from '../../type';
5
5
 
6
6
  type ApFieldDateRangeSlots = {
7
7
  suffixIcon?: any;
@@ -96,7 +96,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
96
96
  }> | null | undefined)[] | VNode<RendererNode, RendererElement, {
97
97
  [key: string]: any;
98
98
  }> | null;
99
- format: (string | CustomFormat<dayjs.Dayjs> | (string | CustomFormat<dayjs.Dayjs>)[]) & string;
99
+ format: LiteralUnion<ApFormatPresetType, string>;
100
100
  inputReadOnly: boolean;
101
101
  emptyText: string;
102
102
  }, {}>, Readonly<ApFieldDateRangeSlots> & ApFieldDateRangeSlots>;
@@ -1,14 +1,15 @@
1
- import { defineComponent as x, computed as p, unref as o, openBlock as y, createElementBlock as k, Fragment as B, createTextVNode as O, toDisplayString as C, renderSlot as S, createVNode as V, createBlock as I, mergeProps as j, createSlots as U, renderList as H, withCtx as $, normalizeProps as z, guardReactiveProps as K } from "vue";
2
- import { ApFieldDatePresetFormats as L, PRESET_FORMAT_MAP as Y, PRESET_FORMAT_PICK_MAP as q, PRESET_FORMAT_TIME_MAP as G } from "../date/constant.mjs";
1
+ import { defineComponent as x, computed as c, unref as t, openBlock as g, createElementBlock as k, Fragment as B, createTextVNode as O, toDisplayString as C, renderSlot as T, createVNode as V, createBlock as I, mergeProps as j, createSlots as U, renderList as H, withCtx as $, normalizeProps as K, guardReactiveProps as L } from "vue";
2
+ import { ApFieldDatePresetFormats as W, PRESET_FORMAT_MAP as Y, PRESET_FORMAT_PICK_MAP as Z, PRESET_FORMAT_TIME_MAP as q } from "../date/constant.mjs";
3
3
  import "../../hooks/index.mjs";
4
- import { isNil as b, omit as T, isString as s } from "lodash-unified";
4
+ import { isNil as S, omit as b, isString as f } from "lodash-unified";
5
5
  import u from "dayjs";
6
- import { DatePicker as J } from "ant-design-vue";
7
- import { formatDay as f, formatValue as M } from "../date/helper.mjs";
6
+ import { DatePicker as G } from "ant-design-vue";
7
+ import { formatDayWithTimezone as J, formatValue as D } from "../date/helper.mjs";
8
8
  import { SwapRightOutlined as Q } from "@ant-design/icons-vue";
9
- import { omitUndefined as W } from "../../utils/index.mjs";
10
- import { useControllableValue as X } from "../../hooks/useControllableValue.mjs";
11
- const de = /* @__PURE__ */ x({
9
+ import { omitUndefined as X } from "../../utils/index.mjs";
10
+ import { getTimeFormatToZone as M } from "@aplus-frontend/utils";
11
+ import { useControllableValue as ee } from "../../hooks/useControllableValue.mjs";
12
+ const fe = /* @__PURE__ */ x({
12
13
  __name: "index",
13
14
  props: {
14
15
  mode: { default: "edit" },
@@ -46,7 +47,6 @@ const de = /* @__PURE__ */ x({
46
47
  open: { type: Boolean, default: void 0 },
47
48
  defaultOpen: { type: Boolean, default: void 0 },
48
49
  inputReadOnly: { type: Boolean, default: void 0 },
49
- format: { default: "Y-D" },
50
50
  suffixIcon: { type: [Object, String, Number, Boolean, null, Array], default: void 0 },
51
51
  clearIcon: { type: [Object, String, Number, Boolean, null, Array], default: void 0 },
52
52
  getPopupContainer: {},
@@ -83,29 +83,31 @@ const de = /* @__PURE__ */ x({
83
83
  value: {},
84
84
  defaultValue: {},
85
85
  onChange: {},
86
- onOk: {}
86
+ onOk: {},
87
+ format: { default: "Y-D" },
88
+ timezone: {}
87
89
  },
88
90
  emits: ["update:value"],
89
91
  setup(R, { emit: w }) {
90
- const t = R, D = w, r = p(
91
- () => L.indexOf(t.format) > -1
92
- ), l = p(
93
- () => r.value ? Y[t.format] : t.format
94
- ), { value: g, updateValue: h } = X(
95
- t,
96
- D
97
- ), m = p(() => {
98
- var n, a;
99
- const e = o(g);
100
- return b(e) || !(e != null && e.length) ? e : [
101
- u((n = o(g)) == null ? void 0 : n[0]),
102
- u((a = o(g)) == null ? void 0 : a[1])
103
- ];
104
- }), _ = p(() => o(r) ? t.picker ?? q[t.format] : t.picker), A = p(() => {
105
- const e = o(r) ? G[t.format] : {};
92
+ const o = R, _ = w, i = c(
93
+ () => W.indexOf(o.format) > -1
94
+ ), r = c(
95
+ () => i.value ? Y[o.format] : o.format
96
+ ), { value: p, updateValue: h } = ee(
97
+ o,
98
+ _
99
+ ), m = J(o.timezone), v = c(() => {
100
+ var l, d;
101
+ const e = t(p);
102
+ if (S(e) || !(e != null && e.length))
103
+ return e;
104
+ const n = o.timezone ? M(t(p)[0], o.timezone) : (l = t(p)) == null ? void 0 : l[0], a = o.timezone ? M(t(p)[1], o.timezone) : (d = t(p)) == null ? void 0 : d[1];
105
+ return [u(n), u(a)];
106
+ }), A = c(() => t(i) ? o.picker ?? Z[o.format] : o.picker), F = c(() => {
107
+ const e = t(i) ? q[o.format] : {};
106
108
  return {
107
- ...W(
108
- T(t, [
109
+ ...X(
110
+ b(o, [
109
111
  "value",
110
112
  "onUpdate:value",
111
113
  "onChange",
@@ -117,55 +119,55 @@ const de = /* @__PURE__ */ x({
117
119
  ...e
118
120
  };
119
121
  });
120
- function E(e) {
122
+ function z(e) {
121
123
  if (!e) {
122
124
  h(e);
123
125
  return;
124
126
  }
125
- const n = s(e[0]) ? u(e[0]) : e[0], a = s(e[1]) ? u(e[1]) : e[1];
126
- o(r) ? h([
127
- f(n, o(l)),
128
- f(a, o(l), !1)
129
- ]) : h([M(n), M(a)]);
127
+ let n = f(e[0]) ? u(e[0]) : e[0], a = f(e[1]) ? u(e[1]) : e[1];
128
+ t(i) ? h([
129
+ m(n, t(r)),
130
+ m(a, t(r), !1)
131
+ ]) : h([D(n), D(a)]);
130
132
  }
131
- function F(e) {
132
- var d;
133
- const n = s(e[0]) ? u(e[0]) : e[0], a = s(e[1]) ? u(e[1]) : e[1], i = e[0] ? o(r) ? f(n, o(l)) : n.valueOf() : null, c = e[1] ? o(r) ? f(a, o(l), !1) : a.valueOf() : null;
134
- (d = t.onOk) == null || d.call(t, [i, c]);
133
+ function E(e) {
134
+ var s;
135
+ const n = f(e[0]) ? u(e[0]) : e[0], a = f(e[1]) ? u(e[1]) : e[1], l = e[0] ? t(i) ? m(n, t(r)) : n.valueOf() : null, d = e[1] ? t(i) ? m(a, t(r), !1) : a.valueOf() : null;
136
+ (s = o.onOk) == null || s.call(o, [l, d]);
135
137
  }
136
138
  function N(e, n) {
137
- var v, P;
138
- if (b(e)) {
139
- (v = t.onChange) == null || v.call(t, e, n);
139
+ var y, P;
140
+ if (S(e)) {
141
+ (y = o.onChange) == null || y.call(o, e, n);
140
142
  return;
141
143
  }
142
- const a = s(e[0]) ? u(e[0]) : e[0], i = s(e[1]) ? u(e[1]) : e[1], c = e[0] ? o(r) ? f(a, o(l)) : a.valueOf() : null, d = e[1] ? o(r) ? f(i, o(l), !1) : i.valueOf() : null;
143
- (P = t.onChange) == null || P.call(t, [c, d], n);
144
+ const a = f(e[0]) ? u(e[0]) : e[0], l = f(e[1]) ? u(e[1]) : e[1], d = e[0] ? t(i) ? m(a, t(r)) : a.valueOf() : null, s = e[1] ? t(i) ? m(l, t(r), !1) : l.valueOf() : null;
145
+ (P = o.onChange) == null || P.call(o, [d, s], n);
144
146
  }
145
147
  return (e, n) => {
146
- var a, i;
147
- return e.mode === "read" ? (y(), k(B, { key: 0 }, [
148
- m.value ? (y(), k(B, { key: 0 }, [
149
- O(C((a = m.value[0]) == null ? void 0 : a.format(l.value)) + " ", 1),
150
- S(e.$slots, "readModeSeparator", {}, () => [
151
- V(o(Q))
148
+ var a, l;
149
+ return e.mode === "read" ? (g(), k(B, { key: 0 }, [
150
+ v.value ? (g(), k(B, { key: 0 }, [
151
+ O(C((a = v.value[0]) == null ? void 0 : a.format(r.value)) + " ", 1),
152
+ T(e.$slots, "readModeSeparator", {}, () => [
153
+ V(t(Q))
152
154
  ]),
153
- O(" " + C((i = m.value[1]) == null ? void 0 : i.format(l.value)), 1)
154
- ], 64)) : (y(), k(B, { key: 1 }, [
155
+ O(" " + C((l = v.value[1]) == null ? void 0 : l.format(r.value)), 1)
156
+ ], 64)) : (g(), k(B, { key: 1 }, [
155
157
  O(C(e.emptyText), 1)
156
158
  ], 64))
157
- ], 64)) : (y(), I(o(J).RangePicker, j({ key: 1 }, A.value, {
158
- value: m.value,
159
- "onUpdate:value": E,
159
+ ], 64)) : (g(), I(t(G).RangePicker, j({ key: 1 }, F.value, {
160
+ value: v.value,
161
+ "onUpdate:value": z,
160
162
  onChange: N,
161
- picker: _.value,
162
- format: l.value,
163
- onOk: F
163
+ picker: A.value,
164
+ format: r.value,
165
+ onOk: E
164
166
  }), U({ _: 2 }, [
165
- H(o(T)(e.$slots, "readModeSeparator"), (c, d) => ({
166
- name: d,
167
- fn: $((v) => [
168
- S(e.$slots, d, z(K(v || {})))
167
+ H(t(b)(e.$slots, "readModeSeparator"), (d, s) => ({
168
+ name: s,
169
+ fn: $((y) => [
170
+ T(e.$slots, s, K(L(y || {})))
169
171
  ])
170
172
  }))
171
173
  ]), 1040, ["value", "picker", "format"]));
@@ -173,5 +175,5 @@ const de = /* @__PURE__ */ x({
173
175
  }
174
176
  });
175
177
  export {
176
- de as default
178
+ fe as default
177
179
  };
@@ -5,6 +5,7 @@ import { RangeValue } from 'ant-design-vue/es/vc-picker/interface';
5
5
  import { RangePickerProps } from 'ant-design-vue/es/date-picker/dayjs';
6
6
  import { LiteralUnion } from '../type';
7
7
  import { InputPasswordProps } from './text/input-password-props';
8
+ import { ZoneAlias } from '@aplus-frontend/utils';
8
9
 
9
10
  export type FieldMode = 'read' | 'edit';
10
11
  export type BasicApFieldProps<FieldPropsType = any> = {
@@ -40,6 +41,10 @@ export type ApFieldDateProps = BasicApFieldProps<Omit<DatePickerProps, 'mode' |
40
41
  onChange?: (ts: number | null, dayStr: string) => void;
41
42
  onOk?: (ts: number | null) => void;
42
43
  format?: LiteralUnion<ApFormatPresetType, string>;
44
+ /**
45
+ * 指定时区,指定后value会变为特定时区下的timestamp
46
+ */
47
+ timezone?: ZoneAlias;
43
48
  };
44
49
  export type ApFieldNumberProps = BasicApFieldProps<InputNumberProps> & {
45
50
  emptyText?: string;
@@ -77,13 +82,17 @@ export type ApFieldTextAreaExpose = {
77
82
  blur: () => void;
78
83
  resizableTextArea: any;
79
84
  };
80
- export type ApFieldDateRangeProps = BasicApFieldProps<Omit<RangePickerProps, 'value' | 'onChange' | 'onPanelChange' | 'defaultValue' | 'onOk' | 'renderExtraFooter' | 'onUpdate:value' | 'mode'>> & {
85
+ export type ApFieldDateRangeProps = BasicApFieldProps<Omit<RangePickerProps, 'value' | 'onChange' | 'onPanelChange' | 'defaultValue' | 'onOk' | 'renderExtraFooter' | 'onUpdate:value' | 'mode' | 'format'>> & {
81
86
  emptyText?: string;
82
87
  value?: RangeValue<number> | null;
83
88
  defaultValue?: RangeValue<number>;
84
89
  onChange?: (ts: RangeValue<number> | null, dayStr: [string, string]) => void;
85
90
  onOk?: (ts: RangeValue<number>) => void;
86
91
  format?: LiteralUnion<ApFormatPresetType, string>;
92
+ /**
93
+ * 指定时区,指定后value会变为特定时区下的timestamp
94
+ */
95
+ timezone?: ZoneAlias;
87
96
  };
88
97
  export type ApFieldSelectProps = BasicApFieldProps<Omit<SelectProps, 'mode' | 'value' | 'onUpdate:value' | 'onSearch'>> & {
89
98
  emptyText?: string;