@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.
- package/es/index.mjs +42 -36
- package/es/src/ap-field/date/index.vue.mjs +98 -65
- package/es/src/ap-field/date-range/index.vue.mjs +98 -70
- package/es/src/ap-field/hooks/use-date-timezone.d.ts +7 -0
- package/es/src/ap-field/hooks/use-date-timezone.mjs +10 -0
- package/es/src/ap-field/hooks/use-default-presets.d.ts +3 -2
- package/es/src/ap-field/hooks/use-default-presets.mjs +8 -8
- package/es/src/ap-field/interface.d.ts +8 -2
- package/es/src/business/ap-ladder/ApLadder.vue.d.ts +6 -2
- package/es/src/business/ap-ladder/ApLadder.vue2.mjs +118 -95
- package/es/src/business/ap-ladder/index.d.ts +3 -1
- package/es/src/full-screen/index.d.ts +3 -0
- package/es/src/full-screen/index.mjs +2 -0
- package/es/src/full-screen/index.vue.d.ts +43 -0
- package/es/src/full-screen/index.vue.mjs +84 -0
- package/es/src/full-screen/index.vue2.mjs +4 -0
- package/es/src/full-screen/interface.d.ts +50 -0
- package/es/src/full-screen/interface.mjs +1 -0
- package/es/src/full-screen/style/css.d.ts +0 -0
- package/es/src/full-screen/style/css.js +1 -0
- package/es/src/full-screen/style/index.d.ts +0 -0
- package/es/src/full-screen/style/index.js +1 -0
- package/es/src/hooks/index.d.ts +1 -0
- package/es/src/hooks/index.mjs +6 -4
- package/es/src/hooks/useFullScreen.d.ts +8 -0
- package/es/src/hooks/useFullScreen.mjs +50 -0
- package/es/src/index.d.ts +2 -0
- package/es/src/index.mjs +243 -237
- package/es/src/path-map.mjs +3 -1
- package/es/src/portal/index.d.ts +3 -0
- package/es/src/portal/index.mjs +2 -0
- package/es/src/portal/index.vue.d.ts +18 -0
- package/es/src/portal/index.vue.mjs +21 -0
- package/es/src/portal/index.vue2.mjs +4 -0
- package/es/src/portal/interface.d.ts +2 -0
- package/es/src/portal/interface.mjs +1 -0
- package/es/src/portal/style/css.d.ts +1 -0
- package/es/src/portal/style/css.js +1 -0
- package/es/src/portal/style/index.d.ts +1 -0
- package/es/src/portal/style/index.js +1 -0
- package/lib/index.js +1 -1
- package/lib/src/ap-field/date/index.vue.js +1 -1
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-field/hooks/use-date-timezone.d.ts +7 -0
- package/lib/src/ap-field/hooks/use-date-timezone.js +1 -0
- package/lib/src/ap-field/hooks/use-default-presets.d.ts +3 -2
- package/lib/src/ap-field/hooks/use-default-presets.js +1 -1
- package/lib/src/ap-field/interface.d.ts +8 -2
- package/lib/src/business/ap-ladder/ApLadder.vue.d.ts +6 -2
- package/lib/src/business/ap-ladder/ApLadder.vue2.js +1 -1
- package/lib/src/business/ap-ladder/index.d.ts +3 -1
- package/lib/src/full-screen/index.d.ts +3 -0
- package/lib/src/full-screen/index.js +1 -0
- package/lib/src/full-screen/index.vue.d.ts +43 -0
- package/lib/src/full-screen/index.vue.js +1 -0
- package/lib/src/full-screen/index.vue2.js +1 -0
- package/lib/src/full-screen/interface.d.ts +50 -0
- package/lib/src/full-screen/interface.js +1 -0
- package/lib/src/full-screen/style/css.cjs +1 -0
- package/lib/src/full-screen/style/css.d.ts +0 -0
- package/lib/src/full-screen/style/index.cjs +1 -0
- package/lib/src/full-screen/style/index.d.ts +0 -0
- package/lib/src/hooks/index.d.ts +1 -0
- package/lib/src/hooks/index.js +1 -1
- package/lib/src/hooks/useFullScreen.d.ts +8 -0
- package/lib/src/hooks/useFullScreen.js +1 -0
- package/lib/src/index.d.ts +2 -0
- package/lib/src/index.js +1 -1
- package/lib/src/path-map.js +1 -1
- package/lib/src/portal/index.d.ts +3 -0
- package/lib/src/portal/index.js +1 -0
- package/lib/src/portal/index.vue.d.ts +18 -0
- package/lib/src/portal/index.vue.js +1 -0
- package/lib/src/portal/index.vue2.js +1 -0
- package/lib/src/portal/interface.d.ts +2 -0
- package/lib/src/portal/interface.js +1 -0
- package/lib/src/portal/style/css.cjs +1 -0
- package/lib/src/portal/style/css.d.ts +1 -0
- package/lib/src/portal/style/index.cjs +1 -0
- package/lib/src/portal/style/index.d.ts +1 -0
- package/package.json +3 -3
- package/theme/ap-form/ap-form-item.css +4 -0
- package/theme/ap-form/ap-form-item.less +7 -0
- package/theme/ap-form/index.css +18 -0
- package/theme/ap-form/item-text-group.css +14 -0
- package/theme/ap-form/item-text-group.less +11 -1
- package/theme/ap-form/item-text.css +14 -0
- package/theme/ap-form/search-form.css +4 -0
- package/theme/ap-table/ap-table.css +18 -0
- package/theme/ap-table-modal/index.css +18 -0
- package/theme/editable-table/index.css +18 -0
- package/theme/full-screen/index.css +6 -0
- package/theme/full-screen/index.less +12 -0
- package/theme/index.css +24 -0
- 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
|
|
8
|
-
import { defaultNamespace as G, namespaceContextKey as
|
|
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
|
|
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
|
|
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
|
|
57
|
-
import { default as
|
|
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
|
|
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
|
|
84
|
-
import { ApImage as
|
|
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
|
|
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
|
|
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
|
|
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 {
|
|
113
|
-
import {
|
|
114
|
-
import {
|
|
115
|
-
import {
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
188
|
+
Dr as ApImage,
|
|
186
189
|
ho as ApInfoLayout,
|
|
187
190
|
hr as ApInputRadio,
|
|
188
|
-
|
|
189
|
-
|
|
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
|
-
|
|
203
|
-
|
|
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
|
-
|
|
218
|
-
|
|
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
|
-
|
|
230
|
+
S as buildTranslator,
|
|
226
231
|
Hr as computedRecords,
|
|
227
232
|
n as configProviderContextKey,
|
|
228
233
|
d as configProviderProps,
|
|
229
|
-
|
|
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
|
-
|
|
246
|
+
C as localeContextKey,
|
|
242
247
|
Lr as locales,
|
|
243
|
-
|
|
248
|
+
P as namespaceContextKey,
|
|
244
249
|
l as pathMap,
|
|
245
250
|
F as provideGlobalConfig,
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
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
|
-
|
|
252
|
-
|
|
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
|
-
|
|
265
|
+
Wt as useThrottleRef
|
|
260
266
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { DatePicker as
|
|
4
|
-
import { ApFieldDatePresetFormats as
|
|
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
|
|
7
|
-
import { formatDayWithTimezone as
|
|
8
|
-
import { getTimeFormatToZone as
|
|
9
|
-
import { useDefaultPlaceholder as
|
|
10
|
-
import {
|
|
11
|
-
|
|
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(
|
|
91
|
-
const e =
|
|
91
|
+
setup(O, { emit: b }) {
|
|
92
|
+
const e = O, w = b, { value: c, updateValue: B } = ae(
|
|
92
93
|
e,
|
|
93
|
-
|
|
94
|
-
),
|
|
95
|
-
() =>
|
|
96
|
-
),
|
|
97
|
-
() =>
|
|
98
|
-
),
|
|
99
|
-
if (
|
|
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
|
|
102
|
-
return e.timezone && (
|
|
103
|
-
}),
|
|
104
|
-
const
|
|
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
|
-
|
|
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:
|
|
116
|
-
...
|
|
116
|
+
placeholder: a(A),
|
|
117
|
+
...t
|
|
117
118
|
};
|
|
118
|
-
}),
|
|
119
|
-
function
|
|
120
|
-
if (
|
|
121
|
-
|
|
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
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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
|
|
134
|
-
var
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
|
|
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
|
-
(
|
|
141
|
+
(p = e.onChange) == null || p.call(e, l, n);
|
|
141
142
|
}
|
|
142
|
-
function
|
|
143
|
-
var
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
|
|
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
|
-
(
|
|
150
|
+
(l = e.onOk) == null || l.call(e, o);
|
|
150
151
|
}
|
|
151
|
-
return (
|
|
152
|
-
|
|
153
|
-
], 64)) : (
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
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
|
-
|
|
204
|
+
ve as default
|
|
172
205
|
};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ApFieldDatePresetFormats as
|
|
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
|
|
5
|
-
import
|
|
6
|
-
import { DatePicker as
|
|
7
|
-
import { formatDayWithTimezone as
|
|
8
|
-
import { SwapRightOutlined as
|
|
9
|
-
import { omitUndefined as
|
|
10
|
-
import { getTimeFormatToZone as
|
|
11
|
-
import { useDefaultPlaceholder as
|
|
12
|
-
import { useDefaultPresets as
|
|
13
|
-
import {
|
|
14
|
-
|
|
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:
|
|
157
|
+
setup(N, {
|
|
158
|
+
emit: x
|
|
158
159
|
}) {
|
|
159
|
-
const o =
|
|
160
|
-
value:
|
|
161
|
-
updateValue:
|
|
162
|
-
} =
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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
|
|
168
|
-
return [
|
|
169
|
-
}),
|
|
170
|
-
const e =
|
|
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
|
-
...
|
|
173
|
-
placeholder:
|
|
174
|
-
presets:
|
|
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
|
|
184
|
+
function H(e) {
|
|
179
185
|
if (!e) {
|
|
180
|
-
|
|
186
|
+
O(e);
|
|
181
187
|
return;
|
|
182
188
|
}
|
|
183
|
-
let
|
|
184
|
-
const
|
|
185
|
-
|
|
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
|
|
188
|
-
var
|
|
189
|
-
const
|
|
190
|
-
(
|
|
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
|
|
193
|
-
var
|
|
194
|
-
if (
|
|
195
|
-
(
|
|
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
|
|
199
|
-
(
|
|
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
|
|
202
|
-
var
|
|
207
|
+
const G = y(() => {
|
|
208
|
+
var r;
|
|
203
209
|
const e = o.readModeSeparator;
|
|
204
210
|
if (e)
|
|
205
|
-
return
|
|
206
|
-
const
|
|
207
|
-
return
|
|
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,
|
|
210
|
-
var
|
|
211
|
-
return e.mode === "read" ? (
|
|
215
|
+
return (e, a) => {
|
|
216
|
+
var r, l;
|
|
217
|
+
return e.mode === "read" ? (d(), k(v, {
|
|
212
218
|
key: 0
|
|
213
|
-
}, [S.value ? (
|
|
219
|
+
}, [S.value ? (d(), k(v, {
|
|
214
220
|
key: 0
|
|
215
|
-
}, [B(P((
|
|
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)) : (
|
|
218
|
-
key: 1
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
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
|
-
|
|
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
|
+
};
|
|
@@ -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 {
|
|
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?:
|
|
8
|
+
timezone?: Ref<ZoneAlias | undefined>;
|
|
8
9
|
}>) => ComputedRef<{
|
|
9
10
|
label: VueNode;
|
|
10
11
|
value: Dayjs[];
|