@pantograph/vue 0.23.26 → 0.23.28
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/Combobox/index.js +1 -1
- package/dist/Combobox/index.umd.cjs +1 -1
- package/dist/Combobox/types.d.ts +3 -0
- package/dist/Combobox.vue_vue_type_style_index_0_lang-CN8YBSRI.js +1 -0
- package/dist/{Combobox.vue_vue_type_style_index_0_lang-Oc5nUJgi.js → Combobox.vue_vue_type_style_index_0_lang-DXKRCrNG.js} +336 -316
- package/dist/Select/index.js +1 -1
- package/dist/Select/index.umd.cjs +1 -1
- package/dist/Select/types.d.ts +1 -0
- package/dist/{Select.vue_vue_type_style_index_0_lang-CbJsb6VK.js → Select.vue_vue_type_style_index_0_lang-C5QD2kVd.js} +1 -1
- package/dist/{Select.vue_vue_type_style_index_0_lang-CMy8AQub.js → Select.vue_vue_type_style_index_0_lang-COe9-Nur.js} +52 -50
- package/dist/index.js +2 -2
- package/dist/index.umd.cjs +1 -1
- package/package.json +1 -1
- package/dist/Combobox.vue_vue_type_style_index_0_lang-DOcOXELp.js +0 -1
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { computed as m, unref as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { g as ut, h as
|
|
4
|
-
import { a as
|
|
1
|
+
import { computed as m, unref as D, defineComponent as le, createBlock as xe, openBlock as ue, mergeProps as Ke, withCtx as ve, createElementBlock as Re, createVNode as Ne, h as l, normalizeClass as Ye, renderSlot as Ae, ref as Ve, watch as $e, useSlots as Je, useAttrs as Qe, createSlots as Xe, renderList as Ze, normalizeProps as et, guardReactiveProps as tt } from "vue";
|
|
2
|
+
import { createContext as Fe, ComboboxInput as ot, ComboboxAnchor as nt, injectComboboxRootContext as at, useFilter as rt, ComboboxPortal as lt, ComboboxContent as st, useEmitAsProps as it, ComboboxRoot as pt } from "reka-ui";
|
|
3
|
+
import { g as ut, h as re, o as ct, f as Me, j as dt } from "./FormItem.vue_vue_type_style_index_0_lang-BpgRONei.js";
|
|
4
|
+
import { a as Oe, g as gt } from "./options-D4et5euX.js";
|
|
5
5
|
import { getBemBlock as mt, getBemElement as k, generateVariantClassList as H } from "@pantograph/utils";
|
|
6
|
-
import { a as
|
|
7
|
-
import { cva as
|
|
8
|
-
import { a as vt, l as ht, o as
|
|
6
|
+
import { a as he, i as A, b as Se, u as ft, d as Le } from "./index-jwkhq8oW.js";
|
|
7
|
+
import { cva as Be } from "class-variance-authority";
|
|
8
|
+
import { a as vt, l as ht, o as De } from "./omit-BuBwx_M2.js";
|
|
9
9
|
import { _ as bt } from "./Empty.vue_vue_type_style_index_0_lang-jfObDGf0.js";
|
|
10
10
|
import { _ as yt } from "./Skeleton.vue_vue_type_style_index_0_lang-Xi8CteLp.js";
|
|
11
|
-
import { _ as
|
|
12
|
-
import { b as
|
|
11
|
+
import { _ as _e } from "./Divider.vue_vue_type_style_index_0_lang-B6fQsp1Y.js";
|
|
12
|
+
import { b as U, f as Ct, a as Vt, i as _t, d as xt } from "./element-BfQuKSll.js";
|
|
13
13
|
import { u as St, U as Ot } from "./useInputDataStates-0nK-AuOK.js";
|
|
14
14
|
import { u as Bt } from "./useLazyLoading-Zo-PEp2E.js";
|
|
15
|
-
import { g as Pt, b as
|
|
16
|
-
import { _ as
|
|
15
|
+
import { g as Pt, b as It } from "./Popover.vue_vue_type_style_index_0_lang-DyIDJxIC.js";
|
|
16
|
+
import { _ as kt } from "./ScrollContainer.vue_vue_type_style_index_0_lang-DfMU1mTu.js";
|
|
17
17
|
import { _ as Tt } from "./Tree.vue_vue_type_style_index_0_lang-E0A2gSV2.js";
|
|
18
|
-
import { u as
|
|
19
|
-
import { i as
|
|
18
|
+
import { u as we } from "./uniq-Cxafs-eV.js";
|
|
19
|
+
import { i as ae } from "./isEmpty-wdqPTIXx.js";
|
|
20
20
|
import { _ as zt } from "./Chip.vue_vue_type_style_index_0_lang-DXsCoBle.js";
|
|
21
21
|
import { _ as Mt } from "./ChipGroup.vue_vue_type_style_index_0_lang-R-SmBNur.js";
|
|
22
|
-
import { _ as
|
|
23
|
-
import { d as
|
|
24
|
-
import { _ as
|
|
25
|
-
import { _ as
|
|
22
|
+
import { _ as Pe } from "./Icon.vue_vue_type_style_index_0_lang-CbLL-Ngi.js";
|
|
23
|
+
import { d as Lt, _ as We } from "./Avatar.vue_vue_type_style_index_0_lang-DRTI7zpy.js";
|
|
24
|
+
import { _ as Dt } from "./GraphicalObjectGroup.vue_vue_type_style_index_0_lang-C3LfQ7iN.js";
|
|
25
|
+
import { _ as Ge } from "./GraphicalObject.vue_vue_type_script_setup_true_lang-Cm_eOjGc.js";
|
|
26
26
|
import { _ as wt } from "./Input.vue_vue_type_style_index_0_lang-oEQu3uIk.js";
|
|
27
27
|
import { whenever as Et, useVModel as Kt } from "@vueuse/core";
|
|
28
28
|
import { last as Rt } from "lodash-es";
|
|
@@ -30,13 +30,13 @@ import { a as Nt } from "./MenuItem.vue_vue_type_style_index_0_lang-7T_SPKSm.js"
|
|
|
30
30
|
import "@iconify/vue";
|
|
31
31
|
import { _ as At } from "./Checkbox.vue_vue_type_style_index_0_lang-aDK0Pvm-.js";
|
|
32
32
|
import "@pantograph/tokens";
|
|
33
|
-
const [
|
|
33
|
+
const [Ie, $t] = Fe("Combobox"), [Ft, Wt] = Fe("_Combobox"), E = mt("combobox");
|
|
34
34
|
var Gt = 1 / 0;
|
|
35
35
|
function Ut(u) {
|
|
36
36
|
var o = u == null ? 0 : u.length;
|
|
37
37
|
return o ? vt(u, Gt) : [];
|
|
38
38
|
}
|
|
39
|
-
const
|
|
39
|
+
const fe = (u) => ut(u) || he(u);
|
|
40
40
|
function jt({
|
|
41
41
|
getValue: u,
|
|
42
42
|
arr: o,
|
|
@@ -44,11 +44,11 @@ function jt({
|
|
|
44
44
|
}) {
|
|
45
45
|
const e = [], c = (i, B) => {
|
|
46
46
|
i.forEach((T) => {
|
|
47
|
-
const
|
|
48
|
-
if (
|
|
49
|
-
e.push({ ...T, _parentKeys: B, _key:
|
|
47
|
+
const x = u(T);
|
|
48
|
+
if (fe(x)) {
|
|
49
|
+
e.push({ ...T, _parentKeys: B, _key: x });
|
|
50
50
|
const y = t(T);
|
|
51
|
-
y != null && y.length && c(y, [...B ?? [],
|
|
51
|
+
y != null && y.length && c(y, [...B ?? [], x]);
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
};
|
|
@@ -61,130 +61,138 @@ const Ht = ({
|
|
|
61
61
|
getChildren: e
|
|
62
62
|
}) => {
|
|
63
63
|
const c = m(
|
|
64
|
-
() => jt({ arr:
|
|
64
|
+
() => jt({ arr: D(u()), getChildren: e, getValue: t })
|
|
65
65
|
), i = (r, f = !1) => {
|
|
66
66
|
const d = t(r);
|
|
67
67
|
return c.value.filter((s) => {
|
|
68
|
-
var
|
|
68
|
+
var S;
|
|
69
69
|
if (f) {
|
|
70
70
|
const V = ht(s._parentKeys ?? []);
|
|
71
71
|
return V && V === d;
|
|
72
72
|
}
|
|
73
|
-
return (
|
|
73
|
+
return (S = s._parentKeys) == null ? void 0 : S.includes(d);
|
|
74
74
|
});
|
|
75
75
|
}, B = (r) => {
|
|
76
|
-
if (r &&
|
|
77
|
-
return
|
|
78
|
-
const f =
|
|
79
|
-
return f &&
|
|
76
|
+
if (r && A(r))
|
|
77
|
+
return re(r);
|
|
78
|
+
const f = D(o());
|
|
79
|
+
return f && A(f) ? re(f) : [];
|
|
80
80
|
}, T = (r, f) => {
|
|
81
81
|
const d = B(f), s = i(r);
|
|
82
82
|
if (s != null && s.length)
|
|
83
|
-
return s.some((
|
|
83
|
+
return s.some((S) => {
|
|
84
84
|
var a;
|
|
85
|
-
const V =
|
|
85
|
+
const V = S._key;
|
|
86
86
|
return V && ((a = d == null ? void 0 : d.includes) == null ? void 0 : a.call(d, V));
|
|
87
87
|
});
|
|
88
|
-
},
|
|
88
|
+
}, x = (r, f) => {
|
|
89
89
|
const d = B(f), s = i(r);
|
|
90
90
|
if (s != null && s.length)
|
|
91
|
-
return s.every((
|
|
91
|
+
return s.every((S) => {
|
|
92
92
|
var a;
|
|
93
|
-
const V =
|
|
93
|
+
const V = S._key;
|
|
94
94
|
return V && ((a = d == null ? void 0 : d.includes) == null ? void 0 : a.call(d, V));
|
|
95
95
|
});
|
|
96
96
|
}, y = (r, f) => {
|
|
97
|
-
const d = B(f), s = i(r),
|
|
98
|
-
return s != null && s.length ?
|
|
99
|
-
},
|
|
97
|
+
const d = B(f), s = i(r), S = t(r);
|
|
98
|
+
return s != null && s.length ? x(r) ? !0 : T(r) ? "intermediate" : !1 : d.includes(S);
|
|
99
|
+
}, K = (r) => fe(r) ? c.value.find((f) => f._key === r) : void 0;
|
|
100
100
|
return {
|
|
101
101
|
flattenData: c,
|
|
102
102
|
getNodeChildren: i,
|
|
103
103
|
isSomeChildrenSelected: T,
|
|
104
|
-
isAllChildrenSelected:
|
|
104
|
+
isAllChildrenSelected: x,
|
|
105
105
|
isSelected: y,
|
|
106
106
|
selectValues: (r, f) => {
|
|
107
107
|
if (r.length) {
|
|
108
108
|
let d = B();
|
|
109
|
-
const s = r.filter(
|
|
109
|
+
const s = r.filter(fe);
|
|
110
110
|
f ? d.push(...s) : d = d.filter((v) => !s.includes(v));
|
|
111
|
-
const
|
|
111
|
+
const S = d.map(K).filter((v) => v && v._parentKeys), a = we(Ut(S.map((v) => v._parentKeys))).filter(fe).map(K).filter(Boolean), _ = [], z = [];
|
|
112
112
|
return a.forEach((v) => {
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
}), d.push(...
|
|
113
|
+
const j = t(v);
|
|
114
|
+
x(v, d) ? _.push(j) : z.push(j);
|
|
115
|
+
}), d.push(..._), we(d.filter((v) => !z.includes(v)));
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
};
|
|
119
|
-
},
|
|
119
|
+
}, Ue = ["sm", "md", "lg"], qt = ["error", "warning", "success"], Yt = { key: 1 }, je = /* @__PURE__ */ le({
|
|
120
120
|
__name: "ComboboxInput",
|
|
121
121
|
setup(u) {
|
|
122
|
-
const o =
|
|
122
|
+
const o = Ie();
|
|
123
123
|
Et(
|
|
124
124
|
() => o.open.value && o.headerInputElement.value,
|
|
125
125
|
() => {
|
|
126
126
|
o.headerInputElement.value && o.open.value && o.focusOnInput();
|
|
127
127
|
}
|
|
128
128
|
);
|
|
129
|
-
const t = m(() => !
|
|
130
|
-
if (
|
|
131
|
-
|
|
132
|
-
o.
|
|
129
|
+
const t = m(() => !ae(o.modelValue.value)), e = m(() => {
|
|
130
|
+
if (t.value) {
|
|
131
|
+
if (o.props.multiple && A(o.modelValue.value) && !o.props.noLastValueOnPlaceholder)
|
|
132
|
+
return o.getLabelByValue(Rt(o.modelValue.value));
|
|
133
|
+
if (!o.props.multiple && !A(o.modelValue.value))
|
|
134
|
+
return o.getLabelByValue(o.modelValue.value);
|
|
135
|
+
}
|
|
136
|
+
return o.props.placeholder ?? "";
|
|
137
|
+
}), c = (T) => {
|
|
138
|
+
if (T.key === "Backspace" && o.props.multiple && A(o.modelValue.value) && ae(o.searchModel.value) && (o.setModelValue(o.modelValue.value.slice(0, -1)), ae(o.modelValue.value))) {
|
|
139
|
+
const x = setTimeout(() => {
|
|
140
|
+
o.focusOnInput(), clearTimeout(x);
|
|
133
141
|
}, 2);
|
|
134
142
|
}
|
|
135
|
-
}, i = k(
|
|
143
|
+
}, i = k(E, "input"), B = Be(i, {
|
|
136
144
|
variants: {
|
|
137
145
|
valuePlaceholder: H("value-placeholder", i)
|
|
138
146
|
}
|
|
139
147
|
});
|
|
140
|
-
return (T,
|
|
141
|
-
disabled:
|
|
148
|
+
return (T, x) => (ue(), xe(D(ot), Ke(D(o).comboboxInputBinding.value, {
|
|
149
|
+
disabled: D(o).getDisabled.value,
|
|
142
150
|
placeholder: e.value,
|
|
143
151
|
"as-child": "",
|
|
144
|
-
modelValue:
|
|
145
|
-
"onUpdate:modelValue":
|
|
152
|
+
modelValue: D(o).searchModel.value,
|
|
153
|
+
"onUpdate:modelValue": x[0] || (x[0] = (y) => D(o).searchModel.value = y),
|
|
146
154
|
onKeydown: c,
|
|
147
|
-
class:
|
|
155
|
+
class: D(B)({
|
|
148
156
|
valuePlaceholder: t.value
|
|
149
157
|
}),
|
|
150
158
|
displayValue: () => ""
|
|
151
159
|
}), {
|
|
152
|
-
default:
|
|
153
|
-
|
|
160
|
+
default: ve(() => [
|
|
161
|
+
D(o).props.headerSearch ? (ue(), xe(wt, {
|
|
154
162
|
key: 0,
|
|
155
|
-
ref:
|
|
156
|
-
placeholder:
|
|
163
|
+
ref: D(o).headerInputElement,
|
|
164
|
+
placeholder: D(o).props.placeholder
|
|
157
165
|
}, {
|
|
158
|
-
leading:
|
|
159
|
-
|
|
166
|
+
leading: ve(({ iconSize: y }) => [
|
|
167
|
+
Ne(Pe, {
|
|
160
168
|
size: y,
|
|
161
169
|
icon: "tabler:search",
|
|
162
170
|
flipOnDir: "rtl"
|
|
163
171
|
}, null, 8, ["size"])
|
|
164
172
|
]),
|
|
165
173
|
_: 1
|
|
166
|
-
}, 8, ["placeholder"])) : (
|
|
174
|
+
}, 8, ["placeholder"])) : (ue(), Re("input", Yt))
|
|
167
175
|
]),
|
|
168
176
|
_: 1
|
|
169
177
|
}, 16, ["disabled", "placeholder", "modelValue", "class"]));
|
|
170
178
|
}
|
|
171
|
-
}), Jt = /* @__PURE__ */
|
|
172
|
-
name:
|
|
179
|
+
}), Jt = /* @__PURE__ */ le({
|
|
180
|
+
name: Oe("ComboboxTrigger"),
|
|
173
181
|
props: {},
|
|
174
182
|
setup(u, {
|
|
175
183
|
slots: o,
|
|
176
184
|
attrs: t
|
|
177
185
|
}) {
|
|
178
|
-
const e =
|
|
186
|
+
const e = Ie(), c = ({
|
|
179
187
|
value: a
|
|
180
|
-
},
|
|
181
|
-
if (
|
|
182
|
-
const
|
|
183
|
-
e.setModelValue(
|
|
188
|
+
}, _) => {
|
|
189
|
+
if (_.stopPropagation(), a && A(e.modelValue.value) && !e.getDisabled.value) {
|
|
190
|
+
const z = e.modelValue.value.filter((v) => v !== a);
|
|
191
|
+
e.setModelValue(z);
|
|
184
192
|
}
|
|
185
|
-
}, i = k(
|
|
193
|
+
}, i = k(E, "trigger"), B = Be(i, {
|
|
186
194
|
variants: {
|
|
187
|
-
size: H(
|
|
195
|
+
size: H(Ue, i),
|
|
188
196
|
headerSearch: H("header-search", i),
|
|
189
197
|
status: H(qt, i),
|
|
190
198
|
bordered: H("bordered", i),
|
|
@@ -201,23 +209,23 @@ const Ht = ({
|
|
|
201
209
|
default:
|
|
202
210
|
return "xsm";
|
|
203
211
|
}
|
|
204
|
-
}),
|
|
205
|
-
if (!e.props.multiple &&
|
|
212
|
+
}), x = m(() => {
|
|
213
|
+
if (!e.props.multiple && he(e.modelValue.value) && !ae(e.modelValue.value))
|
|
206
214
|
return e.getOptionByValue(e.modelValue.value);
|
|
207
|
-
}), y = (a =
|
|
208
|
-
if (e.props.selectedItemIconAsTrailingIcon &&
|
|
215
|
+
}), y = (a = x.value) => {
|
|
216
|
+
if (e.props.selectedItemIconAsTrailingIcon && Se(a) && "icon" in a)
|
|
209
217
|
return a.icon;
|
|
210
|
-
},
|
|
218
|
+
}, K = m(() => y()), R = m(() => {
|
|
211
219
|
if (!e.props.noTrailing)
|
|
212
220
|
return e.props.trailingIcon;
|
|
213
221
|
}), r = m(() => {
|
|
214
|
-
var
|
|
215
|
-
const a =
|
|
222
|
+
var z, v;
|
|
223
|
+
const a = re(e.modelValue.value), _ = A(e.modelValue.value);
|
|
216
224
|
return {
|
|
217
225
|
modelValue: a,
|
|
218
|
-
open:
|
|
219
|
-
option:
|
|
220
|
-
options:
|
|
226
|
+
open: re(e.open.value),
|
|
227
|
+
option: _ ? void 0 : e.getOptionByValue(e.modelValue.value),
|
|
228
|
+
options: _ ? (v = (z = e.modelValue.value).map) == null ? void 0 : v.call(z, e.getOptionByValue).filter(Boolean) : void 0
|
|
221
229
|
};
|
|
222
230
|
}), f = () => {
|
|
223
231
|
e.onOpenChange(!e.open.value);
|
|
@@ -236,88 +244,96 @@ const Ht = ({
|
|
|
236
244
|
"data-state": e.open.value ? "open" : "closed",
|
|
237
245
|
class: [B({
|
|
238
246
|
size: e.getSize.value,
|
|
239
|
-
status: e.getStatus.value === "success" &&
|
|
247
|
+
status: e.getStatus.value === "success" && ae(e.modelValue.value) ? void 0 : e.getStatus.value,
|
|
240
248
|
bordered: e.props.bordered,
|
|
241
249
|
multiple: e.props.multiple,
|
|
242
250
|
contentFit: e.props.contentFit,
|
|
243
251
|
wrapped: e.props.wrapped,
|
|
244
|
-
filled: !
|
|
252
|
+
filled: !ae(e.modelValue.value),
|
|
245
253
|
headerSearch: e.props.headerSearch
|
|
246
254
|
}), e.props.triggerCls],
|
|
247
255
|
...t
|
|
248
|
-
})),
|
|
256
|
+
})), S = (a, _ = T.value) => l(Pe, {
|
|
249
257
|
icon: a,
|
|
250
|
-
size:
|
|
258
|
+
size: _
|
|
251
259
|
}), V = () => {
|
|
252
|
-
var
|
|
260
|
+
var z;
|
|
253
261
|
let a;
|
|
254
|
-
const
|
|
255
|
-
if (
|
|
262
|
+
const _ = (z = o.triggerTrailing) == null ? void 0 : z.call(o, r.value);
|
|
263
|
+
if (U(_) ? R.value && (a = S(R.value)) : a = _, a)
|
|
256
264
|
return l("div", {
|
|
257
265
|
class: [k(i, "trailing"), e.props.triggerTrailingCls]
|
|
258
266
|
}, a);
|
|
259
267
|
};
|
|
260
268
|
return () => {
|
|
261
|
-
var
|
|
262
|
-
const a = (
|
|
263
|
-
if (
|
|
264
|
-
const
|
|
265
|
-
return
|
|
266
|
-
})()
|
|
269
|
+
var ee;
|
|
270
|
+
const a = (ee = o.trigger) == null ? void 0 : ee.call(o, r.value), _ = !U(a), v = (() => {
|
|
271
|
+
if (!_) return !1;
|
|
272
|
+
const Q = Ct(a) ?? null, X = Q.length === 1 ? Q[0] : Q;
|
|
273
|
+
return X ? Vt(X) && !_t(X) : !0;
|
|
274
|
+
})(), {
|
|
275
|
+
class: j,
|
|
276
|
+
...J
|
|
277
|
+
} = s.value;
|
|
267
278
|
return l(nt, {
|
|
268
|
-
...
|
|
279
|
+
...J,
|
|
280
|
+
class: _ ? e.props.triggerCls : j,
|
|
269
281
|
...e.comboboxTriggerBinding.value,
|
|
270
|
-
asChild:
|
|
271
|
-
as:
|
|
272
|
-
key: String(
|
|
282
|
+
asChild: v,
|
|
283
|
+
as: v ? "template" : "button",
|
|
284
|
+
key: String(v),
|
|
273
285
|
onKeyUp: d,
|
|
274
286
|
onClick: f
|
|
275
287
|
}, () => {
|
|
276
|
-
if (
|
|
288
|
+
if (_)
|
|
277
289
|
return a;
|
|
278
|
-
const
|
|
279
|
-
var
|
|
280
|
-
const
|
|
281
|
-
|
|
282
|
-
|
|
290
|
+
const Q = (P) => {
|
|
291
|
+
var F, N;
|
|
292
|
+
const $ = e.getOptionByValue(P) ?? {
|
|
293
|
+
value: P
|
|
294
|
+
};
|
|
295
|
+
return l(We, {
|
|
296
|
+
...$ ? ((N = (F = e.props).getTagProps) == null ? void 0 : N.call(F, $)) ?? {} : {},
|
|
283
297
|
size: e.getTagSize.value
|
|
284
298
|
});
|
|
285
|
-
},
|
|
286
|
-
var
|
|
287
|
-
const
|
|
288
|
-
|
|
289
|
-
|
|
299
|
+
}, X = (P) => {
|
|
300
|
+
var F, N;
|
|
301
|
+
const $ = e.getOptionByValue(P) ?? {
|
|
302
|
+
value: P
|
|
303
|
+
};
|
|
304
|
+
return l(Ge, {
|
|
305
|
+
...$ ? ((N = (F = e.props).getTagProps) == null ? void 0 : N.call(F, $)) ?? {} : {},
|
|
290
306
|
size: e.getTagSize.value
|
|
291
307
|
});
|
|
292
308
|
}, Z = () => {
|
|
293
|
-
if (!e.props.multiple && !
|
|
294
|
-
let
|
|
295
|
-
if (e.props.tagRenderMode === "avatar" ?
|
|
309
|
+
if (!e.props.multiple && !e.props.multiple && !A(e.modelValue.value) && e.modelValue.value && (e.props.tagRenderMode && ["avatar", "go"].includes(e.props.tagRenderMode) || K.value || e.props.leadingIcon)) {
|
|
310
|
+
let P;
|
|
311
|
+
if (e.props.tagRenderMode === "avatar" ? P = Q(e.modelValue.value) : e.props.tagRenderMode === "go" ? P = X(e.modelValue.value) : K.value ? P = S(K.value) : e.props.leadingIcon && (P = S(e.props.leadingIcon)), !U(P))
|
|
296
312
|
return l("div", {
|
|
297
313
|
class: [k(i, "leading"), e.props.triggerLeadingCls]
|
|
298
|
-
},
|
|
314
|
+
}, P);
|
|
299
315
|
}
|
|
300
|
-
},
|
|
301
|
-
const
|
|
302
|
-
if (e.props.multiple &&
|
|
316
|
+
}, ce = () => {
|
|
317
|
+
const P = [], $ = [k(i, "tags"), e.props.triggerContentCls, e.props.triggerContentValueCls], N = (() => {
|
|
318
|
+
if (e.props.multiple && A(e.modelValue.value)) {
|
|
303
319
|
if (e.props.tagRenderMode === "avatar")
|
|
304
|
-
return l(
|
|
320
|
+
return l(Lt, {
|
|
305
321
|
maxCount: e.props.maxCount,
|
|
306
322
|
size: e.getTagSize.value,
|
|
307
323
|
closeable: !e.getDisabled.value,
|
|
308
324
|
noPopover: !0,
|
|
309
325
|
noWrap: !e.props.wrapped,
|
|
310
|
-
class:
|
|
311
|
-
}, () => e.modelValue.value.map(
|
|
326
|
+
class: $
|
|
327
|
+
}, () => e.modelValue.value.map(Q));
|
|
312
328
|
if (e.props.tagRenderMode === "go")
|
|
313
|
-
return l(
|
|
329
|
+
return l(Dt, {
|
|
314
330
|
maxCount: e.props.maxCount,
|
|
315
331
|
size: e.getTagSize.value,
|
|
316
332
|
closeable: !e.getDisabled.value,
|
|
317
333
|
noPopover: !0,
|
|
318
334
|
noWrap: !e.props.wrapped,
|
|
319
|
-
class:
|
|
320
|
-
}, () => e.modelValue.value.map(
|
|
335
|
+
class: $
|
|
336
|
+
}, () => e.modelValue.value.map(X));
|
|
321
337
|
if (e.props.tagRenderMode === "chip")
|
|
322
338
|
return l(Mt, {
|
|
323
339
|
maxCount: e.props.maxCount,
|
|
@@ -326,49 +342,49 @@ const Ht = ({
|
|
|
326
342
|
closeable: !e.getDisabled.value,
|
|
327
343
|
noPopover: !0,
|
|
328
344
|
noWrap: !e.props.wrapped,
|
|
329
|
-
class:
|
|
345
|
+
class: $,
|
|
330
346
|
onClose: c
|
|
331
|
-
}, () => e.modelValue.value.map((
|
|
332
|
-
var
|
|
333
|
-
const
|
|
334
|
-
size:
|
|
347
|
+
}, () => e.modelValue.value.map((q) => {
|
|
348
|
+
var ge, ne;
|
|
349
|
+
const se = () => e.getLabelByValue(q), be = ({
|
|
350
|
+
size: ye
|
|
335
351
|
}) => {
|
|
336
|
-
const
|
|
337
|
-
return
|
|
338
|
-
},
|
|
352
|
+
const me = y(e.getOptionByValue(q)) ?? e.props.leadingIcon;
|
|
353
|
+
return me ? S(me, ye) : null;
|
|
354
|
+
}, ie = e.getOptionByValue(q);
|
|
339
355
|
return l(zt, {
|
|
340
|
-
...
|
|
341
|
-
value:
|
|
356
|
+
...ie ? ((ne = (ge = e.props).getTagProps) == null ? void 0 : ne.call(ge, ie)) ?? {} : {},
|
|
357
|
+
value: q,
|
|
342
358
|
class: [k(i, "tag"), e.props.tagCls],
|
|
343
359
|
closeIconCls: k(i, "tag__close")
|
|
344
360
|
}, {
|
|
345
|
-
text:
|
|
346
|
-
leading:
|
|
361
|
+
text: se,
|
|
362
|
+
leading: be
|
|
347
363
|
});
|
|
348
364
|
}));
|
|
349
365
|
}
|
|
350
366
|
})();
|
|
351
|
-
return
|
|
367
|
+
return N && P.push(N), e.props.headerSearch ? e.props.showLabelValueOnHeaderSearch && P.push(l("div", {}, "dddd")) : P.push(l(je)), l("div", {
|
|
352
368
|
class: k(i, "content")
|
|
353
|
-
},
|
|
354
|
-
},
|
|
355
|
-
|
|
356
|
-
const
|
|
357
|
-
return
|
|
369
|
+
}, P);
|
|
370
|
+
}, oe = [], te = Z();
|
|
371
|
+
U(te) || oe.push(te), oe.push(ce());
|
|
372
|
+
const de = V();
|
|
373
|
+
return U(de) || oe.push(de), oe;
|
|
358
374
|
});
|
|
359
375
|
};
|
|
360
376
|
}
|
|
361
|
-
}), Qt = /* @__PURE__ */
|
|
377
|
+
}), Qt = /* @__PURE__ */ le({
|
|
362
378
|
__name: "ComboboxLabel",
|
|
363
379
|
setup(u) {
|
|
364
|
-
return (o, t) => (
|
|
365
|
-
class: Ye(
|
|
380
|
+
return (o, t) => (ue(), Re("div", {
|
|
381
|
+
class: Ye(D(k)(D(E), "label"))
|
|
366
382
|
}, [
|
|
367
|
-
|
|
383
|
+
Ae(o.$slots, "default")
|
|
368
384
|
], 2));
|
|
369
385
|
}
|
|
370
|
-
}),
|
|
371
|
-
name:
|
|
386
|
+
}), Ee = /* @__PURE__ */ le({
|
|
387
|
+
name: Oe("SelectOption"),
|
|
372
388
|
props: {
|
|
373
389
|
option: {
|
|
374
390
|
type: [Object, String],
|
|
@@ -379,7 +395,7 @@ const Ht = ({
|
|
|
379
395
|
setup(u, {
|
|
380
396
|
slots: o
|
|
381
397
|
}) {
|
|
382
|
-
const t =
|
|
398
|
+
const t = Ie(), e = m(() => {
|
|
383
399
|
switch (t.getSize.value) {
|
|
384
400
|
case "sm":
|
|
385
401
|
return "2xsm";
|
|
@@ -389,56 +405,56 @@ const Ht = ({
|
|
|
389
405
|
default:
|
|
390
406
|
return "xsm";
|
|
391
407
|
}
|
|
392
|
-
}), c = m(() => t.getOptionValue(u.option)), i = m(() => t.getOptionNoCheckbox(u.option)), B = m(() => t.getOptionClear(u.option)), T = m(() => t.getOptionSingle(u.option)),
|
|
393
|
-
if (!(t.props.tree || !c.value ||
|
|
408
|
+
}), c = m(() => t.getOptionValue(u.option)), i = m(() => t.getOptionNoCheckbox(u.option)), B = m(() => t.getOptionClear(u.option)), T = m(() => t.getOptionSingle(u.option)), x = m(() => t.getOptionLabel(u.option)), y = m(() => t.getOptionIcon(u.option)), K = m(() => t.props.tree ? void 0 : t.getOptionDescription(u.option)), R = m(() => t.getOptionDisabled(u.option)), r = m(() => t.isItemSelected(c.value)), f = k(E, "option"), d = () => {
|
|
409
|
+
if (!(t.props.tree || !c.value || R.value))
|
|
394
410
|
if (t.props.multiple)
|
|
395
411
|
if (B.value)
|
|
396
412
|
t.setModelValue([]), t.emit("select", void 0, !1);
|
|
397
413
|
else if (T.value)
|
|
398
414
|
t.setModelValue([c.value]), t.emit("select", c.value, !0);
|
|
399
415
|
else {
|
|
400
|
-
let s =
|
|
401
|
-
const
|
|
402
|
-
s.length === 1 && t.getSingleByValue(s[0]) && c.value !== s[0] && (s = []),
|
|
416
|
+
let s = A(t.modelValue.value) ? t.modelValue.value : [];
|
|
417
|
+
const S = s.includes(c.value);
|
|
418
|
+
s.length === 1 && t.getSingleByValue(s[0]) && c.value !== s[0] && (s = []), S ? (t.setModelValue(s.filter((V) => V !== c.value)), t.emit("select", c.value, !0)) : (t.setModelValue([...s, c.value]), t.emit("select", c.value, !1));
|
|
403
419
|
}
|
|
404
420
|
else B.value ? (t.setModelValue(void 0), t.emit("select", void 0, !1)) : (t.setModelValue(c.value), t.emit("select", c.value, !0));
|
|
405
421
|
};
|
|
406
422
|
if (!u.option) throw new Error("option is required");
|
|
407
423
|
return () => {
|
|
408
424
|
const s = (V) => {
|
|
409
|
-
var
|
|
425
|
+
var z, v, j, J, ee;
|
|
410
426
|
const a = [];
|
|
411
427
|
!t.props.tree && t.props.multiple && t.props.checkbox && !i.value && a.push(l(At, {
|
|
412
428
|
modelValue: r.value,
|
|
413
429
|
size: V.checkboxSize,
|
|
414
|
-
disabled:
|
|
430
|
+
disabled: R.value
|
|
415
431
|
}));
|
|
416
|
-
const
|
|
432
|
+
const _ = (z = o.leading) == null ? void 0 : z.call(o, {
|
|
417
433
|
option: u.option
|
|
418
434
|
});
|
|
419
|
-
return
|
|
420
|
-
...((
|
|
435
|
+
return U(_) ? t.props.tagRenderMode === "avatar" ? a.push(l(We, {
|
|
436
|
+
...((j = (v = t.props).getTagProps) == null ? void 0 : j.call(v, u.option)) ?? {},
|
|
421
437
|
size: t.getTagSize.value
|
|
422
|
-
})) : t.props.tagRenderMode === "go" ? a.push(l(
|
|
423
|
-
...((
|
|
438
|
+
})) : t.props.tagRenderMode === "go" ? a.push(l(Ge, {
|
|
439
|
+
...((ee = (J = t.props).getTagProps) == null ? void 0 : ee.call(J, u.option)) ?? {},
|
|
424
440
|
size: t.getTagSize.value
|
|
425
|
-
})) : y.value && a.push(l(
|
|
441
|
+
})) : y.value && a.push(l(Pe, {
|
|
426
442
|
icon: y.value,
|
|
427
443
|
size: e.value
|
|
428
|
-
})) : a.push(
|
|
444
|
+
})) : a.push(_), U(a) ? null : a;
|
|
429
445
|
};
|
|
430
446
|
return (() => {
|
|
431
|
-
const V = !!
|
|
447
|
+
const V = !!K.value;
|
|
432
448
|
return l(Nt, {
|
|
433
449
|
class: f,
|
|
434
|
-
description:
|
|
435
|
-
title:
|
|
450
|
+
description: K.value,
|
|
451
|
+
title: x.value,
|
|
436
452
|
key: c.value,
|
|
437
453
|
selected: r.value,
|
|
438
454
|
unFocusable: !0,
|
|
439
455
|
leadingCenter: !V,
|
|
440
456
|
size: t.getSize.value,
|
|
441
|
-
disabled:
|
|
457
|
+
disabled: R.value,
|
|
442
458
|
onClick: d
|
|
443
459
|
}, {
|
|
444
460
|
leading: s,
|
|
@@ -452,45 +468,45 @@ const Ht = ({
|
|
|
452
468
|
})();
|
|
453
469
|
};
|
|
454
470
|
}
|
|
455
|
-
}), Xt = /* @__PURE__ */
|
|
456
|
-
name:
|
|
471
|
+
}), Xt = /* @__PURE__ */ le({
|
|
472
|
+
name: Oe("ComboboxWrapper"),
|
|
457
473
|
setup(u, {
|
|
458
474
|
slots: o
|
|
459
475
|
}) {
|
|
460
|
-
const t = Ft(), e = at(), c =
|
|
476
|
+
const t = Ft(), e = at(), c = Ve();
|
|
461
477
|
Bt({
|
|
462
478
|
target: c
|
|
463
479
|
});
|
|
464
|
-
const i =
|
|
480
|
+
const i = Ve(), B = Pt({
|
|
465
481
|
triggerRef: i,
|
|
466
482
|
props: t.props
|
|
467
483
|
}), {
|
|
468
484
|
getFlipOnDir: T,
|
|
469
|
-
getDir:
|
|
470
|
-
} = ft(), y = T("reversePlacementOnDir"),
|
|
485
|
+
getDir: x
|
|
486
|
+
} = ft(), y = T("reversePlacementOnDir"), K = x(), R = It({
|
|
471
487
|
props: t.props,
|
|
472
488
|
flip: y,
|
|
473
489
|
emitsAsProps: t.emitsAsProps,
|
|
474
|
-
_dir:
|
|
490
|
+
_dir: K,
|
|
475
491
|
controlAutoFocus: !1,
|
|
476
492
|
extraPropNames: ["bodyLock", "position"]
|
|
477
493
|
}), r = ({
|
|
478
494
|
key: n,
|
|
479
495
|
getterKey: p,
|
|
480
496
|
defaultValue: h,
|
|
481
|
-
noReturnOption:
|
|
497
|
+
noReturnOption: I
|
|
482
498
|
}) => (b) => {
|
|
483
|
-
const
|
|
484
|
-
if (
|
|
485
|
-
const W = b[n] ??
|
|
499
|
+
const L = Le(h) ? h(b) : h;
|
|
500
|
+
if (Se(b)) {
|
|
501
|
+
const W = b[n] ?? L, G = p && t.props[p];
|
|
486
502
|
if (G) {
|
|
487
|
-
if (
|
|
503
|
+
if (he(G))
|
|
488
504
|
return b[G] ?? W;
|
|
489
|
-
if (
|
|
505
|
+
if (Le(G)) return G(b) ?? W;
|
|
490
506
|
}
|
|
491
507
|
return W;
|
|
492
508
|
}
|
|
493
|
-
return
|
|
509
|
+
return he(b) && !I ? b ?? L : L;
|
|
494
510
|
}, f = r({
|
|
495
511
|
getterKey: "getValue",
|
|
496
512
|
key: "value"
|
|
@@ -501,7 +517,7 @@ const Ht = ({
|
|
|
501
517
|
getterKey: "getSingle",
|
|
502
518
|
key: "single",
|
|
503
519
|
noReturnOption: !0
|
|
504
|
-
}),
|
|
520
|
+
}), S = r({
|
|
505
521
|
getterKey: "getClear",
|
|
506
522
|
key: "clear",
|
|
507
523
|
noReturnOption: !0
|
|
@@ -513,11 +529,11 @@ const Ht = ({
|
|
|
513
529
|
getterKey: "getIcon",
|
|
514
530
|
key: "icon",
|
|
515
531
|
noReturnOption: !0
|
|
516
|
-
}),
|
|
532
|
+
}), _ = r({
|
|
517
533
|
getterKey: "getDescription",
|
|
518
534
|
key: "description",
|
|
519
535
|
noReturnOption: !0
|
|
520
|
-
}),
|
|
536
|
+
}), z = r({
|
|
521
537
|
getterKey: "getDisabled",
|
|
522
538
|
key: "disabled",
|
|
523
539
|
defaultValue: !1,
|
|
@@ -526,67 +542,67 @@ const Ht = ({
|
|
|
526
542
|
getterKey: "getGroupLabel",
|
|
527
543
|
key: "label",
|
|
528
544
|
noReturnOption: !0
|
|
529
|
-
}),
|
|
545
|
+
}), j = r({
|
|
530
546
|
getterKey: "getGroupOptions",
|
|
531
547
|
key: "options",
|
|
532
548
|
noReturnOption: !0
|
|
533
|
-
}),
|
|
549
|
+
}), J = (n) => {
|
|
534
550
|
const p = (h) => {
|
|
535
551
|
if (h != null && h.length && n)
|
|
536
|
-
for (const
|
|
537
|
-
if (f(
|
|
538
|
-
const b =
|
|
552
|
+
for (const I of h) {
|
|
553
|
+
if (f(I) === n) return I;
|
|
554
|
+
const b = j(I);
|
|
539
555
|
if (b != null && b.length) {
|
|
540
|
-
const
|
|
541
|
-
if (
|
|
556
|
+
const L = p(b);
|
|
557
|
+
if (L) return L;
|
|
542
558
|
}
|
|
543
559
|
}
|
|
544
560
|
};
|
|
545
561
|
return p(t.props.options);
|
|
546
|
-
},
|
|
547
|
-
const p =
|
|
562
|
+
}, ee = (n) => {
|
|
563
|
+
const p = J(n);
|
|
548
564
|
return p ? V(p) ?? n : n;
|
|
549
|
-
},
|
|
550
|
-
const p =
|
|
565
|
+
}, Q = (n) => {
|
|
566
|
+
const p = J(n);
|
|
551
567
|
return p ? s(p) ?? !1 : !1;
|
|
552
568
|
}, {
|
|
553
|
-
contains:
|
|
569
|
+
contains: X
|
|
554
570
|
} = rt({
|
|
555
571
|
sensitivity: "base"
|
|
556
|
-
}),
|
|
572
|
+
}), Z = m(() => {
|
|
557
573
|
const n = (p) => p == null ? void 0 : p.map((h) => {
|
|
558
|
-
const
|
|
574
|
+
const I = V(h), b = f(h), L = z(h), W = v(h), G = !t.searchModel.value || I && X(I, t.searchModel.value), g = j(h), O = !t.props.tree || b;
|
|
559
575
|
if (g && O) {
|
|
560
576
|
const C = n(g);
|
|
561
577
|
if (C != null && C.length || G)
|
|
562
578
|
return {
|
|
563
579
|
groupLabel: W,
|
|
564
|
-
title:
|
|
580
|
+
title: I,
|
|
565
581
|
key: b,
|
|
566
|
-
disabled:
|
|
582
|
+
disabled: L,
|
|
567
583
|
children: C,
|
|
568
584
|
_option: h
|
|
569
585
|
};
|
|
570
586
|
}
|
|
571
587
|
return G && O ? {
|
|
572
|
-
title:
|
|
588
|
+
title: I,
|
|
573
589
|
key: b,
|
|
574
|
-
disabled:
|
|
590
|
+
disabled: L,
|
|
575
591
|
_option: h
|
|
576
592
|
} : null;
|
|
577
593
|
}).filter(Boolean);
|
|
578
594
|
if (t.props.options)
|
|
579
595
|
return n(t.props.options);
|
|
580
596
|
}), {
|
|
581
|
-
getDisabled:
|
|
582
|
-
getStatus:
|
|
583
|
-
getSize:
|
|
597
|
+
getDisabled: ce,
|
|
598
|
+
getStatus: oe,
|
|
599
|
+
getSize: te
|
|
584
600
|
} = St({
|
|
585
601
|
getDisabled: () => t.props.disabled,
|
|
586
602
|
getSize: () => t.props.size,
|
|
587
603
|
getStatus: () => t.props.status
|
|
588
|
-
}),
|
|
589
|
-
switch (
|
|
604
|
+
}), de = m(() => {
|
|
605
|
+
switch (te.value) {
|
|
590
606
|
case "sm":
|
|
591
607
|
return "xsm";
|
|
592
608
|
case "lg":
|
|
@@ -596,73 +612,73 @@ const Ht = ({
|
|
|
596
612
|
return "sm";
|
|
597
613
|
}
|
|
598
614
|
}), {
|
|
599
|
-
inputBindings:
|
|
600
|
-
rootBindings:
|
|
615
|
+
inputBindings: P,
|
|
616
|
+
rootBindings: $
|
|
601
617
|
} = Ot({
|
|
602
|
-
getDisabled: () =>
|
|
603
|
-
}),
|
|
604
|
-
var n, p, h,
|
|
605
|
-
e.open.value && e.inputElement.value && (t.props.headerSearch && ((n =
|
|
606
|
-
},
|
|
618
|
+
getDisabled: () => ce.value
|
|
619
|
+
}), F = Ve(), N = () => {
|
|
620
|
+
var n, p, h, I, b, L, W;
|
|
621
|
+
e.open.value && e.inputElement.value && (t.props.headerSearch && ((n = F.value) != null && n.input) ? document.activeElement !== ((p = F.value) == null ? void 0 : p.input) && ((b = (I = (h = F.value) == null ? void 0 : h.input) == null ? void 0 : I.focus) == null || b.call(I)) : document.activeElement !== e.inputElement.value && ((W = (L = e.inputElement.value) == null ? void 0 : L.focus) == null || W.call(L)));
|
|
622
|
+
}, q = (n) => {
|
|
607
623
|
e.modelValue.value = n, t.emit("update:modelValue", n);
|
|
608
|
-
},
|
|
624
|
+
}, se = (n) => n === void 0 ? !1 : Array.isArray(e.modelValue.value) ? !!(n && e.modelValue.value.includes(n)) : e.modelValue.value === n;
|
|
609
625
|
$t({
|
|
610
626
|
...t,
|
|
611
627
|
getOptionValue: f,
|
|
612
628
|
getOptionLabel: V,
|
|
613
629
|
getOptionSingle: s,
|
|
614
|
-
getOptionClear:
|
|
630
|
+
getOptionClear: S,
|
|
615
631
|
getOptionNoCheckbox: d,
|
|
616
|
-
getOptionDescription:
|
|
617
|
-
getOptionDisabled:
|
|
632
|
+
getOptionDescription: _,
|
|
633
|
+
getOptionDisabled: z,
|
|
618
634
|
getOptionIcon: a,
|
|
619
|
-
getOptionByValue:
|
|
620
|
-
isItemSelected:
|
|
621
|
-
getLabelByValue:
|
|
622
|
-
getSingleByValue:
|
|
623
|
-
focusOnInput:
|
|
624
|
-
setModelValue:
|
|
625
|
-
headerInputElement:
|
|
626
|
-
getDisabled:
|
|
627
|
-
getStatus:
|
|
628
|
-
getSize:
|
|
629
|
-
getTagSize:
|
|
630
|
-
comboboxInputBinding:
|
|
631
|
-
comboboxTriggerBinding:
|
|
635
|
+
getOptionByValue: J,
|
|
636
|
+
isItemSelected: se,
|
|
637
|
+
getLabelByValue: ee,
|
|
638
|
+
getSingleByValue: Q,
|
|
639
|
+
focusOnInput: N,
|
|
640
|
+
setModelValue: q,
|
|
641
|
+
headerInputElement: F,
|
|
642
|
+
getDisabled: ce,
|
|
643
|
+
getStatus: oe,
|
|
644
|
+
getSize: te,
|
|
645
|
+
getTagSize: de,
|
|
646
|
+
comboboxInputBinding: P,
|
|
647
|
+
comboboxTriggerBinding: $,
|
|
632
648
|
...e,
|
|
633
649
|
modelValue: e.modelValue
|
|
634
|
-
}),
|
|
635
|
-
t.props.clearOnChangeMultiple &&
|
|
650
|
+
}), $e(() => [t.props.clearOnChangeMultiple, t.props.multiple], () => {
|
|
651
|
+
t.props.clearOnChangeMultiple && q(void 0);
|
|
636
652
|
});
|
|
637
|
-
const
|
|
653
|
+
const be = m(() => {
|
|
638
654
|
const n = t.props.scrollContainerProps ?? {};
|
|
639
655
|
return {
|
|
640
656
|
...n,
|
|
641
|
-
areaCls: [k(
|
|
657
|
+
areaCls: [k(E, "scroll_area"), n == null ? void 0 : n.class, n == null ? void 0 : n.areaCls]
|
|
642
658
|
};
|
|
643
|
-
}),
|
|
659
|
+
}), ie = k(E, "popup"), ge = Be(ie, {
|
|
644
660
|
variants: {
|
|
645
|
-
size: H(
|
|
661
|
+
size: H(Ue, ie)
|
|
646
662
|
}
|
|
647
|
-
}),
|
|
663
|
+
}), ne = (n) => {
|
|
648
664
|
if (Number(n) > 0)
|
|
649
665
|
return `${n}px`;
|
|
650
666
|
if (typeof n == "string")
|
|
651
667
|
return n;
|
|
652
|
-
},
|
|
653
|
-
type:
|
|
654
|
-
...
|
|
655
|
-
})), He = m(() =>
|
|
668
|
+
}, ye = m(() => ne(t.props.popupWidth)), me = m(() => ne(t.props.popupHeight)), ke = m(() => ne(t.props.minWidth)), Te = m(() => ({
|
|
669
|
+
type: te.value === "sm" ? "simple" : "advance",
|
|
670
|
+
...De(t.props.emptyProps ?? {}, "class")
|
|
671
|
+
})), He = m(() => De(t.props.skeletonProps ?? {}, "class")), {
|
|
656
672
|
selectValues: qe
|
|
657
673
|
} = Ht({
|
|
658
674
|
getValue: (n) => n == null ? void 0 : n.key,
|
|
659
675
|
getChildren: (n) => n == null ? void 0 : n.children,
|
|
660
|
-
getModel: () =>
|
|
661
|
-
getData: () =>
|
|
676
|
+
getModel: () => re(e.modelValue.value),
|
|
677
|
+
getData: () => re(Z.value ?? [])
|
|
662
678
|
});
|
|
663
679
|
return () => {
|
|
664
680
|
var W, G;
|
|
665
|
-
const n = (g) => l(
|
|
681
|
+
const n = (g) => l(Ee, {
|
|
666
682
|
option: g
|
|
667
683
|
}, {
|
|
668
684
|
trailing: o.optionTrailing,
|
|
@@ -670,9 +686,9 @@ const Ht = ({
|
|
|
670
686
|
}), p = [];
|
|
671
687
|
let h;
|
|
672
688
|
if (t.props.tree) {
|
|
673
|
-
const O =
|
|
689
|
+
const O = A(e.modelValue.value) ? e.modelValue.value : e.modelValue.value ? [e.modelValue.value] : [];
|
|
674
690
|
h = l(Tt, {
|
|
675
|
-
data:
|
|
691
|
+
data: Z.value ?? [],
|
|
676
692
|
selectable: !0,
|
|
677
693
|
checkbox: t.props.multiple && t.props.checkbox,
|
|
678
694
|
multiple: t.props.multiple,
|
|
@@ -681,13 +697,13 @@ const Ht = ({
|
|
|
681
697
|
showLine: !0,
|
|
682
698
|
modelValue: O,
|
|
683
699
|
checkedKeys: O,
|
|
684
|
-
onExpand:
|
|
685
|
-
onSelect: (C,
|
|
700
|
+
onExpand: N,
|
|
701
|
+
onSelect: (C, w, M) => {
|
|
686
702
|
if (t.props.multiple) {
|
|
687
|
-
const Y =
|
|
688
|
-
|
|
703
|
+
const Y = A(M) ? M : [M];
|
|
704
|
+
q(qe(Y, w));
|
|
689
705
|
} else
|
|
690
|
-
|
|
706
|
+
q(M);
|
|
691
707
|
},
|
|
692
708
|
class: "w-full"
|
|
693
709
|
}, {
|
|
@@ -696,64 +712,64 @@ const Ht = ({
|
|
|
696
712
|
} else {
|
|
697
713
|
let g = !1;
|
|
698
714
|
const O = [];
|
|
699
|
-
if ((
|
|
700
|
-
var
|
|
701
|
-
if ((
|
|
702
|
-
const
|
|
715
|
+
if ((Z.value ?? []).forEach((C) => {
|
|
716
|
+
var w;
|
|
717
|
+
if ((w = C.children) != null && w.length) {
|
|
718
|
+
const M = [];
|
|
703
719
|
C.children.forEach((Y) => {
|
|
704
|
-
const
|
|
705
|
-
|
|
706
|
-
}),
|
|
720
|
+
const pe = n(Y._option);
|
|
721
|
+
se(f(Y._option)) && t.props.sortSelectedItems ? O.push(pe) : M.push(pe);
|
|
722
|
+
}), M.length && ((g || p.length) && (p.push(l(_e)), g = !1), C.groupLabel && p.push(l(Qt, {
|
|
707
723
|
class: t.props.labelCls
|
|
708
|
-
}, () => C.groupLabel)), p.push(...
|
|
724
|
+
}, () => C.groupLabel)), p.push(...M), g = !0);
|
|
709
725
|
} else {
|
|
710
|
-
const
|
|
711
|
-
|
|
726
|
+
const M = n(C._option);
|
|
727
|
+
se(f(C._option)) && t.props.sortSelectedItems ? O.push(M) : (g && (p.push(l(_e)), g = !1), p.push(M));
|
|
712
728
|
}
|
|
713
729
|
}), t.props.sortSelectedItems && O.length) {
|
|
714
730
|
const C = !!p.length;
|
|
715
|
-
p.splice(0, 0, ...O), C && p.splice(O.length, 0, l(
|
|
731
|
+
p.splice(0, 0, ...O), C && p.splice(O.length, 0, l(_e));
|
|
716
732
|
}
|
|
717
733
|
}
|
|
718
|
-
const
|
|
734
|
+
const I = xt(h ? [h] : p, Ee).filter((g) => {
|
|
719
735
|
var O;
|
|
720
|
-
return
|
|
721
|
-
}), b = !!(t.props.tree && ((W =
|
|
736
|
+
return Se(g == null ? void 0 : g.props) && ((O = g == null ? void 0 : g.props) == null ? void 0 : O.option);
|
|
737
|
+
}), b = !!(t.props.tree && ((W = Z.value) != null && W.length) || I != null && I.length), L = () => {
|
|
722
738
|
var O, C;
|
|
723
739
|
const g = [];
|
|
724
740
|
if (b || t.props.loading) {
|
|
725
|
-
const
|
|
726
|
-
if (b &&
|
|
727
|
-
const
|
|
728
|
-
if (!
|
|
741
|
+
const w = [];
|
|
742
|
+
if (b && w.push(...p), t.props.loading) {
|
|
743
|
+
const M = (O = o.loading) == null ? void 0 : O.call(o, {});
|
|
744
|
+
if (!U(M)) w.push(M);
|
|
729
745
|
else {
|
|
730
746
|
const Y = new Array(b ? 2 : t.props.loadingRowCount).fill(1);
|
|
731
|
-
|
|
732
|
-
size:
|
|
733
|
-
class: [k(
|
|
747
|
+
w.push(...Y.map(() => l(yt, {
|
|
748
|
+
size: te.value,
|
|
749
|
+
class: [k(E, "skeleton"), t.props.skeletonCls],
|
|
734
750
|
...He.value
|
|
735
751
|
})));
|
|
736
752
|
}
|
|
737
753
|
}
|
|
738
754
|
g.push(l("div", {
|
|
739
|
-
class: [k(
|
|
740
|
-
},
|
|
755
|
+
class: [k(E, "options"), t.props.optionsCls]
|
|
756
|
+
}, w));
|
|
741
757
|
} else if (!b) {
|
|
742
|
-
const
|
|
743
|
-
|
|
744
|
-
class: [k(
|
|
745
|
-
...
|
|
758
|
+
const w = (C = o.empty) == null ? void 0 : C.call(o, Te.value);
|
|
759
|
+
U(w) ? g.push(l(bt, {
|
|
760
|
+
class: [k(E, "empty"), t.props.emptyCls],
|
|
761
|
+
...Te.value
|
|
746
762
|
}, {
|
|
747
763
|
title: o.emptyTitle,
|
|
748
764
|
description: o.emptyDescription,
|
|
749
765
|
actions: o.emptyActions,
|
|
750
766
|
image: o.emptyImage
|
|
751
|
-
})) : g.push(
|
|
767
|
+
})) : g.push(w);
|
|
752
768
|
}
|
|
753
769
|
return t.props.lazyLoading && g.push(l("div", {
|
|
754
|
-
class: k(
|
|
770
|
+
class: k(E, "lazy_loading")
|
|
755
771
|
}, l("div", {
|
|
756
|
-
class: k(
|
|
772
|
+
class: k(E, "lazy_loading_trigger"),
|
|
757
773
|
ref: c
|
|
758
774
|
}))), g;
|
|
759
775
|
};
|
|
@@ -762,51 +778,55 @@ const Ht = ({
|
|
|
762
778
|
...t.attrs,
|
|
763
779
|
style: {
|
|
764
780
|
...((G = t.attrs) == null ? void 0 : G.style) ?? {},
|
|
765
|
-
"--ptc-combobox-trigger-min-w":
|
|
781
|
+
"--ptc-combobox-trigger-min-w": ke.value
|
|
766
782
|
}
|
|
767
783
|
}, {
|
|
768
784
|
trigger: o.trigger,
|
|
769
785
|
triggerTrailing: o.triggerTrailing
|
|
770
786
|
}), l(lt, B.value, () => l(st, {
|
|
771
|
-
|
|
787
|
+
...R.value,
|
|
772
788
|
vShow: e.open.value,
|
|
773
|
-
class: [
|
|
789
|
+
class: [ge(t.props), t.props.popupCls],
|
|
774
790
|
style: {
|
|
775
|
-
|
|
776
|
-
"--ptc-combobox-popup-
|
|
777
|
-
"--ptc-combobox-
|
|
791
|
+
zIndex: t.props.zIndex,
|
|
792
|
+
"--ptc-combobox-popup-width": t.props.samePopupWidth ? void 0 : ye.value,
|
|
793
|
+
"--ptc-combobox-popup-height": me.value,
|
|
794
|
+
"--ptc-combobox-trigger-min-w": ke.value
|
|
778
795
|
},
|
|
779
|
-
onClick:
|
|
796
|
+
onClick: N
|
|
780
797
|
}, () => {
|
|
781
|
-
var
|
|
798
|
+
var M, Y, pe, ze;
|
|
782
799
|
const g = [], O = (Y = o.header) == null ? void 0 : Y.call(o, {
|
|
783
|
-
isEmpty: !((
|
|
800
|
+
isEmpty: !((M = Z.value) != null && M.length),
|
|
784
801
|
search: t.searchModel.value
|
|
785
|
-
}), C = !
|
|
802
|
+
}), C = !U(O);
|
|
786
803
|
if (t.props.headerSearch || C) {
|
|
787
|
-
const
|
|
788
|
-
C &&
|
|
789
|
-
class: k(
|
|
790
|
-
},
|
|
804
|
+
const Ce = [];
|
|
805
|
+
C && Ce.push(O), t.props.headerSearch && Ce.push(l(je)), g.push(l("div", {
|
|
806
|
+
class: k(E, "header")
|
|
807
|
+
}, Ce));
|
|
791
808
|
}
|
|
792
|
-
g.push(l(
|
|
793
|
-
const
|
|
794
|
-
isEmpty: !((
|
|
809
|
+
g.push(l(kt, be.value, L));
|
|
810
|
+
const w = (ze = o.footer) == null ? void 0 : ze.call(o, {
|
|
811
|
+
isEmpty: !((pe = Z.value) != null && pe.length),
|
|
795
812
|
search: t.searchModel.value
|
|
796
813
|
});
|
|
797
|
-
return
|
|
798
|
-
class: k(
|
|
799
|
-
},
|
|
814
|
+
return U(w) || g.push(l("div", {
|
|
815
|
+
class: k(E, "footer")
|
|
816
|
+
}, w)), g;
|
|
800
817
|
}))];
|
|
801
818
|
};
|
|
802
819
|
}
|
|
803
|
-
}), Mo = /* @__PURE__ */
|
|
820
|
+
}), Mo = /* @__PURE__ */ le({
|
|
804
821
|
...gt("Combobox"),
|
|
805
822
|
__name: "Combobox",
|
|
806
823
|
props: {
|
|
807
824
|
size: { default: "md" },
|
|
808
825
|
status: {},
|
|
809
826
|
multiple: { type: Boolean, default: void 0 },
|
|
827
|
+
noLastValueOnPlaceholder: { type: Boolean },
|
|
828
|
+
showLabelValueOnHeaderSearch: { type: Boolean },
|
|
829
|
+
zIndex: {},
|
|
810
830
|
checkbox: { type: Boolean, default: !0 },
|
|
811
831
|
tagRenderMode: { default: "chip" },
|
|
812
832
|
getTagProps: {},
|
|
@@ -905,7 +925,7 @@ const Ht = ({
|
|
|
905
925
|
const t = u, e = o, c = it(e), i = m(
|
|
906
926
|
() => ct(
|
|
907
927
|
{
|
|
908
|
-
...
|
|
928
|
+
...Me(
|
|
909
929
|
t,
|
|
910
930
|
"open",
|
|
911
931
|
"defaultOpen",
|
|
@@ -916,7 +936,7 @@ const Ht = ({
|
|
|
916
936
|
"multiple",
|
|
917
937
|
"disabled"
|
|
918
938
|
),
|
|
919
|
-
...
|
|
939
|
+
...Me(
|
|
920
940
|
c,
|
|
921
941
|
"onUpdate:modelValue",
|
|
922
942
|
"onUpdate:open"
|
|
@@ -928,26 +948,26 @@ const Ht = ({
|
|
|
928
948
|
), B = Kt(t, "search", e, {
|
|
929
949
|
passive: t.search === void 0
|
|
930
950
|
});
|
|
931
|
-
|
|
951
|
+
$e(
|
|
932
952
|
() => t.open,
|
|
933
953
|
(y) => {
|
|
934
954
|
y || (B.value = void 0);
|
|
935
955
|
}
|
|
936
956
|
);
|
|
937
|
-
const T = Je(),
|
|
957
|
+
const T = Je(), x = Qe();
|
|
938
958
|
return Wt({
|
|
939
|
-
attrs:
|
|
959
|
+
attrs: x,
|
|
940
960
|
props: t,
|
|
941
961
|
emit: e,
|
|
942
962
|
searchModel: B,
|
|
943
963
|
emitsAsProps: c
|
|
944
|
-
}), (y,
|
|
945
|
-
default:
|
|
946
|
-
|
|
947
|
-
Ze(Object.keys(T), (
|
|
948
|
-
name:
|
|
949
|
-
fn:
|
|
950
|
-
|
|
964
|
+
}), (y, K) => (ue(), xe(D(pt), Ke(i.value, { class: D(E) }), {
|
|
965
|
+
default: ve(() => [
|
|
966
|
+
Ne(D(Xt), null, Xe({ _: 2 }, [
|
|
967
|
+
Ze(Object.keys(T), (R) => ({
|
|
968
|
+
name: R,
|
|
969
|
+
fn: ve((r) => [
|
|
970
|
+
Ae(y.$slots, R, et(tt(r)))
|
|
951
971
|
])
|
|
952
972
|
}))
|
|
953
973
|
]), 1024)
|
|
@@ -957,9 +977,9 @@ const Ht = ({
|
|
|
957
977
|
}
|
|
958
978
|
});
|
|
959
979
|
export {
|
|
960
|
-
|
|
980
|
+
Ue as C,
|
|
961
981
|
Mo as _,
|
|
962
982
|
qt as a,
|
|
963
|
-
|
|
983
|
+
Ie as i,
|
|
964
984
|
$t as p
|
|
965
985
|
};
|