@aplus-frontend/ui 0.4.10 → 0.4.12

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 (106) 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 +107 -71
  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 +10 -6
  7. package/es/src/ap-field/hooks/use-default-presets.mjs +24 -13
  8. package/es/src/ap-field/interface.d.ts +8 -2
  9. package/es/src/business/ap-ladder/ApLadder.vue.d.ts +8 -2
  10. package/es/src/business/ap-ladder/ApLadder.vue2.mjs +95 -90
  11. package/es/src/business/ap-ladder/index.d.ts +4 -1
  12. package/es/src/business/ap-ladder/useWatchEllipsis.d.ts +3 -0
  13. package/es/src/business/ap-ladder/useWatchEllipsis.mjs +35 -0
  14. package/es/src/config-provider/hooks/use-locale.mjs +7 -7
  15. package/es/src/full-screen/index.d.ts +3 -0
  16. package/es/src/full-screen/index.mjs +2 -0
  17. package/es/src/full-screen/index.vue.d.ts +43 -0
  18. package/es/src/full-screen/index.vue.mjs +85 -0
  19. package/es/src/full-screen/index.vue2.mjs +4 -0
  20. package/es/src/full-screen/interface.d.ts +50 -0
  21. package/es/src/full-screen/interface.mjs +1 -0
  22. package/es/src/full-screen/style/css.d.ts +0 -0
  23. package/es/src/full-screen/style/css.js +1 -0
  24. package/es/src/full-screen/style/index.d.ts +0 -0
  25. package/es/src/full-screen/style/index.js +1 -0
  26. package/es/src/hooks/index.d.ts +1 -0
  27. package/es/src/hooks/index.mjs +6 -4
  28. package/es/src/hooks/useFullScreen.d.ts +8 -0
  29. package/es/src/hooks/useFullScreen.mjs +51 -0
  30. package/es/src/index.d.ts +2 -0
  31. package/es/src/index.mjs +243 -237
  32. package/es/src/path-map.mjs +3 -1
  33. package/es/src/portal/index.d.ts +3 -0
  34. package/es/src/portal/index.mjs +2 -0
  35. package/es/src/portal/index.vue.d.ts +18 -0
  36. package/es/src/portal/index.vue.mjs +21 -0
  37. package/es/src/portal/index.vue2.mjs +4 -0
  38. package/es/src/portal/interface.d.ts +2 -0
  39. package/es/src/portal/interface.mjs +1 -0
  40. package/es/src/portal/style/css.d.ts +1 -0
  41. package/es/src/portal/style/css.js +1 -0
  42. package/es/src/portal/style/index.d.ts +1 -0
  43. package/es/src/portal/style/index.js +1 -0
  44. package/es/src/utils/data-range-persets.d.ts +23 -40
  45. package/es/src/utils/data-range-persets.mjs +95 -102
  46. package/lib/index.js +1 -1
  47. package/lib/src/ap-field/date/index.vue.js +1 -1
  48. package/lib/src/ap-field/date-range/index.vue.js +1 -1
  49. package/lib/src/ap-field/hooks/use-date-timezone.d.ts +7 -0
  50. package/lib/src/ap-field/hooks/use-date-timezone.js +1 -0
  51. package/lib/src/ap-field/hooks/use-default-presets.d.ts +10 -6
  52. package/lib/src/ap-field/hooks/use-default-presets.js +1 -1
  53. package/lib/src/ap-field/interface.d.ts +8 -2
  54. package/lib/src/business/ap-ladder/ApLadder.vue.d.ts +8 -2
  55. package/lib/src/business/ap-ladder/ApLadder.vue2.js +1 -1
  56. package/lib/src/business/ap-ladder/index.d.ts +4 -1
  57. package/lib/src/business/ap-ladder/useWatchEllipsis.d.ts +3 -0
  58. package/lib/src/business/ap-ladder/useWatchEllipsis.js +1 -0
  59. package/lib/src/config-provider/hooks/use-locale.js +1 -1
  60. package/lib/src/full-screen/index.d.ts +3 -0
  61. package/lib/src/full-screen/index.js +1 -0
  62. package/lib/src/full-screen/index.vue.d.ts +43 -0
  63. package/lib/src/full-screen/index.vue.js +1 -0
  64. package/lib/src/full-screen/index.vue2.js +1 -0
  65. package/lib/src/full-screen/interface.d.ts +50 -0
  66. package/lib/src/full-screen/interface.js +1 -0
  67. package/lib/src/full-screen/style/css.cjs +1 -0
  68. package/lib/src/full-screen/style/css.d.ts +0 -0
  69. package/lib/src/full-screen/style/index.cjs +1 -0
  70. package/lib/src/full-screen/style/index.d.ts +0 -0
  71. package/lib/src/hooks/index.d.ts +1 -0
  72. package/lib/src/hooks/index.js +1 -1
  73. package/lib/src/hooks/useFullScreen.d.ts +8 -0
  74. package/lib/src/hooks/useFullScreen.js +1 -0
  75. package/lib/src/index.d.ts +2 -0
  76. package/lib/src/index.js +1 -1
  77. package/lib/src/path-map.js +1 -1
  78. package/lib/src/portal/index.d.ts +3 -0
  79. package/lib/src/portal/index.js +1 -0
  80. package/lib/src/portal/index.vue.d.ts +18 -0
  81. package/lib/src/portal/index.vue.js +1 -0
  82. package/lib/src/portal/index.vue2.js +1 -0
  83. package/lib/src/portal/interface.d.ts +2 -0
  84. package/lib/src/portal/interface.js +1 -0
  85. package/lib/src/portal/style/css.cjs +1 -0
  86. package/lib/src/portal/style/css.d.ts +1 -0
  87. package/lib/src/portal/style/index.cjs +1 -0
  88. package/lib/src/portal/style/index.d.ts +1 -0
  89. package/lib/src/utils/data-range-persets.d.ts +23 -40
  90. package/lib/src/utils/data-range-persets.js +1 -1
  91. package/package.json +3 -3
  92. package/theme/ap-form/ap-form-item.css +5 -1
  93. package/theme/ap-form/ap-form-item.less +8 -1
  94. package/theme/ap-form/index.css +22 -1
  95. package/theme/ap-form/item-text-group.css +14 -0
  96. package/theme/ap-form/item-text-group.less +11 -1
  97. package/theme/ap-form/item-text.css +14 -0
  98. package/theme/ap-form/search-form.css +8 -1
  99. package/theme/ap-form/search-form.less +5 -0
  100. package/theme/ap-table/ap-table.css +22 -1
  101. package/theme/ap-table-modal/index.css +22 -1
  102. package/theme/editable-table/index.css +22 -1
  103. package/theme/full-screen/index.css +6 -0
  104. package/theme/full-screen/index.less +12 -0
  105. package/theme/index.css +28 -1
  106. 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 Y, useSlots as Z, computed as y, unref as t, isVNode as q, createVNode as T, Fragment as v, openBlock as d, createElementBlock as k, createTextVNode as C, toDisplayString as B, createBlock as P, resolveDynamicComponent as J, normalizeStyle as Q, withCtx as D, isRef as X, renderList as R, createCommentVNode as z, mergeProps as ee, createSlots as ne, renderSlot as oe, normalizeProps as te, guardReactiveProps as ae } from "vue";
