@aplus-frontend/ui 0.4.10 → 0.4.11

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 (95) hide show
  1. package/es/index.mjs +42 -36
  2. package/es/src/ap-field/date/index.vue.mjs +98 -65
  3. package/es/src/ap-field/date-range/index.vue.mjs +98 -70
  4. package/es/src/ap-field/hooks/use-date-timezone.d.ts +7 -0
  5. package/es/src/ap-field/hooks/use-date-timezone.mjs +10 -0
  6. package/es/src/ap-field/hooks/use-default-presets.d.ts +3 -2
  7. package/es/src/ap-field/hooks/use-default-presets.mjs +8 -8
  8. package/es/src/ap-field/interface.d.ts +8 -2
  9. package/es/src/business/ap-ladder/ApLadder.vue.d.ts +6 -2
  10. package/es/src/business/ap-ladder/ApLadder.vue2.mjs +118 -95
  11. package/es/src/business/ap-ladder/index.d.ts +3 -1
  12. package/es/src/full-screen/index.d.ts +3 -0
  13. package/es/src/full-screen/index.mjs +2 -0
  14. package/es/src/full-screen/index.vue.d.ts +43 -0
  15. package/es/src/full-screen/index.vue.mjs +84 -0
  16. package/es/src/full-screen/index.vue2.mjs +4 -0
  17. package/es/src/full-screen/interface.d.ts +50 -0
  18. package/es/src/full-screen/interface.mjs +1 -0
  19. package/es/src/full-screen/style/css.d.ts +0 -0
  20. package/es/src/full-screen/style/css.js +1 -0
  21. package/es/src/full-screen/style/index.d.ts +0 -0
  22. package/es/src/full-screen/style/index.js +1 -0
  23. package/es/src/hooks/index.d.ts +1 -0
  24. package/es/src/hooks/index.mjs +6 -4
  25. package/es/src/hooks/useFullScreen.d.ts +8 -0
  26. package/es/src/hooks/useFullScreen.mjs +50 -0
  27. package/es/src/index.d.ts +2 -0
  28. package/es/src/index.mjs +243 -237
  29. package/es/src/path-map.mjs +3 -1
  30. package/es/src/portal/index.d.ts +3 -0
  31. package/es/src/portal/index.mjs +2 -0
  32. package/es/src/portal/index.vue.d.ts +18 -0
  33. package/es/src/portal/index.vue.mjs +21 -0
  34. package/es/src/portal/index.vue2.mjs +4 -0
  35. package/es/src/portal/interface.d.ts +2 -0
  36. package/es/src/portal/interface.mjs +1 -0
  37. package/es/src/portal/style/css.d.ts +1 -0
  38. package/es/src/portal/style/css.js +1 -0
  39. package/es/src/portal/style/index.d.ts +1 -0
  40. package/es/src/portal/style/index.js +1 -0
  41. package/lib/index.js +1 -1
  42. package/lib/src/ap-field/date/index.vue.js +1 -1
  43. package/lib/src/ap-field/date-range/index.vue.js +1 -1
  44. package/lib/src/ap-field/hooks/use-date-timezone.d.ts +7 -0
  45. package/lib/src/ap-field/hooks/use-date-timezone.js +1 -0
  46. package/lib/src/ap-field/hooks/use-default-presets.d.ts +3 -2
  47. package/lib/src/ap-field/hooks/use-default-presets.js +1 -1
  48. package/lib/src/ap-field/interface.d.ts +8 -2
  49. package/lib/src/business/ap-ladder/ApLadder.vue.d.ts +6 -2
  50. package/lib/src/business/ap-ladder/ApLadder.vue2.js +1 -1
  51. package/lib/src/business/ap-ladder/index.d.ts +3 -1
  52. package/lib/src/full-screen/index.d.ts +3 -0
  53. package/lib/src/full-screen/index.js +1 -0
  54. package/lib/src/full-screen/index.vue.d.ts +43 -0
  55. package/lib/src/full-screen/index.vue.js +1 -0
  56. package/lib/src/full-screen/index.vue2.js +1 -0
  57. package/lib/src/full-screen/interface.d.ts +50 -0
  58. package/lib/src/full-screen/interface.js +1 -0
  59. package/lib/src/full-screen/style/css.cjs +1 -0
  60. package/lib/src/full-screen/style/css.d.ts +0 -0
  61. package/lib/src/full-screen/style/index.cjs +1 -0
  62. package/lib/src/full-screen/style/index.d.ts +0 -0
  63. package/lib/src/hooks/index.d.ts +1 -0
  64. package/lib/src/hooks/index.js +1 -1
  65. package/lib/src/hooks/useFullScreen.d.ts +8 -0
  66. package/lib/src/hooks/useFullScreen.js +1 -0
  67. package/lib/src/index.d.ts +2 -0
  68. package/lib/src/index.js +1 -1
  69. package/lib/src/path-map.js +1 -1
  70. package/lib/src/portal/index.d.ts +3 -0
  71. package/lib/src/portal/index.js +1 -0
  72. package/lib/src/portal/index.vue.d.ts +18 -0
  73. package/lib/src/portal/index.vue.js +1 -0
  74. package/lib/src/portal/index.vue2.js +1 -0
  75. package/lib/src/portal/interface.d.ts +2 -0
  76. package/lib/src/portal/interface.js +1 -0
  77. package/lib/src/portal/style/css.cjs +1 -0
  78. package/lib/src/portal/style/css.d.ts +1 -0
  79. package/lib/src/portal/style/index.cjs +1 -0
  80. package/lib/src/portal/style/index.d.ts +1 -0
  81. package/package.json +3 -3
  82. package/theme/ap-form/ap-form-item.css +4 -0
  83. package/theme/ap-form/ap-form-item.less +7 -0
  84. package/theme/ap-form/index.css +18 -0
  85. package/theme/ap-form/item-text-group.css +14 -0
  86. package/theme/ap-form/item-text-group.less +11 -1
  87. package/theme/ap-form/item-text.css +14 -0
  88. package/theme/ap-form/search-form.css +4 -0
  89. package/theme/ap-table/ap-table.css +18 -0
  90. package/theme/ap-table-modal/index.css +18 -0
  91. package/theme/editable-table/index.css +18 -0
  92. package/theme/full-screen/index.css +6 -0
  93. package/theme/full-screen/index.less +12 -0
  94. package/theme/index.css +24 -0
  95. package/theme/index.less +1 -0
