@guodun/antdv 1.6.2 → 1.6.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.
Files changed (69) hide show
  1. package/dist/es/components/dept-selector/src/DeptSelector.vue.mjs +52 -46
  2. package/dist/es/components/dept-selector/src/types.mjs +4 -0
  3. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateAuthoringBar.vue.mjs +67 -106
  4. package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +791 -794
  5. package/dist/es/components/pro-contract-template-designer/src/composables/use-template-authoring.mjs +2 -9
  6. package/dist/es/components/pro-contract-template-designer/src/extensions/editor-extensions.mjs +34 -36
  7. package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
  8. package/dist/es/components/pro-menu-tree/src/pro-menu-tree.mjs +108 -103
  9. package/dist/es/components/pro-menu-tree/src/types.mjs +4 -0
  10. package/dist/es/components/pro-selector/src/ProUserSelector.vue.mjs +50 -44
  11. package/dist/es/components/pro-selector/src/types.mjs +4 -0
  12. package/dist/es/components/pro-selector-group/src/index.vue.mjs +47 -40
  13. package/dist/es/components/role-selector/src/RoleSelector.vue.mjs +50 -44
  14. package/dist/es/components/role-selector/src/types.mjs +5 -1
  15. package/dist/es/components/selector-core/components/SelectorDialog.vue.mjs +242 -233
  16. package/dist/es/components/selector-core/selection-theme.mjs +35 -0
  17. package/dist/es/components/selector-core/useSelectorData.mjs +1 -1
  18. package/dist/lib/components/dept-selector/src/DeptSelector.vue.cjs +1 -1
  19. package/dist/lib/components/dept-selector/src/types.cjs +1 -1
  20. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateAuthoringBar.vue.cjs +1 -1
  21. package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
  22. package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-authoring.cjs +1 -1
  23. package/dist/lib/components/pro-contract-template-designer/src/extensions/editor-extensions.cjs +1 -1
  24. package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
  25. package/dist/lib/components/pro-menu-tree/src/pro-menu-tree.cjs +1 -1
  26. package/dist/lib/components/pro-menu-tree/src/types.cjs +1 -1
  27. package/dist/lib/components/pro-selector/src/ProUserSelector.vue.cjs +1 -1
  28. package/dist/lib/components/pro-selector/src/types.cjs +1 -1
  29. package/dist/lib/components/pro-selector-group/src/index.vue.cjs +1 -1
  30. package/dist/lib/components/role-selector/src/RoleSelector.vue.cjs +1 -1
  31. package/dist/lib/components/role-selector/src/types.cjs +1 -1
  32. package/dist/lib/components/selector-core/components/SelectorDialog.vue.cjs +1 -1
  33. package/dist/lib/components/selector-core/selection-theme.cjs +1 -0
  34. package/dist/lib/components/selector-core/useSelectorData.cjs +1 -1
  35. package/dist/theme/dept-selector.css +1 -0
  36. package/dist/theme/icon.css +1 -1
  37. package/dist/theme/index.css +1 -1
  38. package/dist/theme/pro-menu-tree.css +1 -1
  39. package/dist/theme/pro-selector-group.css +1 -0
  40. package/dist/theme/role-selector.css +1 -0
  41. package/dist/theme/selector-core.css +1 -1
  42. package/dist/types/components/dept-selector/index.d.ts +15 -0
  43. package/dist/types/components/dept-selector/src/DeptSelector.vue.d.ts +9 -0
  44. package/dist/types/components/dept-selector/src/types.d.ts +7 -0
  45. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateAuthoringBar.vue.d.ts +0 -3
  46. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.vue.d.ts +2 -2
  47. package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +0 -3
  48. package/dist/types/components/pro-contract-template-designer/src/composables/use-template-authoring.d.ts +2 -4
  49. package/dist/types/components/pro-contract-template-designer/src/constants.d.ts +0 -3
  50. package/dist/types/components/pro-contract-template-designer/src/types.d.ts +0 -4
  51. package/dist/types/components/pro-menu-tree/index.d.ts +9 -0
  52. package/dist/types/components/pro-menu-tree/src/pro-menu-tree.d.ts +9 -0
  53. package/dist/types/components/pro-menu-tree/src/types.d.ts +7 -0
  54. package/dist/types/components/pro-selector/index.d.ts +59 -2
  55. package/dist/types/components/pro-selector/src/ProUserSelector.vue.d.ts +9 -0
  56. package/dist/types/components/pro-selector/src/ProUserSelectorDrilldown.vue.d.ts +28 -4
  57. package/dist/types/components/pro-selector/src/types.d.ts +7 -0
  58. package/dist/types/components/pro-selector-group/index.d.ts +3 -0
  59. package/dist/types/components/pro-selector-group/src/index.vue.d.ts +1 -0
  60. package/dist/types/components/pro-selector-group/src/types.d.ts +5 -0
  61. package/dist/types/components/role-selector/index.d.ts +30 -0
  62. package/dist/types/components/role-selector/src/RoleSelector.vue.d.ts +9 -0
  63. package/dist/types/components/role-selector/src/types.d.ts +9 -2
  64. package/dist/types/components/selector-core/components/SelectorDialog.vue.d.ts +2 -0
  65. package/dist/types/components/selector-core/selection-theme.d.ts +20 -0
  66. package/package.json +3 -3
  67. package/dist/es/components/pro-contract-template-designer/src/utils/clause-snippets.mjs +0 -56
  68. package/dist/lib/components/pro-contract-template-designer/src/utils/clause-snippets.cjs +0 -1
  69. package/dist/types/components/pro-contract-template-designer/src/utils/clause-snippets.d.ts +0 -10
