geekin-devtoys 0.2.21 → 0.2.22
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/lib/GInputTreeTag/index.js +1 -1
- package/lib/GInputTreeTag/index.mjs +191 -194
- package/lib/GInputTreeTag/style.css +1 -1
- package/lib/components/GDialog/index.d.ts +8 -24
- package/lib/components/GInputTreeTag/index.d.ts +2012 -2
- package/lib/components/GScreen/index.d.ts +55 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),f=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(y,{expose:H,emit:R}){const o=y,r=R,z=t.computed(()=>({label:o.props.label||"label",children:o.props.children||"children",disabled:o.props.disabled})),$=t.computed(()=>o.props.value||o.nodeKey||"id"),q=t.computed(()=>o.props.label||"label"),O=t.computed(()=>o.props.children||"children"),k=t.computed(()=>o.props.isLeaf),m=e=>e?e[$.value]:void 0,i=e=>e?e[q.value]:"",N=e=>e?e[O.value]:void 0,c=e=>{if(!e)return!1;if(typeof o.selectable=="function")return o.selectable(e);if(k.value&&e[k.value]!==void 0)return!!e[k.value];const l=N(e);return!l||!l.length},E=t.computed(()=>{const e=new Map,l=(a=[])=>{a.forEach(n=>{c(n)&&e.set(m(n),n);const d=N(n);d?.length&&l(d)})};return l(o.data||[]),e}),s=t.computed(()=>(o.modelValue||[]).map(l=>{const a=o.valueFormat==="object"?l?.value:l,n=E.value.get(a),d=o.valueFormat==="object"?l?.label:void 0;return{value:a,label:n?i(n):d??String(a??""),raw:n}})),B=e=>s.value.some(l=>l.value===e),g=t.ref(""),u=t.ref(!1),x=t.ref(null),F=t.ref(null),I=t.ref(null),V=t.ref(null),T=t.ref({}),_=t.ref("bottom"),K=t.computed(()=>typeof o.width=="number"?`${o.width}px`:o.width),C=()=>{o.disabled||(u.value=!0)},b=()=>{if(!u.value)return;const e=I.value,l=V.value;if(!e||!l)return;const a=e.getBoundingClientRect(),n=l.offsetHeight||o.popperMaxHeight,w=window.innerHeight-a.bottom,W=a.top;let S;w>=n+o.popperOffset||w>=W?(S=a.bottom+o.popperOffset,_.value="bottom"):(S=a.top-n-o.popperOffset,_.value="top"),T.value={position:"fixed",top:`${S}px`,left:`${a.left}px`,width:`${a.width}px`,zIndex:String(o.popperZIndex)}};let p=null;const h=()=>{u.value&&(p&&cancelAnimationFrame(p),p=requestAnimationFrame(()=>{p=null,b()}))};t.watch(u,async e=>{e&&(await t.nextTick(),b(),requestAnimationFrame(b))});const L=e=>{if(!u.value)return;const l=e.target;F.value?.contains(l)||V.value?.contains(l)||(u.value=!1)};t.onMounted(()=>{document.addEventListener("mousedown",L,!0),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h)}),t.onBeforeUnmount(()=>{document.removeEventListener("mousedown",L,!0),window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h),p&&cancelAnimationFrame(p)});const j=e=>{u.value=!0,x.value?.filter(e),t.nextTick(b)},D=(e,l)=>e?typeof o.filterMethod=="function"?o.filterMethod(e,l):String(i(l)??"").toLowerCase().includes(String(e).toLowerCase()):!0,U=e=>{r("node-click",e),c(e)&&(M(e),u.value=!1)},G=e=>o.valueFormat==="object"?{value:e.value,label:e.label,raw:e.raw}:e.value,M=e=>{const l=m(e);if(l==null||l==="")return;if(B(l)){const d={value:l,label:i(e),raw:e};r("duplicate",d),o.duplicateMessage&&f.ElMessage.warning(o.duplicateMessage);return}const a={value:l,label:i(e),raw:e},n=[...o.modelValue||[],G(a)];r("update:modelValue",n),r("add",a),r("change",n,[...s.value,a]),o.clearInputAfterSelect&&(g.value="")},Z=()=>{if(!o.enterToAdd)return;const e=(g.value||"").trim();if(!e)return;let l=null;for(const a of E.value.values())if(i(a)===e){l=a;break}if(!l){r("not-found",e),o.notFoundMessage&&f.ElMessage.warning(o.notFoundMessage);return}M(l)},A=e=>{const l=s.value[e],a=[...o.modelValue||[]];a.splice(e,1),r("update:modelValue",a),l&&r("remove",l,e);const n=s.value.filter((d,w)=>w!==e);r("change",a,n)};return H({open:C,close:()=>u.value=!1,clear:()=>{r("update:modelValue",[]),r("change",[],[])},addByValue:e=>{const l=E.value.get(e);l&&M(l)}}),(e,l)=>(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:K.value})},[t.createVNode(t.unref(f.ElInput),{modelValue:g.value,"onUpdate:modelValue":l[0]||(l[0]=a=>g.value=a),placeholder:e.placeholder,clearable:e.clearable,disabled:e.disabled,class:"g-input-tree-tag__input",onFocus:C,onClick:C,onInput:j,onKeyup:t.withKeys(Z,["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:V,class:t.normalizeClass(["g-input-tree-tag__popover",`is-${_.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(t.unref(f.ElTree),{ref_key:"treeRef",ref:x,data:e.data,props:z.value,"node-key":e.nodeKey,"filter-node-method":D,"expand-on-click-node":!1,"default-expand-all":e.defaultExpandAll,onNodeClick:U},{default:t.withCtx(a=>[t.renderSlot(e.$slots,"tree-node",{data:a?.data,node:a?.node,selectable:c(a?.data),selected:B(m(a?.data))},()=>[a?.data?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(["g-input-tree-tag__node",{"is-selectable":c(a.data),"is-selected":c(a.data)&&B(m(a.data))}])},[c(a.data)&&e.showLeafIcon?(t.openBlock(),t.createBlock(t.unref(f.ElIcon),{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(i(a.data)),1)],2)):t.createCommentVNode("",!0)],!0)]),_:3},8,["data","props","node-key","default-expand-all"])],4)],38),[[t.vShow,u.value]])])),s.value.length?(t.openBlock(),t.createElementBlock("div",X,[t.renderSlot(e.$slots,"tags",{items:s.value,remove:A},()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.value,(a,n)=>(t.openBlock(),t.createBlock(t.unref(f.ElTag),{key:a.value,class:"g-input-tree-tag__tag",type:e.tagType,effect:e.tagEffect,closable:e.closable&&!e.disabled,onClose:d=>A(n)},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"tag",{item:a,index:n},()=>[t.createTextVNode(t.toDisplayString(a.label),1)],!0)]),_:2},1032,["type","effect","closable","onClose"]))),128))],!0)])):t.createCommentVNode("",!0)],512)],2))}}),v=Q._export_sfc(Y,[["__scopeId","data-v-6f1283aa"]]);v.install=y=>{y.component(v.name,v)};exports.GInputTreeTag=v;exports.default=v;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as ie, computed as d, ref as
|
|
2
|
-
import { ElMessage as
|
|
3
|
-
import { u as
|
|
4
|
-
import { _ as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as ie, computed as d, ref as s, watch as pe, nextTick as G, onMounted as ce, onBeforeUnmount as fe, createElementBlock as k, openBlock as p, normalizeClass as S, createElementVNode as E, createBlock as T, createCommentVNode as A, normalizeStyle as N, createVNode as R, unref as m, withKeys as ve, Teleport as me, withDirectives as ge, withModifiers as be, withCtx as H, renderSlot as $, createTextVNode as W, toDisplayString as J, vShow as he, Fragment as we, renderList as ye } from "vue";
|
|
2
|
+
import { ElInput as ke, ElTree as Ee, ElIcon as _e, ElTag as Ve, ElMessage as Q } from "element-plus";
|
|
3
|
+
import { u as Fe } from "../index-CzamRrBC.mjs";
|
|
4
|
+
import { _ as Be } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
5
|
+
const Ie = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "g-input-tree-tag__tags"
|
|
8
|
-
},
|
|
8
|
+
}, Me = /* @__PURE__ */ ie({
|
|
9
9
|
__name: "index",
|
|
10
10
|
props: {
|
|
11
11
|
modelValue: { default: () => [] },
|
|
@@ -33,243 +33,240 @@ 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
|
-
})),
|
|
36
|
+
setup(_, { expose: X, emit: Y }) {
|
|
37
|
+
const l = _, n = Y, P = d(() => ({
|
|
38
|
+
label: l.props.label || "label",
|
|
39
|
+
children: l.props.children || "children",
|
|
40
|
+
disabled: l.props.disabled
|
|
41
|
+
})), ee = d(() => l.props.value || l.nodeKey || "id"), te = d(() => l.props.label || "label"), ae = d(() => l.props.children || "children"), V = d(() => l.props.isLeaf), g = (e) => e ? e[ee.value] : void 0, c = (e) => e ? e[te.value] : "", K = (e) => e ? e[ae.value] : void 0, f = (e) => {
|
|
42
42
|
if (!e) return !1;
|
|
43
|
-
if (typeof
|
|
44
|
-
if (
|
|
45
|
-
const t =
|
|
43
|
+
if (typeof l.selectable == "function") return l.selectable(e);
|
|
44
|
+
if (V.value && e[V.value] !== void 0) return !!e[V.value];
|
|
45
|
+
const t = K(e);
|
|
46
46
|
return !t || !t.length;
|
|
47
|
-
},
|
|
48
|
-
const e = /* @__PURE__ */ new Map(), t = (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
|
|
47
|
+
}, F = d(() => {
|
|
48
|
+
const e = /* @__PURE__ */ new Map(), t = (a = []) => {
|
|
49
|
+
a.forEach((o) => {
|
|
50
|
+
f(o) && e.set(g(o), o);
|
|
51
|
+
const u = K(o);
|
|
52
|
+
u?.length && t(u);
|
|
53
53
|
});
|
|
54
54
|
};
|
|
55
|
-
return t(
|
|
56
|
-
}),
|
|
57
|
-
const
|
|
55
|
+
return t(l.data || []), e;
|
|
56
|
+
}), i = d(() => (l.modelValue || []).map((t) => {
|
|
57
|
+
const a = l.valueFormat === "object" ? t?.value : t, o = F.value.get(a), u = l.valueFormat === "object" ? t?.label : void 0;
|
|
58
58
|
return {
|
|
59
|
-
value:
|
|
60
|
-
label: o ?
|
|
59
|
+
value: a,
|
|
60
|
+
label: o ? c(o) : u ?? String(a ?? ""),
|
|
61
61
|
raw: o
|
|
62
62
|
};
|
|
63
|
-
})),
|
|
64
|
-
() => typeof
|
|
65
|
-
),
|
|
66
|
-
|
|
67
|
-
},
|
|
68
|
-
if (!
|
|
69
|
-
const e =
|
|
63
|
+
})), B = (e) => i.value.some((t) => t.value === e), b = s(""), r = s(!1), O = s(null), j = s(null), U = s(null), I = s(null), q = s({}), M = s("bottom"), le = d(
|
|
64
|
+
() => typeof l.width == "number" ? `${l.width}px` : l.width
|
|
65
|
+
), L = () => {
|
|
66
|
+
l.disabled || (r.value = !0);
|
|
67
|
+
}, h = () => {
|
|
68
|
+
if (!r.value) return;
|
|
69
|
+
const e = U.value, t = I.value;
|
|
70
70
|
if (!e || !t) return;
|
|
71
|
-
const
|
|
72
|
-
let
|
|
73
|
-
|
|
71
|
+
const a = e.getBoundingClientRect(), o = t.offsetHeight || l.popperMaxHeight, y = window.innerHeight - a.bottom, se = a.top;
|
|
72
|
+
let x;
|
|
73
|
+
y >= o + l.popperOffset || y >= se ? (x = a.bottom + l.popperOffset, M.value = "bottom") : (x = a.top - o - l.popperOffset, M.value = "top"), q.value = {
|
|
74
74
|
position: "fixed",
|
|
75
|
-
top: `${
|
|
76
|
-
left: `${
|
|
77
|
-
width: `${
|
|
78
|
-
zIndex: String(
|
|
75
|
+
top: `${x}px`,
|
|
76
|
+
left: `${a.left}px`,
|
|
77
|
+
width: `${a.width}px`,
|
|
78
|
+
zIndex: String(l.popperZIndex)
|
|
79
79
|
};
|
|
80
80
|
};
|
|
81
|
-
let
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
let v = null;
|
|
82
|
+
const w = () => {
|
|
83
|
+
r.value && (v && cancelAnimationFrame(v), v = requestAnimationFrame(() => {
|
|
84
|
+
v = null, h();
|
|
85
85
|
}));
|
|
86
86
|
};
|
|
87
|
-
pe(
|
|
88
|
-
e && (await
|
|
87
|
+
pe(r, async (e) => {
|
|
88
|
+
e && (await G(), h(), requestAnimationFrame(h));
|
|
89
89
|
});
|
|
90
|
-
const
|
|
91
|
-
if (!
|
|
90
|
+
const D = (e) => {
|
|
91
|
+
if (!r.value) return;
|
|
92
92
|
const t = e.target;
|
|
93
|
-
|
|
93
|
+
j.value?.contains(t) || I.value?.contains(t) || (r.value = !1);
|
|
94
94
|
};
|
|
95
95
|
ce(() => {
|
|
96
|
-
document.addEventListener("mousedown",
|
|
96
|
+
document.addEventListener("mousedown", D, !0), window.addEventListener("scroll", w, !0), window.addEventListener("resize", w);
|
|
97
97
|
}), fe(() => {
|
|
98
|
-
document.removeEventListener("mousedown",
|
|
98
|
+
document.removeEventListener("mousedown", D, !0), window.removeEventListener("scroll", w, !0), window.removeEventListener("resize", w), v && cancelAnimationFrame(v);
|
|
99
99
|
});
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
},
|
|
105
|
-
const t =
|
|
100
|
+
const oe = (e) => {
|
|
101
|
+
r.value = !0, O.value?.filter(e), G(h);
|
|
102
|
+
}, ne = (e, t) => e ? typeof l.filterMethod == "function" ? l.filterMethod(e, t) : String(c(t) ?? "").toLowerCase().includes(String(e).toLowerCase()) : !0, re = (e) => {
|
|
103
|
+
n("node-click", e), f(e) && (C(e), r.value = !1);
|
|
104
|
+
}, ue = (e) => l.valueFormat === "object" ? { value: e.value, label: e.label, raw: e.raw } : e.value, C = (e) => {
|
|
105
|
+
const t = g(e);
|
|
106
106
|
if (t == null || t === "") return;
|
|
107
|
-
if (
|
|
108
|
-
const
|
|
109
|
-
|
|
107
|
+
if (B(t)) {
|
|
108
|
+
const u = { value: t, label: c(e), raw: e };
|
|
109
|
+
n("duplicate", u), l.duplicateMessage && Q.warning(l.duplicateMessage);
|
|
110
110
|
return;
|
|
111
111
|
}
|
|
112
|
-
const
|
|
113
|
-
|
|
112
|
+
const a = { value: t, label: c(e), raw: e }, o = [...l.modelValue || [], ue(a)];
|
|
113
|
+
n("update:modelValue", o), n("add", a), n("change", o, [...i.value, a]), l.clearInputAfterSelect && (b.value = "");
|
|
114
114
|
}, de = () => {
|
|
115
|
-
if (!
|
|
116
|
-
const e = (
|
|
115
|
+
if (!l.enterToAdd) return;
|
|
116
|
+
const e = (b.value || "").trim();
|
|
117
117
|
if (!e) return;
|
|
118
118
|
let t = null;
|
|
119
|
-
for (const
|
|
120
|
-
if (
|
|
121
|
-
t =
|
|
119
|
+
for (const a of F.value.values())
|
|
120
|
+
if (c(a) === e) {
|
|
121
|
+
t = a;
|
|
122
122
|
break;
|
|
123
123
|
}
|
|
124
124
|
if (!t) {
|
|
125
|
-
|
|
125
|
+
n("not-found", e), l.notFoundMessage && Q.warning(l.notFoundMessage);
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
|
-
|
|
129
|
-
},
|
|
130
|
-
const t =
|
|
131
|
-
|
|
132
|
-
const o =
|
|
133
|
-
|
|
128
|
+
C(t);
|
|
129
|
+
}, Z = (e) => {
|
|
130
|
+
const t = i.value[e], a = [...l.modelValue || []];
|
|
131
|
+
a.splice(e, 1), n("update:modelValue", a), t && n("remove", t, e);
|
|
132
|
+
const o = i.value.filter((u, y) => y !== e);
|
|
133
|
+
n("change", a, o);
|
|
134
134
|
};
|
|
135
|
-
return
|
|
135
|
+
return X({
|
|
136
136
|
/** 主动打开下拉面板 */
|
|
137
|
-
open:
|
|
137
|
+
open: L,
|
|
138
138
|
/** 主动关闭下拉面板 */
|
|
139
|
-
close: () =>
|
|
139
|
+
close: () => r.value = !1,
|
|
140
140
|
/** 清空已选 */
|
|
141
141
|
clear: () => {
|
|
142
|
-
|
|
142
|
+
n("update:modelValue", []), n("change", [], []);
|
|
143
143
|
},
|
|
144
144
|
/** 根据 value 直接添加 */
|
|
145
145
|
addByValue: (e) => {
|
|
146
|
-
const t =
|
|
147
|
-
t &&
|
|
146
|
+
const t = F.value.get(e);
|
|
147
|
+
t && C(t);
|
|
148
148
|
}
|
|
149
|
-
}), (e, t) => {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
149
|
+
}), (e, t) => (p(), k("div", {
|
|
150
|
+
class: S(["g-input-tree-tag", { "is-disabled": e.disabled }])
|
|
151
|
+
}, [
|
|
152
|
+
E("div", {
|
|
153
|
+
class: "g-input-tree-tag__wrap",
|
|
154
|
+
ref_key: "wrapRef",
|
|
155
|
+
ref: j
|
|
153
156
|
}, [
|
|
154
157
|
E("div", {
|
|
155
|
-
class: "g-input-tree-
|
|
156
|
-
ref_key: "
|
|
157
|
-
ref: U
|
|
158
|
+
class: "g-input-tree-tag__input-box",
|
|
159
|
+
ref_key: "inputBoxRef",
|
|
160
|
+
ref: U,
|
|
161
|
+
style: N({ width: le.value })
|
|
158
162
|
}, [
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
163
|
+
R(m(ke), {
|
|
164
|
+
modelValue: b.value,
|
|
165
|
+
"onUpdate:modelValue": t[0] || (t[0] = (a) => b.value = a),
|
|
166
|
+
placeholder: e.placeholder,
|
|
167
|
+
clearable: e.clearable,
|
|
168
|
+
disabled: e.disabled,
|
|
169
|
+
class: "g-input-tree-tag__input",
|
|
170
|
+
onFocus: L,
|
|
171
|
+
onClick: L,
|
|
172
|
+
onInput: oe,
|
|
173
|
+
onKeyup: ve(de, ["enter"])
|
|
174
|
+
}, null, 8, ["modelValue", "placeholder", "clearable", "disabled"])
|
|
175
|
+
], 4),
|
|
176
|
+
(p(), T(me, { to: "body" }, [
|
|
177
|
+
ge(E("div", {
|
|
178
|
+
ref_key: "popperRef",
|
|
179
|
+
ref: I,
|
|
180
|
+
class: S(["g-input-tree-tag__popover", `is-${M.value}`]),
|
|
181
|
+
style: N(q.value),
|
|
182
|
+
onMousedown: t[1] || (t[1] = be(() => {
|
|
183
|
+
}, ["prevent"]))
|
|
164
184
|
}, [
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
placeholder: e.placeholder,
|
|
169
|
-
clearable: e.clearable,
|
|
170
|
-
disabled: e.disabled,
|
|
171
|
-
class: "g-input-tree-tag__input",
|
|
172
|
-
onFocus: x,
|
|
173
|
-
onClick: x,
|
|
174
|
-
onInput: ne,
|
|
175
|
-
onKeyup: ve(de, ["enter"])
|
|
176
|
-
}, null, 8, ["modelValue", "placeholder", "clearable", "disabled"])
|
|
177
|
-
], 4),
|
|
178
|
-
(c(), N(me, { to: "body" }, [
|
|
179
|
-
ge(E("div", {
|
|
180
|
-
ref_key: "popperRef",
|
|
181
|
-
ref: I,
|
|
182
|
-
class: A(["g-input-tree-tag__popover", `is-${L.value}`]),
|
|
183
|
-
style: R(D.value),
|
|
184
|
-
onMousedown: t[1] || (t[1] = be(() => {
|
|
185
|
-
}, ["prevent"]))
|
|
185
|
+
E("div", {
|
|
186
|
+
class: "g-input-tree-tag__tree-wrap",
|
|
187
|
+
style: N({ maxHeight: e.popperMaxHeight + "px" })
|
|
186
188
|
}, [
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
"filter-node-method": re,
|
|
198
|
-
"expand-on-click-node": !1,
|
|
199
|
-
"default-expand-all": e.defaultExpandAll,
|
|
200
|
-
onNodeClick: ue
|
|
201
|
-
}, {
|
|
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
|
-
}, () => [
|
|
209
|
-
n?.data ? (c(), V("span", {
|
|
210
|
-
key: 0,
|
|
211
|
-
class: A([
|
|
212
|
-
"g-input-tree-tag__node",
|
|
213
|
-
{
|
|
214
|
-
"is-selectable": v(n.data),
|
|
215
|
-
"is-selected": v(n.data) && C(h(n.data))
|
|
216
|
-
}
|
|
217
|
-
])
|
|
218
|
-
}, [
|
|
219
|
-
v(n.data) && e.showLeafIcon ? (c(), N(o, {
|
|
220
|
-
key: 0,
|
|
221
|
-
class: "g-input-tree-tag__node-icon"
|
|
222
|
-
}, {
|
|
223
|
-
default: $(() => [
|
|
224
|
-
H(he(ke))
|
|
225
|
-
]),
|
|
226
|
-
_: 1
|
|
227
|
-
})) : T("", !0),
|
|
228
|
-
J(" " + Q(f(n.data)), 1)
|
|
229
|
-
], 2)) : T("", !0)
|
|
230
|
-
], !0)
|
|
231
|
-
]),
|
|
232
|
-
_: 3
|
|
233
|
-
}, 8, ["data", "props", "node-key", "default-expand-all"])
|
|
234
|
-
], 4)
|
|
235
|
-
], 38), [
|
|
236
|
-
[we, u.value]
|
|
237
|
-
])
|
|
238
|
-
])),
|
|
239
|
-
p.value.length ? (c(), V("div", Ee, [
|
|
240
|
-
z(e.$slots, "tags", {
|
|
241
|
-
items: p.value,
|
|
242
|
-
remove: G
|
|
243
|
-
}, () => [
|
|
244
|
-
(c(!0), V(ye, null, _e(p.value, (n, b) => (c(), N(g, {
|
|
245
|
-
key: n.value,
|
|
246
|
-
class: "g-input-tree-tag__tag",
|
|
247
|
-
type: e.tagType,
|
|
248
|
-
effect: e.tagEffect,
|
|
249
|
-
closable: e.closable && !e.disabled,
|
|
250
|
-
onClose: (Be) => G(b)
|
|
189
|
+
R(m(Ee), {
|
|
190
|
+
ref_key: "treeRef",
|
|
191
|
+
ref: O,
|
|
192
|
+
data: e.data,
|
|
193
|
+
props: P.value,
|
|
194
|
+
"node-key": e.nodeKey,
|
|
195
|
+
"filter-node-method": ne,
|
|
196
|
+
"expand-on-click-node": !1,
|
|
197
|
+
"default-expand-all": e.defaultExpandAll,
|
|
198
|
+
onNodeClick: re
|
|
251
199
|
}, {
|
|
252
|
-
default:
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
200
|
+
default: H((a) => [
|
|
201
|
+
$(e.$slots, "tree-node", {
|
|
202
|
+
data: a?.data,
|
|
203
|
+
node: a?.node,
|
|
204
|
+
selectable: f(a?.data),
|
|
205
|
+
selected: B(g(a?.data))
|
|
256
206
|
}, () => [
|
|
257
|
-
|
|
207
|
+
a?.data ? (p(), k("span", {
|
|
208
|
+
key: 0,
|
|
209
|
+
class: S([
|
|
210
|
+
"g-input-tree-tag__node",
|
|
211
|
+
{
|
|
212
|
+
"is-selectable": f(a.data),
|
|
213
|
+
"is-selected": f(a.data) && B(g(a.data))
|
|
214
|
+
}
|
|
215
|
+
])
|
|
216
|
+
}, [
|
|
217
|
+
f(a.data) && e.showLeafIcon ? (p(), T(m(_e), {
|
|
218
|
+
key: 0,
|
|
219
|
+
class: "g-input-tree-tag__node-icon"
|
|
220
|
+
}, {
|
|
221
|
+
default: H(() => [
|
|
222
|
+
R(m(Fe))
|
|
223
|
+
]),
|
|
224
|
+
_: 1
|
|
225
|
+
})) : A("", !0),
|
|
226
|
+
W(" " + J(c(a.data)), 1)
|
|
227
|
+
], 2)) : A("", !0)
|
|
258
228
|
], !0)
|
|
259
229
|
]),
|
|
260
|
-
_:
|
|
261
|
-
},
|
|
262
|
-
],
|
|
263
|
-
])
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
230
|
+
_: 3
|
|
231
|
+
}, 8, ["data", "props", "node-key", "default-expand-all"])
|
|
232
|
+
], 4)
|
|
233
|
+
], 38), [
|
|
234
|
+
[he, r.value]
|
|
235
|
+
])
|
|
236
|
+
])),
|
|
237
|
+
i.value.length ? (p(), k("div", Ie, [
|
|
238
|
+
$(e.$slots, "tags", {
|
|
239
|
+
items: i.value,
|
|
240
|
+
remove: Z
|
|
241
|
+
}, () => [
|
|
242
|
+
(p(!0), k(we, null, ye(i.value, (a, o) => (p(), T(m(Ve), {
|
|
243
|
+
key: a.value,
|
|
244
|
+
class: "g-input-tree-tag__tag",
|
|
245
|
+
type: e.tagType,
|
|
246
|
+
effect: e.tagEffect,
|
|
247
|
+
closable: e.closable && !e.disabled,
|
|
248
|
+
onClose: (u) => Z(o)
|
|
249
|
+
}, {
|
|
250
|
+
default: H(() => [
|
|
251
|
+
$(e.$slots, "tag", {
|
|
252
|
+
item: a,
|
|
253
|
+
index: o
|
|
254
|
+
}, () => [
|
|
255
|
+
W(J(a.label), 1)
|
|
256
|
+
], !0)
|
|
257
|
+
]),
|
|
258
|
+
_: 2
|
|
259
|
+
}, 1032, ["type", "effect", "closable", "onClose"]))), 128))
|
|
260
|
+
], !0)
|
|
261
|
+
])) : A("", !0)
|
|
262
|
+
], 512)
|
|
263
|
+
], 2));
|
|
267
264
|
}
|
|
268
|
-
}),
|
|
269
|
-
|
|
270
|
-
|
|
265
|
+
}), z = /* @__PURE__ */ Be(Me, [["__scopeId", "data-v-6f1283aa"]]);
|
|
266
|
+
z.install = (_) => {
|
|
267
|
+
_.component(z.name, z);
|
|
271
268
|
};
|
|
272
269
|
export {
|
|
273
|
-
|
|
274
|
-
|
|
270
|
+
z as GInputTreeTag,
|
|
271
|
+
z as default
|
|
275
272
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.g-input-tree-tag[data-v-
|
|
1
|
+
@charset "UTF-8";.g-input-tree-tag[data-v-6f1283aa]{width:100%}.g-input-tree-tag__wrap[data-v-6f1283aa]{display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%}.g-input-tree-tag__tags[data-v-6f1283aa]{display:flex;flex-wrap:wrap;gap:8px;width:100%}.g-input-tree-tag__tag[data-v-6f1283aa]{margin:0}.g-input-tree-tag.is-disabled[data-v-6f1283aa]{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,27 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @description 对话框尺寸
|
|
11
|
-
* @version 0.1.6
|
|
12
|
-
* @default 'medium'
|
|
13
|
-
*/
|
|
14
|
-
size?: 'small' | 'medium' | 'large' | string;
|
|
15
|
-
/**
|
|
16
|
-
* @description 是否显示对话框
|
|
17
|
-
* @version 0.1.6
|
|
18
|
-
* @default false
|
|
19
|
-
*/
|
|
20
|
-
modelValue?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* @description 是否隐藏底部操作区(包含取消/重置/保存与自定义 actions)
|
|
23
|
-
* @version 0.2.18
|
|
24
|
-
* @default false
|
|
1
|
+
import { default as GDialog } from './index';
|
|
2
|
+
import { default as GDialogMinimizedIcon } from './GDialogMinimizedIcon';
|
|
3
|
+
import { createDialogManager, useDialogManager, DialogDescriptor, DialogManager, DialogPosition } from './useDialogManager';
|
|
4
|
+
import { DIALOG_MANAGER_KEY, DIALOG_SIZES, MINIMIZED_LAYOUT, DialogCloseAction, FooterAction } from './const';
|
|
5
|
+
export default GDialog;
|
|
6
|
+
export { GDialog, GDialogMinimizedIcon, createDialogManager, useDialogManager, DIALOG_MANAGER_KEY, DIALOG_SIZES, MINIMIZED_LAYOUT, };
|
|
7
|
+
export type { DialogDescriptor, DialogManager, DialogPosition, DialogCloseAction, FooterAction };
|
|
8
|
+
|
|
25
9
|
*/
|
|
26
10
|
hideFooter?: boolean;
|
|
27
11
|
/**
|