package/es/index.mjs CHANGED
@@ -4,8 +4,8 @@ import "./src/hooks/index.mjs";
4
4
  import { configProviderProps as d } from "./src/config-provider/config-provider-props.mjs";
5
5
  import { DEFAULT_NAMESPACE as s, DEFAULT_UIMODE as A, configProviderContextKey as n } from "./src/config-provider/constants.mjs";
6
6
  import { keysOf as c, provideGlobalConfig as F, useGlobalConfig as I } from "./src/config-provider/hooks/use-global-config.mjs";
7
- import { buildLocaleContext as b, buildTranslator as C, localeContextKey as D, translate as S, useLocale as g } from "./src/config-provider/hooks/use-locale.mjs";
8
- import { defaultNamespace as G, namespaceContextKey as M, useGetDerivedNamespace as P, useNamespace as E } from "./src/config-provider/hooks/use-namespace.mjs";
7
+ import { buildLocaleContext as b, buildTranslator as S, localeContextKey as C, translate as D, useLocale as g } from "./src/config-provider/hooks/use-locale.mjs";
8
+ import { defaultNamespace as G, namespaceContextKey as P, useGetDerivedNamespace as M, useNamespace as E } from "./src/config-provider/hooks/use-namespace.mjs";
9
9
  import { ConfigProvider as N, globalConfigCached as R } from "./src/config-provider/config-provider.mjs";
10
10
  import { APConfigProvider as w } from "./src/config-provider/index.mjs";
11
11
  import { ApFormItemText as v } from "./src/ap-form/items/text/index.mjs";
@@ -28,10 +28,10 @@ import { default as ne } from "./src/ap-form/dependency/index.vue.mjs";
28
28
  import { default as ce } from "./src/ap-form/set/index.vue.mjs";
29
29
  import { default as Ie } from "./src/ap-form/drawer-form/index.vue.mjs";
30
30
  import { default as be } from "./src/ap-form/render/control.vue.mjs";
31
- import { default as De } from "./src/ap-form/render/item.vue.mjs";
31
+ import { default as Ce } from "./src/ap-form/render/item.vue.mjs";
32
32
  import { default as ge } from "./src/ap-form/provider/index.vue.mjs";
33
33
  import { ApField as Ge } from "./src/ap-field/index.mjs";
34
- import { ApFieldText as Pe } from "./src/ap-field/text/index.mjs";
34
+ import { ApFieldText as Me } from "./src/ap-field/text/index.mjs";
35
35
  import { default as Le } from "./src/ap-field/checkbox/index.vue.mjs";
36
36
  import { default as Re } from "./src/ap-field/date/index.vue.mjs";
37
37
  import { default as we } from "./src/ap-field/number/index.vue.mjs";
@@ -53,10 +53,10 @@ import { default as so } from "./src/ap-action/group/index.vue.mjs";
53
53
  import { DictCode as no, langMap as io } from "./src/work-order-modal/interfaces.mjs";
54
54
  import { createWorkOrderModal as Fo } from "./src/work-order-modal/createWorkOrder.mjs";
55
55
  import { default as To } from "./src/work-order-modal/work-order-modal.vue.mjs";
56
- import { default as Co } from "./src/ap-tag/ap-tag.vue.mjs";
57
- import { default as So } from "./src/ap-tag/ap-tag-group.vue.mjs";
56
+ import { default as So } from "./src/ap-tag/ap-tag.vue.mjs";
57
+ import { default as Do } from "./src/ap-tag/ap-tag-group.vue.mjs";
58
58
  import { default as ho } from "./src/ap-info-layout/ApInfoLayout.vue.mjs";
59
- import { NeedNameKeyDefault as Mo } from "./src/ap-upload/apUploadTypes.mjs";
59
+ import { NeedNameKeyDefault as Po } from "./src/ap-upload/apUploadTypes.mjs";
60
60
  import { default as Eo } from "./src/ap-upload/apUpload.vue.mjs";
61
61
  import { ApDownLoadNeedNameKeyDefault as No } from "./src/ap-download/interface.mjs";
62
62
  import { default as yo } from "./src/ap-download/ap-download.vue.mjs";
@@ -80,10 +80,10 @@ import { ApExpandAlert as Ar } from "./src/business/ap-expand-alert/index.mjs";
80
80
  import { ApExportGroupActionType as ir } from "./src/business/ap-export-group/interface.mjs";
