@aplus-frontend/ui 6.26.3 → 6.26.4
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/theme.mjs +4 -3
- package/es/src/ap-modal/interface.d.ts +10 -3
- package/es/src/ap-modal/utils/createModalStream.mjs +67 -58
- package/es/src/business/ap-value-select-card/index.vue2.mjs +81 -90
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/theme.js +1 -1
- package/lib/src/ap-modal/interface.d.ts +10 -3
- package/lib/src/ap-modal/utils/createModalStream.js +1 -1
- package/lib/src/business/ap-value-select-card/index.vue2.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
- package/theme/ag-grid/index.css +5 -0
- package/theme/ag-grid/index.less +12 -0
- package/theme/ap-value-select-card/index.css +1 -1
- package/theme/ap-value-select-card/index.less +2 -1
- package/theme/index.css +6 -1
package/es/src/ag-grid/theme.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useToken as a } from "@aplus-frontend/antdv/es/theme/internal";
|
|
2
2
|
import { themeQuartz as n } from "ag-grid-community";
|
|
3
3
|
import { computed as d } from "vue";
|
|
4
|
-
const
|
|
4
|
+
const m = (r, e) => {
|
|
5
5
|
const [, t] = a();
|
|
6
6
|
return d(() => {
|
|
7
7
|
const c = r.value === "mini", o = t.value;
|
|
@@ -16,10 +16,11 @@ const p = (r, e) => {
|
|
|
16
16
|
rowBorder: { color: o.colorBorderSecondary },
|
|
17
17
|
headerRowBorder: { color: o.colorBorderSecondary },
|
|
18
18
|
selectedRowBackgroundColor: o.controlItemBgActive,
|
|
19
|
-
checkboxCheckedBackgroundColor: o.colorPrimary
|
|
19
|
+
checkboxCheckedBackgroundColor: o.colorPrimary,
|
|
20
|
+
rowHoverColor: "var(--ap-color-bg-2)"
|
|
20
21
|
});
|
|
21
22
|
});
|
|
22
23
|
};
|
|
23
24
|
export {
|
|
24
|
-
|
|
25
|
+
m as useTheme
|
|
25
26
|
};
|
|
@@ -54,7 +54,7 @@ export type CreateModalFuncReturn = {
|
|
|
54
54
|
close: () => void;
|
|
55
55
|
};
|
|
56
56
|
export type CreateModalFunc = (props: CreateModalFuncProps) => CreateModalFuncReturn;
|
|
57
|
-
export type ModalStreamNextFunc<ModalType extends ModalStreamTypeKey = ModalStreamTypeKey> = (option
|
|
57
|
+
export type ModalStreamNextFunc<ModalType extends ModalStreamTypeKey = ModalStreamTypeKey> = (option?: {
|
|
58
58
|
/**
|
|
59
59
|
* 下一步弹框的id
|
|
60
60
|
*/
|
|
@@ -77,7 +77,7 @@ export type ModalStreamNextFunc<ModalType extends ModalStreamTypeKey = ModalStre
|
|
|
77
77
|
* @returns
|
|
78
78
|
*/
|
|
79
79
|
handleModal?: (option: {
|
|
80
|
-
getModal: (modalId: string) => CreateModalFuncReturn;
|
|
80
|
+
getModal: (modalId: string) => CreateModalFuncReturn | ModalStreamFuncReturn;
|
|
81
81
|
}) => any | Promise<any>;
|
|
82
82
|
}) => any | Promise<any>;
|
|
83
83
|
export type ModalStreamType = {
|
|
@@ -147,5 +147,12 @@ export type CreateModalStreamProps<ModalType extends ModalStreamTypeKey = ModalS
|
|
|
147
147
|
*/
|
|
148
148
|
props: (params: any, next: ModalStreamNextFunc<ModalType>) => Promise<ModalStreamType[ModalType]>;
|
|
149
149
|
} : never;
|
|
150
|
-
export type CreateModalStreamFunc<ModalType extends ModalStreamTypeKey = ModalStreamTypeKey> = (streamList: CreateModalStreamProps<ModalType>[], firstModalId?: string) =>
|
|
150
|
+
export type CreateModalStreamFunc<ModalType extends ModalStreamTypeKey = ModalStreamTypeKey> = (streamList: CreateModalStreamProps<ModalType>[], firstModalId?: string) => {
|
|
151
|
+
/** 获取弹框实例 */
|
|
152
|
+
getModal: (modalId: string) => CreateModalFuncReturn | ModalStreamFuncReturn;
|
|
153
|
+
/** 清空弹框 */
|
|
154
|
+
clearAllModal: () => void;
|
|
155
|
+
/** 下一步 */
|
|
156
|
+
next: ModalStreamNextFunc<ModalType>;
|
|
157
|
+
} | undefined;
|
|
151
158
|
export type ApModalType = keyof Omit<ModalStaticFunctions, 'warn'>;
|
|
@@ -1,93 +1,102 @@
|
|
|
1
|
-
import { isValid as
|
|
2
|
-
import { createModal as
|
|
3
|
-
import { Modal as
|
|
4
|
-
import { ModalMessage as
|
|
5
|
-
const A = (
|
|
6
|
-
const E =
|
|
7
|
-
let x,
|
|
8
|
-
const
|
|
9
|
-
modalId:
|
|
10
|
-
params:
|
|
11
|
-
handleCurrentModal:
|
|
1
|
+
import { isValid as _ } from "@aplus-frontend/utils";
|
|
2
|
+
import { createModal as I } from "./createModal.mjs";
|
|
3
|
+
import { Modal as S } from "@aplus-frontend/antdv";
|
|
4
|
+
import { ModalMessage as y } from "../enums/modalMessage.mjs";
|
|
5
|
+
const A = (M, g) => {
|
|
6
|
+
const E = g ?? (Array.isArray(M) ? M[0]?.modalId : void 0), n = /* @__PURE__ */ new Map();
|
|
7
|
+
let x, u, c = 1e3;
|
|
8
|
+
const m = async ({
|
|
9
|
+
modalId: r,
|
|
10
|
+
params: d,
|
|
11
|
+
handleCurrentModal: f,
|
|
12
12
|
handleModal: O
|
|
13
|
-
}) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
} = {}) => {
|
|
14
|
+
if (!_(r)) {
|
|
15
|
+
l();
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
x = d;
|
|
19
|
+
const s = M.find((t) => t.modalId === r);
|
|
20
|
+
let i = !1;
|
|
21
|
+
if (u) {
|
|
22
|
+
const t = n.get(u), a = {
|
|
19
23
|
...t,
|
|
20
24
|
destroy: () => {
|
|
21
|
-
t?.destroy?.(), n.delete(
|
|
25
|
+
t?.destroy?.(), n.delete(u);
|
|
22
26
|
},
|
|
23
27
|
open: () => {
|
|
24
|
-
|
|
28
|
+
i = !0;
|
|
25
29
|
}
|
|
26
30
|
};
|
|
27
|
-
await
|
|
31
|
+
await f?.(a), await O?.({
|
|
28
32
|
getModal: n.get.bind(n)
|
|
29
33
|
});
|
|
30
34
|
}
|
|
31
|
-
return
|
|
32
|
-
C(
|
|
33
|
-
}),
|
|
34
|
-
},
|
|
35
|
-
for (const [
|
|
36
|
-
|
|
37
|
-
}, C = async (
|
|
35
|
+
return s && setTimeout(() => {
|
|
36
|
+
C(s);
|
|
37
|
+
}), i;
|
|
38
|
+
}, l = () => {
|
|
39
|
+
for (const [r, d] of n)
|
|
40
|
+
d?.destroy?.();
|
|
41
|
+
}, C = async (r) => {
|
|
38
42
|
const {
|
|
39
|
-
modalId:
|
|
40
|
-
modalType:
|
|
43
|
+
modalId: d,
|
|
44
|
+
modalType: f = "createModal",
|
|
41
45
|
props: O
|
|
42
|
-
} =
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
+
} = r;
|
|
47
|
+
u = d;
|
|
48
|
+
const s = n.get(d), i = await O?.(x, async (e) => (a = !0, await m(e)));
|
|
49
|
+
c = Math.max(i?.zIndex ?? 0, c), c += 1;
|
|
46
50
|
let t, a = !1;
|
|
47
|
-
if (
|
|
48
|
-
const e =
|
|
51
|
+
if (f === "createModal") {
|
|
52
|
+
const e = i, p = async (o) => (a = !0, await m(o));
|
|
49
53
|
t = {
|
|
50
54
|
...e,
|
|
51
55
|
destroyOnClose: !1,
|
|
52
|
-
zIndex:
|
|
56
|
+
zIndex: c,
|
|
53
57
|
onOk: async (o) => {
|
|
54
|
-
const w = await e?.onOk?.(o,
|
|
55
|
-
if (a ||
|
|
56
|
-
throw new Error(
|
|
58
|
+
const w = await e?.onOk?.(o, p);
|
|
59
|
+
if (a || l(), w)
|
|
60
|
+
throw new Error(y.NOT_NEED_CLOSE);
|
|
57
61
|
},
|
|
58
62
|
onCancel: async (o) => {
|
|
59
|
-
const w = await e?.onCancel?.(o,
|
|
60
|
-
if (a ||
|
|
61
|
-
throw new Error(
|
|
63
|
+
const w = await e?.onCancel?.(o, p);
|
|
64
|
+
if (a || l(), w)
|
|
65
|
+
throw new Error(y.NOT_NEED_CLOSE);
|
|
62
66
|
}
|
|
63
67
|
};
|
|
64
68
|
} else {
|
|
65
|
-
const e =
|
|
69
|
+
const e = i, p = async (o) => (a = !0, await m(o));
|
|
66
70
|
t = {
|
|
67
71
|
...e,
|
|
68
|
-
zIndex:
|
|
72
|
+
zIndex: c,
|
|
69
73
|
onOk: async () => {
|
|
70
|
-
const o = await e?.onOk?.(
|
|
71
|
-
if (a ||
|
|
72
|
-
throw new Error(
|
|
74
|
+
const o = await e?.onOk?.(p);
|
|
75
|
+
if (a || l(), o)
|
|
76
|
+
throw new Error(y.NOT_NEED_CLOSE);
|
|
73
77
|
},
|
|
74
78
|
onCancel: async () => {
|
|
75
|
-
const o = await e?.onCancel?.(
|
|
76
|
-
if (a ||
|
|
77
|
-
throw new Error(
|
|
79
|
+
const o = await e?.onCancel?.(p);
|
|
80
|
+
if (a || l(), o)
|
|
81
|
+
throw new Error(y.NOT_NEED_CLOSE);
|
|
78
82
|
}
|
|
79
83
|
};
|
|
80
84
|
}
|
|
81
|
-
if (
|
|
82
|
-
|
|
85
|
+
if (s) {
|
|
86
|
+
s?.update(t), s?.open?.();
|
|
83
87
|
return;
|
|
84
|
-
} else if (
|
|
85
|
-
const e =
|
|
86
|
-
e?.open?.(), n.set(
|
|
88
|
+
} else if (f === "createModal") {
|
|
89
|
+
const e = I(t);
|
|
90
|
+
e?.open?.(), n.set(d, e);
|
|
87
91
|
} else
|
|
88
|
-
|
|
89
|
-
}, N =
|
|
90
|
-
N !== void 0
|
|
92
|
+
S?.[f]?.(t);
|
|
93
|
+
}, N = M.find((r) => _(E) && r.modalId === E);
|
|
94
|
+
if (N !== void 0)
|
|
95
|
+
return C(N), {
|
|
96
|
+
getModal: n.get.bind(n),
|
|
97
|
+
clearAllModal: l,
|
|
98
|
+
next: m
|
|
99
|
+
};
|
|
91
100
|
};
|
|
92
101
|
export {
|
|
93
102
|
A as createModalStream
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Popover as
|
|
3
|
-
import { PlusOutlined as
|
|
4
|
-
import { IconApAdLinePoor as
|
|
1
|
+
import { defineComponent as L, ref as T, computed as A, resolveComponent as _, createElementBlock as c, openBlock as a, normalizeStyle as V, normalizeClass as d, unref as s, createVNode as b, withCtx as F, createElementVNode as u, createCommentVNode as y, Fragment as N, renderList as R, withModifiers as f, renderSlot as h, createTextVNode as p, toDisplayString as g, createBlock as j } from "vue";
|
|
2
|
+
import { Popover as G } from "@aplus-frontend/antdv";
|
|
3
|
+
import { PlusOutlined as q } from "@ant-design/icons-vue";
|
|
4
|
+
import { IconApAdLinePoor as J } from "@aplus-frontend/icon";
|
|
5
5
|
import "../../config-provider/index.mjs";
|
|
6
|
-
import { useNamespace as
|
|
7
|
-
import { useGlobalConfig as
|
|
8
|
-
const
|
|
6
|
+
import { useNamespace as Q } from "../../config-provider/hooks/use-namespace.mjs";
|
|
7
|
+
import { useGlobalConfig as U } from "../../config-provider/hooks/use-global-config.mjs";
|
|
8
|
+
const W = ["onClick"], X = { class: "label" }, Y = { class: "value" }, Z = ["onClick"], x = ["onClick"], ee = { class: "label" }, te = { class: "value" }, le = { class: "text" }, ce = /* @__PURE__ */ L({
|
|
9
9
|
name: "ApValueSelectCard",
|
|
10
10
|
__name: "index",
|
|
11
11
|
props: {
|
|
@@ -19,171 +19,162 @@ const Y = ["onClick"], Z = { class: "label" }, x = { class: "value" }, ee = ["on
|
|
|
19
19
|
showCloseIcon: { type: Boolean, default: !0 },
|
|
20
20
|
showAddButton: { type: Boolean, default: !0 },
|
|
21
21
|
addButtonText: { default: "" },
|
|
22
|
-
getContainer: { type: Function, default: (
|
|
22
|
+
getContainer: { type: Function, default: (v) => v.parentElement || document.body },
|
|
23
23
|
getCardStyle: { type: Function, default: () => ({}) },
|
|
24
24
|
wrapperStyle: { type: [Boolean, null, String, Object, Array] }
|
|
25
25
|
},
|
|
26
26
|
emits: ["update:selectedKeys", "update:highlightedKeys", "change", "select", "remove", "highlight"],
|
|
27
|
-
setup(
|
|
28
|
-
const
|
|
27
|
+
setup(v, { expose: H, emit: D }) {
|
|
28
|
+
const i = D, l = v, { b: n, m: E } = Q("ap-value-select-card"), M = U("uiMode", "aplus"), P = T(null), m = T(!1), K = A(() => l.options), C = A(() => K.value.filter(
|
|
29
29
|
(e) => l.selectedKeys.includes(e.key)
|
|
30
|
-
)),
|
|
31
|
-
l.selectedKeys.includes(e) ? k(e) :
|
|
32
|
-
},
|
|
30
|
+
)), B = (e) => l.selectedKeys.includes(e), S = (e) => l.highlightedKeys.includes(e), $ = (e) => {
|
|
31
|
+
l.selectedKeys.includes(e) ? k(e) : I(e);
|
|
32
|
+
}, I = (e) => {
|
|
33
33
|
if (l.maxSelected && l.selectedKeys.length >= l.maxSelected)
|
|
34
34
|
return;
|
|
35
|
-
const
|
|
36
|
-
|
|
35
|
+
const o = [...l.selectedKeys, e];
|
|
36
|
+
i("update:selectedKeys", o), i("change", o), i("select", e), l.highlightedKeys.includes(e) || w(e);
|
|
37
37
|
}, k = (e) => {
|
|
38
38
|
if (l.selectedKeys.length <= 1 || l.highlightedKeys.length <= 1 && l.highlightedKeys.includes(e))
|
|
39
39
|
return;
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
40
|
+
const o = l.selectedKeys.filter((r) => r !== e);
|
|
41
|
+
if (i("update:selectedKeys", o), i("change", o), i("remove", e), l.highlightedKeys.includes(e)) {
|
|
42
42
|
const r = l.highlightedKeys.filter((t) => t !== e);
|
|
43
|
-
|
|
43
|
+
i("update:highlightedKeys", r), i("highlight", r);
|
|
44
44
|
}
|
|
45
|
-
},
|
|
46
|
-
let
|
|
45
|
+
}, w = (e) => {
|
|
46
|
+
let o;
|
|
47
47
|
if (l.highlightedKeys.includes(e))
|
|
48
48
|
if (l.highlightedKeys.length > 1)
|
|
49
|
-
|
|
49
|
+
o = l.highlightedKeys.filter((r) => r !== e);
|
|
50
50
|
else
|
|
51
51
|
return;
|
|
52
52
|
else
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
e || (
|
|
53
|
+
o = [...l.highlightedKeys, e];
|
|
54
|
+
i("update:highlightedKeys", o), i("highlight", o);
|
|
55
|
+
}, z = (e) => {
|
|
56
|
+
e || (m.value = e);
|
|
57
57
|
};
|
|
58
|
-
return
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
allOptions: f,
|
|
67
|
-
selectedOptions: S,
|
|
68
|
-
isSelected: T,
|
|
69
|
-
isHighlighted: w,
|
|
70
|
-
toggleOption: H,
|
|
71
|
-
addOption: A,
|
|
58
|
+
return H({
|
|
59
|
+
popoverVisible: m,
|
|
60
|
+
allOptions: K,
|
|
61
|
+
selectedOptions: C,
|
|
62
|
+
isSelected: B,
|
|
63
|
+
isHighlighted: S,
|
|
64
|
+
toggleOption: $,
|
|
65
|
+
addOption: I,
|
|
72
66
|
removeOption: k,
|
|
73
|
-
highlightOption:
|
|
74
|
-
}), (e,
|
|
75
|
-
const r =
|
|
76
|
-
return
|
|
77
|
-
class:
|
|
78
|
-
style:
|
|
67
|
+
highlightOption: w
|
|
68
|
+
}), (e, o) => {
|
|
69
|
+
const r = _("InfoCircleFilled");
|
|
70
|
+
return a(), c("div", {
|
|
71
|
+
class: d([s(n)(), `${s(E)(s(M))}`]),
|
|
72
|
+
style: V({
|
|
79
73
|
...e.wrapperStyle,
|
|
80
74
|
"--ap-value-select-card-column-count": e.maxRowDisplay
|
|
81
75
|
})
|
|
82
76
|
}, [
|
|
83
|
-
|
|
84
|
-
open:
|
|
77
|
+
b(s(G), {
|
|
78
|
+
open: m.value,
|
|
85
79
|
trigger: "click",
|
|
86
80
|
placement: "bottomRight",
|
|
87
81
|
arrow: !1,
|
|
88
82
|
"get-popup-container": e.getContainer,
|
|
89
|
-
onOpenChange:
|
|
83
|
+
onOpenChange: z
|
|
90
84
|
}, {
|
|
91
|
-
content:
|
|
85
|
+
content: F(() => [
|
|
92
86
|
u("div", {
|
|
93
|
-
class:
|
|
87
|
+
class: d(s(n)("popover"))
|
|
94
88
|
}, [
|
|
95
|
-
e.popoverTitle ? (
|
|
89
|
+
e.popoverTitle ? (a(), c("div", {
|
|
96
90
|
key: 0,
|
|
97
|
-
class:
|
|
91
|
+
class: d(s(n)("title"))
|
|
98
92
|
}, [
|
|
99
|
-
e.showTitleIcon ? (
|
|
93
|
+
e.showTitleIcon ? (a(), j(r, {
|
|
100
94
|
key: 0,
|
|
101
|
-
class:
|
|
102
|
-
}, null, 8, ["class"])) :
|
|
95
|
+
class: d(s(n)("title-icon"))
|
|
96
|
+
}, null, 8, ["class"])) : y("", !0),
|
|
103
97
|
p(" " + g(e.popoverTitle), 1)
|
|
104
|
-
], 2)) :
|
|
98
|
+
], 2)) : y("", !0),
|
|
105
99
|
u("div", {
|
|
106
|
-
class:
|
|
100
|
+
class: d(s(n)("list"))
|
|
107
101
|
}, [
|
|
108
|
-
(
|
|
102
|
+
(a(!0), c(N, null, R(K.value, (t) => (a(), c("div", {
|
|
109
103
|
key: t.key,
|
|
110
|
-
class:
|
|
104
|
+
class: d([
|
|
111
105
|
s(n)("list-item"),
|
|
112
106
|
"all",
|
|
113
107
|
{
|
|
114
|
-
select:
|
|
108
|
+
select: B(t.key),
|
|
115
109
|
disabled: e.maxSelected && e.selectedKeys.length >= e.maxSelected
|
|
116
110
|
}
|
|
117
111
|
]),
|
|
118
|
-
onClick:
|
|
112
|
+
onClick: f((O) => $(t.key), ["stop"])
|
|
119
113
|
}, [
|
|
120
|
-
u("div",
|
|
114
|
+
u("div", X, [
|
|
121
115
|
h(e.$slots, "popover-label", { option: t }, () => [
|
|
122
116
|
p(g(t.label), 1)
|
|
123
117
|
])
|
|
124
118
|
]),
|
|
125
|
-
u("div",
|
|
119
|
+
u("div", Y, [
|
|
126
120
|
h(e.$slots, "popover-value", { option: t }, () => [
|
|
127
121
|
p(g(t.value), 1)
|
|
128
122
|
])
|
|
129
123
|
])
|
|
130
|
-
], 10,
|
|
124
|
+
], 10, W))), 128))
|
|
131
125
|
], 2)
|
|
132
126
|
], 2)
|
|
133
127
|
]),
|
|
134
|
-
default:
|
|
128
|
+
default: F(() => [
|
|
135
129
|
u("div", {
|
|
136
|
-
class:
|
|
130
|
+
class: d(s(n)("list"))
|
|
137
131
|
}, [
|
|
138
|
-
(
|
|
132
|
+
(a(!0), c(N, null, R(C.value, (t) => (a(), c("div", {
|
|
139
133
|
key: t.key,
|
|
140
134
|
ref_for: !0,
|
|
141
135
|
ref_key: "listItemRef",
|
|
142
|
-
ref:
|
|
143
|
-
class:
|
|
136
|
+
ref: P,
|
|
137
|
+
class: d([
|
|
144
138
|
s(n)("list-item"),
|
|
145
139
|
{
|
|
146
|
-
select:
|
|
140
|
+
select: S(t.key),
|
|
147
141
|
custom: t.customClass
|
|
148
142
|
},
|
|
149
143
|
t.customClass
|
|
150
144
|
]),
|
|
151
|
-
style:
|
|
152
|
-
onClick:
|
|
145
|
+
style: V(e.getCardStyle(t.key)),
|
|
146
|
+
onClick: f((O) => w(t.key), ["stop"])
|
|
153
147
|
}, [
|
|
154
|
-
e.showCloseIcon && (!(e.highlightedKeys.length === 1 &&
|
|
148
|
+
e.showCloseIcon && (!(e.highlightedKeys.length === 1 && S(t.key)) && C.value.length > 1) ? (a(), c("div", {
|
|
155
149
|
key: 0,
|
|
156
|
-
class:
|
|
157
|
-
onClick:
|
|
150
|
+
class: d(s(n)("list-item-close")),
|
|
151
|
+
onClick: f((O) => k(t.key), ["stop"])
|
|
158
152
|
}, [
|
|
159
153
|
h(e.$slots, "close-icon", {}, () => [
|
|
160
|
-
|
|
154
|
+
b(s(J))
|
|
161
155
|
])
|
|
162
|
-
], 10,
|
|
163
|
-
u("div",
|
|
156
|
+
], 10, x)) : y("", !0),
|
|
157
|
+
u("div", ee, [
|
|
164
158
|
h(e.$slots, "label", { option: t }, () => [
|
|
165
159
|
p(g(t.label), 1)
|
|
166
160
|
])
|
|
167
161
|
]),
|
|
168
|
-
u("div",
|
|
162
|
+
u("div", te, [
|
|
169
163
|
h(e.$slots, "value", { option: t }, () => [
|
|
170
164
|
p(g(t.value), 1)
|
|
171
165
|
])
|
|
172
166
|
])
|
|
173
|
-
], 14,
|
|
174
|
-
e.showAddButton && (!e.maxSelected || e.selectedKeys.length < e.maxSelected) ? (
|
|
167
|
+
], 14, Z))), 128)),
|
|
168
|
+
e.showAddButton && (!e.maxSelected || e.selectedKeys.length < e.maxSelected) ? (a(), c("div", {
|
|
175
169
|
key: 0,
|
|
176
|
-
class:
|
|
177
|
-
|
|
178
|
-
minHeight: `${O.value}px`
|
|
179
|
-
}),
|
|
180
|
-
onClick: i[0] || (i[0] = K((t) => y.value = !0, ["stop"]))
|
|
170
|
+
class: d([s(n)("list-item"), "choose"]),
|
|
171
|
+
onClick: o[0] || (o[0] = f((t) => m.value = !0, ["stop"]))
|
|
181
172
|
}, [
|
|
182
173
|
h(e.$slots, "add-button", {}, () => [
|
|
183
|
-
|
|
184
|
-
u("span",
|
|
174
|
+
b(s(q)),
|
|
175
|
+
u("span", le, g(e.addButtonText), 1)
|
|
185
176
|
])
|
|
186
|
-
],
|
|
177
|
+
], 2)) : y("", !0)
|
|
187
178
|
], 2)
|
|
188
179
|
]),
|
|
189
180
|
_: 3
|
|
@@ -193,5 +184,5 @@ const Y = ["onClick"], Z = { class: "label" }, x = { class: "value" }, ee = ["on
|
|
|
193
184
|
}
|
|
194
185
|
});
|
|
195
186
|
export {
|
|
196
|
-
|
|
187
|
+
ce as default
|
|
197
188
|
};
|
package/es/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "6.26.
|
|
1
|
+
declare const _default: "6.26.4";
|
|
2
2
|
export default _default;
|
package/es/src/version.mjs
CHANGED
package/lib/src/ag-grid/theme.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@aplus-frontend/antdv/es/theme/internal"),a=require("ag-grid-community"),i=require("vue"),l=(o,r)=>{const[,t]=n.useToken();return i.computed(()=>{const c=o.value==="mini",e=t.value;return a.themeQuartz.withParams({headerHeight:"36px",headerFontSize:"12px",dataFontSize:"12px",rowHeight:r.value,spacing:c?"5px":"6.5px",foregroundColor:e.colorTextBase,wrapperBorder:!1,rowBorder:{color:e.colorBorderSecondary},headerRowBorder:{color:e.colorBorderSecondary},selectedRowBackgroundColor:e.controlItemBgActive,checkboxCheckedBackgroundColor:e.colorPrimary,rowHoverColor:"var(--ap-color-bg-2)"})})};exports.useTheme=l;
|
|
@@ -54,7 +54,7 @@ export type CreateModalFuncReturn = {
|
|
|
54
54
|
close: () => void;
|
|
55
55
|
};
|
|
56
56
|
export type CreateModalFunc = (props: CreateModalFuncProps) => CreateModalFuncReturn;
|
|
57
|
-
export type ModalStreamNextFunc<ModalType extends ModalStreamTypeKey = ModalStreamTypeKey> = (option
|
|
57
|
+
export type ModalStreamNextFunc<ModalType extends ModalStreamTypeKey = ModalStreamTypeKey> = (option?: {
|
|
58
58
|
/**
|
|
59
59
|
* 下一步弹框的id
|
|
60
60
|
*/
|
|
@@ -77,7 +77,7 @@ export type ModalStreamNextFunc<ModalType extends ModalStreamTypeKey = ModalStre
|
|
|
77
77
|
* @returns
|
|
78
78
|
*/
|
|
79
79
|
handleModal?: (option: {
|
|
80
|
-
getModal: (modalId: string) => CreateModalFuncReturn;
|
|
80
|
+
getModal: (modalId: string) => CreateModalFuncReturn | ModalStreamFuncReturn;
|
|
81
81
|
}) => any | Promise<any>;
|
|
82
82
|
}) => any | Promise<any>;
|
|
83
83
|
export type ModalStreamType = {
|
|
@@ -147,5 +147,12 @@ export type CreateModalStreamProps<ModalType extends ModalStreamTypeKey = ModalS
|
|
|
147
147
|
*/
|
|
148
148
|
props: (params: any, next: ModalStreamNextFunc<ModalType>) => Promise<ModalStreamType[ModalType]>;
|
|
149
149
|
} : never;
|
|
150
|
-
export type CreateModalStreamFunc<ModalType extends ModalStreamTypeKey = ModalStreamTypeKey> = (streamList: CreateModalStreamProps<ModalType>[], firstModalId?: string) =>
|
|
150
|
+
export type CreateModalStreamFunc<ModalType extends ModalStreamTypeKey = ModalStreamTypeKey> = (streamList: CreateModalStreamProps<ModalType>[], firstModalId?: string) => {
|
|
151
|
+
/** 获取弹框实例 */
|
|
152
|
+
getModal: (modalId: string) => CreateModalFuncReturn | ModalStreamFuncReturn;
|
|
153
|
+
/** 清空弹框 */
|
|
154
|
+
clearAllModal: () => void;
|
|
155
|
+
/** 下一步 */
|
|
156
|
+
next: ModalStreamNextFunc<ModalType>;
|
|
157
|
+
} | undefined;
|
|
151
158
|
export type ApModalType = keyof Omit<ModalStaticFunctions, 'warn'>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("@aplus-frontend/utils"),_=require("./createModal.js"),I=require("@aplus-frontend/antdv"),O=require("../enums/modalMessage.js"),T=(f,S)=>{const m=S??(Array.isArray(f)?f[0]?.modalId:void 0),o=new Map;let x,p,c=1e3;const y=async({modalId:r,params:s,handleCurrentModal:M,handleModal:w}={})=>{if(!N.isValid(r)){d();return}x=s;const l=f.find(t=>t.modalId===r);let i=!1;if(p){const t=o.get(p),n={...t,destroy:()=>{t?.destroy?.(),o.delete(p)},open:()=>{i=!0}};await M?.(n),await w?.({getModal:o.get.bind(o)})}return l&&setTimeout(()=>{g(l)}),i},d=()=>{for(const[r,s]of o)s?.destroy?.()},g=async r=>{const{modalId:s,modalType:M="createModal",props:w}=r;p=s;const l=o.get(s),i=await w?.(x,async e=>(n=!0,await y(e)));c=Math.max(i?.zIndex??0,c),c+=1;let t,n=!1;if(M==="createModal"){const e=i,u=async a=>(n=!0,await y(a));t={...e,destroyOnClose:!1,zIndex:c,onOk:async a=>{const E=await e?.onOk?.(a,u);if(n||d(),E)throw new Error(O.ModalMessage.NOT_NEED_CLOSE)},onCancel:async a=>{const E=await e?.onCancel?.(a,u);if(n||d(),E)throw new Error(O.ModalMessage.NOT_NEED_CLOSE)}}}else{const e=i,u=async a=>(n=!0,await y(a));t={...e,zIndex:c,onOk:async()=>{const a=await e?.onOk?.(u);if(n||d(),a)throw new Error(O.ModalMessage.NOT_NEED_CLOSE)},onCancel:async()=>{const a=await e?.onCancel?.(u);if(n||d(),a)throw new Error(O.ModalMessage.NOT_NEED_CLOSE)}}}if(l){l?.update(t),l?.open?.();return}else if(M==="createModal"){const e=_.createModal(t);e?.open?.(),o.set(s,e)}else I.Modal?.[M]?.(t)},C=f.find(r=>N.isValid(m)&&r.modalId===m);if(C!==void 0)return g(C),{getModal:o.get.bind(o),clearAllModal:d,next:y}};exports.createModalStream=T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),V=require("@aplus-frontend/antdv"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),V=require("@aplus-frontend/antdv"),w=require("@ant-design/icons-vue"),E=require("@aplus-frontend/icon");require("../../config-provider/index.js");const b=require("../../config-provider/hooks/use-namespace.js"),T=require("../../config-provider/hooks/use-global-config.js"),z=["onClick"],$={class:"label"},I={class:"value"},O=["onClick"],D=["onClick"],M={class:"label"},q={class:"value"},A={class:"text"},F=e.defineComponent({name:"ApValueSelectCard",__name:"index",props:{options:{},selectedKeys:{default:()=>[]},highlightedKeys:{default:()=>[]},maxSelected:{default:4},maxRowDisplay:{default:4},popoverTitle:{default:""},showTitleIcon:{type:Boolean,default:!0},showCloseIcon:{type:Boolean,default:!0},showAddButton:{type:Boolean,default:!0},addButtonText:{default:""},getContainer:{type:Function,default:c=>c.parentElement||document.body},getCardStyle:{type:Function,default:()=>({})},wrapperStyle:{type:[Boolean,null,String,Object,Array]}},emits:["update:selectedKeys","update:highlightedKeys","change","select","remove","highlight"],setup(c,{expose:C,emit:k}){const n=k,s=c,{b:i,m:S}=b.useNamespace("ap-value-select-card"),K=T.useGlobalConfig("uiMode","aplus"),B=e.ref(null),a=e.ref(!1),d=e.computed(()=>s.options),u=e.computed(()=>d.value.filter(t=>s.selectedKeys.includes(t.key))),p=t=>s.selectedKeys.includes(t),h=t=>s.highlightedKeys.includes(t),f=t=>{s.selectedKeys.includes(t)?g(t):y(t)},y=t=>{if(s.maxSelected&&s.selectedKeys.length>=s.maxSelected)return;const o=[...s.selectedKeys,t];n("update:selectedKeys",o),n("change",o),n("select",t),s.highlightedKeys.includes(t)||m(t)},g=t=>{if(s.selectedKeys.length<=1||s.highlightedKeys.length<=1&&s.highlightedKeys.includes(t))return;const o=s.selectedKeys.filter(r=>r!==t);if(n("update:selectedKeys",o),n("change",o),n("remove",t),s.highlightedKeys.includes(t)){const r=s.highlightedKeys.filter(l=>l!==t);n("update:highlightedKeys",r),n("highlight",r)}},m=t=>{let o;if(s.highlightedKeys.includes(t))if(s.highlightedKeys.length>1)o=s.highlightedKeys.filter(r=>r!==t);else return;else o=[...s.highlightedKeys,t];n("update:highlightedKeys",o),n("highlight",o)},N=t=>{t||(a.value=t)};return C({popoverVisible:a,allOptions:d,selectedOptions:u,isSelected:p,isHighlighted:h,toggleOption:f,addOption:y,removeOption:g,highlightOption:m}),(t,o)=>{const r=e.resolveComponent("InfoCircleFilled");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(i)(),`${e.unref(S)(e.unref(K))}`]),style:e.normalizeStyle({...t.wrapperStyle,"--ap-value-select-card-column-count":t.maxRowDisplay})},[e.createVNode(e.unref(V.Popover),{open:a.value,trigger:"click",placement:"bottomRight",arrow:!1,"get-popup-container":t.getContainer,onOpenChange:N},{content:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(i)("popover"))},[t.popoverTitle?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(i)("title"))},[t.showTitleIcon?(e.openBlock(),e.createBlock(r,{key:0,class:e.normalizeClass(e.unref(i)("title-icon"))},null,8,["class"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.popoverTitle),1)],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(i)("list"))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,l=>(e.openBlock(),e.createElementBlock("div",{key:l.key,class:e.normalizeClass([e.unref(i)("list-item"),"all",{select:p(l.key),disabled:t.maxSelected&&t.selectedKeys.length>=t.maxSelected}]),onClick:e.withModifiers(v=>f(l.key),["stop"])},[e.createElementVNode("div",$,[e.renderSlot(t.$slots,"popover-label",{option:l},()=>[e.createTextVNode(e.toDisplayString(l.label),1)])]),e.createElementVNode("div",I,[e.renderSlot(t.$slots,"popover-value",{option:l},()=>[e.createTextVNode(e.toDisplayString(l.value),1)])])],10,z))),128))],2)],2)]),default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(i)("list"))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,l=>(e.openBlock(),e.createElementBlock("div",{key:l.key,ref_for:!0,ref_key:"listItemRef",ref:B,class:e.normalizeClass([e.unref(i)("list-item"),{select:h(l.key),custom:l.customClass},l.customClass]),style:e.normalizeStyle(t.getCardStyle(l.key)),onClick:e.withModifiers(v=>m(l.key),["stop"])},[t.showCloseIcon&&(!(t.highlightedKeys.length===1&&h(l.key))&&u.value.length>1)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(i)("list-item-close")),onClick:e.withModifiers(v=>g(l.key),["stop"])},[e.renderSlot(t.$slots,"close-icon",{},()=>[e.createVNode(e.unref(E.IconApAdLinePoor))])],10,D)):e.createCommentVNode("",!0),e.createElementVNode("div",M,[e.renderSlot(t.$slots,"label",{option:l},()=>[e.createTextVNode(e.toDisplayString(l.label),1)])]),e.createElementVNode("div",q,[e.renderSlot(t.$slots,"value",{option:l},()=>[e.createTextVNode(e.toDisplayString(l.value),1)])])],14,O))),128)),t.showAddButton&&(!t.maxSelected||t.selectedKeys.length<t.maxSelected)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([e.unref(i)("list-item"),"choose"]),onClick:o[0]||(o[0]=e.withModifiers(l=>a.value=!0,["stop"]))},[e.renderSlot(t.$slots,"add-button",{},()=>[e.createVNode(e.unref(w.PlusOutlined)),e.createElementVNode("span",A,e.toDisplayString(t.addButtonText),1)])],2)):e.createCommentVNode("",!0)],2)]),_:3},8,["open","get-popup-container"])],6)}}});exports.default=F;
|
package/lib/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "6.26.
|
|
1
|
+
declare const _default: "6.26.4";
|
|
2
2
|
export default _default;
|
package/lib/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="6.26.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="6.26.4";exports.default=e;
|
package/package.json
CHANGED
package/theme/ag-grid/index.css
CHANGED
package/theme/ag-grid/index.less
CHANGED
|
@@ -151,4 +151,16 @@
|
|
|
151
151
|
.ag-tooltip {
|
|
152
152
|
max-width: 300px;
|
|
153
153
|
}
|
|
154
|
+
// .ag-pinned-left-header, .ag-pinned-left-cols-container {
|
|
155
|
+
// z-index: 1;
|
|
156
|
+
// box-shadow: 8px 0px 10px -5px var(--ap-grid-fixed-scrolling-box-shadow-color);
|
|
157
|
+
// border-right-color: transparent !important;
|
|
158
|
+
// }
|
|
159
|
+
// .ag-cell-last-left-pinned {
|
|
160
|
+
// border-right-color: transparent !important;
|
|
161
|
+
// }
|
|
162
|
+
.ag-unselectable {
|
|
163
|
+
user-select: text;
|
|
164
|
+
-webkit-user-select: text;
|
|
165
|
+
}
|
|
154
166
|
});
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
.aplus-ap-value-select-card-list {
|
|
55
55
|
display: grid;
|
|
56
56
|
grid-template-columns: repeat(var(--ap-value-select-card-column-count, 5), minmax(var(--ap-value-select-card-max-width, 150px), 1fr));
|
|
57
|
+
grid-auto-rows: 1fr;
|
|
57
58
|
gap: 12px;
|
|
58
59
|
}
|
|
59
60
|
.aplus-ap-value-select-card-list-item {
|
|
@@ -64,7 +65,6 @@
|
|
|
64
65
|
border: 1px solid var(--ap-color-bg);
|
|
65
66
|
border-radius: 4px;
|
|
66
67
|
cursor: pointer;
|
|
67
|
-
transition: all 0.2s ease-in-out;
|
|
68
68
|
}
|
|
69
69
|
.aplus-ap-value-select-card-list-item-close {
|
|
70
70
|
position: absolute;
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
&-list {
|
|
14
14
|
display: grid;
|
|
15
15
|
grid-template-columns: repeat(var(--ap-value-select-card-column-count, 5), minmax(var(--ap-value-select-card-max-width, 150px), 1fr));
|
|
16
|
+
grid-auto-rows: 1fr;
|
|
16
17
|
gap: 12px;
|
|
17
18
|
|
|
18
19
|
&-item {
|
|
@@ -23,7 +24,7 @@
|
|
|
23
24
|
border: 1px solid var(--ap-color-bg);
|
|
24
25
|
border-radius: @border-radius;
|
|
25
26
|
cursor: pointer;
|
|
26
|
-
transition: all 0.2s ease-in-out;
|
|
27
|
+
// transition: all 0.2s ease-in-out;
|
|
27
28
|
|
|
28
29
|
&-close {
|
|
29
30
|
position: absolute;
|
package/theme/index.css
CHANGED
|
@@ -4378,6 +4378,11 @@ div.aplus-ap-info-layout-admin__header-shadow.aplus-ap-info-layout-admin__sticky
|
|
|
4378
4378
|
.aplus-ag-grid .ag-tooltip {
|
|
4379
4379
|
max-width: 300px;
|
|
4380
4380
|
}
|
|
4381
|
+
.aplus-ag-grid .ag-unselectable {
|
|
4382
|
+
-moz-user-select: text;
|
|
4383
|
+
user-select: text;
|
|
4384
|
+
-webkit-user-select: text;
|
|
4385
|
+
}
|
|
4381
4386
|
.aplus-ap-value-select-card {
|
|
4382
4387
|
position: relative;
|
|
4383
4388
|
margin-top: 8px;
|
|
@@ -4388,6 +4393,7 @@ div.aplus-ap-info-layout-admin__header-shadow.aplus-ap-info-layout-admin__sticky
|
|
|
4388
4393
|
.aplus-ap-value-select-card-list {
|
|
4389
4394
|
display: grid;
|
|
4390
4395
|
grid-template-columns: repeat(var(--ap-value-select-card-column-count, 5), minmax(var(--ap-value-select-card-max-width, 150px), 1fr));
|
|
4396
|
+
grid-auto-rows: 1fr;
|
|
4391
4397
|
gap: 12px;
|
|
4392
4398
|
}
|
|
4393
4399
|
.aplus-ap-value-select-card-list-item {
|
|
@@ -4398,7 +4404,6 @@ div.aplus-ap-info-layout-admin__header-shadow.aplus-ap-info-layout-admin__sticky
|
|
|
4398
4404
|
border: 1px solid var(--ap-color-bg);
|
|
4399
4405
|
border-radius: 4px;
|
|
4400
4406
|
cursor: pointer;
|
|
4401
|
-
transition: all 0.2s ease-in-out;
|
|
4402
4407
|
}
|
|
4403
4408
|
.aplus-ap-value-select-card-list-item-close {
|
|
4404
4409
|
position: absolute;
|