@@ -1,107 +1,109 @@
1
1
  import { useNamespace as e } from "../../../hooks/use-namespace/index.mjs";
2
- import { useProMenuTree as t } from "./hooks.mjs";
3
- import { MENU_TREE_URL as n, proMenuTreeEmits as r, proMenuTreeProps as i } from "./types.mjs";
4
- import { Fragment as a, computed as o, createTextVNode as s, createVNode as c, defineComponent as l, onMounted as u, reactive as d, ref as f, watch as p } from "vue";
5
- import { Button as m, Empty as h, InputSearch as g, Spin as ee, Tree as te, message as _ } from "ant-design-vue";
2
+ import { createSelectionTheme as t } from "../../selector-core/selection-theme.mjs";
3
+ import { useProMenuTree as n } from "./hooks.mjs";
4
+ import { MENU_TREE_URL as r, proMenuTreeEmits as i, proMenuTreeProps as a } from "./types.mjs";
5
+ import { Fragment as o, computed as s, createTextVNode as c, createVNode as l, defineComponent as u, mergeProps as d, onMounted as ee, reactive as te, ref as f, watch as p } from "vue";
6
+ import { Button as m, ConfigProvider as ne, Empty as h, InputSearch as g, Spin as re, Tree as ie, message as _ } from "ant-design-vue";
6
7
  //#region src/components/pro-menu-tree/src/pro-menu-tree.tsx