81
81
  import { ApExportGroup as Fr } from "./src/business/ap-export-group/index.mjs";
82
82
  import { handleExportDownload as Tr } from "./src/business/ap-export-group/handleExportDownload.mjs";
83
- import { convertExportField as Cr } from "./src/business/ap-export-group/convertExportField.mjs";
84
- import { ApImage as Sr } from "./src/business/ap-image/index.mjs";
83
+ import { convertExportField as Sr } from "./src/business/ap-export-group/convertExportField.mjs";
84
+ import { ApImage as Dr } from "./src/business/ap-image/index.mjs";
85
85
  import { ApInputRadio as hr } from "./src/business/ap-input-radio/index.mjs";
86
- import { ApLabel as Mr, ApLabelGroup as Pr } from "./src/business/ap-label/index.mjs";
86
+ import { ApLabel as Pr, ApLabelGroup as Mr } from "./src/business/ap-label/index.mjs";
87
87
  import { locales as Lr } from "./src/business/ap-ladder/interface.mjs";
88
88
  import { ApLadder as Rr } from "./src/business/ap-ladder/index.mjs";
89
89
  import { ApSelectLayout as wr } from "./src/business/ap-select-layout/index.mjs";
@@ -104,15 +104,18 @@ import { useTablePaging as nt } from "./src/ap-table/hooks/use-table-paging.mjs"
104
104
  import { ApTable as ct } from "./src/ap-table/index.mjs";
105
105
  import { default as It } from "./src/editable-table/index.vue.mjs";
106
106
  import { default as bt } from "./src/editable-table/form-item.vue.mjs";
107
- import { default as Dt } from "./src/ap-descriptions/ap-descriptions.vue.mjs";
107
+ import { default as Ct } from "./src/ap-descriptions/ap-descriptions.vue.mjs";
108
108
  import { ensureRangeValue as gt } from "./src/scroll-bar/utils/index.mjs";
109
109
  import { default as Gt } from "./src/scroll-bar/index.vue.mjs";
110
- import { default as Pt } from "./src/scroll-bar/internal.vue.mjs";
110
+ import { default as Mt } from "./src/scroll-bar/internal.vue.mjs";
111
111
  import { default as Lt } from "./src/scroll-view/index.vue.mjs";
