@aplus-frontend/ui 7.15.0 → 7.15.2
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/src/ag-grid/editable/form-item.vue.mjs +8 -7
- package/es/src/ag-grid/editable/index.vue.mjs +19 -18
- package/es/src/ag-grid/index.vue.mjs +110 -105
- package/es/src/ag-grid/interface.d.ts +7 -0
- package/es/src/ap-form/drawer-form/index.vue.d.ts +1 -0
- package/es/src/ap-form/drawer-form/index.vue.mjs +107 -116
- package/es/src/ap-form/interface.d.ts +1 -1
- package/es/src/ap-form/items/checkbox/index.vue.mjs +2 -2
- package/es/src/ap-form/items/radio/index.vue.mjs +3 -2
- package/es/src/ap-table/components/setting/template/item.vue2.mjs +27 -26
- package/es/src/business/ap-descriptions/ap-descriptions.vue.mjs +23 -21
- package/es/src/business/ap-descriptions/style/index.mjs +7 -4
- package/es/src/time-ago/index.vue.mjs +21 -17
- package/es/src/time-ago/interface.d.ts +8 -0
- package/es/src/time-ago/useTimeAgo.d.ts +21 -0
- package/es/src/time-ago/useTimeAgo.mjs +36 -34
- package/es/src/time-ago/utils.d.ts +11 -0
- package/es/src/time-ago/utils.mjs +41 -9
- package/es/src/utils/index.d.ts +1 -0
- package/es/src/utils/index.mjs +18 -14
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ag-grid/editable/index.vue.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +7 -0
- package/lib/src/ap-form/drawer-form/index.vue.d.ts +1 -0
- package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
- package/lib/src/ap-form/interface.d.ts +1 -1
- package/lib/src/ap-form/items/checkbox/index.vue.js +1 -1
- package/lib/src/ap-form/items/radio/index.vue.js +1 -1
- package/lib/src/ap-table/components/setting/template/item.vue2.js +1 -1
- package/lib/src/business/ap-descriptions/ap-descriptions.vue.js +1 -1
- package/lib/src/business/ap-descriptions/style/index.js +1 -1
- package/lib/src/time-ago/index.vue.js +1 -1
- package/lib/src/time-ago/interface.d.ts +8 -0
- package/lib/src/time-ago/useTimeAgo.d.ts +21 -0
- package/lib/src/time-ago/useTimeAgo.js +1 -1
- package/lib/src/time-ago/utils.d.ts +11 -0
- package/lib/src/time-ago/utils.js +1 -1
- package/lib/src/utils/index.d.ts +1 -0
- package/lib/src/utils/index.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +5 -5
|
@@ -343,6 +343,13 @@ export type AgGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
|
|
|
343
343
|
* 自定义数据为空时展示的文本
|
|
344
344
|
*/
|
|
345
345
|
emptyText?: string;
|
|
346
|
+
/**
|
|
347
|
+
* 列尺寸变化后的回调
|
|
348
|
+
* @param key
|
|
349
|
+
* @param width
|
|
350
|
+
* @returns
|
|
351
|
+
*/
|
|
352
|
+
onColumnResized?: (key: string, width: number) => void;
|
|
346
353
|
};
|
|
347
354
|
export type AgGridExpose<SearchParamsType = Recordable, RecordType = any> = {
|
|
348
355
|
/**
|
|
@@ -926,6 +926,7 @@ declare const __VLS_component: DefineComponent<ApFormDrawerFormProps, {
|
|
|
926
926
|
type: PropType<sizeType>;
|
|
927
927
|
};
|
|
928
928
|
maxSize: NumberConstructor;
|
|
929
|
+
minSize: NumberConstructor;
|
|
929
930
|
drawerStyle: {
|
|
930
931
|
type: PropType<CSSProperties>;
|
|
931
932
|
default: CSSProperties;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { isVNode as
|
|
2
|
-
import { Button as
|
|
3
|
-
import { isBoolean as
|
|
1
|
+
import { isVNode as q, defineComponent as A, useSlots as E, shallowRef as L, ref as v, watch as G, computed as T, unref as l, cloneVNode as H, createVNode as o, mergeProps as m, createElementBlock as J, openBlock as h, Fragment as K, createBlock as w, createCommentVNode as Q, withCtx as c, renderSlot as B, resolveDynamicComponent as R, createTextVNode as X, toDisplayString as Y } from "vue";
|
|
2
|
+
import { Button as b, Flex as Z, Space as ee, Drawer as te } from "@aplus-frontend/antdv";
|
|
3
|
+
import { isBoolean as ie, isUndefined as ae, omit as le } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import "../../hooks/index.mjs";
|
|
6
|
-
import { convertReactiveToRaw as
|
|
7
|
-
import { getSingleVNode as
|
|
6
|
+
import { getNumberPx as F, convertReactiveToRaw as ne } from "../../utils/index.mjs";
|
|
7
|
+
import { getSingleVNode as oe } from "../../utils/slot.mjs";
|
|
8
8
|
import "../ap-form.vue.mjs";
|
|
9
|
-
import
|
|
10
|
-
import { useControllableValue as
|
|
11
|
-
import { useLocale as
|
|
12
|
-
import { useNamespace as
|
|
13
|
-
import
|
|
14
|
-
function
|
|
15
|
-
return typeof
|
|
9
|
+
import se from "../style/drawer-form.mjs";
|
|
10
|
+
import { useControllableValue as re } from "../../hooks/useControllableValue.mjs";
|
|
11
|
+
import { useLocale as ue } from "../../config-provider/hooks/use-locale.mjs";
|
|
12
|
+
import { useNamespace as de } from "../../config-provider/hooks/use-namespace.mjs";
|
|
13
|
+
import me from "../ap-form.vue2.mjs";
|
|
14
|
+
function x(s) {
|
|
15
|
+
return typeof s == "function" || Object.prototype.toString.call(s) === "[object Object]" && !q(s);
|
|
16
16
|
}
|
|
17
|
-
const
|
|
17
|
+
const Se = /* @__PURE__ */ A({
|
|
18
18
|
name: "ApFormDrawerForm",
|
|
19
19
|
__name: "index",
|
|
20
20
|
props: {
|
|
@@ -100,17 +100,25 @@ const De = /* @__PURE__ */ Y({
|
|
|
100
100
|
}
|
|
101
101
|
},
|
|
102
102
|
emits: ["update:open"],
|
|
103
|
-
setup(
|
|
104
|
-
expose:
|
|
105
|
-
emit:
|
|
103
|
+
setup(s, {
|
|
104
|
+
expose: O,
|
|
105
|
+
emit: k
|
|
106
106
|
}) {
|
|
107
|
-
const t =
|
|
108
|
-
value:
|
|
109
|
-
updateValue:
|
|
110
|
-
} =
|
|
107
|
+
const t = s, f = E(), W = k, a = L(), r = v(), n = v(!1), {
|
|
108
|
+
value: P,
|
|
109
|
+
updateValue: u
|
|
110
|
+
} = re(t, W, {
|
|
111
111
|
valuePropName: "open",
|
|
112
112
|
defaultValue: !1
|
|
113
|
-
}),
|
|
113
|
+
}), {
|
|
114
|
+
t: p
|
|
115
|
+
} = ue(), N = se("ap-form-drawer-form"), {
|
|
116
|
+
b: S
|
|
117
|
+
} = de("ap-form-drawer-form");
|
|
118
|
+
G(() => a.value, (e) => {
|
|
119
|
+
e && r.value && (e.setFieldsValue?.(r.value), r.value = void 0);
|
|
120
|
+
});
|
|
121
|
+
const d = T(() => {
|
|
114
122
|
const e = {
|
|
115
123
|
onResize: () => {
|
|
116
124
|
},
|
|
@@ -118,160 +126,143 @@ const De = /* @__PURE__ */ Y({
|
|
|
118
126
|
maxWidth: window.innerWidth * 0.8,
|
|
119
127
|
resizeOnOpen: !0
|
|
120
128
|
};
|
|
121
|
-
return
|
|
129
|
+
return ie(t.resize) ? t.resize ? e : {} : {
|
|
122
130
|
minWidth: t.resize?.minWidth ?? e.minWidth,
|
|
123
131
|
maxWidth: t.resize?.maxWidth ?? e.maxWidth,
|
|
124
132
|
onResize: t.resize?.onResize ?? e.onResize,
|
|
125
|
-
resizeOnOpen:
|
|
133
|
+
resizeOnOpen: ae(t.resize?.resizeOnOpen) ? e.resizeOnOpen : t.resize.resizeOnOpen
|
|
126
134
|
};
|
|
127
|
-
}), u = y(T()), {
|
|
128
|
-
t: F
|
|
129
|
-
} = be(), D = he("ap-form-drawer-form"), {
|
|
130
|
-
b: $,
|
|
131
|
-
e: q,
|
|
132
|
-
em: V
|
|
133
|
-
} = Fe("ap-form-drawer-form"), A = w(() => [q("resize-bar"), {
|
|
134
|
-
[V("resize-bar", "min-disabled")]: n(u) === n(l).minWidth
|
|
135
|
-
}, {
|
|
136
|
-
[V("resize-bar", "max-disabled")]: n(u) === n(l).maxWidth
|
|
137
|
-
}]);
|
|
138
|
-
P(() => o.value, (e) => {
|
|
139
|
-
e && d.value && (e.setFieldsValue?.(d.value), d.value = void 0);
|
|
140
|
-
}), P(() => n(C), (e) => {
|
|
141
|
-
e && n(l)?.resizeOnOpen && (u.value = T());
|
|
142
135
|
});
|
|
143
|
-
function
|
|
144
|
-
const e =
|
|
136
|
+
function _() {
|
|
137
|
+
const e = l(d)?.minWidth;
|
|
145
138
|
return !e || e && e < t.width ? t.width : e;
|
|
146
139
|
}
|
|
147
|
-
const
|
|
140
|
+
const g = v(F(_()));
|
|
141
|
+
function I(e) {
|
|
142
|
+
const {
|
|
143
|
+
resizeOnOpen: i,
|
|
144
|
+
onResize: C
|
|
145
|
+
} = d.value;
|
|
146
|
+
i && (g.value = e, C?.(e));
|
|
147
|
+
}
|
|
148
|
+
const y = oe(f.trigger), z = y ? H(y, {
|
|
148
149
|
onClick: () => {
|
|
149
|
-
|
|
150
|
+
u(!0);
|
|
150
151
|
}
|
|
151
|
-
}) : null,
|
|
152
|
+
}) : null, j = T(() => {
|
|
152
153
|
const e = [];
|
|
153
154
|
if (t.submitter === !1)
|
|
154
155
|
return null;
|
|
155
156
|
if (t.showCancel) {
|
|
156
157
|
let i;
|
|
157
|
-
e.push(
|
|
158
|
-
onClick:
|
|
159
|
-
disabled:
|
|
160
|
-
},
|
|
158
|
+
e.push(o(b, {
|
|
159
|
+
onClick: V,
|
|
160
|
+
disabled: n.value
|
|
161
|
+
}, x(i = p("ap.common.cancelText")) ? i : {
|
|
161
162
|
default: () => [i]
|
|
162
163
|
}));
|
|
163
164
|
}
|
|
164
|
-
return t.submitter?.resetButtonProps !== !1 && e.push(
|
|
165
|
+
return t.submitter?.resetButtonProps !== !1 && e.push(o(b, m(t.submitter?.resetButtonProps || {}, {
|
|
165
166
|
key: "submit",
|
|
166
|
-
disabled:
|
|
167
|
-
onClick:
|
|
167
|
+
disabled: n.value,
|
|
168
|
+
onClick: U
|
|
168
169
|
}), {
|
|
169
|
-
default: () => [t.submitter?.resetText ||
|
|
170
|
-
})), t.submitter?.submitButtonProps !== !1 && e.push(
|
|
170
|
+
default: () => [t.submitter?.resetText || p("ap.common.resetText")]
|
|
171
|
+
})), t.submitter?.submitButtonProps !== !1 && e.push(o(b, m({
|
|
171
172
|
type: "primary",
|
|
172
173
|
key: "submit"
|
|
173
174
|
}, t.submitter?.submitButtonProps || {}, {
|
|
174
|
-
loading:
|
|
175
|
-
onClick:
|
|
175
|
+
loading: n.value,
|
|
176
|
+
onClick: D
|
|
176
177
|
}), {
|
|
177
|
-
default: () => [t.submitter?.submitText ||
|
|
178
|
-
})),
|
|
178
|
+
default: () => [t.submitter?.submitText || p("ap.common.okText")]
|
|
179
|
+
})), o(Z, {
|
|
179
180
|
justify: "flex-end"
|
|
180
181
|
}, {
|
|
181
|
-
default: () => [
|
|
182
|
+
default: () => [f.submitter ? f.submitter(e) : o(ee, null, x(e) ? e : {
|
|
182
183
|
default: () => [e]
|
|
183
184
|
})]
|
|
184
185
|
});
|
|
185
186
|
});
|
|
186
|
-
function
|
|
187
|
-
|
|
188
|
-
}
|
|
189
|
-
function B(e) {
|
|
190
|
-
const i = n(l), c = (document.body.offsetWidth || 1e3) - (e.clientX - document.body.offsetLeft), f = i?.minWidth ?? (t.width || 800), O = i?.maxWidth ?? window.innerWidth * 0.8;
|
|
191
|
-
let g = c;
|
|
192
|
-
c < f && (g = f), c > O && (g = O), u.value = g;
|
|
187
|
+
function U() {
|
|
188
|
+
t.submitter !== !1 && (a.value?.resetFields(), t.submitter?.onReset?.());
|
|
193
189
|
}
|
|
194
|
-
function
|
|
195
|
-
document.removeEventListener("mousemove", B), document.removeEventListener("mouseup", x);
|
|
196
|
-
}
|
|
197
|
-
function H() {
|
|
198
|
-
t.submitter !== !1 && (o.value?.resetFields(), t.submitter?.onReset?.());
|
|
199
|
-
}
|
|
200
|
-
async function J() {
|
|
190
|
+
async function D() {
|
|
201
191
|
if (t.submitter !== !1)
|
|
202
192
|
try {
|
|
203
|
-
const e = await
|
|
204
|
-
t.submitter?.onSubmit?.(),
|
|
205
|
-
const i = t.onFinish?.(
|
|
193
|
+
const e = await a.value?.validateFieldsReturnTransformed();
|
|
194
|
+
t.submitter?.onSubmit?.(), n.value = !0;
|
|
195
|
+
const i = t.onFinish?.(ne(e));
|
|
206
196
|
if (t.submitTimeout && i instanceof Promise) {
|
|
207
|
-
const
|
|
197
|
+
const $ = setTimeout(() => n.value = !1, t.submitTimeout);
|
|
208
198
|
i.finally(() => {
|
|
209
|
-
clearTimeout(
|
|
199
|
+
clearTimeout($), n.value = !1;
|
|
210
200
|
});
|
|
211
201
|
}
|
|
212
|
-
await i &&
|
|
202
|
+
await i && u(!1);
|
|
213
203
|
} finally {
|
|
214
|
-
|
|
204
|
+
n.value = !1;
|
|
215
205
|
}
|
|
216
206
|
}
|
|
217
|
-
function
|
|
218
|
-
n
|
|
207
|
+
function V() {
|
|
208
|
+
l(n) || u(!1);
|
|
219
209
|
}
|
|
220
|
-
function
|
|
221
|
-
!e && n
|
|
210
|
+
function M(e) {
|
|
211
|
+
!e && l(n) || u(e);
|
|
222
212
|
}
|
|
223
|
-
return
|
|
213
|
+
return O({
|
|
224
214
|
resetFields: async () => {
|
|
225
|
-
|
|
215
|
+
a.value?.resetFields();
|
|
226
216
|
},
|
|
227
217
|
clearValidate: (e) => {
|
|
228
|
-
|
|
218
|
+
a.value?.clearValidate(e);
|
|
229
219
|
},
|
|
230
|
-
validateFields: (e, i) =>
|
|
231
|
-
getFieldsValue: (e) =>
|
|
232
|
-
validate: (e, i) =>
|
|
220
|
+
validateFields: (e, i) => a.value?.validateFields(e, i),
|
|
221
|
+
getFieldsValue: (e) => a.value?.getFieldsValue(e),
|
|
222
|
+
validate: (e, i) => a.value?.validate(e, i),
|
|
233
223
|
scrollToField: (e, i = {}) => {
|
|
234
|
-
|
|
224
|
+
a.value?.scrollToField(e, i);
|
|
235
225
|
},
|
|
236
226
|
setFieldValue: (e, i) => {
|
|
237
|
-
|
|
227
|
+
a.value?.setFieldValue?.(e, i);
|
|
238
228
|
},
|
|
239
229
|
setFieldsValue: (e) => {
|
|
240
|
-
if (!
|
|
241
|
-
|
|
230
|
+
if (!a.value) {
|
|
231
|
+
r.value = e;
|
|
242
232
|
return;
|
|
243
233
|
}
|
|
244
|
-
|
|
234
|
+
a.value?.setFieldsValue?.(e);
|
|
235
|
+
},
|
|
236
|
+
getInternalInstance: (e) => a.value?.getInternalInstance(e),
|
|
237
|
+
getFieldsValueTransformed: (e) => a.value?.getFieldsValueTransformed(e),
|
|
238
|
+
validateFieldsReturnTransformed: (e) => a.value?.validateFieldsReturnTransformed(e)
|
|
239
|
+
}), (e, i) => (h(), J(K, null, [o(l(te), m(e.drawerProps, {
|
|
240
|
+
open: l(P),
|
|
241
|
+
size: g.value,
|
|
242
|
+
"max-size": l(F)(d.value.maxWidth),
|
|
243
|
+
"min-size": l(F)(d.value.minWidth),
|
|
244
|
+
resizable: {
|
|
245
|
+
onResize: I
|
|
245
246
|
},
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
}), (e, i) => (h(), N(ie, null, [s(n(ue), p(e.drawerProps, {
|
|
250
|
-
open: n(C),
|
|
251
|
-
width: u.value,
|
|
252
|
-
class: [n($)(), n(D)],
|
|
253
|
-
"onUpdate:open": K,
|
|
254
|
-
onCancel: k
|
|
247
|
+
class: [l(S)(), l(N)],
|
|
248
|
+
"onUpdate:open": M,
|
|
249
|
+
onCancel: V
|
|
255
250
|
}), {
|
|
256
|
-
title:
|
|
257
|
-
footer:
|
|
258
|
-
default:
|
|
251
|
+
title: c(() => [B(e.$slots, "title", {}, () => [X(Y(t.title), 1)])]),
|
|
252
|
+
footer: c(() => [(h(), w(R(j.value)))]),
|
|
253
|
+
default: c(() => [o(me, m({
|
|
259
254
|
ref_key: "formRef",
|
|
260
|
-
ref:
|
|
261
|
-
},
|
|
262
|
-
default:
|
|
255
|
+
ref: a
|
|
256
|
+
}, l(le)(t, ["drawerProps", "open", "onUpdate:open", "title", "width", "onFinish", "submitter"])), {
|
|
257
|
+
default: c(() => [B(e.$slots, "default")]),
|
|
263
258
|
_: 3
|
|
264
|
-
}, 16)
|
|
265
|
-
key: 0,
|
|
266
|
-
class: oe(A.value),
|
|
267
|
-
onMousedown: ne(G, ["stop", "prevent"])
|
|
268
|
-
}, null, 34)) : M("", !0)]),
|
|
259
|
+
}, 16)]),
|
|
269
260
|
_: 3
|
|
270
|
-
}, 16, ["open", "
|
|
261
|
+
}, 16, ["open", "size", "max-size", "min-size", "resizable", "class"]), l(z) ? (h(), w(R(l(z)), {
|
|
271
262
|
key: 0
|
|
272
|
-
})) :
|
|
263
|
+
})) : Q("", !0)], 64));
|
|
273
264
|
}
|
|
274
265
|
});
|
|
275
266
|
export {
|
|
276
|
-
|
|
267
|
+
Se as default
|
|
277
268
|
};
|
|
@@ -278,7 +278,7 @@ export type ApFormModalFormProps = Omit<ApFormProps, 'onFinish'> & {
|
|
|
278
278
|
submitTimeout?: number;
|
|
279
279
|
};
|
|
280
280
|
export type CustomizeResizeType = {
|
|
281
|
-
onResize?: () => void;
|
|
281
|
+
onResize?: (_size: number) => void;
|
|
282
282
|
maxWidth?: DrawerProps['width'];
|
|
283
283
|
minWidth?: DrawerProps['width'];
|
|
284
284
|
resizeOnOpen?: boolean;
|
|
@@ -58,11 +58,11 @@ const A = /* @__PURE__ */ m({
|
|
|
58
58
|
request: () => l.value?.request()
|
|
59
59
|
}), (e, F) => (y(), x(k, a(r(o(i)(p, ["field"]))), B({
|
|
60
60
|
default: s(() => [
|
|
61
|
-
_(o(C), h(
|
|
61
|
+
_(o(C), h({
|
|
62
62
|
ref_key: "checkboxRef",
|
|
63
63
|
ref: l,
|
|
64
64
|
disabled: e.disabled
|
|
65
|
-
}), null, 16, ["disabled"])
|
|
65
|
+
}, e.field), null, 16, ["disabled"])
|
|
66
66
|
]),
|
|
67
67
|
_: 2
|
|
68
68
|
}, [
|
|
@@ -60,8 +60,9 @@ const A = /* @__PURE__ */ u({
|
|
|
60
60
|
default: s(() => [
|
|
61
61
|
v(r(k), b({
|
|
62
62
|
ref_key: "radioRef",
|
|
63
|
-
ref: o
|
|
64
|
-
|
|
63
|
+
ref: o,
|
|
64
|
+
disabled: e.disabled
|
|
65
|
+
}, e.field), null, 16, ["disabled"])
|
|
65
66
|
]),
|
|
66
67
|
_: 2
|
|
67
68
|
}, [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as g, ref as b, createElementBlock as c, openBlock as
|
|
1
|
+
import { defineComponent as g, ref as b, createElementBlock as c, openBlock as r, normalizeClass as a, unref as t, createElementVNode as f, createBlock as w, createCommentVNode as v, toDisplayString as B, withCtx as p, createVNode as s, withModifiers as d } from "vue";
|
|
2
2
|
import { EditOutlined as N, DeleteOutlined as A } from "@ant-design/icons-vue";
|
|
3
3
|
import { Flex as D, Popover as E } from "@aplus-frontend/antdv";
|
|
4
4
|
import "../../../../config-provider/index.mjs";
|
|
@@ -15,58 +15,59 @@ const K = /* @__PURE__ */ g({
|
|
|
15
15
|
shouldRemove: { type: Boolean }
|
|
16
16
|
},
|
|
17
17
|
setup(C) {
|
|
18
|
-
const
|
|
18
|
+
const m = C, { b: l } = V("ap-column-setting-template-item"), n = b(!1), { deleteTemplate: k, cacheConfig: u } = S();
|
|
19
19
|
function y(o) {
|
|
20
|
-
if (!o || o ===
|
|
20
|
+
if (!o || o === m.value.label)
|
|
21
21
|
return;
|
|
22
|
-
const e =
|
|
23
|
-
e.label = o,
|
|
22
|
+
const e = m.value;
|
|
23
|
+
e.label = o, u.value?.onChange?.(e.columnState, e), n.value = !1;
|
|
24
24
|
}
|
|
25
|
-
return (o, e) => (
|
|
26
|
-
class:
|
|
27
|
-
onClick: e[
|
|
28
|
-
(...
|
|
25
|
+
return (o, e) => (r(), c("div", {
|
|
26
|
+
class: a([t(l)(), { [t(l)("active")]: o.isActive }]),
|
|
27
|
+
onClick: e[4] || (e[4] = //@ts-ignore
|
|
28
|
+
(...i) => o.onClick && o.onClick(...i))
|
|
29
29
|
}, [
|
|
30
30
|
f("span", {
|
|
31
|
-
class:
|
|
31
|
+
class: a(t(l)("label"))
|
|
32
32
|
}, B(o.value.label), 3),
|
|
33
|
-
t(
|
|
33
|
+
t(u).persistenceKey ? (r(), w(t(D), {
|
|
34
34
|
key: 0,
|
|
35
35
|
gap: 8,
|
|
36
|
-
class:
|
|
36
|
+
class: a(t(l)("action-wrapper"))
|
|
37
37
|
}, {
|
|
38
|
-
default:
|
|
39
|
-
|
|
40
|
-
open:
|
|
38
|
+
default: p(() => [
|
|
39
|
+
s(t(E), {
|
|
40
|
+
open: n.value,
|
|
41
|
+
"onUpdate:open": e[2] || (e[2] = (i) => n.value = i),
|
|
41
42
|
trigger: "click",
|
|
42
43
|
arrow: !1,
|
|
43
44
|
placement: "bottom",
|
|
44
45
|
"destroy-tooltip-on-hide": ""
|
|
45
46
|
}, {
|
|
46
|
-
content:
|
|
47
|
-
|
|
47
|
+
content: p(() => [
|
|
48
|
+
s(F, {
|
|
48
49
|
"is-edit": "",
|
|
49
50
|
"initial-values": { label: o.value.label },
|
|
50
51
|
onConfirm: y,
|
|
51
|
-
onCancel: e[1] || (e[1] = () =>
|
|
52
|
+
onCancel: e[1] || (e[1] = () => n.value = !1)
|
|
52
53
|
}, null, 8, ["initial-values"])
|
|
53
54
|
]),
|
|
54
|
-
default:
|
|
55
|
+
default: p(() => [
|
|
55
56
|
f("span", {
|
|
56
|
-
class:
|
|
57
|
-
onClick: e[0] || (e[0] = d((
|
|
57
|
+
class: a(t(l)("icon-wrapper")),
|
|
58
|
+
onClick: e[0] || (e[0] = d((i) => n.value = !0, ["stop"]))
|
|
58
59
|
}, [
|
|
59
|
-
|
|
60
|
+
s(t(N))
|
|
60
61
|
], 2)
|
|
61
62
|
]),
|
|
62
63
|
_: 1
|
|
63
64
|
}, 8, ["open"]),
|
|
64
|
-
o.shouldRemove ? (
|
|
65
|
+
o.shouldRemove ? (r(), c("span", {
|
|
65
66
|
key: 0,
|
|
66
|
-
class:
|
|
67
|
-
onClick: e[
|
|
67
|
+
class: a(t(l)("icon-wrapper")),
|
|
68
|
+
onClick: e[3] || (e[3] = d(() => t(k)(o.value.key), ["stop"]))
|
|
68
69
|
}, [
|
|
69
|
-
|
|
70
|
+
s(t(A))
|
|
70
71
|
], 2)) : v("", !0)
|
|
71
72
|
]),
|
|
72
73
|
_: 1
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { defineComponent as N, useSlots as T, createVNode as l, createTextVNode as D, Fragment as V, shallowRef as w, watch as E, createElementBlock as _, openBlock as k, normalizeStyle as A, normalizeClass as B, unref as n, mergeProps as I } from "vue";
|
|
2
2
|
import { Descriptions as R } from "@aplus-frontend/antdv";
|
|
3
|
-
import { get as
|
|
3
|
+
import { get as u } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import "./help-message/index.vue.mjs";
|
|
6
6
|
import { mixinsAttachmentExtraProps as j, transformValue as z, isEmptyWithType as F } from "./helper.mjs";
|
|
7
7
|
import G from "./style/index.mjs";
|
|
8
|
-
import { useGlobalConfig as
|
|
8
|
+
import { useGlobalConfig as f } from "../../config-provider/hooks/use-global-config.mjs";
|
|
9
9
|
import { useNamespace as M } from "../../config-provider/hooks/use-namespace.mjs";
|
|
10
10
|
import L from "./help-message/index.vue2.mjs";
|
|
11
11
|
const Z = /* @__PURE__ */ N({
|
|
@@ -20,30 +20,30 @@ const Z = /* @__PURE__ */ N({
|
|
|
20
20
|
},
|
|
21
21
|
className: {}
|
|
22
22
|
},
|
|
23
|
-
setup(
|
|
24
|
-
const o =
|
|
25
|
-
b:
|
|
26
|
-
be:
|
|
23
|
+
setup(c) {
|
|
24
|
+
const o = c, d = f("apDescriptions"), y = f("downloadCenterTriggerConfig"), {
|
|
25
|
+
b: m,
|
|
26
|
+
be: s
|
|
27
27
|
} = M("ap-descriptions"), b = G("ap-descriptions"), g = T(), S = (e = {}) => {
|
|
28
28
|
let r = "";
|
|
29
29
|
return o.descriptionsProps?.layout === "vertical" && (r = "start"), {
|
|
30
30
|
justifyContent: r,
|
|
31
31
|
...e
|
|
32
32
|
};
|
|
33
|
-
},
|
|
34
|
-
const r =
|
|
33
|
+
}, i = (e) => {
|
|
34
|
+
const r = u(o.dataSource, e.field);
|
|
35
35
|
if (e.customRender)
|
|
36
36
|
return e.customRender(o.dataSource);
|
|
37
37
|
e.valueType === "attachment" && (e.extraProps = j(e.extraProps, {
|
|
38
|
-
fromConfig:
|
|
39
|
-
fromGlobal:
|
|
38
|
+
fromConfig: d.value?.downloadFile,
|
|
39
|
+
fromGlobal: y.value?.trigger
|
|
40
40
|
}));
|
|
41
41
|
const t = e.format ? e.format(r, o.dataSource || {}) : r;
|
|
42
42
|
return z({
|
|
43
43
|
value: t,
|
|
44
44
|
record: o.dataSource
|
|
45
45
|
}, e);
|
|
46
|
-
}, v = (e) => e.valueType === "text" && !!e.extraProps?.ellipsis,
|
|
46
|
+
}, v = (e) => e.valueType === "text" && !!e.extraProps?.ellipsis, x = (e, r) => {
|
|
47
47
|
if (e.visible != null) {
|
|
48
48
|
if (typeof e.visible == "boolean")
|
|
49
49
|
return e.visible;
|
|
@@ -54,11 +54,13 @@ const Z = /* @__PURE__ */ N({
|
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
return !0;
|
|
57
|
-
},
|
|
57
|
+
}, C = (e, r, t) => e.valueType === "empty" ? null : F(u(t, e.field), e) ? l("span", null, [D("--")]) : e.contentSlotName ? g?.[e.contentSlotName]?.({
|
|
58
58
|
index: r,
|
|
59
59
|
record: t,
|
|
60
|
-
item:
|
|
61
|
-
}) : l(V, null, [e.prefix,
|
|
60
|
+
item: i(e)
|
|
61
|
+
}) : l(V, null, [e.prefix, i(e), e.suffix && l("span", {
|
|
62
|
+
class: s("content", "suffix")
|
|
63
|
+
}, [e.suffix])]), P = (e = [], r) => e.filter((t) => x(t, r)).map((t, p) => ({
|
|
62
64
|
label: t.label && l(L, {
|
|
63
65
|
helpMessage: t.helpMessage,
|
|
64
66
|
label: t.label
|
|
@@ -67,23 +69,23 @@ const Z = /* @__PURE__ */ N({
|
|
|
67
69
|
style: t.style,
|
|
68
70
|
contentStyle: t.contentStyle,
|
|
69
71
|
labelStyle: t.labelStyle,
|
|
70
|
-
key: t.field?.toString() || "empty" +
|
|
71
|
-
class: v(t) ?
|
|
72
|
-
children:
|
|
73
|
-
})),
|
|
72
|
+
key: t.field?.toString() || "empty" + p,
|
|
73
|
+
class: v(t) ? s("item", "ellipsis") : "",
|
|
74
|
+
children: C(t, p, r)
|
|
75
|
+
})), a = w([]);
|
|
74
76
|
return E([() => o.schemas, () => o.dataSource], () => {
|
|
75
|
-
|
|
77
|
+
a.value = P(o.schemas, o.dataSource);
|
|
76
78
|
}, {
|
|
77
79
|
immediate: !0,
|
|
78
80
|
deep: !0
|
|
79
81
|
}), (e, r) => (k(), _("div", {
|
|
80
|
-
class: B([e.className, n(
|
|
82
|
+
class: B([e.className, n(m)(), n(b)]),
|
|
81
83
|
style: A(e.style)
|
|
82
84
|
}, [l(n(R), I(e.descriptionsProps, {
|
|
83
85
|
"label-style": S({
|
|
84
86
|
...e.descriptionsProps?.labelStyle || {}
|
|
85
87
|
}),
|
|
86
|
-
items:
|
|
88
|
+
items: a.value
|
|
87
89
|
}), null, 16, ["label-style", "items"])], 6));
|
|
88
90
|
}
|
|
89
91
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { genComponentStyleHook as
|
|
2
|
-
const
|
|
1
|
+
import { genComponentStyleHook as e } from "../../../utils/cssinjs/index.mjs";
|
|
2
|
+
const n = (t) => {
|
|
3
3
|
const { componentCls: i } = t;
|
|
4
4
|
return {
|
|
5
5
|
[i]: {
|
|
@@ -60,6 +60,9 @@ const e = (t) => {
|
|
|
60
60
|
},
|
|
61
61
|
".ant-descriptions-item-content": {
|
|
62
62
|
color: t.textColor1,
|
|
63
|
+
[`${i}-content__suffix`]: {
|
|
64
|
+
whiteSpace: "pre-wrap"
|
|
65
|
+
},
|
|
63
66
|
".ap-descriptions-item-content__link": {
|
|
64
67
|
color: t.colorLink,
|
|
65
68
|
cursor: "pointer"
|
|
@@ -68,8 +71,8 @@ const e = (t) => {
|
|
|
68
71
|
}
|
|
69
72
|
}
|
|
70
73
|
};
|
|
71
|
-
}, a =
|
|
72
|
-
|
|
74
|
+
}, a = e("ApDescriptions", (t) => [
|
|
75
|
+
n(t)
|
|
73
76
|
]);
|
|
74
77
|
export {
|
|
75
78
|
a as default
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as f, toRef as r, computed as a, createElementBlock as d, openBlock as g, normalizeClass as
|
|
1
|
+
import { defineComponent as f, toRef as r, computed as a, createElementBlock as d, openBlock as g, normalizeClass as _, unref as m, toDisplayString as v } from "vue";
|
|
2
2
|
import y from "dayjs";
|
|
3
3
|
import "../config-provider/index.mjs";
|
|
4
4
|
import D from "./style/index.mjs";
|
|
@@ -6,7 +6,7 @@ import h from "./useTimeAgo.mjs";
|
|
|
6
6
|
import { getTimeAgoStr as B } from "./utils.mjs";
|
|
7
7
|
import { useLocale as S } from "../config-provider/hooks/use-locale.mjs";
|
|
8
8
|
import { useNamespace as T } from "../config-provider/hooks/use-namespace.mjs";
|
|
9
|
-
const Y = ["title"],
|
|
9
|
+
const Y = ["title"], H = /* @__PURE__ */ f({
|
|
10
10
|
name: "TimeAgo",
|
|
11
11
|
__name: "index",
|
|
12
12
|
props: {
|
|
@@ -20,28 +20,32 @@ const Y = ["title"], M = /* @__PURE__ */ f({
|
|
|
20
20
|
interval: {
|
|
21
21
|
type: [Boolean, Number],
|
|
22
22
|
default: 1e4
|
|
23
|
-
}
|
|
23
|
+
},
|
|
24
|
+
customFormat: {}
|
|
24
25
|
},
|
|
25
|
-
setup(
|
|
26
|
-
const
|
|
27
|
-
locale:
|
|
26
|
+
setup(s) {
|
|
27
|
+
const e = s, {
|
|
28
|
+
locale: n
|
|
28
29
|
} = S(), {
|
|
29
30
|
b: l
|
|
30
|
-
} = T("time-ago"), i = D("time-ago"), u = h(r(
|
|
31
|
-
const
|
|
32
|
-
|
|
31
|
+
} = T("time-ago"), i = D("time-ago"), u = h(r(e, "value"), Date.now(), r(e, "interval")), c = a(() => {
|
|
32
|
+
const t = u.value;
|
|
33
|
+
return e.customFormat ? e.customFormat(t) : B(t, n.value);
|
|
34
|
+
}), p = a(() => {
|
|
35
|
+
const t = e.title;
|
|
36
|
+
if (t === !1)
|
|
33
37
|
return;
|
|
34
|
-
if (typeof
|
|
35
|
-
return
|
|
36
|
-
const o =
|
|
37
|
-
return y(
|
|
38
|
+
if (typeof t == "string")
|
|
39
|
+
return t;
|
|
40
|
+
const o = t === !0 ? "YYYY-MM-DD HH:mm:ss" : t.format;
|
|
41
|
+
return y(e.value).format(o);
|
|
38
42
|
});
|
|
39
|
-
return (
|
|
43
|
+
return (t, o) => (g(), d("span", {
|
|
40
44
|
title: p.value,
|
|
41
|
-
class:
|
|
42
|
-
},
|
|
45
|
+
class: _([m(l)(), m(i)])
|
|
46
|
+
}, v(c.value), 11, Y));
|
|
43
47
|
}
|
|
44
48
|
});
|
|
45
49
|
export {
|
|
46
|
-
|
|
50
|
+
H as default
|
|
47
51
|
};
|