2
+ import { ApFieldDatePresetFormats as re, PRESET_FORMAT_MAP as le, PRESET_FORMAT_PICK_MAP as ue, PRESET_FORMAT_TIME_MAP as de } 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 ie } from "lodash-unified";
5
+ import i from "dayjs";
6
+ import { InputGroup as se, Select as fe, SelectOption as pe, DatePicker as me } from "@aplus-frontend/antdv";
7
+ import { formatDayWithTimezone as ce } from "../date/helper.mjs";
8
+ import { SwapRightOutlined as ye } from "@ant-design/icons-vue";
9
+ import { omitUndefined as ve } from "../../utils/index.mjs";
10
+ import { getTimeFormatToZone as F } from "@aplus-frontend/utils";
11
+ import { useDefaultPlaceholder as he } from "../hooks/use-default-placeholder.mjs";
12
+ import { useDefaultPresets as ge } from "../hooks/use-default-presets.mjs";
13
+ import { useDateTimezone as Se } from "../hooks/use-date-timezone.mjs";
14
+ import { useControllableValue as ke } from "../../hooks/useControllableValue.mjs";
15
+ const xe = /* @__PURE__ */ Y({
15
16
  __name: "index",
16
17
  props: {
17
18
  mode: {
@@ -153,85 +154,120 @@ 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 n = N, E = x, O = Z(), s = y(() => re.indexOf(n.format) > -1), f = y(() => s.value ? le[n.format] : n.format), {
161
+ value: g,
162
+ updateValue: M
163
+ } = ke(n, E), V = he("DateRange", n), {
164
+ currentTimezone: u
165
+ } = Se(n), {
166
+ presets: I,
167
+ changeCurrentDate: U
168
+ } = ge({
169
+ ...n,
170
+ timezone: u
171
+ }), p = (e, a, r = !0) => ce(u.value)(e, a, r), S = y(() => {
172
+ var l, o;
173
+ const e = t(g);
174
+ if (w(e) || !(e != null && e.length))
166
175
  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] : {};
176
+ const a = u.value ? F(t(g)[0], u.value) : (l = t(g)) == null ? void 0 : l[0], r = n.timezone ? F(t(g)[1], u.value) : (o = t(g)) == null ? void 0 : o[1];
177
+ return [i(a), i(r)];
178
+ }), j = y(() => t(s) ? n.picker ?? ue[n.format] : n.picker), H = y(() => {
179
+ const e = t(s) ? de[n.format] : {};
171
180
  return {
172
- ...ue(R(o, ["value", "onUpdate:value", "onChange", "onOk", "format", "mode", "presets"])),
173
- placeholder: n(N),
174
- presets: n(x),
181
+ ...ve(_(n, ["value", "onUpdate:value", "onChange", "onOk", "format", "mode", "presets"])),
182
+ placeholder: t(V),
183
+ presets: t(I),
175
184
  ...e
176
185
  };
177
186
  });
178
- function V(e) {
187
+ function K(e) {
179
188
  if (!e) {
180
- C(e);
189
+ M(e);
181
190
  return;
182
191
  }
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)]);
192
+ let a = h(e[0]) ? i(e[0]) : e[0], r = h(e[1]) ? i(e[1]) : e[1];
193
+ const l = t(s) ? t(f) : void 0;
194
+ M([p(a, l), p(r, l, !1)]);
186
195
  }
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]);
196
+ function $(e) {
197
+ var c;
198
+ 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, o = e[0] ? p(a, l) : null, m = e[1] ? p(r, l, !1) : null;
199
+ (c = n.onOk) == null || c.call(n, [o, m]);
191
200
  }
