@dazhicheng/ui 1.6.9 → 1.6.10
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/components/tt-panel-select/src/common.d.ts +10 -0
- package/dist/components/tt-panel-select/src/common.js +23 -2
- package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.d.ts +2 -1
- package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.js +122 -117
- package/dist/components/tt-panel-select/src/hooks/usePanelData.d.ts +1 -3
- package/dist/components/tt-panel-select/src/hooks/usePanelData.js +62 -55
- package/dist/components/tt-panel-select/src/hooks/usePanelSelection.d.ts +4 -2
- package/dist/components/tt-panel-select/src/hooks/usePanelSelection.js +73 -72
- package/dist/components/tt-panel-select/src/index.vue.d.ts +5 -3
- package/dist/components/tt-panel-select/src/index.vue.js +181 -179
- package/dist/components/tt-panel-select/src/types.d.ts +8 -5
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as ze, mergeModels as
|
|
1
|
+
import { defineComponent as ze, mergeModels as I, useModel as je, computed as s, watch as V, ref as h, useTemplateRef as O, unref as i, onMounted as qe, createElementBlock as z, openBlock as g, normalizeClass as j, createVNode as q, mergeProps as He, withCtx as Je, withDirectives as Qe, normalizeStyle as Xe, createBlock as H, createCommentVNode as J, nextTick as M } from "vue";
|
|
2
2
|
import "../../../node_modules/.pnpm/vue-types@5.1.3_vue@3.5.21_typescript@5.9.3_/node_modules/vue-types/shim/index.modern.js";
|
|
3
3
|
import { useDesign as Ye } from "../../../packages/hooks/src/useDesign.js";
|
|
4
4
|
import "axios";
|
|
@@ -17,17 +17,17 @@ import "lodash-es";
|
|
|
17
17
|
import "vue-router";
|
|
18
18
|
import { useResizeObserver as ll } from "@vueuse/core";
|
|
19
19
|
import { useSelectCollapseOptions as tl } from "../../tt-form/src/hooks/useSelectCollapse.js";
|
|
20
|
-
import { ALL as al } from "./common.js";
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import { usePanelSelectData as
|
|
25
|
-
import { usePanelSelectSelection as
|
|
20
|
+
import { ALL as al, DEFAULT_PANEL_SELECT_SEPARATORS as ol } from "./common.js";
|
|
21
|
+
import nl from "./components/PanelLeft.vue.js";
|
|
22
|
+
import rl from "./components/PanelMiddle.vue.js";
|
|
23
|
+
import il from "./components/PanelRight.vue.js";
|
|
24
|
+
import { usePanelSelectData as sl } from "./hooks/usePanelData.js";
|
|
25
|
+
import { usePanelSelectSelection as ul } from "./hooks/usePanelSelection.js";
|
|
26
26
|
/* empty css */
|
|
27
|
-
const p = 4,
|
|
27
|
+
const p = 4, Tl = /* @__PURE__ */ ze({
|
|
28
28
|
name: "TtPanelSelect",
|
|
29
29
|
__name: "index",
|
|
30
|
-
props: /* @__PURE__ */
|
|
30
|
+
props: /* @__PURE__ */ I({
|
|
31
31
|
disabled: { type: Boolean, default: !1 },
|
|
32
32
|
showNav: { type: Boolean, default: !0 },
|
|
33
33
|
multiple: { type: Boolean, default: !0 },
|
|
@@ -47,7 +47,7 @@ const p = 4, El = /* @__PURE__ */ ze({
|
|
|
47
47
|
immediate: { type: Boolean, default: !0 },
|
|
48
48
|
beforeFetch: { type: Function, default: void 0 },
|
|
49
49
|
afterFetch: { type: Function, default: void 0 },
|
|
50
|
-
separator: { default:
|
|
50
|
+
separator: { default: () => [...ol] },
|
|
51
51
|
pasteSearch: { type: Boolean, default: !0 },
|
|
52
52
|
alwaysLoad: { type: Boolean, default: !1 },
|
|
53
53
|
showAll: { type: Boolean, default: !0 },
|
|
@@ -61,52 +61,52 @@ const p = 4, El = /* @__PURE__ */ ze({
|
|
|
61
61
|
modelValue: {},
|
|
62
62
|
modelModifiers: {}
|
|
63
63
|
}),
|
|
64
|
-
emits: /* @__PURE__ */
|
|
65
|
-
setup(
|
|
66
|
-
const
|
|
67
|
-
loading:
|
|
64
|
+
emits: /* @__PURE__ */ I(["visible-change", "change"], ["update:modelValue"]),
|
|
65
|
+
setup(E, { expose: Q, emit: X }) {
|
|
66
|
+
const Y = el, Z = Ze, t = E, F = X, { prefixCls: c } = Ye("panel-select"), {
|
|
67
|
+
loading: ee,
|
|
68
68
|
fetchApi: m,
|
|
69
|
-
treeOptions:
|
|
70
|
-
navTreeOptions:
|
|
71
|
-
navNodes:
|
|
69
|
+
treeOptions: le,
|
|
70
|
+
navTreeOptions: R,
|
|
71
|
+
navNodes: te,
|
|
72
72
|
leafNodes: f,
|
|
73
|
-
isFirstLoaded:
|
|
74
|
-
buildOptionGroups:
|
|
75
|
-
} =
|
|
76
|
-
let
|
|
77
|
-
const
|
|
73
|
+
isFirstLoaded: ae,
|
|
74
|
+
buildOptionGroups: oe
|
|
75
|
+
} = sl(t), r = je(E, "modelValue");
|
|
76
|
+
let L;
|
|
77
|
+
const P = s(() => t.disabled), ne = s(() => {
|
|
78
78
|
const e = /* @__PURE__ */ new Map();
|
|
79
79
|
return f.value.forEach((l) => e.set(l.value, l.label)), e;
|
|
80
80
|
});
|
|
81
|
-
function
|
|
82
|
-
return e === t.showAllField ? { label: "全部", value: t.showAllField } : { label:
|
|
81
|
+
function k(e) {
|
|
82
|
+
return e === t.showAllField ? { label: "全部", value: t.showAllField } : { label: ne.value.get(e) ?? String(e), value: e };
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function $(e) {
|
|
85
85
|
if (e != null)
|
|
86
86
|
return typeof e == "object" && "value" in e ? e.value : e;
|
|
87
87
|
}
|
|
88
|
-
const
|
|
88
|
+
const re = s({
|
|
89
89
|
get() {
|
|
90
|
-
return Array.isArray(
|
|
90
|
+
return Array.isArray(r.value) ? t.multiple ? r.value : r.value.slice(-1) : r.value === void 0 ? [] : [r.value];
|
|
91
91
|
},
|
|
92
92
|
set(e) {
|
|
93
|
-
|
|
93
|
+
r.value = t.multiple ? [...e] : e.at(-1);
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
|
-
|
|
96
|
+
V([() => t.multiple, () => r.value], ([e, l]) => {
|
|
97
97
|
if (e) {
|
|
98
|
-
Array.isArray(l) || (
|
|
98
|
+
Array.isArray(l) || (r.value = l === void 0 ? [] : [l]);
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
|
-
Array.isArray(l) && (
|
|
101
|
+
Array.isArray(l) && (r.value = l.at(-1));
|
|
102
102
|
});
|
|
103
|
-
const
|
|
104
|
-
function
|
|
103
|
+
const A = h(), v = h(""), y = h(""), C = h(), b = O("middleRef"), w = O("selectWrapRef"), N = O("selectRef"), S = h(0);
|
|
104
|
+
function B() {
|
|
105
105
|
const e = w.value;
|
|
106
|
-
e && (
|
|
106
|
+
e && (S.value = e.offsetWidth);
|
|
107
107
|
}
|
|
108
|
-
ll(w, () =>
|
|
109
|
-
const
|
|
108
|
+
ll(w, () => B());
|
|
109
|
+
const ie = s(() => ({
|
|
110
110
|
componentProps: {
|
|
111
111
|
multiple: t.multiple,
|
|
112
112
|
component: {
|
|
@@ -115,56 +115,55 @@ const p = 4, El = /* @__PURE__ */ ze({
|
|
|
115
115
|
},
|
|
116
116
|
component: "TtPanelSelect",
|
|
117
117
|
selectWrapRef: w,
|
|
118
|
-
selectRef:
|
|
119
|
-
})), { selectComponentProps:
|
|
118
|
+
selectRef: N
|
|
119
|
+
})), { selectComponentProps: se } = tl(ie), T = s(() => {
|
|
120
120
|
const e = v.value.trim().toLowerCase();
|
|
121
|
-
if (!e) return
|
|
122
|
-
const l = (
|
|
123
|
-
const
|
|
124
|
-
return
|
|
125
|
-
var
|
|
126
|
-
const u = (
|
|
127
|
-
(String(
|
|
128
|
-
}),
|
|
121
|
+
if (!e) return R.value;
|
|
122
|
+
const l = (a) => {
|
|
123
|
+
const n = [];
|
|
124
|
+
return a.forEach((o) => {
|
|
125
|
+
var U;
|
|
126
|
+
const u = (U = o.children) != null && U.length ? l(o.children) : void 0;
|
|
127
|
+
(String(o.label).toLowerCase().includes(e) || u && u.length) && n.push({ ...o, children: u != null && u.length ? u : void 0 });
|
|
128
|
+
}), n;
|
|
129
129
|
};
|
|
130
|
-
return l(
|
|
131
|
-
}),
|
|
132
|
-
const e = [], l = (
|
|
133
|
-
|
|
134
|
-
var
|
|
135
|
-
e.push(
|
|
130
|
+
return l(R.value);
|
|
131
|
+
}), ue = s(() => {
|
|
132
|
+
const e = [], l = (a) => {
|
|
133
|
+
a.forEach((n) => {
|
|
134
|
+
var o;
|
|
135
|
+
e.push(n.value), (o = n.children) != null && o.length && l(n.children);
|
|
136
136
|
});
|
|
137
137
|
};
|
|
138
138
|
return l(T.value), e;
|
|
139
|
-
}),
|
|
139
|
+
}), x = s(() => oe(f.value, y.value)), de = s(() => {
|
|
140
140
|
const e = "minmax(var(--tt-panel-select-middle-width, 450px), 1fr)";
|
|
141
141
|
return t.showNav && !t.multiple ? `200px ${e}` : !t.showNav && t.multiple ? `${e} 180px` : !t.showNav && !t.multiple ? e : `200px ${e} 180px`;
|
|
142
|
-
}),
|
|
142
|
+
}), ce = s(() => {
|
|
143
143
|
const e = "var(--tt-panel-select-middle-width, 450px)";
|
|
144
144
|
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)`;
|
|
145
|
-
}),
|
|
145
|
+
}), pe = s(() => {
|
|
146
146
|
const e = [];
|
|
147
|
-
return
|
|
147
|
+
return x.value.forEach((l) => {
|
|
148
148
|
!(t.showOriginMode && l.value === "__origin__") && e.push({ key: `group-${String(l.value)}`, type: "group", group: l });
|
|
149
|
-
const
|
|
150
|
-
for (let
|
|
151
|
-
const u =
|
|
149
|
+
const n = Math.ceil(l.options.length / p);
|
|
150
|
+
for (let o = 0; o < l.options.length; o += p) {
|
|
151
|
+
const u = o / p;
|
|
152
152
|
e.push({
|
|
153
|
-
key: `options-${String(l.value)}-${
|
|
153
|
+
key: `options-${String(l.value)}-${o / p}`,
|
|
154
154
|
type: "options",
|
|
155
155
|
group: l,
|
|
156
|
-
options: l.options.slice(
|
|
157
|
-
isLast: u ===
|
|
156
|
+
options: l.options.slice(o, o + p),
|
|
157
|
+
isLast: u === n - 1
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
160
|
}), e;
|
|
161
161
|
}), {
|
|
162
|
-
selectedOptions:
|
|
163
|
-
selectedValueSet:
|
|
164
|
-
isAllChecked:
|
|
165
|
-
isIndeterminate:
|
|
166
|
-
|
|
167
|
-
isGroupIndeterminate: ve,
|
|
162
|
+
selectedOptions: me,
|
|
163
|
+
selectedValueSet: _,
|
|
164
|
+
isAllChecked: fe,
|
|
165
|
+
isIndeterminate: he,
|
|
166
|
+
getGroupCheckCount: ve,
|
|
168
167
|
handleGroupCheck: ye,
|
|
169
168
|
handleAllOptionCheck: we,
|
|
170
169
|
handleOptionCheck: ge,
|
|
@@ -172,110 +171,113 @@ const p = 4, El = /* @__PURE__ */ ze({
|
|
|
172
171
|
handleCheckAll: Ae,
|
|
173
172
|
clearSelected: Ce,
|
|
174
173
|
removeSelected: be,
|
|
175
|
-
withLockedSelectedValues:
|
|
176
|
-
} =
|
|
174
|
+
withLockedSelectedValues: Se
|
|
175
|
+
} = ul({
|
|
177
176
|
multiple: s(() => t.multiple),
|
|
178
|
-
modelValue:
|
|
179
|
-
selectedValues:
|
|
177
|
+
modelValue: r,
|
|
178
|
+
selectedValues: re,
|
|
180
179
|
leafNodes: f,
|
|
181
180
|
allValue: s(() => t.showAllField)
|
|
182
|
-
}),
|
|
181
|
+
}), G = s({
|
|
183
182
|
get() {
|
|
184
183
|
if (t.multiple)
|
|
185
|
-
return (Array.isArray(
|
|
186
|
-
if (Array.isArray(
|
|
187
|
-
const e =
|
|
188
|
-
return e === void 0 ? void 0 :
|
|
184
|
+
return (Array.isArray(r.value) ? r.value : r.value === void 0 ? [] : [r.value]).map((l) => k(l));
|
|
185
|
+
if (Array.isArray(r.value)) {
|
|
186
|
+
const e = r.value.at(-1);
|
|
187
|
+
return e === void 0 ? void 0 : k(e);
|
|
189
188
|
}
|
|
190
|
-
return
|
|
189
|
+
return r.value === void 0 ? void 0 : k(r.value);
|
|
191
190
|
},
|
|
192
191
|
set(e) {
|
|
193
|
-
const l = r
|
|
194
|
-
if (
|
|
195
|
-
const
|
|
196
|
-
|
|
192
|
+
const l = i(r);
|
|
193
|
+
if (L = Array.isArray(l) ? [...l] : l, t.multiple) {
|
|
194
|
+
const n = (Array.isArray(e) ? e : []).map((o) => $(o)).filter((o) => o !== void 0);
|
|
195
|
+
r.value = Se(n);
|
|
197
196
|
return;
|
|
198
197
|
}
|
|
199
|
-
|
|
198
|
+
r.value = $(e);
|
|
200
199
|
}
|
|
201
|
-
}),
|
|
202
|
-
(
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
200
|
+
}), W = s(
|
|
201
|
+
() => {
|
|
202
|
+
const e = {}, l = {};
|
|
203
|
+
return x.value.forEach((a) => {
|
|
204
|
+
const { enabledCount: n, checkedCount: o } = ve(a), u = String(a.value);
|
|
205
|
+
e[u] = n > 0 && o === n, l[u] = n > 0 && o > 0 && o < n;
|
|
206
|
+
}), { checkedMap: e, indeterminateMap: l };
|
|
207
|
+
}
|
|
208
|
+
), xe = s(() => W.value.checkedMap), Ve = s(() => W.value.indeterminateMap), Oe = s(() => _.value.has(t.showAllField)), D = s(() => [...t.showAll ? [{ label: "全部", value: t.showAllField }] : [], ...f.value.map((l) => ({ ...l }))]);
|
|
208
209
|
function Me(e) {
|
|
209
|
-
const l =
|
|
210
|
+
const l = i(D);
|
|
210
211
|
if (Array.isArray(e)) {
|
|
211
|
-
const
|
|
212
|
-
return l.filter((
|
|
212
|
+
const a = new Set(e);
|
|
213
|
+
return l.filter((n) => n.value !== void 0 && a.has(n.value));
|
|
213
214
|
}
|
|
214
215
|
if (e !== void 0)
|
|
215
|
-
return l.find((
|
|
216
|
+
return l.find((a) => a.value === e);
|
|
216
217
|
}
|
|
217
|
-
function
|
|
218
|
-
var
|
|
219
|
-
if (t.showPinyinMode || (
|
|
218
|
+
function Ee(e) {
|
|
219
|
+
var a, n;
|
|
220
|
+
if (t.showPinyinMode || (a = e.children) != null && a.some((o) => {
|
|
220
221
|
var u;
|
|
221
|
-
return !((u =
|
|
222
|
+
return !((u = o.children) != null && u.length);
|
|
222
223
|
})) return e.value;
|
|
223
|
-
const l = f.value.find((
|
|
224
|
-
return (
|
|
224
|
+
const l = f.value.find((o) => o.path.some((u) => u.value === e.value));
|
|
225
|
+
return (n = l == null ? void 0 : l.path.at(-2)) == null ? void 0 : n.value;
|
|
225
226
|
}
|
|
226
227
|
function Fe(e) {
|
|
227
|
-
|
|
228
|
-
const l =
|
|
229
|
-
|
|
230
|
-
var
|
|
231
|
-
|
|
228
|
+
A.value = e.value;
|
|
229
|
+
const l = Ee(e);
|
|
230
|
+
C.value = void 0, M(() => {
|
|
231
|
+
var a;
|
|
232
|
+
C.value = l, l !== void 0 && ((a = b.value) == null || a.scrollToGroup(l));
|
|
232
233
|
});
|
|
233
234
|
}
|
|
234
235
|
function Re(e) {
|
|
235
236
|
v.value = e;
|
|
236
237
|
}
|
|
237
|
-
function
|
|
238
|
+
function Le(e) {
|
|
238
239
|
y.value = e;
|
|
239
240
|
}
|
|
240
|
-
function
|
|
241
|
-
const
|
|
242
|
-
|
|
241
|
+
function Pe(e, l) {
|
|
242
|
+
const a = x.value.find((n) => n.value === e);
|
|
243
|
+
a && ye(a, l);
|
|
243
244
|
}
|
|
244
|
-
async function
|
|
245
|
-
|
|
245
|
+
async function $e(e) {
|
|
246
|
+
var l;
|
|
247
|
+
F("visible-change", e), e && (y.value = "", v.value = "", await M(), (l = b.value) == null || l.inputFocus(), B(), t.alwaysLoad ? await m() : !t.immediate && !i(ae) && await m());
|
|
246
248
|
}
|
|
247
|
-
function
|
|
248
|
-
|
|
249
|
+
function Ne() {
|
|
250
|
+
K(L);
|
|
249
251
|
}
|
|
250
|
-
function
|
|
251
|
-
|
|
252
|
+
function Be(e) {
|
|
253
|
+
F("change", e, [...i(D)], Me(e));
|
|
252
254
|
}
|
|
253
|
-
function
|
|
254
|
-
return Array.isArray(e) && Array.isArray(l) ? e.length === l.length && e.every((
|
|
255
|
+
function Te(e, l) {
|
|
256
|
+
return Array.isArray(e) && Array.isArray(l) ? e.length === l.length && e.every((a, n) => a === l[n]) : e === l;
|
|
255
257
|
}
|
|
256
|
-
function
|
|
257
|
-
|
|
258
|
-
const l = r
|
|
259
|
-
|
|
258
|
+
function K(e) {
|
|
259
|
+
M(() => {
|
|
260
|
+
const l = i(r);
|
|
261
|
+
Te(l, e) || Be(l);
|
|
260
262
|
});
|
|
261
263
|
}
|
|
262
264
|
function d(e) {
|
|
263
|
-
const l = r
|
|
264
|
-
e(),
|
|
265
|
+
const l = i(r), a = Array.isArray(l) ? [...l] : l;
|
|
266
|
+
e(), K(a);
|
|
265
267
|
}
|
|
266
|
-
function
|
|
268
|
+
function _e(e) {
|
|
267
269
|
d(() => {
|
|
268
270
|
we(e);
|
|
269
271
|
});
|
|
270
272
|
}
|
|
271
|
-
function
|
|
273
|
+
function Ge(e) {
|
|
272
274
|
d(() => {
|
|
273
275
|
Ae(e);
|
|
274
276
|
});
|
|
275
277
|
}
|
|
276
278
|
function We(e, l) {
|
|
277
279
|
d(() => {
|
|
278
|
-
|
|
280
|
+
Pe(e, l);
|
|
279
281
|
});
|
|
280
282
|
}
|
|
281
283
|
function De(e, l) {
|
|
@@ -283,123 +285,123 @@ const p = 4, El = /* @__PURE__ */ ze({
|
|
|
283
285
|
ge(e, l);
|
|
284
286
|
});
|
|
285
287
|
}
|
|
286
|
-
function
|
|
288
|
+
function Ke(e, l) {
|
|
287
289
|
d(() => {
|
|
288
290
|
ke(e, l);
|
|
289
291
|
});
|
|
290
292
|
}
|
|
291
|
-
function
|
|
293
|
+
function Ue(e) {
|
|
292
294
|
d(() => {
|
|
293
295
|
be(e);
|
|
294
296
|
});
|
|
295
297
|
}
|
|
296
|
-
function
|
|
298
|
+
function Ie() {
|
|
297
299
|
d(() => {
|
|
298
300
|
Ce();
|
|
299
301
|
});
|
|
300
302
|
}
|
|
301
|
-
return
|
|
303
|
+
return V(
|
|
302
304
|
() => t.params,
|
|
303
305
|
() => {
|
|
304
306
|
m();
|
|
305
307
|
},
|
|
306
308
|
{ deep: !0 }
|
|
307
|
-
),
|
|
308
|
-
|
|
309
|
+
), V(
|
|
310
|
+
te,
|
|
309
311
|
(e) => {
|
|
310
312
|
var l;
|
|
311
|
-
|
|
313
|
+
A.value !== void 0 || !e.length || (A.value = (l = e[0]) == null ? void 0 : l.value);
|
|
312
314
|
},
|
|
313
315
|
{ immediate: !0 }
|
|
314
316
|
), qe(() => {
|
|
315
317
|
t.immediate && m();
|
|
316
|
-
}),
|
|
318
|
+
}), Q({
|
|
317
319
|
/** 重新加载数据源*/
|
|
318
320
|
reload: m,
|
|
319
321
|
/** 获取当前归一化后的树形选项数据 */
|
|
320
|
-
getOptions: () =>
|
|
322
|
+
getOptions: () => i(le),
|
|
321
323
|
/** 获取当前v-model值 */
|
|
322
|
-
getValue: () => r
|
|
323
|
-
}), (e, l) => (
|
|
324
|
+
getValue: () => i(r)
|
|
325
|
+
}), (e, l) => (g(), z("div", {
|
|
324
326
|
ref_key: "selectWrapRef",
|
|
325
327
|
ref: w,
|
|
326
|
-
class:
|
|
328
|
+
class: j(i(c))
|
|
327
329
|
}, [
|
|
328
|
-
|
|
330
|
+
q(i(Z), He({
|
|
329
331
|
ref_key: "selectRef",
|
|
330
|
-
ref:
|
|
331
|
-
modelValue:
|
|
332
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
333
|
-
},
|
|
332
|
+
ref: N,
|
|
333
|
+
modelValue: G.value,
|
|
334
|
+
"onUpdate:modelValue": l[0] || (l[0] = (a) => G.value = a)
|
|
335
|
+
}, i(se), {
|
|
334
336
|
multiple: e.multiple,
|
|
335
337
|
filterable: !1,
|
|
336
338
|
placeholder: e.placeholder,
|
|
337
339
|
persistent: !1,
|
|
338
340
|
"fallback-placements": ["bottom-start", "bottom-end", "bottom", "top-start", "top-end", "top", "right", "left"],
|
|
339
341
|
disabled: e.disabled,
|
|
340
|
-
"popper-class": `${
|
|
341
|
-
onVisibleChange:
|
|
342
|
-
onChange:
|
|
342
|
+
"popper-class": `${i(c)}__popper vxe-table--ignore-clear`,
|
|
343
|
+
onVisibleChange: $e,
|
|
344
|
+
onChange: Ne
|
|
343
345
|
}), {
|
|
344
346
|
empty: Je(() => [
|
|
345
|
-
Qe((
|
|
347
|
+
Qe((g(), z("div", {
|
|
346
348
|
"element-loading-text": "加载中",
|
|
347
|
-
class:
|
|
349
|
+
class: j(`${i(c)}__panel`),
|
|
348
350
|
style: Xe({
|
|
349
|
-
"--columns":
|
|
350
|
-
"--panel-min-width":
|
|
351
|
-
"--panel-width":
|
|
351
|
+
"--columns": de.value,
|
|
352
|
+
"--panel-min-width": ce.value,
|
|
353
|
+
"--panel-width": S.value ? `${S.value}px` : "100%"
|
|
352
354
|
})
|
|
353
355
|
}, [
|
|
354
|
-
t.showNav ? (
|
|
356
|
+
t.showNav ? (g(), H(nl, {
|
|
355
357
|
key: 0,
|
|
356
|
-
"prefix-cls":
|
|
358
|
+
"prefix-cls": i(c),
|
|
357
359
|
keyword: v.value,
|
|
358
360
|
"tree-data": T.value,
|
|
359
|
-
"expanded-keys":
|
|
361
|
+
"expanded-keys": ue.value,
|
|
360
362
|
"left-placeholder": e.leftPlaceholder,
|
|
361
363
|
"onUpdate:keyword": Re,
|
|
362
364
|
onSelect: Fe
|
|
363
|
-
}, null, 8, ["prefix-cls", "keyword", "tree-data", "expanded-keys", "left-placeholder"])) :
|
|
364
|
-
|
|
365
|
+
}, null, 8, ["prefix-cls", "keyword", "tree-data", "expanded-keys", "left-placeholder"])) : J("", !0),
|
|
366
|
+
q(rl, {
|
|
365
367
|
ref_key: "middleRef",
|
|
366
|
-
ref:
|
|
367
|
-
"prefix-cls":
|
|
368
|
+
ref: b,
|
|
369
|
+
"prefix-cls": i(c),
|
|
368
370
|
multiple: e.multiple,
|
|
369
371
|
keyword: y.value,
|
|
370
|
-
rows:
|
|
371
|
-
disabled:
|
|
372
|
+
rows: pe.value,
|
|
373
|
+
disabled: P.value,
|
|
372
374
|
"show-all": t.showAll,
|
|
373
375
|
"option-per-row": p,
|
|
374
376
|
"row-height": 40,
|
|
375
|
-
"selected-
|
|
376
|
-
"is-all-checked":
|
|
377
|
-
"is-indeterminate":
|
|
377
|
+
"selected-value-set": i(_),
|
|
378
|
+
"is-all-checked": i(fe),
|
|
379
|
+
"is-indeterminate": i(he),
|
|
378
380
|
"all-checked": Oe.value,
|
|
379
|
-
"scroll-to-group-value":
|
|
380
|
-
"group-checked-map":
|
|
381
|
+
"scroll-to-group-value": C.value,
|
|
382
|
+
"group-checked-map": xe.value,
|
|
381
383
|
"group-indeterminate-map": Ve.value,
|
|
382
384
|
"paste-search": e.pasteSearch,
|
|
383
385
|
separator: e.separator,
|
|
384
386
|
"middle-placeholder": e.middlePlaceholder,
|
|
385
|
-
"onUpdate:keyword":
|
|
386
|
-
onAllCheck:
|
|
387
|
-
onCheckAll:
|
|
387
|
+
"onUpdate:keyword": Le,
|
|
388
|
+
onAllCheck: _e,
|
|
389
|
+
onCheckAll: Ge,
|
|
388
390
|
onGroupCheck: We,
|
|
389
391
|
onOptionCheck: De,
|
|
390
|
-
onOptionsCheck:
|
|
391
|
-
}, null, 8, ["prefix-cls", "multiple", "keyword", "rows", "disabled", "show-all", "selected-
|
|
392
|
-
t.multiple ? (
|
|
392
|
+
onOptionsCheck: Ke
|
|
393
|
+
}, null, 8, ["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"]),
|
|
394
|
+
t.multiple ? (g(), H(il, {
|
|
393
395
|
key: 1,
|
|
394
|
-
"prefix-cls":
|
|
396
|
+
"prefix-cls": i(c),
|
|
395
397
|
multiple: e.multiple,
|
|
396
|
-
disabled:
|
|
397
|
-
"selected-options":
|
|
398
|
-
onClearAll:
|
|
399
|
-
onRemove:
|
|
400
|
-
}, null, 8, ["prefix-cls", "multiple", "disabled", "selected-options"])) :
|
|
398
|
+
disabled: P.value,
|
|
399
|
+
"selected-options": i(me),
|
|
400
|
+
onClearAll: Ie,
|
|
401
|
+
onRemove: Ue
|
|
402
|
+
}, null, 8, ["prefix-cls", "multiple", "disabled", "selected-options"])) : J("", !0)
|
|
401
403
|
], 6)), [
|
|
402
|
-
[
|
|
404
|
+
[i(Y), i(ee)]
|
|
403
405
|
])
|
|
404
406
|
]),
|
|
405
407
|
_: 1
|
|
@@ -408,5 +410,5 @@ const p = 4, El = /* @__PURE__ */ ze({
|
|
|
408
410
|
}
|
|
409
411
|
});
|
|
410
412
|
export {
|
|
411
|
-
|
|
413
|
+
Tl as default
|
|
412
414
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AnyPromiseFunction, Recordable } from '../../../../../utils/src';
|
|
2
2
|
import { MiddleRow } from './components/panel.types';
|
|
3
3
|
export type PanelSelectValue = string | number;
|
|
4
|
+
export type PanelSelectSeparator = string | string[];
|
|
4
5
|
export type PanelSelectModelValue = PanelSelectValue | PanelSelectValue[] | undefined;
|
|
5
6
|
export interface PanelSelectOption extends Recordable {
|
|
6
7
|
label?: string;
|
|
@@ -23,8 +24,8 @@ export interface PanelMiddleProps {
|
|
|
23
24
|
optionPerRow: number;
|
|
24
25
|
/** 行高 */
|
|
25
26
|
rowHeight: number;
|
|
26
|
-
/**
|
|
27
|
-
|
|
27
|
+
/** 已选值集合,由容器统一构建后下传,避免在中间列表再建一份同规模集合 */
|
|
28
|
+
selectedValueSet: ReadonlySet<PanelSelectValue>;
|
|
28
29
|
/** 全部选项是否选中 */
|
|
29
30
|
isAllChecked: boolean;
|
|
30
31
|
/** 是否初始化就选中 */
|
|
@@ -34,8 +35,10 @@ export interface PanelMiddleProps {
|
|
|
34
35
|
groupCheckedMap: Record<string, boolean>;
|
|
35
36
|
groupIndeterminateMap: Record<string, boolean>;
|
|
36
37
|
scrollToGroupValue?: PanelSelectValue;
|
|
38
|
+
/** 黏贴后是否触发搜索 */
|
|
37
39
|
pasteSearch?: boolean;
|
|
38
|
-
|
|
40
|
+
/** 搜索与黏贴拆分分隔符;字符串表示一个分隔符,数组表示多个分隔符 */
|
|
41
|
+
separator?: PanelSelectSeparator;
|
|
39
42
|
showAll: boolean;
|
|
40
43
|
middlePlaceholder?: string;
|
|
41
44
|
}
|
|
@@ -78,8 +81,8 @@ export interface PanelContainerProps {
|
|
|
78
81
|
beforeFetch?: AnyPromiseFunction<any, any>;
|
|
79
82
|
/** 请求后钩子 */
|
|
80
83
|
afterFetch?: AnyPromiseFunction<any, any>;
|
|
81
|
-
/**
|
|
82
|
-
separator?:
|
|
84
|
+
/** 搜索与黏贴拆分分隔符;字符串表示一个分隔符,数组表示多个分隔符 */
|
|
85
|
+
separator?: PanelSelectSeparator;
|
|
83
86
|
/** 粘贴后是否触发搜索 */
|
|
84
87
|
pasteSearch?: boolean;
|
|
85
88
|
/** 打开下拉框时是否总是请求接口加载数据源 */
|