112
- import { useMessage as Rt } from "./src/hooks/useMessage.mjs";
113
- import { useControllableValue as wt } from "./src/hooks/useControllableValue.mjs";
114
- import { useManualRef as vt } from "./src/hooks/useManualRef.mjs";
115
- import { useThrottleRef as Kt } from "./src/hooks/useThrottleRef.mjs";
112
+ import { default as Rt } from "./src/portal/index.vue.mjs";
113
+ import { default as wt } from "./src/full-screen/index.vue.mjs";
114
+ import { useMessage as vt } from "./src/hooks/useMessage.mjs";
115
+ import { useControllableValue as Kt } from "./src/hooks/useControllableValue.mjs";
116
+ import { useManualRef as Ot } from "./src/hooks/useManualRef.mjs";
117
+ import { useThrottleRef as Wt } from "./src/hooks/useThrottleRef.mjs";
118
+ import { useFullScreen as zt } from "./src/hooks/useFullScreen.mjs";
116
119
  const a = {
117
120
  install: (r) => {
118
121
  for (const t in o) {
@@ -136,7 +139,7 @@ export {
136
139
  _o as ApButton,
137
140
  xr as ApButtonGroup,
138
141
  ur as ApCard,
139
- Dt as ApDescriptions,
142
+ Ct as ApDescriptions,
140
143
  No as ApDownLoadNeedNameKeyDefault,
141
144
  yo as ApDownload,
142
145
  jo as ApDrawer,
@@ -156,7 +159,7 @@ export {
156
159
  ze as ApFieldSelect,
157
160
  qe as ApFieldSlider,
158
161
  Ke as ApFieldSwitch,
159
- Pe as ApFieldText,
162
+ Me as ApFieldText,
160
163
  Oe as ApFieldTextArea,
161
164
  re as ApForm,
162
165
  be as ApFormControlRender,
@@ -170,7 +173,7 @@ export {
170
173
  fe as ApFormItemGroup,
171
174
  O as ApFormItemNumber,
172
175
  $ as ApFormItemRadio,
173
- De as ApFormItemRender,
176
+ Ce as ApFormItemRender,
174
177
  q as ApFormItemSelect,
175
178
  Q as ApFormItemSwitch,
176
179
  v as ApFormItemText,
@@ -182,11 +185,11 @@ export {
182
185
  de as ApFormSearchForm,
183
186
  ce as ApFormSet,
184
187
  tt as ApGroupSearch,
185
- Sr as ApImage,
188
+ Dr as ApImage,
186
189
  ho as ApInfoLayout,
187
190
  hr as ApInputRadio,
188
- Mr as ApLabel,
189
- Pr as ApLabelGroup,
191
+ Pr as ApLabel,
192
+ Mr as ApLabelGroup,
190
193
  Rr as ApLadder,
191
194
  Vo as ApList,
192
195
  Uo as ApModal,
@@ -199,8 +202,8 @@ export {
199
202
  Qr as ApSummary,
200
203
  ct as ApTable,
201
204
  Xo as ApTableModal,
202
- Co as ApTag,
203
- So as ApTagGroup,
205
+ So as ApTag,
206
+ Do as ApTagGroup,
204
207
  Ur as ApTitle,
205
208
  Jo as ApTransformDataHelper,
206
209
  Eo as ApUpload,
@@ -214,19 +217,21 @@ export {
214
217
  no as DictCode,
215
218
  It as EditableTable,
216
219
  bt as EditableTableFormItem,
217
- Pt as InternalScrollBar,
218
- Mo as NeedNameKeyDefault,
220
+ wt as FullScreen,
221
+ Mt as InternalScrollBar,
222
+ Po as NeedNameKeyDefault,
223
+ Rt as Portal,
219
224
  Gt as ScrollBar,
220
225
  Lt as ScrollView,
221
226
  To as WorkOrderModal,
222
227
  eo as adminToken,
223
228
  oo as aplusToken,
224
229
  b as buildLocaleContext,
225
- C as buildTranslator,
230
+ S as buildTranslator,
226
231
  Hr as computedRecords,
227
232
  n as configProviderContextKey,
228
233
  d as configProviderProps,
229
- Cr as convertExportField,
234
+ Sr as convertExportField,
230
235
  Fo as createWorkOrderModal,
231
236
  a as default,
232
237
  G as defaultNamespace,
@@ -238,23 +243,24 @@ export {
238
243
  Tr as handleExportDownload,
239
244
  c as keysOf,
240
245
  io as langMap,
241
- D as localeContextKey,
246
+ C as localeContextKey,
242
247
  Lr as locales,
243
- M as namespaceContextKey,
248
+ P as namespaceContextKey,
244
249
  l as pathMap,
245
250
  F as provideGlobalConfig,
246
- S as translate,
247
- wt as useControllableValue,
248
- P as useGetDerivedNamespace,
251
+ D as translate,
252
+ Kt as useControllableValue,
253
+ zt as useFullScreen,
254
+ M as useGetDerivedNamespace,
249
255
  I as useGlobalConfig,
250
256
  g as useLocale,
251
- vt as useManualRef,
252
- Rt as useMessage,
257
+ Ot as useManualRef,
258
+ vt as useMessage,
253
259
  E as useNamespace,
254
260
  Vr as usePageListApTable,
255
261
  Zo as useTableModal,
256
262
  nt as useTablePaging,
257
263
  _r as useTableRefresh,
258
264
  or as useTableSelectModal,
259
- Kt as useThrottleRef
265
+ Wt as useThrottleRef
260
266
  };
@@ -1,14 +1,15 @@
1
- import { defineComponent as b, computed as i, unref as t, openBlock as v, createElementBlock as _, Fragment as w, createTextVNode as M, toDisplayString as R, createBlock as F, mergeProps as A, createSlots as D, renderList as x, withCtx as E, renderSlot as V, normalizeProps as z, guardReactiveProps as N } from "vue";
2
- import r from "dayjs";
3
- import { DatePicker as j } from "@aplus-frontend/antdv";
4
- import { ApFieldDatePresetFormats as I, PRESET_FORMAT_MAP as H, PRESET_FORMAT_PICK_MAP as U, PRESET_FORMAT_TIME_MAP as K } from "./constant.mjs";
1
+ import { defineComponent as x, computed as s, unref as a, openBlock as m, createElementBlock as g, Fragment as k, createTextVNode as P, toDisplayString as C, createBlock as h, normalizeStyle as V, withCtx as f, isRef as E, renderList as S, createCommentVNode as N, createVNode as j, mergeProps as I, createSlots as U, renderSlot as H, normalizeProps as K, guardReactiveProps as $ } from "vue";
2
+ import u from "dayjs";
3
+ import { InputGroup as G, Select as L, SelectOption as W, DatePicker as Y } from "@aplus-frontend/antdv";
4
+ import { ApFieldDatePresetFormats as Z, PRESET_FORMAT_MAP as q, PRESET_FORMAT_PICK_MAP as J, PRESET_FORMAT_TIME_MAP as Q } from "./constant.mjs";
5
5
  import "../../hooks/index.mjs";
6
- import { isNil as y, omit as $ } from "lodash-unified";
7
- import { formatDayWithTimezone as L } from "./helper.mjs";
8
- import { getTimeFormatToZone as W } from "@aplus-frontend/utils";
9
- import { useDefaultPlaceholder as Y } from "../hooks/use-default-placeholder.mjs";
10
- import { useControllableValue as Z } from "../../hooks/useControllableValue.mjs";
11
- const le = /* @__PURE__ */ b({
6
+ import { isNil as T, omit as X } from "lodash-unified";
7
+ import { formatDayWithTimezone as z } from "./helper.mjs";
8
+ import { getTimeFormatToZone as ee } from "@aplus-frontend/utils";
9
+ import { useDefaultPlaceholder as oe } from "../hooks/use-default-placeholder.mjs";
10
+ import { useDateTimezone as te } from "../hooks/use-date-timezone.mjs";
11
+ import { useControllableValue as ae } from "../../hooks/useControllableValue.mjs";
12
+ const ve = /* @__PURE__ */ x({
12
13
  name: "ApFieldDate",
13
14
  __name: "index",
14
15
  props: {
@@ -87,23 +88,23 @@ const le = /* @__PURE__ */ b({
87
88
  timezone: {}
88
89
  },
89
90
  emits: ["update:value"],
90
- setup(h, { emit: B }) {
91
- const e = h, g = B, { value: m, updateValue: c } = Z(
91
+ setup(O, { emit: b }) {
92
+ const e = O, w = b, { value: c, updateValue: B } = ae(
92
93
  e,
93
- g
94
- ), k = Y("Date", e), n = i(
95
- () => I.indexOf(e.format) > -1
96
- ), d = i(
97
- () => n.value ? H[e.format] : e.format
98
- ), p = i(() => {
99
- if (y(t(m)))
94
+ w
95
+ ), A = oe("Date", e), { currentTimezone: d } = te(e), r = s(
96
+ () => Z.indexOf(e.format) > -1
97
+ ), i = s(
98
+ () => r.value ? q[e.format] : e.format
99
+ ), v = s(() => {
100
+ if (T(a(c)))
100
101
  return;
101
- let o = r(t(m));
102
- return e.timezone && (o = r(W(t(m), e.timezone))), o;
103
- }), P = i(() => t(n) ? e.picker ?? U[e.format] : e.picker), C = i(() => {
104
- const o = t(n) ? K[e.format] : {};
102
+ let t = u(a(c));
103
+ return e.timezone && (t = u(ee(a(c), d.value))), t;
104
+ }), _ = s(() => a(r) ? e.picker ?? J[e.format] : e.picker), R = s(() => {
105
+ const t = a(r) ? Q[e.format] : {};
105
106
  return {
106
- ...$(e, [
107
+ ...X(e, [
107
108
  "value",
108
109
  "defaultValue",
109
110
  "onChange",
@@ -112,61 +113,93 @@ const le = /* @__PURE__ */ b({
112
113
  "onUpdate:value",
113
114
  "mode"
114
115
  ]),
115
- placeholder: t(k),
116
- ...o
116
+ placeholder: a(A),
117
+ ...t
117
118
  };
118
- }), f = L(e.timezone);
119
- function O(o) {
120
- if (y(o)) {
121
- c(null);
119
+ }), y = (t, n, o = !0) => z(d.value)(t, n, o);
120
+ function M(t) {
121
+ if (T(t)) {
122
+ B(null);
122
123
  return;
123
124
  }
124
- const l = r(o);
125
- c(
126
- f(
127
- l,
128
- t(n) ? t(d) : void 0,
125
+ const n = u(t);
126
+ B(
127
+ y(
128
+ n,
129
+ a(r) ? a(i) : void 0,
129
130
  e.formatBegins
130
131
  )
131
132
  );
132
133
  }
133
- function T(o, l) {
134
- var s;
135
- const u = r(o), a = o ? f(
136
- u,
137
- t(n) ? t(d) : void 0,
134
+ function D(t, n) {
135
+ var p;
136
+ const o = u(t), l = t ? y(
137
+ o,
138
+ a(r) ? a(i) : void 0,
138
139
  e.formatBegins
139
140
  ) : null;
140
- (s = e.onChange) == null || s.call(e, a, l);
141
+ (p = e.onChange) == null || p.call(e, l, n);
141
142
  }
142
- function S(o) {
143
- var a;
144
- const l = r(o), u = o ? f(
145
- l,
146
- t(n) ? t(d) : void 0,
143
+ function F(t) {
144
+ var l;
145
+ const n = u(t), o = t ? y(
146
+ n,
147
+ a(r) ? a(i) : void 0,
147
148
  e.formatBegins
148
149
  ) : null;
149
- (a = e.onOk) == null || a.call(e, u);
150
+ (l = e.onOk) == null || l.call(e, o);
150
151
  }
151
- return (o, l) => o.mode === "read" ? (v(), _(w, { key: 0 }, [
152
- M(R(p.value ? t(r)(p.value).format(d.value) : o.emptyText), 1)
153
- ], 64)) : (v(), F(t(j), A({ key: 1 }, C.value, {
154
- value: p.value,
155
- format: d.value,
156
- picker: P.value,
157
- "onUpdate:value": O,
158
- onChange: T,
159
- onOk: S
160
- }), D({ _: 2 }, [
161
- x(o.$slots, (u, a) => ({
162
- name: a,
163
- fn: E((s) => [
164
- V(o.$slots, a, z(N(s || {})))
165
- ])
166
- }))
167
- ]), 1040, ["value", "format", "picker"]));
152
+ return (t, n) => t.mode === "read" ? (m(), g(k, { key: 0 }, [
153
+ P(C(v.value ? a(u)(v.value).format(i.value) : t.emptyText), 1)
154
+ ], 64)) : (m(), h(a(G), {
155
+ key: 1,
156
+ compact: "",
157
+ style: V({
158
+ display: Array.isArray(e.timezone) && e.timezone.length ? "flex" : "block"
159
+ })
160
+ }, {
161
+ default: f(() => [
162
+ Array.isArray(e.timezone) && e.timezone.length ? (m(), h(a(L), {
163
+ key: 0,
164
+ value: a(d),
165
+ "onUpdate:value": n[0] || (n[0] = (o) => E(d) ? d.value = o : null),
166
+ "default-active-first-option": "",
167
+ "dropdown-match-select-width": !1,
168
+ style: { "max-width": "50%" }
169
+ }, {
170
+ default: f(() => [
171
+ (m(!0), g(k, null, S(e.timezone, (o) => (m(), h(a(W), {
172
+ key: o == null ? void 0 : o.value,
173
+ value: o == null ? void 0 : o.value
174
+ }, {
175
+ default: f(() => [
176
+ P(C((o == null ? void 0 : o.label) ?? (o == null ? void 0 : o.value)), 1)
177
+ ]),
178
+ _: 2
179
+ }, 1032, ["value"]))), 128))
180
+ ]),
181
+ _: 1
182
+ }, 8, ["value"])) : N("", !0),
183
+ j(a(Y), I(R.value, {
184
+ value: v.value,
185
+ format: i.value,
186
+ picker: _.value,
187
+ "onUpdate:value": M,
188
+ onChange: D,
189
+ onOk: F
190
+ }), U({ _: 2 }, [
191
+ S(t.$slots, (o, l) => ({
192
+ name: l,
193
+ fn: f((p) => [
194
+ H(t.$slots, l, K($(p || {})))
195
+ ])
196
+ }))
197
+ ]), 1040, ["value", "format", "picker"])
198
+ ]),
199
+ _: 3
200
+ }, 8, ["style"]));
168
201
  }
169
202
  });
170
203
  export {
171
- le as default
204
+ ve as default
172
205
  };
@@ -1,17 +1,18 @@
1
- import { defineComponent as H, useSlots as K, computed as m, unref as n, isVNode as $, createVNode as T, Fragment as h, openBlock as g, createElementBlock as v, createTextVNode as B, toDisplayString as P, createBlock as O, resolveDynamicComponent as L, mergeProps as W, createSlots as Y, renderList as Z, withCtx as q, renderSlot as G, normalizeProps as J, guardReactiveProps as Q } from "vue";
2
- import { ApFieldDatePresetFormats as X, PRESET_FORMAT_MAP as ee, PRESET_FORMAT_PICK_MAP as oe, PRESET_FORMAT_TIME_MAP as ne } from "../date/constant.mjs";
1
+ import { defineComponent as L, useSlots as W, computed as y, unref as t, isVNode as Y, createVNode as M, Fragment as v, openBlock as d, createElementBlock as k, createTextVNode as B, toDisplayString as P, createBlock as C, resolveDynamicComponent as Z, normalizeStyle as q, withCtx as D, isRef as J, renderList as R, createCommentVNode as Q, mergeProps as X, createSlots as z, renderSlot as ee, normalizeProps as oe, guardReactiveProps as ne } from "vue";
2
+ import { ApFieldDatePresetFormats as te, PRESET_FORMAT_MAP as ae, PRESET_FORMAT_PICK_MAP as re, PRESET_FORMAT_TIME_MAP as le } from "../date/constant.mjs";
3
3
  import "../../hooks/index.mjs";
4
- import { isNil as b, omit as R, isString as c, isFunction as te } from "lodash-unified";
5
- import u from "dayjs";
6
- import { DatePicker as ae } from "@aplus-frontend/antdv";
7
- import { formatDayWithTimezone as re } from "../date/helper.mjs";
8
- import { SwapRightOutlined as le } from "@ant-design/icons-vue";
9
- import { omitUndefined as ue } from "../../utils/index.mjs";
10
- import { getTimeFormatToZone as w } from "@aplus-frontend/utils";
11
- import { useDefaultPlaceholder as de } from "../hooks/use-default-placeholder.mjs";
12
- import { useDefaultPresets as ie } from "../hooks/use-default-presets.mjs";
13
- import { useControllableValue as se } from "../../hooks/useControllableValue.mjs";
14
- const De = /* @__PURE__ */ H({
4
+ import { isNil as w, omit as _, isString as h, isFunction as ue } from "lodash-unified";
5
+ import i from "dayjs";
6
+ import { InputGroup as de, Select as ie, SelectOption as se, DatePicker as fe } from "@aplus-frontend/antdv";
7
+ import { formatDayWithTimezone as pe } from "../date/helper.mjs";
8
+ import { SwapRightOutlined as me } from "@ant-design/icons-vue";
9
+ import { omitUndefined as ce } from "../../utils/index.mjs";
10
+ import { getTimeFormatToZone as F } from "@aplus-frontend/utils";
11
+ import { useDefaultPlaceholder as ye } from "../hooks/use-default-placeholder.mjs";
12
+ import { useDefaultPresets as ve } from "../hooks/use-default-presets.mjs";
13
+ import { useDateTimezone as he } from "../hooks/use-date-timezone.mjs";
14
+ import { useControllableValue as ge } from "../../hooks/useControllableValue.mjs";
15
+ const Fe = /* @__PURE__ */ L({
15
16
  __name: "index",
16
17
  props: {
17
18
  mode: {
@@ -153,85 +154,112 @@ const De = /* @__PURE__ */ H({
153
154
  }
154
155
  },
155
156
  emits: ["update:value"],
156
- setup(_, {
157
- emit: A
157
+ setup(N, {
158
+ emit: x
158
159
  }) {
159
- const o = _, F = A, k = K(), d = m(() => X.indexOf(o.format) > -1), i = m(() => d.value ? ee[o.format] : o.format), {
160
- value: y,
161
- updateValue: C
162
- } = se(o, F), N = de("DateRange", o), x = ie(o), s = re(o.timezone), S = m(() => {
163
- var a, l;
164
- const e = n(y);
165
- if (b(e) || !(e != null && e.length))
160
+ const o = N, E = x, T = W(), s = y(() => te.indexOf(o.format) > -1), f = y(() => s.value ? ae[o.format] : o.format), {
161
+ value: g,
162
+ updateValue: O
163
+ } = ge(o, E), V = ye("DateRange", o), {
164
+ currentTimezone: u
165
+ } = he(o), I = ve({
166
+ ...o,
167
+ timezone: u
168
+ }), p = (e, a, r = !0) => pe(u.value)(e, a, r), S = y(() => {
169
+ var l, n;
170
+ const e = t(g);
171
+ if (w(e) || !(e != null && e.length))
166
172
  return e;
167
- const r = o.timezone ? w(n(y)[0], o.timezone) : (a = n(y)) == null ? void 0 : a[0], t = o.timezone ? w(n(y)[1], o.timezone) : (l = n(y)) == null ? void 0 : l[1];
168
- return [u(r), u(t)];
169
- }), z = m(() => n(d) ? o.picker ?? oe[o.format] : o.picker), E = m(() => {
170
- const e = n(d) ? ne[o.format] : {};
173
+ const a = u.value ? F(t(g)[0], u.value) : (l = t(g)) == null ? void 0 : l[0], r = o.timezone ? F(t(g)[1], u.value) : (n = t(g)) == null ? void 0 : n[1];
174
+ return [i(a), i(r)];
175
+ }), U = y(() => t(s) ? o.picker ?? re[o.format] : o.picker), j = y(() => {
176
+ const e = t(s) ? le[o.format] : {};
171
177
  return {
172
- ...ue(R(o, ["value", "onUpdate:value", "onChange", "onOk", "format", "mode", "presets"])),
173
- placeholder: n(N),
174
- presets: n(x),
178
+ ...ce(_(o, ["value", "onUpdate:value", "onChange", "onOk", "format", "mode", "presets"])),
179
+ placeholder: t(V),
180
+ presets: t(I),
175
181
  ...e
176
182
  };
177
183
  });
178
- function V(e) {
184
+ function H(e) {
179
185
  if (!e) {
180
- C(e);
186
+ O(e);
181
187
  return;
182
188
  }
183
- let r = c(e[0]) ? u(e[0]) : e[0], t = c(e[1]) ? u(e[1]) : e[1];
184
- const a = n(d) ? n(i) : void 0;
185
- C([s(r, a), s(t, a, !1)]);
189
+ let a = h(e[0]) ? i(e[0]) : e[0], r = h(e[1]) ? i(e[1]) : e[1];
190
+ const l = t(s) ? t(f) : void 0;
191
+ O([p(a, l), p(r, l, !1)]);
186
192
  }
187
- function I(e) {
188
- var p;
189
- const r = c(e[0]) ? u(e[0]) : e[0], t = c(e[1]) ? u(e[1]) : e[1], a = n(d) ? n(i) : void 0, l = e[0] ? s(r, a) : null, f = e[1] ? s(t, a, !1) : null;
190
- (p = o.onOk) == null || p.call(o, [l, f]);
193
+ function K(e) {
194
+ var c;
195
+ const a = h(e[0]) ? i(e[0]) : e[0], r = h(e[1]) ? i(e[1]) : e[1], l = t(s) ? t(f) : void 0, n = e[0] ? p(a, l) : null, m = e[1] ? p(r, l, !1) : null;
196
+ (c = o.onOk) == null || c.call(o, [n, m]);
191
197
  }
192
- function j(e, r) {
193
- var D, M;
194
- if (b(e)) {
195
- (D = o.onChange) == null || D.call(o, e, r);
198
+ function $(e, a) {
199
+ var b, A;
200
+ if (w(e)) {
201
+ (b = o.onChange) == null || b.call(o, e, a);
196
202
  return;
197
203
  }
198
- const t = c(e[0]) ? u(e[0]) : e[0], a = c(e[1]) ? u(e[1]) : e[1], l = n(d) ? n(i) : void 0, f = e[0] ? s(t, l) : null, p = e[1] ? s(a, l, !1) : null;
199
- (M = o.onChange) == null || M.call(o, [f, p], r);
204
+ const r = h(e[0]) ? i(e[0]) : e[0], l = h(e[1]) ? i(e[1]) : e[1], n = t(s) ? t(f) : void 0, m = e[0] ? p(r, n) : null, c = e[1] ? p(l, n, !1) : null;
205
+ (A = o.onChange) == null || A.call(o, [m, c], a);
200
206
  }
201
- const U = m(() => {
202
- var t;
207
+ const G = y(() => {
208
+ var r;
203
209
  const e = o.readModeSeparator;
204
210
  if (e)
205
- return $(e) || te(e) ? o.readModeSeparator : T(h, null, [o.readModeSeparator]);
206
- const r = (t = k.readModeSeparator) == null ? void 0 : t.call(k);
207
- return r ? T(h, null, [r]) : le;
211
+ return Y(e) || ue(e) ? o.readModeSeparator : M(v, null, [o.readModeSeparator]);
212
+ const a = (r = T.readModeSeparator) == null ? void 0 : r.call(T);
213
+ return a ? M(v, null, [a]) : me;
208
214
  });
209
- return (e, r) => {
210
- var t, a;
211
- return e.mode === "read" ? (g(), v(h, {
215
+ return (e, a) => {
216
+ var r, l;
217
+ return e.mode === "read" ? (d(), k(v, {
212
218
  key: 0
213
- }, [S.value ? (g(), v(h, {
219
+ }, [S.value ? (d(), k(v, {
214
220
  key: 0
215
- }, [B(P((t = S.value[0]) == null ? void 0 : t.format(i.value)) + " ", 1), (g(), O(L(U.value))), B(" " + P((a = S.value[1]) == null ? void 0 : a.format(i.value)), 1)], 64)) : (g(), v(h, {
221
+ }, [B(P((r = S.value[0]) == null ? void 0 : r.format(f.value)) + " ", 1), (d(), C(Z(G.value))), B(" " + P((l = S.value[1]) == null ? void 0 : l.format(f.value)), 1)], 64)) : (d(), k(v, {
216
222
  key: 1
217
- }, [B(P(e.emptyText), 1)], 64))], 64)) : (g(), O(n(ae).RangePicker, W({
218
- key: 1
219
- }, E.value, {
220
- value: S.value,
221
- picker: z.value,
222
- format: i.value,
223
- "onUpdate:value": V,
224
- onChange: j,
225
- onOk: I
226
- }), Y({
227
- _: 2
228
- }, [Z(n(R)(e.$slots, "readModeSeparator"), (l, f) => ({
229
- name: f,
230
- fn: q((p) => [G(e.$slots, f, J(Q(p || {})))])
231
- }))]), 1040, ["value", "picker", "format"]));
223
+ }, [B(P(e.emptyText), 1)], 64))], 64)) : (d(), C(t(de), {
224
+ key: 1,
225
+ compact: "",
226
+ style: q({
227
+ display: Array.isArray(o.timezone) && o.timezone.length ? "flex" : "block"
228
+ })
229
+ }, {
230
+ default: D(() => [Array.isArray(o.timezone) && o.timezone.length ? (d(), C(t(ie), {
231
+ key: 0,
232
+ value: t(u),
233
+ "onUpdate:value": a[0] || (a[0] = (n) => J(u) ? u.value = n : null),
234
+ "default-active-first-option": "",
235
+ "dropdown-match-select-width": !1
236
+ }, {
237
+ default: D(() => [(d(!0), k(v, null, R(o.timezone, (n) => (d(), C(t(se), {
238
+ key: n == null ? void 0 : n.value,
239
+ value: n == null ? void 0 : n.value
240
+ }, {
241
+ default: D(() => [B(P((n == null ? void 0 : n.label) ?? (n == null ? void 0 : n.value)), 1)]),
242
+ _: 2
243
+ }, 1032, ["value"]))), 128))]),
244
+ _: 1
245
+ }, 8, ["value"])) : Q("", !0), M(t(fe).RangePicker, X(j.value, {
246
+ value: S.value,
247
+ picker: U.value,
248
+ format: f.value,
249
+ "onUpdate:value": H,
250
+ onChange: $,
251
+ onOk: K
252
+ }), z({
253
+ _: 2
254
+ }, [R(t(_)(e.$slots, "readModeSeparator"), (n, m) => ({
255
+ name: m,
256
+ fn: D((c) => [ee(e.$slots, m, oe(ne(c || {})))])
257
+ }))]), 1040, ["value", "picker", "format"])]),
258
+ _: 3
259
+ }, 8, ["style"]));
232
260
  };
233
261
  }
234
262
  });
235
263
  export {
236
- De as default
264
+ Fe as default
237
265
  };
@@ -0,0 +1,7 @@
1
+ import { ApFieldDateRangeProps, BasicApFieldProps } from '../interface';
2
+ import { Ref } from 'vue';
3
+ export declare const useDateTimezone: (props: BasicApFieldProps<{
4
+ timezone?: ApFieldDateRangeProps["timezone"];
5
+ }>) => {
6
+ currentTimezone: Ref<"RJ" | "PR" | "VD" | "CP" | "BS" | "MS" | "SP" | "DB" | "NY" | "KR" | "CG" | "TM" | "DV" | "SU" | "LA" | "SH" | "ALS" | undefined, "RJ" | "PR" | "VD" | "CP" | "BS" | "MS" | "SP" | "DB" | "NY" | "KR" | "CG" | "TM" | "DV" | "SU" | "LA" | "SH" | "ALS" | undefined>;
7
+ };
@@ -0,0 +1,10 @@
1
+ import { ref as n } from "vue";
2
+ const t = (r) => {
3
+ var e;
4
+ return Array.isArray(r) ? (e = r[0]) == null ? void 0 : e.value : r;
5
+ }, i = (r) => ({
6
+ currentTimezone: n(t(r.timezone))
7
+ });
8
+ export {
9
+ i as useDateTimezone
10
+ };
@@ -1,10 +1,11 @@
1
+ import { Ref, ComputedRef } from 'vue';
1
2
  import { ApFieldDateRangeProps, BasicApFieldProps } from '../interface';
2
3
  import { Dayjs } from 'dayjs';
3
- import { ComputedRef } from 'vue';
4
+ import { ZoneAlias } from '@aplus-frontend/utils';
4
5
  import { VueNode } from '@aplus-frontend/antdv/es/_util/type';
5
6
  export declare const useDefaultPresets: (props: BasicApFieldProps<{
6
7
  presets?: ApFieldDateRangeProps["presets"];
7
- timezone?: ApFieldDateRangeProps["timezone"];
8
+ timezone?: Ref<ZoneAlias | undefined>;
8
9
  }>) => ComputedRef<{
9
10
  label: VueNode;
10
11
  value: Dayjs[];