@qynpm/ui 1.0.26 → 1.0.27
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/README.md +313 -27
- package/dist/index.cjs +10 -4
- package/dist/index.mjs +69 -42
- package/dist/qy-action-bar/index.cjs +1 -1
- package/dist/qy-action-bar/index.mjs +1 -1
- package/dist/qy-alert/index.cjs +1 -0
- package/dist/qy-alert/index.mjs +7 -0
- package/dist/qy-avatar/index.cjs +1 -0
- package/dist/qy-avatar/index.mjs +7 -0
- package/dist/qy-badge/index.cjs +1 -0
- package/dist/qy-badge/index.mjs +7 -0
- package/dist/qy-button/index.cjs +1 -1
- package/dist/qy-button/index.mjs +1 -1
- package/dist/qy-card/index.cjs +1 -0
- package/dist/qy-card/index.mjs +7 -0
- package/dist/qy-cascader/index.cjs +1 -0
- package/dist/qy-cascader/index.mjs +7 -0
- package/dist/qy-checkbox/index.cjs +1 -1
- package/dist/qy-checkbox/index.mjs +1 -1
- package/dist/qy-checkbox-group/index.cjs +1 -1
- package/dist/qy-checkbox-group/index.mjs +1 -1
- package/dist/qy-collapse/index.cjs +1 -0
- package/dist/qy-collapse/index.mjs +7 -0
- package/dist/qy-collapse-item/index.cjs +1 -0
- package/dist/qy-collapse-item/index.mjs +7 -0
- package/dist/qy-descriptions/index.cjs +1 -0
- package/dist/qy-descriptions/index.mjs +7 -0
- package/dist/qy-descriptions-item/index.cjs +1 -0
- package/dist/qy-descriptions-item/index.mjs +7 -0
- package/dist/qy-dialog/index.cjs +1 -1
- package/dist/qy-dialog/index.mjs +1 -1
- package/dist/qy-divider/index.cjs +1 -0
- package/dist/qy-divider/index.mjs +7 -0
- package/dist/qy-dropdown/index.cjs +1 -1
- package/dist/qy-dropdown/index.mjs +1 -1
- package/dist/qy-empty/index.cjs +1 -0
- package/dist/qy-empty/index.mjs +7 -0
- package/dist/qy-file-picker/index.cjs +1 -1
- package/dist/qy-file-picker/index.mjs +1 -1
- package/dist/qy-form-section/index.cjs +1 -1
- package/dist/qy-form-section/index.mjs +2 -2
- package/dist/qy-image/index.cjs +1 -1
- package/dist/qy-image/index.mjs +1 -1
- package/dist/qy-image-upload/index.cjs +1 -1
- package/dist/qy-image-upload/index.mjs +1 -1
- package/dist/qy-input-number/index.cjs +0 -2
- package/dist/qy-input-number/index.mjs +0 -2
- package/dist/qy-legacy-selection-dialog/index.cjs +1 -1
- package/dist/qy-legacy-selection-dialog/index.mjs +2 -2
- package/dist/qy-link/index.cjs +1 -0
- package/dist/qy-link/index.mjs +7 -0
- package/dist/qy-menu-actions/index.cjs +1 -1
- package/dist/qy-menu-actions/index.mjs +1 -1
- package/dist/qy-money-input/index.cjs +1 -1
- package/dist/qy-money-input/index.mjs +1 -1
- package/dist/qy-popover/index.cjs +1 -1
- package/dist/qy-popover/index.mjs +1 -1
- package/dist/qy-progress/index.cjs +1 -0
- package/dist/qy-progress/index.mjs +7 -0
- package/dist/qy-radio/index.cjs +1 -1
- package/dist/qy-radio/index.mjs +1 -1
- package/dist/qy-radio-group/index.cjs +1 -1
- package/dist/qy-radio-group/index.mjs +1 -1
- package/dist/qy-record-quote-search/index.cjs +1 -1
- package/dist/qy-record-quote-search/index.mjs +1 -1
- package/dist/qy-remark-image/index.cjs +1 -1
- package/dist/qy-remark-image/index.mjs +1 -1
- package/dist/qy-remote-select/index.cjs +1 -1
- package/dist/qy-remote-select/index.mjs +1 -1
- package/dist/qy-scrollbar/index.cjs +1 -0
- package/dist/qy-scrollbar/index.mjs +7 -0
- package/dist/qy-search-input/index.cjs +1 -1
- package/dist/qy-search-input/index.mjs +1 -1
- package/dist/qy-select/index.cjs +1 -1
- package/dist/qy-select/index.mjs +1 -1
- package/dist/qy-selection-dialog/index.cjs +1 -1
- package/dist/qy-selection-dialog/index.mjs +1 -1
- package/dist/qy-skeleton/index.cjs +1 -0
- package/dist/qy-skeleton/index.mjs +7 -0
- package/dist/qy-skeleton-item/index.cjs +1 -0
- package/dist/qy-skeleton-item/index.mjs +7 -0
- package/dist/qy-step/index.cjs +1 -0
- package/dist/qy-step/index.mjs +7 -0
- package/dist/qy-steps/index.cjs +1 -0
- package/dist/qy-steps/index.mjs +7 -0
- package/dist/qy-switch/index.cjs +1 -1
- package/dist/qy-switch/index.mjs +1 -1
- package/dist/qy-tab-pane/index.cjs +1 -0
- package/dist/qy-tab-pane/index.mjs +7 -0
- package/dist/qy-table-column-settings/index.cjs +1 -1
- package/dist/qy-table-column-settings/index.mjs +1 -1
- package/dist/qy-tabs/index.cjs +1 -0
- package/dist/qy-tabs/index.mjs +7 -0
- package/dist/qy-tag/index.cjs +1 -1
- package/dist/qy-tag/index.mjs +1 -1
- package/dist/qy-tooltip/index.cjs +1 -1
- package/dist/qy-tooltip/index.mjs +1 -1
- package/dist/qy-tree/index.cjs +1 -0
- package/dist/qy-tree/index.mjs +7 -0
- package/dist/qy-tree-select/index.cjs +1 -1
- package/dist/qy-tree-select/index.mjs +5 -4
- package/dist/qy-upload/index.cjs +1 -1
- package/dist/qy-upload/index.mjs +1 -1
- package/dist/shared/{index-9v7CIwzO.cjs → index-B9RYNZUh.cjs} +1 -1
- package/dist/shared/{index-B7uyWUhS.mjs → index-C7V-LeFg.mjs} +1 -1
- package/dist/shared/{index-Du2IqeCI.mjs → index-CYn7TvRx.mjs} +1 -1
- package/dist/shared/index-CnZNcnTs.cjs +1 -0
- package/dist/shared/{index-DmhpD4Cp.cjs → index-CpvFUems.cjs} +1 -1
- package/dist/shared/{index-C1YwUATr.cjs → index-DEkng5wh.cjs} +1 -1
- package/dist/shared/index-DHJf8Zto.mjs +377 -0
- package/dist/shared/index-DjyaOKUS.cjs +1 -0
- package/dist/shared/{index-C98mN7sQ.mjs → index-T9Om5Csd.mjs} +1197 -1134
- package/dist/shared/{index-DZroPZ8B.mjs → index-hEy-3mcr.mjs} +8 -8
- package/dist/shared/index.vue_vue_type_script_lang-69zSOotQ.mjs +47 -0
- package/dist/shared/index.vue_vue_type_script_lang-BGAdXWIL.mjs +78 -0
- package/dist/shared/index.vue_vue_type_script_lang-BO9Ju_i0.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_lang-Bc3tktk9.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_lang-BkoqbceR.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_lang-C4JHCuXz.mjs +54 -0
- package/dist/shared/index.vue_vue_type_script_lang-C9X0V5AK.mjs +71 -0
- package/dist/shared/index.vue_vue_type_script_lang-CIOi2ahp.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_lang-CZK0hDYa.mjs +77 -0
- package/dist/shared/index.vue_vue_type_script_lang-Cv4Pf58E.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_lang-CwrbII5c.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_lang-D42aRlO2.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_lang-D7b9ABei.mjs +113 -0
- package/dist/shared/index.vue_vue_type_script_lang-D7nzeBUR.mjs +35 -0
- package/dist/shared/index.vue_vue_type_script_lang-DIKHRo0o.mjs +72 -0
- package/dist/shared/index.vue_vue_type_script_lang-DLmUPDR5.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_lang-DMrpLmWN.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_lang-DOOT2grg.mjs +54 -0
- package/dist/shared/index.vue_vue_type_script_lang-Dfq7D3mJ.mjs +18 -0
- package/dist/shared/index.vue_vue_type_script_lang-DpSaB5eg.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_lang-WJ63_A7F.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_lang-chBiq2cG.mjs +31 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-4KZSABSM.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-B4JrNUDc.mjs +43 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-BJe7Uo6S.mjs +42 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-BWi3g3mb.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-Bdz9oDDW.mjs +62 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-C96ZaggL.cjs +1 -0
- package/dist/shared/{index.vue_vue_type_script_setup_true_lang-CKZHI_y-.mjs → index.vue_vue_type_script_setup_true_lang-CUox3Lm-.mjs} +1 -1
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-CmQLfhRo.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-DUEhuwGQ.cjs +1 -0
- package/dist/shared/{index.vue_vue_type_script_setup_true_lang-C3F8M9sD.cjs → index.vue_vue_type_script_setup_true_lang-DXGjuA2f.cjs} +1 -1
- package/dist/shared/{index.vue_vue_type_script_setup_true_lang-N12Nn2uu.mjs → index.vue_vue_type_script_setup_true_lang-DXtovY1E.mjs} +1 -1
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-Dd_nKJvH.mjs +19 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-DobP199g.mjs +63 -0
- package/dist/shared/{index.vue_vue_type_script_setup_true_lang-CsKjCWIN.cjs → index.vue_vue_type_script_setup_true_lang-kje3Rtlw.cjs} +1 -1
- package/dist/shared/index.vue_vue_type_style_index_0_lang-B-FeHatv.mjs +98 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-BXTkWo5P.cjs +1 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-C1n-zAZh.mjs +67 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-Cb4yMk-r.cjs +1 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-Cn3P9d4L.cjs +1 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-CnL4aeg1.cjs +1 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-DIMCVnQm.mjs +286 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-DOfJV2oz.cjs +1 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-DzfGx6ce.mjs +298 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-dLpQXf6x.mjs +87 -0
- package/index.d.ts +272 -24
- package/package.json +128 -2
- package/qy-alert/index.d.ts +64 -0
- package/qy-autocomplete/index.d.ts +5 -5
- package/qy-avatar/index.d.ts +67 -0
- package/qy-badge/index.d.ts +63 -0
- package/qy-card/index.d.ts +64 -0
- package/qy-cascader/index.d.ts +198 -0
- package/qy-collapse/index.d.ts +59 -0
- package/qy-collapse-item/index.d.ts +45 -0
- package/qy-descriptions/index.d.ts +47 -0
- package/qy-descriptions-item/index.d.ts +46 -0
- package/qy-divider/index.d.ts +53 -0
- package/qy-empty/index.d.ts +51 -0
- package/qy-image/index.d.ts +28 -28
- package/qy-image-preview/index.d.ts +20 -20
- package/qy-link/index.d.ts +69 -0
- package/qy-menu-actions/index.d.ts +29 -29
- package/qy-progress/index.d.ts +74 -0
- package/qy-scrollbar/index.d.ts +85 -0
- package/qy-skeleton/index.d.ts +54 -0
- package/qy-skeleton-item/index.d.ts +48 -0
- package/qy-step/index.d.ts +55 -0
- package/qy-steps/index.d.ts +62 -0
- package/qy-tab-pane/index.d.ts +40 -0
- package/qy-table-column-settings/index.d.ts +18 -18
- package/qy-tabs/index.d.ts +84 -0
- package/qy-tree/index.d.ts +132 -0
- package/qy-tree-select/index.d.ts +123 -5
- package/dist/shared/index-BF1_Rib_.cjs +0 -1
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-C-Pf9TJ0.mjs +0 -152
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-DWS8bsiP.cjs +0 -1
- /package/dist/shared/{index-C1p86ezL.cjs → index-BDdhBEFr.cjs} +0 -0
- /package/dist/shared/{index-R5B1rjXo.mjs → index-BbDWedqW.mjs} +0 -0
- /package/dist/shared/{index-QQkDJv3q.cjs → index-BqV6vW9P.cjs} +0 -0
- /package/dist/shared/{index-DrJuMzr1.mjs → index-CUITnlPr.mjs} +0 -0
- /package/dist/shared/{index-CuusBxhR.cjs → index-DA3GVIZY.cjs} +0 -0
- /package/dist/shared/{index-BYLXkIxS.mjs → index-DEZF-Fkt.mjs} +0 -0
- /package/dist/shared/{index-ClUqUsAv.cjs → index-DIs6iPjF.cjs} +0 -0
- /package/dist/shared/{index-EGnVOaC9.cjs → index-DMiZy6gD.cjs} +0 -0
- /package/dist/shared/{index-Cl5cuyVG.mjs → index-DvA3Wy_F.mjs} +0 -0
- /package/dist/shared/{index-BcCZMWAj.cjs → index-PlyLRNmb.cjs} +0 -0
- /package/dist/shared/{index-zJN0M-bx.cjs → index-UGOgNLvm.cjs} +0 -0
- /package/dist/shared/{index-yf2Ijz_G.mjs → index-WP9Dbscv.mjs} +0 -0
- /package/dist/shared/{index-CbCpXtYr.mjs → index-YsBzyp9n.mjs} +0 -0
- /package/dist/shared/{index-BTPk2zzq.cjs → index-ceTTRCGJ.cjs} +0 -0
- /package/dist/shared/{index-C6jcSQSF.mjs → index-mTWXYnLm.mjs} +0 -0
- /package/dist/shared/{index-Cy_Glkc-.mjs → index-seQHtqdh.mjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-BZQLyvw8.cjs → index.vue_vue_type_style_index_0_lang-C6urLjSf.cjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-ztD-It-2.mjs → index.vue_vue_type_style_index_0_lang-CVxWn-Vs.mjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-1cTut9Ql.cjs → index.vue_vue_type_style_index_0_lang-CWz689KH.cjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-DSur831A.mjs → index.vue_vue_type_style_index_0_lang-D1kpIund.mjs} +0 -0
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { defineComponent as W, useAttrs as K, ref as H, computed as h, openBlock as N, createBlock as U, unref as q, mergeProps as Q, createSlots as G, withCtx as d, renderSlot as c, normalizeProps as J, guardReactiveProps as X } from "vue";
|
|
2
|
+
import { ElCascader as Y } from "element-plus";
|
|
3
|
+
const ee = /* @__PURE__ */ W({
|
|
4
|
+
name: "QyCascader",
|
|
5
|
+
inheritAttrs: !1,
|
|
6
|
+
__name: "index",
|
|
7
|
+
props: {
|
|
8
|
+
modelValue: {},
|
|
9
|
+
options: { default: () => [] },
|
|
10
|
+
props: { default: () => ({}) },
|
|
11
|
+
size: {},
|
|
12
|
+
placeholder: {},
|
|
13
|
+
disabled: { type: Boolean },
|
|
14
|
+
clearable: { type: Boolean, default: !0 },
|
|
15
|
+
clearIcon: {},
|
|
16
|
+
filterable: { type: Boolean, default: !1 },
|
|
17
|
+
filterMethod: {},
|
|
18
|
+
separator: { default: " / " },
|
|
19
|
+
showAllLevels: { type: Boolean, default: !0 },
|
|
20
|
+
collapseTags: { type: Boolean, default: !1 },
|
|
21
|
+
maxCollapseTags: { default: 1 },
|
|
22
|
+
collapseTagsTooltip: { type: Boolean, default: !1 },
|
|
23
|
+
maxCollapseTagsTooltipHeight: {},
|
|
24
|
+
debounce: { default: 300 },
|
|
25
|
+
beforeFilter: {},
|
|
26
|
+
placement: {},
|
|
27
|
+
fallbackPlacements: {},
|
|
28
|
+
popperClass: {},
|
|
29
|
+
popperStyle: { type: [Boolean, null, String, Object, Array] },
|
|
30
|
+
teleported: { type: Boolean, default: !0 },
|
|
31
|
+
effect: {},
|
|
32
|
+
persistent: { type: Boolean, default: !0 },
|
|
33
|
+
showCheckedStrategy: {},
|
|
34
|
+
fitInputWidth: { type: [Boolean, Number] },
|
|
35
|
+
tagType: {},
|
|
36
|
+
tagEffect: {},
|
|
37
|
+
validateEvent: { type: Boolean, default: !0 },
|
|
38
|
+
emptyValues: {},
|
|
39
|
+
valueOnClear: {},
|
|
40
|
+
virtualScroll: { type: Boolean, default: !1 },
|
|
41
|
+
itemSize: { default: 34 },
|
|
42
|
+
height: { default: 204 }
|
|
43
|
+
},
|
|
44
|
+
emits: ["update:modelValue", "change", "focus", "blur", "clear", "visible-change", "expand-change", "remove-tag"],
|
|
45
|
+
setup(a, { expose: y, emit: g }) {
|
|
46
|
+
const i = a, n = g, C = K(), u = H(), S = h(
|
|
47
|
+
() => Object.fromEntries(
|
|
48
|
+
Object.entries(C).filter(
|
|
49
|
+
([e]) => e === "class" || e === "style" || e === "role" || e === "title" || e.startsWith("data-") || e.startsWith("aria-")
|
|
50
|
+
)
|
|
51
|
+
)
|
|
52
|
+
), k = h(() => ({
|
|
53
|
+
...i.emptyValues !== void 0 ? { emptyValues: i.emptyValues } : {},
|
|
54
|
+
...i.valueOnClear !== void 0 ? { valueOnClear: i.valueOnClear } : {}
|
|
55
|
+
})), V = h(() => ({
|
|
56
|
+
...S.value,
|
|
57
|
+
...k.value
|
|
58
|
+
}));
|
|
59
|
+
function f(e, t = {}) {
|
|
60
|
+
return Object.freeze({
|
|
61
|
+
uid: e.uid,
|
|
62
|
+
level: e.level,
|
|
63
|
+
value: e.value,
|
|
64
|
+
label: e.label,
|
|
65
|
+
pathValues: Object.freeze([...e.pathValues]),
|
|
66
|
+
pathLabels: Object.freeze([...e.pathLabels]),
|
|
67
|
+
data: e.data,
|
|
68
|
+
root: e.root,
|
|
69
|
+
isLeaf: t.isLeaf ?? e.isLeaf,
|
|
70
|
+
isDisabled: t.isDisabled ?? e.isDisabled,
|
|
71
|
+
checked: e.checked,
|
|
72
|
+
indeterminate: e.indeterminate,
|
|
73
|
+
loading: e.loading,
|
|
74
|
+
loaded: e.loaded ?? !1
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function T(e, t) {
|
|
78
|
+
var p, v;
|
|
79
|
+
const l = typeof t.leaf == "string" ? t.leaf : "leaf", s = t.children ?? "children", o = (p = e.data) == null ? void 0 : p[l];
|
|
80
|
+
if (typeof o == "boolean")
|
|
81
|
+
return o;
|
|
82
|
+
const r = Array.isArray(e.childrenData) ? e.childrenData : (v = e.data) == null ? void 0 : v[s];
|
|
83
|
+
return Array.isArray(r) && r.length > 0 ? !1 : t.lazy ? e.loaded === !0 : !0;
|
|
84
|
+
}
|
|
85
|
+
function m(e, t, l = /* @__PURE__ */ new Set()) {
|
|
86
|
+
var p;
|
|
87
|
+
if (l.has(e))
|
|
88
|
+
return !1;
|
|
89
|
+
l.add(e);
|
|
90
|
+
const s = typeof t.disabled == "string" ? t.disabled : "disabled", o = !!((p = e.data) != null && p[s]), r = t.checkStrictly !== !0 && e.parent ? m(e.parent, t, l) : !1;
|
|
91
|
+
return o || r;
|
|
92
|
+
}
|
|
93
|
+
function b(e, t) {
|
|
94
|
+
return f(e, {
|
|
95
|
+
isLeaf: T(e, t),
|
|
96
|
+
isDisabled: m(e, t)
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
const z = h(() => {
|
|
100
|
+
const e = i.props ?? {}, t = { ...e };
|
|
101
|
+
return typeof e.disabled == "function" && (t.disabled = (l, s) => {
|
|
102
|
+
var o;
|
|
103
|
+
return ((o = e.disabled) == null ? void 0 : o.call(e, b(s, e))) ?? !1;
|
|
104
|
+
}), typeof e.leaf == "function" && (t.leaf = (l, s) => {
|
|
105
|
+
var o;
|
|
106
|
+
return ((o = e.leaf) == null ? void 0 : o.call(e, b(s, e))) ?? !1;
|
|
107
|
+
}), typeof e.lazyLoad == "function" && (t.lazyLoad = (l, s, o) => {
|
|
108
|
+
var r;
|
|
109
|
+
return (r = e.lazyLoad) == null ? void 0 : r.call(e, f(l), s, o);
|
|
110
|
+
}), t;
|
|
111
|
+
}), B = h(
|
|
112
|
+
() => i.filterMethod ? (e, t) => {
|
|
113
|
+
var l;
|
|
114
|
+
return ((l = i.filterMethod) == null ? void 0 : l.call(i, f(e), t)) ?? !1;
|
|
115
|
+
} : void 0
|
|
116
|
+
);
|
|
117
|
+
function w(e) {
|
|
118
|
+
return {
|
|
119
|
+
...e,
|
|
120
|
+
node: f(e.node)
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function L(e, t) {
|
|
124
|
+
return e.map((l) => {
|
|
125
|
+
const s = f(l.node);
|
|
126
|
+
return Object.freeze({
|
|
127
|
+
uid: s.uid,
|
|
128
|
+
value: s.value,
|
|
129
|
+
label: s.label,
|
|
130
|
+
pathValues: s.pathValues,
|
|
131
|
+
pathLabels: s.pathLabels,
|
|
132
|
+
data: s.data,
|
|
133
|
+
text: l.text,
|
|
134
|
+
hitState: l.hitState,
|
|
135
|
+
closable: l.closable,
|
|
136
|
+
remove: () => t(l)
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
function $(e) {
|
|
141
|
+
n("update:modelValue", e);
|
|
142
|
+
}
|
|
143
|
+
function A(e) {
|
|
144
|
+
n("change", e);
|
|
145
|
+
}
|
|
146
|
+
function O(e) {
|
|
147
|
+
n("focus", e);
|
|
148
|
+
}
|
|
149
|
+
function x(e) {
|
|
150
|
+
n("blur", e);
|
|
151
|
+
}
|
|
152
|
+
function D() {
|
|
153
|
+
n("clear");
|
|
154
|
+
}
|
|
155
|
+
function E(e) {
|
|
156
|
+
n("visible-change", e);
|
|
157
|
+
}
|
|
158
|
+
function P(e) {
|
|
159
|
+
n("expand-change", e);
|
|
160
|
+
}
|
|
161
|
+
function j(e) {
|
|
162
|
+
n("remove-tag", e);
|
|
163
|
+
}
|
|
164
|
+
function F() {
|
|
165
|
+
var e;
|
|
166
|
+
(e = u.value) == null || e.focus();
|
|
167
|
+
}
|
|
168
|
+
function M() {
|
|
169
|
+
var e;
|
|
170
|
+
(e = u.value) == null || e.blur();
|
|
171
|
+
}
|
|
172
|
+
function R() {
|
|
173
|
+
var e, t;
|
|
174
|
+
(t = (e = u.value) == null ? void 0 : e.togglePopperVisible) == null || t.call(e, !0);
|
|
175
|
+
}
|
|
176
|
+
function I() {
|
|
177
|
+
var e, t;
|
|
178
|
+
(t = (e = u.value) == null ? void 0 : e.togglePopperVisible) == null || t.call(e, !1);
|
|
179
|
+
}
|
|
180
|
+
return y({ focus: F, blur: M, open: R, close: I }), (e, t) => (N(), U(q(Y), Q({
|
|
181
|
+
ref_key: "cascaderRef",
|
|
182
|
+
ref: u
|
|
183
|
+
}, V.value, {
|
|
184
|
+
class: "qy-cascader",
|
|
185
|
+
"model-value": a.modelValue,
|
|
186
|
+
options: a.options,
|
|
187
|
+
props: z.value,
|
|
188
|
+
size: a.size,
|
|
189
|
+
placeholder: a.placeholder,
|
|
190
|
+
disabled: a.disabled,
|
|
191
|
+
clearable: a.clearable,
|
|
192
|
+
"clear-icon": a.clearIcon,
|
|
193
|
+
filterable: a.filterable,
|
|
194
|
+
"filter-method": B.value,
|
|
195
|
+
separator: a.separator,
|
|
196
|
+
"show-all-levels": a.showAllLevels,
|
|
197
|
+
"collapse-tags": a.collapseTags,
|
|
198
|
+
"max-collapse-tags": a.maxCollapseTags,
|
|
199
|
+
"collapse-tags-tooltip": a.collapseTagsTooltip,
|
|
200
|
+
"max-collapse-tags-tooltip-height": a.maxCollapseTagsTooltipHeight,
|
|
201
|
+
debounce: a.debounce,
|
|
202
|
+
"before-filter": a.beforeFilter,
|
|
203
|
+
placement: a.placement,
|
|
204
|
+
"fallback-placements": a.fallbackPlacements,
|
|
205
|
+
"popper-class": a.popperClass,
|
|
206
|
+
"popper-style": a.popperStyle,
|
|
207
|
+
teleported: a.teleported,
|
|
208
|
+
effect: a.effect,
|
|
209
|
+
persistent: a.persistent,
|
|
210
|
+
"show-checked-strategy": a.showCheckedStrategy,
|
|
211
|
+
"fit-input-width": a.fitInputWidth,
|
|
212
|
+
"tag-type": a.tagType,
|
|
213
|
+
"tag-effect": a.tagEffect,
|
|
214
|
+
"validate-event": a.validateEvent,
|
|
215
|
+
"virtual-scroll": a.virtualScroll,
|
|
216
|
+
"item-size": a.itemSize,
|
|
217
|
+
height: a.height,
|
|
218
|
+
"onUpdate:modelValue": $,
|
|
219
|
+
onChange: A,
|
|
220
|
+
onFocus: O,
|
|
221
|
+
onBlur: x,
|
|
222
|
+
onClear: D,
|
|
223
|
+
onVisibleChange: E,
|
|
224
|
+
onExpandChange: P,
|
|
225
|
+
onRemoveTag: j
|
|
226
|
+
}), G({ _: 2 }, [
|
|
227
|
+
e.$slots.prefix ? {
|
|
228
|
+
name: "prefix",
|
|
229
|
+
fn: d(() => [
|
|
230
|
+
c(e.$slots, "prefix")
|
|
231
|
+
]),
|
|
232
|
+
key: "0"
|
|
233
|
+
} : void 0,
|
|
234
|
+
e.$slots.header ? {
|
|
235
|
+
name: "header",
|
|
236
|
+
fn: d(() => [
|
|
237
|
+
c(e.$slots, "header")
|
|
238
|
+
]),
|
|
239
|
+
key: "1"
|
|
240
|
+
} : void 0,
|
|
241
|
+
e.$slots.footer ? {
|
|
242
|
+
name: "footer",
|
|
243
|
+
fn: d(() => [
|
|
244
|
+
c(e.$slots, "footer")
|
|
245
|
+
]),
|
|
246
|
+
key: "2"
|
|
247
|
+
} : void 0,
|
|
248
|
+
e.$slots.empty ? {
|
|
249
|
+
name: "empty",
|
|
250
|
+
fn: d(() => [
|
|
251
|
+
c(e.$slots, "empty")
|
|
252
|
+
]),
|
|
253
|
+
key: "3"
|
|
254
|
+
} : void 0,
|
|
255
|
+
e.$slots.default ? {
|
|
256
|
+
name: "default",
|
|
257
|
+
fn: d((l) => [
|
|
258
|
+
c(e.$slots, "default", J(X(w(l))))
|
|
259
|
+
]),
|
|
260
|
+
key: "4"
|
|
261
|
+
} : void 0,
|
|
262
|
+
e.$slots["suggestion-item"] ? {
|
|
263
|
+
name: "suggestion-item",
|
|
264
|
+
fn: d((l) => [
|
|
265
|
+
c(e.$slots, "suggestion-item", {
|
|
266
|
+
item: f(l.item)
|
|
267
|
+
})
|
|
268
|
+
]),
|
|
269
|
+
key: "5"
|
|
270
|
+
} : void 0,
|
|
271
|
+
e.$slots.tag ? {
|
|
272
|
+
name: "tag",
|
|
273
|
+
fn: d((l) => [
|
|
274
|
+
c(e.$slots, "tag", {
|
|
275
|
+
data: L(l.data, l.deleteTag),
|
|
276
|
+
remove: (s) => s == null ? void 0 : s.remove()
|
|
277
|
+
})
|
|
278
|
+
]),
|
|
279
|
+
key: "6"
|
|
280
|
+
} : void 0
|
|
281
|
+
]), 1040, ["model-value", "options", "props", "size", "placeholder", "disabled", "clearable", "clear-icon", "filterable", "filter-method", "separator", "show-all-levels", "collapse-tags", "max-collapse-tags", "collapse-tags-tooltip", "max-collapse-tags-tooltip-height", "debounce", "before-filter", "placement", "fallback-placements", "popper-class", "popper-style", "teleported", "effect", "persistent", "show-checked-strategy", "fit-input-width", "tag-type", "tag-effect", "validate-event", "virtual-scroll", "item-size", "height"]));
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
export {
|
|
285
|
+
ee as _
|
|
286
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const c=require("vue"),ee=require("element-plus"),te=c.defineComponent({name:"QyTree",inheritAttrs:!1,__name:"index",props:{data:{default:()=>[]},emptyText:{},nodeKey:{},props:{default:()=>({})},renderAfterExpand:{type:Boolean,default:!0},defaultExpandAll:{type:Boolean},expandOnClickNode:{type:Boolean,default:!0},autoExpandParent:{type:Boolean,default:!0},defaultExpandedKeys:{},accordion:{type:Boolean},indent:{default:18},icon:{},highlightCurrent:{type:Boolean},currentNodeKey:{},showCheckbox:{type:Boolean},checkStrictly:{type:Boolean},checkOnClickNode:{type:Boolean},checkOnClickLeaf:{type:Boolean,default:!0},checkDescendants:{type:Boolean},defaultCheckedKeys:{},filterNodeMethod:{},lazy:{type:Boolean},load:{},draggable:{type:Boolean},allowDrag:{},allowDrop:{}},emits:["node-click","node-contextmenu","current-change","node-expand","node-collapse","check-change","check","node-drag-start","node-drag-enter","node-drag-over","node-drag-leave","node-drag-end","node-drop"],setup(l,{expose:N,emit:y}){const r=l,s=y,C=c.useAttrs(),i=c.ref(),p=Object.freeze([...r.defaultExpandedKeys??[]]),v=Object.freeze([...r.defaultCheckedKeys??[]]),x=c.computed(()=>Object.fromEntries(Object.entries(C).filter(([e])=>e==="class"||e==="style"||e==="id"||e==="title"||e.startsWith("data-")||e.startsWith("aria-"))));function d(e){var n,t,a,o;return Object.freeze({key:e.key??null,parentKey:((n=e.parent)==null?void 0:n.key)??null,data:e.data,label:e.label??String(((a=e.data)==null?void 0:a[typeof((t=r.props)==null?void 0:t.label)=="string"?r.props.label:"label"])??""),level:e.level??0,expanded:e.expanded===!0,checked:e.checked===!0,indeterminate:e.indeterminate===!0,disabled:e.disabled===!0,leaf:e.isLeaf===!0,visible:e.visible!==!1,loading:e.loading===!0,loaded:e.loaded===!0,childCount:((o=e.childNodes)==null?void 0:o.length)??0})}const D=c.computed(()=>{const e=r.props??{};return{...e,...typeof e.label=="function"?{label:n=>{var t;return((t=e.label)==null?void 0:t.call(e,n))??""}}:{},...typeof e.disabled=="function"?{disabled:n=>{var t;return((t=e.disabled)==null?void 0:t.call(e,n))??!1}}:{},...typeof e.isLeaf=="function"?{isLeaf:n=>{var t;return((t=e.isLeaf)==null?void 0:t.call(e,n))??!1}}:{},...typeof e.class=="function"?{class:(n,t)=>{var a;return((a=e.class)==null?void 0:a.call(e,n,d(t)))??""}}:{}}}),m=c.computed(()=>r.filterNodeMethod?(e,n,t)=>{var a;return((a=r.filterNodeMethod)==null?void 0:a.call(r,e,n,d(t)))??!1}:void 0),K=c.computed(()=>r.load?(e,n,t)=>{var a;return(a=r.load)==null?void 0:a.call(r,d(e),n,t)}:void 0);function u(e){var t;return((t=i.value)==null?void 0:t.getNode(e.data))===e?e:null}function g(e){var t;const n=(t=i.value)==null?void 0:t.getNode(e);return(n==null?void 0:n.data)===e?n:null}const b=c.computed(()=>r.allowDrag?e=>{var t;const n=u(e);return n?((t=r.allowDrag)==null?void 0:t.call(r,d(n)))??!1:!1}:void 0),w=c.computed(()=>r.allowDrop?(e,n,t)=>{var h;const a=u(e),o=u(n);return a&&o?((h=r.allowDrop)==null?void 0:h.call(r,d(a),d(o),t==="prev"?"before":t==="next"?"after":"inner"))??!1:!1}:void 0);function E(e){return{checkedKeys:e.checkedKeys??[],checkedNodes:e.checkedNodes??[],halfCheckedKeys:e.halfCheckedKeys??[],halfCheckedNodes:e.halfCheckedNodes??[]}}function ne(e){return e}function B(e,n,t,a){const o=u(n);o&&s("node-click",o.data,d(o),a)}function O(e,n,t){const a=u(t);a&&s("node-contextmenu",e,a.data,d(a))}function A(e,n){if(e===null&&n===null){s("current-change",null,null);return}const t=n?u(n):g(e);t&&s("current-change",t.data,n?d(t):null)}function L(e,n){const t=u(n);t&&s("node-expand",t.data,d(t))}function P(e,n){const t=u(n);t&&s("node-collapse",t.data,d(t))}function S(e,n,t){const a=g(e);a&&s("check-change",a.data,n,t)}function z(e,n){const t=g(e);t&&s("check",t.data,E(n))}function q(e,n){const t=u(e);t&&s("node-drag-start",d(t),n)}function H(e,n,t){const a=u(e),o=u(n);a&&o&&s("node-drag-enter",d(a),d(o),t)}function M(e,n,t){const a=u(e),o=u(n);a&&o&&s("node-drag-over",d(a),d(o),t)}function T(e,n,t){const a=u(e),o=u(n);a&&o&&s("node-drag-leave",d(a),d(o),t)}function j(e,n,t,a){const o=u(e),h=n?u(n):null;o&&(!n||h)&&s("node-drag-end",d(o),h?d(h):null,t,a)}function $(e,n,t,a){const o=u(e),h=u(n);o&&h&&s("node-drop",d(o),d(h),t,a)}function f(e){if(!r.nodeKey)throw new Error(`QyTree.${e} requires nodeKey`)}function Q(e){var n;if(!r.filterNodeMethod)throw new Error("QyTree.filter requires filterNodeMethod");(n=i.value)==null||n.filter(e)}function I(e){var t;f("getNode");const n=(t=i.value)==null?void 0:t.getNode(e);return n?d(n):null}function R(e){var n;return f("getNodePath"),((n=i.value)==null?void 0:n.getNodePath(e))??[]}function W(e){var n;return f("getCheckedKeys"),((n=i.value)==null?void 0:n.getCheckedKeys(e))??[]}function F(e,n){var t;return f("getCheckedNodes"),((t=i.value)==null?void 0:t.getCheckedNodes(e,n))??[]}function G(){var e;return f("getHalfCheckedKeys"),((e=i.value)==null?void 0:e.getHalfCheckedKeys())??[]}function J(){var e;return f("getHalfCheckedNodes"),((e=i.value)==null?void 0:e.getHalfCheckedNodes())??[]}function U(e,n,t=!1){var a;f("setChecked"),(a=i.value)==null||a.setChecked(e,n,t)}function V(e,n){var t;f("setCheckedKeys"),(t=i.value)==null||t.setCheckedKeys(e,n)}function X(e,n){var t;f("setCheckedNodes"),(t=i.value)==null||t.setCheckedNodes(e,n)}function k(){var n,t;f("getCurrentKey");const e=((n=i.value)==null?void 0:n.getCurrentKey())??null;return e!==null&&((t=i.value)!=null&&t.getNode(e))?e:null}function Y(){var e;return f("getCurrentNode"),k()===null?null:((e=i.value)==null?void 0:e.getCurrentNode())??null}function Z(e,n=!0){var t;f("setCurrentKey"),(t=i.value)==null||t.setCurrentKey(e,n)}function _(e,n=!0){var t;f("setCurrentNode"),(t=i.value)==null||t.setCurrentNode(e,n)}return N({filter:Q,getNode:I,getNodePath:R,getCheckedKeys:W,getCheckedNodes:F,getHalfCheckedKeys:G,getHalfCheckedNodes:J,setChecked:U,setCheckedKeys:V,setCheckedNodes:X,getCurrentKey:k,getCurrentNode:Y,setCurrentKey:Z,setCurrentNode:_}),(e,n)=>(c.openBlock(),c.createBlock(c.unref(ee.ElTree),c.mergeProps({ref_key:"treeRef",ref:i},x.value,{class:"qy-tree",data:l.data,"empty-text":l.emptyText,"node-key":l.nodeKey,props:D.value,"render-after-expand":l.renderAfterExpand,"default-expand-all":l.defaultExpandAll,"expand-on-click-node":l.expandOnClickNode,"auto-expand-parent":l.autoExpandParent,"default-expanded-keys":c.unref(p),accordion:l.accordion,indent:l.indent,icon:l.icon,"highlight-current":l.highlightCurrent,"current-node-key":l.currentNodeKey,"show-checkbox":l.showCheckbox,"check-strictly":l.checkStrictly,"check-on-click-node":l.checkOnClickNode,"check-on-click-leaf":l.checkOnClickLeaf,"check-descendants":l.checkDescendants,"default-checked-keys":c.unref(v),"filter-node-method":m.value,lazy:l.lazy,load:K.value,draggable:l.draggable,"allow-drag":b.value,"allow-drop":w.value,onNodeClick:B,onNodeContextmenu:O,onCurrentChange:A,onNodeExpand:L,onNodeCollapse:P,onCheckChange:S,onCheck:z,onNodeDragStart:q,onNodeDragEnter:H,onNodeDragOver:M,onNodeDragLeave:T,onNodeDragEnd:j,onNodeDrop:$}),c.createSlots({_:2},[e.$slots.default?{name:"default",fn:c.withCtx(t=>[c.renderSlot(e.$slots,"default",{data:t.data,node:d(t.node)})]),key:"0"}:void 0,e.$slots.empty?{name:"empty",fn:c.withCtx(()=>[c.renderSlot(e.$slots,"empty")]),key:"1"}:void 0]),1040,["data","empty-text","node-key","props","render-after-expand","default-expand-all","expand-on-click-node","auto-expand-parent","default-expanded-keys","accordion","indent","icon","highlight-current","current-node-key","show-checkbox","check-strictly","check-on-click-node","check-on-click-leaf","check-descendants","default-checked-keys","filter-node-method","lazy","load","draggable","allow-drag","allow-drop"]))}});exports._sfc_main=te;
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import { defineComponent as ae, useAttrs as oe, ref as de, computed as h, openBlock as re, createBlock as le, unref as k, mergeProps as ce, createSlots as ue, withCtx as y, renderSlot as C } from "vue";
|
|
2
|
+
import { ElTree as ie } from "element-plus";
|
|
3
|
+
const ge = /* @__PURE__ */ ae({
|
|
4
|
+
name: "QyTree",
|
|
5
|
+
inheritAttrs: !1,
|
|
6
|
+
__name: "index",
|
|
7
|
+
props: {
|
|
8
|
+
data: { default: () => [] },
|
|
9
|
+
emptyText: {},
|
|
10
|
+
nodeKey: {},
|
|
11
|
+
props: { default: () => ({}) },
|
|
12
|
+
renderAfterExpand: { type: Boolean, default: !0 },
|
|
13
|
+
defaultExpandAll: { type: Boolean },
|
|
14
|
+
expandOnClickNode: { type: Boolean, default: !0 },
|
|
15
|
+
autoExpandParent: { type: Boolean, default: !0 },
|
|
16
|
+
defaultExpandedKeys: {},
|
|
17
|
+
accordion: { type: Boolean },
|
|
18
|
+
indent: { default: 18 },
|
|
19
|
+
icon: {},
|
|
20
|
+
highlightCurrent: { type: Boolean },
|
|
21
|
+
currentNodeKey: {},
|
|
22
|
+
showCheckbox: { type: Boolean },
|
|
23
|
+
checkStrictly: { type: Boolean },
|
|
24
|
+
checkOnClickNode: { type: Boolean },
|
|
25
|
+
checkOnClickLeaf: { type: Boolean, default: !0 },
|
|
26
|
+
checkDescendants: { type: Boolean },
|
|
27
|
+
defaultCheckedKeys: {},
|
|
28
|
+
filterNodeMethod: {},
|
|
29
|
+
lazy: { type: Boolean },
|
|
30
|
+
load: {},
|
|
31
|
+
draggable: { type: Boolean },
|
|
32
|
+
allowDrag: {},
|
|
33
|
+
allowDrop: {}
|
|
34
|
+
},
|
|
35
|
+
emits: ["node-click", "node-contextmenu", "current-change", "node-expand", "node-collapse", "check-change", "check", "node-drag-start", "node-drag-enter", "node-drag-over", "node-drag-leave", "node-drag-end", "node-drop"],
|
|
36
|
+
setup(l, { expose: p, emit: v }) {
|
|
37
|
+
const r = l, i = v, x = oe(), u = de(), D = Object.freeze([...r.defaultExpandedKeys ?? []]), m = Object.freeze([...r.defaultCheckedKeys ?? []]), K = h(() => Object.fromEntries(Object.entries(x).filter(
|
|
38
|
+
([e]) => e === "class" || e === "style" || e === "id" || e === "title" || e.startsWith("data-") || e.startsWith("aria-")
|
|
39
|
+
)));
|
|
40
|
+
function o(e) {
|
|
41
|
+
var n, t, a, d;
|
|
42
|
+
return Object.freeze({
|
|
43
|
+
key: e.key ?? null,
|
|
44
|
+
parentKey: ((n = e.parent) == null ? void 0 : n.key) ?? null,
|
|
45
|
+
data: e.data,
|
|
46
|
+
label: e.label ?? String(((a = e.data) == null ? void 0 : a[typeof ((t = r.props) == null ? void 0 : t.label) == "string" ? r.props.label : "label"]) ?? ""),
|
|
47
|
+
level: e.level ?? 0,
|
|
48
|
+
expanded: e.expanded === !0,
|
|
49
|
+
checked: e.checked === !0,
|
|
50
|
+
indeterminate: e.indeterminate === !0,
|
|
51
|
+
disabled: e.disabled === !0,
|
|
52
|
+
leaf: e.isLeaf === !0,
|
|
53
|
+
visible: e.visible !== !1,
|
|
54
|
+
loading: e.loading === !0,
|
|
55
|
+
loaded: e.loaded === !0,
|
|
56
|
+
childCount: ((d = e.childNodes) == null ? void 0 : d.length) ?? 0
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
const b = h(() => {
|
|
60
|
+
const e = r.props ?? {};
|
|
61
|
+
return {
|
|
62
|
+
...e,
|
|
63
|
+
...typeof e.label == "function" ? { label: (n) => {
|
|
64
|
+
var t;
|
|
65
|
+
return ((t = e.label) == null ? void 0 : t.call(e, n)) ?? "";
|
|
66
|
+
} } : {},
|
|
67
|
+
...typeof e.disabled == "function" ? { disabled: (n) => {
|
|
68
|
+
var t;
|
|
69
|
+
return ((t = e.disabled) == null ? void 0 : t.call(e, n)) ?? !1;
|
|
70
|
+
} } : {},
|
|
71
|
+
...typeof e.isLeaf == "function" ? { isLeaf: (n) => {
|
|
72
|
+
var t;
|
|
73
|
+
return ((t = e.isLeaf) == null ? void 0 : t.call(e, n)) ?? !1;
|
|
74
|
+
} } : {},
|
|
75
|
+
...typeof e.class == "function" ? { class: (n, t) => {
|
|
76
|
+
var a;
|
|
77
|
+
return ((a = e.class) == null ? void 0 : a.call(e, n, o(t))) ?? "";
|
|
78
|
+
} } : {}
|
|
79
|
+
};
|
|
80
|
+
}), w = h(() => r.filterNodeMethod ? (e, n, t) => {
|
|
81
|
+
var a;
|
|
82
|
+
return ((a = r.filterNodeMethod) == null ? void 0 : a.call(r, e, n, o(t))) ?? !1;
|
|
83
|
+
} : void 0), E = h(() => r.load ? (e, n, t) => {
|
|
84
|
+
var a;
|
|
85
|
+
return (a = r.load) == null ? void 0 : a.call(r, o(e), n, t);
|
|
86
|
+
} : void 0);
|
|
87
|
+
function c(e) {
|
|
88
|
+
var t;
|
|
89
|
+
return ((t = u.value) == null ? void 0 : t.getNode(e.data)) === e ? e : null;
|
|
90
|
+
}
|
|
91
|
+
function g(e) {
|
|
92
|
+
var t;
|
|
93
|
+
const n = (t = u.value) == null ? void 0 : t.getNode(e);
|
|
94
|
+
return (n == null ? void 0 : n.data) === e ? n : null;
|
|
95
|
+
}
|
|
96
|
+
const B = h(() => r.allowDrag ? (e) => {
|
|
97
|
+
var t;
|
|
98
|
+
const n = c(e);
|
|
99
|
+
return n ? ((t = r.allowDrag) == null ? void 0 : t.call(r, o(n))) ?? !1 : !1;
|
|
100
|
+
} : void 0), O = h(() => r.allowDrop ? (e, n, t) => {
|
|
101
|
+
var f;
|
|
102
|
+
const a = c(e), d = c(n);
|
|
103
|
+
return a && d ? ((f = r.allowDrop) == null ? void 0 : f.call(r, o(a), o(d), t === "prev" ? "before" : t === "next" ? "after" : "inner")) ?? !1 : !1;
|
|
104
|
+
} : void 0);
|
|
105
|
+
function A(e) {
|
|
106
|
+
return { checkedKeys: e.checkedKeys ?? [], checkedNodes: e.checkedNodes ?? [], halfCheckedKeys: e.halfCheckedKeys ?? [], halfCheckedNodes: e.halfCheckedNodes ?? [] };
|
|
107
|
+
}
|
|
108
|
+
function se(e) {
|
|
109
|
+
return e;
|
|
110
|
+
}
|
|
111
|
+
function L(e, n, t, a) {
|
|
112
|
+
const d = c(n);
|
|
113
|
+
d && i("node-click", d.data, o(d), a);
|
|
114
|
+
}
|
|
115
|
+
function P(e, n, t) {
|
|
116
|
+
const a = c(t);
|
|
117
|
+
a && i("node-contextmenu", e, a.data, o(a));
|
|
118
|
+
}
|
|
119
|
+
function S(e, n) {
|
|
120
|
+
if (e === null && n === null) {
|
|
121
|
+
i("current-change", null, null);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const t = n ? c(n) : g(e);
|
|
125
|
+
t && i("current-change", t.data, n ? o(t) : null);
|
|
126
|
+
}
|
|
127
|
+
function z(e, n) {
|
|
128
|
+
const t = c(n);
|
|
129
|
+
t && i("node-expand", t.data, o(t));
|
|
130
|
+
}
|
|
131
|
+
function H(e, n) {
|
|
132
|
+
const t = c(n);
|
|
133
|
+
t && i("node-collapse", t.data, o(t));
|
|
134
|
+
}
|
|
135
|
+
function M(e, n, t) {
|
|
136
|
+
const a = g(e);
|
|
137
|
+
a && i("check-change", a.data, n, t);
|
|
138
|
+
}
|
|
139
|
+
function T(e, n) {
|
|
140
|
+
const t = g(e);
|
|
141
|
+
t && i("check", t.data, A(n));
|
|
142
|
+
}
|
|
143
|
+
function j(e, n) {
|
|
144
|
+
const t = c(e);
|
|
145
|
+
t && i("node-drag-start", o(t), n);
|
|
146
|
+
}
|
|
147
|
+
function $(e, n, t) {
|
|
148
|
+
const a = c(e), d = c(n);
|
|
149
|
+
a && d && i("node-drag-enter", o(a), o(d), t);
|
|
150
|
+
}
|
|
151
|
+
function q(e, n, t) {
|
|
152
|
+
const a = c(e), d = c(n);
|
|
153
|
+
a && d && i("node-drag-over", o(a), o(d), t);
|
|
154
|
+
}
|
|
155
|
+
function Q(e, n, t) {
|
|
156
|
+
const a = c(e), d = c(n);
|
|
157
|
+
a && d && i("node-drag-leave", o(a), o(d), t);
|
|
158
|
+
}
|
|
159
|
+
function I(e, n, t, a) {
|
|
160
|
+
const d = c(e), f = n ? c(n) : null;
|
|
161
|
+
d && (!n || f) && i("node-drag-end", o(d), f ? o(f) : null, t, a);
|
|
162
|
+
}
|
|
163
|
+
function R(e, n, t, a) {
|
|
164
|
+
const d = c(e), f = c(n);
|
|
165
|
+
d && f && i("node-drop", o(d), o(f), t, a);
|
|
166
|
+
}
|
|
167
|
+
function s(e) {
|
|
168
|
+
if (!r.nodeKey) throw new Error(`QyTree.${e} requires nodeKey`);
|
|
169
|
+
}
|
|
170
|
+
function W(e) {
|
|
171
|
+
var n;
|
|
172
|
+
if (!r.filterNodeMethod) throw new Error("QyTree.filter requires filterNodeMethod");
|
|
173
|
+
(n = u.value) == null || n.filter(e);
|
|
174
|
+
}
|
|
175
|
+
function F(e) {
|
|
176
|
+
var t;
|
|
177
|
+
s("getNode");
|
|
178
|
+
const n = (t = u.value) == null ? void 0 : t.getNode(e);
|
|
179
|
+
return n ? o(n) : null;
|
|
180
|
+
}
|
|
181
|
+
function G(e) {
|
|
182
|
+
var n;
|
|
183
|
+
return s("getNodePath"), ((n = u.value) == null ? void 0 : n.getNodePath(e)) ?? [];
|
|
184
|
+
}
|
|
185
|
+
function J(e) {
|
|
186
|
+
var n;
|
|
187
|
+
return s("getCheckedKeys"), ((n = u.value) == null ? void 0 : n.getCheckedKeys(e)) ?? [];
|
|
188
|
+
}
|
|
189
|
+
function U(e, n) {
|
|
190
|
+
var t;
|
|
191
|
+
return s("getCheckedNodes"), ((t = u.value) == null ? void 0 : t.getCheckedNodes(e, n)) ?? [];
|
|
192
|
+
}
|
|
193
|
+
function V() {
|
|
194
|
+
var e;
|
|
195
|
+
return s("getHalfCheckedKeys"), ((e = u.value) == null ? void 0 : e.getHalfCheckedKeys()) ?? [];
|
|
196
|
+
}
|
|
197
|
+
function X() {
|
|
198
|
+
var e;
|
|
199
|
+
return s("getHalfCheckedNodes"), ((e = u.value) == null ? void 0 : e.getHalfCheckedNodes()) ?? [];
|
|
200
|
+
}
|
|
201
|
+
function Y(e, n, t = !1) {
|
|
202
|
+
var a;
|
|
203
|
+
s("setChecked"), (a = u.value) == null || a.setChecked(e, n, t);
|
|
204
|
+
}
|
|
205
|
+
function Z(e, n) {
|
|
206
|
+
var t;
|
|
207
|
+
s("setCheckedKeys"), (t = u.value) == null || t.setCheckedKeys(e, n);
|
|
208
|
+
}
|
|
209
|
+
function _(e, n) {
|
|
210
|
+
var t;
|
|
211
|
+
s("setCheckedNodes"), (t = u.value) == null || t.setCheckedNodes(e, n);
|
|
212
|
+
}
|
|
213
|
+
function N() {
|
|
214
|
+
var n, t;
|
|
215
|
+
s("getCurrentKey");
|
|
216
|
+
const e = ((n = u.value) == null ? void 0 : n.getCurrentKey()) ?? null;
|
|
217
|
+
return e !== null && ((t = u.value) != null && t.getNode(e)) ? e : null;
|
|
218
|
+
}
|
|
219
|
+
function ee() {
|
|
220
|
+
var e;
|
|
221
|
+
return s("getCurrentNode"), N() === null ? null : ((e = u.value) == null ? void 0 : e.getCurrentNode()) ?? null;
|
|
222
|
+
}
|
|
223
|
+
function te(e, n = !0) {
|
|
224
|
+
var t;
|
|
225
|
+
s("setCurrentKey"), (t = u.value) == null || t.setCurrentKey(e, n);
|
|
226
|
+
}
|
|
227
|
+
function ne(e, n = !0) {
|
|
228
|
+
var t;
|
|
229
|
+
s("setCurrentNode"), (t = u.value) == null || t.setCurrentNode(e, n);
|
|
230
|
+
}
|
|
231
|
+
return p({ filter: W, getNode: F, getNodePath: G, getCheckedKeys: J, getCheckedNodes: U, getHalfCheckedKeys: V, getHalfCheckedNodes: X, setChecked: Y, setCheckedKeys: Z, setCheckedNodes: _, getCurrentKey: N, getCurrentNode: ee, setCurrentKey: te, setCurrentNode: ne }), (e, n) => (re(), le(k(ie), ce({
|
|
232
|
+
ref_key: "treeRef",
|
|
233
|
+
ref: u
|
|
234
|
+
}, K.value, {
|
|
235
|
+
class: "qy-tree",
|
|
236
|
+
data: l.data,
|
|
237
|
+
"empty-text": l.emptyText,
|
|
238
|
+
"node-key": l.nodeKey,
|
|
239
|
+
props: b.value,
|
|
240
|
+
"render-after-expand": l.renderAfterExpand,
|
|
241
|
+
"default-expand-all": l.defaultExpandAll,
|
|
242
|
+
"expand-on-click-node": l.expandOnClickNode,
|
|
243
|
+
"auto-expand-parent": l.autoExpandParent,
|
|
244
|
+
"default-expanded-keys": k(D),
|
|
245
|
+
accordion: l.accordion,
|
|
246
|
+
indent: l.indent,
|
|
247
|
+
icon: l.icon,
|
|
248
|
+
"highlight-current": l.highlightCurrent,
|
|
249
|
+
"current-node-key": l.currentNodeKey,
|
|
250
|
+
"show-checkbox": l.showCheckbox,
|
|
251
|
+
"check-strictly": l.checkStrictly,
|
|
252
|
+
"check-on-click-node": l.checkOnClickNode,
|
|
253
|
+
"check-on-click-leaf": l.checkOnClickLeaf,
|
|
254
|
+
"check-descendants": l.checkDescendants,
|
|
255
|
+
"default-checked-keys": k(m),
|
|
256
|
+
"filter-node-method": w.value,
|
|
257
|
+
lazy: l.lazy,
|
|
258
|
+
load: E.value,
|
|
259
|
+
draggable: l.draggable,
|
|
260
|
+
"allow-drag": B.value,
|
|
261
|
+
"allow-drop": O.value,
|
|
262
|
+
onNodeClick: L,
|
|
263
|
+
onNodeContextmenu: P,
|
|
264
|
+
onCurrentChange: S,
|
|
265
|
+
onNodeExpand: z,
|
|
266
|
+
onNodeCollapse: H,
|
|
267
|
+
onCheckChange: M,
|
|
268
|
+
onCheck: T,
|
|
269
|
+
onNodeDragStart: j,
|
|
270
|
+
onNodeDragEnter: $,
|
|
271
|
+
onNodeDragOver: q,
|
|
272
|
+
onNodeDragLeave: Q,
|
|
273
|
+
onNodeDragEnd: I,
|
|
274
|
+
onNodeDrop: R
|
|
275
|
+
}), ue({ _: 2 }, [
|
|
276
|
+
e.$slots.default ? {
|
|
277
|
+
name: "default",
|
|
278
|
+
fn: y((t) => [
|
|
279
|
+
C(e.$slots, "default", {
|
|
280
|
+
data: t.data,
|
|
281
|
+
node: o(t.node)
|
|
282
|
+
})
|
|
283
|
+
]),
|
|
284
|
+
key: "0"
|
|
285
|
+
} : void 0,
|
|
286
|
+
e.$slots.empty ? {
|
|
287
|
+
name: "empty",
|
|
288
|
+
fn: y(() => [
|
|
289
|
+
C(e.$slots, "empty")
|
|
290
|
+
]),
|
|
291
|
+
key: "1"
|
|
292
|
+
} : void 0
|
|
293
|
+
]), 1040, ["data", "empty-text", "node-key", "props", "render-after-expand", "default-expand-all", "expand-on-click-node", "auto-expand-parent", "default-expanded-keys", "accordion", "indent", "icon", "highlight-current", "current-node-key", "show-checkbox", "check-strictly", "check-on-click-node", "check-on-click-leaf", "check-descendants", "default-checked-keys", "filter-node-method", "lazy", "load", "draggable", "allow-drag", "allow-drop"]));
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
export {
|
|
297
|
+
ge as _
|
|
298
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { defineComponent as v, computed as b, h as o, unref as i, isVNode as P, Fragment as u } from "vue";
|
|
2
|
+
import { ElTabs as V, ElTabPane as g } from "element-plus";
|
|
3
|
+
const S = v({
|
|
4
|
+
name: "QyTabs",
|
|
5
|
+
inheritAttrs: !1,
|
|
6
|
+
props: {
|
|
7
|
+
modelValue: { type: [String, Number], required: !1 },
|
|
8
|
+
defaultValue: { type: [String, Number], required: !1 },
|
|
9
|
+
type: { type: String, default: "" },
|
|
10
|
+
tabPosition: { type: String, default: "top" },
|
|
11
|
+
stretch: { type: Boolean, default: !1 },
|
|
12
|
+
closable: { type: Boolean, default: !1 },
|
|
13
|
+
addable: { type: Boolean, default: !1 },
|
|
14
|
+
editable: { type: Boolean, default: !1 },
|
|
15
|
+
beforeLeave: {
|
|
16
|
+
type: Function,
|
|
17
|
+
required: !1
|
|
18
|
+
},
|
|
19
|
+
tabindex: { type: [String, Number], default: 0 }
|
|
20
|
+
},
|
|
21
|
+
emits: ["update:modelValue", "tab-change", "tab-click", "tab-remove", "tab-add", "edit"],
|
|
22
|
+
setup(t, { attrs: f, emit: l, slots: r }) {
|
|
23
|
+
const d = b(
|
|
24
|
+
() => Object.fromEntries(
|
|
25
|
+
Object.entries(f).filter(
|
|
26
|
+
([e]) => e === "class" || e === "style" || e === "id" || e === "role" || e === "title" || e.startsWith("data-") || e.startsWith("aria-")
|
|
27
|
+
)
|
|
28
|
+
)
|
|
29
|
+
), c = b(() => ({
|
|
30
|
+
...d.value,
|
|
31
|
+
class: ["qy-tabs", d.value.class]
|
|
32
|
+
}));
|
|
33
|
+
function m(e) {
|
|
34
|
+
const a = i(e.paneName), n = e.props ?? {};
|
|
35
|
+
return Object.freeze({
|
|
36
|
+
name: a ?? n.name,
|
|
37
|
+
label: n.label ?? "",
|
|
38
|
+
disabled: n.disabled ?? !1,
|
|
39
|
+
closable: i(e.isClosable) ?? n.closable ?? !1,
|
|
40
|
+
lazy: n.lazy ?? !1,
|
|
41
|
+
active: i(e.active) ?? !1,
|
|
42
|
+
index: i(e.index)
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function p(e) {
|
|
46
|
+
return typeof e.type == "object" && e.type !== null && e.type.name === "QyTabPane";
|
|
47
|
+
}
|
|
48
|
+
function y(e) {
|
|
49
|
+
return Object.fromEntries(
|
|
50
|
+
Object.entries(e ?? {}).filter(
|
|
51
|
+
([a]) => a === "label" || a === "name" || a === "closable" || a === "disabled" || a === "lazy" || a === "class" || a === "style" || a === "id" || a === "role" || a === "title" || a.startsWith("data-") || a.startsWith("aria-")
|
|
52
|
+
)
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
function s(e) {
|
|
56
|
+
return e.map((a) => P(a) ? p(a) ? o(g, { ...y(a.props), key: a.key ?? void 0 }, a.children) : a.type === u && Array.isArray(a.children) ? o(u, { key: a.key ?? void 0 }, s(a.children)) : a : a);
|
|
57
|
+
}
|
|
58
|
+
return () => o(V, {
|
|
59
|
+
...c.value,
|
|
60
|
+
modelValue: t.modelValue,
|
|
61
|
+
defaultValue: t.defaultValue,
|
|
62
|
+
type: t.type,
|
|
63
|
+
tabPosition: t.tabPosition,
|
|
64
|
+
stretch: t.stretch,
|
|
65
|
+
closable: t.closable,
|
|
66
|
+
addable: t.addable,
|
|
67
|
+
editable: t.editable,
|
|
68
|
+
beforeLeave: t.beforeLeave,
|
|
69
|
+
tabindex: t.tabindex,
|
|
70
|
+
"onUpdate:modelValue": (e) => l("update:modelValue", e),
|
|
71
|
+
onTabChange: (e) => l("tab-change", e),
|
|
72
|
+
onTabClick: (e, a) => l("tab-click", m(e), a),
|
|
73
|
+
onTabRemove: (e) => l("tab-remove", e),
|
|
74
|
+
onTabAdd: () => l("tab-add"),
|
|
75
|
+
onEdit: (e, a) => l("edit", e, a)
|
|
76
|
+
}, {
|
|
77
|
+
default: () => {
|
|
78
|
+
var e;
|
|
79
|
+
return s(((e = r.default) == null ? void 0 : e.call(r)) ?? []);
|
|
80
|
+
},
|
|
81
|
+
"add-icon": r["add-icon"]
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
export {
|
|
86
|
+
S as _
|
|
87
|
+
};
|