huiyi-select-table 0.1.21 → 0.1.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/huiyi-select-table-0.1.22.tgz +0 -0
- package/huiyi-select-table.mjs +118 -118
- package/huiyi-select-table.umd.js +1 -1
- package/package.json +1 -1
- package/style.css +1 -1
- package/huiyi-select-table-0.1.21.tgz +0 -0
|
Binary file
|
package/huiyi-select-table.mjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as K, openBlock as h, createElementBlock as V, createElementVNode as B, ref as i, watch as ee, onMounted as F, nextTick as g, computed as ne, onUnmounted as le, resolveComponent as R, createVNode as T, unref as y, isRef as te, withCtx as L, normalizeClass as oe, createBlock as E, Teleport as N, normalizeStyle as ae, Fragment as re, renderList as ue, createCommentVNode as q } from "vue";
|
|
2
2
|
/*! Element Plus Icons Vue v2.3.2 */
|
|
3
|
-
var
|
|
3
|
+
var se = /* @__PURE__ */ K({
|
|
4
4
|
name: "ArrowDown",
|
|
5
5
|
__name: "arrow-down",
|
|
6
6
|
setup(u) {
|
|
7
|
-
return (f, _) => (
|
|
7
|
+
return (f, _) => (h(), V("svg", {
|
|
8
8
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9
9
|
viewBox: "0 0 1024 1024"
|
|
10
10
|
}, [
|
|
11
|
-
|
|
11
|
+
B("path", {
|
|
12
12
|
fill: "currentColor",
|
|
13
13
|
d: "M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.59 30.59 0 0 0-42.752 0z"
|
|
14
14
|
})
|
|
15
15
|
]));
|
|
16
16
|
}
|
|
17
|
-
}),
|
|
18
|
-
const
|
|
17
|
+
}), ce = se;
|
|
18
|
+
const ie = /* @__PURE__ */ K({
|
|
19
19
|
name: "InputSelectCompont",
|
|
20
20
|
__name: "SelectTable",
|
|
21
21
|
props: {
|
|
@@ -31,120 +31,120 @@ const ce = /* @__PURE__ */ q({
|
|
|
31
31
|
},
|
|
32
32
|
emits: ["getInputRef", "handleChangeSelectValue"],
|
|
33
33
|
setup(u, { emit: f }) {
|
|
34
|
-
const _ = f,
|
|
35
|
-
let d = i(), p = i(""),
|
|
34
|
+
const _ = f, l = u;
|
|
35
|
+
let d = i(), p = i(""), C = i(), D = i(), r = i(!1), M = i({
|
|
36
36
|
top: "0px",
|
|
37
37
|
left: "0px"
|
|
38
38
|
// width: "0px",
|
|
39
|
-
}),
|
|
40
|
-
|
|
41
|
-
() =>
|
|
39
|
+
}), t = i(-1), b = i(!1), I = i(!1);
|
|
40
|
+
ee(
|
|
41
|
+
() => l.value,
|
|
42
42
|
(e) => {
|
|
43
43
|
p.value = e || "";
|
|
44
44
|
},
|
|
45
45
|
{ immediate: !0 }
|
|
46
|
-
),
|
|
47
|
-
|
|
48
|
-
_("getInputRef",
|
|
46
|
+
), F(() => {
|
|
47
|
+
g(() => {
|
|
48
|
+
_("getInputRef", C.value);
|
|
49
49
|
});
|
|
50
50
|
});
|
|
51
|
-
const
|
|
52
|
-
if (!
|
|
51
|
+
const k = () => {
|
|
52
|
+
if (!D.value)
|
|
53
53
|
return;
|
|
54
|
-
const e =
|
|
55
|
-
|
|
54
|
+
const e = D.value.getBoundingClientRect(), n = window.pageYOffset || document.documentElement.scrollTop, a = window.pageXOffset || document.documentElement.scrollLeft;
|
|
55
|
+
M.value = {
|
|
56
56
|
top: `${e.bottom + n}px`,
|
|
57
57
|
left: `${e.left + a}px`
|
|
58
58
|
// width: `${rect.width}px`,
|
|
59
59
|
};
|
|
60
|
-
},
|
|
61
|
-
const e =
|
|
60
|
+
}, S = ne(() => {
|
|
61
|
+
const e = l.column?.map((c) => c.prop) || [
|
|
62
62
|
"name",
|
|
63
63
|
"engname",
|
|
64
64
|
"spell",
|
|
65
65
|
"zjm",
|
|
66
66
|
"infoOrder"
|
|
67
|
-
], n =
|
|
68
|
-
return
|
|
69
|
-
const c =
|
|
67
|
+
], n = l.options || [], a = p.value || "";
|
|
68
|
+
return t.value = -1, g(() => {
|
|
69
|
+
const c = l.options || [], w = c.find((m) => m.name === l.value);
|
|
70
70
|
if (d.value && d.value.setCurrentRow(w), w) {
|
|
71
|
-
const m =
|
|
71
|
+
const m = O(
|
|
72
72
|
e,
|
|
73
73
|
a,
|
|
74
74
|
c
|
|
75
75
|
);
|
|
76
|
-
|
|
76
|
+
t.value = m.findIndex(
|
|
77
77
|
(o) => o.name === w.name
|
|
78
78
|
);
|
|
79
79
|
}
|
|
80
|
-
}),
|
|
81
|
-
}),
|
|
82
|
-
e?.stopPropagation(), !
|
|
83
|
-
},
|
|
84
|
-
if (
|
|
80
|
+
}), O(e, a, n);
|
|
81
|
+
}), U = (e) => {
|
|
82
|
+
e?.stopPropagation(), !l.readonly && (r.value ? s() : v());
|
|
83
|
+
}, Y = () => {
|
|
84
|
+
if (l.readonly) {
|
|
85
85
|
s();
|
|
86
86
|
return;
|
|
87
87
|
}
|
|
88
|
-
r.value || v(),
|
|
88
|
+
r.value || v(), t.value = -1;
|
|
89
89
|
}, v = () => {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
l.readonly || I.value || (I.value = !0, r.value = !0, g(() => {
|
|
91
|
+
k(), b.value = !1, setTimeout(() => {
|
|
92
|
+
I.value = !1;
|
|
93
93
|
}, 100);
|
|
94
94
|
}));
|
|
95
95
|
}, s = () => {
|
|
96
|
-
r.value = !1,
|
|
97
|
-
},
|
|
98
|
-
p.value = e.name, s(),
|
|
99
|
-
|
|
96
|
+
r.value = !1, b.value = !1;
|
|
97
|
+
}, z = (e) => {
|
|
98
|
+
p.value = e.name, s(), g(() => {
|
|
99
|
+
C.value?.focus();
|
|
100
100
|
}), _("handleChangeSelectValue", {
|
|
101
101
|
valueCode: e.code,
|
|
102
102
|
value: e.name,
|
|
103
|
-
index:
|
|
103
|
+
index: l.itemIndex ? l.itemIndex : ""
|
|
104
104
|
});
|
|
105
|
-
}, Y = (e) => {
|
|
106
|
-
h.value = !0, e.preventDefault();
|
|
107
105
|
}, $ = (e) => {
|
|
106
|
+
b.value = !0, e.preventDefault();
|
|
107
|
+
}, j = (e) => {
|
|
108
108
|
e.stopPropagation(), s();
|
|
109
|
-
},
|
|
110
|
-
if (console.log("handleInput"),
|
|
109
|
+
}, H = async () => {
|
|
110
|
+
if (console.log("handleInput"), l.readonly) {
|
|
111
111
|
s();
|
|
112
112
|
return;
|
|
113
113
|
}
|
|
114
|
-
v(),
|
|
115
|
-
},
|
|
116
|
-
if (console.log("handleFocus"),
|
|
114
|
+
v(), t.value = -1;
|
|
115
|
+
}, X = () => {
|
|
116
|
+
if (console.log("handleFocus"), l.readonly) {
|
|
117
117
|
s();
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
|
-
r.value || v(),
|
|
121
|
-
},
|
|
122
|
-
console.log("handleBlur",
|
|
123
|
-
if (
|
|
124
|
-
|
|
125
|
-
|
|
120
|
+
r.value || v(), t.value = -1;
|
|
121
|
+
}, G = () => {
|
|
122
|
+
console.log("handleBlur", b.value), setTimeout(() => {
|
|
123
|
+
if (b.value) {
|
|
124
|
+
g(() => {
|
|
125
|
+
C.value?.focus();
|
|
126
126
|
});
|
|
127
127
|
return;
|
|
128
128
|
}
|
|
129
129
|
s();
|
|
130
130
|
}, 150);
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
},
|
|
134
|
-
const n =
|
|
131
|
+
}, J = (e) => {
|
|
132
|
+
S.value.length !== 0 && (e.key === "ArrowDown" ? (e.preventDefault(), r.value || v(), P(1)) : e.key === "ArrowUp" ? (e.preventDefault(), r.value || v(), P(-1)) : e.key === "Enter" ? (e.preventDefault(), r.value ? Q() : v()) : (e.key === "Escape" || e.key === "Tab") && s());
|
|
133
|
+
}, P = (e) => {
|
|
134
|
+
const n = S.value;
|
|
135
135
|
if (n.length === 0)
|
|
136
136
|
return;
|
|
137
|
-
|
|
138
|
-
const a = n[
|
|
139
|
-
d.value && d.value.setCurrentRow(a),
|
|
140
|
-
}, J = () => {
|
|
141
|
-
const e = C.value;
|
|
142
|
-
if (e.length === 0 || l.value === -1)
|
|
143
|
-
return;
|
|
144
|
-
const n = e[l.value];
|
|
145
|
-
M(n);
|
|
137
|
+
t.value === -1 ? e === 1 ? t.value = 0 : t.value = n.length - 1 : (t.value += e, t.value < 0 ? t.value = n.length - 1 : t.value >= n.length && (t.value = 0));
|
|
138
|
+
const a = n[t.value];
|
|
139
|
+
d.value && d.value.setCurrentRow(a), W();
|
|
146
140
|
}, Q = () => {
|
|
147
|
-
|
|
141
|
+
const e = S.value;
|
|
142
|
+
if (e.length === 0 || t.value === -1)
|
|
143
|
+
return;
|
|
144
|
+
const n = e[t.value];
|
|
145
|
+
z(n);
|
|
146
|
+
}, W = () => {
|
|
147
|
+
g(() => {
|
|
148
148
|
const e = d.value;
|
|
149
149
|
if (!e)
|
|
150
150
|
return;
|
|
@@ -157,7 +157,7 @@ const ce = /* @__PURE__ */ q({
|
|
|
157
157
|
block: "nearest"
|
|
158
158
|
});
|
|
159
159
|
});
|
|
160
|
-
},
|
|
160
|
+
}, O = (e, n, a) => {
|
|
161
161
|
const c = n.trim().toLowerCase();
|
|
162
162
|
return c ? a.filter(
|
|
163
163
|
(w) => e.some((m) => {
|
|
@@ -166,64 +166,64 @@ const ce = /* @__PURE__ */ q({
|
|
|
166
166
|
})
|
|
167
167
|
) : a;
|
|
168
168
|
};
|
|
169
|
-
return
|
|
170
|
-
window.addEventListener("resize",
|
|
171
|
-
}),
|
|
172
|
-
window.removeEventListener("resize",
|
|
169
|
+
return F(() => {
|
|
170
|
+
window.addEventListener("resize", k), window.addEventListener("scroll", k, !0);
|
|
171
|
+
}), le(() => {
|
|
172
|
+
window.removeEventListener("resize", k), window.removeEventListener("scroll", k, !0);
|
|
173
173
|
}), (e, n) => {
|
|
174
|
-
const a =
|
|
175
|
-
return
|
|
174
|
+
const a = R("el-icon"), c = R("el-input"), w = R("el-table-column"), m = R("el-table");
|
|
175
|
+
return h(), V("div", {
|
|
176
176
|
class: "custom-dropdown",
|
|
177
177
|
ref_key: "dropdownRef",
|
|
178
|
-
ref:
|
|
178
|
+
ref: D
|
|
179
179
|
}, [
|
|
180
180
|
T(c, {
|
|
181
|
-
modelValue:
|
|
181
|
+
modelValue: y(p),
|
|
182
182
|
"onUpdate:modelValue": n[0] || (n[0] = (o) => te(p) ? p.value = o : p = o),
|
|
183
183
|
ref_key: "inputValueRef",
|
|
184
|
-
ref:
|
|
185
|
-
readonly:
|
|
186
|
-
onInput:
|
|
187
|
-
onKeydown:
|
|
188
|
-
onFocus:
|
|
189
|
-
onBlur:
|
|
190
|
-
onClick:
|
|
184
|
+
ref: C,
|
|
185
|
+
readonly: l.readonly,
|
|
186
|
+
onInput: H,
|
|
187
|
+
onKeydown: J,
|
|
188
|
+
onFocus: X,
|
|
189
|
+
onBlur: G,
|
|
190
|
+
onClick: Y
|
|
191
191
|
}, {
|
|
192
|
-
suffix:
|
|
192
|
+
suffix: L(() => [
|
|
193
193
|
T(a, {
|
|
194
|
-
class:
|
|
195
|
-
onClick:
|
|
194
|
+
class: oe(["el-input__icon dropdown-arrow", { "dropdown-arrow--open": y(r) }]),
|
|
195
|
+
onClick: U
|
|
196
196
|
}, {
|
|
197
|
-
default:
|
|
198
|
-
T(
|
|
197
|
+
default: L(() => [
|
|
198
|
+
T(y(ce))
|
|
199
199
|
]),
|
|
200
200
|
_: 1
|
|
201
201
|
}, 8, ["class"])
|
|
202
202
|
]),
|
|
203
203
|
_: 1
|
|
204
204
|
}, 8, ["modelValue", "readonly"]),
|
|
205
|
-
|
|
205
|
+
y(r) ? (h(), E(N, {
|
|
206
206
|
key: 0,
|
|
207
207
|
to: "body"
|
|
208
208
|
}, [
|
|
209
|
-
|
|
209
|
+
B("div", {
|
|
210
210
|
class: "dropdown-panel",
|
|
211
|
-
style:
|
|
212
|
-
onMousedown:
|
|
211
|
+
style: ae(y(M)),
|
|
212
|
+
onMousedown: $
|
|
213
213
|
}, [
|
|
214
214
|
T(m, {
|
|
215
215
|
border: "",
|
|
216
|
-
data:
|
|
216
|
+
data: S.value,
|
|
217
217
|
"highlight-current-row": "",
|
|
218
218
|
ref_key: "tableRef",
|
|
219
219
|
ref: d,
|
|
220
220
|
"max-height": "200px",
|
|
221
|
-
onRowClick:
|
|
221
|
+
onRowClick: z,
|
|
222
222
|
style: { width: "100%" }
|
|
223
223
|
}, {
|
|
224
|
-
default:
|
|
225
|
-
(
|
|
226
|
-
key:
|
|
224
|
+
default: L(() => [
|
|
225
|
+
(h(!0), V(re, null, ue(l.column, (o, Z) => (h(), E(w, {
|
|
226
|
+
key: Z,
|
|
227
227
|
prop: o.prop,
|
|
228
228
|
label: o.label,
|
|
229
229
|
width: o.width,
|
|
@@ -235,45 +235,45 @@ const ce = /* @__PURE__ */ q({
|
|
|
235
235
|
_: 1
|
|
236
236
|
}, 8, ["data"])
|
|
237
237
|
], 36)
|
|
238
|
-
])) :
|
|
239
|
-
|
|
238
|
+
])) : q("", !0),
|
|
239
|
+
y(r) ? (h(), E(N, {
|
|
240
240
|
key: 1,
|
|
241
241
|
to: "body"
|
|
242
242
|
}, [
|
|
243
|
-
|
|
243
|
+
B("div", {
|
|
244
244
|
class: "dropdown-mask",
|
|
245
|
-
onMousedown:
|
|
245
|
+
onMousedown: j
|
|
246
246
|
}, null, 32)
|
|
247
|
-
])) :
|
|
247
|
+
])) : q("", !0)
|
|
248
248
|
], 512);
|
|
249
249
|
};
|
|
250
250
|
}
|
|
251
251
|
});
|
|
252
|
-
const
|
|
252
|
+
const de = (u, f) => {
|
|
253
253
|
const _ = u.__vccOpts || u;
|
|
254
|
-
for (const [
|
|
255
|
-
_[
|
|
254
|
+
for (const [l, d] of f)
|
|
255
|
+
_[l] = d;
|
|
256
256
|
return _;
|
|
257
|
-
},
|
|
258
|
-
|
|
259
|
-
u.component(
|
|
257
|
+
}, x = /* @__PURE__ */ de(ie, [["__scopeId", "data-v-2301dea2"]]);
|
|
258
|
+
x.install = (u) => {
|
|
259
|
+
u.component(x.name, x);
|
|
260
260
|
};
|
|
261
|
-
const
|
|
262
|
-
|
|
263
|
-
],
|
|
264
|
-
|
|
261
|
+
const fe = [
|
|
262
|
+
x
|
|
263
|
+
], A = function(u) {
|
|
264
|
+
A.installed || fe.forEach((f) => {
|
|
265
265
|
u.component(f.name, f);
|
|
266
266
|
});
|
|
267
267
|
};
|
|
268
|
-
typeof window < "u" && window.Vue &&
|
|
269
|
-
const
|
|
268
|
+
typeof window < "u" && window.Vue && A(window.Vue);
|
|
269
|
+
const ve = {
|
|
270
270
|
// 导出的对象必须具有 install,才能被 Vue.use() 方法安装
|
|
271
|
-
install:
|
|
271
|
+
install: A,
|
|
272
272
|
// 以下是具体的组件列表
|
|
273
|
-
SelectTable:
|
|
273
|
+
SelectTable: x
|
|
274
274
|
};
|
|
275
275
|
export {
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
276
|
+
x as SelectTable,
|
|
277
|
+
ve as default,
|
|
278
|
+
A as install
|
|
279
279
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(c,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(c=typeof globalThis<"u"?globalThis:c||self,e(c.HuiyiSelectTable={},c.Vue))})(this,function(c,e){"use strict";const $="";/*! Element Plus Icons Vue v2.3.2 */var D=e.defineComponent({name:"ArrowDown",__name:"arrow-down",setup(i){return(p,g)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.59 30.59 0 0 0-42.752 0z"})]))}}),I=D;const L=e.defineComponent({name:"InputSelectCompont",__name:"SelectTable",props:{options:Array,readonly:Boolean,required:Boolean,value:String,itemIndex:{type:[String,Number,null],default:null},column:Array},emits:["getInputRef","handleChangeSelectValue"],setup(i,{emit:p}){const g=p,o=i;let f=e.ref(),m=e.ref(""),
|
|
1
|
+
(function(c,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(c=typeof globalThis<"u"?globalThis:c||self,e(c.HuiyiSelectTable={},c.Vue))})(this,function(c,e){"use strict";const $="";/*! Element Plus Icons Vue v2.3.2 */var D=e.defineComponent({name:"ArrowDown",__name:"arrow-down",setup(i){return(p,g)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.59 30.59 0 0 0-42.752 0z"})]))}}),I=D;const L=e.defineComponent({name:"InputSelectCompont",__name:"SelectTable",props:{options:Array,readonly:Boolean,required:Boolean,value:String,itemIndex:{type:[String,Number,null],default:null},column:Array},emits:["getInputRef","handleChangeSelectValue"],setup(i,{emit:p}){const g=p,o=i;let f=e.ref(),m=e.ref(""),C=e.ref(),S=e.ref(),s=e.ref(!1),B=e.ref({top:"0px",left:"0px"}),l=e.ref(-1),k=e.ref(!1),v=e.ref(!1);e.watch(()=>o.value,n=>{m.value=n||""},{immediate:!0}),e.onMounted(()=>{e.nextTick(()=>{g("getInputRef",C.value)})});const b=()=>{if(!S.value)return;const n=S.value.getBoundingClientRect(),t=window.pageYOffset||document.documentElement.scrollTop,r=window.pageXOffset||document.documentElement.scrollLeft;B.value={top:`${n.bottom+t}px`,left:`${n.left+r}px`}},T=e.computed(()=>{const n=o.column?.map(u=>u.prop)||["name","engname","spell","zjm","infoOrder"],t=o.options||[],r=m.value||"";return l.value=-1,e.nextTick(()=>{const u=o.options||[],_=u.find(y=>y.name===o.value);if(f.value&&f.value.setCurrentRow(_),_){const y=E(n,r,u);l.value=y.findIndex(a=>a.name===_.name)}}),E(n,r,t)}),A=n=>{n?.stopPropagation(),!o.readonly&&(s.value?d():w())},P=()=>{if(o.readonly){d();return}s.value||w(),l.value=-1},w=()=>{o.readonly||v.value||(v.value=!0,s.value=!0,e.nextTick(()=>{b(),k.value=!1,setTimeout(()=>{v.value=!1},100)}))},d=()=>{s.value=!1,k.value=!1},R=n=>{m.value=n.name,d(),e.nextTick(()=>{C.value?.focus()}),g("handleChangeSelectValue",{valueCode:n.code,value:n.name,index:o.itemIndex?o.itemIndex:""})},z=n=>{k.value=!0,n.preventDefault()},O=n=>{n.stopPropagation(),d()},q=async()=>{if(console.log("handleInput"),o.readonly){d();return}w(),l.value=-1},F=()=>{if(console.log("handleFocus"),o.readonly){d();return}s.value||w(),l.value=-1},j=()=>{console.log("handleBlur",k.value),setTimeout(()=>{if(k.value){e.nextTick(()=>{C.value?.focus()});return}d()},150)},K=n=>{T.value.length!==0&&(n.key==="ArrowDown"?(n.preventDefault(),s.value||w(),V(1)):n.key==="ArrowUp"?(n.preventDefault(),s.value||w(),V(-1)):n.key==="Enter"?(n.preventDefault(),s.value?U():w()):(n.key==="Escape"||n.key==="Tab")&&d())},V=n=>{const t=T.value;if(t.length===0)return;l.value===-1?n===1?l.value=0:l.value=t.length-1:(l.value+=n,l.value<0?l.value=t.length-1:l.value>=t.length&&(l.value=0));const r=t[l.value];f.value&&f.value.setCurrentRow(r),H()},U=()=>{const n=T.value;if(n.length===0||l.value===-1)return;const t=n[l.value];R(t)},H=()=>{e.nextTick(()=>{const n=f.value;if(!n)return;const t=n.$el.querySelector(".el-table__body-wrapper");if(!t)return;const r=t.querySelector(".current-row");r&&r.scrollIntoView({behavior:"smooth",block:"nearest"})})},E=(n,t,r)=>{const u=t.trim().toLowerCase();return u?r.filter(_=>n.some(y=>{const a=_[y];return a==null&&a!==0?!1:String(a).toLowerCase().includes(u)})):r};return e.onMounted(()=>{window.addEventListener("resize",b),window.addEventListener("scroll",b,!0)}),e.onUnmounted(()=>{window.removeEventListener("resize",b),window.removeEventListener("scroll",b,!0)}),(n,t)=>{const r=e.resolveComponent("el-icon"),u=e.resolveComponent("el-input"),_=e.resolveComponent("el-table-column"),y=e.resolveComponent("el-table");return e.openBlock(),e.createElementBlock("div",{class:"custom-dropdown",ref_key:"dropdownRef",ref:S},[e.createVNode(u,{modelValue:e.unref(m),"onUpdate:modelValue":t[0]||(t[0]=a=>e.isRef(m)?m.value=a:m=a),ref_key:"inputValueRef",ref:C,readonly:o.readonly,onInput:q,onKeydown:K,onFocus:F,onBlur:j,onClick:P},{suffix:e.withCtx(()=>[e.createVNode(r,{class:e.normalizeClass(["el-input__icon dropdown-arrow",{"dropdown-arrow--open":e.unref(s)}]),onClick:A},{default:e.withCtx(()=>[e.createVNode(e.unref(I))]),_:1},8,["class"])]),_:1},8,["modelValue","readonly"]),e.unref(s)?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.createElementVNode("div",{class:"dropdown-panel",style:e.normalizeStyle(e.unref(B)),onMousedown:z},[e.createVNode(y,{border:"",data:T.value,"highlight-current-row":"",ref_key:"tableRef",ref:f,"max-height":"200px",onRowClick:R,style:{width:"100%"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.column,(a,Y)=>(e.openBlock(),e.createBlock(_,{key:Y,prop:a.prop,label:a.label,width:a.width,align:a.align,type:a.type,"header-align":a.headerAlign},null,8,["prop","label","width","align","type","header-align"]))),128))]),_:1},8,["data"])],36)])):e.createCommentVNode("",!0),e.unref(s)?(e.openBlock(),e.createBlock(e.Teleport,{key:1,to:"body"},[e.createElementVNode("div",{class:"dropdown-mask",onMousedown:O},null,32)])):e.createCommentVNode("",!0)],512)}}}),X="",h=((i,p)=>{const g=i.__vccOpts||i;for(const[o,f]of p)g[o]=f;return g})(L,[["__scopeId","data-v-2301dea2"]]);h.install=i=>{i.component(h.name,h)};const M=[h],x=function(i){x.installed||M.forEach(p=>{i.component(p.name,p)})};typeof window<"u"&&window.Vue&&x(window.Vue);const N={install:x,SelectTable:h};c.SelectTable=h,c.default=N,c.install=x,Object.defineProperties(c,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
package/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.custom-dropdown[data-v-
|
|
1
|
+
.custom-dropdown[data-v-2301dea2]{position:relative;width:100%}.dropdown-panel[data-v-2301dea2]{position:fixed;z-index:9999;background:white;border:1px solid #e4e7ed;border-radius:4px;box-shadow:0 2px 12px #0000001a;margin-top:4px;box-sizing:border-box;max-height:200px;overflow:hidden}.dropdown-mask[data-v-2301dea2]{position:fixed;inset:0;z-index:9998;background:transparent}.dropdown-arrow[data-v-2301dea2]{cursor:pointer;transition:transform .3s}.dropdown-arrow--open[data-v-2301dea2]{transform:rotate(180deg)}
|
|
Binary file
|