@dazhicheng/ui 1.5.262 → 1.5.263
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-area/TtArea.vue.js +1 -1
- package/dist/components/tt-drawer/src/components/DrawerHeader.vue.js +2 -2
- package/dist/components/tt-form/src/hooks/useSelectCollapse.js +82 -64
- package/dist/components/tt-icon/index.vue.js +2 -2
- package/dist/components/tt-loading/src/loading.vue.js +2 -2
- package/dist/components/tt-panel-select/src/components/PanelLeft.vue.js +29 -23
- package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.js +89 -81
- package/dist/components/tt-panel-select/src/components/PanelRight.vue.js +49 -43
- package/dist/components/tt-panel-select/src/hooks/usePanelData.js +56 -49
- package/dist/components/tt-panel-select/src/hooks/usePanelSelection.d.ts +3 -0
- package/dist/components/tt-panel-select/src/hooks/usePanelSelection.js +94 -61
- package/dist/components/tt-panel-select/src/index.vue.js +204 -190
- package/dist/components/tt-select/src/Select.vue.d.ts +4 -4
- package/dist/components/tt-select/src/components/Table.vue.d.ts +4 -4
- package/dist/components/tt-table/index.d.ts +12 -12
- package/dist/components/tt-table/src/Table.vue.d.ts +4 -4
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as M, ref as f, computed as s, watch as V, nextTick as H, createElementBlock as p, openBlock as u, normalizeClass as r, createElementVNode as v, createVNode as a, unref as t, withCtx as h, createTextVNode as x, normalizeStyle as g, Fragment as N, renderList as I, createCommentVNode as A, toDisplayString as P } from "vue";
|
|
2
|
+
import y from "../../../../assets/svg/close.svg.js";
|
|
3
3
|
import { TtButton as Y } from "../../../tt-button/index.js";
|
|
4
|
-
import { TtIcon as
|
|
4
|
+
import { TtIcon as $ } from "../../../tt-icon/index.js";
|
|
5
5
|
import { TtText as D } from "../../../tt-text/index.js";
|
|
6
|
-
import {
|
|
7
|
-
|
|
6
|
+
import { useResizeObserver as F } from "@vueuse/core";
|
|
7
|
+
import { ElScrollbar as L } from "element-plus";
|
|
8
|
+
const n = 34, _ = 8, X = /* @__PURE__ */ M({
|
|
8
9
|
name: "PanelRight",
|
|
9
10
|
__name: "PanelRight",
|
|
10
11
|
props: {
|
|
@@ -14,86 +15,91 @@ const n = 34, $ = 8, U = /* @__PURE__ */ V({
|
|
|
14
15
|
disabled: { type: Boolean }
|
|
15
16
|
},
|
|
16
17
|
emits: ["clearAll", "remove"],
|
|
17
|
-
setup(
|
|
18
|
-
const
|
|
19
|
-
() => Math.min(
|
|
20
|
-
),
|
|
21
|
-
function
|
|
18
|
+
setup(k, { emit: R }) {
|
|
19
|
+
const i = k, C = R, c = f(), d = f(0), b = f(0), T = s(() => i.selectedOptions.length * n), O = s(() => Math.max(1, Math.ceil(b.value / n))), m = s(() => Math.max(0, Math.floor(d.value / n) - _)), S = s(
|
|
20
|
+
() => Math.min(i.selectedOptions.length, m.value + O.value + _ * 2)
|
|
21
|
+
), z = s(() => m.value * n), B = s(() => i.selectedOptions.slice(m.value, S.value));
|
|
22
|
+
function w() {
|
|
22
23
|
var l;
|
|
23
|
-
const e = (l =
|
|
24
|
-
e && (
|
|
24
|
+
const e = (l = c.value) == null ? void 0 : l.wrapRef;
|
|
25
|
+
e && (b.value = e.clientHeight, d.value = e.scrollTop);
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
+
function E() {
|
|
27
28
|
var l;
|
|
28
|
-
const e = (l =
|
|
29
|
+
const e = (l = c.value) == null ? void 0 : l.wrapRef;
|
|
29
30
|
e && (d.value = e.scrollTop);
|
|
30
31
|
}
|
|
31
|
-
return
|
|
32
|
-
() =>
|
|
32
|
+
return V(
|
|
33
|
+
() => i.selectedOptions.length,
|
|
33
34
|
async () => {
|
|
34
|
-
await H(),
|
|
35
|
+
await H(), w();
|
|
35
36
|
},
|
|
36
37
|
{ immediate: !0 }
|
|
37
|
-
), (
|
|
38
|
-
|
|
38
|
+
), F(
|
|
39
|
+
() => {
|
|
40
|
+
var e;
|
|
41
|
+
return (e = c.value) == null ? void 0 : e.wrapRef;
|
|
42
|
+
},
|
|
43
|
+
() => w()
|
|
44
|
+
), (e, l) => (u(), p("div", {
|
|
45
|
+
class: r(`${e.prefixCls}__right`)
|
|
39
46
|
}, [
|
|
40
47
|
v("div", {
|
|
41
|
-
class:
|
|
48
|
+
class: r(`${e.prefixCls}__selected-actions`)
|
|
42
49
|
}, [
|
|
43
|
-
|
|
50
|
+
a(t(Y), {
|
|
44
51
|
disabled: e.disabled,
|
|
45
52
|
class: "w-full",
|
|
46
53
|
plain: "",
|
|
47
|
-
onClick: l[0] || (l[0] = (
|
|
54
|
+
onClick: l[0] || (l[0] = (o) => C("clearAll"))
|
|
48
55
|
}, {
|
|
49
56
|
default: h(() => [
|
|
50
|
-
|
|
57
|
+
a(t($), {
|
|
51
58
|
class: "mr-[4px]",
|
|
52
59
|
size: 14,
|
|
53
60
|
"is-custom-svg": "",
|
|
54
|
-
icon: t(
|
|
61
|
+
icon: t(y)
|
|
55
62
|
}, null, 8, ["icon"]),
|
|
56
|
-
l[1] || (l[1] =
|
|
63
|
+
l[1] || (l[1] = x(" 取消全选 ", -1))
|
|
57
64
|
]),
|
|
58
65
|
_: 1
|
|
59
66
|
}, 8, ["disabled"])
|
|
60
67
|
], 2),
|
|
61
|
-
|
|
68
|
+
a(t(L), {
|
|
62
69
|
ref_key: "scrollbarRef",
|
|
63
|
-
ref:
|
|
64
|
-
class:
|
|
65
|
-
|
|
66
|
-
onScroll: O
|
|
70
|
+
ref: c,
|
|
71
|
+
class: r(`${e.prefixCls}__selected-list ${e.prefixCls}__right-scrollbar`),
|
|
72
|
+
onScroll: E
|
|
67
73
|
}, {
|
|
68
74
|
default: h(() => [
|
|
69
75
|
v("div", {
|
|
70
76
|
style: g({ height: `${T.value}px` })
|
|
71
77
|
}, [
|
|
72
78
|
v("div", {
|
|
73
|
-
style: g({ transform: `translateY(${
|
|
79
|
+
style: g({ transform: `translateY(${z.value}px)` })
|
|
74
80
|
}, [
|
|
75
|
-
(
|
|
76
|
-
key:
|
|
81
|
+
(u(!0), p(N, null, I(B.value, (o) => (u(), p("div", {
|
|
82
|
+
key: o.value,
|
|
77
83
|
style: g({ height: `${n}px` }),
|
|
78
|
-
class:
|
|
84
|
+
class: r(`${e.prefixCls}__selected-item`)
|
|
79
85
|
}, [
|
|
80
|
-
|
|
86
|
+
a(t(D), null, {
|
|
81
87
|
default: h(() => [
|
|
82
|
-
|
|
88
|
+
x(P(o.label), 1)
|
|
83
89
|
]),
|
|
84
90
|
_: 2
|
|
85
91
|
}, 1024),
|
|
86
|
-
e.disabled
|
|
92
|
+
!e.disabled && !o.disabled ? (u(), p("span", {
|
|
87
93
|
key: 0,
|
|
88
|
-
class:
|
|
94
|
+
class: r(`${e.prefixCls}__selected-item-close`)
|
|
89
95
|
}, [
|
|
90
|
-
|
|
96
|
+
a(t($), {
|
|
91
97
|
size: 14,
|
|
92
98
|
"is-custom-svg": "",
|
|
93
|
-
icon: t(
|
|
94
|
-
onClick: (
|
|
99
|
+
icon: t(y),
|
|
100
|
+
onClick: (j) => C("remove", o.value)
|
|
95
101
|
}, null, 8, ["icon", "onClick"])
|
|
96
|
-
], 2))
|
|
102
|
+
], 2)) : A("", !0)
|
|
97
103
|
], 6))), 128))
|
|
98
104
|
], 4)
|
|
99
105
|
], 4)
|
|
@@ -104,5 +110,5 @@ const n = 34, $ = 8, U = /* @__PURE__ */ V({
|
|
|
104
110
|
}
|
|
105
111
|
});
|
|
106
112
|
export {
|
|
107
|
-
|
|
113
|
+
X as default
|
|
108
114
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "axios";
|
|
2
2
|
import "element-plus";
|
|
3
3
|
import { isFunction as w } from "../../../../packages/utils/src/is.js";
|
|
4
|
-
import { computed as d, ref as T, unref as
|
|
4
|
+
import { computed as d, ref as T, unref as Z, nextTick as ee } from "vue";
|
|
5
5
|
import "xe-utils";
|
|
6
6
|
import "dayjs";
|
|
7
7
|
import "dayjs/plugin/utc";
|
|
@@ -11,11 +11,11 @@ import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/ae
|
|
|
11
11
|
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
|
|
12
12
|
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
13
13
|
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
14
|
-
import { get as a, omit as
|
|
15
|
-
import { pinyin as
|
|
16
|
-
function
|
|
14
|
+
import { get as a, omit as te, cloneDeep as re } from "lodash-es";
|
|
15
|
+
import { pinyin as ne } from "pinyin-pro";
|
|
16
|
+
function Fe(l) {
|
|
17
17
|
const A = d(() => {
|
|
18
|
-
const e =
|
|
18
|
+
const e = l.treeConfig || {};
|
|
19
19
|
return {
|
|
20
20
|
transform: e.transform,
|
|
21
21
|
labelField: e.labelField ?? "label",
|
|
@@ -25,12 +25,12 @@ function ge(i) {
|
|
|
25
25
|
parentField: e.parentField ?? "pid",
|
|
26
26
|
rootParentValue: e.rootParentValue ?? null
|
|
27
27
|
};
|
|
28
|
-
}), F = T(!1), C = T([]), P = T(!1),
|
|
28
|
+
}), F = T(!1), C = T([]), P = T(!1), M = T(!1), S = d(() => w(l.api) ? C.value : l.options || []), N = d(() => K(S.value)), x = d(() => !V() && l.showPinyinMode ? $(G.value) : D(N.value)), O = d(() => q(N.value)), B = d(() => O.value.filter((e) => {
|
|
29
29
|
var t;
|
|
30
30
|
return (t = e.children) == null ? void 0 : t.length;
|
|
31
31
|
})), G = d(() => O.value.filter((e) => e.children === void 0));
|
|
32
32
|
async function L() {
|
|
33
|
-
if (!(!
|
|
33
|
+
if (!(!l.api || !w(l.api))) {
|
|
34
34
|
if (F.value) {
|
|
35
35
|
P.value = !0;
|
|
36
36
|
return;
|
|
@@ -38,56 +38,56 @@ function ge(i) {
|
|
|
38
38
|
C.value = [];
|
|
39
39
|
try {
|
|
40
40
|
F.value = !0;
|
|
41
|
-
let e =
|
|
42
|
-
|
|
43
|
-
let t = await
|
|
44
|
-
|
|
41
|
+
let e = Z(l.params);
|
|
42
|
+
l.beforeFetch && w(l.beforeFetch) && (e = await l.beforeFetch(re(e)) || e);
|
|
43
|
+
let t = await l.api(e);
|
|
44
|
+
l.afterFetch && w(l.afterFetch) && (t = await l.afterFetch(t) || t), M.value = !0, C.value = Array.isArray(t) ? t : a(t, l.resultField || "") || [];
|
|
45
45
|
} catch {
|
|
46
|
-
|
|
46
|
+
M.value = !1;
|
|
47
47
|
} finally {
|
|
48
|
-
F.value = !1, P.value && (P.value = !1, await
|
|
48
|
+
F.value = !1, P.value && (P.value = !1, await ee(), L());
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
function K(e) {
|
|
53
|
-
const { childrenField: t, transform: r, valueField: n, labelField:
|
|
54
|
-
const g = a(
|
|
53
|
+
const { childrenField: t, transform: r, valueField: n, labelField: i, disabledField: o, parentField: s } = A.value, u = e.some((m) => Array.isArray(a(m, t))), h = e.some((m) => {
|
|
54
|
+
const g = a(m, t);
|
|
55
55
|
return Array.isArray(g) && g.length > 0;
|
|
56
56
|
}), v = u || h ? e : r ? U(e) : e;
|
|
57
|
-
function m
|
|
58
|
-
return
|
|
59
|
-
const
|
|
57
|
+
function p(m, g = 0, b) {
|
|
58
|
+
return m.map((c) => {
|
|
59
|
+
const W = a(c, n), I = a(c, t), X = Array.isArray(I), Y = [i, n, o, t].filter(
|
|
60
60
|
(y) => !!y
|
|
61
61
|
), f = {
|
|
62
|
-
...
|
|
63
|
-
label: String(a(c,
|
|
64
|
-
value:
|
|
62
|
+
...te(c, Y),
|
|
63
|
+
label: String(a(c, i) ?? ""),
|
|
64
|
+
value: W,
|
|
65
65
|
disabled: !!a(c, o),
|
|
66
66
|
pid: (b == null ? void 0 : b.value) ?? a(c, s),
|
|
67
67
|
level: g,
|
|
68
68
|
path: [],
|
|
69
69
|
raw: c
|
|
70
70
|
};
|
|
71
|
-
if (f.path = b ? [...b.path, f] : [f],
|
|
72
|
-
const y =
|
|
73
|
-
f.children = y.length ?
|
|
71
|
+
if (f.path = b ? [...b.path, f] : [f], X) {
|
|
72
|
+
const y = I;
|
|
73
|
+
f.children = y.length ? p(y, g + 1, f) : [];
|
|
74
74
|
} else
|
|
75
75
|
f.children = void 0;
|
|
76
76
|
return f;
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
|
-
return
|
|
79
|
+
return p(v);
|
|
80
80
|
}
|
|
81
81
|
function U(e) {
|
|
82
|
-
const t = /* @__PURE__ */ new Map(), r = [], { childrenField: n, valueField:
|
|
82
|
+
const t = /* @__PURE__ */ new Map(), r = [], { childrenField: n, valueField: i, parentField: o, rootParentValue: s } = A.value;
|
|
83
83
|
return e.forEach((u) => {
|
|
84
|
-
const h = a(u,
|
|
84
|
+
const h = a(u, i);
|
|
85
85
|
t.set(h, { ...u });
|
|
86
86
|
}), t.forEach((u) => {
|
|
87
87
|
const h = a(u, o), v = h === s ? void 0 : t.get(h);
|
|
88
88
|
if (v) {
|
|
89
|
-
const
|
|
90
|
-
|
|
89
|
+
const p = a(v, n) || [];
|
|
90
|
+
p.push(u), v[n] = p;
|
|
91
91
|
} else
|
|
92
92
|
r.push(u);
|
|
93
93
|
}), r;
|
|
@@ -101,8 +101,8 @@ function ge(i) {
|
|
|
101
101
|
return {
|
|
102
102
|
...t,
|
|
103
103
|
children: (r = t.children) != null && r.some((n) => {
|
|
104
|
-
var
|
|
105
|
-
return (
|
|
104
|
+
var i;
|
|
105
|
+
return (i = n.children) == null ? void 0 : i.length;
|
|
106
106
|
}) ? D(t.children) : void 0
|
|
107
107
|
};
|
|
108
108
|
});
|
|
@@ -125,8 +125,8 @@ function ge(i) {
|
|
|
125
125
|
var n;
|
|
126
126
|
const t = [], r = [...e];
|
|
127
127
|
for (; r.length; ) {
|
|
128
|
-
const
|
|
129
|
-
|
|
128
|
+
const i = r.shift();
|
|
129
|
+
i && (t.push(i), (n = i.children) != null && n.length && r.unshift(...i.children));
|
|
130
130
|
}
|
|
131
131
|
return t;
|
|
132
132
|
}
|
|
@@ -134,12 +134,12 @@ function ge(i) {
|
|
|
134
134
|
const r = t.trim().toLowerCase();
|
|
135
135
|
return r ? e.filter((n) => n.label.toLowerCase().includes(r)) : e;
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function R(e, t) {
|
|
138
138
|
const r = E(e, t);
|
|
139
|
-
return
|
|
139
|
+
return l.showOriginMode ? H(r) : l.showPinyinMode ? k(r) : V() ? j(r) : _(r);
|
|
140
140
|
}
|
|
141
141
|
function V() {
|
|
142
|
-
const { childrenField: e, transform: t } = A.value, r =
|
|
142
|
+
const { childrenField: e, transform: t } = A.value, r = S.value.some((o) => Array.isArray(a(o, e))), n = S.value.some((o) => {
|
|
143
143
|
const s = a(o, e);
|
|
144
144
|
return Array.isArray(s) && !!s.length;
|
|
145
145
|
});
|
|
@@ -148,14 +148,14 @@ function ge(i) {
|
|
|
148
148
|
function _(e) {
|
|
149
149
|
const t = /* @__PURE__ */ new Map();
|
|
150
150
|
return e.forEach((r) => {
|
|
151
|
-
const n = r.path.at(-2),
|
|
152
|
-
s.options.push(r), t.set(
|
|
151
|
+
const n = r.path.at(-2), i = (n == null ? void 0 : n.value) ?? r.value, o = (n == null ? void 0 : n.label) ?? r.label, s = t.get(i) || { value: i, label: o, options: [] };
|
|
152
|
+
s.options.push(r), t.set(i, s);
|
|
153
153
|
}), Array.from(t.values());
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function j(e) {
|
|
156
156
|
return _(e);
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function H(e) {
|
|
159
159
|
return e.length ? [
|
|
160
160
|
{
|
|
161
161
|
value: "__origin__",
|
|
@@ -167,28 +167,35 @@ function ge(i) {
|
|
|
167
167
|
function k(e) {
|
|
168
168
|
const t = /* @__PURE__ */ new Map();
|
|
169
169
|
return e.forEach((r) => {
|
|
170
|
-
const n =
|
|
171
|
-
|
|
170
|
+
const n = J(r.label), i = t.get(n) || { value: n, label: n.toUpperCase(), options: [] };
|
|
171
|
+
i.options.push(r), t.set(n, i);
|
|
172
172
|
}), Array.from(t.values()).sort((r, n) => String(r.value).localeCompare(String(n.value)));
|
|
173
173
|
}
|
|
174
|
-
|
|
174
|
+
const z = /* @__PURE__ */ new Map();
|
|
175
|
+
function J(e) {
|
|
176
|
+
const t = z.get(e);
|
|
177
|
+
if (t !== void 0) return t;
|
|
178
|
+
const r = Q(e);
|
|
179
|
+
return z.set(e, r), r;
|
|
180
|
+
}
|
|
181
|
+
function Q(e) {
|
|
175
182
|
const t = String(e || "").trim(), r = t.charAt(0).toLowerCase();
|
|
176
183
|
if (/^[a-z]$/.test(r)) return r;
|
|
177
|
-
const
|
|
178
|
-
return /^[a-z]$/.test(
|
|
184
|
+
const i = String(ne(t, { pattern: "initial" })).replace(/\s+/g, "").charAt(0).toLowerCase();
|
|
185
|
+
return /^[a-z]$/.test(i) ? i : "#";
|
|
179
186
|
}
|
|
180
187
|
return {
|
|
181
188
|
loading: F,
|
|
182
189
|
fetchApi: L,
|
|
183
190
|
treeOptions: N,
|
|
184
|
-
navTreeOptions:
|
|
191
|
+
navTreeOptions: x,
|
|
185
192
|
navNodes: B,
|
|
186
193
|
leafNodes: G,
|
|
187
194
|
filterNodes: E,
|
|
188
|
-
buildOptionGroups:
|
|
189
|
-
isFirstLoaded:
|
|
195
|
+
buildOptionGroups: R,
|
|
196
|
+
isFirstLoaded: M
|
|
190
197
|
};
|
|
191
198
|
}
|
|
192
199
|
export {
|
|
193
|
-
|
|
200
|
+
Fe as usePanelSelectData
|
|
194
201
|
};
|
|
@@ -14,6 +14,7 @@ type UsePanelSelectSelectionParams = {
|
|
|
14
14
|
*/
|
|
15
15
|
export declare function usePanelSelectSelection(params: UsePanelSelectSelectionParams): {
|
|
16
16
|
selectedOptions: import('vue').ComputedRef<PanelTreeNode[]>;
|
|
17
|
+
selectedValueSet: import('vue').ComputedRef<Set<PanelSelectValue>>;
|
|
17
18
|
isAllChecked: import('vue').ComputedRef<boolean>;
|
|
18
19
|
isIndeterminate: import('vue').ComputedRef<boolean>;
|
|
19
20
|
isGroupChecked: (group: OptionGroup) => boolean;
|
|
@@ -23,6 +24,8 @@ export declare function usePanelSelectSelection(params: UsePanelSelectSelectionP
|
|
|
23
24
|
handleOptionCheck: (value: PanelSelectValue, checked: boolean) => void;
|
|
24
25
|
handleOptionsCheck: (values: PanelSelectValue[], checked: boolean) => void;
|
|
25
26
|
handleCheckAll: (checked: boolean) => void;
|
|
27
|
+
clearSelected: () => void;
|
|
26
28
|
removeSelected: (value: PanelSelectValue) => void;
|
|
29
|
+
withLockedSelectedValues: (values: PanelSelectValue[]) => PanelSelectValue[];
|
|
27
30
|
};
|
|
28
31
|
export {};
|
|
@@ -1,91 +1,124 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
function
|
|
3
|
-
const { multiple:
|
|
4
|
-
const
|
|
5
|
-
if (
|
|
6
|
-
const
|
|
1
|
+
import { computed as u, unref as l } from "vue";
|
|
2
|
+
function L(p) {
|
|
3
|
+
const { multiple: s, modelValue: d, selectedValues: a, leafNodes: h, allValue: r } = p, i = u(() => new Set(l(a))), m = u(() => {
|
|
4
|
+
const e = l(i), n = l(h).filter((t) => e.has(t.value));
|
|
5
|
+
if (e.has(l(r))) {
|
|
6
|
+
const t = l(r);
|
|
7
7
|
return [
|
|
8
8
|
{
|
|
9
9
|
label: "全部",
|
|
10
|
-
value:
|
|
10
|
+
value: t,
|
|
11
11
|
level: 0,
|
|
12
12
|
path: [],
|
|
13
|
-
raw: { label: "全部", value:
|
|
13
|
+
raw: { label: "全部", value: t }
|
|
14
14
|
},
|
|
15
|
-
...
|
|
15
|
+
...n
|
|
16
16
|
];
|
|
17
17
|
}
|
|
18
|
-
return
|
|
19
|
-
}), v =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
18
|
+
return n;
|
|
19
|
+
}), v = u(
|
|
20
|
+
() => l(h).filter((e) => !e.disabled).map((e) => e.value)
|
|
21
|
+
);
|
|
22
|
+
function f(e) {
|
|
23
|
+
const n = l(i);
|
|
24
|
+
let t = 0;
|
|
25
|
+
return e.forEach((o) => {
|
|
26
|
+
n.has(o) && (t += 1);
|
|
27
|
+
}), t;
|
|
28
|
+
}
|
|
29
|
+
const k = u(() => {
|
|
30
|
+
const e = l(v);
|
|
31
|
+
return e.length > 0 && f(e) === e.length;
|
|
32
|
+
}), C = u(() => {
|
|
33
|
+
const e = l(v), n = f(e);
|
|
34
|
+
return n > 0 && n < e.length;
|
|
25
35
|
});
|
|
26
|
-
function
|
|
27
|
-
const
|
|
28
|
-
return
|
|
36
|
+
function g(e) {
|
|
37
|
+
const n = e.options.filter((t) => !t.disabled).map((t) => t.value);
|
|
38
|
+
return n.length > 0 && f(n) === n.length;
|
|
29
39
|
}
|
|
30
|
-
function
|
|
31
|
-
const
|
|
32
|
-
return
|
|
40
|
+
function w(e) {
|
|
41
|
+
const n = e.options.filter((o) => !o.disabled).map((o) => o.value), t = f(n);
|
|
42
|
+
return n.length > 0 && t > 0 && t < n.length;
|
|
33
43
|
}
|
|
34
|
-
function
|
|
35
|
-
const
|
|
36
|
-
if (!
|
|
37
|
-
if (!
|
|
38
|
-
d.value =
|
|
44
|
+
function A(e, n) {
|
|
45
|
+
const t = e.options.filter((c) => !c.disabled).map((c) => c.value);
|
|
46
|
+
if (!t.length) return;
|
|
47
|
+
if (!l(s)) {
|
|
48
|
+
d.value = n ? t[0] : void 0;
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const o = new Set(l(a));
|
|
52
|
+
o.delete(l(r)), t.forEach((c) => n ? o.add(c) : o.delete(c)), a.value = Array.from(o);
|
|
53
|
+
}
|
|
54
|
+
function V(e) {
|
|
55
|
+
if (!l(s)) {
|
|
56
|
+
d.value = e ? l(r) : void 0;
|
|
39
57
|
return;
|
|
40
58
|
}
|
|
41
|
-
|
|
42
|
-
a.delete(n(r)), e.forEach((i) => t ? a.add(i) : a.delete(i)), o.value = Array.from(a);
|
|
59
|
+
a.value = e ? [l(r)] : [];
|
|
43
60
|
}
|
|
44
|
-
function
|
|
45
|
-
if (!
|
|
46
|
-
d.value =
|
|
61
|
+
function b(e, n) {
|
|
62
|
+
if (!l(s)) {
|
|
63
|
+
d.value = n ? e : void 0;
|
|
47
64
|
return;
|
|
48
65
|
}
|
|
49
|
-
|
|
66
|
+
const t = new Set(l(a));
|
|
67
|
+
t.delete(l(r)), n ? t.add(e) : t.delete(e), a.value = Array.from(t);
|
|
50
68
|
}
|
|
51
|
-
function
|
|
52
|
-
if (!
|
|
53
|
-
|
|
69
|
+
function y(e, n) {
|
|
70
|
+
if (!e.length) return;
|
|
71
|
+
if (!l(s)) {
|
|
72
|
+
d.value = n ? e.at(-1) : void 0;
|
|
54
73
|
return;
|
|
55
74
|
}
|
|
56
|
-
const
|
|
57
|
-
|
|
75
|
+
const t = new Set(l(a));
|
|
76
|
+
t.delete(l(r)), e.forEach((o) => n ? t.add(o) : t.delete(o)), a.value = Array.from(t);
|
|
58
77
|
}
|
|
59
|
-
function
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
78
|
+
function E(e) {
|
|
79
|
+
const n = l(v), t = new Set(l(a));
|
|
80
|
+
t.delete(l(r)), n.forEach((o) => e ? t.add(o) : t.delete(o)), a.value = Array.from(t);
|
|
81
|
+
}
|
|
82
|
+
const S = u(() => {
|
|
83
|
+
const e = l(i), n = /* @__PURE__ */ new Set();
|
|
84
|
+
return l(h).forEach((t) => {
|
|
85
|
+
t.disabled && e.has(t.value) && n.add(t.value);
|
|
86
|
+
}), n;
|
|
87
|
+
});
|
|
88
|
+
function O() {
|
|
89
|
+
const e = Array.from(l(S));
|
|
90
|
+
if (!l(s)) {
|
|
91
|
+
d.value = e.length ? e[0] : void 0;
|
|
63
92
|
return;
|
|
64
93
|
}
|
|
65
|
-
|
|
66
|
-
e.delete(n(r)), l.forEach((a) => t ? e.add(a) : e.delete(a)), o.value = Array.from(e);
|
|
94
|
+
a.value = e;
|
|
67
95
|
}
|
|
68
|
-
function
|
|
69
|
-
|
|
70
|
-
e.delete(n(r)), t.forEach((a) => l ? e.add(a) : e.delete(a)), o.value = Array.from(e);
|
|
96
|
+
function G(e) {
|
|
97
|
+
l(S).has(e) || (a.value = l(a).filter((n) => n !== e));
|
|
71
98
|
}
|
|
72
|
-
function
|
|
73
|
-
|
|
99
|
+
function x(e) {
|
|
100
|
+
const n = l(S);
|
|
101
|
+
if (!n.size) return e;
|
|
102
|
+
const t = new Set(e);
|
|
103
|
+
return n.forEach((o) => t.add(o)), Array.from(t);
|
|
74
104
|
}
|
|
75
105
|
return {
|
|
76
|
-
selectedOptions:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
106
|
+
selectedOptions: m,
|
|
107
|
+
selectedValueSet: i,
|
|
108
|
+
isAllChecked: k,
|
|
109
|
+
isIndeterminate: C,
|
|
110
|
+
isGroupChecked: g,
|
|
111
|
+
isGroupIndeterminate: w,
|
|
112
|
+
handleGroupCheck: A,
|
|
113
|
+
handleAllOptionCheck: V,
|
|
114
|
+
handleOptionCheck: b,
|
|
115
|
+
handleOptionsCheck: y,
|
|
116
|
+
handleCheckAll: E,
|
|
117
|
+
clearSelected: O,
|
|
118
|
+
removeSelected: G,
|
|
119
|
+
withLockedSelectedValues: x
|
|
87
120
|
};
|
|
88
121
|
}
|
|
89
122
|
export {
|
|
90
|
-
|
|
123
|
+
L as usePanelSelectSelection
|
|
91
124
|
};
|