zhihao-ui 1.3.55 → 1.3.56

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.
Files changed (38) hide show
  1. package/dist/es/{BaseInfo-Bz9HbxrR.js → BaseInfo-ehtLJvVF.js} +1 -1
  2. package/dist/es/{BaseItem-YGnpIugn.js → BaseItem-0fbDCeuh.js} +3 -3
  3. package/dist/es/{Button-DSjKm2wO.js → Button-DlEYWX3X.js} +2 -2
  4. package/dist/es/CascaderLoadMore-DFdDRygU.js +283 -0
  5. package/dist/es/DatePicker-BH5X28Bl.js +63 -0
  6. package/dist/es/{DetailHeader-lzEy7t5Y.js → DetailHeader-kFn2FtqV.js} +3 -3
  7. package/dist/es/{DetailSubTitle-DfqGXyKI.js → DetailSubTitle-DjHsWNVa.js} +2 -2
  8. package/dist/es/{Dialog-MVXB7s2S.js → Dialog-B_Psb_wh.js} +3 -3
  9. package/dist/es/{DiyDataTable-Yp1HvbS1.js → DiyDataTable-a-pFltM6.js} +4 -4
  10. package/dist/es/{EditInfoPair-BXF1tV3S.js → EditInfoPair-ZvaiiVmj.js} +3 -3
  11. package/dist/es/{FileWrapper-CqbiXynu.js → FileWrapper-mQ4rJXJr.js} +4 -4
  12. package/dist/es/{Grid-CDS9IrCA.js → Grid-CCkuxPw9.js} +2 -2
  13. package/dist/es/{InfoPair-jRjF91Ro.js → InfoPair-R1-mr8Vf.js} +3 -3
  14. package/dist/es/Input-DjQtffZg.js +91 -0
  15. package/dist/es/{Loading-C9Te67Gr.js → Loading-CDxuHkdt.js} +2 -2
  16. package/dist/es/{Map-BoN5eeEB.js → Map-CmcmvvxF.js} +945 -908
  17. package/dist/es/{MessageBox-BzwToZ0E.js → MessageBox-kkpNeAii.js} +2 -2
  18. package/dist/es/{MoneyInput-oY4Jr4Du.js → MoneyInput-BlilgYic.js} +5 -5
  19. package/dist/es/{PageHeadPanel-oLoxYR29.js → PageHeadPanel-DsEeXTgj.js} +2 -2
  20. package/dist/es/{Table-BU_pHf2Y.js → Table-DNrZVI3t.js} +6 -6
  21. package/dist/es/{ToolTips-H93PrmYL.js → ToolTips-BRjrysPf.js} +3 -3
  22. package/dist/es/index.js +23 -23
  23. package/dist/es/{utils-DRDkj6ga.js → utils-B-n1yx0L.js} +3 -3
  24. package/dist/es/{vendor-CxcudVpO.js → vendor-DkGhDRdQ.js} +51 -50
  25. package/dist/index.css +1 -1
  26. package/dist/types/components/DatePicker/DatePicker.vue.d.ts +2 -0
  27. package/dist/types/components/DatePicker/index.d.ts +9 -0
  28. package/dist/types/components/InputNumber/InputNumber.vue.d.ts +2 -0
  29. package/dist/types/components/InputNumber/index.d.ts +5 -0
  30. package/dist/types/components/Map/Map.vue.d.ts +2 -0
  31. package/dist/types/components/Map/function/position.d.ts +5 -0
  32. package/dist/types/components/Map/index.d.ts +6 -0
  33. package/dist/umd/index.css +1 -1
  34. package/dist/umd/index.umd.cjs +25 -25
  35. package/package.json +1 -1
  36. package/dist/es/CascaderLoadMore-BwYi7PBx.js +0 -287
  37. package/dist/es/DatePicker-BkKUo2v1.js +0 -57
  38. package/dist/es/Input-CJadFglX.js +0 -88
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zhihao-ui",
3
- "version": "1.3.55",
3
+ "version": "1.3.56",
4
4
  "description": "components",
5
5
  "type": "module",
6
6
  "main": "./dist/umd/index.umd.cjs",