7
- var v = /* @__PURE__ */ l({
8
+ var v = /* @__PURE__ */ u({
8
9
  name: "KProMenuTree",
9
- props: i,
10
- emits: r,
11
- setup(r, { emit: i, slots: l, expose: v }) {
12
- let y = e("pro-menu-tree"), { treeData: ne, nodeMap: b, normalizeTree: re, getAllSelectableNodeIds: x, getAllExpandableKeys: ie, getDefaultExpandedKeys: S, searchTree: ae, getFilteredTree: C, buildCheckedStateFromIds: w, buildCheckedStateAfterToggle: T, isButton: E } = t(() => ({
13
- fieldNames: r.fieldNames,
14
- nodeTypeField: r.nodeTypeField,
15
- buttonType: r.buttonType
16
- })), D = f(!1), O = f(""), k = f([]), A = f(!0), j = d({
10
+ inheritAttrs: !1,
11
+ props: a,
12
+ emits: i,
13
+ setup(i, { attrs: a, emit: u, slots: v, expose: ae }) {
14
+ let y = e("pro-menu-tree"), { treeData: oe, nodeMap: se, normalizeTree: b, getAllSelectableNodeIds: x, getAllExpandableKeys: S, getDefaultExpandedKeys: C, searchTree: w, getFilteredTree: T, buildCheckedStateFromIds: ce, buildCheckedStateAfterToggle: le, isButton: ue } = n(() => ({
15
+ fieldNames: i.fieldNames,
16
+ nodeTypeField: i.nodeTypeField,
17
+ buttonType: i.buttonType
18
+ })), E = f(!1), D = f(""), O = f([]), k = f(!0), A = te({
17
19
  checked: [],
18
20
  halfChecked: []
19
- }), M = !1, oe = o(() => r.fieldNames.key), se = o(() => r.fieldNames.title), N = o(() => r.showExpandActions ?? r.showToolbar), P = o(() => r.showClearAction ?? r.showToolbar), F = o(() => r.isBuiltInRequest && r.showRefreshAction), I = o(() => r.disabled), L = o(() => r.searchable || r.showToolbar || r.showStats || N.value || P.value || F.value), R = o(() => ({
20
- checked: j.checked.length,
21
- halfChecked: j.halfChecked.length
22
- })), z = o(() => C(O.value));
21
+ }), j = !1, de = s(() => i.fieldNames.key), fe = s(() => i.fieldNames.title), M = s(() => i.showExpandActions ?? i.showToolbar), N = s(() => i.showClearAction ?? i.showToolbar), P = s(() => i.isBuiltInRequest && i.showRefreshAction), F = s(() => i.disabled), I = s(() => i.searchable || i.showToolbar || i.showStats || M.value || N.value || P.value), L = s(() => ({
22
+ checked: A.checked.length,
23
+ halfChecked: A.halfChecked.length
24
+ })), R = s(() => T(D.value)), z = s(() => t(i.activeColor));
23
25
  function B() {
24
- return [...j.checked, ...j.halfChecked].map((e) => ({
26
+ return [...A.checked, ...A.halfChecked].map((e) => ({
25
27
  id: e,
26
28
  selected: !0
27
29
  }));
28
30
  }
29
31
  function V(e) {
30
- j.checked = e.checked, j.halfChecked = e.halfChecked;
32
+ A.checked = e.checked, A.halfChecked = e.halfChecked;
31
33
  }
32
34
  function H() {
33
- I.value || (q(x()), J());
35
+ F.value || (q(x()), J());
34
36
  }
35
37
  function U() {
36
- if (I.value) return;
37
- let e = new Set([...j.checked, ...j.halfChecked]);
38
+ if (F.value) return;
39
+ let e = new Set([...A.checked, ...A.halfChecked]);
38
40
  q(x().filter((t) => !e.has(t))), J();
39
41
  }
40
42
  function W() {
41
- I.value || (V({
43
+ F.value || (V({
42
44
  checked: [],
43
45
  halfChecked: []
44
46
  }), J());
45
47
  }
46
48
  function G() {
47
- I.value || (k.value = ie(), A.value = !0);
49
+ F.value || (O.value = S(), k.value = !0);
48
50
  }
49
51
  function K() {
50
- I.value || (k.value = [], A.value = !1);
52
+ F.value || (O.value = [], k.value = !1);
51
53
  }
52
54
  function q(e) {
53
- V(w(e ?? []));
55
+ V(ce(e ?? []));
54
56
  }
55
- function ce(e, t) {
56
- r.disabled || (V(T(j, String(t.node[oe.value] ?? t.node.key ?? t.node.eventKey ?? ""), t.checked)), J());
57
+ function pe(e, t) {
58
+ i.disabled || (V(le(A, String(t.node[de.value] ?? t.node.key ?? t.node.eventKey ?? ""), t.checked)), J());
57
59
  }
58
60
  function J() {
59
- M = !0, i("update:modelValue", [...j.checked, ...j.halfChecked]), i("change", B());
61
+ j = !0, u("update:modelValue", [...A.checked, ...A.halfChecked]), u("change", B());
60
62
  }
61
- function le() {
62
- b.value.size !== 0 && q(r.modelValue ?? []);
63
+ function me() {
64
+ se.value.size !== 0 && q(i.modelValue ?? []);
63
65
  }
64
66
  function Y(e) {
65
- re(e), k.value = S(r.defaultExpandAll), O.value = "", A.value = !0, q(r.modelValue ?? []);
67
+ b(e), O.value = C(i.defaultExpandAll), D.value = "", k.value = !0, q(i.modelValue ?? []);
66
68
  }
67
69
  async function X() {
68
- I.value || !r.isBuiltInRequest || await Z();
70
+ F.value || !i.isBuiltInRequest || await Z();
69
71
  }
70
72
  async function Z() {
71
- if (!r.http?.get) {
73
+ if (!i.http?.get) {
72
74
  _.error("请传入 http 实例");
73
75
  return;
74
76
  }
75
- D.value = !0;
77
+ E.value = !0;
76
78
  try {
77
- let e = await r.http.get(`${r.prefix ?? ""}${n}`);
78
- e.status === 0 ? (Y(Array.isArray(e.data) ? e.data : []), i("ready")) : _.error(e.message ?? e.msg ?? "获取菜单树失败");
79
+ let e = await i.http.get(`${i.prefix ?? ""}${r}`);
80
+ e.status === 0 ? (Y(Array.isArray(e.data) ? e.data : []), u("ready")) : _.error(e.message ?? e.msg ?? "获取菜单树失败");
79
81
  } catch (e) {
80
82
  _.error(e instanceof Error ? e.message : "获取菜单树失败");
81
83
  } finally {
82
- D.value = !1;
84
+ E.value = !1;
83
85
  }
84
86
  }
85
- u(() => {
86
- r.isBuiltInRequest ? Z() : (Y(r.treeData ?? []), i("ready"));
87
- }), p(() => r.treeData, (e) => {
88
- r.isBuiltInRequest || Y(e ?? []);
89
- }), p(() => r.modelValue, () => {
90
- if (M) {
91
- M = !1;
87
+ ee(() => {
88
+ i.isBuiltInRequest ? Z() : (Y(i.treeData ?? []), u("ready"));
89
+ }), p(() => i.treeData, (e) => {
90
+ i.isBuiltInRequest || Y(e ?? []);
91
+ }), p(() => i.modelValue, () => {
92
+ if (j) {
93
+ j = !1;
92
94
  return;
93
95
  }
94
- le();
96
+ me();
95
97
  }, { deep: !0 });
96
98
  function Q(e) {
97
- if (I.value) return;
98
- let t = ae(e);
99
- O.value = t.keyword, A.value = !0, k.value = t.keyword ? t.expandedKeys : S(r.defaultExpandAll);
99
+ if (F.value) return;
100
+ let t = w(e);
101
+ D.value = t.keyword, k.value = !0, O.value = t.keyword ? t.expandedKeys : C(i.defaultExpandAll);
100
102
  }
101
- function $(e) {
102
- k.value = e, A.value = !1;
103
+ function he(e) {
104
+ O.value = e, k.value = !1;
103
105
  }
104
- v({
106
+ ae({
105
107
  getSelectedStatusArray: B,
106
108
  setCheckedKeysFromIds: q,
107
109
  selectAll: H,
@@ -111,37 +113,37 @@ var v = /* @__PURE__ */ l({
111
113
  collapseAll: K,
112
114
  reload: X
113
115
  });
114
- let ue = (e) => {
115
- if (!O.value) return c("span", { class: y.e("title") }, [e], 2);
116
- let t = e.indexOf(O.value);
117
- return t === -1 ? c("span", { class: y.e("title") }, [e], 2) : c("span", { class: y.e("title") }, [
116
+ let ge = (e) => {
117
+ if (!D.value) return l("span", { class: y.e("title") }, [e], 2);
118
+ let t = e.indexOf(D.value);
119
+ return t === -1 ? l("span", { class: y.e("title") }, [e], 2) : l("span", { class: y.e("title") }, [
118
120
  e.substring(0, t),
119
- c("span", { class: y.e("keyword") }, [e.substring(t, t + O.value.length)], 2),
120
- e.substring(t + O.value.length)
121
+ l("span", { class: y.e("keyword") }, [e.substring(t, t + D.value.length)], 2),
122
+ e.substring(t + D.value.length)
121
123
  ], 2);
122
- }, de = (e) => {
123
- let t = E(e), n = String(e[se.value] ?? ""), i = e[r.iconField];
124
- return c("div", { class: [y.e("node"), t ? "pro-menu-tree-button" : ""] }, [c("div", { class: y.e("node-inner") }, [!t && l.icon ? l.icon({
124
+ }, $ = (e) => {
125
+ let t = ue(e), n = String(e[fe.value] ?? ""), r = e[i.iconField];
126
+ return l("div", { class: [y.e("node"), t ? "pro-menu-tree-button" : ""] }, [l("div", { class: y.e("node-inner") }, [!t && v.icon ? v.icon({
125
127
  node: e,
126
- icon: i
127
- }) : null, ue(n)], 2)], 2);
128
- }, fe = () => c(te, {
129
- treeData: z.value,
130
- fieldNames: r.fieldNames,
128
+ icon: r
129
+ }) : null, ge(n)], 2)], 2);
130
+ }, _e = () => l(ie, {
131
+ treeData: R.value,
132
+ fieldNames: i.fieldNames,
131
133
  checkedKeys: {
132
- checked: j.checked,
133
- halfChecked: j.halfChecked
134
+ checked: A.checked,
135
+ halfChecked: A.halfChecked
134
136
  },
135
- expandedKeys: k.value,
136
- autoExpandParent: A.value,
137
+ expandedKeys: O.value,
138
+ autoExpandParent: k.value,
137
139
  checkable: !0,
138
140
  checkStrictly: !0,
139
- disabled: r.disabled,
141
+ disabled: i.disabled,
140
142
  selectable: !1,
141
- onCheck: ce,
142
- onExpand: $
143
+ onCheck: pe,
144
+ onExpand: he
143
145
  }, {
144
- title: (e) => de(e),
146
+ title: (e) => $(e),
145
147
  _: 1
146
148
  }, 8, [
147
149
  "treeData",
@@ -154,47 +156,50 @@ var v = /* @__PURE__ */ l({
154
156
  "disabled",
155
157
  "onCheck",
156
158
  "onExpand"
157
- ]), pe = () => r.showToolbar || P.value || N.value || F.value ? c("div", { class: y.e("actions") }, [
158
- r.showToolbar && c(a, null, [c(m, {
159
+ ]), ve = () => i.showToolbar || N.value || M.value || P.value ? l("div", { class: y.e("actions") }, [
160
+ i.showToolbar && l(o, null, [l(m, {
159
161
  size: "small",
160
- disabled: r.disabled,
162
+ disabled: i.disabled,
161
163
  onClick: H
162
- }, { default: () => [s("全选")] }, 8, ["disabled", "onClick"]), c(m, {
164
+ }, { default: () => [c("全选")] }, 8, ["disabled", "onClick"]), l(m, {
163
165
  size: "small",
164
- disabled: r.disabled,
166
+ disabled: i.disabled,
165
167
  onClick: U
166
- }, { default: () => [s("反选")] }, 8, ["disabled", "onClick"])]),
167
- P.value && c(m, {
168
+ }, { default: () => [c("反选")] }, 8, ["disabled", "onClick"])]),
169
+ N.value && l(m, {
168
170
  size: "small",
169
- disabled: r.disabled,
171
+ disabled: i.disabled,
170
172
  onClick: W
171
- }, { default: () => [s("清空")] }, 8, ["disabled", "onClick"]),
172
- N.value && c(a, null, [c(m, {
173
+ }, { default: () => [c("清空")] }, 8, ["disabled", "onClick"]),
174
+ M.value && l(o, null, [l(m, {
173
175
  size: "small",
174
- disabled: I.value,
176
+ disabled: F.value,
175
177
  onClick: G
176
- }, { default: () => [s("展开全部")] }, 8, ["disabled", "onClick"]), c(m, {
178
+ }, { default: () => [c("展开全部")] }, 8, ["disabled", "onClick"]), l(m, {
177
179
  size: "small",
178
- disabled: I.value,
180
+ disabled: F.value,
179
181
  onClick: K
180
- }, { default: () => [s("收起全部")] }, 8, ["disabled", "onClick"])]),
181
- F.value && c(m, {
182
+ }, { default: () => [c("收起全部")] }, 8, ["disabled", "onClick"])]),
183
+ P.value && l(m, {
182
184
  size: "small",
183
- disabled: I.value,
184
- loading: D.value,
185
+ disabled: F.value,
186
+ loading: E.value,
185
187
  onClick: X
186
- }, { default: () => [s("刷新")] }, 8, [
188
+ }, { default: () => [c("刷新")] }, 8, [
187
189
  "disabled",
188
190
  "loading",
189
191
  "onClick"
190
192
  ])
191
193
  ], 2) : null;
192
- return () => c("div", { class: y.b() }, [L.value && c("div", { class: y.e("toolbar") }, [c("div", { class: y.e("tools") }, [r.searchable && c(g, {
194
+ return () => l(ne, { theme: z.value.config }, { default: () => [l("div", d(a, {
195
+ class: [y.b(), a.class],
196
+ style: [a.style, z.value.style]
197
+ }), [I.value && l("div", { class: y.e("toolbar") }, [l("div", { class: y.e("tools") }, [i.searchable && l(g, {
193
198
  class: y.e("search"),
194
- value: O.value,
199
+ value: D.value,
195
200
  placeholder: "请输入菜单名称",
196
201
  allowClear: !0,
197
- disabled: I.value,
202
+ disabled: F.value,
198
203
  onSearch: Q,
199
204
  onChange: (e) => Q(e.target?.value ?? "")
200
205
  }, null, 8, [
@@ -204,16 +209,16 @@ var v = /* @__PURE__ */ l({
204
209
  "disabled",
205
210
  "onSearch",
206
211
  "onChange"
207
- ]), r.showStats && c("span", { class: y.e("stats") }, [
208
- s("已选 "),
209
- R.value.checked,
210
- s(" 项 / 半选 "),
211
- R.value.halfChecked,
212
- s(" 项")
213
- ], 2)], 2), pe()], 2), c(ee, { spinning: D.value }, { default: () => [c("div", { class: y.e("body") }, [z.value.length > 0 ? fe() : c(h, {
212
+ ]), i.showStats && l("span", { class: y.e("stats") }, [
213
+ c("已选 "),
214
+ L.value.checked,
215
+ c(" 项 / 半选 "),
216
+ L.value.halfChecked,
217
+ c(" 项")
218
+ ], 2)], 2), ve()], 2), l(re, { spinning: E.value }, { default: () => [l("div", { class: y.e("body") }, [R.value.length > 0 ? _e() : l(h, {
214
219
  image: h.PRESENTED_IMAGE_SIMPLE,
215
220
  description: "暂无数据"
216
- }, null, 8, ["image"])], 2)] }, 8, ["spinning"])], 2);
221
+ }, null, 8, ["image"])], 2)] }, 8, ["spinning"])], 16)] }, 8, ["theme"]);
217
222
  }
218
223
  });
219
224
  //#endregion
@@ -37,6 +37,10 @@ var e = {
37
37
  default: () => {}
38
38
  },
39
39
  prefix: String,
40
+ activeColor: {
41
+ type: String,
42
+ default: "#1161ff"
43
+ },
40
44
  defaultExpandAll: {
41
45
  type: Boolean,
42
46
  default: !0
@@ -1,17 +1,18 @@
1
1
  import { serializeUsers as e, text as t } from "../../selector-core/model.mjs";
2
- import n from "../../selector-core/components/SelectorDialog.mjs";
3
- import r from "../../selector-core/components/SelectionChips.mjs";
4
- import { UserSelectorProps as i, userSelectorEmits as a } from "./types.mjs";
5
- import { computed as o, createBlock as s, createCommentVNode as c, createElementVNode as l, createVNode as u, defineComponent as d, openBlock as f, renderSlot as p, unref as m, useAttrs as h, withCtx as g } from "vue";
6
- import { FormItemRest as _ } from "ant-design-vue";
2
+ import { createSelectionTheme as n } from "../../selector-core/selection-theme.mjs";
3
+ import r from "../../selector-core/components/SelectorDialog.mjs";
4
+ import i from "../../selector-core/components/SelectionChips.mjs";
5
+ import { UserSelectorProps as a, userSelectorEmits 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/pro-selector/src/ProUserSelector.vue?vue&type=script&setup=true&lang.ts
8
- var v = { class: "gd-ant-pro-user-selector" }, y = /* @__PURE__ */ d({
9
+ var b = /* @__PURE__ */ f({
9
10
  name: "ProUserSelector",
10
11
  __name: "ProUserSelector",
11
- props: i,
12
- emits: a,
13
- setup(i, { expose: a, emit: d }) {
14
- let y = i, b = d, x = h(), S = o(() => y.modelValue.map((e) => ({
12
+ props: a,
13
+ emits: o,
14
+ setup(a, { expose: o, emit: f }) {
15
+ let b = a, x = f, S = _(), C = s(() => n(b.activeColor)), w = s(() => b.modelValue.map((e) => ({
15
16
  type: "user",
16
17
  value: t(e.id),
17
18
  label: e.realName,
@@ -21,8 +22,8 @@ var v = { class: "gd-ant-pro-user-selector" }, y = /* @__PURE__ */ d({
21
22
  id: e.id,
22
23
  userId: e.id
23
24
  }
24
- }))), C = o(() => {
25
- let { modalProps: e, ...t } = x;
25
+ }))), T = s(() => {
26
+ let { modalProps: e, ...t } = S;
26
27
  return {
27
28
  cancelText: "取消",
28
29
  okText: "确定",
@@ -30,43 +31,47 @@ var v = { class: "gd-ant-pro-user-selector" }, y = /* @__PURE__ */ d({
30
31
  ...e || {}
31
32
  };
32
33
  });
33
- function w(e) {
34
- b("update:visible", e === !0);
34
+ function E(e) {
35
+ x("update:visible", e === !0);
35
36
  }
36
- function T(t) {
37
+ function D(t) {
37
38
  let n = e(t);
38
- b("update:visible", !1), b("update:modelValue", n), b("confirm", n);
39
+ x("update:visible", !1), x("update:modelValue", n), x("confirm", n);
39
40
  }
40
- function E() {
41
- b("update:visible", !1), b("cancel");
41
+ function O() {
42
+ x("update:visible", !1), x("cancel");
42
43
  }
43
- function D(e) {
44
- b("update:modelValue", y.modelValue.filter((t) => t.id !== e)), b("delete-user", e);
44
+ function k(e) {
45
+ x("update:modelValue", b.modelValue.filter((t) => t.id !== e)), x("delete-user", e);
45
46
  }
46
- return a({ deleteCheckedUser: D }), (e, t) => (f(), s(m(_), null, {
47
- default: g(() => [l("div", v, [y.hideSlot ? c("", !0) : p(e.$slots, "default", { key: 0 }, () => [u(r, {
48
- items: S.value,
49
- "max-visible-count": y.maxVisibleCount,
47
+ return o({ deleteCheckedUser: k }), (e, t) => (m(), c(g(y), null, {
48
+ default: v(() => [u("div", {
49
+ class: "gd-ant-pro-user-selector",
50
+ style: p(C.value.style)
51
+ }, [b.hideSlot ? l("", !0) : h(e.$slots, "default", { key: 0 }, () => [d(i, {
52
+ items: w.value,
53
+ "max-visible-count": b.maxVisibleCount,
50
54
  "add-text": "选择用户",
51
- onAdd: t[0] ||= (e) => b("update:visible", !0),
52
- onRemove: t[1] ||= (e) => D(e.value)
53
- }, null, 8, ["items", "max-visible-count"])]), u(n, {
54
- open: y.visible,
55
+ onAdd: t[0] ||= (e) => x("update:visible", !0),
56
+ onRemove: t[1] ||= (e) => k(e.value)
57
+ }, null, 8, ["items", "max-visible-count"])]), d(r, {
58
+ open: b.visible,
55
59
  mode: "user",
56
- selected: S.value,
57
- selection: y.type,
58
- "max-count": y.maxCount,
59
- variant: y.variant,
60
- title: y.title || "选择联系人",
61
- http: y.http,
62
- prefix: y.prefix,
63
- "init-data": y.initData,
64
- "is-built-in-request": y.isBuiltInRequest,
65
- "modal-props": C.value,
66
- "onUpdate:open": w,
67
- "onUpdate:variant": t[2] ||= (e) => b("update:variant", e),
68
- onConfirm: T,
69
- onCancel: E
60
+ selected: w.value,
61
+ selection: b.type,
62
+ "max-count": b.maxCount,
63
+ variant: b.variant,
64
+ title: b.title || "选择联系人",
65
+ http: b.http,
66
+ prefix: b.prefix,
67
+ "init-data": b.initData,
68
+ "is-built-in-request": b.isBuiltInRequest,
69
+ "active-color": b.activeColor,
70
+ "modal-props": T.value,
71
+ "onUpdate:open": E,
72
+ "onUpdate:variant": t[2] ||= (e) => x("update:variant", e),
73
+ onConfirm: D,
74
+ onCancel: O
70
75
  }, null, 8, [
71
76
  "open",
72
77
  "selected",
@@ -78,11 +83,12 @@ var v = { class: "gd-ant-pro-user-selector" }, y = /* @__PURE__ */ d({
78
83
  "prefix",
79
84
  "init-data",
80
85
  "is-built-in-request",
86
+ "active-color",
81
87
  "modal-props"
82
- ])])]),
88
+ ])], 4)]),
83
89
  _: 3
84
90
  }));
85
91
  }
86
92
  });
87
93
  //#endregion
88
- export { y as default };
94
+ export { b as default };
@@ -37,6 +37,10 @@ var e = Symbol("selectUserContextKey"), t = {
37
37
  default: !1
38
38
  },
39
39
  prefix: String,
40
+ activeColor: {
41
+ type: String,
42
+ default: "#1161ff"
43
+ },
40
44
  maxVisibleCount: {
41
45
  type: Number,
42
46
  default: 5
@@ -1,17 +1,19 @@
1
1
  import { serializeGroup as e, text as t } from "../../selector-core/model.mjs";
2
- import n from "../../selector-core/components/SelectorDialog.mjs";
3
- import r from "../../selector-core/components/SelectionChips.mjs";
4
- import { normalizeSelectorOptions as i, removeSelectorOption as a } from "./utils/index.mjs";
5
- import { computed as o, createBlock as s, createCommentVNode as c, createElementVNode as l, createVNode as u, defineComponent as d, mergeModels as f, openBlock as p, renderSlot as m, unref as h, useAttrs as g, useModel as _, withCtx as v } from "vue";
6
- import { FormItemRest as y } from "ant-design-vue";
2
+ import { DEFAULT_SELECTION_ACTIVE_COLOR as n, createSelectionTheme as r } from "../../selector-core/selection-theme.mjs";
3
+ import i from "../../selector-core/components/SelectorDialog.mjs";
4
+ import a from "../../selector-core/components/SelectionChips.mjs";
5
+ import { normalizeSelectorOptions as o, removeSelectorOption as s } from "./utils/index.mjs";
6
+ import { computed as c, createBlock as l, createCommentVNode as u, createElementVNode as d, createVNode as f, defineComponent as p, mergeModels as m, normalizeStyle as h, openBlock as g, renderSlot as _, unref as v, useAttrs as y, useModel as b, withCtx as x } from "vue";
7
+ import { FormItemRest as S } from "ant-design-vue";
7
8
  //#region src/components/pro-selector-group/src/index.vue?vue&type=script&setup=true&lang.ts
8
- var b = { class: "gd-ant-pro-selector-group" }, x = /* @__PURE__ */ d({
9
+ var C = /* @__PURE__ */ p({
9
10
  name: "ProSelectorGroup",
10
11
  __name: "index",
11
- props: /* @__PURE__ */ f({
12
+ props: /* @__PURE__ */ m({
12
13
  title: { default: "选择器" },
13
14
  http: {},
14
15
  urlPrefix: {},
16
+ activeColor: { default: n },
15
17
  isSingle: {
16
18
  type: Boolean,
17
19
  default: !0
@@ -35,19 +37,19 @@ var b = { class: "gd-ant-pro-selector-group" }, x = /* @__PURE__ */ d({
35
37
  },
36
38
  visibleModifiers: {}
37
39
  }),
38
- emits: /* @__PURE__ */ f([
40
+ emits: /* @__PURE__ */ m([
39
41
  "confirm",
40
42
  "cancel",
41
43
  "changeTab"
42
44
  ], ["update:modelValue", "update:visible"]),
43
- setup(d, { emit: f }) {
44
- let x = d, S = f, C = g(), w = _(d, "modelValue"), T = _(d, "visible"), E = o(() => w.value.map((e) => ({
45
- type: e.type || x.type || "dept",
45
+ setup(n, { emit: p }) {
46
+ let m = n, C = p, w = y(), T = b(n, "modelValue"), E = b(n, "visible"), D = c(() => r(m.activeColor)), O = c(() => T.value.map((e) => ({
47
+ type: e.type || m.type || "dept",
46
48
  value: t(e.value),
47
49
  label: e.label || "",
48
50
  raw: e
49
- }))), D = o(() => {
50
- let { modalProps: e, ...t } = C;
51
+ }))), k = c(() => {
52
+ let { modalProps: e, ...t } = w;
51
53
  return {
52
54
  cancelText: "取消",
53
55
  okText: "确定",
@@ -55,36 +57,40 @@ var b = { class: "gd-ant-pro-selector-group" }, x = /* @__PURE__ */ d({
55
57
  ...e || {}
56
58
  };
57
59
  });
58
- function O(t) {
59
- w.value = i(e(t)), T.value = !1, S("confirm");
60
+ function A(t) {
61
+ T.value = o(e(t)), E.value = !1, C("confirm");
60
62
  }
61
- function k() {
62
- T.value = !1, S("cancel");
63
+ function j() {
64
+ E.value = !1, C("cancel");
63
65
  }
64
- function A(e) {
65
- w.value = a(w.value, e.value, e.type, x.type || "dept");
66
+ function M(e) {
67
+ T.value = s(T.value, e.value, e.type, m.type || "dept");
66
68
  }
67
- return (e, t) => (p(), s(h(y), null, {
68
- default: v(() => [l("div", b, [x.hideSlot ? c("", !0) : m(e.$slots, "default", { key: 0 }, () => [u(r, {
69
- items: E.value,
70
- "max-visible-count": x.maxVisibleCount ?? 5,
69
+ return (e, t) => (g(), l(v(S), null, {
70
+ default: x(() => [d("div", {
71
+ class: "gd-ant-pro-selector-group",
72
+ style: h(D.value.style)
73
+ }, [m.hideSlot ? u("", !0) : _(e.$slots, "default", { key: 0 }, () => [f(a, {
74
+ items: O.value,
75
+ "max-visible-count": m.maxVisibleCount ?? 5,
71
76
  "add-text": "选择对象",
72
- onAdd: t[0] ||= (e) => T.value = !0,
73
- onRemove: A
74
- }, null, 8, ["items", "max-visible-count"])]), u(n, {
75
- open: T.value,
77
+ onAdd: t[0] ||= (e) => E.value = !0,
78
+ onRemove: M
79
+ }, null, 8, ["items", "max-visible-count"])]), f(i, {
80
+ open: E.value,
76
81
  mode: "group",
77
- selected: E.value,
78
- "initial-tab": x.type,
79
- "is-single": x.isSingle,
80
- title: x.title,
81
- http: x.http,
82
- prefix: x.urlPrefix,
83
- "modal-props": D.value,
84
- "onUpdate:open": t[1] ||= (e) => T.value = e === !0,
85
- onConfirm: O,
86
- onCancel: k,
87
- onChangeTab: t[2] ||= (e) => S("changeTab", e)
82
+ selected: O.value,
83
+ "initial-tab": m.type,
84
+ "is-single": m.isSingle,
85
+ title: m.title,
86
+ http: m.http,
87
+ prefix: m.urlPrefix,
88
+ "active-color": m.activeColor,
89
+ "modal-props": k.value,
90
+ "onUpdate:open": t[1] ||= (e) => E.value = e === !0,
91
+ onConfirm: A,
92
+ onCancel: j,
93
+ onChangeTab: t[2] ||= (e) => C("changeTab", e)
88
94
  }, null, 8, [
89
95
  "open",
90
96
  "selected",
@@ -93,11 +99,12 @@ var b = { class: "gd-ant-pro-selector-group" }, x = /* @__PURE__ */ d({
93
99
  "title",
94
100
  "http",
95
101
  "prefix",
102
+ "active-color",
96
103
  "modal-props"
97
- ])])]),
104
+ ])], 4)]),
98
105
  _: 3
99
106
  }));
100
107
  }
101
108
  });
102
109
  //#endregion
103
- export { x as default };
110
+ export { C as default };