@aplus-frontend/ui 0.0.32 → 0.0.33
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/ap-form/ap-form-item-group/helper.d.ts +7 -0
- package/es/src/ap-form/ap-form-item-group/helper.mjs +30 -25
- package/es/src/ap-form/ap-form-item-group/index.vue.mjs +20 -22
- package/es/src/ap-form/modal-form/index.vue.d.ts +2 -1
- package/es/src/ap-form/modal-form/index.vue.mjs +43 -39
- package/es/src/ap-tag/ap-tag-group.vue.d.ts +16 -6
- package/es/src/ap-tag/ap-tag-group.vue.mjs +81 -61
- package/es/src/ap-tag/interface.d.ts +24 -0
- package/es/src/ap-tag/style/ap-tag-group.css +8 -0
- package/es/src/design-token/index.mjs +6 -2
- package/es/src/theme/ap-tag/ap-tag-group.css +8 -0
- package/lib/src/ap-form/ap-form-item-group/helper.d.ts +7 -0
- package/lib/src/ap-form/ap-form-item-group/helper.js +1 -1
- package/lib/src/ap-form/ap-form-item-group/index.vue.js +1 -1
- package/lib/src/ap-form/modal-form/index.vue.d.ts +2 -1
- package/lib/src/ap-form/modal-form/index.vue.js +1 -1
- package/lib/src/ap-tag/ap-tag-group.vue.d.ts +16 -6
- package/lib/src/ap-tag/ap-tag-group.vue.js +1 -1
- package/lib/src/ap-tag/interface.d.ts +24 -0
- package/lib/src/ap-tag/style/ap-tag-group.css +8 -0
- package/lib/src/design-token/index.js +1 -1
- package/lib/src/theme/ap-tag/ap-tag-group.css +8 -0
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { VNode, RendererNode, RendererElement } from 'vue';
|
|
2
|
+
import { ApFormItemProps } from '../interface';
|
|
2
3
|
|
|
3
4
|
export declare const buildColSpan: (count: number, times?: number) => {
|
|
4
5
|
xs: number;
|
|
@@ -16,3 +17,9 @@ export declare const buildColSpan: (count: number, times?: number) => {
|
|
|
16
17
|
export declare const genRealChildren: (nodes: VNode[]) => VNode< RendererNode, RendererElement, {
|
|
17
18
|
[key: string]: any;
|
|
18
19
|
}>[];
|
|
20
|
+
/**
|
|
21
|
+
* 获取FormItem 字符串化的name,如果未获取到name,返回当前的时间戳
|
|
22
|
+
* @param name
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
25
|
+
export declare function getStringName(name?: ApFormItemProps['name']): string | number;
|
|
@@ -1,33 +1,38 @@
|
|
|
1
1
|
import { isArray as f } from "lodash-unified";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
import { isDef as i } from "../../utils/index.mjs";
|
|
3
|
+
const s = (r) => r <= 1 ? 1 : r, n = (r, e = 1) => {
|
|
4
|
+
const t = Math.floor(24 / r), o = t * e;
|
|
5
|
+
return o > 24 ? t : o;
|
|
6
|
+
}, p = (r, e = 1) => ({
|
|
7
|
+
xs: n(s(r - 3), e),
|
|
8
|
+
sm: n(s(r - 2), e),
|
|
9
|
+
md: n(s(r - 1), e),
|
|
10
|
+
lg: n(s(r - 1), e),
|
|
11
|
+
xl: n(r, e),
|
|
12
|
+
xxl: n(r, e)
|
|
12
13
|
});
|
|
13
|
-
function
|
|
14
|
-
const
|
|
15
|
-
for (const
|
|
16
|
-
if (
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
} else if (f(
|
|
20
|
-
const
|
|
21
|
-
|
|
14
|
+
function l(r) {
|
|
15
|
+
const e = [];
|
|
16
|
+
for (const t of r.filter(Boolean).filter((o) => o.type !== Symbol.for("v-cmt")))
|
|
17
|
+
if (t.type === Symbol.for("v-fgt")) {
|
|
18
|
+
const o = l(t.children);
|
|
19
|
+
e.push(...o);
|
|
20
|
+
} else if (f(t)) {
|
|
21
|
+
const o = l(t);
|
|
22
|
+
e.push(...o);
|
|
22
23
|
} else
|
|
23
|
-
|
|
24
|
-
return
|
|
24
|
+
e.push(t);
|
|
25
|
+
return e;
|
|
25
26
|
}
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
return
|
|
27
|
+
const a = (r) => {
|
|
28
|
+
const e = [];
|
|
29
|
+
return e.push(...l(r)), e;
|
|
29
30
|
};
|
|
31
|
+
function h(r) {
|
|
32
|
+
return i(r) ? (f(r) ? r : [r]).join("") : Date.now();
|
|
33
|
+
}
|
|
30
34
|
export {
|
|
31
35
|
p as buildColSpan,
|
|
32
|
-
|
|
36
|
+
a as genRealChildren,
|
|
37
|
+
h as getStringName
|
|
33
38
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { isVNode as
|
|
2
|
-
import { Col as $, Row as
|
|
1
|
+
import { isVNode as C, defineComponent as _, useSlots as k, watch as S, shallowRef as b, computed as h, unref as n, createVNode as x, mergeProps as m, openBlock as a, createBlock as u, withCtx as N, createElementBlock as R, Fragment as j, renderList as B, resolveDynamicComponent as P } from "vue";
|
|
2
|
+
import { Col as $, Row as v } from "ant-design-vue";
|
|
3
3
|
import { pick as F } from "lodash-unified";
|
|
4
|
-
import { apFormItemColPropKeys as
|
|
5
|
-
import { genRealChildren as
|
|
4
|
+
import { apFormItemColPropKeys as D } from "../constant.mjs";
|
|
5
|
+
import { genRealChildren as i, buildColSpan as I, getStringName as O } from "./helper.mjs";
|
|
6
6
|
import "../../config-provider/index.mjs";
|
|
7
7
|
import "../style/ap-form-item-group.css";
|
|
8
8
|
import { useNamespace as V } from "../../config-provider/hooks/use-namespace.mjs";
|
|
9
9
|
function A(r) {
|
|
10
|
-
return typeof r == "function" || Object.prototype.toString.call(r) === "[object Object]" && !
|
|
10
|
+
return typeof r == "function" || Object.prototype.toString.call(r) === "[object Object]" && !C(r);
|
|
11
11
|
}
|
|
12
|
-
const
|
|
12
|
+
const M = /* @__PURE__ */ _({
|
|
13
13
|
name: "ApFormItemGroup",
|
|
14
14
|
__name: "index",
|
|
15
15
|
props: {
|
|
@@ -29,30 +29,28 @@ const J = /* @__PURE__ */ _({
|
|
|
29
29
|
},
|
|
30
30
|
setup(r) {
|
|
31
31
|
const {
|
|
32
|
-
b:
|
|
32
|
+
b: s
|
|
33
33
|
} = V("ap-form-item-group"), {
|
|
34
34
|
countPerRow: f,
|
|
35
35
|
...d
|
|
36
|
-
} = r,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}), h(() => {
|
|
40
|
-
a.value = l(n.default());
|
|
36
|
+
} = r, p = k();
|
|
37
|
+
S(() => p.default(), (e) => {
|
|
38
|
+
c.value = i(e);
|
|
41
39
|
});
|
|
42
|
-
const
|
|
43
|
-
const t = e.props, o = F(t,
|
|
44
|
-
return
|
|
45
|
-
key: `${
|
|
46
|
-
},
|
|
47
|
-
class:
|
|
40
|
+
const c = b(i(p.default())), g = h(() => n(c).map((e, l) => {
|
|
41
|
+
const t = e.props, o = F(t, D), w = o != null && o.span ? {} : I(f), y = !!(t != null && t.hidden);
|
|
42
|
+
return x($, m({
|
|
43
|
+
key: `${l}-${O(t.name)}`
|
|
44
|
+
}, w, o, {
|
|
45
|
+
class: y ? s("col-hidden") : ""
|
|
48
46
|
}), A(e) ? e : {
|
|
49
47
|
default: () => [e]
|
|
50
48
|
});
|
|
51
49
|
}));
|
|
52
|
-
return (e,
|
|
53
|
-
class:
|
|
50
|
+
return (e, l) => (a(), u(n(v), m({
|
|
51
|
+
class: n(s)()
|
|
54
52
|
}, d), {
|
|
55
|
-
default:
|
|
53
|
+
default: N(() => [(a(!0), R(j, null, B(g.value, (t, o) => (a(), u(P(t), {
|
|
56
54
|
key: `${o}-${Date.now()}`
|
|
57
55
|
}))), 128))]),
|
|
58
56
|
_: 1
|
|
@@ -60,5 +58,5 @@ const J = /* @__PURE__ */ _({
|
|
|
60
58
|
}
|
|
61
59
|
});
|
|
62
60
|
export {
|
|
63
|
-
|
|
61
|
+
M as default
|
|
64
62
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApFormModalFormProps, ApFormSubmitterConfig } from '../interface';
|
|
1
|
+
import { ApFormModalFormProps, ApFormInternalInstance, ApFormSubmitterConfig } from '../interface';
|
|
2
2
|
import { VNode, DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType, CSSProperties } from 'vue';
|
|
3
3
|
import { InternalNamePath, NamePath, ValidateOptions, FormLabelAlign } from 'ant-design-vue/es/form/interface';
|
|
4
4
|
import { VueTypeValidableDef } from '../../../node_modules/vue-types';
|
|
@@ -36,6 +36,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
|
|
|
36
36
|
scrollToField: (name: NamePath, options?: {}) => void;
|
|
37
37
|
setFieldValue: (key: string, newValue: any) => void;
|
|
38
38
|
setFieldsValue: (values: Record<string, any>) => void;
|
|
39
|
+
getInternalInstance: (mark: string) => ApFormInternalInstance | undefined;
|
|
39
40
|
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
40
41
|
"update:open": (...args: any[]) => void;
|
|
41
42
|
}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApFormModalFormProps>, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isVNode as $, defineComponent as q, useSlots as D, ref as
|
|
2
|
-
import { Button as V, Flex as
|
|
1
|
+
import { isVNode as $, defineComponent as q, useSlots as D, ref as h, watch as L, cloneVNode as A, computed as G, createVNode as u, mergeProps as p, unref as n, openBlock as F, createElementBlock as I, Fragment as W, withCtx as y, renderSlot as x, createTextVNode as H, toDisplayString as J, createElementVNode as K, normalizeClass as Q, createBlock as T, resolveDynamicComponent as N, createCommentVNode as X } from "vue";
|
|
2
|
+
import { Button as V, Flex as Y, Space as Z, Modal as ee } from "ant-design-vue";
|
|
3
3
|
import "../ap-form.vue.mjs";
|
|
4
4
|
import "../../hooks/index.mjs";
|
|
5
5
|
import { getSingleVNode as te } from "../../utils/slot.mjs";
|
|
@@ -8,14 +8,14 @@ import { omit as le } from "lodash-unified";
|
|
|
8
8
|
import "../style/modal-form.css";
|
|
9
9
|
import { convertReactiveToRaw as ae } from "../../utils/index.mjs";
|
|
10
10
|
import { useControllableValue as oe } from "../../hooks/useControllableValue.mjs";
|
|
11
|
-
import { useLocale as
|
|
12
|
-
import { useGlobalConfig as
|
|
13
|
-
import { useNamespace as
|
|
11
|
+
import { useLocale as ne } from "../../config-provider/hooks/use-locale.mjs";
|
|
12
|
+
import { useGlobalConfig as ie } from "../../config-provider/hooks/use-global-config.mjs";
|
|
13
|
+
import { useNamespace as se } from "../../config-provider/hooks/use-namespace.mjs";
|
|
14
14
|
import re from "../ap-form.vue2.mjs";
|
|
15
15
|
function P(d) {
|
|
16
16
|
return typeof d == "function" || Object.prototype.toString.call(d) === "[object Object]" && !$(d);
|
|
17
17
|
}
|
|
18
|
-
const
|
|
18
|
+
const Re = /* @__PURE__ */ q({
|
|
19
19
|
__name: "index",
|
|
20
20
|
props: {
|
|
21
21
|
layout: {
|
|
@@ -89,7 +89,7 @@ const _e = /* @__PURE__ */ q({
|
|
|
89
89
|
expose: S,
|
|
90
90
|
emit: _
|
|
91
91
|
}) {
|
|
92
|
-
const a = d, b = D(), R = _, o =
|
|
92
|
+
const a = d, b = D(), R = _, o = h(), c = h(), r = h(!1), {
|
|
93
93
|
value: M,
|
|
94
94
|
updateValue: m
|
|
95
95
|
} = oe(a, R, {
|
|
@@ -97,10 +97,10 @@ const _e = /* @__PURE__ */ q({
|
|
|
97
97
|
defaultValue: !1
|
|
98
98
|
}), {
|
|
99
99
|
t: v
|
|
100
|
-
} =
|
|
100
|
+
} = ne(), g = ie("uiMode", "aplus"), {
|
|
101
101
|
b: j,
|
|
102
102
|
e: C
|
|
103
|
-
} =
|
|
103
|
+
} = se("ap-form-modal-form");
|
|
104
104
|
L(() => o.value, (e) => {
|
|
105
105
|
var t;
|
|
106
106
|
e && c.value && ((t = e.setFieldsValue) == null || t.call(e, c.value), c.value = void 0);
|
|
@@ -110,17 +110,17 @@ const _e = /* @__PURE__ */ q({
|
|
|
110
110
|
m(!0);
|
|
111
111
|
}
|
|
112
112
|
}) : null, O = G(() => {
|
|
113
|
-
var t, l,
|
|
113
|
+
var t, l, s, f;
|
|
114
114
|
const e = [];
|
|
115
115
|
if (a.submitter === !1)
|
|
116
116
|
return null;
|
|
117
117
|
if (a.showCancel) {
|
|
118
|
-
let
|
|
118
|
+
let i;
|
|
119
119
|
e.push(u(V, {
|
|
120
120
|
onClick: w,
|
|
121
121
|
disabled: r.value
|
|
122
|
-
}, P(
|
|
123
|
-
default: () => [
|
|
122
|
+
}, P(i = v("ap.common.cancelText")) ? i : {
|
|
123
|
+
default: () => [i]
|
|
124
124
|
}));
|
|
125
125
|
}
|
|
126
126
|
return ((t = a.submitter) == null ? void 0 : t.resetButtonProps) !== !1 && e.push(u(V, p(((l = a.submitter) == null ? void 0 : l.resetButtonProps) || {}, {
|
|
@@ -129,10 +129,10 @@ const _e = /* @__PURE__ */ q({
|
|
|
129
129
|
onClick: z
|
|
130
130
|
}), {
|
|
131
131
|
default: () => {
|
|
132
|
-
var
|
|
133
|
-
return [((
|
|
132
|
+
var i;
|
|
133
|
+
return [((i = a.submitter) == null ? void 0 : i.resetText) || v("ap.common.resetText")];
|
|
134
134
|
}
|
|
135
|
-
})), ((
|
|
135
|
+
})), ((s = a.submitter) == null ? void 0 : s.submitButtonProps) !== !1 && e.push(u(V, p({
|
|
136
136
|
type: "primary",
|
|
137
137
|
key: "submit"
|
|
138
138
|
}, ((f = a.submitter) == null ? void 0 : f.submitButtonProps) || {}, {
|
|
@@ -140,14 +140,14 @@ const _e = /* @__PURE__ */ q({
|
|
|
140
140
|
onClick: E
|
|
141
141
|
}), {
|
|
142
142
|
default: () => {
|
|
143
|
-
var
|
|
144
|
-
return [((
|
|
143
|
+
var i;
|
|
144
|
+
return [((i = a.submitter) == null ? void 0 : i.submitText) || v("ap.common.okText")];
|
|
145
145
|
}
|
|
146
|
-
})), u(
|
|
146
|
+
})), u(Y, {
|
|
147
147
|
justify: "flex-end",
|
|
148
|
-
class: C(
|
|
148
|
+
class: C(n(g) === "admin" ? "footer-admin" : "footer")
|
|
149
149
|
}, {
|
|
150
|
-
default: () => [b.submitter ? b.submitter(e) : u(
|
|
150
|
+
default: () => [b.submitter ? b.submitter(e) : u(Z, null, P(e) ? e : {
|
|
151
151
|
default: () => [e]
|
|
152
152
|
})]
|
|
153
153
|
});
|
|
@@ -157,20 +157,20 @@ const _e = /* @__PURE__ */ q({
|
|
|
157
157
|
a.submitter !== !1 && ((e = o.value) == null || e.resetFields(), (l = (t = a.submitter) == null ? void 0 : t.onReset) == null || l.call(t));
|
|
158
158
|
}
|
|
159
159
|
async function E() {
|
|
160
|
-
var e, t, l,
|
|
160
|
+
var e, t, l, s;
|
|
161
161
|
if (a.submitter !== !1)
|
|
162
162
|
try {
|
|
163
163
|
const f = await ((e = o.value) == null ? void 0 : e.validateFields());
|
|
164
|
-
(l = (t = a.submitter) == null ? void 0 : t.onSubmit) == null || l.call(t), r.value = !0, await ((
|
|
164
|
+
(l = (t = a.submitter) == null ? void 0 : t.onSubmit) == null || l.call(t), r.value = !0, await ((s = a.onFinish) == null ? void 0 : s.call(a, ae(f))) && m(!1);
|
|
165
165
|
} finally {
|
|
166
166
|
r.value = !1;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
function w() {
|
|
170
|
-
|
|
170
|
+
n(r) || m(!1);
|
|
171
171
|
}
|
|
172
172
|
function U(e) {
|
|
173
|
-
!e &&
|
|
173
|
+
!e && n(r) || m(e);
|
|
174
174
|
}
|
|
175
175
|
return S({
|
|
176
176
|
resetFields: () => {
|
|
@@ -198,8 +198,8 @@ const _e = /* @__PURE__ */ q({
|
|
|
198
198
|
(l = o.value) == null || l.scrollToField(e, t);
|
|
199
199
|
},
|
|
200
200
|
setFieldValue: (e, t) => {
|
|
201
|
-
var l,
|
|
202
|
-
(
|
|
201
|
+
var l, s;
|
|
202
|
+
(s = (l = o.value) == null ? void 0 : l.setFieldValue) == null || s.call(l, e, t);
|
|
203
203
|
},
|
|
204
204
|
setFieldsValue: (e) => {
|
|
205
205
|
var t, l;
|
|
@@ -208,36 +208,40 @@ const _e = /* @__PURE__ */ q({
|
|
|
208
208
|
return;
|
|
209
209
|
}
|
|
210
210
|
(l = (t = o.value) == null ? void 0 : t.setFieldsValue) == null || l.call(t, e);
|
|
211
|
+
},
|
|
212
|
+
getInternalInstance: (e) => {
|
|
213
|
+
var t;
|
|
214
|
+
return (t = o.value) == null ? void 0 : t.getInternalInstance(e);
|
|
211
215
|
}
|
|
212
|
-
}), (e, t) => (
|
|
213
|
-
open:
|
|
216
|
+
}), (e, t) => (F(), I(W, null, [u(n(ee), p(e.modalProps, {
|
|
217
|
+
open: n(M),
|
|
214
218
|
"onUpdate:open": U,
|
|
215
219
|
onCancel: w,
|
|
216
220
|
footer: null,
|
|
217
221
|
width: e.width,
|
|
218
|
-
class:
|
|
222
|
+
class: n(j)(),
|
|
219
223
|
"body-style": {
|
|
220
|
-
padding:
|
|
224
|
+
padding: n(g) === "admin" ? "0px !important" : "20px !important"
|
|
221
225
|
// 这里使用内联样式目的是为了使用最高优先级覆盖设置的全局样式
|
|
222
226
|
// 使用ModalForm你可能无法再自定义body的样式
|
|
223
227
|
}
|
|
224
228
|
}), {
|
|
225
|
-
title: y(() => [x(e.$slots, "title", {}, () => [J(
|
|
226
|
-
default: y(() => [
|
|
227
|
-
class:
|
|
229
|
+
title: y(() => [x(e.$slots, "title", {}, () => [H(J(a.title), 1)])]),
|
|
230
|
+
default: y(() => [K("div", {
|
|
231
|
+
class: Q(n(C)(n(g) === "admin" ? "content-admin" : "content"))
|
|
228
232
|
}, [u(re, p({
|
|
229
233
|
ref_key: "formRef",
|
|
230
234
|
ref: o
|
|
231
|
-
},
|
|
235
|
+
}, n(le)(a, ["modalProps", "open", "onUpdate:open", "title", "width", "onFinish", "submitter"])), {
|
|
232
236
|
default: y(() => [x(e.$slots, "default")]),
|
|
233
237
|
_: 3
|
|
234
|
-
}, 16)], 2), (
|
|
238
|
+
}, 16)], 2), (F(), T(N(O.value)))]),
|
|
235
239
|
_: 3
|
|
236
|
-
}, 16, ["open", "width", "class", "body-style"]),
|
|
240
|
+
}, 16, ["open", "width", "class", "body-style"]), n(k) ? (F(), T(N(n(k)), {
|
|
237
241
|
key: 0
|
|
238
|
-
})) :
|
|
242
|
+
})) : X("", !0)], 64));
|
|
239
243
|
}
|
|
240
244
|
});
|
|
241
245
|
export {
|
|
242
|
-
|
|
246
|
+
Re as default
|
|
243
247
|
};
|
|
@@ -1,19 +1,24 @@
|
|
|
1
|
-
import { ApTagGroupProps, ApTagProps } from './interface';
|
|
1
|
+
import { ApTagGroupProps, ApTagProps, EllipsisProps } from './interface';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
type ApTagGroupSlots = {
|
|
5
|
+
tooltip?: (props: {
|
|
6
|
+
tags: ApTagProps[];
|
|
7
|
+
}) => void;
|
|
8
|
+
};
|
|
9
|
+
declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApTagGroupProps>, {
|
|
5
10
|
list: () => ApTagProps[];
|
|
6
11
|
space: number;
|
|
7
|
-
|
|
12
|
+
ellipsis: () => {};
|
|
8
13
|
}>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApTagGroupProps>, {
|
|
9
14
|
list: () => ApTagProps[];
|
|
10
15
|
space: number;
|
|
11
|
-
|
|
16
|
+
ellipsis: () => {};
|
|
12
17
|
}>>>, {
|
|
18
|
+
ellipsis: EllipsisProps;
|
|
13
19
|
space: number;
|
|
14
20
|
list: ApTagProps[];
|
|
15
|
-
|
|
16
|
-
}, {}>;
|
|
21
|
+
}, {}>, Readonly<ApTagGroupSlots> & ApTagGroupSlots>;
|
|
17
22
|
export default _default;
|
|
18
23
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
19
24
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -32,3 +37,8 @@ type __VLS_WithDefaults<P, D> = {
|
|
|
32
37
|
type __VLS_Prettify<T> = {
|
|
33
38
|
[K in keyof T]: T[K];
|
|
34
39
|
} & {};
|
|
40
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
41
|
+
new (): {
|
|
42
|
+
$slots: S;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { createElementVNode as
|
|
2
|
-
import { Tooltip as
|
|
3
|
-
import
|
|
1
|
+
import { createElementVNode as t, defineComponent as N, ref as v, computed as s, unref as o, nextTick as g, watch as P, onMounted as S, onUnmounted as j, openBlock as u, createBlock as h, mergeProps as _, withCtx as y, renderSlot as q, createTextVNode as G, toDisplayString as k, normalizeClass as b, normalizeStyle as E, createElementBlock as B, Fragment as R, renderList as I, createCommentVNode as U } from "vue";
|
|
2
|
+
import { Tooltip as H } from "ant-design-vue";
|
|
3
|
+
import J from "@ant-design/icons-vue";
|
|
4
4
|
import "./ap-tag.vue2.mjs";
|
|
5
5
|
import "../config-provider/index.mjs";
|
|
6
|
+
import { omit as K } from "lodash-unified";
|
|
6
7
|
import "./style/ap-tag-group.css";
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
8
|
+
import { useLocale as O } from "../config-provider/hooks/use-locale.mjs";
|
|
9
|
+
import { useGlobalConfig as Q } from "../config-provider/hooks/use-global-config.mjs";
|
|
10
|
+
import { useNamespace as X } from "../config-provider/hooks/use-namespace.mjs";
|
|
11
|
+
import Y from "./ap-tag.vue.mjs";
|
|
12
|
+
const Z = /* @__PURE__ */ t("svg", {
|
|
10
13
|
xmlns: "http://www.w3.org/2000/svg",
|
|
11
14
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
12
15
|
fill: "none",
|
|
@@ -15,9 +18,9 @@ const I = /* @__PURE__ */ e("svg", {
|
|
|
15
18
|
height: "16",
|
|
16
19
|
viewBox: "0 0 16 16"
|
|
17
20
|
}, [
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
+
/* @__PURE__ */ t("defs", null, [
|
|
22
|
+
/* @__PURE__ */ t("clipPath", { id: "master_svg0_1133_24991" }, [
|
|
23
|
+
/* @__PURE__ */ t("rect", {
|
|
21
24
|
x: "0",
|
|
22
25
|
y: "0",
|
|
23
26
|
width: "16",
|
|
@@ -26,9 +29,9 @@ const I = /* @__PURE__ */ e("svg", {
|
|
|
26
29
|
})
|
|
27
30
|
])
|
|
28
31
|
]),
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ t("g", { "clip-path": "url(#master_svg0_1133_24991)" }, [
|
|
33
|
+
/* @__PURE__ */ t("g", null, [
|
|
34
|
+
/* @__PURE__ */ t("ellipse", {
|
|
32
35
|
cx: "8",
|
|
33
36
|
cy: "8",
|
|
34
37
|
rx: "1",
|
|
@@ -37,8 +40,8 @@ const I = /* @__PURE__ */ e("svg", {
|
|
|
37
40
|
"fill-opacity": "1"
|
|
38
41
|
})
|
|
39
42
|
]),
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ t("g", null, [
|
|
44
|
+
/* @__PURE__ */ t("ellipse", {
|
|
42
45
|
cx: "3.25",
|
|
43
46
|
cy: "8",
|
|
44
47
|
rx: "1",
|
|
@@ -47,8 +50,8 @@ const I = /* @__PURE__ */ e("svg", {
|
|
|
47
50
|
"fill-opacity": "1"
|
|
48
51
|
})
|
|
49
52
|
]),
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ t("g", null, [
|
|
54
|
+
/* @__PURE__ */ t("ellipse", {
|
|
52
55
|
cx: "12.75",
|
|
53
56
|
cy: "8",
|
|
54
57
|
rx: "1",
|
|
@@ -58,80 +61,97 @@ const I = /* @__PURE__ */ e("svg", {
|
|
|
58
61
|
})
|
|
59
62
|
])
|
|
60
63
|
])
|
|
61
|
-
], -1),
|
|
64
|
+
], -1), pe = /* @__PURE__ */ N({
|
|
62
65
|
__name: "ap-tag-group",
|
|
63
66
|
props: {
|
|
64
67
|
list: { default: () => [] },
|
|
65
68
|
space: { default: 4 },
|
|
66
|
-
ellipsisColor: {
|
|
69
|
+
ellipsisColor: {},
|
|
70
|
+
ellipsis: { default: () => ({}) }
|
|
67
71
|
},
|
|
68
|
-
setup(
|
|
69
|
-
const
|
|
70
|
-
|
|
72
|
+
setup(T) {
|
|
73
|
+
const { t: V } = O(), l = T, z = Q("uiMode"), { b: L, bm: x } = X("tag-group"), c = v(), r = s(() => ({
|
|
74
|
+
...{
|
|
75
|
+
iconColor: "#34B77C",
|
|
76
|
+
symbol: "icon",
|
|
77
|
+
text: V("ap.common.more")
|
|
78
|
+
},
|
|
79
|
+
...l.ellipsis
|
|
80
|
+
})), M = s(() => r.value.tooltip && typeof r.value.tooltip == "object" ? K(r.value.tooltip, ["trigger", "title"]) : {}), d = s(() => o(n) < l.list.length), $ = s(() => l.list.slice(0, o(n))), n = v(0), p = v(0), m = v(l.list.length), W = s(() => l.list.map((e) => e.text).join("、")), A = s(() => [L()].filter(Boolean)), D = s(() => z.value === "aplus" ? [x("ellipsis-text", "aplus")] : [x("ellipsis-text", "admin")]), f = () => {
|
|
81
|
+
if (!c.value)
|
|
71
82
|
return;
|
|
72
|
-
const
|
|
73
|
-
if (
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
requestAnimationFrame(
|
|
83
|
+
const e = c.value.scrollWidth, i = c.value.clientWidth;
|
|
84
|
+
if (o(p) <= o(m)) {
|
|
85
|
+
const a = Math.floor((o(p) + o(m)) / 2);
|
|
86
|
+
e <= i ? (n.value = a, p.value = a + 1) : m.value = a - 1, g(() => {
|
|
87
|
+
requestAnimationFrame(f);
|
|
77
88
|
});
|
|
78
89
|
} else
|
|
79
|
-
|
|
80
|
-
requestAnimationFrame(
|
|
90
|
+
e > i && (n.value = n.value - 1, g(() => {
|
|
91
|
+
requestAnimationFrame(f);
|
|
81
92
|
}));
|
|
82
|
-
},
|
|
83
|
-
|
|
93
|
+
}, w = () => {
|
|
94
|
+
p.value = 0, m.value = l.list.length, n.value = 0;
|
|
84
95
|
};
|
|
85
|
-
|
|
86
|
-
() =>
|
|
87
|
-
(
|
|
88
|
-
|
|
96
|
+
P(
|
|
97
|
+
() => l.list,
|
|
98
|
+
(e, i) => {
|
|
99
|
+
e !== i && (w(), g(() => f()));
|
|
89
100
|
},
|
|
90
101
|
{
|
|
91
102
|
immediate: !0
|
|
92
103
|
}
|
|
93
|
-
)
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
104
|
+
);
|
|
105
|
+
const C = () => {
|
|
106
|
+
w(), f();
|
|
107
|
+
};
|
|
108
|
+
return S(() => {
|
|
109
|
+
[["ellipsisColor", "ellipse.color"]].forEach(([e, i]) => {
|
|
110
|
+
l[e] && console.error(
|
|
111
|
+
`[ApTagGroup]: \`${e}\` is deprecated, please use \`${i}\` instead.`
|
|
112
|
+
);
|
|
113
|
+
}), window.addEventListener("resize", C);
|
|
114
|
+
}), j(() => {
|
|
115
|
+
window.removeEventListener("resize", C);
|
|
116
|
+
}), (e, i) => (u(), h(o(H), _({ trigger: "hover" }, M.value), {
|
|
117
|
+
title: y(() => [
|
|
118
|
+
q(e.$slots, "tooltip", { tags: e.list }, () => [
|
|
119
|
+
G(k(W.value), 1)
|
|
120
|
+
])
|
|
121
|
+
]),
|
|
105
122
|
default: y(() => [
|
|
106
|
-
|
|
107
|
-
class:
|
|
123
|
+
t("div", {
|
|
124
|
+
class: b(A.value),
|
|
108
125
|
ref_key: "container",
|
|
109
|
-
ref:
|
|
110
|
-
style:
|
|
111
|
-
pointerEvents:
|
|
126
|
+
ref: c,
|
|
127
|
+
style: E({
|
|
128
|
+
pointerEvents: d.value ? "auto" : "none"
|
|
112
129
|
})
|
|
113
130
|
}, [
|
|
114
|
-
(
|
|
115
|
-
key:
|
|
131
|
+
(u(!0), B(R, null, I($.value, (a, F) => (u(), h(Y, _({ ref_for: !0 }, a, {
|
|
132
|
+
key: F,
|
|
116
133
|
style: {
|
|
117
|
-
marginRight: `${
|
|
134
|
+
marginRight: `${e.space}px`
|
|
118
135
|
}
|
|
119
136
|
}), null, 16, ["style"]))), 128)),
|
|
120
|
-
|
|
137
|
+
d.value && r.value.symbol === "icon" ? (u(), h(o(J), {
|
|
121
138
|
key: 0,
|
|
122
|
-
style:
|
|
139
|
+
style: E({ color: e.ellipsisColor || r.value.iconColor })
|
|
123
140
|
}, {
|
|
124
141
|
component: y(() => [
|
|
125
|
-
|
|
142
|
+
Z
|
|
126
143
|
]),
|
|
127
144
|
_: 1
|
|
128
|
-
}, 8, ["style"])) :
|
|
145
|
+
}, 8, ["style"])) : d.value && r.value.symbol === "text" ? (u(), B("span", {
|
|
146
|
+
key: 1,
|
|
147
|
+
class: b(D.value)
|
|
148
|
+
}, k(r.value.text), 3)) : U("", !0)
|
|
129
149
|
], 6)
|
|
130
150
|
]),
|
|
131
|
-
_:
|
|
132
|
-
},
|
|
151
|
+
_: 3
|
|
152
|
+
}, 16));
|
|
133
153
|
}
|
|
134
154
|
});
|
|
135
155
|
export {
|
|
136
|
-
|
|
156
|
+
pe as default
|
|
137
157
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { TooltipProps } from 'ant-design-vue/es/tooltip';
|
|
2
|
+
|
|
1
3
|
export interface ApTagProps {
|
|
2
4
|
/**
|
|
3
5
|
* 标签内容
|
|
@@ -17,6 +19,27 @@ export interface ApTagProps {
|
|
|
17
19
|
*/
|
|
18
20
|
disabled?: boolean;
|
|
19
21
|
}
|
|
22
|
+
export type EllipsisProps = {
|
|
23
|
+
/**
|
|
24
|
+
* 省略号标志
|
|
25
|
+
* @default 'icon' - 内置图标不能自定义
|
|
26
|
+
* @type 'icon' | 'text'
|
|
27
|
+
*/
|
|
28
|
+
symbol?: 'icon' | 'text';
|
|
29
|
+
/**
|
|
30
|
+
* 省略号文本 - symbol为text时生效
|
|
31
|
+
*/
|
|
32
|
+
text?: string;
|
|
33
|
+
/**
|
|
34
|
+
* 省略号颜色 - symbol为icon时生效
|
|
35
|
+
* @default #34B77C
|
|
36
|
+
*/
|
|
37
|
+
iconColor?: string;
|
|
38
|
+
/**
|
|
39
|
+
* 省略号气泡内容
|
|
40
|
+
*/
|
|
41
|
+
tooltip?: Omit<TooltipProps, 'trigger' | 'title'>;
|
|
42
|
+
};
|
|
20
43
|
export interface ApTagGroupProps {
|
|
21
44
|
/**
|
|
22
45
|
* 标签组内容
|
|
@@ -32,4 +55,5 @@ export interface ApTagGroupProps {
|
|
|
32
55
|
* @default #34B77C
|
|
33
56
|
*/
|
|
34
57
|
ellipsisColor?: string;
|
|
58
|
+
ellipsis?: EllipsisProps;
|
|
35
59
|
}
|
|
@@ -28,7 +28,9 @@ const o = {
|
|
|
28
28
|
colorBgContainerDisabled: "#F9F9FA",
|
|
29
29
|
wireframe: !1,
|
|
30
30
|
colorBgLayout: "#F2F6F9",
|
|
31
|
-
colorBgSpotlight: "#000000cc"
|
|
31
|
+
colorBgSpotlight: "#000000cc",
|
|
32
|
+
controlItemBgActive: "#E9EDF3",
|
|
33
|
+
controlItemBgActiveHover: "#EAF2FF"
|
|
32
34
|
}, c = {
|
|
33
35
|
...o,
|
|
34
36
|
// 主色
|
|
@@ -57,7 +59,9 @@ const o = {
|
|
|
57
59
|
colorLink: "#1890FF",
|
|
58
60
|
wireframe: !1,
|
|
59
61
|
colorBgLayout: "#FAFAFA",
|
|
60
|
-
colorBgSpotlight: "#000000cc"
|
|
62
|
+
colorBgSpotlight: "#000000cc",
|
|
63
|
+
controlItemBgActive: "#f3fbf7",
|
|
64
|
+
controlItemBgActiveHover: "#e6f6ef"
|
|
61
65
|
};
|
|
62
66
|
export {
|
|
63
67
|
c as adminToken,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { VNode, RendererNode, RendererElement } from 'vue';
|
|
2
|
+
import { ApFormItemProps } from '../interface';
|
|
2
3
|
|
|
3
4
|
export declare const buildColSpan: (count: number, times?: number) => {
|
|
4
5
|
xs: number;
|
|
@@ -16,3 +17,9 @@ export declare const buildColSpan: (count: number, times?: number) => {
|
|
|
16
17
|
export declare const genRealChildren: (nodes: VNode[]) => VNode< RendererNode, RendererElement, {
|
|
17
18
|
[key: string]: any;
|
|
18
19
|
}>[];
|
|
20
|
+
/**
|
|
21
|
+
* 获取FormItem 字符串化的name,如果未获取到name,返回当前的时间戳
|
|
22
|
+
* @param name
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
25
|
+
export declare function getStringName(name?: ApFormItemProps['name']): string | number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("lodash-unified"),u=require("../../utils/index.js"),l=r=>r<=1?1:r,o=(r,e=1)=>{const t=Math.floor(24/r),n=t*e;return n>24?t:n},f=(r,e=1)=>({xs:o(l(r-3),e),sm:o(l(r-2),e),md:o(l(r-1),e),lg:o(l(r-1),e),xl:o(r,e),xxl:o(r,e)});function s(r){const e=[];for(const t of r.filter(Boolean).filter(n=>n.type!==Symbol.for("v-cmt")))if(t.type===Symbol.for("v-fgt")){const n=s(t.children);e.push(...n)}else if(i.isArray(t)){const n=s(t);e.push(...n)}else e.push(t);return e}const a=r=>{const e=[];return e.push(...s(r)),e};function c(r){return u.isDef(r)?(i.isArray(r)?r:[r]).join(""):Date.now()}exports.buildColSpan=f;exports.genRealChildren=a;exports.getStringName=c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("ant-design-vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("ant-design-vue"),k=require("lodash-unified"),y=require("../constant.js"),s=require("./helper.js");require("../../config-provider/index.js");require("../style/ap-form-item-group.css");const C=require("../../config-provider/hooks/use-namespace.js");function _(r){return typeof r=="function"||Object.prototype.toString.call(r)==="[object Object]"&&!e.isVNode(r)}const h=e.defineComponent({name:"ApFormItemGroup",__name:"index",props:{align:{},justify:{},prefixCls:{},gutter:{default:16},wrap:{type:Boolean,default:void 0},countPerRow:{default:3}},setup(r){const{b:u}=C.useNamespace("ap-form-item-group"),{countPerRow:p,...d}=r,a=e.useSlots();e.watch(()=>a.default(),t=>{c.value=s.genRealChildren(t)});const c=e.shallowRef(s.genRealChildren(a.default())),f=e.computed(()=>e.unref(c).map((t,l)=>{const n=t.props,o=k.pick(n,y.apFormItemColPropKeys),m=o!=null&&o.span?{}:s.buildColSpan(p),g=!!(n!=null&&n.hidden);return e.createVNode(i.Col,e.mergeProps({key:`${l}-${s.getStringName(n.name)}`},m,o,{class:g?u("col-hidden"):""}),_(t)?t:{default:()=>[t]})}));return(t,l)=>(e.openBlock(),e.createBlock(e.unref(i.Row),e.mergeProps({class:e.unref(u)()},d),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(n,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n),{key:`${o}-${Date.now()}`}))),128))]),_:1},16,["class"]))}});exports.default=h;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApFormModalFormProps, ApFormSubmitterConfig } from '../interface';
|
|
1
|
+
import { ApFormModalFormProps, ApFormInternalInstance, ApFormSubmitterConfig } from '../interface';
|
|
2
2
|
import { VNode, DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType, CSSProperties } from 'vue';
|
|
3
3
|
import { InternalNamePath, NamePath, ValidateOptions, FormLabelAlign } from 'ant-design-vue/es/form/interface';
|
|
4
4
|
import { VueTypeValidableDef } from '../../../node_modules/vue-types';
|
|
@@ -36,6 +36,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
|
|
|
36
36
|
scrollToField: (name: NamePath, options?: {}) => void;
|
|
37
37
|
setFieldValue: (key: string, newValue: any) => void;
|
|
38
38
|
setFieldsValue: (values: Record<string, any>) => void;
|
|
39
|
+
getInternalInstance: (mark: string) => ApFormInternalInstance | undefined;
|
|
39
40
|
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
40
41
|
"update:open": (...args: any[]) => void;
|
|
41
42
|
}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApFormModalFormProps>, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("ant-design-vue");require("../ap-form.vue.js");require("../../hooks/index.js");const S=require("../../utils/slot.js");require("../../config-provider/index.js");const T=require("lodash-unified");require("../style/modal-form.css");const M=require("../../utils/index.js"),R=require("../../hooks/useControllableValue.js"),j=require("../../config-provider/hooks/use-locale.js"),O=require("../../config-provider/hooks/use-global-config.js"),D=require("../../config-provider/hooks/use-namespace.js"),U=require("../ap-form.vue2.js");function y(d){return typeof d=="function"||Object.prototype.toString.call(d)==="[object Object]"&&!e.isVNode(d)}const z=e.defineComponent({__name:"index",props:{layout:{default:"horizontal"},labelCol:{},wrapperCol:{},colon:{type:Boolean,default:!0},labelAlign:{default:"right"},labelWrap:{type:Boolean},prefixCls:{},requiredMark:{},hideRequiredMark:{type:Boolean,default:!1},rules:{},validateMessages:{},validateOnRuleChange:{type:Boolean,default:!0},scrollToFirstError:{},onSubmit:{},name:{},validateTrigger:{default:"change"},size:{},disabled:{type:Boolean},onValuesChange:{},onFieldsChange:{},onFinishFailed:{},onValidate:{},initialValues:{},open:{type:Boolean,default:void 0},"onUpdate:open":{},modalProps:{default:()=>({})},title:{},width:{default:800},onFinish:{},submitter:{type:[Boolean,Object],default:()=>({resetButtonProps:!1})},showCancel:{type:Boolean,default:!0}},emits:["update:open"],setup(d,{expose:C,emit:B}){const o=d,m=e.useSlots(),k=B,n=e.ref(),c=e.ref(),u=e.ref(!1),{value:N,updateValue:f}=R.useControllableValue(o,k,{valuePropName:"open",defaultValue:!1}),{t:
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("ant-design-vue");require("../ap-form.vue.js");require("../../hooks/index.js");const S=require("../../utils/slot.js");require("../../config-provider/index.js");const T=require("lodash-unified");require("../style/modal-form.css");const M=require("../../utils/index.js"),R=require("../../hooks/useControllableValue.js"),j=require("../../config-provider/hooks/use-locale.js"),O=require("../../config-provider/hooks/use-global-config.js"),D=require("../../config-provider/hooks/use-namespace.js"),U=require("../ap-form.vue2.js");function y(d){return typeof d=="function"||Object.prototype.toString.call(d)==="[object Object]"&&!e.isVNode(d)}const z=e.defineComponent({__name:"index",props:{layout:{default:"horizontal"},labelCol:{},wrapperCol:{},colon:{type:Boolean,default:!0},labelAlign:{default:"right"},labelWrap:{type:Boolean},prefixCls:{},requiredMark:{},hideRequiredMark:{type:Boolean,default:!1},rules:{},validateMessages:{},validateOnRuleChange:{type:Boolean,default:!0},scrollToFirstError:{},onSubmit:{},name:{},validateTrigger:{default:"change"},size:{},disabled:{type:Boolean},onValuesChange:{},onFieldsChange:{},onFinishFailed:{},onValidate:{},initialValues:{},open:{type:Boolean,default:void 0},"onUpdate:open":{},modalProps:{default:()=>({})},title:{},width:{default:800},onFinish:{},submitter:{type:[Boolean,Object],default:()=>({resetButtonProps:!1})},showCancel:{type:Boolean,default:!0}},emits:["update:open"],setup(d,{expose:C,emit:B}){const o=d,m=e.useSlots(),k=B,n=e.ref(),c=e.ref(),u=e.ref(!1),{value:N,updateValue:f}=R.useControllableValue(o,k,{valuePropName:"open",defaultValue:!1}),{t:v}=j.useLocale(),b=O.useGlobalConfig("uiMode","aplus"),{b:q,e:g}=D.useNamespace("ap-form-modal-form");e.watch(()=>n.value,t=>{var l;t&&c.value&&((l=t.setFieldsValue)==null||l.call(t,c.value),c.value=void 0)});const V=S.getSingleVNode(m.trigger),h=V?e.cloneVNode(V,{onClick:()=>{f(!0)}}):null,_=e.computed(()=>{var l,a,r,p;const t=[];if(o.submitter===!1)return null;if(o.showCancel){let s;t.push(e.createVNode(i.Button,{onClick:F,disabled:u.value},y(s=v("ap.common.cancelText"))?s:{default:()=>[s]}))}return((l=o.submitter)==null?void 0:l.resetButtonProps)!==!1&&t.push(e.createVNode(i.Button,e.mergeProps(((a=o.submitter)==null?void 0:a.resetButtonProps)||{},{key:"submit",disabled:u.value,onClick:w}),{default:()=>{var s;return[((s=o.submitter)==null?void 0:s.resetText)||v("ap.common.resetText")]}})),((r=o.submitter)==null?void 0:r.submitButtonProps)!==!1&&t.push(e.createVNode(i.Button,e.mergeProps({type:"primary",key:"submit"},((p=o.submitter)==null?void 0:p.submitButtonProps)||{},{loading:u.value,onClick:x}),{default:()=>{var s;return[((s=o.submitter)==null?void 0:s.submitText)||v("ap.common.okText")]}})),e.createVNode(i.Flex,{justify:"flex-end",class:g(e.unref(b)==="admin"?"footer-admin":"footer")},{default:()=>[m.submitter?m.submitter(t):e.createVNode(i.Space,null,y(t)?t:{default:()=>[t]})]})});function w(){var t,l,a;o.submitter!==!1&&((t=n.value)==null||t.resetFields(),(a=(l=o.submitter)==null?void 0:l.onReset)==null||a.call(l))}async function x(){var t,l,a,r;if(o.submitter!==!1)try{const p=await((t=n.value)==null?void 0:t.validateFields());(a=(l=o.submitter)==null?void 0:l.onSubmit)==null||a.call(l),u.value=!0,await((r=o.onFinish)==null?void 0:r.call(o,M.convertReactiveToRaw(p)))&&f(!1)}finally{u.value=!1}}function F(){e.unref(u)||f(!1)}function P(t){!t&&e.unref(u)||f(t)}return C({resetFields:()=>{var t;(t=n.value)==null||t.resetFields()},clearValidate:t=>{var l;(l=n.value)==null||l.clearValidate(t)},validateFields:(t,l)=>{var a;return(a=n.value)==null?void 0:a.validateFields(t,l)},getFieldsValue:t=>{var l;return(l=n.value)==null?void 0:l.getFieldsValue(t)},validate:(t,l)=>{var a;return(a=n.value)==null?void 0:a.validate(t,l)},scrollToField:(t,l={})=>{var a;(a=n.value)==null||a.scrollToField(t,l)},setFieldValue:(t,l)=>{var a,r;(r=(a=n.value)==null?void 0:a.setFieldValue)==null||r.call(a,t,l)},setFieldsValue:t=>{var l,a;if(!n.value){c.value=t;return}(a=(l=n.value)==null?void 0:l.setFieldsValue)==null||a.call(l,t)},getInternalInstance:t=>{var l;return(l=n.value)==null?void 0:l.getInternalInstance(t)}}),(t,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(i.Modal),e.mergeProps(t.modalProps,{open:e.unref(N),"onUpdate:open":P,onCancel:F,footer:null,width:t.width,class:e.unref(q)(),"body-style":{padding:e.unref(b)==="admin"?"0px !important":"20px !important"}}),{title:e.withCtx(()=>[e.renderSlot(t.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(o.title),1)])]),default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(g)(e.unref(b)==="admin"?"content-admin":"content"))},[e.createVNode(U.default,e.mergeProps({ref_key:"formRef",ref:n},e.unref(T.omit)(o,["modalProps","open","onUpdate:open","title","width","onFinish","submitter"])),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16)],2),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(_.value)))]),_:3},16,["open","width","class","body-style"]),e.unref(h)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(h)),{key:0})):e.createCommentVNode("",!0)],64))}});exports.default=z;
|
|
@@ -1,19 +1,24 @@
|
|
|
1
|
-
import { ApTagGroupProps, ApTagProps } from './interface';
|
|
1
|
+
import { ApTagGroupProps, ApTagProps, EllipsisProps } from './interface';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
type ApTagGroupSlots = {
|
|
5
|
+
tooltip?: (props: {
|
|
6
|
+
tags: ApTagProps[];
|
|
7
|
+
}) => void;
|
|
8
|
+
};
|
|
9
|
+
declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApTagGroupProps>, {
|
|
5
10
|
list: () => ApTagProps[];
|
|
6
11
|
space: number;
|
|
7
|
-
|
|
12
|
+
ellipsis: () => {};
|
|
8
13
|
}>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApTagGroupProps>, {
|
|
9
14
|
list: () => ApTagProps[];
|
|
10
15
|
space: number;
|
|
11
|
-
|
|
16
|
+
ellipsis: () => {};
|
|
12
17
|
}>>>, {
|
|
18
|
+
ellipsis: EllipsisProps;
|
|
13
19
|
space: number;
|
|
14
20
|
list: ApTagProps[];
|
|
15
|
-
|
|
16
|
-
}, {}>;
|
|
21
|
+
}, {}>, Readonly<ApTagGroupSlots> & ApTagGroupSlots>;
|
|
17
22
|
export default _default;
|
|
18
23
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
19
24
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -32,3 +37,8 @@ type __VLS_WithDefaults<P, D> = {
|
|
|
32
37
|
type __VLS_Prettify<T> = {
|
|
33
38
|
[K in keyof T]: T[K];
|
|
34
39
|
} & {};
|
|
40
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
41
|
+
new (): {
|
|
42
|
+
$slots: S;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),V=require("ant-design-vue"),N=require("@ant-design/icons-vue");require("./ap-tag.vue2.js");require("../config-provider/index.js");const q=require("lodash-unified");require("./style/ap-tag-group.css");const B=require("../config-provider/hooks/use-locale.js"),b=require("../config-provider/hooks/use-global-config.js"),T=require("../config-provider/hooks/use-namespace.js"),z=require("./ap-tag.vue.js"),M=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",fill:"none",version:"1.1",width:"16",height:"16",viewBox:"0 0 16 16"},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:"master_svg0_1133_24991"},[e.createElementVNode("rect",{x:"0",y:"0",width:"16",height:"16",rx:"0"})])]),e.createElementVNode("g",{"clip-path":"url(#master_svg0_1133_24991)"},[e.createElementVNode("g",null,[e.createElementVNode("ellipse",{cx:"8",cy:"8",rx:"1",ry:"1",fill:"currentColor","fill-opacity":"1"})]),e.createElementVNode("g",null,[e.createElementVNode("ellipse",{cx:"3.25",cy:"8",rx:"1",ry:"1",fill:"currentColor","fill-opacity":"1"})]),e.createElementVNode("g",null,[e.createElementVNode("ellipse",{cx:"12.75",cy:"8",rx:"1",ry:"1",fill:"currentColor","fill-opacity":"1"})])])],-1),S=e.defineComponent({__name:"ap-tag-group",props:{list:{default:()=>[]},space:{default:4},ellipsisColor:{},ellipsis:{default:()=>({})}},setup(v){const{t:g}=B.useLocale(),l=v,h=b.useGlobalConfig("uiMode"),{b:y,bm:m}=T.useNamespace("tag-group"),i=e.ref(),o=e.computed(()=>({...{iconColor:"#34B77C",symbol:"icon",text:g("ap.common.more")},...l.ellipsis})),x=e.computed(()=>o.value.tooltip&&typeof o.value.tooltip=="object"?q.omit(o.value.tooltip,["trigger","title"]):{}),p=e.computed(()=>e.unref(n)<l.list.length),_=e.computed(()=>l.list.slice(0,e.unref(n))),n=e.ref(0),a=e.ref(0),u=e.ref(l.list.length),C=e.computed(()=>l.list.map(t=>t.text).join("、")),w=e.computed(()=>[y()].filter(Boolean)),k=e.computed(()=>h.value==="aplus"?[m("ellipsis-text","aplus")]:[m("ellipsis-text","admin")]),c=()=>{if(!i.value)return;const t=i.value.scrollWidth,r=i.value.clientWidth;if(e.unref(a)<=e.unref(u)){const s=Math.floor((e.unref(a)+e.unref(u))/2);t<=r?(n.value=s,a.value=s+1):u.value=s-1,e.nextTick(()=>{requestAnimationFrame(c)})}else t>r&&(n.value=n.value-1,e.nextTick(()=>{requestAnimationFrame(c)}))},d=()=>{a.value=0,u.value=l.list.length,n.value=0};e.watch(()=>l.list,(t,r)=>{t!==r&&(d(),e.nextTick(()=>c()))},{immediate:!0});const f=()=>{d(),c()};return e.onMounted(()=>{[["ellipsisColor","ellipse.color"]].forEach(([t,r])=>{l[t]&&console.error(`[ApTagGroup]: \`${t}\` is deprecated, please use \`${r}\` instead.`)}),window.addEventListener("resize",f)}),e.onUnmounted(()=>{window.removeEventListener("resize",f)}),(t,r)=>(e.openBlock(),e.createBlock(e.unref(V.Tooltip),e.mergeProps({trigger:"hover"},x.value),{title:e.withCtx(()=>[e.renderSlot(t.$slots,"tooltip",{tags:t.list},()=>[e.createTextVNode(e.toDisplayString(C.value),1)])]),default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(w.value),ref_key:"container",ref:i,style:e.normalizeStyle({pointerEvents:p.value?"auto":"none"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(s,E)=>(e.openBlock(),e.createBlock(z.default,e.mergeProps({ref_for:!0},s,{key:E,style:{marginRight:`${t.space}px`}}),null,16,["style"]))),128)),p.value&&o.value.symbol==="icon"?(e.openBlock(),e.createBlock(e.unref(N),{key:0,style:e.normalizeStyle({color:t.ellipsisColor||o.value.iconColor})},{component:e.withCtx(()=>[M]),_:1},8,["style"])):p.value&&o.value.symbol==="text"?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(k.value)},e.toDisplayString(o.value.text),3)):e.createCommentVNode("",!0)],6)]),_:3},16))}});exports.default=S;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { TooltipProps } from 'ant-design-vue/es/tooltip';
|
|
2
|
+
|
|
1
3
|
export interface ApTagProps {
|
|
2
4
|
/**
|
|
3
5
|
* 标签内容
|
|
@@ -17,6 +19,27 @@ export interface ApTagProps {
|
|
|
17
19
|
*/
|
|
18
20
|
disabled?: boolean;
|
|
19
21
|
}
|
|
22
|
+
export type EllipsisProps = {
|
|
23
|
+
/**
|
|
24
|
+
* 省略号标志
|
|
25
|
+
* @default 'icon' - 内置图标不能自定义
|
|
26
|
+
* @type 'icon' | 'text'
|
|
27
|
+
*/
|
|
28
|
+
symbol?: 'icon' | 'text';
|
|
29
|
+
/**
|
|
30
|
+
* 省略号文本 - symbol为text时生效
|
|
31
|
+
*/
|
|
32
|
+
text?: string;
|
|
33
|
+
/**
|
|
34
|
+
* 省略号颜色 - symbol为icon时生效
|
|
35
|
+
* @default #34B77C
|
|
36
|
+
*/
|
|
37
|
+
iconColor?: string;
|
|
38
|
+
/**
|
|
39
|
+
* 省略号气泡内容
|
|
40
|
+
*/
|
|
41
|
+
tooltip?: Omit<TooltipProps, 'trigger' | 'title'>;
|
|
42
|
+
};
|
|
20
43
|
export interface ApTagGroupProps {
|
|
21
44
|
/**
|
|
22
45
|
* 标签组内容
|
|
@@ -32,4 +55,5 @@ export interface ApTagGroupProps {
|
|
|
32
55
|
* @default #34B77C
|
|
33
56
|
*/
|
|
34
57
|
ellipsisColor?: string;
|
|
58
|
+
ellipsis?: EllipsisProps;
|
|
35
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o={borderRadius:4},r={...o,colorPrimary:"#0070FF",colorPrimaryHover:"#66A9FF",colorPrimaryActive:"#338CFF",colorTextBase:"#182948",colorText:"#182948",colorTextSecondary:"#526A90",colorTextTertiary:"#8896B0",colorTextPlaceholder:"#BFBFBF",colorBorder:"#DEE4ED",colorSplit:"#E9EDF3",colorInfo:"#0070FF",colorSuccess:"#2ED1A3",colorError:"#FF4D4F",colorWarning:"#FFA940",colorBgContainerDisabled:"#F9F9FA",wireframe:!1,colorBgLayout:"#F2F6F9",colorBgSpotlight:"#000000cc"},c={...o,colorPrimary:"#34B77C",colorPrimaryHover:"#85D4B0",colorPrimaryActive:"#5DC596",colorBgContainerDisabled:"#f5f5f5",colorText:"#333333",colorTextSecondary:"#666666",colorTextTertiary:"#999999",colorTextPlaceholder:"#ABB7CC",colorBorder:"#D9D9D9",colorSplit:"#E9E9E9",colorInfo:"#1890FF",colorSuccess:"#52C41A",colorError:"#FF4D4F",colorWarning:"#FAAD14",colorLink:"#1890FF",wireframe:!1,colorBgLayout:"#FAFAFA",colorBgSpotlight:"#000000cc"};exports.adminToken=c;exports.aplusToken=r;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o={borderRadius:4},r={...o,colorPrimary:"#0070FF",colorPrimaryHover:"#66A9FF",colorPrimaryActive:"#338CFF",colorTextBase:"#182948",colorText:"#182948",colorTextSecondary:"#526A90",colorTextTertiary:"#8896B0",colorTextPlaceholder:"#BFBFBF",colorBorder:"#DEE4ED",colorSplit:"#E9EDF3",colorInfo:"#0070FF",colorSuccess:"#2ED1A3",colorError:"#FF4D4F",colorWarning:"#FFA940",colorBgContainerDisabled:"#F9F9FA",wireframe:!1,colorBgLayout:"#F2F6F9",colorBgSpotlight:"#000000cc",controlItemBgActive:"#E9EDF3",controlItemBgActiveHover:"#EAF2FF"},c={...o,colorPrimary:"#34B77C",colorPrimaryHover:"#85D4B0",colorPrimaryActive:"#5DC596",colorBgContainerDisabled:"#f5f5f5",colorText:"#333333",colorTextSecondary:"#666666",colorTextTertiary:"#999999",colorTextPlaceholder:"#ABB7CC",colorBorder:"#D9D9D9",colorSplit:"#E9E9E9",colorInfo:"#1890FF",colorSuccess:"#52C41A",colorError:"#FF4D4F",colorWarning:"#FAAD14",colorLink:"#1890FF",wireframe:!1,colorBgLayout:"#FAFAFA",colorBgSpotlight:"#000000cc",controlItemBgActive:"#f3fbf7",controlItemBgActiveHover:"#e6f6ef"};exports.adminToken=c;exports.aplusToken=r;
|