192
- function j(e, r) {
193
- var D, M;
194
- if (b(e)) {
195
- (D = o.onChange) == null || D.call(o, e, r);
201
+ function G(e) {
202
+ var a;
203
+ e && U(), (a = n.onOpenChange) == null || a.call(n, e);
204
+ }
205
+ function L(e, a) {
206
+ var b, A;
207
+ if (w(e)) {
208
+ (b = n.onChange) == null || b.call(n, e, a);
196
209
  return;
197
210
  }
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);
211
+ const r = h(e[0]) ? i(e[0]) : e[0], l = h(e[1]) ? i(e[1]) : e[1], o = t(s) ? t(f) : void 0, m = e[0] ? p(r, o) : null, c = e[1] ? p(l, o, !1) : null;
212
+ (A = n.onChange) == null || A.call(n, [m, c], a);
200
213
  }
201
- const U = m(() => {
202
- var t;
203
- const e = o.readModeSeparator;
214
+ const W = y(() => {
215
+ var r;
216
+ const e = n.readModeSeparator;
204
217
  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;
218
+ return q(e) || ie(e) ? n.readModeSeparator : T(v, null, [n.readModeSeparator]);
219
+ const a = (r = O.readModeSeparator) == null ? void 0 : r.call(O);
220
+ return a ? T(v, null, [a]) : ye;
208
221
  });
209
- return (e, r) => {
210
- var t, a;
211
- return e.mode === "read" ? (g(), v(h, {
222
+ return (e, a) => {
223
+ var r, l;
224
+ return e.mode === "read" ? (d(), k(v, {
212
225
  key: 0
213
- }, [S.value ? (g(), v(h, {
226
+ }, [S.value ? (d(), k(v, {
214
227
  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, {
216
- key: 1
217
- }, [B(P(e.emptyText), 1)], 64))], 64)) : (g(), O(n(ae).RangePicker, W({
228
+ }, [C(B((r = S.value[0]) == null ? void 0 : r.format(f.value)) + " ", 1), (d(), P(J(W.value))), C(" " + B((l = S.value[1]) == null ? void 0 : l.format(f.value)), 1)], 64)) : (d(), k(v, {
218
229
  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"]));
230
+ }, [C(B(e.emptyText), 1)], 64))], 64)) : (d(), P(t(se), {
231
+ key: 1,
232
+ compact: "",
233
+ style: Q({
234
+ display: Array.isArray(n.timezone) && n.timezone.length ? "flex" : "block"
235
+ })
236
+ }, {
237
+ default: D(() => [Array.isArray(n.timezone) && n.timezone.length ? (d(), P(t(fe), {
238
+ key: 0,
239
+ value: t(u),
240
+ "onUpdate:value": a[0] || (a[0] = (o) => X(u) ? u.value = o : null),
241
+ "default-active-first-option": "",
242
+ "dropdown-match-select-width": !1
243
+ }, {
244
+ default: D(() => [(d(!0), k(v, null, R(n.timezone, (o) => (d(), P(t(pe), {
245
+ key: o == null ? void 0 : o.value,
246
+ value: o == null ? void 0 : o.value
247
+ }, {
248
+ default: D(() => [C(B((o == null ? void 0 : o.label) ?? (o == null ? void 0 : o.value)), 1)]),
249
+ _: 2
250
+ }, 1032, ["value"]))), 128))]),
251
+ _: 1
252
+ }, 8, ["value"])) : z("", !0), T(t(me).RangePicker, ee(H.value, {
253
+ value: S.value,
254
+ picker: j.value,
255
+ format: f.value,
256
+ "onUpdate:value": K,
257
+ onChange: L,
258
+ onOk: $,
259
+ onOpenChange: G
260
+ }), ne({
261
+ _: 2
262
+ }, [R(t(_)(e.$slots, "readModeSeparator"), (o, m) => ({
263
+ name: m,
264
+ fn: D((c) => [oe(e.$slots, m, te(ae(c || {})))])
265
+ }))]), 1040, ["value", "picker", "format"])]),
266
+ _: 3
267
+ }, 8, ["style"]));
232
268
  };
233
269
  }
234
270
  });
235
271
  export {
236
- De as default
272
+ xe as default
237
273
  };
@@ -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
+ };