@dazhicheng/ui 1.6.80 → 1.6.81

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.
@@ -24,9 +24,7 @@ async function t(e, s) {
24
24
  }
25
25
  async function f(e) {
26
26
  const s = [
27
- ...new Set(
28
- (Array.isArray(e) ? e : []).map((r) => String(r ?? "").trim()).filter(Boolean)
29
- )
27
+ ...new Set((Array.isArray(e) ? e : []).map((r) => String(r ?? "").trim()).filter(Boolean))
30
28
  ];
31
29
  if (!s.length) return [];
32
30
  const l = await t(s).catch(() => null);
@@ -42,6 +42,7 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {
42
42
  middlePlaceholder: string;
43
43
  showNav: boolean;
44
44
  resolveMissingOptions: (codes: Array<string | number>) => Promise<PanelSelectOption[]>;
45
+ missingEchoKey: string;
45
46
  showAllField: PanelSelectValue;
46
47
  showPinyinMode: boolean;
47
48
  showOriginMode: boolean;
@@ -1,8 +1,8 @@
1
- import { defineComponent as hl, mergeModels as ue, ref as w, computed as i, useModel as vl, watch as V, useTemplateRef as T, unref as u, onMounted as ml, createElementBlock as _, openBlock as C, normalizeClass as M, createVNode as ce, mergeProps as wl, withCtx as de, withDirectives as gl, normalizeStyle as yl, createBlock as pe, createCommentVNode as G, createElementVNode as fe, toDisplayString as kl, nextTick as D } from "vue";
1
+ import { defineComponent as fl, mergeModels as ne, computed as i, useModel as hl, watch as b, ref as g, useTemplateRef as L, unref as s, onMounted as ml, createElementBlock as R, openBlock as w, normalizeClass as x, createVNode as re, mergeProps as vl, withCtx as ie, withDirectives as gl, normalizeStyle as wl, createBlock as se, createCommentVNode as B, createElementVNode as ue, toDisplayString as yl, nextTick as _ } from "vue";
2
2
  import "../../../node_modules/.pnpm/vue-types@5.1.3_vue@3.5.34_typescript@5.9.3_/node_modules/vue-types/shim/index.modern.js";
3
3
  import { useDesign as Al } from "../../../packages/hooks/src/useDesign.js";
4
4
  import "axios";
5
- import { ElSelect as Cl, vLoading as xl } from "element-plus";
5
+ import { ElSelect as Cl, vLoading as kl } from "element-plus";
6
6
  import { isString as bl } from "../../../packages/utils/src/is.js";
7
7
  import "dayjs";
8
8
  import "numeral";
@@ -17,20 +17,20 @@ import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-
17
17
  import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
18
18
  import "lodash-es";
19
19
  import "vue-router";
20
- import { expandJoinedOptionValues as Sl } from "../../../hooks/missingOptionsCache.js";
21
- import { useResizeObserver as Ol } from "@vueuse/core";
22
- import { useSelectCollapseOptions as Vl } from "../../tt-form/src/hooks/useSelectCollapse.js";
23
- import { splitPanelSelectText as W, ALL as Ml, DEFAULT_PANEL_SELECT_SEPARATORS as El } from "./common.js";
24
- import $l from "./components/PanelLeft.vue.js";
25
- import Fl from "./components/PanelMiddle.vue.js";
26
- import Nl from "./components/PanelRight.vue.js";
27
- import { usePanelSelectData as Ll } from "./hooks/usePanelData.js";
28
- import { usePanelSelectSelection as Pl } from "./hooks/usePanelSelection.js";
20
+ import { missingOptionsEchoVersion as xl, getPanelMissingEchoOptions as Sl, expandJoinedOptionValues as Ol, diffPanelMissingCodes as Ml, ensurePanelResolveMissingOptions as Vl, PANEL_MISSING_ECHO_DEFAULT_SCOPE as ce } from "../../../hooks/missingOptionsCache.js";
21
+ import { useDebounceFn as El, useResizeObserver as Fl } from "@vueuse/core";
22
+ import { useSelectCollapseOptions as Pl } from "../../tt-form/src/hooks/useSelectCollapse.js";
23
+ import { splitPanelSelectText as T, ALL as $l, DEFAULT_PANEL_SELECT_SEPARATORS as Nl } from "./common.js";
24
+ import Ll from "./components/PanelLeft.vue.js";
25
+ import Rl from "./components/PanelMiddle.vue.js";
26
+ import Bl from "./components/PanelRight.vue.js";
27
+ import { usePanelSelectData as _l } from "./hooks/usePanelData.js";
28
+ import { usePanelSelectSelection as Tl } from "./hooks/usePanelSelection.js";
29
29
  /* empty css */
30
- const g = 4, ct = /* @__PURE__ */ hl({
30
+ const m = 4, ht = /* @__PURE__ */ fl({
31
31
  name: "TtPanelSelect",
32
32
  __name: "index",
33
- props: /* @__PURE__ */ ue({
33
+ props: /* @__PURE__ */ ne({
34
34
  allowCreate: { type: Boolean, default: !1 },
35
35
  disabled: { type: Boolean, default: !1 },
36
36
  showNav: { type: Boolean, default: !0 },
@@ -41,6 +41,7 @@ const g = 4, ct = /* @__PURE__ */ hl({
41
41
  resultField: { default: "" },
42
42
  options: { default: () => [] },
43
43
  resolveMissingOptions: { type: Function, default: void 0 },
44
+ missingEchoKey: { default: ce },
44
45
  treeConfig: { default: () => ({
45
46
  transform: !1,
46
47
  labelField: "label",
@@ -53,11 +54,11 @@ const g = 4, ct = /* @__PURE__ */ hl({
53
54
  immediate: { type: Boolean, default: !0 },
54
55
  beforeFetch: { type: Function, default: void 0 },
55
56
  afterFetch: { type: Function, default: void 0 },
56
- separator: { default: () => [...El] },
57
+ separator: { default: () => [...Nl] },
57
58
  pasteSearch: { type: Boolean, default: !0 },
58
59
  alwaysLoad: { type: Boolean, default: !1 },
59
60
  showAll: { type: Boolean, default: !0 },
60
- showAllField: { default: Ml },
61
+ showAllField: { default: $l },
61
62
  showPinyinMode: { type: Boolean, default: !1 },
62
63
  showOriginMode: { type: Boolean, default: !0 },
63
64
  leftPlaceholder: { default: "支持模糊搜索" },
@@ -67,479 +68,477 @@ const g = 4, ct = /* @__PURE__ */ hl({
67
68
  modelValue: {},
68
69
  modelModifiers: {}
69
70
  }),
70
- emits: /* @__PURE__ */ ue(["visible-change", "change", "focus"], ["update:modelValue"]),
71
- setup(d, { expose: he, emit: ve }) {
72
- const me = xl, we = Cl, a = d, E = ve, { prefixCls: p } = Al("panel-select"), y = w([]);
73
- let K = 0;
74
- function U(e = []) {
75
- const l = /* @__PURE__ */ new Set(), t = (o) => {
71
+ emits: /* @__PURE__ */ ne(["visible-change", "change", "focus"], ["update:modelValue"]),
72
+ setup(c, { expose: de, emit: pe }) {
73
+ const fe = kl, he = Cl, t = c, S = pe, { prefixCls: d } = Al("panel-select");
74
+ function me(e = []) {
75
+ const l = /* @__PURE__ */ new Set(), a = (o) => {
76
76
  o.forEach((n) => {
77
- var s;
78
- if ((s = n.children) != null && s.length) {
79
- t(n.children);
77
+ var u;
78
+ if ((u = n.children) != null && u.length) {
79
+ a(n.children);
80
80
  return;
81
81
  }
82
82
  n.value !== void 0 && n.value !== null && n.value !== "" && l.add(n.value);
83
83
  });
84
84
  };
85
- return t(e), l;
85
+ return a(e), l;
86
86
  }
87
- function ge(e) {
87
+ function ve(e) {
88
88
  return Array.isArray(e) ? e : e == null || e === "" ? [] : [e];
89
89
  }
90
- const ye = i(() => {
91
- const e = a.options || [];
92
- if (!y.value.length) return e;
93
- const l = U(e), t = y.value.filter(
94
- (o) => o.value !== void 0 && o.value !== null && !l.has(o.value)
90
+ function G() {
91
+ return t.missingEchoKey || ce;
92
+ }
93
+ const ge = i(() => {
94
+ xl.value;
95
+ const e = t.options || [], l = Sl(G());
96
+ if (!l.length) return e;
97
+ const a = me(e), o = l.filter(
98
+ (n) => n.value !== void 0 && n.value !== null && !a.has(n.value)
95
99
  );
96
- return t.length ? [...e, ...t] : e;
97
- }), ke = new Proxy(a, {
98
- get(e, l, t) {
99
- return l === "options" ? ye.value : Reflect.get(e, l, t);
100
+ return o.length ? [...e, ...o] : e;
101
+ }), we = new Proxy(t, {
102
+ get(e, l, a) {
103
+ return l === "options" ? ge.value : Reflect.get(e, l, a);
100
104
  }
101
105
  }), {
102
- loading: I,
103
- fetchApi: k,
104
- treeOptions: Ae,
105
- navTreeOptions: z,
106
- navNodes: Ce,
107
- leafNodes: h,
108
- isFirstLoaded: q,
109
- filterNodes: xe,
110
- buildOptionGroups: j
111
- } = Ll(ke), r = vl(d, "modelValue");
112
- let J;
113
- const H = i(() => a.disabled), be = i(() => {
114
- if (!a.multiple)
115
- return a.allowCreate ? `${a.placeholder ? a.placeholder : "请选择"}(可创建)` : a.placeholder;
116
- const e = a.showMultiple ? "支持多选和全选" : "支持多选", l = typeof a.placeholder == "string" && a.placeholder.trim() ? a.placeholder.trim().replace(/[,,]\s*$/, "") : "请选择", t = l.includes("支持多选和全选") || l.includes("支持多选") ? l : `${l},${e}`;
117
- return a.allowCreate ? `${t}(可创建)` : t;
118
- }), Se = i(() => {
106
+ loading: D,
107
+ fetchApi: v,
108
+ treeOptions: ye,
109
+ navTreeOptions: K,
110
+ navNodes: Ae,
111
+ leafNodes: f,
112
+ isFirstLoaded: W,
113
+ filterNodes: Ce,
114
+ buildOptionGroups: U
115
+ } = _l(we), r = hl(c, "modelValue");
116
+ let I;
117
+ const z = i(() => t.disabled), ke = i(() => {
118
+ if (!t.multiple)
119
+ return t.allowCreate ? `${t.placeholder ? t.placeholder : "请选择"}(可创建)` : t.placeholder;
120
+ const e = t.showMultiple ? "支持多选和全选" : "支持多选", l = typeof t.placeholder == "string" && t.placeholder.trim() ? t.placeholder.trim().replace(/[,,]\s*$/, "") : "请选择", a = l.includes("支持多选和全选") || l.includes("支持多选") ? l : `${l},${e}`;
121
+ return t.allowCreate ? `${a}(可创建)` : a;
122
+ }), be = i(() => {
119
123
  const e = /* @__PURE__ */ new Map();
120
- return h.value.forEach((l) => e.set(l.value, l.label)), e;
121
- }), Q = i(() => {
124
+ return f.value.forEach((l) => e.set(l.value, l.label)), e;
125
+ }), j = i(() => {
122
126
  const e = /* @__PURE__ */ new Map();
123
- return h.value.forEach((l) => {
124
- var t;
125
- (l.deleted === !0 || ((t = l.raw) == null ? void 0 : t.deleted) === !0) && e.set(l.value, !0);
127
+ return f.value.forEach((l) => {
128
+ var a;
129
+ (l.deleted === !0 || ((a = l.raw) == null ? void 0 : a.deleted) === !0) && e.set(l.value, !0);
126
130
  }), e;
127
131
  });
128
- function $(e) {
129
- return e === a.showAllField ? { label: "全部", value: a.showAllField } : {
130
- label: Se.value.get(e) ?? String(e),
132
+ function O(e) {
133
+ return e === t.showAllField ? { label: "全部", value: t.showAllField } : {
134
+ label: be.value.get(e) ?? String(e),
131
135
  value: e,
132
- deleted: Q.value.get(e) === !0
136
+ deleted: j.value.get(e) === !0
133
137
  };
134
138
  }
135
- function Oe(e) {
136
- return e == null ? !1 : Q.value.get(e) === !0;
139
+ function xe(e) {
140
+ return e == null ? !1 : j.value.get(e) === !0;
137
141
  }
138
- V(
139
- [r, () => a.options, () => a.resolveMissingOptions, () => a.showAllField],
140
- async () => {
141
- const e = a.resolveMissingOptions;
142
- if (!e) return;
143
- const l = Sl(
144
- ge(r.value).filter((c) => c !== a.showAllField)
145
- );
146
- if (!l.length) return;
147
- const t = U(a.options || []);
148
- y.value.forEach((c) => {
149
- c.value !== void 0 && c.value !== null && t.add(c.value);
150
- });
151
- const o = l.filter((c) => !t.has(c));
152
- if (!o.length) return;
153
- const n = ++K, s = await e(o) || [];
154
- if (n !== K) return;
155
- const m = [...y.value], A = new Set(
156
- m.map((c) => c.value).filter((c) => c != null)
157
- );
158
- let se = !1;
159
- s.forEach((c) => {
160
- (c == null ? void 0 : c.value) === void 0 || (c == null ? void 0 : c.value) === null || A.has(c.value) || (m.push(c), A.add(c.value), se = !0);
161
- }), se && (y.value = m);
142
+ const Se = El(async () => {
143
+ const e = t.resolveMissingOptions;
144
+ if (!e) return;
145
+ const l = Ol(
146
+ ve(r.value).filter((n) => n !== t.showAllField)
147
+ );
148
+ if (!l.length) return;
149
+ const a = G();
150
+ Ml(a, l, t.options || []).length && await Vl(
151
+ a,
152
+ l,
153
+ t.options || [],
154
+ (n) => e(n)
155
+ );
156
+ }, 64);
157
+ b(
158
+ [r, () => t.options, () => t.showAllField, () => t.missingEchoKey],
159
+ () => {
160
+ t.resolveMissingOptions && Se();
162
161
  },
163
162
  { immediate: !0, deep: !0 }
164
163
  );
165
- function X(e) {
164
+ function H(e) {
166
165
  if (e != null)
167
166
  return typeof e == "object" && "value" in e ? e.value : e;
168
167
  }
169
- const Y = i({
168
+ const J = i({
170
169
  get() {
171
- return Array.isArray(r.value) ? a.multiple ? r.value : r.value.slice(-1) : r.value === void 0 ? [] : [r.value];
170
+ return Array.isArray(r.value) ? t.multiple ? r.value : r.value.slice(-1) : r.value === void 0 ? [] : [r.value];
172
171
  },
173
172
  set(e) {
174
- r.value = a.multiple ? [...e] : e.at(-1);
173
+ r.value = t.multiple ? [...e] : e.at(-1);
175
174
  }
176
- }), F = i(() => {
177
- if (!a.allowCreate) return [];
178
- const e = new Set(h.value.map((t) => t.value)), l = [];
179
- return new Set(Y.value).forEach((t) => {
180
- !bl(t) || t === a.showAllField || e.has(t) || l.push({ label: t, value: t, level: 0, path: [], raw: { label: t, value: t } });
175
+ }), M = i(() => {
176
+ if (!t.allowCreate) return [];
177
+ const e = new Set(f.value.map((a) => a.value)), l = [];
178
+ return new Set(J.value).forEach((a) => {
179
+ !bl(a) || a === t.showAllField || e.has(a) || l.push({ label: a, value: a, level: 0, path: [], raw: { label: a, value: a } });
181
180
  }), l;
182
- }), N = i(() => [...h.value, ...F.value]);
183
- V([() => a.multiple, () => r.value], ([e, l]) => {
181
+ }), V = i(() => [...f.value, ...M.value]);
182
+ b([() => t.multiple, () => r.value], ([e, l]) => {
184
183
  if (e) {
185
184
  Array.isArray(l) || (r.value = l === void 0 ? [] : [l]);
186
185
  return;
187
186
  }
188
187
  Array.isArray(l) && (r.value = l.at(-1));
189
188
  });
190
- const L = w(), x = w(""), f = w(""), P = w(), R = T("middleRef"), b = T("selectWrapRef"), Z = T("selectRef"), B = w(0);
191
- function ee() {
192
- const e = b.value;
193
- e && (B.value = e.offsetWidth);
189
+ const E = g(), y = g(""), p = g(""), F = g(), P = L("middleRef"), A = L("selectWrapRef"), q = L("selectRef"), $ = g(0);
190
+ function Q() {
191
+ const e = A.value;
192
+ e && ($.value = e.offsetWidth);
194
193
  }
195
- Ol(b, () => ee());
196
- const Ve = i(() => ({
194
+ Fl(A, () => Q());
195
+ const Oe = i(() => ({
197
196
  componentProps: {
198
- multiple: a.multiple,
197
+ multiple: t.multiple,
199
198
  component: {
200
199
  name: "TtPanelSelect"
201
200
  }
202
201
  },
203
202
  component: "TtPanelSelect",
204
- selectWrapRef: b,
205
- selectRef: Z
206
- })), { selectComponentProps: Me } = Vl(Ve), le = i(() => {
207
- const e = x.value.trim().toLowerCase();
208
- if (!e) return z.value;
209
- const l = (t) => {
203
+ selectWrapRef: A,
204
+ selectRef: q
205
+ })), { selectComponentProps: Me } = Pl(Oe), X = i(() => {
206
+ const e = y.value.trim().toLowerCase();
207
+ if (!e) return K.value;
208
+ const l = (a) => {
210
209
  const o = [];
211
- return t.forEach((n) => {
212
- var A;
213
- const s = (A = n.children) != null && A.length ? l(n.children) : void 0;
214
- (String(n.label).toLowerCase().includes(e) || s && s.length) && o.push({ ...n, children: s != null && s.length ? s : void 0 });
210
+ return a.forEach((n) => {
211
+ var oe;
212
+ const u = (oe = n.children) != null && oe.length ? l(n.children) : void 0;
213
+ (String(n.label).toLowerCase().includes(e) || u && u.length) && o.push({ ...n, children: u != null && u.length ? u : void 0 });
215
214
  }), o;
216
215
  };
217
- return l(z.value);
218
- }), Ee = i(() => {
219
- const e = [], l = (t) => {
220
- t.forEach((o) => {
216
+ return l(K.value);
217
+ }), Ve = i(() => {
218
+ const e = [], l = (a) => {
219
+ a.forEach((o) => {
221
220
  var n;
222
221
  e.push(o.value), (n = o.children) != null && n.length && l(o.children);
223
222
  });
224
223
  };
225
- return l(le.value), e;
226
- }), S = i(
227
- () => Fe(f.value).map((e) => ({
224
+ return l(X.value), e;
225
+ }), C = i(
226
+ () => Fe(p.value).map((e) => ({
228
227
  label: e,
229
228
  value: e,
230
229
  level: 0,
231
230
  path: [],
232
231
  raw: { label: e, value: e }
233
232
  }))
234
- ), $e = i(() => [...N.value, ...S.value]), O = i(() => {
235
- const e = j(h.value, f.value), l = xe([...F.value, ...S.value], f.value);
233
+ ), Ee = i(() => [...V.value, ...C.value]), k = i(() => {
234
+ const e = U(f.value, p.value), l = Ce([...M.value, ...C.value], p.value);
236
235
  if (!l.length) return e;
237
- const t = new Map(l.map((s) => [s.value, s])), o = [];
238
- W(f.value, a.separator).forEach((s) => {
239
- const m = t.get(s);
240
- m && (o.push(m), t.delete(s));
241
- }), o.push(...t.values());
236
+ const a = new Map(l.map((u) => [u.value, u])), o = [];
237
+ T(p.value, t.separator).forEach((u) => {
238
+ const N = a.get(u);
239
+ N && (o.push(N), a.delete(u));
240
+ }), o.push(...a.values());
242
241
  let n = "__created__";
243
- for (; e.some((s) => s.value === n); ) n += "_";
242
+ for (; e.some((u) => u.value === n); ) n += "_";
244
243
  return [{ value: n, label: "自定义", options: o }, ...e];
245
244
  });
246
245
  function Fe(e) {
247
- if (!a.allowCreate || a.disabled || I.value || a.api && !q.value) return [];
248
- const l = W(e, a.separator);
249
- if (!l.length || j(h.value, e).length) return [];
250
- const t = new Set(N.value.map((o) => `${o.value}`));
251
- return [...new Set(l)].filter((o) => o !== `${a.showAllField}` && !t.has(o));
246
+ if (!t.allowCreate || t.disabled || D.value || t.api && !W.value) return [];
247
+ const l = T(e, t.separator);
248
+ if (!l.length || U(f.value, e).length) return [];
249
+ const a = new Set(V.value.map((o) => `${o.value}`));
250
+ return [...new Set(l)].filter((o) => o !== `${t.showAllField}` && !a.has(o));
252
251
  }
253
- function Ne() {
254
- if (!S.value.length) return;
252
+ function Pe() {
253
+ if (!C.value.length) return;
255
254
  const e = new Set(
256
- [...F.value, ...S.value].map((t) => t.value)
257
- ), l = [...new Set(W(f.value, a.separator))].filter(
258
- (t) => e.has(t)
255
+ [...M.value, ...C.value].map((a) => a.value)
256
+ ), l = [...new Set(T(p.value, t.separator))].filter(
257
+ (a) => e.has(a)
259
258
  );
260
- ie(l, !0);
259
+ ae(l, !0);
261
260
  }
262
- const Le = i(() => {
261
+ const $e = i(() => {
263
262
  const e = "minmax(var(--tt-panel-select-middle-width, 450px), 1fr)";
264
- return a.showNav && !a.multiple ? `200px ${e}` : !a.showNav && a.multiple ? `${e} 180px` : !a.showNav && !a.multiple ? e : `200px ${e} 180px`;
265
- }), Pe = i(() => {
263
+ return t.showNav && !t.multiple ? `200px ${e}` : !t.showNav && t.multiple ? `${e} 180px` : !t.showNav && !t.multiple ? e : `200px ${e} 180px`;
264
+ }), Ne = i(() => {
266
265
  const e = "var(--tt-panel-select-middle-width, 450px)";
267
- return a.showNav && !a.multiple ? `max(calc(200px + ${e}), 800px)` : !a.showNav && a.multiple ? `max(calc(${e} + 180px), 800px)` : !a.showNav && !a.multiple ? `max(${e}, 800px)` : `max(calc(200px + ${e} + 180px), 800px)`;
268
- }), Re = i(() => {
266
+ return t.showNav && !t.multiple ? `max(calc(200px + ${e}), 800px)` : !t.showNav && t.multiple ? `max(calc(${e} + 180px), 800px)` : !t.showNav && !t.multiple ? `max(${e}, 800px)` : `max(calc(200px + ${e} + 180px), 800px)`;
267
+ }), Le = i(() => {
269
268
  const e = [];
270
- return O.value.forEach((l) => {
271
- !(a.showOriginMode && l.value === "__origin__") && e.push({ key: `group-${String(l.value)}`, type: "group", group: l });
272
- const o = Math.ceil(l.options.length / g);
273
- for (let n = 0; n < l.options.length; n += g) {
274
- const s = n / g;
269
+ return k.value.forEach((l) => {
270
+ !(t.showOriginMode && l.value === "__origin__") && e.push({ key: `group-${String(l.value)}`, type: "group", group: l });
271
+ const o = Math.ceil(l.options.length / m);
272
+ for (let n = 0; n < l.options.length; n += m) {
273
+ const u = n / m;
275
274
  e.push({
276
- key: `options-${String(l.value)}-${n / g}`,
275
+ key: `options-${String(l.value)}-${n / m}`,
277
276
  type: "options",
278
277
  group: l,
279
- options: l.options.slice(n, n + g),
280
- isLast: s === o - 1
278
+ options: l.options.slice(n, n + m),
279
+ isLast: u === o - 1
281
280
  });
282
281
  }
283
282
  }), e;
284
283
  }), {
285
- selectedOptions: Be,
286
- selectedValueSet: te,
287
- isAllChecked: Te,
284
+ selectedOptions: Re,
285
+ selectedValueSet: Y,
286
+ isAllChecked: Be,
288
287
  isIndeterminate: _e,
289
- getGroupCheckCount: Ge,
290
- handleGroupCheck: De,
291
- handleAllOptionCheck: We,
288
+ getGroupCheckCount: Te,
289
+ handleGroupCheck: Ge,
290
+ handleAllOptionCheck: De,
292
291
  handleOptionCheck: Ke,
293
- handleOptionsCheck: Ue,
294
- handleCheckAll: Ie,
295
- clearSelected: ze,
296
- removeSelected: qe,
292
+ handleOptionsCheck: We,
293
+ handleCheckAll: Ue,
294
+ clearSelected: Ie,
295
+ removeSelected: ze,
297
296
  withLockedSelectedValues: je
298
- } = Pl({
299
- multiple: i(() => a.multiple),
297
+ } = Tl({
298
+ multiple: i(() => t.multiple),
300
299
  modelValue: r,
301
- selectedValues: Y,
302
- leafNodes: $e,
303
- allValue: i(() => a.showAllField)
304
- }), ae = i({
300
+ selectedValues: J,
301
+ leafNodes: Ee,
302
+ allValue: i(() => t.showAllField)
303
+ }), Z = i({
305
304
  get() {
306
- if (a.multiple)
307
- return (Array.isArray(r.value) ? r.value : r.value === void 0 ? [] : [r.value]).map((l) => $(l));
305
+ if (t.multiple)
306
+ return (Array.isArray(r.value) ? r.value : r.value === void 0 ? [] : [r.value]).map((l) => O(l));
308
307
  if (Array.isArray(r.value)) {
309
308
  const e = r.value.at(-1);
310
- return e === void 0 ? void 0 : $(e);
309
+ return e === void 0 ? void 0 : O(e);
311
310
  }
312
- return r.value === void 0 ? void 0 : $(r.value);
311
+ return r.value === void 0 ? void 0 : O(r.value);
313
312
  },
314
313
  set(e) {
315
- const l = u(r);
316
- if (J = Array.isArray(l) ? [...l] : l, a.multiple) {
317
- const o = (Array.isArray(e) ? e : []).map((n) => X(n)).filter((n) => n !== void 0);
314
+ const l = s(r);
315
+ if (I = Array.isArray(l) ? [...l] : l, t.multiple) {
316
+ const o = (Array.isArray(e) ? e : []).map((n) => H(n)).filter((n) => n !== void 0);
318
317
  r.value = je(o);
319
318
  return;
320
319
  }
321
- r.value = X(e);
320
+ r.value = H(e);
322
321
  }
323
- }), oe = i(
322
+ }), ee = i(
324
323
  () => {
325
324
  const e = {}, l = {};
326
- return O.value.forEach((t) => {
327
- const { enabledCount: o, checkedCount: n } = Ge(t), s = String(t.value);
328
- e[s] = o > 0 && n === o, l[s] = o > 0 && n > 0 && n < o;
325
+ return k.value.forEach((a) => {
326
+ const { enabledCount: o, checkedCount: n } = Te(a), u = String(a.value);
327
+ e[u] = o > 0 && n === o, l[u] = o > 0 && n > 0 && n < o;
329
328
  }), { checkedMap: e, indeterminateMap: l };
330
329
  }
331
- ), Je = i(() => oe.value.checkedMap), He = i(() => oe.value.indeterminateMap), Qe = i(() => te.value.has(a.showAllField)), ne = i(() => [...a.showAll ? [{ label: "全部", value: a.showAllField }] : [], ...N.value.map((l) => ({ ...l }))]);
332
- function Xe(e) {
333
- const l = u(ne);
330
+ ), He = i(() => ee.value.checkedMap), Je = i(() => ee.value.indeterminateMap), qe = i(() => Y.value.has(t.showAllField)), le = i(() => [...t.showAll ? [{ label: "全部", value: t.showAllField }] : [], ...V.value.map((l) => ({ ...l }))]);
331
+ function Qe(e) {
332
+ const l = s(le);
334
333
  if (Array.isArray(e)) {
335
- const t = new Set(e);
336
- return l.filter((o) => o.value !== void 0 && t.has(o.value));
334
+ const a = new Set(e);
335
+ return l.filter((o) => o.value !== void 0 && a.has(o.value));
337
336
  }
338
337
  if (e !== void 0)
339
- return l.find((t) => t.value === e);
338
+ return l.find((a) => a.value === e);
339
+ }
340
+ function Xe(e) {
341
+ var a;
342
+ if (t.showPinyinMode || k.value.some((o) => o.value === e.value)) return e.value;
343
+ const l = f.value.find((o) => o.path.some((n) => n.value === e.value));
344
+ return (a = l == null ? void 0 : l.path.at(-2)) == null ? void 0 : a.value;
340
345
  }
341
346
  function Ye(e) {
342
- var t;
343
- if (a.showPinyinMode || O.value.some((o) => o.value === e.value)) return e.value;
344
- const l = h.value.find((o) => o.path.some((n) => n.value === e.value));
345
- return (t = l == null ? void 0 : l.path.at(-2)) == null ? void 0 : t.value;
347
+ E.value = e.value;
348
+ const l = Xe(e);
349
+ F.value = void 0, _(() => {
350
+ var a;
351
+ F.value = l, l !== void 0 && ((a = P.value) == null || a.scrollToGroup(l));
352
+ });
346
353
  }
347
354
  function Ze(e) {
348
- L.value = e.value;
349
- const l = Ye(e);
350
- P.value = void 0, D(() => {
351
- var t;
352
- P.value = l, l !== void 0 && ((t = R.value) == null || t.scrollToGroup(l));
353
- });
355
+ y.value = e;
354
356
  }
355
357
  function el(e) {
356
- x.value = e;
357
- }
358
- function ll(e) {
359
- f.value = e;
358
+ p.value = e;
360
359
  }
361
- function tl(e, l) {
362
- const t = O.value.find((o) => o.value === e);
363
- t && De(t, l);
360
+ function ll(e, l) {
361
+ const a = k.value.find((o) => o.value === e);
362
+ a && Ge(a, l);
364
363
  }
365
- async function al(e) {
364
+ async function tl(e) {
366
365
  var l;
367
- E("visible-change", e), e && (f.value = "", x.value = "", await D(), (l = R.value) == null || l.inputFocus(), ee(), a.alwaysLoad ? await k() : !a.immediate && !u(q) && await k());
366
+ S("visible-change", e), e && (p.value = "", y.value = "", await _(), (l = P.value) == null || l.inputFocus(), Q(), t.alwaysLoad ? await v() : !t.immediate && !s(W) && await v());
368
367
  }
369
- function ol() {
370
- re(J);
368
+ function al() {
369
+ te(I);
371
370
  }
372
- function nl(e) {
373
- E("change", e, [...u(ne)], Xe(e));
371
+ function ol(e) {
372
+ S("change", e, [...s(le)], Qe(e));
374
373
  }
375
- function rl(e, l) {
376
- return Array.isArray(e) && Array.isArray(l) ? e.length === l.length && e.every((t, o) => t === l[o]) : e === l;
374
+ function nl(e, l) {
375
+ return Array.isArray(e) && Array.isArray(l) ? e.length === l.length && e.every((a, o) => a === l[o]) : e === l;
377
376
  }
378
- function re(e) {
379
- D(() => {
380
- const l = u(r);
381
- rl(l, e) || nl(l);
377
+ function te(e) {
378
+ _(() => {
379
+ const l = s(r);
380
+ nl(l, e) || ol(l);
382
381
  });
383
382
  }
384
- function v(e) {
385
- const l = u(r), t = Array.isArray(l) ? [...l] : l;
386
- e(), re(t);
383
+ function h(e) {
384
+ const l = s(r), a = Array.isArray(l) ? [...l] : l;
385
+ e(), te(a);
387
386
  }
388
- function il(e) {
389
- v(() => {
390
- We(e);
387
+ function rl(e) {
388
+ h(() => {
389
+ De(e);
391
390
  });
392
391
  }
393
- function sl(e) {
394
- v(() => {
395
- Ie(e);
392
+ function il(e) {
393
+ h(() => {
394
+ Ue(e);
396
395
  });
397
396
  }
398
- function ul(e, l) {
399
- v(() => {
400
- tl(e, l);
397
+ function sl(e, l) {
398
+ h(() => {
399
+ ll(e, l);
401
400
  });
402
401
  }
403
- function cl(e, l) {
404
- v(() => {
402
+ function ul(e, l) {
403
+ h(() => {
405
404
  Ke(e, l);
406
405
  });
407
406
  }
408
- function ie(e, l) {
409
- v(() => {
410
- Ue(e, l);
407
+ function ae(e, l) {
408
+ h(() => {
409
+ We(e, l);
411
410
  });
412
411
  }
413
- function dl(e) {
414
- v(() => {
415
- qe(e);
412
+ function cl(e) {
413
+ h(() => {
414
+ ze(e);
416
415
  });
417
416
  }
418
- function pl() {
419
- v(() => {
420
- ze();
417
+ function dl() {
418
+ h(() => {
419
+ Ie();
421
420
  });
422
421
  }
423
- function fl(e) {
424
- E("focus", e);
422
+ function pl(e) {
423
+ S("focus", e);
425
424
  }
426
- return V(
427
- () => a.params,
425
+ return b(
426
+ () => t.params,
428
427
  () => {
429
- k();
428
+ v();
430
429
  },
431
430
  { deep: !0 }
432
- ), V(
433
- Ce,
431
+ ), b(
432
+ Ae,
434
433
  (e) => {
435
434
  var l;
436
- L.value !== void 0 || !e.length || (L.value = (l = e[0]) == null ? void 0 : l.value);
435
+ E.value !== void 0 || !e.length || (E.value = (l = e[0]) == null ? void 0 : l.value);
437
436
  },
438
437
  { immediate: !0 }
439
438
  ), ml(() => {
440
- a.immediate && k();
441
- }), he({
439
+ t.immediate && v();
440
+ }), de({
442
441
  /** 重新加载数据源*/
443
- reload: k,
442
+ reload: v,
444
443
  /** 获取当前归一化后的树形选项数据 */
445
- getOptions: () => u(Ae),
444
+ getOptions: () => s(ye),
446
445
  /** 获取当前v-model值 */
447
- getValue: () => u(r)
448
- }), (e, l) => (C(), _("div", {
446
+ getValue: () => s(r)
447
+ }), (e, l) => (w(), R("div", {
449
448
  ref_key: "selectWrapRef",
450
- ref: b,
451
- class: M(u(p))
449
+ ref: A,
450
+ class: x(s(d))
452
451
  }, [
453
- ce(u(we), wl({
452
+ re(s(he), vl({
454
453
  ref_key: "selectRef",
455
- ref: Z,
456
- modelValue: ae.value,
457
- "onUpdate:modelValue": l[0] || (l[0] = (t) => ae.value = t)
458
- }, u(Me), {
459
- multiple: d.multiple,
454
+ ref: q,
455
+ modelValue: Z.value,
456
+ "onUpdate:modelValue": l[0] || (l[0] = (a) => Z.value = a)
457
+ }, s(Me), {
458
+ multiple: c.multiple,
460
459
  filterable: !1,
461
- placeholder: be.value,
460
+ placeholder: ke.value,
462
461
  persistent: !1,
463
462
  "fallback-placements": ["bottom-start", "bottom-end", "bottom", "top-start", "top-end", "top", "right", "left"],
464
- disabled: d.disabled,
465
- "popper-class": `${u(p)}__popper vxe-table--ignore-clear`,
466
- onVisibleChange: al,
467
- onChange: ol,
468
- onFocus: fl
463
+ disabled: c.disabled,
464
+ "popper-class": `${s(d)}__popper vxe-table--ignore-clear`,
465
+ onVisibleChange: tl,
466
+ onChange: al,
467
+ onFocus: pl
469
468
  }), {
470
- label: de(({ label: t, value: o }) => [
471
- fe("span", {
472
- class: M(`${u(p)}__trigger-label`)
469
+ label: ie(({ label: a, value: o }) => [
470
+ ue("span", {
471
+ class: x(`${s(d)}__trigger-label`)
473
472
  }, [
474
- fe("span", null, kl(t), 1),
475
- Oe(o) ? (C(), _("span", {
473
+ ue("span", null, yl(a), 1),
474
+ xe(o) ? (w(), R("span", {
476
475
  key: 0,
477
- class: M(`${u(p)}__deleted-mark`)
478
- }, "删", 2)) : G("", !0)
476
+ class: x(`${s(d)}__deleted-mark`)
477
+ }, "删", 2)) : B("", !0)
479
478
  ], 2)
480
479
  ]),
481
- empty: de(() => [
482
- gl((C(), _("div", {
480
+ empty: ie(() => [
481
+ gl((w(), R("div", {
483
482
  "element-loading-text": "加载中",
484
- class: M(`${u(p)}__panel`),
485
- style: yl({
486
- "--columns": Le.value,
487
- "--panel-min-width": Pe.value,
488
- "--panel-width": B.value ? `${B.value}px` : "100%"
483
+ class: x(`${s(d)}__panel`),
484
+ style: wl({
485
+ "--columns": $e.value,
486
+ "--panel-min-width": Ne.value,
487
+ "--panel-width": $.value ? `${$.value}px` : "100%"
489
488
  })
490
489
  }, [
491
- a.showNav ? (C(), pe($l, {
490
+ t.showNav ? (w(), se(Ll, {
492
491
  key: 0,
493
- "prefix-cls": u(p),
494
- keyword: x.value,
495
- "tree-data": le.value,
496
- "expanded-keys": Ee.value,
497
- "left-placeholder": d.leftPlaceholder,
498
- "onUpdate:keyword": el,
499
- onSelect: Ze
500
- }, null, 8, ["prefix-cls", "keyword", "tree-data", "expanded-keys", "left-placeholder"])) : G("", !0),
501
- ce(Fl, {
492
+ "prefix-cls": s(d),
493
+ keyword: y.value,
494
+ "tree-data": X.value,
495
+ "expanded-keys": Ve.value,
496
+ "left-placeholder": c.leftPlaceholder,
497
+ "onUpdate:keyword": Ze,
498
+ onSelect: Ye
499
+ }, null, 8, ["prefix-cls", "keyword", "tree-data", "expanded-keys", "left-placeholder"])) : B("", !0),
500
+ re(Rl, {
502
501
  ref_key: "middleRef",
503
- ref: R,
504
- "allow-create": a.allowCreate,
505
- "prefix-cls": u(p),
506
- multiple: d.multiple,
507
- keyword: f.value,
508
- rows: Re.value,
509
- disabled: H.value,
510
- "show-all": a.showAll,
511
- "option-per-row": g,
502
+ ref: P,
503
+ "allow-create": t.allowCreate,
504
+ "prefix-cls": s(d),
505
+ multiple: c.multiple,
506
+ keyword: p.value,
507
+ rows: Le.value,
508
+ disabled: z.value,
509
+ "show-all": t.showAll,
510
+ "option-per-row": m,
512
511
  "row-height": 40,
513
- "selected-value-set": u(te),
514
- "is-all-checked": u(Te),
515
- "is-indeterminate": u(_e),
516
- "all-checked": Qe.value,
517
- "scroll-to-group-value": P.value,
518
- "group-checked-map": Je.value,
519
- "group-indeterminate-map": He.value,
520
- "paste-search": d.pasteSearch,
521
- separator: d.separator,
522
- "middle-placeholder": d.middlePlaceholder,
523
- "show-multiple": d.showMultiple,
524
- "onUpdate:keyword": ll,
525
- onAllCheck: il,
526
- onCheckAll: sl,
527
- onGroupCheck: ul,
528
- onOptionCheck: cl,
529
- onOptionsCheck: ie,
530
- onSelectCreatedOptions: Ne
512
+ "selected-value-set": s(Y),
513
+ "is-all-checked": s(Be),
514
+ "is-indeterminate": s(_e),
515
+ "all-checked": qe.value,
516
+ "scroll-to-group-value": F.value,
517
+ "group-checked-map": He.value,
518
+ "group-indeterminate-map": Je.value,
519
+ "paste-search": c.pasteSearch,
520
+ separator: c.separator,
521
+ "middle-placeholder": c.middlePlaceholder,
522
+ "show-multiple": c.showMultiple,
523
+ "onUpdate:keyword": el,
524
+ onAllCheck: rl,
525
+ onCheckAll: il,
526
+ onGroupCheck: sl,
527
+ onOptionCheck: ul,
528
+ onOptionsCheck: ae,
529
+ onSelectCreatedOptions: Pe
531
530
  }, null, 8, ["allow-create", "prefix-cls", "multiple", "keyword", "rows", "disabled", "show-all", "selected-value-set", "is-all-checked", "is-indeterminate", "all-checked", "scroll-to-group-value", "group-checked-map", "group-indeterminate-map", "paste-search", "separator", "middle-placeholder", "show-multiple"]),
532
- a.multiple ? (C(), pe(Nl, {
531
+ t.multiple ? (w(), se(Bl, {
533
532
  key: 1,
534
- "prefix-cls": u(p),
535
- multiple: d.multiple,
536
- disabled: H.value,
537
- "selected-options": u(Be),
538
- onClearAll: pl,
539
- onRemove: dl
540
- }, null, 8, ["prefix-cls", "multiple", "disabled", "selected-options"])) : G("", !0)
533
+ "prefix-cls": s(d),
534
+ multiple: c.multiple,
535
+ disabled: z.value,
536
+ "selected-options": s(Re),
537
+ onClearAll: dl,
538
+ onRemove: cl
539
+ }, null, 8, ["prefix-cls", "multiple", "disabled", "selected-options"])) : B("", !0)
541
540
  ], 6)), [
542
- [u(me), u(I)]
541
+ [s(fe), s(D)]
543
542
  ])
544
543
  ]),
545
544
  _: 1
@@ -548,5 +547,5 @@ const g = 4, ct = /* @__PURE__ */ hl({
548
547
  }
549
548
  });
550
549
  export {
551
- ct as default
550
+ ht as default
552
551
  };
@@ -84,8 +84,15 @@ export interface PanelContainerProps {
84
84
  /**
85
85
  * 主 options 缺码时按 value 补拉(选中态回显)。
86
86
  * 由 usePanelSelectSchemas 在 CODE 声明了 fetchMissingOptions 时注入;组件内 watch modelValue 调用。
87
+ * 结果写入全局 panel echo(按 missingEchoKey 隔离),跨实例 / 重挂复用,同缺码在途去重。
87
88
  */
88
89
  resolveMissingOptions?: (codes: Array<string | number>) => Promise<PanelSelectOption[]>;
90
+ /**
91
+ * 自定义 resolveMissingOptions 的全局 echo 作用域。
92
+ * 同作用域内按 value 共享缺码回显;不同业务含义请传不同 key。
93
+ * @default '__tt_panel_select__'
94
+ */
95
+ missingEchoKey?: string;
89
96
  /** 树转换与字段映射配置 */
90
97
  treeConfig?: PanelSelectTreeConfig;
91
98
  /** 是否在组件初始化时立即请求 */
@@ -1,5 +1,19 @@
1
1
  import { BasicDataCode, BasicDataOption } from './basicDataCodes';
2
- /** 供 dataSource computed 订阅;写入 echo 后自增 */
2
+ /**
3
+ * PanelSelect 缺码 echo 节点:差集只扫 value/children。
4
+ * label 可缺省,兼容 `PanelSelectOption`(label?: string)。
5
+ */
6
+ export type PanelMissingEchoOption = {
7
+ label?: string;
8
+ value?: string | number | null;
9
+ children?: PanelMissingEchoOption[];
10
+ deleted?: boolean;
11
+ disabled?: boolean;
12
+ [key: string]: any;
13
+ };
14
+ /** PanelSelect 缺码 echo 默认作用域(业务可传 missingEchoKey 隔离) */
15
+ export declare const PANEL_MISSING_ECHO_DEFAULT_SCOPE = "__tt_panel_select__";
16
+ /** 供 dataSource / PanelSelect mergedOptions 订阅;写入 echo 后自增 */
3
17
  export declare const missingOptionsEchoVersion: import('vue').Ref<number, number>;
4
18
  /**
5
19
  * 展开 values:数组项若为拼接串则拆开,去空、去重(保序)。
@@ -23,5 +37,17 @@ export declare function withMissingOptionDisabled(options: BasicDataOption[] | u
23
37
  * @returns 本次相关的 echo options(含缓存命中)
24
38
  */
25
39
  export declare function ensureMissingOptions(routePath: string, code: BasicDataCode, values: Array<string | number>, mainOptions?: BasicDataOption[]): Promise<BasicDataOption[]>;
40
+ /** 读取 PanelSelect 作用域下已缓存的缺码 options(扁平) */
41
+ export declare function getPanelMissingEchoOptions(scopeKey?: string): PanelMissingEchoOption[];
42
+ /**
43
+ * 自定义 resolveMissingOptions 的差集补拉:全局 echo + 同缺码在途去重。
44
+ * 供 TtPanelSelect watch 调用;不依赖 CODE_REGISTRY。
45
+ * @returns 本次相关的 echo options(含缓存命中)
46
+ */
47
+ export declare function ensurePanelResolveMissingOptions(scopeKey: string, values: Array<string | number>, mainOptions: PanelMissingEchoOption[] | undefined, fetchMissing: (codes: Array<string | number>) => Promise<PanelMissingEchoOption[]>): Promise<PanelMissingEchoOption[]>;
48
+ /** 仅根据主 options + 全局 panel echo 计算仍缺的码(不做请求) */
49
+ export declare function diffPanelMissingCodes(scopeKey: string, values: Array<string | number>, mainOptions?: PanelMissingEchoOption[]): Array<string | number>;
26
50
  /** 清空某路由下全部 echo(可选,供调试 / 路由卸载) */
27
51
  export declare function clearMissingOptionsEcho(routePath?: string): void;
52
+ /** 清空 PanelSelect 自定义 resolve 的全局 echo(可选,供调试) */
53
+ export declare function clearPanelMissingEcho(scopeKey?: string): void;
@@ -1,96 +1,133 @@
1
- import { ref as M } from "vue";
2
- import { CODE_REGISTRY as w } from "./basicDataCodes.js";
3
- const y = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), O = M(0);
4
- function g(r, o) {
5
- return `${r}::${o}`;
1
+ import { ref as P } from "vue";
2
+ import { CODE_REGISTRY as k } from "./basicDataCodes.js";
3
+ const A = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), K = "__tt_panel_select__", _ = P(0);
4
+ function E(r, e) {
5
+ return `${r}::${e}`;
6
6
  }
7
7
  function f(r) {
8
8
  return String(r);
9
9
  }
10
- const S = /[,,|/]/;
11
- function K(r = []) {
12
- const o = [], n = /* @__PURE__ */ new Set();
13
- return (Array.isArray(r) ? r : []).forEach((e) => {
14
- if (!(e == null || e === "")) {
15
- if (typeof e == "number") {
16
- const s = f(e);
10
+ const C = /[,,|/]/;
11
+ function R(r = []) {
12
+ const e = [], n = /* @__PURE__ */ new Set();
13
+ return (Array.isArray(r) ? r : []).forEach((o) => {
14
+ if (!(o == null || o === "")) {
15
+ if (typeof o == "number") {
16
+ const s = f(o);
17
17
  if (n.has(s)) return;
18
- n.add(s), o.push(e);
18
+ n.add(s), e.push(o);
19
19
  return;
20
20
  }
21
- String(e).split(S).map((s) => s.trim()).filter(Boolean).forEach((s) => {
22
- n.has(s) || (n.add(s), o.push(s));
21
+ String(o).split(C).map((s) => s.trim()).filter(Boolean).forEach((s) => {
22
+ n.has(s) || (n.add(s), e.push(s));
23
23
  });
24
24
  }
25
- }), o;
25
+ }), e;
26
26
  }
27
- function E(r) {
28
- const o = /* @__PURE__ */ new Set(), n = (e = []) => {
29
- e.forEach((s) => {
27
+ function O(r = []) {
28
+ const e = /* @__PURE__ */ new Set(), n = (o = []) => {
29
+ o.forEach((s) => {
30
30
  var u;
31
31
  if ((u = s.children) != null && u.length) {
32
32
  n(s.children);
33
33
  return;
34
34
  }
35
- s.value !== void 0 && s.value !== null && s.value !== "" && o.add(f(s.value));
35
+ s.value !== void 0 && s.value !== null && s.value !== "" && e.add(f(s.value));
36
36
  });
37
37
  };
38
- return n(Array.isArray(r) ? r : []), o;
38
+ return n(Array.isArray(r) ? r : []), e;
39
39
  }
40
- function k(r, o) {
41
- const n = g(r, o);
42
- let e = y.get(n);
43
- return e || (e = /* @__PURE__ */ new Map(), y.set(n, e)), e;
40
+ function $(r, e) {
41
+ const n = E(r, e);
42
+ let o = A.get(n);
43
+ return o || (o = /* @__PURE__ */ new Map(), A.set(n, o)), o;
44
44
  }
45
- function R(r, o) {
46
- const n = y.get(g(r, o));
45
+ function B(r, e) {
46
+ const n = A.get(E(r, e));
47
47
  return n ? Array.from(n.values()) : [];
48
48
  }
49
- function C(r, o, n = []) {
50
- const e = Array.isArray(n) ? n : [], s = R(r, o);
51
- if (!s.length) return e;
52
- const u = E(e), t = s.filter((a) => a.value !== void 0 && !u.has(f(a.value)));
53
- return t.length ? [...e, ...t] : e;
49
+ function x(r, e, n = []) {
50
+ const o = Array.isArray(n) ? n : [], s = B(r, e);
51
+ if (!s.length) return o;
52
+ const u = O(o), a = s.filter((t) => t.value !== void 0 && !u.has(f(t.value)));
53
+ return a.length ? [...o, ...a] : o;
54
54
  }
55
- function V(r = [], o) {
55
+ function V(r = [], e) {
56
56
  return !Array.isArray(r) || !r.length ? Array.isArray(r) ? r : [] : r.map((n) => {
57
- var e;
58
- return (e = n == null ? void 0 : n.children) != null && e.length ? { ...n, children: V(n.children, o) } : (n == null ? void 0 : n.deleted) === !0 ? { ...n, disabled: o } : n;
57
+ var o;
58
+ return (o = n == null ? void 0 : n.children) != null && o.length ? { ...n, children: V(n.children, e) } : (n == null ? void 0 : n.deleted) === !0 ? { ...n, disabled: e } : n;
59
59
  });
60
60
  }
61
- function $(r, o, n) {
62
- const e = E(o), s = [], u = /* @__PURE__ */ new Set();
63
- return K(r).forEach((t) => {
64
- const a = f(t);
65
- u.has(a) || e.has(a) || n.has(a) || (u.add(a), s.push(t));
61
+ function M(r, e, n) {
62
+ const o = O(e), s = [], u = /* @__PURE__ */ new Set();
63
+ return R(r).forEach((a) => {
64
+ const t = f(a);
65
+ u.has(t) || o.has(t) || n.has(t) || (u.add(t), s.push(a));
66
66
  }), s;
67
67
  }
68
- async function D(r, o, n, e = []) {
69
- const s = w[o], u = s == null ? void 0 : s.fetchMissingOptions, t = k(r, o);
68
+ async function L(r, e, n, o = []) {
69
+ const s = k[e], u = s == null ? void 0 : s.fetchMissingOptions, a = $(r, e);
70
70
  if (!u)
71
- return Array.from(t.values());
72
- const a = $(n, e, t);
73
- if (!a.length)
74
- return Array.from(t.values());
75
- const i = `${g(r, o)}::${a.map(f).sort().join(",")}`;
76
- let l = h.get(i);
77
- return l || (l = u(a).then((d) => {
78
- const v = Array.isArray(d) ? d : [];
79
- let p = !1;
80
- return v.forEach((c) => {
71
+ return Array.from(a.values());
72
+ const t = M(n, o, a);
73
+ if (!t.length)
74
+ return Array.from(a.values());
75
+ const i = `${E(r, e)}::${t.map(f).sort().join(",")}`;
76
+ let h = p.get(i);
77
+ return h || (h = u(t).then((y) => {
78
+ const c = Array.isArray(y) ? y : [];
79
+ let g = !1;
80
+ return c.forEach((l) => {
81
+ if ((l == null ? void 0 : l.value) === void 0 || (l == null ? void 0 : l.value) === null || (l == null ? void 0 : l.value) === "") return;
82
+ const w = f(l.value);
83
+ a.has(w) || (a.set(w, l), g = !0);
84
+ }), g && (_.value += 1), Array.from(a.values());
85
+ }).finally(() => {
86
+ p.get(i) === h && p.delete(i);
87
+ }), p.set(i, h)), h;
88
+ }
89
+ function S(r) {
90
+ const e = r || K;
91
+ let n = v.get(e);
92
+ return n || (n = /* @__PURE__ */ new Map(), v.set(e, n)), n;
93
+ }
94
+ function N(r) {
95
+ const e = v.get(r);
96
+ return e ? Array.from(e.values()) : [];
97
+ }
98
+ async function T(r, e, n = [], o) {
99
+ const s = S(r);
100
+ if (!o)
101
+ return Array.from(s.values());
102
+ const u = M(e, n, s);
103
+ if (!u.length)
104
+ return Array.from(s.values());
105
+ const a = `${r}::${u.map(f).sort().join(",")}`;
106
+ let t = d.get(a);
107
+ return t || (t = Promise.resolve().then(() => o(u)).then((i) => {
108
+ const h = Array.isArray(i) ? i : [];
109
+ let y = !1;
110
+ return h.forEach((c) => {
81
111
  if ((c == null ? void 0 : c.value) === void 0 || (c == null ? void 0 : c.value) === null || (c == null ? void 0 : c.value) === "") return;
82
- const A = f(c.value);
83
- t.has(A) || (t.set(A, c), p = !0);
84
- }), p && (O.value += 1), Array.from(t.values());
112
+ const g = f(c.value);
113
+ s.has(g) || (s.set(g, c), y = !0);
114
+ }), y && (_.value += 1), Array.from(s.values());
85
115
  }).finally(() => {
86
- h.get(i) === l && h.delete(i);
87
- }), h.set(i, l)), l;
116
+ d.get(a) === t && d.delete(a);
117
+ }), d.set(a, t)), t;
118
+ }
119
+ function j(r, e, n = []) {
120
+ return M(e, n, S(r));
88
121
  }
89
122
  export {
90
- D as ensureMissingOptions,
91
- K as expandJoinedOptionValues,
92
- R as getEchoOptions,
93
- C as getMergedOptions,
94
- O as missingOptionsEchoVersion,
123
+ K as PANEL_MISSING_ECHO_DEFAULT_SCOPE,
124
+ j as diffPanelMissingCodes,
125
+ L as ensureMissingOptions,
126
+ T as ensurePanelResolveMissingOptions,
127
+ R as expandJoinedOptionValues,
128
+ B as getEchoOptions,
129
+ x as getMergedOptions,
130
+ N as getPanelMissingEchoOptions,
131
+ _ as missingOptionsEchoVersion,
95
132
  V as withMissingOptionDisabled
96
133
  };
@@ -74,9 +74,7 @@ function oe(r = {}, l = te, c) {
74
74
  showAll: re
75
75
  });
76
76
  if (R && !c) {
77
- const e = String(
78
- ((H = (Z = r.fieldConfigs) == null ? void 0 : Z.purchasePlaceId) == null ? void 0 : H.fieldName) || ee.purchasePlaceId
79
- );
77
+ const e = String(((H = (Z = r.fieldConfigs) == null ? void 0 : Z.purchasePlaceId) == null ? void 0 : H.fieldName) || ee.purchasePlaceId);
80
78
  be(P, G.PURCHASE_PLACE, e);
81
79
  }
82
80
  const D = R && !c ? Ie(() => {
@@ -209,7 +207,11 @@ function oe(r = {}, l = te, c) {
209
207
  };
210
208
  }
211
209
  function q(e, t, n, o, i) {
212
- const s = b(e), u = Ee(s.componentProps, t, n, o), f = E(e), { onChange: a, resolveMissingOptions: S, ...m } = u, d = K(s.customOptions) ? s.customOptions(t, o) : o, I = w(e) === "TtPanelSelect", F = I && e === "shopId" ? ie(d) : I && e === "purchasePlaceId" ? se(d) : d, v = I ? X(F) : d, ae = I && e === "purchasePlaceId";
210
+ const s = b(e), u = Ee(s.componentProps, t, n, o), f = E(e), {
211
+ onChange: a,
212
+ resolveMissingOptions: S,
213
+ ...m
214
+ } = u, d = K(s.customOptions) ? s.customOptions(t, o) : o, I = w(e) === "TtPanelSelect", F = I && e === "shopId" ? ie(d) : I && e === "purchasePlaceId" ? se(d) : d, v = I ? X(F) : d, ae = I && e === "purchasePlaceId";
213
215
  return I ? {
214
216
  multiple: f,
215
217
  showAll: s.showAll ?? (e === "shopId" && g === "action" ? V(h(t, p("platformId"))).length > 0 : !0),
@@ -104,7 +104,11 @@ function He(t, n = {}) {
104
104
  const A = D(r, e.code);
105
105
  let O = w ? se(o[w], A) : A;
106
106
  re(e.customOptions) && (O = e.customOptions(o, O) || []);
107
- const b = q(O), U = ee(e.componentProps, o, u, O), { onChange: Q, resolveMissingOptions: E, ...I } = U;
107
+ const b = q(O), U = ee(e.componentProps, o, u, O), {
108
+ onChange: Q,
109
+ resolveMissingOptions: E,
110
+ ...I
111
+ } = U;
108
112
  return {
109
113
  multiple: K,
110
114
  showAll: ce,
@@ -183,7 +187,11 @@ function He(t, n = {}) {
183
187
  rules: o.rules,
184
188
  dependencies: I,
185
189
  componentProps: (d, x) => {
186
- const y = D(r, e.code), M = oe(d[h], y, _), ae = q(M), de = ee(o.componentProps, d, x, M), { onChange: Fe, resolveMissingOptions: be, ...me } = de;
190
+ const y = D(r, e.code), M = oe(d[h], y, _), ae = q(M), de = ee(o.componentProps, d, x, M), {
191
+ onChange: Fe,
192
+ resolveMissingOptions: be,
193
+ ...me
194
+ } = de;
187
195
  return {
188
196
  multiple: b,
189
197
  showAll: U,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dazhicheng/ui",
3
- "version": "1.6.80",
3
+ "version": "1.6.81",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",