@@ -1,287 +0,0 @@
1
- import { defineComponent as te, useModel as le, ref as n, watch as B, nextTick as h, resolveDirective as ae, openBlock as d, createElementBlock as k, withDirectives as oe, createBlock as w, unref as y, mergeProps as ne, withCtx as V, Fragment as se, renderList as re, createVNode as ie, toDisplayString as ce, createCommentVNode as ue, mergeModels as F } from "vue";
2
- import { e as z, f as pe, g as de, h as ve, i as fe } from "./vendor-CxcudVpO.js";
3
- import { w as me } from "./utils-DRDkj6ga.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__ */ te({
11
- name: "CascaderLoadMore",
12
- __name: "CascaderLoadMore",
13
- props: /* @__PURE__ */ F({
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__ */ F(["change", "removeTag"], ["update:modelValue"]),
98
- setup(r, { expose: A, emit: H }) {
99
- const a = r, s = le(r, "modelValue"), v = n(s.value || []), C = n(!1), i = n({
100
- page: 1,
101
- size: a.pageSize
102
- }), S = n(void 0), b = n(!1), p = n(a.initialOptions || []), c = n(a.initialOptions || []), f = n(void 0), E = n(!1), I = {
103
- expandTrigger: "hover",
104
- checkStrictly: !1,
105
- multiple: a.multiple,
106
- emitPath: !0,
107
- ...a.cascaderProps
108
- }, x = n(), P = n(), N = () => {
109
- C.value = !0;
110
- }, W = () => {
111
- C.value = !1;
112
- }, $ = () => {
113
- var e, l;
114
- (l = (e = y(P).popperRef) == null ? void 0 : e.delayHide) == null || l.call(e);
115
- }, U = (e) => {
116
- const l = /* @__PURE__ */ new Map();
117
- return (e || []).forEach((o) => {
118
- const t = `${o.value}`;
119
- l.has(t) || l.set(t, o);
120
- }), Array.from(l.values());
121
- };
122
- function M(e) {
123
- const l = [];
124
- function o(t, u = "") {
125
- const g = u && (a.cascaderProps.emitPath ?? !0) ? `${u}/${t.label}` : t.label;
126
- l.push({
127
- ...t,
128
- value: t.value,
129
- label: g
130
- // 如果需要保留原始路径结构,可加上 fullPath 字段
131
- // fullPath: currentPath
132
- }), t.children && t.children.length > 0 && t.children.forEach((ee) => o(ee, g));
133
- }
134
- return e.forEach((t) => o(t)), l;
135
- }
136
- const T = async (e) => {
137
- var u;
138
- if (!a.forceSearch && !e) return;
139
- const l = f.value === e || !f.value && !e;
140
- if (l || (i.value.page = 1), l && S.value !== void 0 && i.value.page > S.value && !E.value) return;
141
- E.value = !1, b.value = !0;
142
- const t = await a.requestFunction(i.value.page, i.value.size, e);
143
- if (t && Object.keys(t).length) {
144
- S.value = t.totalPage;
145
- const g = (u = t == null ? void 0 : t.list) == null ? void 0 : u.map(a.handleOptionsFunction);
146
- l && i.value.page !== 1 ? c.value = U([...c.value, ...g]) : c.value = g || [], v.value = z(s.value), p.value = M(c.value);
147
- }
148
- h(() => {
149
- L();
150
- }), f.value = e, b.value = !1;
151
- }, j = () => {
152
- i.value.page = i.value.page + 1, T(f.value);
153
- }, Z = (e) => {
154
- s.value = e, v.value = e;
155
- const l = q(e), o = a.onChange;
156
- o && o(e, l);
157
- }, q = (e) => {
158
- const l = e || s.value;
159
- return a.multiple ? p.value.filter(
160
- (o) => (l || []).includes(o.value)
161
- ) : p.value.find((o) => o.value === l);
162
- }, _ = () => {
163
- s.value = a.initialValue, v.value = a.initialValue, i.value.page = 1, i.value.size = a.pageSize, p.value = a.initialOptions || [], c.value = a.initialOptions || [], S.value = void 0, f.value = void 0;
164
- }, R = H;
165
- B(
166
- () => a.initialOptions,
167
- () => {
168
- p.value = M(a.initialOptions), console.log("options.value", p.value), c.value = a.initialOptions;
169
- },
170
- { immediate: !0 }
171
- );
172
- const Q = (e) => {
173
- R("removeTag", e);
174
- }, G = (e) => {
175
- E.value = e;
176
- }, O = n(null), m = n(null), D = () => {
177
- if (!C.value) return;
178
- const e = P.value.popperRef.contentRef, l = e == null ? void 0 : e.querySelector(".el-cascader-panel .el-scrollbar__wrap");
179
- l && (O.value = l, m.value = () => K(l), l.addEventListener("scroll", m.value));
180
- }, J = () => {
181
- O.value && m.value && (O.value.removeEventListener("scroll", m.value), O.value = null, m.value = null);
182
- }, K = (e) => {
183
- const { scrollTop: l, scrollHeight: o, clientHeight: t } = e;
184
- let u = o - l;
185
- t + 10 > u && j();
186
- };
187
- h(() => D()), B(C, (e) => {
188
- e ? h(() => D()) : J();
189
- });
190
- const X = async (e) => {
191
- (a.cascaderProps.emitPath ?? !0) && Array.isArray(e) ? a.multiple ? s.value = e.map((t) => t.at(-1)) : s.value = e.at(-1) : s.value = z(v.value), await h();
192
- const l = q(s.value);
193
- R("change", e, l);
194
- const o = a.onChange;
195
- o && o(e, l);
196
- }, L = () => {
197
- const l = P.value.popperRef.contentRef.querySelectorAll(".el-cascader-node__label");
198
- console.log(l), l.forEach((o) => {
199
- const t = document.createElement("span");
200
- t.style.visibility = "hidden", t.style.position = "absolute", t.style.whiteSpace = "nowrap", t.style.font = window.getComputedStyle(o).font, t.textContent = o.textContent || "", document.body.appendChild(t);
201
- const u = t.offsetWidth;
202
- document.body.removeChild(t), o instanceof HTMLElement && (o.style.whiteSpace = u > 240 ? "break-spaces" : "nowrap");
203
- });
204
- }, Y = () => {
205
- h(() => {
206
- L();
207
- });
208
- };
209
- return A({
210
- reset: _,
211
- getSelectedOption: q,
212
- remoteMethod: T,
213
- handleRequestParamsChanged: G,
214
- options: p,
215
- cascderOptions: c
216
- }), (e, l) => {
217
- const o = ae("click-outside");
218
- return d(), k("div", ge, [
219
- oe((d(), w(y(pe), ne({
220
- ref_key: "remoteSelectRef",
221
- ref: x,
222
- modelValue: s.value,
223
- "onUpdate:modelValue": l[0] || (l[0] = (t) => s.value = t),
224
- multiple: r.multiple,
225
- placeholder: r.placeholder,
226
- "remote-method": T,
227
- teleported: !0,
228
- clearable: r.clearable,
229
- "collapse-tags": r.collapseTags,
230
- "collapse-tags-tooltip": r.collapseTagsTooltip,
231
- filterable: "",
232
- height: "300",
233
- remote: "",
234
- "remote-show-suffix": "",
235
- "reserve-keyword": "",
236
- "popper-class": "hidden-dropdown",
237
- class: "cascader-select"
238
- }, e.$attrs, {
239
- onChange: Z,
240
- onRemoveTag: Q
241
- }), {
242
- default: V(() => [
243
- (d(!0), k(se, null, re(p.value, (t) => (d(), w(y(de), {
244
- key: t.value,
245
- label: t.label,
246
- value: t.value
247
- }, null, 8, ["label", "value"]))), 128))
248
- ]),
249
- _: 1
250
- }, 16, ["modelValue", "multiple", "placeholder", "clearable", "collapse-tags", "collapse-tags-tooltip"])), [
251
- [o, $]
252
- ]),
253
- ie(y(ve), {
254
- ref_key: "popoverRef",
255
- ref: P,
256
- teleported: r.teleported,
257
- placement: a.placement,
258
- trigger: a.trigger,
259
- "popper-class": a.popperClass,
260
- "virtual-ref": x.value,
261
- onShow: N,
262
- onHide: W,
263
- "virtual-triggering": ""
264
- }, {
265
- default: V(() => [
266
- !b.value && c.value.length > 0 ? (d(), w(y(fe), {
267
- key: 0,
268
- modelValue: v.value,
269
- "onUpdate:modelValue": l[1] || (l[1] = (t) => v.value = t),
270
- border: !1,
271
- props: I,
272
- options: c.value,
273
- class: "select-cascader-panel",
274
- onChange: X,
275
- onExpandChange: Y
276
- }, null, 8, ["modelValue", "options"])) : (d(), k("div", he, ce(r.noDataText), 1)),
277
- b.value ? (d(), k("div", ye, "加载中...")) : ue("", !0)
278
- ]),
279
- _: 1
280
- }, 8, ["teleported", "placement", "trigger", "popper-class", "virtual-ref"])
281
- ]);
282
- };
283
- }
284
- }), Oe = me(Ce);
285
- export {
286
- Oe as Z
287
- };
@@ -1,57 +0,0 @@
1
- import { defineComponent as d, openBlock as u, createElementBlock as f, normalizeClass as h, createVNode as _, unref as g, mergeProps as A } from "vue";
2
- import { j as D, k } from "./vendor-CxcudVpO.js";
3
- import { D as p, a as E, L as m, b as M } from "./BaseItem-YGnpIugn.js";
4
- import { w as y } from "./utils-DRDkj6ga.js";
5
- const i = (e, l = E) => e ? D(e).format(l).replace("Invalid date", p) : p, O = (e) => typeof e == "number" ? !0 : typeof e == "string" ? !isNaN(parseFloat(e)) : !1;
6
- function P(e) {
7
- const l = ["角", "分"], c = ["零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"], s = [
8
- ["元", "万", "亿"],
9
- ["", "拾", "佰", "仟"]
10
- ], n = e < 0 ? "负" : "";
11
- e = Math.abs(e);
12
- let r = "";
13
- for (let a = 0; a < l.length; a++)
14
- r += (c[Math.floor(e * 10 * Math.pow(10, a)) % 10] + l[a]).replace(/零./, "");
15
- r = r || "整", e = Math.floor(e);
16
- for (let a = 0; a < s[0].length && e > 0; a++) {
17
- let t = "";
18
- for (let o = 0; o < s[1].length && e > 0; o++)
19
- t = c[e % 10] + s[1][o] + t, e = Math.floor(e / 10);
20
- r = t.replace(/(零.)*零$/, "").replace(/^$/, "零") + s[0][a] + r;
21
- }
22
- return n + r.replace(/(零.)*零元/, "元").replace(/(零.)+/g, "零").replace(/^整$/, "零元整");
23
- }
24
- const T = /* @__PURE__ */ d({
25
- name: "zh-date-picker",
26
- __name: "DatePicker",
27
- props: {
28
- style: {},
29
- class: {},
30
- modelValue: {}
31
- },
32
- emits: ["update:modelValue", "change"],
33
- setup(e, { emit: l }) {
34
- const c = e, s = l, n = (t) => Array.isArray(t) ? [i(t[0], m), i(t[1], M)] : t && i(t, m), r = (t) => {
35
- const o = n(t);
36
- s("update:modelValue", o);
37
- }, a = (t) => {
38
- const o = n(t);
39
- s("change", o);
40
- };
41
- return (t, o) => (u(), f("div", {
42
- class: h([c.class, "zh-date-picker"])
43
- }, [
44
- _(g(k), A(t.$attrs, {
45
- style: c.style,
46
- "model-value": c.modelValue,
47
- "onUpdate:modelValue": r,
48
- onChange: a
49
- }), null, 16, ["style", "model-value"])
50
- ], 2));
51
- }
52
- }), U = y(T);
53
- export {
54
- U as Z,
55
- P as d,
56
- O as v
57
- };
@@ -1,88 +0,0 @@
1
- import { defineComponent as b, useAttrs as v, useModel as k, openBlock as h, createElementBlock as I, normalizeClass as z, createVNode as S, unref as $, mergeProps as N, createSlots as x, renderList as _, withCtx as y, renderSlot as B, normalizeProps as M, guardReactiveProps as C, mergeModels as E, normalizeStyle as j } from "vue";
2
- import { s as P } from "./vendor-CxcudVpO.js";
3
- import { _ as U } from "./Button-DSjKm2wO.js";
4
- import { w as Z } from "./utils-DRDkj6ga.js";
5
- const A = /* @__PURE__ */ b({
6
- name: "zh-input",
7
- __name: "Input",
8
- props: /* @__PURE__ */ E({
9
- style: {},
10
- class: { default: "zh-default-input" },
11
- size: { default: "default" },
12
- className: {}
13
- }, {
14
- modelValue: {},
15
- modelModifiers: {}
16
- }),
17
- emits: ["update:modelValue"],
18
- setup(d) {
19
- const o = v(), r = d, s = k(d, "modelValue"), l = () => {
20
- (o.max || Number(o.max) === 0) && Number(s.value) >= o.max && (s.value = o.max.toString()), (o.min || Number(o.min) === 0) && Number(s.value) <= o.min && (s.value = o.min.toString());
21
- };
22
- return (m, p) => (h(), I("div", {
23
- class: z(r.class)
24
- }, [
25
- S($(P), N(m.$attrs, {
26
- modelValue: s.value,
27
- "onUpdate:modelValue": p[0] || (p[0] = (a) => s.value = a),
28
- size: m.size,
29
- onBlur: l
30
- }), x({ _: 2 }, [
31
- _(m.$slots, (a, g) => ({
32
- name: a,
33
- fn: y((t) => [
34
- B(m.$slots, a, M(C(t)), void 0, !0)
35
- ])
36
- }))
37
- ]), 1040, ["modelValue", "size"])
38
- ], 2));
39
- }
40
- }), H = /* @__PURE__ */ U(A, [["__scopeId", "data-v-ce1df798"]]), G = Z(H), L = /* @__PURE__ */ b({
41
- name: "zh-input-number",
42
- __name: "InputNumber",
43
- props: {
44
- style: {},
45
- class: {},
46
- modelValue: {}
47
- },
48
- emits: ["update:modelValue"],
49
- setup(d, { emit: o }) {
50
- const r = d, s = o, l = v(), m = (t, n = 0, u = 0, c = 0) => {
51
- let e = (t == null ? void 0 : t.toString()) ?? "", i, f, V;
52
- return u === 0 ? (e = e.replace(/[^\d]/g, ""), e = e.replace(/^0\d+/g, "0"), n !== 0 && (e = e.slice(0, n))) : (e = e.replace(/[^\-\d.]/g, ""), e = e.replace(/^[^\-\d]/g, ""), e = e.replace(/\.{2}/g, "."), e = e.replace(/^0(\d+)/g, "$1"), i = e.split(".") || [], i.length > 1 ? (n === 0 ? f = i[0] : f = i[0].slice(0, n), V = i[1].slice(0, u), e = f + "." + V) : n !== 0 && (e = e.slice(0, n))), c !== 0 && (e = e.slice(0, c)), e;
53
- }, p = () => {
54
- r.modelValue === "" || r.modelValue === void 0 || (l.max && Number(r.modelValue) > l.max && s("update:modelValue", l.max.toString()), l.min && Number(r.modelValue) < l.min && s("update:modelValue", l.min.toString()));
55
- }, a = (t) => t ? m(
56
- t,
57
- l.integer,
58
- l.precision,
59
- l.maxLength
60
- ) : "", g = (t) => {
61
- /^\d+\.0*$/.test((t == null ? void 0 : t.toString()) || "") || t === "" ? s("update:modelValue", a(t)) : s("update:modelValue", Number(a(t)));
62
- };
63
- return (t, n) => (h(), I("div", {
64
- class: z(["input-number", r.class]),
65
- style: j(r.style)
66
- }, [
67
- S($(P), N(t.$attrs, {
68
- "model-value": r.modelValue,
69
- "onUpdate:modelValue": g,
70
- onBlur: p,
71
- style: { width: "100%" },
72
- formatter: a
73
- }), x({ _: 2 }, [
74
- _(Object.keys(t.$slots), (u) => ({
75
- name: u,
76
- fn: y((c) => [
77
- B(t.$slots, u, M(C(c)), void 0, !0)
78
- ])
79
- }))
80
- ]), 1040, ["model-value"])
81
- ], 6));
82
- }
83
- }), O = /* @__PURE__ */ U(L, [["__scopeId", "data-v-920e8405"]]), J = Z(O);
84
- export {
85
- O as I,
86
- G as Z,
87
- J as a
88
- };