geekin-devtoys 0.2.20 → 0.2.21
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),H=require("element-plus"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),H=require("element-plus"),J=require("../index-il5JtS6o.js"),Q=require("../_plugin-vue_export-helper-BHFhmbuH.js"),X={key:0,class:"g-input-tree-tag__tags"},Y=t.defineComponent({__name:"index",props:{modelValue:{default:()=>[]},data:{default:()=>[]},props:{default:()=>({})},nodeKey:{default:"id"},placeholder:{default:"请输入关键字搜索"},width:{default:320},popperMaxHeight:{default:320},popperZIndex:{default:2e3},popperOffset:{default:4},defaultExpandAll:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},closable:{type:Boolean,default:!0},tagType:{default:"info"},tagEffect:{default:"light"},clearInputAfterSelect:{type:Boolean,default:!0},enterToAdd:{type:Boolean,default:!0},showLeafIcon:{type:Boolean,default:!0},valueFormat:{default:"value"},selectable:{},filterMethod:{},duplicateMessage:{default:"该项已添加"},notFoundMessage:{default:"未找到匹配项"}},emits:["update:modelValue","change","add","remove","node-click","duplicate","not-found"],setup(k,{expose:R,emit:z}){const a=k,u=z,$=t.computed(()=>({label:a.props.label||"label",children:a.props.children||"children",disabled:a.props.disabled})),q=t.computed(()=>a.props.value||a.nodeKey||"id"),O=t.computed(()=>a.props.label||"label"),K=t.computed(()=>a.props.children||"children"),_=t.computed(()=>a.props.isLeaf),b=e=>e?e[q.value]:void 0,c=e=>e?e[O.value]:"",N=e=>e?e[K.value]:void 0,p=e=>{if(!e)return!1;if(typeof a.selectable=="function")return a.selectable(e);if(_.value&&e[_.value]!==void 0)return!!e[_.value];const l=N(e);return!l||!l.length},B=t.computed(()=>{const e=new Map,l=(o=[])=>{o.forEach(n=>{p(n)&&e.set(b(n),n);const s=N(n);s?.length&&l(s)})};return l(a.data||[]),e}),i=t.computed(()=>(a.modelValue||[]).map(l=>{const o=a.valueFormat==="object"?l?.value:l,n=B.value.get(o),s=a.valueFormat==="object"?l?.label:void 0;return{value:o,label:n?c(n):s??String(o??""),raw:n}})),V=e=>i.value.some(l=>l.value===e),h=t.ref(""),d=t.ref(!1),x=t.ref(null),F=t.ref(null),I=t.ref(null),E=t.ref(null),T=t.ref({}),C=t.ref("bottom"),j=t.computed(()=>typeof a.width=="number"?`${a.width}px`:a.width),M=()=>{a.disabled||(d.value=!0)},w=()=>{if(!d.value)return;const e=I.value,l=E.value;if(!e||!l)return;const o=e.getBoundingClientRect(),n=l.offsetHeight||a.popperMaxHeight,m=window.innerHeight-o.bottom,r=o.top;let v;m>=n+a.popperOffset||m>=r?(v=o.bottom+a.popperOffset,C.value="bottom"):(v=o.top-n-a.popperOffset,C.value="top"),T.value={position:"fixed",top:`${v}px`,left:`${o.left}px`,width:`${o.width}px`,zIndex:String(a.popperZIndex)}};let f=null;const y=()=>{d.value&&(f&&cancelAnimationFrame(f),f=requestAnimationFrame(()=>{f=null,w()}))};t.watch(d,async e=>{e&&(await t.nextTick(),w(),requestAnimationFrame(w))});const L=e=>{if(!d.value)return;const l=e.target;F.value?.contains(l)||E.value?.contains(l)||(d.value=!1)};t.onMounted(()=>{document.addEventListener("mousedown",L,!0),window.addEventListener("scroll",y,!0),window.addEventListener("resize",y)}),t.onBeforeUnmount(()=>{document.removeEventListener("mousedown",L,!0),window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",y),f&&cancelAnimationFrame(f)});const D=e=>{d.value=!0,x.value?.filter(e),t.nextTick(w)},U=(e,l)=>e?typeof a.filterMethod=="function"?a.filterMethod(e,l):String(c(l)??"").toLowerCase().includes(String(e).toLowerCase()):!0,G=e=>{u("node-click",e),p(e)&&(S(e),d.value=!1)},Z=e=>a.valueFormat==="object"?{value:e.value,label:e.label,raw:e.raw}:e.value,S=e=>{const l=b(e);if(l==null||l==="")return;if(V(l)){const s={value:l,label:c(e),raw:e};u("duplicate",s),a.duplicateMessage&&H.ElMessage.warning(a.duplicateMessage);return}const o={value:l,label:c(e),raw:e},n=[...a.modelValue||[],Z(o)];u("update:modelValue",n),u("add",o),u("change",n,[...i.value,o]),a.clearInputAfterSelect&&(h.value="")},W=()=>{if(!a.enterToAdd)return;const e=(h.value||"").trim();if(!e)return;let l=null;for(const o of B.value.values())if(c(o)===e){l=o;break}if(!l){u("not-found",e),a.notFoundMessage&&H.ElMessage.warning(a.notFoundMessage);return}S(l)},A=e=>{const l=i.value[e],o=[...a.modelValue||[]];o.splice(e,1),u("update:modelValue",o),l&&u("remove",l,e);const n=i.value.filter((s,m)=>m!==e);u("change",o,n)};return R({open:M,close:()=>d.value=!1,clear:()=>{u("update:modelValue",[]),u("change",[],[])},addByValue:e=>{const l=B.value.get(e);l&&S(l)}}),(e,l)=>{const o=t.resolveComponent("el-input"),n=t.resolveComponent("el-icon"),s=t.resolveComponent("el-tree"),m=t.resolveComponent("el-tag");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["g-input-tree-tag",{"is-disabled":e.disabled}])},[t.createElementVNode("div",{class:"g-input-tree-tag__wrap",ref_key:"wrapRef",ref:F},[t.createElementVNode("div",{class:"g-input-tree-tag__input-box",ref_key:"inputBoxRef",ref:I,style:t.normalizeStyle({width:j.value})},[t.createVNode(o,{modelValue:h.value,"onUpdate:modelValue":l[0]||(l[0]=r=>h.value=r),placeholder:e.placeholder,clearable:e.clearable,disabled:e.disabled,class:"g-input-tree-tag__input",onFocus:M,onClick:M,onInput:D,onKeyup:t.withKeys(W,["enter"])},null,8,["modelValue","placeholder","clearable","disabled"])],4),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.withDirectives(t.createElementVNode("div",{ref_key:"popperRef",ref:E,class:t.normalizeClass(["g-input-tree-tag__popover",`is-${C.value}`]),style:t.normalizeStyle(T.value),onMousedown:l[1]||(l[1]=t.withModifiers(()=>{},["prevent"]))},[t.createElementVNode("div",{class:"g-input-tree-tag__tree-wrap",style:t.normalizeStyle({maxHeight:e.popperMaxHeight+"px"})},[t.createVNode(s,{ref_key:"treeRef",ref:x,data:e.data,props:$.value,"node-key":e.nodeKey,"filter-node-method":U,"expand-on-click-node":!1,"default-expand-all":e.defaultExpandAll,onNodeClick:G},{default:t.withCtx(r=>[t.renderSlot(e.$slots,"tree-node",{data:r?.data,node:r?.node,selectable:p(r?.data),selected:V(b(r?.data))},()=>[r?.data?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(["g-input-tree-tag__node",{"is-selectable":p(r.data),"is-selected":p(r.data)&&V(b(r.data))}])},[p(r.data)&&e.showLeafIcon?(t.openBlock(),t.createBlock(n,{key:0,class:"g-input-tree-tag__node-icon"},{default:t.withCtx(()=>[t.createVNode(t.unref(J.user_default))]),_:1})):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(c(r.data)),1)],2)):t.createCommentVNode("",!0)],!0)]),_:3},8,["data","props","node-key","default-expand-all"])],4)],38),[[t.vShow,d.value]])])),i.value.length?(t.openBlock(),t.createElementBlock("div",X,[t.renderSlot(e.$slots,"tags",{items:i.value,remove:A},()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.value,(r,v)=>(t.openBlock(),t.createBlock(m,{key:r.value,class:"g-input-tree-tag__tag",type:e.tagType,effect:e.tagEffect,closable:e.closable&&!e.disabled,onClose:P=>A(v)},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"tag",{item:r,index:v},()=>[t.createTextVNode(t.toDisplayString(r.label),1)],!0)]),_:2},1032,["type","effect","closable","onClose"]))),128))],!0)])):t.createCommentVNode("",!0)],512)],2)}}}),g=Q._export_sfc(Y,[["__scopeId","data-v-d268bb6f"]]);g.install=k=>{k.component(g.name,g)};exports.GInputTreeTag=g;exports.default=g;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ElMessage as
|
|
1
|
+
import { defineComponent as ie, computed as d, ref as i, watch as pe, nextTick as W, onMounted as ce, onBeforeUnmount as fe, resolveComponent as k, createElementBlock as V, openBlock as c, normalizeClass as A, createElementVNode as E, createBlock as N, createCommentVNode as T, normalizeStyle as R, createVNode as H, withKeys as ve, Teleport as me, withDirectives as ge, withModifiers as be, withCtx as $, renderSlot as z, createTextVNode as J, unref as he, toDisplayString as Q, vShow as we, Fragment as ye, renderList as _e } from "vue";
|
|
2
|
+
import { ElMessage as X } from "element-plus";
|
|
3
3
|
import { u as ke } from "../index-CzamRrBC.mjs";
|
|
4
4
|
import { _ as Ve } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
5
5
|
const Ee = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "g-input-tree-tag__tags"
|
|
8
|
-
}, Fe = /* @__PURE__ */
|
|
8
|
+
}, Fe = /* @__PURE__ */ ie({
|
|
9
9
|
__name: "index",
|
|
10
10
|
props: {
|
|
11
11
|
modelValue: { default: () => [] },
|
|
@@ -33,242 +33,243 @@ const Ee = {
|
|
|
33
33
|
notFoundMessage: { default: "未找到匹配项" }
|
|
34
34
|
},
|
|
35
35
|
emits: ["update:modelValue", "change", "add", "remove", "node-click", "duplicate", "not-found"],
|
|
36
|
-
setup(
|
|
37
|
-
const
|
|
38
|
-
label:
|
|
39
|
-
children:
|
|
40
|
-
disabled:
|
|
41
|
-
})), te = d(() =>
|
|
36
|
+
setup(F, { expose: Y, emit: P }) {
|
|
37
|
+
const a = F, r = P, ee = d(() => ({
|
|
38
|
+
label: a.props.label || "label",
|
|
39
|
+
children: a.props.children || "children",
|
|
40
|
+
disabled: a.props.disabled
|
|
41
|
+
})), te = d(() => a.props.value || a.nodeKey || "id"), ae = d(() => a.props.label || "label"), le = d(() => a.props.children || "children"), B = d(() => a.props.isLeaf), h = (e) => e ? e[te.value] : void 0, f = (e) => e ? e[ae.value] : "", O = (e) => e ? e[le.value] : void 0, v = (e) => {
|
|
42
42
|
if (!e) return !1;
|
|
43
|
-
if (typeof
|
|
44
|
-
if (
|
|
45
|
-
const t =
|
|
43
|
+
if (typeof a.selectable == "function") return a.selectable(e);
|
|
44
|
+
if (B.value && e[B.value] !== void 0) return !!e[B.value];
|
|
45
|
+
const t = O(e);
|
|
46
46
|
return !t || !t.length;
|
|
47
|
-
},
|
|
48
|
-
const e = /* @__PURE__ */ new Map(), t = (
|
|
49
|
-
|
|
50
|
-
v(o) && e.set(
|
|
51
|
-
const
|
|
52
|
-
|
|
47
|
+
}, M = d(() => {
|
|
48
|
+
const e = /* @__PURE__ */ new Map(), t = (l = []) => {
|
|
49
|
+
l.forEach((o) => {
|
|
50
|
+
v(o) && e.set(h(o), o);
|
|
51
|
+
const s = O(o);
|
|
52
|
+
s?.length && t(s);
|
|
53
53
|
});
|
|
54
54
|
};
|
|
55
|
-
return t(
|
|
56
|
-
}),
|
|
57
|
-
const
|
|
55
|
+
return t(a.data || []), e;
|
|
56
|
+
}), p = d(() => (a.modelValue || []).map((t) => {
|
|
57
|
+
const l = a.valueFormat === "object" ? t?.value : t, o = M.value.get(l), s = a.valueFormat === "object" ? t?.label : void 0;
|
|
58
58
|
return {
|
|
59
|
-
value:
|
|
60
|
-
label: o ? f(o) :
|
|
59
|
+
value: l,
|
|
60
|
+
label: o ? f(o) : s ?? String(l ?? ""),
|
|
61
61
|
raw: o
|
|
62
62
|
};
|
|
63
|
-
})),
|
|
64
|
-
() => typeof
|
|
65
|
-
),
|
|
66
|
-
|
|
67
|
-
},
|
|
68
|
-
if (!
|
|
69
|
-
const e =
|
|
63
|
+
})), C = (e) => p.value.some((t) => t.value === e), w = i(""), u = i(!1), j = i(null), U = i(null), q = i(null), I = i(null), D = i({}), L = i("bottom"), oe = d(
|
|
64
|
+
() => typeof a.width == "number" ? `${a.width}px` : a.width
|
|
65
|
+
), x = () => {
|
|
66
|
+
a.disabled || (u.value = !0);
|
|
67
|
+
}, y = () => {
|
|
68
|
+
if (!u.value) return;
|
|
69
|
+
const e = q.value, t = I.value;
|
|
70
70
|
if (!e || !t) return;
|
|
71
|
-
const
|
|
72
|
-
let
|
|
73
|
-
g >= o +
|
|
71
|
+
const l = e.getBoundingClientRect(), o = t.offsetHeight || a.popperMaxHeight, g = window.innerHeight - l.bottom, n = l.top;
|
|
72
|
+
let b;
|
|
73
|
+
g >= o + a.popperOffset || g >= n ? (b = l.bottom + a.popperOffset, L.value = "bottom") : (b = l.top - o - a.popperOffset, L.value = "top"), D.value = {
|
|
74
74
|
position: "fixed",
|
|
75
|
-
top: `${
|
|
76
|
-
left: `${
|
|
77
|
-
width: `${
|
|
78
|
-
zIndex: String(
|
|
75
|
+
top: `${b}px`,
|
|
76
|
+
left: `${l.left}px`,
|
|
77
|
+
width: `${l.width}px`,
|
|
78
|
+
zIndex: String(a.popperZIndex)
|
|
79
79
|
};
|
|
80
80
|
};
|
|
81
81
|
let m = null;
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
m = null,
|
|
82
|
+
const _ = () => {
|
|
83
|
+
u.value && (m && cancelAnimationFrame(m), m = requestAnimationFrame(() => {
|
|
84
|
+
m = null, y();
|
|
85
85
|
}));
|
|
86
86
|
};
|
|
87
|
-
pe(
|
|
88
|
-
e && (await
|
|
87
|
+
pe(u, async (e) => {
|
|
88
|
+
e && (await W(), y(), requestAnimationFrame(y));
|
|
89
89
|
});
|
|
90
|
-
const
|
|
91
|
-
if (!
|
|
90
|
+
const Z = (e) => {
|
|
91
|
+
if (!u.value) return;
|
|
92
92
|
const t = e.target;
|
|
93
|
-
|
|
93
|
+
U.value?.contains(t) || I.value?.contains(t) || (u.value = !1);
|
|
94
94
|
};
|
|
95
95
|
ce(() => {
|
|
96
|
-
document.addEventListener("mousedown",
|
|
96
|
+
document.addEventListener("mousedown", Z, !0), window.addEventListener("scroll", _, !0), window.addEventListener("resize", _);
|
|
97
97
|
}), fe(() => {
|
|
98
|
-
document.removeEventListener("mousedown",
|
|
98
|
+
document.removeEventListener("mousedown", Z, !0), window.removeEventListener("scroll", _, !0), window.removeEventListener("resize", _), m && cancelAnimationFrame(m);
|
|
99
99
|
});
|
|
100
100
|
const ne = (e) => {
|
|
101
|
-
|
|
102
|
-
}, re = (e, t) => e ? typeof
|
|
103
|
-
r("node-click", e), v(e) && (
|
|
104
|
-
},
|
|
105
|
-
const t =
|
|
101
|
+
u.value = !0, j.value?.filter(e), W(y);
|
|
102
|
+
}, re = (e, t) => e ? typeof a.filterMethod == "function" ? a.filterMethod(e, t) : String(f(t) ?? "").toLowerCase().includes(String(e).toLowerCase()) : !0, ue = (e) => {
|
|
103
|
+
r("node-click", e), v(e) && (S(e), u.value = !1);
|
|
104
|
+
}, se = (e) => a.valueFormat === "object" ? { value: e.value, label: e.label, raw: e.raw } : e.value, S = (e) => {
|
|
105
|
+
const t = h(e);
|
|
106
106
|
if (t == null || t === "") return;
|
|
107
|
-
if (
|
|
108
|
-
const
|
|
109
|
-
r("duplicate",
|
|
107
|
+
if (C(t)) {
|
|
108
|
+
const s = { value: t, label: f(e), raw: e };
|
|
109
|
+
r("duplicate", s), a.duplicateMessage && X.warning(a.duplicateMessage);
|
|
110
110
|
return;
|
|
111
111
|
}
|
|
112
|
-
const
|
|
113
|
-
r("update:modelValue", o), r("add",
|
|
114
|
-
},
|
|
115
|
-
if (!
|
|
116
|
-
const e = (
|
|
112
|
+
const l = { value: t, label: f(e), raw: e }, o = [...a.modelValue || [], se(l)];
|
|
113
|
+
r("update:modelValue", o), r("add", l), r("change", o, [...p.value, l]), a.clearInputAfterSelect && (w.value = "");
|
|
114
|
+
}, de = () => {
|
|
115
|
+
if (!a.enterToAdd) return;
|
|
116
|
+
const e = (w.value || "").trim();
|
|
117
117
|
if (!e) return;
|
|
118
118
|
let t = null;
|
|
119
|
-
for (const
|
|
120
|
-
if (f(
|
|
121
|
-
t =
|
|
119
|
+
for (const l of M.value.values())
|
|
120
|
+
if (f(l) === e) {
|
|
121
|
+
t = l;
|
|
122
122
|
break;
|
|
123
123
|
}
|
|
124
124
|
if (!t) {
|
|
125
|
-
r("not-found", e),
|
|
125
|
+
r("not-found", e), a.notFoundMessage && X.warning(a.notFoundMessage);
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
|
-
|
|
129
|
-
},
|
|
130
|
-
const t =
|
|
131
|
-
|
|
132
|
-
const o =
|
|
133
|
-
r("change",
|
|
128
|
+
S(t);
|
|
129
|
+
}, G = (e) => {
|
|
130
|
+
const t = p.value[e], l = [...a.modelValue || []];
|
|
131
|
+
l.splice(e, 1), r("update:modelValue", l), t && r("remove", t, e);
|
|
132
|
+
const o = p.value.filter((s, g) => g !== e);
|
|
133
|
+
r("change", l, o);
|
|
134
134
|
};
|
|
135
|
-
return
|
|
135
|
+
return Y({
|
|
136
136
|
/** 主动打开下拉面板 */
|
|
137
|
-
open:
|
|
137
|
+
open: x,
|
|
138
138
|
/** 主动关闭下拉面板 */
|
|
139
|
-
close: () =>
|
|
139
|
+
close: () => u.value = !1,
|
|
140
140
|
/** 清空已选 */
|
|
141
141
|
clear: () => {
|
|
142
142
|
r("update:modelValue", []), r("change", [], []);
|
|
143
143
|
},
|
|
144
144
|
/** 根据 value 直接添加 */
|
|
145
145
|
addByValue: (e) => {
|
|
146
|
-
const t =
|
|
147
|
-
t &&
|
|
146
|
+
const t = M.value.get(e);
|
|
147
|
+
t && S(t);
|
|
148
148
|
}
|
|
149
149
|
}), (e, t) => {
|
|
150
|
-
const
|
|
151
|
-
return
|
|
150
|
+
const l = k("el-input"), o = k("el-icon"), s = k("el-tree"), g = k("el-tag");
|
|
151
|
+
return c(), V("div", {
|
|
152
152
|
class: A(["g-input-tree-tag", { "is-disabled": e.disabled }])
|
|
153
153
|
}, [
|
|
154
|
-
|
|
154
|
+
E("div", {
|
|
155
155
|
class: "g-input-tree-tag__wrap",
|
|
156
156
|
ref_key: "wrapRef",
|
|
157
|
-
ref:
|
|
157
|
+
ref: U
|
|
158
158
|
}, [
|
|
159
|
-
|
|
159
|
+
E("div", {
|
|
160
160
|
class: "g-input-tree-tag__input-box",
|
|
161
161
|
ref_key: "inputBoxRef",
|
|
162
|
-
ref:
|
|
163
|
-
style:
|
|
162
|
+
ref: q,
|
|
163
|
+
style: R({ width: oe.value })
|
|
164
164
|
}, [
|
|
165
|
-
|
|
166
|
-
modelValue:
|
|
167
|
-
"onUpdate:modelValue": t[0] || (t[0] = (n) =>
|
|
165
|
+
H(l, {
|
|
166
|
+
modelValue: w.value,
|
|
167
|
+
"onUpdate:modelValue": t[0] || (t[0] = (n) => w.value = n),
|
|
168
168
|
placeholder: e.placeholder,
|
|
169
169
|
clearable: e.clearable,
|
|
170
170
|
disabled: e.disabled,
|
|
171
171
|
class: "g-input-tree-tag__input",
|
|
172
|
-
onFocus:
|
|
173
|
-
onClick:
|
|
172
|
+
onFocus: x,
|
|
173
|
+
onClick: x,
|
|
174
174
|
onInput: ne,
|
|
175
|
-
onKeyup: ve(
|
|
175
|
+
onKeyup: ve(de, ["enter"])
|
|
176
176
|
}, null, 8, ["modelValue", "placeholder", "clearable", "disabled"])
|
|
177
177
|
], 4),
|
|
178
|
-
(
|
|
179
|
-
ge(
|
|
178
|
+
(c(), N(me, { to: "body" }, [
|
|
179
|
+
ge(E("div", {
|
|
180
180
|
ref_key: "popperRef",
|
|
181
|
-
ref:
|
|
182
|
-
class: A(["g-input-tree-tag__popover", `is-${
|
|
183
|
-
style:
|
|
181
|
+
ref: I,
|
|
182
|
+
class: A(["g-input-tree-tag__popover", `is-${L.value}`]),
|
|
183
|
+
style: R(D.value),
|
|
184
184
|
onMousedown: t[1] || (t[1] = be(() => {
|
|
185
185
|
}, ["prevent"]))
|
|
186
186
|
}, [
|
|
187
|
-
|
|
187
|
+
E("div", {
|
|
188
188
|
class: "g-input-tree-tag__tree-wrap",
|
|
189
|
-
style:
|
|
189
|
+
style: R({ maxHeight: e.popperMaxHeight + "px" })
|
|
190
190
|
}, [
|
|
191
|
-
|
|
191
|
+
H(s, {
|
|
192
192
|
ref_key: "treeRef",
|
|
193
|
-
ref:
|
|
193
|
+
ref: j,
|
|
194
194
|
data: e.data,
|
|
195
195
|
props: ee.value,
|
|
196
196
|
"node-key": e.nodeKey,
|
|
197
197
|
"filter-node-method": re,
|
|
198
198
|
"expand-on-click-node": !1,
|
|
199
199
|
"default-expand-all": e.defaultExpandAll,
|
|
200
|
-
onNodeClick:
|
|
200
|
+
onNodeClick: ue
|
|
201
201
|
}, {
|
|
202
|
-
default:
|
|
203
|
-
|
|
204
|
-
data: n,
|
|
205
|
-
node:
|
|
206
|
-
selectable: v(n),
|
|
207
|
-
selected:
|
|
202
|
+
default: $((n) => [
|
|
203
|
+
z(e.$slots, "tree-node", {
|
|
204
|
+
data: n?.data,
|
|
205
|
+
node: n?.node,
|
|
206
|
+
selectable: v(n?.data),
|
|
207
|
+
selected: C(h(n?.data))
|
|
208
208
|
}, () => [
|
|
209
|
-
|
|
209
|
+
n?.data ? (c(), V("span", {
|
|
210
|
+
key: 0,
|
|
210
211
|
class: A([
|
|
211
212
|
"g-input-tree-tag__node",
|
|
212
213
|
{
|
|
213
|
-
"is-selectable": v(n),
|
|
214
|
-
"is-selected": v(n) &&
|
|
214
|
+
"is-selectable": v(n.data),
|
|
215
|
+
"is-selected": v(n.data) && C(h(n.data))
|
|
215
216
|
}
|
|
216
217
|
])
|
|
217
218
|
}, [
|
|
218
|
-
v(n) && e.showLeafIcon ? (
|
|
219
|
+
v(n.data) && e.showLeafIcon ? (c(), N(o, {
|
|
219
220
|
key: 0,
|
|
220
221
|
class: "g-input-tree-tag__node-icon"
|
|
221
222
|
}, {
|
|
222
|
-
default:
|
|
223
|
-
|
|
223
|
+
default: $(() => [
|
|
224
|
+
H(he(ke))
|
|
224
225
|
]),
|
|
225
226
|
_: 1
|
|
226
|
-
})) :
|
|
227
|
-
|
|
228
|
-
], 2)
|
|
227
|
+
})) : T("", !0),
|
|
228
|
+
J(" " + Q(f(n.data)), 1)
|
|
229
|
+
], 2)) : T("", !0)
|
|
229
230
|
], !0)
|
|
230
231
|
]),
|
|
231
232
|
_: 3
|
|
232
233
|
}, 8, ["data", "props", "node-key", "default-expand-all"])
|
|
233
234
|
], 4)
|
|
234
235
|
], 38), [
|
|
235
|
-
[we,
|
|
236
|
+
[we, u.value]
|
|
236
237
|
])
|
|
237
238
|
])),
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
items:
|
|
241
|
-
remove:
|
|
239
|
+
p.value.length ? (c(), V("div", Ee, [
|
|
240
|
+
z(e.$slots, "tags", {
|
|
241
|
+
items: p.value,
|
|
242
|
+
remove: G
|
|
242
243
|
}, () => [
|
|
243
|
-
(
|
|
244
|
+
(c(!0), V(ye, null, _e(p.value, (n, b) => (c(), N(g, {
|
|
244
245
|
key: n.value,
|
|
245
246
|
class: "g-input-tree-tag__tag",
|
|
246
247
|
type: e.tagType,
|
|
247
248
|
effect: e.tagEffect,
|
|
248
249
|
closable: e.closable && !e.disabled,
|
|
249
|
-
onClose: (Be) =>
|
|
250
|
+
onClose: (Be) => G(b)
|
|
250
251
|
}, {
|
|
251
|
-
default:
|
|
252
|
-
|
|
252
|
+
default: $(() => [
|
|
253
|
+
z(e.$slots, "tag", {
|
|
253
254
|
item: n,
|
|
254
|
-
index:
|
|
255
|
+
index: b
|
|
255
256
|
}, () => [
|
|
256
|
-
|
|
257
|
+
J(Q(n.label), 1)
|
|
257
258
|
], !0)
|
|
258
259
|
]),
|
|
259
260
|
_: 2
|
|
260
261
|
}, 1032, ["type", "effect", "closable", "onClose"]))), 128))
|
|
261
262
|
], !0)
|
|
262
|
-
])) :
|
|
263
|
+
])) : T("", !0)
|
|
263
264
|
], 512)
|
|
264
265
|
], 2);
|
|
265
266
|
};
|
|
266
267
|
}
|
|
267
|
-
}),
|
|
268
|
-
|
|
269
|
-
|
|
268
|
+
}), K = /* @__PURE__ */ Ve(Fe, [["__scopeId", "data-v-d268bb6f"]]);
|
|
269
|
+
K.install = (F) => {
|
|
270
|
+
F.component(K.name, K);
|
|
270
271
|
};
|
|
271
272
|
export {
|
|
272
|
-
|
|
273
|
-
|
|
273
|
+
K as GInputTreeTag,
|
|
274
|
+
K as default
|
|
274
275
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.g-input-tree-tag[data-v-
|
|
1
|
+
@charset "UTF-8";.g-input-tree-tag[data-v-d268bb6f]{width:100%}.g-input-tree-tag__wrap[data-v-d268bb6f]{display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%}.g-input-tree-tag__tags[data-v-d268bb6f]{display:flex;flex-wrap:wrap;gap:8px;width:100%}.g-input-tree-tag__tag[data-v-d268bb6f]{margin:0}.g-input-tree-tag.is-disabled[data-v-d268bb6f]{cursor:not-allowed}.g-input-tree-tag__popover{box-sizing:border-box;background:var(--el-bg-color-overlay, #fff);border:1px solid var(--el-border-color-light);border-radius:4px;box-shadow:var(--el-box-shadow-light);padding:8px 0}.g-input-tree-tag__popover .g-input-tree-tag__tree-wrap{overflow:auto}.g-input-tree-tag__popover .g-input-tree-tag__node{display:inline-flex;align-items:center;gap:4px;font-size:13px}.g-input-tree-tag__popover .g-input-tree-tag__node-icon{font-size:14px;color:var(--el-text-color-secondary)}.g-input-tree-tag__popover .g-input-tree-tag__node.is-selectable{cursor:pointer;color:var(--el-text-color-primary)}.g-input-tree-tag__popover .g-input-tree-tag__node.is-selected,.g-input-tree-tag__popover .g-input-tree-tag__node.is-selected .g-input-tree-tag__node-icon{color:var(--el-color-primary)}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
interface TreeFieldProps {
|
|
2
|
+
label?: string;
|
|
3
|
+
children?: string;
|
|
4
|
+
value?: string;
|
|
5
|
+
isLeaf?: string;
|
|
5
6
|
disabled?: string;
|
|
6
7
|
}
|
|
7
8
|
interface SelectedItem {
|
|
@@ -1,55 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* @description 设计稿宽度
|
|
5
|
-
* @version 0.1.8
|
|
6
|
-
* @default 1920
|
|
7
|
-
*/
|
|
8
|
-
width?: number;
|
|
9
|
-
/**
|
|
10
|
-
* @description 设计稿高度
|
|
11
|
-
* @version 0.1.8
|
|
12
|
-
* @default 1080
|
|
13
|
-
*/
|
|
14
|
-
height?: number;
|
|
15
|
-
/**
|
|
16
|
-
* @description 防抖延迟时间(ms),设为 0 则关闭防抖
|
|
17
|
-
* @version 0.1.8
|
|
18
|
-
* @default 166
|
|
19
|
-
*/
|
|
20
|
-
debounceDelay?: number;
|
|
21
|
-
}
|
|
22
|
-
declare function __VLS_template(): {
|
|
23
|
-
attrs: Partial<{}>;
|
|
24
|
-
slots: {
|
|
25
|
-
default?(_: {}): any;
|
|
26
|
-
};
|
|
27
|
-
refs: {};
|
|
28
|
-
rootEl: any;
|
|
29
|
-
};
|
|
30
|
-
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
31
|
-
declare const __VLS_component: import('vue').DefineComponent<Props, {
|
|
32
|
-
scale: Ref<{
|
|
33
|
-
x: number;
|
|
34
|
-
y: number;
|
|
35
|
-
}, {
|
|
36
|
-
x: number;
|
|
37
|
-
y: number;
|
|
38
|
-
} | {
|
|
39
|
-
x: number;
|
|
40
|
-
y: number;
|
|
41
|
-
}>;
|
|
42
|
-
safeScaleX: import('vue').ComputedRef<number>;
|
|
43
|
-
yScaleRatio: import('vue').ComputedRef<number>;
|
|
44
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
45
|
-
width: number;
|
|
46
|
-
height: number;
|
|
47
|
-
debounceDelay: number;
|
|
48
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
49
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
50
|
-
export default _default;
|
|
51
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
52
|
-
new (): {
|
|
53
|
-
$slots: S;
|
|
54
|
-
};
|
|
55
|
-
};
|
|
1
|
+
import { default as GScreen } from './index';
|
|
2
|
+
export default GScreen;
|
|
3
|
+
export { GScreen };
|