@guodun/antdv 1.6.1 → 1.6.3
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/dist/es/components/dept-selector/src/DeptSelector.vue.mjs +52 -53
- package/dist/es/components/dept-selector/src/types.mjs +4 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateAuthoringBar.vue.mjs +67 -106
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +791 -794
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-authoring.mjs +2 -9
- package/dist/es/components/pro-contract-template-designer/src/extensions/editor-extensions.mjs +34 -36
- package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/es/components/pro-menu-tree/src/pro-menu-tree.mjs +108 -103
- package/dist/es/components/pro-menu-tree/src/types.mjs +4 -0
- package/dist/es/components/pro-selector/src/ProUserSelector.vue.mjs +52 -53
- package/dist/es/components/pro-selector/src/types.mjs +4 -0
- package/dist/es/components/pro-selector-group/src/index.vue.mjs +50 -48
- package/dist/es/components/pro-selector-group/src/utils/index.mjs +2 -2
- package/dist/es/components/role-selector/src/RoleSelector.vue.mjs +51 -52
- package/dist/es/components/role-selector/src/types.mjs +4 -0
- package/dist/es/components/selector-core/components/SelectionChips.mjs +5 -0
- package/dist/es/components/selector-core/components/SelectionChips.vue.mjs +114 -0
- package/dist/es/components/selector-core/components/SelectorDialog.vue.mjs +242 -233
- package/dist/es/components/selector-core/selection-theme.mjs +35 -0
- package/dist/lib/components/dept-selector/src/DeptSelector.vue.cjs +1 -1
- package/dist/lib/components/dept-selector/src/types.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateAuthoringBar.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-authoring.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/extensions/editor-extensions.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/lib/components/pro-menu-tree/src/pro-menu-tree.cjs +1 -1
- package/dist/lib/components/pro-menu-tree/src/types.cjs +1 -1
- package/dist/lib/components/pro-selector/src/ProUserSelector.vue.cjs +1 -1
- package/dist/lib/components/pro-selector/src/types.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/index.vue.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/utils/index.cjs +1 -1
- package/dist/lib/components/role-selector/src/RoleSelector.vue.cjs +1 -1
- package/dist/lib/components/role-selector/src/types.cjs +1 -1
- package/dist/lib/components/selector-core/components/SelectionChips.cjs +1 -0
- package/dist/lib/components/selector-core/components/SelectionChips.vue.cjs +1 -0
- package/dist/lib/components/selector-core/components/SelectorDialog.vue.cjs +1 -1
- package/dist/lib/components/selector-core/selection-theme.cjs +1 -0
- package/dist/theme/icon.css +1 -1
- package/dist/theme/index.css +1 -1
- package/dist/theme/pro-dynamic-tags.css +1 -1
- package/dist/theme/pro-menu-tree.css +1 -1
- package/dist/theme/selector-core.css +1 -1
- package/dist/types/components/dept-selector/index.d.ts +15 -0
- package/dist/types/components/dept-selector/src/DeptSelector.vue.d.ts +9 -0
- package/dist/types/components/dept-selector/src/types.d.ts +7 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateAuthoringBar.vue.d.ts +0 -3
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.vue.d.ts +2 -2
- package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +0 -3
- package/dist/types/components/pro-contract-template-designer/src/composables/use-template-authoring.d.ts +2 -4
- package/dist/types/components/pro-contract-template-designer/src/constants.d.ts +0 -3
- package/dist/types/components/pro-contract-template-designer/src/types.d.ts +0 -4
- package/dist/types/components/pro-dynamic-tags/src/index.vue.d.ts +2 -2
- package/dist/types/components/pro-menu-tree/index.d.ts +9 -0
- package/dist/types/components/pro-menu-tree/src/pro-menu-tree.d.ts +9 -0
- package/dist/types/components/pro-menu-tree/src/types.d.ts +7 -0
- package/dist/types/components/pro-selector/index.d.ts +59 -2
- package/dist/types/components/pro-selector/src/ProUserSelector.vue.d.ts +9 -0
- package/dist/types/components/pro-selector/src/ProUserSelectorDrilldown.vue.d.ts +28 -4
- package/dist/types/components/pro-selector/src/types.d.ts +7 -0
- package/dist/types/components/pro-selector-group/index.d.ts +3 -0
- package/dist/types/components/pro-selector-group/src/index.vue.d.ts +1 -0
- package/dist/types/components/pro-selector-group/src/types.d.ts +5 -0
- package/dist/types/components/pro-selector-group/src/utils/index.d.ts +1 -1
- package/dist/types/components/role-selector/index.d.ts +30 -0
- package/dist/types/components/role-selector/src/RoleSelector.vue.d.ts +9 -0
- package/dist/types/components/role-selector/src/types.d.ts +7 -0
- package/dist/types/components/selector-core/components/SelectionChips.vue.d.ts +16 -0
- package/dist/types/components/selector-core/components/SelectorDialog.vue.d.ts +2 -0
- package/dist/types/components/selector-core/selection-theme.d.ts +20 -0
- package/package.json +3 -3
- package/dist/es/components/pro-contract-template-designer/src/utils/clause-snippets.mjs +0 -56
- package/dist/lib/components/pro-contract-template-designer/src/utils/clause-snippets.cjs +0 -1
- package/dist/types/components/pro-contract-template-designer/src/utils/clause-snippets.d.ts +0 -10
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
import e from "../../
|
|
2
|
-
import {
|
|
1
|
+
import { serializeRoles as e, text as t } from "../../selector-core/model.mjs";
|
|
2
|
+
import { createSelectionTheme as n } from "../../selector-core/selection-theme.mjs";
|
|
3
3
|
import r from "../../selector-core/components/SelectorDialog.mjs";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import i from "../../selector-core/components/SelectionChips.mjs";
|
|
5
|
+
import { roleSelectorEmits as a, roleSelectorProps as o } from "./types.mjs";
|
|
6
|
+
import { computed as s, createBlock as c, createCommentVNode as l, createElementVNode as u, createVNode as d, defineComponent as f, normalizeStyle as p, openBlock as m, renderSlot as h, unref as g, useAttrs as _, withCtx as v } from "vue";
|
|
7
|
+
import { FormItemRest as y } from "ant-design-vue";
|
|
7
8
|
//#region src/components/role-selector/src/RoleSelector.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
-
var
|
|
9
|
+
var b = /* @__PURE__ */ f({
|
|
9
10
|
name: "KRoleSelector",
|
|
10
11
|
__name: "RoleSelector",
|
|
11
|
-
props:
|
|
12
|
-
emits:
|
|
13
|
-
setup(
|
|
14
|
-
let
|
|
12
|
+
props: o,
|
|
13
|
+
emits: a,
|
|
14
|
+
setup(a, { emit: o }) {
|
|
15
|
+
let f = a, b = o, x = _(), S = s(() => n(f.activeColor)), C = s(() => (Array.isArray(f.modelValue) ? f.modelValue : f.modelValue ? [f.modelValue] : []).map((e) => ({
|
|
15
16
|
type: "role",
|
|
16
|
-
value:
|
|
17
|
+
value: t(e.value),
|
|
17
18
|
label: e.label || "",
|
|
18
19
|
raw: e
|
|
19
|
-
}))),
|
|
20
|
-
|
|
21
|
-
value: e.value,
|
|
22
|
-
closable: !0
|
|
23
|
-
}))), C = o(() => {
|
|
24
|
-
let { modalProps: e, ...t } = b;
|
|
20
|
+
}))), w = s(() => {
|
|
21
|
+
let { modalProps: e, ...t } = x;
|
|
25
22
|
return {
|
|
26
23
|
cancelText: "取消",
|
|
27
24
|
okText: "确定",
|
|
@@ -29,48 +26,49 @@ var v = { class: "gd-ant-role-selector" }, y = /* @__PURE__ */ d({
|
|
|
29
26
|
...e || {}
|
|
30
27
|
};
|
|
31
28
|
});
|
|
32
|
-
function w(e) {
|
|
33
|
-
y("update:visible", e === !0);
|
|
34
|
-
}
|
|
35
29
|
function T(e) {
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
b("update:visible", e === !0);
|
|
31
|
+
}
|
|
32
|
+
function E(t) {
|
|
33
|
+
let n = e(t), r = f.type === "radio" ? n[0] || null : n;
|
|
34
|
+
b("update:visible", !1), b("update:modelValue", r), b("confirm", n);
|
|
38
35
|
}
|
|
39
|
-
function
|
|
40
|
-
|
|
36
|
+
function D() {
|
|
37
|
+
b("update:visible", !1), b("cancel");
|
|
41
38
|
}
|
|
42
|
-
function
|
|
43
|
-
if (
|
|
44
|
-
|
|
39
|
+
function O(e) {
|
|
40
|
+
if (f.type === "radio") {
|
|
41
|
+
b("update:modelValue", null);
|
|
45
42
|
return;
|
|
46
43
|
}
|
|
47
|
-
|
|
44
|
+
b("update:modelValue", (Array.isArray(f.modelValue) ? f.modelValue : []).filter((t) => t.value !== e));
|
|
48
45
|
}
|
|
49
|
-
return (
|
|
50
|
-
default:
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
46
|
+
return (e, t) => (m(), c(g(y), null, {
|
|
47
|
+
default: v(() => [u("div", {
|
|
48
|
+
class: "gd-ant-role-selector",
|
|
49
|
+
style: p(S.value.style)
|
|
50
|
+
}, [f.hideSlot ? l("", !0) : h(e.$slots, "default", { key: 0 }, () => [d(i, {
|
|
51
|
+
items: C.value,
|
|
52
|
+
"max-visible-count": f.maxVisibleCount,
|
|
54
53
|
"add-text": "选择角色",
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}, null, 8, ["model-value", "max-count"])]), u(r, {
|
|
60
|
-
open: d.visible,
|
|
54
|
+
onAdd: t[0] ||= (e) => b("update:visible", !0),
|
|
55
|
+
onRemove: t[1] ||= (e) => O(e.value)
|
|
56
|
+
}, null, 8, ["items", "max-visible-count"])]), d(r, {
|
|
57
|
+
open: f.visible,
|
|
61
58
|
mode: "role",
|
|
62
|
-
selected:
|
|
63
|
-
selection:
|
|
59
|
+
selected: C.value,
|
|
60
|
+
selection: f.type,
|
|
64
61
|
title: "选择角色",
|
|
65
|
-
"role-options":
|
|
66
|
-
http:
|
|
67
|
-
prefix:
|
|
68
|
-
"is-built-in-request":
|
|
69
|
-
"value-field":
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
|
|
73
|
-
|
|
62
|
+
"role-options": f.options,
|
|
63
|
+
http: f.http,
|
|
64
|
+
prefix: f.prefix,
|
|
65
|
+
"is-built-in-request": f.isBuiltInRequest,
|
|
66
|
+
"value-field": f.valueField,
|
|
67
|
+
"active-color": f.activeColor,
|
|
68
|
+
"modal-props": w.value,
|
|
69
|
+
"onUpdate:open": T,
|
|
70
|
+
onConfirm: E,
|
|
71
|
+
onCancel: D
|
|
74
72
|
}, null, 8, [
|
|
75
73
|
"open",
|
|
76
74
|
"selected",
|
|
@@ -80,11 +78,12 @@ var v = { class: "gd-ant-role-selector" }, y = /* @__PURE__ */ d({
|
|
|
80
78
|
"prefix",
|
|
81
79
|
"is-built-in-request",
|
|
82
80
|
"value-field",
|
|
81
|
+
"active-color",
|
|
83
82
|
"modal-props"
|
|
84
|
-
])])]),
|
|
83
|
+
])], 4)]),
|
|
85
84
|
_: 3
|
|
86
85
|
}));
|
|
87
86
|
}
|
|
88
87
|
});
|
|
89
88
|
//#endregion
|
|
90
|
-
export {
|
|
89
|
+
export { b as default };
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import e from "../../icon/src/icon.mjs";
|
|
2
|
+
import { entityKey as t } from "../model.mjs";
|
|
3
|
+
import n from "../../pro-user-avatar/src/index.mjs";
|
|
4
|
+
import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createVNode as l, defineComponent as u, normalizeClass as d, openBlock as f, renderList as p, toDisplayString as m, unref as h, withCtx as g, withModifiers as _ } from "vue";
|
|
5
|
+
import { Popover as v } from "ant-design-vue";
|
|
6
|
+
//#region src/components/selector-core/components/SelectionChips.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
+
var y = { class: "gd-ant-selector__confirmed" }, b = { class: "gd-ant-selector__confirmed-chips" }, x = ["title"], S = ["aria-label", "onClick"], C = { class: "gd-ant-selector__confirmed-actions" }, w = {
|
|
8
|
+
class: "gd-ant-selector__confirmed-popover-content",
|
|
9
|
+
"aria-label": "隐藏的已选择项"
|
|
10
|
+
}, T = ["title"], E = ["aria-label", "onClick"], D = ["title", "aria-label"], O = ["aria-label"], k = /* @__PURE__ */ u({
|
|
11
|
+
__name: "SelectionChips",
|
|
12
|
+
props: {
|
|
13
|
+
items: {},
|
|
14
|
+
maxVisibleCount: { default: 5 },
|
|
15
|
+
addText: {}
|
|
16
|
+
},
|
|
17
|
+
emits: ["add", "remove"],
|
|
18
|
+
setup(u) {
|
|
19
|
+
let k = u, A = i(() => {
|
|
20
|
+
let e = k.maxVisibleCount;
|
|
21
|
+
return Number.isFinite(e) && e >= 0 ? Math.floor(e) : 5;
|
|
22
|
+
}), j = i(() => k.items.slice(0, A.value)), M = i(() => k.items.slice(A.value)), N = i(() => `另有 ${M.value.length} 项:${M.value.map((e) => e.label || "未命名").join("、")}`);
|
|
23
|
+
return (i, k) => (f(), s("div", y, [c("div", b, [(f(!0), s(r, null, p(j.value, (r) => (f(), s("div", {
|
|
24
|
+
key: h(t)(r),
|
|
25
|
+
class: d(["gd-ant-selector__confirmed-chip", `gd-ant-selector__confirmed-chip--${r.type}`])
|
|
26
|
+
}, [
|
|
27
|
+
r.type === "user" ? (f(), a(n, {
|
|
28
|
+
key: 0,
|
|
29
|
+
name: r.label,
|
|
30
|
+
avatar: r.avatar,
|
|
31
|
+
preview: !1,
|
|
32
|
+
size: "small"
|
|
33
|
+
}, null, 8, ["name", "avatar"])) : (f(), s("span", {
|
|
34
|
+
key: 1,
|
|
35
|
+
class: d(["gd-ant-selector__confirmed-chip-icon", `gd-ant-selector__confirmed-chip-icon--${r.type}`])
|
|
36
|
+
}, [l(e, {
|
|
37
|
+
name: r.type === "dept" ? "bumen" : "a-jiaoseguanli2",
|
|
38
|
+
size: 14,
|
|
39
|
+
"aria-hidden": "true"
|
|
40
|
+
}, null, 8, ["name"])], 2)),
|
|
41
|
+
c("span", {
|
|
42
|
+
class: "gd-ant-selector__confirmed-chip-label",
|
|
43
|
+
title: r.label || "未命名"
|
|
44
|
+
}, m(r.label || "未命名"), 9, x),
|
|
45
|
+
c("button", {
|
|
46
|
+
type: "button",
|
|
47
|
+
class: "gd-ant-selector__confirmed-chip-remove",
|
|
48
|
+
"aria-label": `移除已选择的${r.label || "未命名"}`,
|
|
49
|
+
onClick: _((e) => i.$emit("remove", r), ["stop"])
|
|
50
|
+
}, [l(e, {
|
|
51
|
+
name: "guanbi",
|
|
52
|
+
size: 10,
|
|
53
|
+
"aria-hidden": "true"
|
|
54
|
+
})], 8, S)
|
|
55
|
+
], 2))), 128))]), c("div", C, [M.value.length ? (f(), a(h(v), {
|
|
56
|
+
key: 0,
|
|
57
|
+
placement: "top",
|
|
58
|
+
trigger: "click",
|
|
59
|
+
"overlay-class-name": "gd-ant-selector__confirmed-popover"
|
|
60
|
+
}, {
|
|
61
|
+
content: g(() => [c("div", w, [(f(!0), s(r, null, p(M.value, (r) => (f(), s("div", {
|
|
62
|
+
key: h(t)(r),
|
|
63
|
+
class: d(["gd-ant-selector__confirmed-chip", `gd-ant-selector__confirmed-chip--${r.type}`])
|
|
64
|
+
}, [
|
|
65
|
+
r.type === "user" ? (f(), a(n, {
|
|
66
|
+
key: 0,
|
|
67
|
+
name: r.label,
|
|
68
|
+
avatar: r.avatar,
|
|
69
|
+
preview: !1,
|
|
70
|
+
size: "small"
|
|
71
|
+
}, null, 8, ["name", "avatar"])) : (f(), s("span", {
|
|
72
|
+
key: 1,
|
|
73
|
+
class: d(["gd-ant-selector__confirmed-chip-icon", `gd-ant-selector__confirmed-chip-icon--${r.type}`])
|
|
74
|
+
}, [l(e, {
|
|
75
|
+
name: r.type === "dept" ? "bumen" : "a-jiaoseguanli2",
|
|
76
|
+
size: 14,
|
|
77
|
+
"aria-hidden": "true"
|
|
78
|
+
}, null, 8, ["name"])], 2)),
|
|
79
|
+
c("span", {
|
|
80
|
+
class: "gd-ant-selector__confirmed-chip-label",
|
|
81
|
+
title: r.label || "未命名"
|
|
82
|
+
}, m(r.label || "未命名"), 9, T),
|
|
83
|
+
c("button", {
|
|
84
|
+
type: "button",
|
|
85
|
+
class: "gd-ant-selector__confirmed-chip-remove",
|
|
86
|
+
"aria-label": `移除已选择的${r.label || "未命名"}`,
|
|
87
|
+
onClick: _((e) => i.$emit("remove", r), ["stop"])
|
|
88
|
+
}, [l(e, {
|
|
89
|
+
name: "guanbi",
|
|
90
|
+
size: 10,
|
|
91
|
+
"aria-hidden": "true"
|
|
92
|
+
})], 8, E)
|
|
93
|
+
], 2))), 128))])]),
|
|
94
|
+
default: g(() => [c("button", {
|
|
95
|
+
type: "button",
|
|
96
|
+
class: "gd-ant-selector__confirmed-more",
|
|
97
|
+
title: N.value,
|
|
98
|
+
"aria-label": `查看隐藏的已选择项,共 ${M.value.length} 项`
|
|
99
|
+
}, " +" + m(M.value.length), 9, D)]),
|
|
100
|
+
_: 1
|
|
101
|
+
})) : o("", !0), c("button", {
|
|
102
|
+
type: "button",
|
|
103
|
+
class: "gd-ant-selector__confirmed-add",
|
|
104
|
+
"aria-label": u.items.length ? "继续选择" : u.addText,
|
|
105
|
+
onClick: k[0] ||= (e) => i.$emit("add")
|
|
106
|
+
}, [l(e, {
|
|
107
|
+
name: "plus",
|
|
108
|
+
size: 15,
|
|
109
|
+
"aria-hidden": "true"
|
|
110
|
+
}), c("span", null, m(u.items.length ? "继续选择" : u.addText), 1)], 8, O)])]));
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
//#endregion
|
|
114
|
+
export { k as default };
|