@pantograph/vue 0.29.2 → 0.29.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Avatar/index.js +2 -2
- package/dist/Avatar/index.umd.cjs +1 -1
- package/dist/{Avatar.vue_vue_type_style_index_0_lang-kRBRb-c7.js → Avatar.vue_vue_type_style_index_0_lang-BSPQHKch.js} +1 -1
- package/dist/Avatar.vue_vue_type_style_index_0_lang-D2o9rP-R.js +1 -0
- package/dist/AvatarGroup/index.js +1 -1
- package/dist/AvatarGroup/index.umd.cjs +1 -1
- package/dist/Card/index.d.ts +1 -1
- package/dist/Combobox/index.js +108 -116
- package/dist/Combobox/index.umd.cjs +1 -1
- package/dist/Comment/Comment.d.ts +11 -9
- package/dist/Comment/CommentEditor.d.ts +1 -1
- package/dist/Comment/index.js +93 -90
- package/dist/Comment/index.umd.cjs +1 -1
- package/dist/ConfigProvider/index.js +33 -33
- package/dist/ConfigProvider/index.umd.cjs +1 -1
- package/dist/{index-DNiPkOH9.js → index-BMbS6v_U.js} +1 -1
- package/dist/{index-BV8PxmlX.js → index-DiTA0K4J.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/index.umd.cjs +1 -1
- package/dist/use/index.js +2 -2
- package/dist/use/index.umd.cjs +1 -1
- package/package.json +1 -1
- package/dist/Avatar.vue_vue_type_style_index_0_lang-D2zI9dKd.js +0 -1
package/dist/Combobox/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as _e, useSlots as
|
|
1
|
+
import { defineComponent as _e, useSlots as ut, onBeforeUnmount as $t, computed as C, createBlock as K, openBlock as I, unref as u, mergeProps as ue, createSlots as Kt, renderList as Ne, withCtx as W, renderSlot as Le, normalizeProps as Me, guardReactiveProps as Re, createVNode as X, h as _, useAttrs as Ft, createElementBlock as ye, normalizeClass as we, toDisplayString as Nt, ref as ve, watch as Wt, isRef as tt, createCommentVNode as Ae, createElementVNode as ot, normalizeStyle as Gt, Fragment as $e } from "vue";
|
|
2
2
|
import { createContext as Ht, Slot as Ut, useEmitAsProps as jt } from "reka-ui";
|
|
3
|
-
import { omit as he, isString as
|
|
4
|
-
import { isEmptyElement as $, useVModel as Oe, useLazyLoading as Qt, useFormInput as Xt, useVirtualScroll as Yt, useInputDataStates as Zt, useCollection as eo, useDisableBodyPointerEvents as to, installComponent as
|
|
5
|
-
import { getBemBlock as oo, getBemModifier as lo, getBemElement as x, getComponentOptions as be, normCls as H, isEmptyLikeLodash as F, generateVariantClassList as q, createOptionGetterFunc as j, usePCId as Ie, getPxSize as Ke, getComponentName as
|
|
3
|
+
import { omit as he, isString as lt, cloneDeep as ae, isFunction as qt, debounce as at, pick as Jt, last as nt } from "es-toolkit";
|
|
4
|
+
import { isEmptyElement as $, useVModel as Oe, useLazyLoading as Qt, useFormInput as Xt, useVirtualScroll as Yt, useInputDataStates as Zt, useCollection as eo, useDisableBodyPointerEvents as to, installComponent as ct } from "@pantograph/utils-vue";
|
|
5
|
+
import { getBemBlock as oo, getBemModifier as lo, getBemElement as x, getComponentOptions as be, normCls as H, isEmptyLikeLodash as F, generateVariantClassList as q, createOptionGetterFunc as j, usePCId as Ie, getPxSize as Ke, getComponentName as pt } from "@pantograph/utils";
|
|
6
6
|
import { _ as ao } from "../index-DObXz0JR.js";
|
|
7
|
-
import { cva as
|
|
7
|
+
import { cva as dt } from "class-variance-authority";
|
|
8
8
|
import "../Icon/index.js";
|
|
9
9
|
import "../Avatar/index.js";
|
|
10
10
|
import "../GraphicalObject/index.js";
|
|
11
|
-
import { _ as
|
|
11
|
+
import { _ as gt, a as no } from "../Avatar.vue_vue_type_style_index_0_lang-BSPQHKch.js";
|
|
12
12
|
import { GraphicalObjectGroup as ro } from "../GraphicalObjectGroup/index.js";
|
|
13
13
|
import { _ as so } from "../index-D8GuRo14.js";
|
|
14
14
|
import { _ as io } from "../Chip.vue_vue_type_style_index_0_lang-VHPsw9Yn.js";
|
|
@@ -18,7 +18,7 @@ import { _ as po } from "../Input.vue_vue_type_script_setup_true_lang-BYffMo8x.j
|
|
|
18
18
|
import { _ as We } from "../Icon.vue_vue_type_style_index_0_lang-cUm6hfXg.js";
|
|
19
19
|
import { g as go, a as mo } from "../MenuItem.vue_vue_type_style_index_0_lang-BAVVaaaZ.js";
|
|
20
20
|
import { i as J } from "../isArray-QlWcxgml.js";
|
|
21
|
-
import { _ as
|
|
21
|
+
import { _ as mt } from "../GraphicalObject.vue_vue_type_script_setup_true_lang-Cw-dYlrK.js";
|
|
22
22
|
import "../ScrollContainer/index.js";
|
|
23
23
|
import "../Empty/index.js";
|
|
24
24
|
import { f as fo, _ as vo, a as yo } from "../index-ChJBx3zx.js";
|
|
@@ -27,12 +27,12 @@ import "../Checkbox/index.js";
|
|
|
27
27
|
import { _ as ho } from "../Checkbox.vue_vue_type_style_index_0_lang-CFQlwsbT.js";
|
|
28
28
|
import { _ as _o } from "../Skeleton.vue_vue_type_style_index_0_lang-DeNnx4lD.js";
|
|
29
29
|
import { _ as bo } from "../Divider.vue_vue_type_style_index_0_lang-GfWcHNix.js";
|
|
30
|
-
import { a as
|
|
30
|
+
import { a as rt } from "../index-D2tZoezA.js";
|
|
31
31
|
import { useConfig as Co } from "../ConfigProvider/index.js";
|
|
32
|
-
import { h as
|
|
32
|
+
import { h as st } from "../head-E4xQy0iK.js";
|
|
33
33
|
import { _ as ko } from "../ScrollContainer.vue_vue_type_style_index_0_lang-C9L-FJn7.js";
|
|
34
34
|
import { _ as xo } from "../Empty.vue_vue_type_style_index_0_lang-DRqpYyi-.js";
|
|
35
|
-
const [Ge, So] = Ht("Combobox"), w = oo("combobox"),
|
|
35
|
+
const [Ge, So] = Ht("Combobox"), w = oo("combobox"), ft = lo(w, "value-placeholder"), Fe = x(w, "option"), vt = ["sm", "md", "lg"], Po = ["error", "warning", "success"], He = /* @__PURE__ */ _e({
|
|
36
36
|
...be("ComboboxInput"),
|
|
37
37
|
__name: "ComboboxInput",
|
|
38
38
|
props: {
|
|
@@ -61,9 +61,9 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
61
61
|
status: {},
|
|
62
62
|
steps: { type: Boolean }
|
|
63
63
|
},
|
|
64
|
-
setup(
|
|
65
|
-
const t =
|
|
66
|
-
uo(() => o.openModel.value && o.inputRef.value, o.focusOnInput),
|
|
64
|
+
setup(Y) {
|
|
65
|
+
const t = Y, c = ut(), o = Ge();
|
|
66
|
+
uo(() => o.openModel.value && o.inputRef.value, o.focusOnInput), $t(() => {
|
|
67
67
|
o.comboboxInputFocused.value = !1;
|
|
68
68
|
});
|
|
69
69
|
const k = C(() => {
|
|
@@ -78,10 +78,10 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
78
78
|
placeholder: k.value,
|
|
79
79
|
onKeydown: u(o).onKeyDown,
|
|
80
80
|
ref: u(o).inputRef,
|
|
81
|
-
class: u(H)(u(U), { [u(
|
|
81
|
+
class: u(H)(u(U), { [u(ft)]: u(o).valuePlaceholder.value }, t.class),
|
|
82
82
|
modelValue: u(o).searchModel.value,
|
|
83
83
|
"onUpdate:modelValue": h[0] || (h[0] = (d) => u(o).searchModel.value = d)
|
|
84
|
-
}),
|
|
84
|
+
}), Kt({ _: 2 }, [
|
|
85
85
|
Ne(Object.keys(u(he)(c, ["leading"])), (d) => ({
|
|
86
86
|
name: d,
|
|
87
87
|
fn: W((g) => [
|
|
@@ -92,7 +92,7 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
92
92
|
name: "leading",
|
|
93
93
|
fn: W((d) => [
|
|
94
94
|
Le(D.$slots, "leading", Me(Re(d)), () => [
|
|
95
|
-
|
|
95
|
+
X(u(We), {
|
|
96
96
|
size: d.iconSize,
|
|
97
97
|
icon: "tabler:search",
|
|
98
98
|
flipOnDir: "rtl"
|
|
@@ -112,7 +112,7 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
112
112
|
}), Bo = /* @__PURE__ */ _e({
|
|
113
113
|
...be("ComboboxTrigger"),
|
|
114
114
|
__name: "ComboboxTrigger",
|
|
115
|
-
setup(
|
|
115
|
+
setup(Y) {
|
|
116
116
|
const t = Ge(), c = ({ value: r }) => {
|
|
117
117
|
r && J(t.model.value) && !t.getDisabled.value && (t.model.value = t.model.value.filter((b) => b !== r));
|
|
118
118
|
}, o = C(() => {
|
|
@@ -124,7 +124,7 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
124
124
|
return "xsm";
|
|
125
125
|
}
|
|
126
126
|
}), k = C(() => {
|
|
127
|
-
if (!t.props.multiple &&
|
|
127
|
+
if (!t.props.multiple && lt(t.model.value) && !F(t.model.value))
|
|
128
128
|
return t.getOptionByValue(t.model.value);
|
|
129
129
|
}), U = (r = k.value) => {
|
|
130
130
|
if (t.props.selectedItemIconAsTrailingIcon && (r != null && r._icon))
|
|
@@ -144,9 +144,9 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
144
144
|
}), g = (r) => ({
|
|
145
145
|
...d.value,
|
|
146
146
|
option: t.getOptionByValue(r)
|
|
147
|
-
}), n = x(w, "trigger"), N =
|
|
147
|
+
}), n = x(w, "trigger"), N = dt(n, {
|
|
148
148
|
variants: {
|
|
149
|
-
size: q(
|
|
149
|
+
size: q(vt, n),
|
|
150
150
|
headerSearch: q("header-search", n),
|
|
151
151
|
status: q(Po, n),
|
|
152
152
|
bordered: q("bordered", n),
|
|
@@ -197,17 +197,17 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
197
197
|
{ class: H(x(n, "trailing"), t.props.triggerTrailingCls) },
|
|
198
198
|
r
|
|
199
199
|
);
|
|
200
|
-
},
|
|
200
|
+
}, Z = (r) => {
|
|
201
201
|
var f, v;
|
|
202
202
|
const b = t.getOptionByValue(r) ?? { _key: r };
|
|
203
|
-
return _(
|
|
203
|
+
return _(gt, {
|
|
204
204
|
size: t.getTagSize.value,
|
|
205
205
|
...b ? ((v = (f = t.props).getTagProps) == null ? void 0 : v.call(f, b)) ?? {} : {}
|
|
206
206
|
});
|
|
207
207
|
}, ce = (r) => {
|
|
208
208
|
var f, v;
|
|
209
209
|
const b = t.getOptionByValue(r) ?? { _key: r };
|
|
210
|
-
return _(
|
|
210
|
+
return _(mt, {
|
|
211
211
|
...b ? ((v = (f = t.props).getTagProps) == null ? void 0 : v.call(f, b)) ?? {} : {},
|
|
212
212
|
size: t.getTagSize.value
|
|
213
213
|
});
|
|
@@ -215,7 +215,7 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
215
215
|
var r, b;
|
|
216
216
|
if (!t.props.multiple && !J(t.model.value) && t.model.value) {
|
|
217
217
|
let f;
|
|
218
|
-
|
|
218
|
+
lt(t.model.value) && !F(t.model.value) && (f = t.model.value);
|
|
219
219
|
const v = f ? (b = (r = t.slots).optionLeading) == null ? void 0 : b.call(
|
|
220
220
|
r,
|
|
221
221
|
go(
|
|
@@ -225,7 +225,7 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
225
225
|
) : null, V = !$(v);
|
|
226
226
|
if (V || t.props.tagRenderMode && ["avatar", "go"].includes(t.props.tagRenderMode) || D.value || t.props.leadingIcon) {
|
|
227
227
|
let L;
|
|
228
|
-
if (V ? L = v : t.props.tagRenderMode === "avatar" ? L =
|
|
228
|
+
if (V ? L = v : t.props.tagRenderMode === "avatar" ? L = Z(t.model.value) : t.props.tagRenderMode === "go" ? L = ce(t.model.value) : D.value ? L = m(D.value) : t.props.leadingIcon && (L = m(t.props.leadingIcon)), !$(L))
|
|
229
229
|
return _(
|
|
230
230
|
"div",
|
|
231
231
|
{
|
|
@@ -241,7 +241,7 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
241
241
|
if (!$(r))
|
|
242
242
|
return _(Ut, he(Q.value, ["class"]), () => r);
|
|
243
243
|
const f = () => {
|
|
244
|
-
const T = [],
|
|
244
|
+
const T = [], ee = [
|
|
245
245
|
x(n, "tags"),
|
|
246
246
|
t.props.triggerContentCls,
|
|
247
247
|
t.props.triggerContentValueCls
|
|
@@ -256,9 +256,9 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
256
256
|
closeable: !t.getDisabled.value,
|
|
257
257
|
noPopover: !0,
|
|
258
258
|
noWrap: !t.props.wrapped,
|
|
259
|
-
class:
|
|
259
|
+
class: ee
|
|
260
260
|
},
|
|
261
|
-
() => t.model.value.map(
|
|
261
|
+
() => t.model.value.map(Z)
|
|
262
262
|
);
|
|
263
263
|
if (t.props.tagRenderMode === "go")
|
|
264
264
|
return _(
|
|
@@ -269,7 +269,7 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
269
269
|
closeable: !t.getDisabled.value,
|
|
270
270
|
noPopover: !0,
|
|
271
271
|
noWrap: !t.props.wrapped,
|
|
272
|
-
class:
|
|
272
|
+
class: ee
|
|
273
273
|
},
|
|
274
274
|
() => t.model.value.map(ce)
|
|
275
275
|
);
|
|
@@ -283,7 +283,7 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
283
283
|
closeable: !t.getDisabled.value,
|
|
284
284
|
noPopover: !0,
|
|
285
285
|
noWrap: !t.props.wrapped,
|
|
286
|
-
class:
|
|
286
|
+
class: ee,
|
|
287
287
|
onClose: c
|
|
288
288
|
},
|
|
289
289
|
() => t.model.value.map((se) => {
|
|
@@ -314,7 +314,7 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
314
314
|
"div",
|
|
315
315
|
{
|
|
316
316
|
class: H(x(n, "content__value"), {
|
|
317
|
-
[
|
|
317
|
+
[ft]: t.valuePlaceholder.value
|
|
318
318
|
})
|
|
319
319
|
},
|
|
320
320
|
t.placeholder.value ?? t.props.placeholder
|
|
@@ -335,15 +335,15 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
335
335
|
};
|
|
336
336
|
return (r, b) => (I(), K(pe));
|
|
337
337
|
}
|
|
338
|
-
}),
|
|
338
|
+
}), it = /* @__PURE__ */ _e({
|
|
339
339
|
...be("ComboboxOption"),
|
|
340
340
|
__name: "ComboboxOption",
|
|
341
341
|
props: {
|
|
342
342
|
option: {}
|
|
343
343
|
},
|
|
344
|
-
setup(
|
|
345
|
-
const t =
|
|
346
|
-
var n, N, Q, m, ne,
|
|
344
|
+
setup(Y) {
|
|
345
|
+
const t = Y, c = Ge(), o = C(() => c.isOptionSelected(t.option._key)), k = (h) => {
|
|
346
|
+
var n, N, Q, m, ne, Z;
|
|
347
347
|
const d = [];
|
|
348
348
|
!c.props.tree && c.props.multiple && c.props.checkbox && !t.option._noCheckbox && d.push(
|
|
349
349
|
_(ho, {
|
|
@@ -355,17 +355,17 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
355
355
|
);
|
|
356
356
|
const g = (N = (n = c.slots).optionLeading) == null ? void 0 : N.call(n, { ...h, option: t.option });
|
|
357
357
|
return $(g) ? c.props.tagRenderMode === "avatar" && c.props.showTriggerTagOnOption ? d.push(
|
|
358
|
-
_(
|
|
358
|
+
_(gt, {
|
|
359
359
|
size: h.avatarSize,
|
|
360
360
|
...((m = (Q = c.props).getTagProps) == null ? void 0 : m.call(Q, t.option)) ?? {}
|
|
361
361
|
})
|
|
362
362
|
) : c.props.tagRenderMode === "go" && c.props.showTriggerTagOnOption ? d.push(
|
|
363
|
-
_(
|
|
363
|
+
_(mt, {
|
|
364
364
|
size: h.iconSize,
|
|
365
|
-
...((
|
|
365
|
+
...((Z = (ne = c.props).getTagProps) == null ? void 0 : Z.call(ne, t.option)) ?? {}
|
|
366
366
|
})
|
|
367
367
|
) : t.option._icon && d.push(_(We, { icon: t.option._icon, size: c.getIconSize.value })) : d.push(g), $(d) ? null : d;
|
|
368
|
-
}, U =
|
|
368
|
+
}, U = Ft(), D = () => {
|
|
369
369
|
const h = c.props.tree ? void 0 : t.option._description, d = (qt(c.props.getMenuItemProps) ? c.props.getMenuItemProps(t.option) : c.props.getMenuItemProps) ?? {};
|
|
370
370
|
return _(
|
|
371
371
|
mo,
|
|
@@ -402,10 +402,10 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
402
402
|
props: {
|
|
403
403
|
label: {}
|
|
404
404
|
},
|
|
405
|
-
setup(
|
|
405
|
+
setup(Y) {
|
|
406
406
|
return (t, c) => (I(), ye("div", {
|
|
407
407
|
class: we(u(x)(u(w), "label"))
|
|
408
|
-
},
|
|
408
|
+
}, Nt(t.label), 3));
|
|
409
409
|
}
|
|
410
410
|
}), Io = /* @__PURE__ */ _e({
|
|
411
411
|
...be("Combobox"),
|
|
@@ -499,13 +499,13 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
499
499
|
noTrigger: { type: Boolean }
|
|
500
500
|
},
|
|
501
501
|
emits: ["update:modelValue", "update:expandedKeys", "keydownEnter", "keydownEscape", "update:search", "fetch", "search", "select", "update:open", "escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "openAutoFocus", "closeAutoFocus"],
|
|
502
|
-
setup(
|
|
503
|
-
const o =
|
|
502
|
+
setup(Y, { expose: t, emit: c }) {
|
|
503
|
+
const o = Y, k = c, U = () => {
|
|
504
504
|
var e, l;
|
|
505
505
|
o.tree && (((e = o.filterOptions) == null ? void 0 : e.expandParent) === "collapse" ? Q([]) : ((l = o.filterOptions) == null ? void 0 : l.expandParent) === "expand" && Q(
|
|
506
506
|
T.value.filter((a) => a._hasChildren).map((a) => a._key)
|
|
507
507
|
));
|
|
508
|
-
}, D =
|
|
508
|
+
}, D = at((e) => {
|
|
509
509
|
k("search", e), U();
|
|
510
510
|
}, 500), h = Oe(o, "search", k, {
|
|
511
511
|
passive: o.search === void 0,
|
|
@@ -534,13 +534,13 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
534
534
|
{
|
|
535
535
|
passive: o.expandedKeys === void 0
|
|
536
536
|
}
|
|
537
|
-
), Q =
|
|
537
|
+
), Q = at(
|
|
538
538
|
(e) => {
|
|
539
539
|
N.value = e;
|
|
540
540
|
},
|
|
541
541
|
500,
|
|
542
542
|
{ edges: ["leading"] }
|
|
543
|
-
), m =
|
|
543
|
+
), m = ut(), ne = jt(k), Z = C(() => ({
|
|
544
544
|
...he(ne, ["update:modelValue", "update:search", "select"]),
|
|
545
545
|
...Jt(o, [
|
|
546
546
|
"placement",
|
|
@@ -645,7 +645,7 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
645
645
|
), v = (e, l = !1) => e ? f.value.filter((a) => {
|
|
646
646
|
var s;
|
|
647
647
|
if (l) {
|
|
648
|
-
const S =
|
|
648
|
+
const S = nt(a._parentKeys ?? []);
|
|
649
649
|
return S && S === e;
|
|
650
650
|
}
|
|
651
651
|
return (s = a._parentKeys) == null ? void 0 : s.includes(e);
|
|
@@ -676,7 +676,7 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
676
676
|
}
|
|
677
677
|
});
|
|
678
678
|
else if ((E = i._parentKeys) != null && E.length) {
|
|
679
|
-
const p =
|
|
679
|
+
const p = st(i._parentKeys);
|
|
680
680
|
if (!F(p)) {
|
|
681
681
|
if (!l.has(p)) {
|
|
682
682
|
const le = V(p);
|
|
@@ -700,7 +700,7 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
700
700
|
z.forEach((B) => {
|
|
701
701
|
var A;
|
|
702
702
|
if ((A = B._parentKeys) != null && A.length) {
|
|
703
|
-
const O =
|
|
703
|
+
const O = st(B._parentKeys);
|
|
704
704
|
let G = le(O);
|
|
705
705
|
const et = Math.max(
|
|
706
706
|
Pe(y),
|
|
@@ -718,8 +718,8 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
718
718
|
if (p[O] === void 0)
|
|
719
719
|
oe(Be, G + 1);
|
|
720
720
|
else {
|
|
721
|
-
const
|
|
722
|
-
oe(Be,
|
|
721
|
+
const At = Pe(O);
|
|
722
|
+
oe(Be, At);
|
|
723
723
|
}
|
|
724
724
|
p[O] = {
|
|
725
725
|
length: void 0,
|
|
@@ -751,7 +751,7 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
751
751
|
return e;
|
|
752
752
|
});
|
|
753
753
|
U();
|
|
754
|
-
const { getDisabled:
|
|
754
|
+
const { getDisabled: ee, getStatus: Ue, getSize: M } = Xt(), se = C(() => {
|
|
755
755
|
switch (M.value) {
|
|
756
756
|
case "sm":
|
|
757
757
|
return "xsm";
|
|
@@ -800,7 +800,7 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
800
800
|
if (l._description)
|
|
801
801
|
return me[M.value] ?? me.md;
|
|
802
802
|
}
|
|
803
|
-
return
|
|
803
|
+
return rt[M.value] ?? rt.md;
|
|
804
804
|
},
|
|
805
805
|
overscan: 5,
|
|
806
806
|
get gap() {
|
|
@@ -814,25 +814,17 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
814
814
|
);
|
|
815
815
|
R = e, te = l;
|
|
816
816
|
}
|
|
817
|
-
const
|
|
817
|
+
const yt = C(
|
|
818
818
|
() => {
|
|
819
819
|
var e;
|
|
820
820
|
return o.virtual ? (((e = R == null ? void 0 : R.value) == null ? void 0 : e.getVirtualItems()) ?? []).map((l) => T.value[l.index]) : T.value;
|
|
821
821
|
}
|
|
822
|
-
),
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
console.log("getDisabled ===>", e);
|
|
827
|
-
},
|
|
828
|
-
{ immediate: !0 }
|
|
829
|
-
);
|
|
830
|
-
const {
|
|
831
|
-
inputBindings: bt,
|
|
832
|
-
rootBindings: Ct,
|
|
833
|
-
focused: kt
|
|
822
|
+
), ht = C(() => (te == null ? void 0 : te.containerStyles.value) ?? {}), {
|
|
823
|
+
inputBindings: _t,
|
|
824
|
+
rootBindings: bt,
|
|
825
|
+
focused: Ct
|
|
834
826
|
} = Zt({
|
|
835
|
-
getDisabled: () =>
|
|
827
|
+
getDisabled: () => ee.value
|
|
836
828
|
}), ie = ve(), Ve = () => {
|
|
837
829
|
var e;
|
|
838
830
|
if (g.value && ie.value && document.activeElement !== ((e = ie.value) == null ? void 0 : e.input)) {
|
|
@@ -845,14 +837,14 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
845
837
|
}
|
|
846
838
|
}, je = C(
|
|
847
839
|
() => !o.noValueOnPlaceholder && (J(n.value) ? n.value.length === 1 && !F(n.value[0]) : !F(n.value))
|
|
848
|
-
),
|
|
840
|
+
), kt = C(() => {
|
|
849
841
|
if (je.value) {
|
|
850
842
|
if (o.multiple && J(n.value))
|
|
851
|
-
return L(
|
|
843
|
+
return L(nt(n.value));
|
|
852
844
|
if (!o.multiple && !J(n.value))
|
|
853
845
|
return L(n.value);
|
|
854
846
|
}
|
|
855
|
-
}), { CollectionSlot:
|
|
847
|
+
}), { CollectionSlot: xt, CollectionItem: qe, itemMap: St, getItems: Je } = eo({
|
|
856
848
|
isProvider: !0,
|
|
857
849
|
key: w
|
|
858
850
|
}), Qe = () => n.value ? Array.isArray(n.value) ? n.value : [n.value] : [], P = ve(), Ee = (e) => {
|
|
@@ -874,7 +866,7 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
874
866
|
S.length === 1 && de(S[0]) && e._key !== S[0] && (S = []), i ? (n.value = S.filter((z) => z !== e._key), k("select", e._key, !0, e)) : (n.value = [...S, e._key], k("select", e._key, !1, e));
|
|
875
867
|
}
|
|
876
868
|
else e._clear ? (n.value = void 0, k("select", void 0, !1)) : (n.value = e._key, k("select", e._key, !0, e));
|
|
877
|
-
}, { getDir:
|
|
869
|
+
}, { getDir: Pt } = Co(), Se = Pt(), Ze = {
|
|
878
870
|
props: o,
|
|
879
871
|
emit: k,
|
|
880
872
|
onKeyDown: (e) => {
|
|
@@ -915,36 +907,36 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
915
907
|
model: n,
|
|
916
908
|
slots: m,
|
|
917
909
|
valuePlaceholder: je,
|
|
918
|
-
placeholder:
|
|
910
|
+
placeholder: kt,
|
|
919
911
|
getOptionByValue: V,
|
|
920
912
|
isOptionSelected: re,
|
|
921
913
|
getLabelByValue: L,
|
|
922
914
|
getSingleByValue: de,
|
|
923
915
|
inputRef: ie,
|
|
924
916
|
focusOnInput: Ve,
|
|
925
|
-
getDisabled:
|
|
917
|
+
getDisabled: ee,
|
|
926
918
|
getStatus: Ue,
|
|
927
919
|
getSize: M,
|
|
928
920
|
getTagSize: se,
|
|
929
921
|
getIconSize: Te,
|
|
930
|
-
comboboxInputBinding:
|
|
931
|
-
comboboxTriggerBinding:
|
|
932
|
-
comboboxInputFocused:
|
|
922
|
+
comboboxInputBinding: _t,
|
|
923
|
+
comboboxTriggerBinding: bt,
|
|
924
|
+
comboboxInputFocused: Ct,
|
|
933
925
|
selectOption: Ye,
|
|
934
|
-
itemMap:
|
|
926
|
+
itemMap: St,
|
|
935
927
|
getItems: Je,
|
|
936
928
|
highlightedOptionKey: P
|
|
937
929
|
};
|
|
938
|
-
So(Ze),
|
|
930
|
+
So(Ze), Wt(
|
|
939
931
|
() => [o.clearOnChangeMultiple, o.multiple],
|
|
940
932
|
() => {
|
|
941
933
|
o.clearOnChangeMultiple && (n.value = void 0);
|
|
942
934
|
}
|
|
943
935
|
);
|
|
944
|
-
const
|
|
936
|
+
const Bt = C(() => ({
|
|
945
937
|
defaultExpandAll: !0,
|
|
946
938
|
showLine: !0,
|
|
947
|
-
disabled:
|
|
939
|
+
disabled: ee.value,
|
|
948
940
|
selectionBehavior: "replace",
|
|
949
941
|
...o.treeProps ?? {},
|
|
950
942
|
size: M.value,
|
|
@@ -960,7 +952,7 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
960
952
|
modelValue: Qe(),
|
|
961
953
|
checkedKeys: Qe(),
|
|
962
954
|
class: x(w, "tree")
|
|
963
|
-
})),
|
|
955
|
+
})), Ot = C(() => {
|
|
964
956
|
const e = o.scrollContainerProps ?? {};
|
|
965
957
|
return {
|
|
966
958
|
...e,
|
|
@@ -974,11 +966,11 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
974
966
|
style: (te == null ? void 0 : te.scrollWrapperStyles.value) ?? {}
|
|
975
967
|
}
|
|
976
968
|
};
|
|
977
|
-
}), De = x(w, "popup"),
|
|
969
|
+
}), De = x(w, "popup"), It = dt(De, {
|
|
978
970
|
variants: {
|
|
979
|
-
size: q(
|
|
971
|
+
size: q(vt, De)
|
|
980
972
|
}
|
|
981
|
-
}),
|
|
973
|
+
}), wt = C(() => Ke(o.popupWidth, !0)), Tt = C(() => Ke(o.popupHeight, !0)), zt = C(() => Ke(o.minWidth, !0)), Vt = () => {
|
|
982
974
|
var a, s;
|
|
983
975
|
const e = (s = m.header) == null ? void 0 : s.call(m, {
|
|
984
976
|
isEmpty: !((a = T.value) != null && a.length),
|
|
@@ -990,7 +982,7 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
990
982
|
{ class: x(w, "header") },
|
|
991
983
|
l ? e : _(He, o.headerSearchInputProps || {})
|
|
992
984
|
);
|
|
993
|
-
},
|
|
985
|
+
}, Et = () => {
|
|
994
986
|
var a, s;
|
|
995
987
|
const e = (s = m.footer) == null ? void 0 : s.call(m, {
|
|
996
988
|
isEmpty: !((a = T.value) != null && a.length),
|
|
@@ -998,7 +990,7 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
998
990
|
});
|
|
999
991
|
if (!$(e))
|
|
1000
992
|
return _("div", { class: x(w, "footer") }, e);
|
|
1001
|
-
},
|
|
993
|
+
}, Dt = () => {
|
|
1002
994
|
var a;
|
|
1003
995
|
const e = {
|
|
1004
996
|
type: M.value === "sm" ? "simple" : "advance",
|
|
@@ -1011,7 +1003,7 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
1011
1003
|
actions: m.emptyActions,
|
|
1012
1004
|
image: m.emptyImage
|
|
1013
1005
|
}) : l;
|
|
1014
|
-
},
|
|
1006
|
+
}, Lt = () => {
|
|
1015
1007
|
var a;
|
|
1016
1008
|
const e = (a = m.loading) == null ? void 0 : a.call(m, {});
|
|
1017
1009
|
return $(e) ? new Array(T.value.length ? 2 : o.loadingRowCount).fill(1).map(
|
|
@@ -1021,7 +1013,7 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
1021
1013
|
...he(o.skeletonProps ?? {}, ["class"])
|
|
1022
1014
|
})
|
|
1023
1015
|
) : e;
|
|
1024
|
-
},
|
|
1016
|
+
}, Mt = (e, l, a) => {
|
|
1025
1017
|
const s = e._clear;
|
|
1026
1018
|
if (o.multiple) {
|
|
1027
1019
|
const S = e._single;
|
|
@@ -1033,13 +1025,13 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
1033
1025
|
l,
|
|
1034
1026
|
e
|
|
1035
1027
|
);
|
|
1036
|
-
},
|
|
1028
|
+
}, Rt = (e) => {
|
|
1037
1029
|
e.key === "ArrowDown" && !g.value ? g.value = !0 : e.key === "Tab" && g.value && (g.value = !1);
|
|
1038
1030
|
};
|
|
1039
1031
|
return o.disableOutsidePointerEvents && to(g), t(Ze), (e, l) => (I(), K(u(ao), ue({
|
|
1040
1032
|
open: u(g),
|
|
1041
|
-
"onUpdate:open": l[2] || (l[2] = (a) =>
|
|
1042
|
-
},
|
|
1033
|
+
"onUpdate:open": l[2] || (l[2] = (a) => tt(g) ? g.value = a : null)
|
|
1034
|
+
}, Z.value, {
|
|
1043
1035
|
containerProps: {
|
|
1044
1036
|
...e.containerProps ?? {},
|
|
1045
1037
|
onClick: Ve
|
|
@@ -1050,39 +1042,39 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
1050
1042
|
pointerEvents: "auto",
|
|
1051
1043
|
display: u(g) ? void 0 : "none",
|
|
1052
1044
|
zIndex: e.zIndex,
|
|
1053
|
-
"--ptc-combobox-popup-width": e.samePopupWidth ? void 0 :
|
|
1054
|
-
"--ptc-combobox-popup-height":
|
|
1055
|
-
"--ptc-combobox-trigger-min-w":
|
|
1045
|
+
"--ptc-combobox-popup-width": e.samePopupWidth ? void 0 : wt.value,
|
|
1046
|
+
"--ptc-combobox-popup-height": Tt.value,
|
|
1047
|
+
"--ptc-combobox-trigger-min-w": zt.value
|
|
1056
1048
|
},
|
|
1057
|
-
containerCls: u(H)(u(
|
|
1058
|
-
onKeydown:
|
|
1049
|
+
containerCls: u(H)(u(It)(o), e.popupCls),
|
|
1050
|
+
onKeydown: Rt
|
|
1059
1051
|
}), {
|
|
1060
1052
|
default: W(() => [
|
|
1061
|
-
|
|
1053
|
+
X(Bo)
|
|
1062
1054
|
]),
|
|
1063
1055
|
content: W(() => [
|
|
1064
|
-
|
|
1065
|
-
|
|
1056
|
+
X(Vt),
|
|
1057
|
+
X(u(ko), ue({
|
|
1066
1058
|
ref_key: "scrollContainerRef",
|
|
1067
1059
|
ref: ke
|
|
1068
|
-
},
|
|
1060
|
+
}, Ot.value), {
|
|
1069
1061
|
default: W(() => [
|
|
1070
|
-
T.value.length || e.loading ? (I(), K(u(
|
|
1062
|
+
T.value.length || e.loading ? (I(), K(u(xt), { key: 0 }, {
|
|
1071
1063
|
default: W(() => [
|
|
1072
|
-
|
|
1064
|
+
ot("div", {
|
|
1073
1065
|
class: we(u(H)(u(x)(u(w), "options"), e.optionsCls)),
|
|
1074
|
-
style: Gt(e.virtual ?
|
|
1066
|
+
style: Gt(e.virtual ? ht.value : {}),
|
|
1075
1067
|
onPointerleave: l[1] || (l[1] = (a) => Ee(void 0))
|
|
1076
1068
|
}, [
|
|
1077
1069
|
e.tree ? (I(), K(u(vo), ue({
|
|
1078
1070
|
key: 0,
|
|
1079
1071
|
ref_key: "treeRef",
|
|
1080
1072
|
ref: fe
|
|
1081
|
-
},
|
|
1073
|
+
}, Bt.value, {
|
|
1082
1074
|
expandedKeys: u(N),
|
|
1083
|
-
"onUpdate:expandedKeys": l[0] || (l[0] = (a) =>
|
|
1075
|
+
"onUpdate:expandedKeys": l[0] || (l[0] = (a) => tt(N) ? N.value = a : null),
|
|
1084
1076
|
onExpand: Ve,
|
|
1085
|
-
onSelect:
|
|
1077
|
+
onSelect: Mt
|
|
1086
1078
|
}), {
|
|
1087
1079
|
default: W(({ items: a }) => [
|
|
1088
1080
|
(I(!0), ye($e, null, Ne(a, (s) => (I(), K(u(qe), {
|
|
@@ -1091,12 +1083,12 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
1091
1083
|
id: s._id
|
|
1092
1084
|
}, {
|
|
1093
1085
|
default: W(() => [
|
|
1094
|
-
|
|
1086
|
+
X(u(yo), ue({ node: s }, { ref_for: !0 }, Xe(s), {
|
|
1095
1087
|
onPointermove: (S) => Ee(s._key),
|
|
1096
1088
|
id: s._id
|
|
1097
1089
|
}), {
|
|
1098
1090
|
default: W(() => [
|
|
1099
|
-
|
|
1091
|
+
X(it, {
|
|
1100
1092
|
option: s
|
|
1101
1093
|
}, null, 8, ["option"])
|
|
1102
1094
|
]),
|
|
@@ -1107,7 +1099,7 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
1107
1099
|
}, 1032, ["value", "id"]))), 128))
|
|
1108
1100
|
]),
|
|
1109
1101
|
_: 1
|
|
1110
|
-
}, 16, ["expandedKeys"])) : (I(!0), ye($e, { key: 1 }, Ne(
|
|
1102
|
+
}, 16, ["expandedKeys"])) : (I(!0), ye($e, { key: 1 }, Ne(yt.value, (a) => (I(), ye($e, {
|
|
1111
1103
|
key: a._key
|
|
1112
1104
|
}, [
|
|
1113
1105
|
a._divider ? (I(), K(bo, { key: 0 })) : a._label && a._hasChildren ? (I(), K(Oo, {
|
|
@@ -1119,7 +1111,7 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
1119
1111
|
id: a._id
|
|
1120
1112
|
}, {
|
|
1121
1113
|
default: W(() => [
|
|
1122
|
-
|
|
1114
|
+
X(it, ue({ option: a }, { ref_for: !0 }, Xe(a), {
|
|
1123
1115
|
onPointermove: (s) => Ee(a._key),
|
|
1124
1116
|
id: a._id
|
|
1125
1117
|
}), null, 16, ["option", "onPointermove", "id"])
|
|
@@ -1127,16 +1119,16 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
1127
1119
|
_: 2
|
|
1128
1120
|
}, 1032, ["value", "id"]))
|
|
1129
1121
|
], 64))), 128)),
|
|
1130
|
-
e.loading ? (I(), K(
|
|
1122
|
+
e.loading ? (I(), K(Lt, { key: 2 })) : Ae("", !0)
|
|
1131
1123
|
], 38)
|
|
1132
1124
|
]),
|
|
1133
1125
|
_: 1
|
|
1134
|
-
})) : (I(), K(
|
|
1126
|
+
})) : (I(), K(Dt, { key: 1 })),
|
|
1135
1127
|
e.lazyLoading ? (I(), ye("div", {
|
|
1136
1128
|
key: 2,
|
|
1137
1129
|
class: we(u(x)(u(w), "lazy_loading"))
|
|
1138
1130
|
}, [
|
|
1139
|
-
|
|
1131
|
+
ot("div", {
|
|
1140
1132
|
class: we(u(x)(u(w), "lazy_loading_trigger")),
|
|
1141
1133
|
ref_key: "target",
|
|
1142
1134
|
ref: ce
|
|
@@ -1145,18 +1137,18 @@ const [Ge, So] = Ht("Combobox"), w = oo("combobox"), vt = lo(w, "value-placehold
|
|
|
1145
1137
|
]),
|
|
1146
1138
|
_: 1
|
|
1147
1139
|
}, 16),
|
|
1148
|
-
|
|
1140
|
+
X(Et)
|
|
1149
1141
|
]),
|
|
1150
1142
|
_: 1
|
|
1151
1143
|
}, 16, ["open", "containerProps", "size", "containerStyle", "containerCls"]));
|
|
1152
1144
|
}
|
|
1153
|
-
}), cl =
|
|
1145
|
+
}), cl = ct(Io, pt("Combobox")), pl = ct(He, pt("ComboboxInput"));
|
|
1154
1146
|
export {
|
|
1155
1147
|
Io as Combobox,
|
|
1156
1148
|
He as ComboboxInput,
|
|
1157
1149
|
pl as ComboboxInputPlugin,
|
|
1158
1150
|
cl as ComboboxPlugin,
|
|
1159
|
-
|
|
1151
|
+
vt as ComboboxSizes,
|
|
1160
1152
|
Po as ComboboxStatuses,
|
|
1161
1153
|
Ge as injectComboboxContext,
|
|
1162
1154
|
So as provideComboboxContext
|