@aplus-frontend/ui 0.0.16 → 0.0.18
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 +51 -46
- package/es/src/ap-field/date/helper.d.ts +7 -0
- package/es/src/ap-field/date/helper.mjs +17 -7
- package/es/src/ap-field/date/index.vue.mjs +46 -39
- package/es/src/ap-field/date-range/index.vue.mjs +63 -61
- package/es/src/ap-field/interface.d.ts +9 -0
- package/es/src/ap-table/ap-table.vue.mjs +92 -95
- package/es/src/ap-table/constants.d.ts +24 -0
- package/es/src/ap-table/interface.d.ts +18 -4
- package/es/src/ap-table/style/ap-table.css +6 -0
- package/es/src/ap-table/utils.d.ts +6831 -845
- package/es/src/business/ap-label/ApLabel.vue.d.ts +38 -0
- package/es/src/business/ap-label/ApLabel.vue.mjs +4 -0
- package/es/src/business/ap-label/ApLabel.vue2.mjs +52 -0
- package/es/src/business/ap-label/index.d.ts +4 -0
- package/es/src/business/ap-label/interface.d.ts +8 -0
- package/es/src/business/ap-label/style.css +4 -0
- package/es/src/business/index.d.ts +256 -1
- package/es/src/business/index.mjs +7 -4
- package/es/src/check-card/checked.svg.mjs +4 -0
- package/es/src/check-card/context.d.ts +6 -0
- package/es/src/check-card/context.mjs +16 -0
- package/es/src/check-card/group.vue.d.ts +57 -0
- package/es/src/check-card/group.vue.mjs +57 -0
- package/es/src/check-card/group.vue2.mjs +4 -0
- package/es/src/check-card/index.d.ts +9 -0
- package/es/src/check-card/index.mjs +11 -0
- package/es/src/check-card/index.vue.d.ts +54 -0
- package/es/src/check-card/index.vue.mjs +4 -0
- package/es/src/check-card/index.vue2.mjs +133 -0
- package/es/src/check-card/interface.d.ts +100 -0
- package/es/src/check-card/interface.mjs +1 -0
- package/es/src/check-card/style/index.css +108 -0
- package/es/src/editable-table/interface.d.ts +1 -1
- package/es/src/hooks/useControllableValue.mjs +15 -13
- package/es/src/index.d.ts +1 -0
- package/es/src/index.mjs +197 -192
- package/es/src/theme/ap-label/ap-label.css +4 -0
- package/es/src/theme/ap-table/ap-table.css +6 -0
- package/es/src/theme/check-card/index.css +108 -0
- package/lib/index.js +1 -1
- package/lib/src/ap-field/date/helper.d.ts +7 -0
- package/lib/src/ap-field/date/helper.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/interface.d.ts +9 -0
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/constants.d.ts +24 -0
- package/lib/src/ap-table/interface.d.ts +18 -4
- package/lib/src/ap-table/style/ap-table.css +6 -0
- package/lib/src/ap-table/utils.d.ts +6831 -845
- package/lib/src/business/ap-label/ApLabel.vue.d.ts +38 -0
- package/lib/src/business/ap-label/ApLabel.vue.js +1 -0
- package/lib/src/business/ap-label/ApLabel.vue2.js +1 -0
- package/lib/src/business/ap-label/index.d.ts +4 -0
- package/lib/src/business/ap-label/interface.d.ts +8 -0
- package/lib/src/business/ap-label/style.css +4 -0
- package/lib/src/business/index.d.ts +256 -1
- package/lib/src/business/index.js +1 -1
- package/lib/src/check-card/checked.svg.js +1 -0
- package/lib/src/check-card/context.d.ts +6 -0
- package/lib/src/check-card/context.js +1 -0
- package/lib/src/check-card/group.vue.d.ts +57 -0
- package/lib/src/check-card/group.vue.js +1 -0
- package/lib/src/check-card/group.vue2.js +1 -0
- package/lib/src/check-card/index.d.ts +9 -0
- package/lib/src/check-card/index.js +1 -0
- package/lib/src/check-card/index.vue.d.ts +54 -0
- package/lib/src/check-card/index.vue.js +1 -0
- package/lib/src/check-card/index.vue2.js +1 -0
- package/lib/src/check-card/interface.d.ts +100 -0
- package/lib/src/check-card/interface.js +1 -0
- package/lib/src/check-card/style/index.css +108 -0
- package/lib/src/editable-table/interface.d.ts +1 -1
- package/lib/src/hooks/useControllableValue.js +1 -1
- package/lib/src/index.d.ts +1 -0
- package/lib/src/index.js +1 -1
- package/lib/src/theme/ap-label/ap-label.css +4 -0
- package/lib/src/theme/ap-table/ap-table.css +6 -0
- package/lib/src/theme/check-card/index.css +108 -0
- package/package.json +2 -2
package/es/index.mjs
CHANGED
|
@@ -5,11 +5,11 @@ import { configProviderProps as x } from "./src/config-provider/config-provider-
|
|
|
5
5
|
import { configProviderContextKey as n, tableDefaultConfig as u } from "./src/config-provider/constants.mjs";
|
|
6
6
|
import { keysOf as c, provideGlobalConfig as F, useGlobalConfig as T } from "./src/config-provider/hooks/use-global-config.mjs";
|
|
7
7
|
import { buildLocaleContext as S, buildTranslator as I, localeContextKey as b, translate as g, useLocale as P } from "./src/config-provider/hooks/use-locale.mjs";
|
|
8
|
-
import { defaultNamespace as R, namespaceContextKey as
|
|
9
|
-
import { ConfigProvider as
|
|
8
|
+
import { defaultNamespace as R, namespaceContextKey as h, useGetDerivedNamespace as v, useNamespace as M } from "./src/config-provider/hooks/use-namespace.mjs";
|
|
9
|
+
import { ConfigProvider as w } from "./src/config-provider/config-provider.mjs";
|
|
10
10
|
import { APConfigProvider as G } from "./src/config-provider/index.mjs";
|
|
11
11
|
import { Scrollbar as y } from "./src/scroll-bar/index.mjs";
|
|
12
|
-
import { CollapseContainer as
|
|
12
|
+
import { CollapseContainer as E, ScrollContainer as X } from "./src/container/index.mjs";
|
|
13
13
|
import { IconPicker as Y } from "./src/icon-picker/index.mjs";
|
|
14
14
|
import { default as H } from "./src/locale/lang/zh-cn.mjs";
|
|
15
15
|
import { default as z } from "./src/locale/lang/en.mjs";
|
|
@@ -23,12 +23,12 @@ import { useForm as Te } from "./src/pro-form/hooks/use-form.mjs";
|
|
|
23
23
|
import { isComponentFormSchema as Se, isSlotFormSchema as Ie } from "./src/pro-form/types/form.mjs";
|
|
24
24
|
import { Field as ge } from "./src/pro-form/index.mjs";
|
|
25
25
|
import { default as De } from "./src/pro-form/components/api-cascader.vue.mjs";
|
|
26
|
-
import { default as
|
|
27
|
-
import { default as
|
|
28
|
-
import { default as
|
|
26
|
+
import { default as he } from "./src/pro-form/components/api-radio-group.vue.mjs";
|
|
27
|
+
import { default as Me } from "./src/pro-form/components/api-select.vue.mjs";
|
|
28
|
+
import { default as we } from "./src/pro-form/components/api-transfer.vue.mjs";
|
|
29
29
|
import { default as Ge } from "./src/pro-form/components/api-tree.vue.mjs";
|
|
30
30
|
import { default as ye } from "./src/pro-form/components/radio-button-group.vue.mjs";
|
|
31
|
-
import { default as
|
|
31
|
+
import { default as Ee } from "./src/pro-form/pro-form.vue.mjs";
|
|
32
32
|
import { default as Ke } from "./src/pro-form/components/api-tree-select.vue.mjs";
|
|
33
33
|
import { default as Oe } from "./src/pro-form/table-form.vue.mjs";
|
|
34
34
|
import { default as We } from "./src/pro-form/table-form-inner.vue.mjs";
|
|
@@ -48,12 +48,12 @@ import { default as Co } from "./src/pro-table/components/table-action.vue.mjs";
|
|
|
48
48
|
import { default as Io } from "./src/pro-table/components/edit-table-header-icon.vue.mjs";
|
|
49
49
|
import { default as go } from "./src/pro-table/components/table-image.vue.mjs";
|
|
50
50
|
import { useTable as Do } from "./src/pro-table/hooks/use-table.mjs";
|
|
51
|
-
import { ApFormItemText as
|
|
52
|
-
import { default as
|
|
53
|
-
import { default as
|
|
51
|
+
import { ApFormItemText as ho } from "./src/ap-form/items/text/index.mjs";
|
|
52
|
+
import { default as Mo } from "./src/ap-form/items/text-area/index.vue.mjs";
|
|
53
|
+
import { default as wo } from "./src/ap-form/items/number/index.vue.mjs";
|
|
54
54
|
import { default as Go } from "./src/ap-form/items/date/index.vue.mjs";
|
|
55
55
|
import { default as yo } from "./src/ap-form/items/date-range/index.vue.mjs";
|
|
56
|
-
import { default as
|
|
56
|
+
import { default as Eo } from "./src/ap-form/items/radio/index.vue.mjs";
|
|
57
57
|
import { default as Ko } from "./src/ap-form/items/select/index.vue.mjs";
|
|
58
58
|
import { default as Oo } from "./src/ap-form/items/switch/index.vue.mjs";
|
|
59
59
|
import { default as Wo } from "./src/ap-form/items/checkbox/index.vue.mjs";
|
|
@@ -75,11 +75,11 @@ import { default as Cr } from "./src/ap-field/text-area/index.vue.mjs";
|
|
|
75
75
|
import { default as Ir } from "./src/ap-field/date-range/index.vue.mjs";
|
|
76
76
|
import { default as gr } from "./src/ap-field/select/index.vue.mjs";
|
|
77
77
|
import { default as Dr } from "./src/ap-field/text/password.vue.mjs";
|
|
78
|
-
import { default as
|
|
79
|
-
import { default as
|
|
80
|
-
import { default as
|
|
78
|
+
import { default as hr } from "./src/ap-field/slider/index.vue.mjs";
|
|
79
|
+
import { default as Mr } from "./src/ap-field/segmented/index.vue.mjs";
|
|
80
|
+
import { default as wr } from "./src/ap-field/rate/index.vue.mjs";
|
|
81
81
|
import { adminToken as Gr, aplusToken as Nr } from "./src/design-token/index.mjs";
|
|
82
|
-
import { ApActionItem as
|
|
82
|
+
import { ApActionItem as Lr } from "./src/ap-action/index.mjs";
|
|
83
83
|
import { default as Xr } from "./src/ap-action/item-modal/index.vue.mjs";
|
|
84
84
|
import { default as Yr } from "./src/ap-action/item-popconfirm/index.vue.mjs";
|
|
85
85
|
import { default as Hr } from "./src/ap-action/item-dropdown/index.vue.mjs";
|
|
@@ -97,13 +97,15 @@ import { default as dt } from "./src/ap-layout/ap-info-layout/ap-info-layout.vue
|
|
|
97
97
|
import { NeedNameKeyDefault as it } from "./src/ap-upload/apUploadTypes.mjs";
|
|
98
98
|
import { default as ut } from "./src/ap-upload/apUpload.vue.mjs";
|
|
99
99
|
import { default as ct } from "./src/ap-download/ap-download.vue.mjs";
|
|
100
|
-
import {
|
|
101
|
-
import {
|
|
102
|
-
import {
|
|
103
|
-
import {
|
|
104
|
-
import { default as
|
|
105
|
-
import {
|
|
106
|
-
import {
|
|
100
|
+
import { CheckCard as Tt } from "./src/check-card/index.mjs";
|
|
101
|
+
import { default as St } from "./src/check-card/group.vue.mjs";
|
|
102
|
+
import { ApLabel as bt, ApTitle as gt } from "./src/business/index.mjs";
|
|
103
|
+
import { useTablePaging as Dt } from "./src/ap-table/hooks/use-table-paging.mjs";
|
|
104
|
+
import { default as ht } from "./src/ap-table/ap-table.vue.mjs";
|
|
105
|
+
import { default as Mt } from "./src/editable-table/index.vue.mjs";
|
|
106
|
+
import { default as wt } from "./src/editable-table/form-item.vue.mjs";
|
|
107
|
+
import { useMessage as Gt } from "./src/hooks/useMessage.mjs";
|
|
108
|
+
import { useControllableValue as yt } from "./src/hooks/useControllableValue.mjs";
|
|
107
109
|
const p = {
|
|
108
110
|
install: (r) => {
|
|
109
111
|
for (const t in o) {
|
|
@@ -115,7 +117,7 @@ const p = {
|
|
|
115
117
|
export {
|
|
116
118
|
G as APConfigProvider,
|
|
117
119
|
zr as ApActionGroup,
|
|
118
|
-
|
|
120
|
+
Lr as ApActionItem,
|
|
119
121
|
Hr as ApActionItemDropdown,
|
|
120
122
|
Xr as ApActionItemModal,
|
|
121
123
|
Yr as ApActionItemPopconfirm,
|
|
@@ -129,10 +131,10 @@ export {
|
|
|
129
131
|
nr as ApFieldNumber,
|
|
130
132
|
Dr as ApFieldPassword,
|
|
131
133
|
Ar as ApFieldRadio,
|
|
132
|
-
|
|
133
|
-
|
|
134
|
+
wr as ApFieldRate,
|
|
135
|
+
Mr as ApFieldSegmented,
|
|
134
136
|
gr as ApFieldSelect,
|
|
135
|
-
|
|
137
|
+
hr as ApFieldSlider,
|
|
136
138
|
Fr as ApFieldSwitch,
|
|
137
139
|
mr as ApFieldText,
|
|
138
140
|
Cr as ApFieldTextArea,
|
|
@@ -142,26 +144,27 @@ export {
|
|
|
142
144
|
Go as ApFormItemDate,
|
|
143
145
|
yo as ApFormItemDateRange,
|
|
144
146
|
Qo as ApFormItemGroup,
|
|
145
|
-
|
|
146
|
-
|
|
147
|
+
wo as ApFormItemNumber,
|
|
148
|
+
Eo as ApFormItemRadio,
|
|
147
149
|
Ko as ApFormItemSelect,
|
|
148
150
|
Oo as ApFormItemSwitch,
|
|
149
|
-
|
|
150
|
-
|
|
151
|
+
ho as ApFormItemText,
|
|
152
|
+
Mo as ApFormItemTextArea,
|
|
151
153
|
Uo as ApFormItemTextPassword,
|
|
152
154
|
_o as ApFormList,
|
|
153
155
|
tr as ApFormModalForm,
|
|
154
156
|
or as ApFormSearchForm,
|
|
155
157
|
dt as ApInfoLayout,
|
|
156
|
-
bt as
|
|
158
|
+
bt as ApLabel,
|
|
159
|
+
ht as ApTable,
|
|
157
160
|
ft as ApTag,
|
|
158
161
|
lt as ApTagGroup,
|
|
159
|
-
|
|
162
|
+
gt as ApTitle,
|
|
160
163
|
ut as ApUpload,
|
|
161
164
|
De as ApiCascader,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
+
he as ApiRadioGroup,
|
|
166
|
+
Me as ApiSelect,
|
|
167
|
+
we as ApiTransfer,
|
|
165
168
|
Ge as ApiTree,
|
|
166
169
|
Ke as ApiTreeSelect,
|
|
167
170
|
qe as BaseButton,
|
|
@@ -169,9 +172,11 @@ export {
|
|
|
169
172
|
V as BasicArrow,
|
|
170
173
|
$ as BasicHelp,
|
|
171
174
|
j as BasicTitle,
|
|
172
|
-
|
|
175
|
+
Tt as CheckCard,
|
|
176
|
+
St as CheckCardGroup,
|
|
177
|
+
E as CollapseContainer,
|
|
173
178
|
J as CollapseTransition,
|
|
174
|
-
|
|
179
|
+
w as ConfigProvider,
|
|
175
180
|
so as CountdownButton,
|
|
176
181
|
xo as CountdownInput,
|
|
177
182
|
fo as CropperAvatar,
|
|
@@ -180,8 +185,8 @@ export {
|
|
|
180
185
|
et as DictCode,
|
|
181
186
|
Ao as Dropdown,
|
|
182
187
|
Io as EditTableHeaderIcon,
|
|
183
|
-
|
|
184
|
-
|
|
188
|
+
Mt as EditableTable,
|
|
189
|
+
wt as EditableTableFormItem,
|
|
185
190
|
Z as ExpandTransition,
|
|
186
191
|
_ as ExpandXTransition,
|
|
187
192
|
ee as FadeTransition,
|
|
@@ -191,7 +196,7 @@ export {
|
|
|
191
196
|
Ue as ModalButton,
|
|
192
197
|
it as NeedNameKeyDefault,
|
|
193
198
|
$e as PopConfirmButton,
|
|
194
|
-
|
|
199
|
+
Ee as ProForm,
|
|
195
200
|
Fo as ProTable,
|
|
196
201
|
Oe as ProTableForm,
|
|
197
202
|
We as ProTableFormInner,
|
|
@@ -229,24 +234,24 @@ export {
|
|
|
229
234
|
Ie as isSlotFormSchema,
|
|
230
235
|
c as keysOf,
|
|
231
236
|
b as localeContextKey,
|
|
232
|
-
|
|
237
|
+
h as namespaceContextKey,
|
|
233
238
|
F as provideGlobalConfig,
|
|
234
239
|
u as tableDefaultConfig,
|
|
235
240
|
g as translate,
|
|
236
241
|
jr as useCacheColumnSetting,
|
|
237
242
|
ce as useComponentRegister,
|
|
238
|
-
|
|
243
|
+
yt as useControllableValue,
|
|
239
244
|
ie as useDescription,
|
|
240
245
|
Te as useForm,
|
|
241
|
-
|
|
246
|
+
v as useGetDerivedNamespace,
|
|
242
247
|
T as useGlobalConfig,
|
|
243
248
|
P as useLocale,
|
|
244
|
-
|
|
249
|
+
Gt as useMessage,
|
|
245
250
|
oo as useModal,
|
|
246
251
|
_e as useModalContext,
|
|
247
252
|
ro as useModalInner,
|
|
248
|
-
|
|
253
|
+
M as useNamespace,
|
|
249
254
|
Do as useTable,
|
|
250
|
-
|
|
255
|
+
Dt as useTablePaging,
|
|
251
256
|
H as zhCn
|
|
252
257
|
};
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
import { ZoneAlias } from '@aplus-frontend/utils';
|
|
1
2
|
import { EventValue } from 'ant-design-vue/es/vc-picker/interface';
|
|
2
3
|
import { Dayjs } from 'dayjs';
|
|
3
4
|
|
|
4
5
|
export declare const formatDay: (d: Dayjs, f: string, begin?: boolean) => number | null;
|
|
6
|
+
/**
|
|
7
|
+
* 带timezone的日期格式化生成函数
|
|
8
|
+
* @param timezone
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
export declare function formatDayWithTimezone(timezone?: ZoneAlias): (d: Dayjs, f: string, begin?: boolean) => number | null;
|
|
5
12
|
export declare const formatValue: (v: EventValue<Dayjs>) => number | null;
|
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { getUtcTimestamp as m } from "@aplus-frontend/utils";
|
|
2
|
+
import n from "dayjs";
|
|
3
|
+
const i = (o, r, e = !0) => {
|
|
4
|
+
if (!o)
|
|
3
5
|
return null;
|
|
4
|
-
let t =
|
|
5
|
-
return t = t.millisecond(0),
|
|
6
|
-
}
|
|
6
|
+
let t = o.clone();
|
|
7
|
+
return t = t.millisecond(0), r.indexOf("ss") === -1 && (t = t.second(e ? 0 : 59)), r.indexOf("mm") === -1 && (t = t.minute(e ? 0 : 59)), r.indexOf("HH") === -1 && (t = t.hour(e ? 0 : 23)), r.indexOf("DD") === -1 && (t = t.date(e ? 1 : 0), e || (t = t.month(t.month() + 1))), r.indexOf("MM") === -1 && (t = t.month(e ? 0 : 12)), t.valueOf();
|
|
8
|
+
};
|
|
9
|
+
function d(o) {
|
|
10
|
+
return (r, e, t = !0) => {
|
|
11
|
+
const f = o ? n(m(r, o)) : n(r);
|
|
12
|
+
return i(f, e, t);
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
const l = (o) => o && o.valueOf();
|
|
7
16
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
17
|
+
i as formatDay,
|
|
18
|
+
d as formatDayWithTimezone,
|
|
19
|
+
l as formatValue
|
|
10
20
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { DatePicker as
|
|
4
|
-
import { ApFieldDatePresetFormats as
|
|
1
|
+
import { defineComponent as S, computed as s, unref as t, openBlock as c, createElementBlock as b, Fragment as _, createTextVNode as w, toDisplayString as M, createBlock as R, mergeProps as F, createSlots as A, renderList as x, withCtx as D, renderSlot as E, normalizeProps as V, guardReactiveProps as z } from "vue";
|
|
2
|
+
import r from "dayjs";
|
|
3
|
+
import { DatePicker as N } from "ant-design-vue";
|
|
4
|
+
import { ApFieldDatePresetFormats as j, PRESET_FORMAT_MAP as I, PRESET_FORMAT_PICK_MAP as H, PRESET_FORMAT_TIME_MAP as U } from "./constant.mjs";
|
|
5
5
|
import "../../hooks/index.mjs";
|
|
6
6
|
import { isNil as v, omit as K } from "lodash-unified";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
7
|
+
import { formatDayWithTimezone as $ } from "./helper.mjs";
|
|
8
|
+
import { getTimeFormatToZone as L } from "@aplus-frontend/utils";
|
|
9
|
+
import { useControllableValue as W } from "../../hooks/useControllableValue.mjs";
|
|
10
|
+
const te = /* @__PURE__ */ S({
|
|
10
11
|
name: "ApFieldDate",
|
|
11
12
|
__name: "index",
|
|
12
13
|
props: {
|
|
@@ -80,16 +81,22 @@ const Z = /* @__PURE__ */ b({
|
|
|
80
81
|
defaultValue: {},
|
|
81
82
|
onChange: {},
|
|
82
83
|
onOk: {},
|
|
83
|
-
format: { default: "Y-D" }
|
|
84
|
+
format: { default: "Y-D" },
|
|
85
|
+
timezone: {}
|
|
84
86
|
},
|
|
85
87
|
emits: ["update:value"],
|
|
86
88
|
setup(y, { emit: h }) {
|
|
87
|
-
const e = y, B = h, { value:
|
|
88
|
-
() =>
|
|
89
|
-
),
|
|
90
|
-
() => l.value ?
|
|
91
|
-
), k =
|
|
92
|
-
|
|
89
|
+
const e = y, B = h, { value: d, updateValue: p } = W(e, B), l = s(
|
|
90
|
+
() => j.indexOf(e.format) > -1
|
|
91
|
+
), u = s(
|
|
92
|
+
() => l.value ? I[e.format] : e.format
|
|
93
|
+
), k = s(() => {
|
|
94
|
+
if (v(t(d)))
|
|
95
|
+
return;
|
|
96
|
+
let o = r(t(d));
|
|
97
|
+
return e.timezone && (o = r(L(t(d), e.timezone))), o;
|
|
98
|
+
}), g = s(() => t(l) ? e.picker ?? H[e.format] : e.picker), O = s(() => {
|
|
99
|
+
const o = t(l) ? U[e.format] : {};
|
|
93
100
|
return {
|
|
94
101
|
...K(e, [
|
|
95
102
|
"value",
|
|
@@ -102,44 +109,44 @@ const Z = /* @__PURE__ */ b({
|
|
|
102
109
|
]),
|
|
103
110
|
...o
|
|
104
111
|
};
|
|
105
|
-
});
|
|
106
|
-
function
|
|
112
|
+
}), f = $(e.timezone);
|
|
113
|
+
function P(o) {
|
|
107
114
|
if (v(o)) {
|
|
108
|
-
|
|
115
|
+
p(null);
|
|
109
116
|
return;
|
|
110
117
|
}
|
|
111
|
-
const a =
|
|
112
|
-
t(l) ?
|
|
118
|
+
const a = r(o);
|
|
119
|
+
t(l) ? p(f(a, t(u))) : p(a.valueOf());
|
|
113
120
|
}
|
|
114
|
-
function
|
|
115
|
-
var
|
|
116
|
-
const
|
|
117
|
-
(
|
|
121
|
+
function C(o, a) {
|
|
122
|
+
var m;
|
|
123
|
+
const i = r(o), n = o ? t(l) ? f(i, t(u)) : i.valueOf() : null;
|
|
124
|
+
(m = e.onChange) == null || m.call(e, n, a);
|
|
118
125
|
}
|
|
119
|
-
function
|
|
126
|
+
function T(o) {
|
|
120
127
|
var n;
|
|
121
|
-
const a =
|
|
122
|
-
(n = e.onOk) == null || n.call(e,
|
|
128
|
+
const a = r(o), i = o ? t(l) ? f(a, t(u)) : a.valueOf() : null;
|
|
129
|
+
(n = e.onOk) == null || n.call(e, i);
|
|
123
130
|
}
|
|
124
|
-
return (o, a) => o.mode === "read" ? (c(), _
|
|
125
|
-
M(
|
|
126
|
-
], 64)) : (c(),
|
|
131
|
+
return (o, a) => o.mode === "read" ? (c(), b(_, { key: 0 }, [
|
|
132
|
+
w(M(t(d) ? t(r)(t(d)).format(u.value) : o.emptyText), 1)
|
|
133
|
+
], 64)) : (c(), R(t(N), F({ key: 1 }, O.value, {
|
|
127
134
|
value: k.value,
|
|
128
|
-
format:
|
|
129
|
-
"onUpdate:value":
|
|
130
|
-
onChange:
|
|
131
|
-
onOk:
|
|
132
|
-
picker:
|
|
133
|
-
}),
|
|
134
|
-
x(o.$slots, (
|
|
135
|
+
format: u.value,
|
|
136
|
+
"onUpdate:value": P,
|
|
137
|
+
onChange: C,
|
|
138
|
+
onOk: T,
|
|
139
|
+
picker: g.value
|
|
140
|
+
}), A({ _: 2 }, [
|
|
141
|
+
x(o.$slots, (i, n) => ({
|
|
135
142
|
name: n,
|
|
136
|
-
fn:
|
|
137
|
-
|
|
143
|
+
fn: D((m) => [
|
|
144
|
+
E(o.$slots, n, V(z(m || {})))
|
|
138
145
|
])
|
|
139
146
|
}))
|
|
140
147
|
]), 1040, ["value", "format", "picker"]));
|
|
141
148
|
}
|
|
142
149
|
});
|
|
143
150
|
export {
|
|
144
|
-
|
|
151
|
+
te as default
|
|
145
152
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { defineComponent as x, computed as
|
|
2
|
-
import { ApFieldDatePresetFormats as
|
|
1
|
+
import { defineComponent as x, computed as c, unref as t, openBlock as g, createElementBlock as k, Fragment as B, createTextVNode as O, toDisplayString as C, renderSlot as T, createVNode as V, createBlock as I, mergeProps as j, createSlots as U, renderList as H, withCtx as $, normalizeProps as K, guardReactiveProps as L } from "vue";
|
|
2
|
+
import { ApFieldDatePresetFormats as W, PRESET_FORMAT_MAP as Y, PRESET_FORMAT_PICK_MAP as Z, PRESET_FORMAT_TIME_MAP as q } from "../date/constant.mjs";
|
|
3
3
|
import "../../hooks/index.mjs";
|
|
4
|
-
import { isNil as
|
|
4
|
+
import { isNil as S, omit as b, isString as f } from "lodash-unified";
|
|
5
5
|
import u from "dayjs";
|
|
6
|
-
import { DatePicker as
|
|
7
|
-
import {
|
|
6
|
+
import { DatePicker as G } from "ant-design-vue";
|
|
7
|
+
import { formatDayWithTimezone as J, formatValue as D } from "../date/helper.mjs";
|
|
8
8
|
import { SwapRightOutlined as Q } from "@ant-design/icons-vue";
|
|
9
|
-
import { omitUndefined as
|
|
10
|
-
import {
|
|
11
|
-
|
|
9
|
+
import { omitUndefined as X } from "../../utils/index.mjs";
|
|
10
|
+
import { getTimeFormatToZone as M } from "@aplus-frontend/utils";
|
|
11
|
+
import { useControllableValue as ee } from "../../hooks/useControllableValue.mjs";
|
|
12
|
+
const fe = /* @__PURE__ */ x({
|
|
12
13
|
__name: "index",
|
|
13
14
|
props: {
|
|
14
15
|
mode: { default: "edit" },
|
|
@@ -83,29 +84,30 @@ const de = /* @__PURE__ */ x({
|
|
|
83
84
|
value: {},
|
|
84
85
|
defaultValue: {},
|
|
85
86
|
onChange: {},
|
|
86
|
-
onOk: {}
|
|
87
|
+
onOk: {},
|
|
88
|
+
timezone: {}
|
|
87
89
|
},
|
|
88
90
|
emits: ["update:value"],
|
|
89
91
|
setup(R, { emit: w }) {
|
|
90
|
-
const
|
|
91
|
-
() =>
|
|
92
|
-
),
|
|
93
|
-
() =>
|
|
94
|
-
), { value:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
), m =
|
|
98
|
-
var
|
|
99
|
-
const e =
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
];
|
|
104
|
-
}),
|
|
105
|
-
const e =
|
|
92
|
+
const o = R, _ = w, i = c(
|
|
93
|
+
() => W.indexOf(o.format) > -1
|
|
94
|
+
), r = c(
|
|
95
|
+
() => i.value ? Y[o.format] : o.format
|
|
96
|
+
), { value: p, updateValue: h } = ee(
|
|
97
|
+
o,
|
|
98
|
+
_
|
|
99
|
+
), m = J(o.timezone), v = c(() => {
|
|
100
|
+
var l, d;
|
|
101
|
+
const e = t(p);
|
|
102
|
+
if (S(e) || !(e != null && e.length))
|
|
103
|
+
return e;
|
|
104
|
+
const n = o.timezone ? M(t(p)[0], o.timezone) : (l = t(p)) == null ? void 0 : l[0], a = o.timezone ? M(t(p)[1], o.timezone) : (d = t(p)) == null ? void 0 : d[1];
|
|
105
|
+
return [u(n), u(a)];
|
|
106
|
+
}), A = c(() => t(i) ? o.picker ?? Z[o.format] : o.picker), F = c(() => {
|
|
107
|
+
const e = t(i) ? q[o.format] : {};
|
|
106
108
|
return {
|
|
107
|
-
...
|
|
108
|
-
|
|
109
|
+
...X(
|
|
110
|
+
b(o, [
|
|
109
111
|
"value",
|
|
110
112
|
"onUpdate:value",
|
|
111
113
|
"onChange",
|
|
@@ -117,55 +119,55 @@ const de = /* @__PURE__ */ x({
|
|
|
117
119
|
...e
|
|
118
120
|
};
|
|
119
121
|
});
|
|
120
|
-
function
|
|
122
|
+
function z(e) {
|
|
121
123
|
if (!e) {
|
|
122
124
|
h(e);
|
|
123
125
|
return;
|
|
124
126
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
]) : h([
|
|
127
|
+
let n = f(e[0]) ? u(e[0]) : e[0], a = f(e[1]) ? u(e[1]) : e[1];
|
|
128
|
+
t(i) ? h([
|
|
129
|
+
m(n, t(r)),
|
|
130
|
+
m(a, t(r), !1)
|
|
131
|
+
]) : h([D(n), D(a)]);
|
|
130
132
|
}
|
|
131
|
-
function
|
|
132
|
-
var
|
|
133
|
-
const n =
|
|
134
|
-
(
|
|
133
|
+
function E(e) {
|
|
134
|
+
var s;
|
|
135
|
+
const n = f(e[0]) ? u(e[0]) : e[0], a = f(e[1]) ? u(e[1]) : e[1], l = e[0] ? t(i) ? m(n, t(r)) : n.valueOf() : null, d = e[1] ? t(i) ? m(a, t(r), !1) : a.valueOf() : null;
|
|
136
|
+
(s = o.onOk) == null || s.call(o, [l, d]);
|
|
135
137
|
}
|
|
136
138
|
function N(e, n) {
|
|
137
|
-
var
|
|
138
|
-
if (
|
|
139
|
-
(
|
|
139
|
+
var y, P;
|
|
140
|
+
if (S(e)) {
|
|
141
|
+
(y = o.onChange) == null || y.call(o, e, n);
|
|
140
142
|
return;
|
|
141
143
|
}
|
|
142
|
-
const a =
|
|
143
|
-
(P =
|
|
144
|
+
const a = f(e[0]) ? u(e[0]) : e[0], l = f(e[1]) ? u(e[1]) : e[1], d = e[0] ? t(i) ? m(a, t(r)) : a.valueOf() : null, s = e[1] ? t(i) ? m(l, t(r), !1) : l.valueOf() : null;
|
|
145
|
+
(P = o.onChange) == null || P.call(o, [d, s], n);
|
|
144
146
|
}
|
|
145
147
|
return (e, n) => {
|
|
146
|
-
var a,
|
|
147
|
-
return e.mode === "read" ? (
|
|
148
|
-
|
|
149
|
-
O(C((a =
|
|
150
|
-
|
|
151
|
-
V(
|
|
148
|
+
var a, l;
|
|
149
|
+
return e.mode === "read" ? (g(), k(B, { key: 0 }, [
|
|
150
|
+
v.value ? (g(), k(B, { key: 0 }, [
|
|
151
|
+
O(C((a = v.value[0]) == null ? void 0 : a.format(r.value)) + " ", 1),
|
|
152
|
+
T(e.$slots, "readModeSeparator", {}, () => [
|
|
153
|
+
V(t(Q))
|
|
152
154
|
]),
|
|
153
|
-
O(" " + C((
|
|
154
|
-
], 64)) : (
|
|
155
|
+
O(" " + C((l = v.value[1]) == null ? void 0 : l.format(r.value)), 1)
|
|
156
|
+
], 64)) : (g(), k(B, { key: 1 }, [
|
|
155
157
|
O(C(e.emptyText), 1)
|
|
156
158
|
], 64))
|
|
157
|
-
], 64)) : (
|
|
158
|
-
value:
|
|
159
|
-
"onUpdate:value":
|
|
159
|
+
], 64)) : (g(), I(t(G).RangePicker, j({ key: 1 }, F.value, {
|
|
160
|
+
value: v.value,
|
|
161
|
+
"onUpdate:value": z,
|
|
160
162
|
onChange: N,
|
|
161
|
-
picker:
|
|
162
|
-
format:
|
|
163
|
-
onOk:
|
|
163
|
+
picker: A.value,
|
|
164
|
+
format: r.value,
|
|
165
|
+
onOk: E
|
|
164
166
|
}), U({ _: 2 }, [
|
|
165
|
-
H(
|
|
166
|
-
name:
|
|
167
|
-
fn: $((
|
|
168
|
-
|
|
167
|
+
H(t(b)(e.$slots, "readModeSeparator"), (d, s) => ({
|
|
168
|
+
name: s,
|
|
169
|
+
fn: $((y) => [
|
|
170
|
+
T(e.$slots, s, K(L(y || {})))
|
|
169
171
|
])
|
|
170
172
|
}))
|
|
171
173
|
]), 1040, ["value", "picker", "format"]));
|
|
@@ -173,5 +175,5 @@ const de = /* @__PURE__ */ x({
|
|
|
173
175
|
}
|
|
174
176
|
});
|
|
175
177
|
export {
|
|
176
|
-
|
|
178
|
+
fe as default
|
|
177
179
|
};
|
|
@@ -5,6 +5,7 @@ import { RangeValue } from 'ant-design-vue/es/vc-picker/interface';
|
|
|
5
5
|
import { RangePickerProps } from 'ant-design-vue/es/date-picker/dayjs';
|
|
6
6
|
import { LiteralUnion } from '../type';
|
|
7
7
|
import { InputPasswordProps } from './text/input-password-props';
|
|
8
|
+
import { ZoneAlias } from '@aplus-frontend/utils';
|
|
8
9
|
|
|
9
10
|
export type FieldMode = 'read' | 'edit';
|
|
10
11
|
export type BasicApFieldProps<FieldPropsType = any> = {
|
|
@@ -40,6 +41,10 @@ export type ApFieldDateProps = BasicApFieldProps<Omit<DatePickerProps, 'mode' |
|
|
|
40
41
|
onChange?: (ts: number | null, dayStr: string) => void;
|
|
41
42
|
onOk?: (ts: number | null) => void;
|
|
42
43
|
format?: LiteralUnion<ApFormatPresetType, string>;
|
|
44
|
+
/**
|
|
45
|
+
* 指定时区,指定后value会变为特定时区下的timestamp
|
|
46
|
+
*/
|
|
47
|
+
timezone?: ZoneAlias;
|
|
43
48
|
};
|
|
44
49
|
export type ApFieldNumberProps = BasicApFieldProps<InputNumberProps> & {
|
|
45
50
|
emptyText?: string;
|
|
@@ -84,6 +89,10 @@ export type ApFieldDateRangeProps = BasicApFieldProps<Omit<RangePickerProps, 'va
|
|
|
84
89
|
onChange?: (ts: RangeValue<number> | null, dayStr: [string, string]) => void;
|
|
85
90
|
onOk?: (ts: RangeValue<number>) => void;
|
|
86
91
|
format?: LiteralUnion<ApFormatPresetType, string>;
|
|
92
|
+
/**
|
|
93
|
+
* 指定时区,指定后value会变为特定时区下的timestamp
|
|
94
|
+
*/
|
|
95
|
+
timezone?: ZoneAlias;
|
|
87
96
|
};
|
|
88
97
|
export type ApFieldSelectProps = BasicApFieldProps<Omit<SelectProps, 'mode' | 'value' | 'onUpdate:value' | 'onSearch'>> & {
|
|
89
98
|
emptyText?: string;
|