zhihao-ui 1.3.56 → 1.3.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/{BaseItem-0fbDCeuh.js → BaseItem-6LMSv4Je.js} +1 -1
- package/dist/es/CascaderLoadMore-DKTvm00E.js +287 -0
- package/dist/es/{DatePicker-BH5X28Bl.js → DatePicker-CymT2gjS.js} +1 -1
- package/dist/es/{DetailHeader-kFn2FtqV.js → DetailHeader-DlAjiYhV.js} +1 -1
- package/dist/es/{DetailSubTitle-DjHsWNVa.js → DetailSubTitle-OH6TMyKI.js} +1 -1
- package/dist/es/{DiyDataTable-a-pFltM6.js → DiyDataTable-DRuRQedj.js} +30 -30
- package/dist/es/{EditInfoPair-ZvaiiVmj.js → EditInfoPair-B3TKNnnl.js} +1 -1
- package/dist/es/{FileWrapper-mQ4rJXJr.js → FileWrapper-bVyPV48o.js} +1 -1
- package/dist/es/{Grid-CCkuxPw9.js → Grid-CLU3cdzX.js} +1 -1
- package/dist/es/{InfoPair-R1-mr8Vf.js → InfoPair-nPqi45Ys.js} +1 -1
- package/dist/es/{MoneyInput-BlilgYic.js → MoneyInput-ZLGQmpLk.js} +1 -1
- package/dist/es/{Table-DNrZVI3t.js → Table-gFH87j_O.js} +2 -2
- package/dist/es/index.js +13 -13
- package/dist/index.css +1 -1
- package/dist/types/components/CascaderLoadMore/CascaderLoadMore.vue.d.ts +0 -3
- package/dist/types/components/CascaderLoadMore/index.d.ts +0 -6
- package/dist/types/components/DiyDataTable/DiyDataTable.vue.d.ts +1 -0
- package/dist/types/components/DiyDataTable/index.d.ts +3 -0
- package/dist/types/components/DiyDataTable/type.d.ts +2 -0
- package/dist/umd/index.css +1 -1
- package/dist/umd/index.umd.cjs +21 -21
- package/package.json +1 -1
- package/dist/es/CascaderLoadMore-DFdDRygU.js +0 -283
package/package.json
CHANGED
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
import { defineComponent as ae, useModel as te, ref as n, watch as L, nextTick as f, withDirectives as oe, openBlock as m, createElementBlock as P, createVNode as w, unref as C, withCtx as R, createBlock as z, toDisplayString as ne, createCommentVNode as se, mergeProps as re, Fragment as ce, renderList as ie, mergeModels as A } from "vue";
|
|
2
|
-
import { e as H, f as ue, g as pe, h as de, i as ve, C as fe } from "./vendor-DkGhDRdQ.js";
|
|
3
|
-
import { w as me } from "./utils-B-n1yx0L.js";
|
|
4
|
-
const ge = { class: "w-100" }, he = {
|
|
5
|
-
key: 1,
|
|
6
|
-
class: "cascader-select-empty"
|
|
7
|
-
}, ye = {
|
|
8
|
-
key: 2,
|
|
9
|
-
class: "loading"
|
|
10
|
-
}, Ce = /* @__PURE__ */ ae({
|
|
11
|
-
name: "CascaderLoadMore",
|
|
12
|
-
__name: "CascaderLoadMore",
|
|
13
|
-
props: /* @__PURE__ */ A({
|
|
14
|
-
onChange: {
|
|
15
|
-
type: Function,
|
|
16
|
-
required: !1
|
|
17
|
-
},
|
|
18
|
-
// 默认选中项
|
|
19
|
-
initialValue: {
|
|
20
|
-
type: [String, Number, Array],
|
|
21
|
-
required: !1
|
|
22
|
-
},
|
|
23
|
-
pageSize: {
|
|
24
|
-
type: Number,
|
|
25
|
-
default: 10
|
|
26
|
-
},
|
|
27
|
-
// 数据请求函数
|
|
28
|
-
requestFunction: {
|
|
29
|
-
type: Function,
|
|
30
|
-
required: !0
|
|
31
|
-
},
|
|
32
|
-
// 选项处理函数
|
|
33
|
-
handleOptionsFunction: {
|
|
34
|
-
type: Function,
|
|
35
|
-
required: !0
|
|
36
|
-
},
|
|
37
|
-
placeholder: {
|
|
38
|
-
type: String,
|
|
39
|
-
default: "输入关键字搜索名称"
|
|
40
|
-
},
|
|
41
|
-
// 强制搜索:不输入内容也进行搜索,即点击下拉默认展示数据
|
|
42
|
-
forceSearch: {
|
|
43
|
-
type: Boolean,
|
|
44
|
-
default: !0
|
|
45
|
-
},
|
|
46
|
-
// 初始下拉项用于回显数据
|
|
47
|
-
initialOptions: {
|
|
48
|
-
type: Array,
|
|
49
|
-
required: !1,
|
|
50
|
-
default: () => []
|
|
51
|
-
},
|
|
52
|
-
// 多选,默认false
|
|
53
|
-
multiple: {
|
|
54
|
-
type: Boolean,
|
|
55
|
-
default: !1
|
|
56
|
-
},
|
|
57
|
-
collapseTags: {
|
|
58
|
-
type: Boolean,
|
|
59
|
-
default: !1
|
|
60
|
-
},
|
|
61
|
-
collapseTagsTooltip: {
|
|
62
|
-
type: Boolean,
|
|
63
|
-
default: !1
|
|
64
|
-
},
|
|
65
|
-
clearable: {
|
|
66
|
-
type: Boolean,
|
|
67
|
-
default: !0
|
|
68
|
-
},
|
|
69
|
-
cascaderProps: {
|
|
70
|
-
type: Object,
|
|
71
|
-
default: () => ({})
|
|
72
|
-
},
|
|
73
|
-
placement: {
|
|
74
|
-
type: String,
|
|
75
|
-
default: "bottom-start"
|
|
76
|
-
},
|
|
77
|
-
trigger: {
|
|
78
|
-
type: String,
|
|
79
|
-
default: "click"
|
|
80
|
-
},
|
|
81
|
-
popperClass: {
|
|
82
|
-
type: String,
|
|
83
|
-
default: "warp-cascade-panel"
|
|
84
|
-
},
|
|
85
|
-
teleported: {
|
|
86
|
-
type: Boolean,
|
|
87
|
-
default: !1
|
|
88
|
-
},
|
|
89
|
-
noDataText: {
|
|
90
|
-
type: String,
|
|
91
|
-
default: "暂无数据"
|
|
92
|
-
}
|
|
93
|
-
}, {
|
|
94
|
-
modelValue: {},
|
|
95
|
-
modelModifiers: {}
|
|
96
|
-
}),
|
|
97
|
-
emits: /* @__PURE__ */ A(["change", "removeTag"], ["update:modelValue"]),
|
|
98
|
-
setup(c, { expose: I, emit: N }) {
|
|
99
|
-
const o = c, r = te(c, "modelValue"), d = n(r.value || []), v = n(!1), i = n({
|
|
100
|
-
page: 1,
|
|
101
|
-
size: o.pageSize
|
|
102
|
-
}), S = n(void 0), k = n(!1), E = n(!0), p = n(o.initialOptions || []), s = n(o.initialOptions || []), g = n(void 0), T = n(!1), W = {
|
|
103
|
-
expandTrigger: "hover",
|
|
104
|
-
checkStrictly: !1,
|
|
105
|
-
multiple: o.multiple,
|
|
106
|
-
emitPath: !0,
|
|
107
|
-
...o.cascaderProps
|
|
108
|
-
}, $ = n(), O = n(), U = () => {
|
|
109
|
-
v.value = !0;
|
|
110
|
-
}, j = () => {
|
|
111
|
-
v.value = !1;
|
|
112
|
-
}, Z = (e) => {
|
|
113
|
-
const l = /* @__PURE__ */ new Map();
|
|
114
|
-
return (e || []).forEach((t) => {
|
|
115
|
-
const a = `${t.value}`;
|
|
116
|
-
l.has(a) || l.set(a, t);
|
|
117
|
-
}), Array.from(l.values());
|
|
118
|
-
};
|
|
119
|
-
function B(e) {
|
|
120
|
-
const l = [];
|
|
121
|
-
function t(a, u = "") {
|
|
122
|
-
const y = u && (o.cascaderProps.emitPath ?? !0) ? `${u}/${a.label}` : a.label;
|
|
123
|
-
l.push({
|
|
124
|
-
...a,
|
|
125
|
-
value: a.value,
|
|
126
|
-
label: y
|
|
127
|
-
// 如果需要保留原始路径结构,可加上 fullPath 字段
|
|
128
|
-
// fullPath: currentPath
|
|
129
|
-
}), a.children && a.children.length > 0 && a.children.forEach((le) => t(le, y));
|
|
130
|
-
}
|
|
131
|
-
return e.forEach((a) => t(a)), l;
|
|
132
|
-
}
|
|
133
|
-
const q = async (e) => {
|
|
134
|
-
var u;
|
|
135
|
-
if (!o.forceSearch && !e) return;
|
|
136
|
-
const l = g.value === e || !g.value && !e;
|
|
137
|
-
if (l || (i.value.page = 1), l && S.value !== void 0 && i.value.page > S.value && !T.value) return;
|
|
138
|
-
T.value = !1, k.value = !0, s.value.length === 0 && (E.value = !0);
|
|
139
|
-
const a = await o.requestFunction(i.value.page, i.value.size, e);
|
|
140
|
-
if (a && Object.keys(a).length) {
|
|
141
|
-
S.value = a.totalPage;
|
|
142
|
-
const y = (u = a == null ? void 0 : a.list) == null ? void 0 : u.map(o.handleOptionsFunction);
|
|
143
|
-
l && i.value.page !== 1 ? s.value = Z([...s.value, ...y]) : s.value = y || [], d.value = H(r.value), p.value = B(s.value);
|
|
144
|
-
}
|
|
145
|
-
f(() => {
|
|
146
|
-
F();
|
|
147
|
-
}), g.value = e, k.value = !1, s.value.length !== 0 && (E.value = !1);
|
|
148
|
-
}, Q = () => {
|
|
149
|
-
i.value.page = i.value.page + 1, q(g.value);
|
|
150
|
-
}, G = (e) => {
|
|
151
|
-
r.value = e, d.value = e;
|
|
152
|
-
const l = x(e), t = o.onChange;
|
|
153
|
-
t && t(e, l);
|
|
154
|
-
}, x = (e) => {
|
|
155
|
-
const l = e || r.value;
|
|
156
|
-
return o.multiple ? p.value.filter(
|
|
157
|
-
(t) => (l || []).includes(t.value)
|
|
158
|
-
) : p.value.find((t) => t.value === l);
|
|
159
|
-
}, J = () => {
|
|
160
|
-
r.value = o.initialValue, d.value = o.initialValue, i.value.page = 1, i.value.size = o.pageSize, p.value = o.initialOptions || [], s.value = o.initialOptions || [], S.value = void 0, g.value = void 0;
|
|
161
|
-
}, D = N;
|
|
162
|
-
L(
|
|
163
|
-
() => o.initialOptions,
|
|
164
|
-
() => {
|
|
165
|
-
p.value = B(o.initialOptions), console.log("options.value", p.value), s.value = o.initialOptions;
|
|
166
|
-
},
|
|
167
|
-
{ immediate: !0 }
|
|
168
|
-
);
|
|
169
|
-
const K = (e) => {
|
|
170
|
-
D("removeTag", e);
|
|
171
|
-
}, X = (e) => {
|
|
172
|
-
T.value = e;
|
|
173
|
-
}, b = n(null), h = n(null), M = () => {
|
|
174
|
-
if (!v.value) return;
|
|
175
|
-
const e = O.value.popperRef.contentRef, l = e == null ? void 0 : e.querySelector(".el-cascader-panel .el-scrollbar__wrap");
|
|
176
|
-
l && (b.value = l, h.value = () => Y(l), l.addEventListener("scroll", h.value));
|
|
177
|
-
}, V = () => {
|
|
178
|
-
b.value && h.value && (b.value.removeEventListener("scroll", h.value), b.value = null, h.value = null);
|
|
179
|
-
}, Y = (e) => {
|
|
180
|
-
const { scrollTop: l, scrollHeight: t, clientHeight: a } = e;
|
|
181
|
-
let u = t - l;
|
|
182
|
-
a + 10 > u && Q();
|
|
183
|
-
};
|
|
184
|
-
f(() => M()), L(v, (e) => {
|
|
185
|
-
e ? (console.log("visible", e), f(() => M())) : V();
|
|
186
|
-
}), L(s, (e) => {
|
|
187
|
-
e != null && e.length && v.value ? f(() => M()) : V();
|
|
188
|
-
});
|
|
189
|
-
const _ = async (e) => {
|
|
190
|
-
(o.cascaderProps.emitPath ?? !0) && Array.isArray(e) ? o.multiple ? r.value = e.map((a) => a.at(-1)) : r.value = e.at(-1) : r.value = H(d.value), await f();
|
|
191
|
-
const l = x(r.value);
|
|
192
|
-
D("change", e, l);
|
|
193
|
-
const t = o.onChange;
|
|
194
|
-
t && t(e, l);
|
|
195
|
-
}, F = () => {
|
|
196
|
-
const l = O.value.popperRef.contentRef.querySelectorAll(".el-cascader-node__label");
|
|
197
|
-
console.log(l), l.forEach((t) => {
|
|
198
|
-
const a = document.createElement("span");
|
|
199
|
-
a.style.visibility = "hidden", a.style.position = "absolute", a.style.whiteSpace = "nowrap", a.style.font = window.getComputedStyle(t).font, a.textContent = t.textContent || "", document.body.appendChild(a);
|
|
200
|
-
const u = a.offsetWidth;
|
|
201
|
-
document.body.removeChild(a), t instanceof HTMLElement && (t.style.whiteSpace = u > 240 ? "break-spaces" : "nowrap");
|
|
202
|
-
});
|
|
203
|
-
}, ee = () => {
|
|
204
|
-
f(() => {
|
|
205
|
-
F();
|
|
206
|
-
});
|
|
207
|
-
};
|
|
208
|
-
return I({
|
|
209
|
-
reset: J,
|
|
210
|
-
getSelectedOption: x,
|
|
211
|
-
remoteMethod: q,
|
|
212
|
-
handleRequestParamsChanged: X,
|
|
213
|
-
options: p,
|
|
214
|
-
cascderOptions: s
|
|
215
|
-
}), (e, l) => oe((m(), P("div", ge, [
|
|
216
|
-
w(C(ue), {
|
|
217
|
-
ref_key: "popoverRef",
|
|
218
|
-
ref: O,
|
|
219
|
-
teleported: c.teleported,
|
|
220
|
-
placement: o.placement,
|
|
221
|
-
trigger: o.trigger,
|
|
222
|
-
"popper-class": o.popperClass,
|
|
223
|
-
visible: v.value
|
|
224
|
-
}, {
|
|
225
|
-
reference: R(() => [
|
|
226
|
-
w(C(de), re({
|
|
227
|
-
ref_key: "remoteSelectRef",
|
|
228
|
-
ref: $,
|
|
229
|
-
modelValue: r.value,
|
|
230
|
-
"onUpdate:modelValue": l[0] || (l[0] = (t) => r.value = t),
|
|
231
|
-
multiple: c.multiple,
|
|
232
|
-
placeholder: c.placeholder,
|
|
233
|
-
"remote-method": q,
|
|
234
|
-
teleported: !0,
|
|
235
|
-
clearable: c.clearable,
|
|
236
|
-
"collapse-tags": c.collapseTags,
|
|
237
|
-
"collapse-tags-tooltip": c.collapseTagsTooltip,
|
|
238
|
-
filterable: "",
|
|
239
|
-
height: "300",
|
|
240
|
-
remote: "",
|
|
241
|
-
"remote-show-suffix": "",
|
|
242
|
-
"reserve-keyword": "",
|
|
243
|
-
"popper-class": "hidden-dropdown",
|
|
244
|
-
class: "cascader-select"
|
|
245
|
-
}, e.$attrs, {
|
|
246
|
-
onClick: U,
|
|
247
|
-
onChange: G,
|
|
248
|
-
onRemoveTag: K
|
|
249
|
-
}), {
|
|
250
|
-
default: R(() => [
|
|
251
|
-
(m(!0), P(ce, null, ie(p.value, (t) => (m(), z(C(ve), {
|
|
252
|
-
key: t.value,
|
|
253
|
-
label: t.label,
|
|
254
|
-
value: t.value
|
|
255
|
-
}, null, 8, ["label", "value"]))), 128))
|
|
256
|
-
]),
|
|
257
|
-
_: 1
|
|
258
|
-
}, 16, ["modelValue", "multiple", "placeholder", "clearable", "collapse-tags", "collapse-tags-tooltip"])
|
|
259
|
-
]),
|
|
260
|
-
default: R(() => [
|
|
261
|
-
!E.value && s.value.length > 0 ? (m(), z(C(pe), {
|
|
262
|
-
key: 0,
|
|
263
|
-
modelValue: d.value,
|
|
264
|
-
"onUpdate:modelValue": l[1] || (l[1] = (t) => d.value = t),
|
|
265
|
-
border: !1,
|
|
266
|
-
props: W,
|
|
267
|
-
options: s.value,
|
|
268
|
-
class: "select-cascader-panel",
|
|
269
|
-
onChange: _,
|
|
270
|
-
onExpandChange: ee
|
|
271
|
-
}, null, 8, ["modelValue", "options"])) : (m(), P("div", he, ne(c.noDataText), 1)),
|
|
272
|
-
k.value ? (m(), P("div", ye, "加载中...")) : se("", !0)
|
|
273
|
-
]),
|
|
274
|
-
_: 1
|
|
275
|
-
}, 8, ["teleported", "placement", "trigger", "popper-class", "visible"])
|
|
276
|
-
])), [
|
|
277
|
-
[C(fe), j]
|
|
278
|
-
]);
|
|
279
|
-
}
|
|
280
|
-
}), ke = me(Ce);
|
|
281
|
-
export {
|
|
282
|
-
ke as Z
|
|
283
|
-
};
|