zhihao-ui 1.3.57 → 1.3.58-alpha.2

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 (56) hide show
  1. package/dist/es/BaseInfo-CD2tAAod.js +51 -0
  2. package/dist/es/BaseItem-DcezA7sa.js +127 -0
  3. package/dist/es/{Button-DlEYWX3X.js → Button-B2Z_WKdq.js} +2 -2
  4. package/dist/es/CascaderLoadMore-Bt031LmH.js +277 -0
  5. package/dist/es/{DatePicker-CymT2gjS.js → DatePicker-CP0KSqBs.js} +3 -3
  6. package/dist/es/{DetailHeader-DlAjiYhV.js → DetailHeader-DoaD0eKO.js} +3 -3
  7. package/dist/es/{DetailSubTitle-OH6TMyKI.js → DetailSubTitle-oiPuqJg6.js} +2 -2
  8. package/dist/es/{Dialog-B_Psb_wh.js → Dialog-BynyEy56.js} +3 -3
  9. package/dist/es/{DiyDataTable-DRuRQedj.js → DiyDataTable-Bwk_tQDp.js} +9 -7
  10. package/dist/es/{EditInfoPair-B3TKNnnl.js → EditInfoPair-BRkRrmJI.js} +3 -3
  11. package/dist/es/{FileWrapper-bVyPV48o.js → FileWrapper-Bw-FhIY5.js} +4 -4
  12. package/dist/es/{Grid-CLU3cdzX.js → Grid-Cndtkriq.js} +35 -34
  13. package/dist/es/{InfoPair-nPqi45Ys.js → InfoPair-CIuXeXV1.js} +3 -3
  14. package/dist/es/{Input-DjQtffZg.js → Input-EcnKRK5Q.js} +3 -3
  15. package/dist/es/{Loading-CDxuHkdt.js → Loading-Mq3IiaFA.js} +2 -2
  16. package/dist/es/Map-CxCxmeGO.js +2560 -0
  17. package/dist/es/{MessageBox-kkpNeAii.js → MessageBox-wQY1ft63.js} +2 -2
  18. package/dist/es/{MoneyInput-ZLGQmpLk.js → MoneyInput-DZuOujIc.js} +5 -5
  19. package/dist/es/{PageHeadPanel-DsEeXTgj.js → PageHeadPanel-B2Uqf3zz.js} +2 -2
  20. package/dist/es/{Table-gFH87j_O.js → Table-NT97DzT0.js} +155 -155
  21. package/dist/es/{ToolTips-BRjrysPf.js → ToolTips-CVkx0nFU.js} +3 -3
  22. package/dist/es/index.js +60 -60
  23. package/dist/es/{utils-B-n1yx0L.js → utils-vqG84sMo.js} +1 -1
  24. package/dist/es/{vendor-DkGhDRdQ.js → vendor-MMWA2y7U.js} +29 -28
  25. package/dist/index.css +1 -1
  26. package/dist/types/components/BaseInfo/BaseInfo.vue.d.ts +2 -2
  27. package/dist/types/components/BaseInfo/index.d.ts +33 -33
  28. package/dist/types/components/BaseItem/BaseItem.vue.d.ts +1 -1
  29. package/dist/types/components/BaseItem/index.d.ts +24 -24
  30. package/dist/types/components/DetailSubTitle/index.d.ts +1 -0
  31. package/dist/types/components/DiyDataTable/DiyDataTable.vue.d.ts +32 -6
  32. package/dist/types/components/DiyDataTable/index.d.ts +96 -18
  33. package/dist/types/components/DiyDataTable/type.d.ts +1 -1
  34. package/dist/types/components/Grid/Grid.vue.d.ts +1 -1
  35. package/dist/types/components/Grid/index.d.ts +15 -15
  36. package/dist/types/components/Input/Input.vue.d.ts +6 -6
  37. package/dist/types/components/Input/index.d.ts +9 -9
  38. package/dist/types/components/Map/Map.vue.d.ts +9 -1
  39. package/dist/types/components/Map/function/drawPolygon.d.ts +1 -1
  40. package/dist/types/components/Map/function/event.d.ts +2 -1
  41. package/dist/types/components/Map/function/map.d.ts +2 -0
  42. package/dist/types/components/Map/function/renderPolygon.d.ts +24 -0
  43. package/dist/types/components/Map/function/ship/index.d.ts +1 -1
  44. package/dist/types/components/Map/function/ship/style.d.ts +5 -3
  45. package/dist/types/components/Map/index.d.ts +27 -3
  46. package/dist/types/components/Map/meta/index.d.ts +2 -1
  47. package/dist/types/components/MoneyInput/MoneyInput.vue.d.ts +4 -4
  48. package/dist/types/components/MoneyInput/index.d.ts +6 -6
  49. package/dist/types/components/Table/types.d.ts +2 -2
  50. package/dist/umd/index.css +1 -1
  51. package/dist/umd/index.umd.cjs +57 -58
  52. package/package.json +1 -1
  53. package/dist/es/BaseInfo-ehtLJvVF.js +0 -53
  54. package/dist/es/BaseItem-6LMSv4Je.js +0 -130
  55. package/dist/es/CascaderLoadMore-DKTvm00E.js +0 -287
  56. package/dist/es/Map-CmcmvvxF.js +0 -2363
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zhihao-ui",
3
- "version": "1.3.57",
3
+ "version": "1.3.58-alpha.2",
4
4
  "description": "components",
5
5
  "type": "module",
6
6
  "main": "./dist/umd/index.umd.cjs",
@@ -1,53 +0,0 @@
1
- import { defineComponent as h, ref as o, provide as n, watch as i, resolveComponent as p, openBlock as m, createBlock as W, withCtx as v, renderSlot as b } from "vue";
2
- import { w as g } from "./utils-B-n1yx0L.js";
3
- const C = /* @__PURE__ */ h({
4
- name: "ZhBaseInfo",
5
- __name: "BaseInfo",
6
- props: {
7
- contentWidth: { default: void 0 },
8
- labelWidth: { default: "70px" },
9
- infoDirection: { default: "vertical" },
10
- cols: { default: 5 },
11
- gap: { default: 16 }
12
- },
13
- setup(r) {
14
- const t = r, a = o(), l = o(), c = o();
15
- n("infoLabelWidth", a), n("infoContentWidth", l), n("infoDirection", c);
16
- function d() {
17
- a.value = t.labelWidth;
18
- }
19
- function f() {
20
- l.value = t.contentWidth;
21
- }
22
- function s() {
23
- c.value = t.infoDirection;
24
- }
25
- return i(
26
- () => t.contentWidth,
27
- () => f(),
28
- { immediate: !0 }
29
- ), i(
30
- () => t.labelWidth,
31
- () => d(),
32
- { immediate: !0 }
33
- ), i(
34
- () => t.infoDirection,
35
- () => s(),
36
- { immediate: !0 }
37
- ), (e, D) => {
38
- const u = p("grid");
39
- return m(), W(u, {
40
- cols: e.cols,
41
- gap: e.gap
42
- }, {
43
- default: v(() => [
44
- b(e.$slots, "default")
45
- ]),
46
- _: 3
47
- }, 8, ["cols", "gap"]);
48
- };
49
- }
50
- }), I = g(C);
51
- export {
52
- I as Z
53
- };
@@ -1,130 +0,0 @@
1
- import { defineComponent as z, useSlots as R, inject as T, computed as n, ref as M, watchEffect as A, openBlock as t, createBlock as u, unref as s, withCtx as d, createElementVNode as h, normalizeClass as m, normalizeStyle as W, resolveDynamicComponent as k, createElementBlock as i, toDisplayString as o, renderSlot as S, Fragment as v, withModifiers as V, createTextVNode as f, createVNode as p, createCommentVNode as O } from "vue";
2
- import { E as D, a as Z, d as g } from "./vendor-DkGhDRdQ.js";
3
- import { Z as G } from "./Grid-CLU3cdzX.js";
4
- import { w as U } from "./utils-B-n1yx0L.js";
5
- const b = "--", X = "YYYY-MM-DDTHH:mm:ss", x = "YYYY-MM-DDT23:59:59", ee = "YYYY-MM-DD", le = "https://static.zhihaoscm.cn/", _ = { key: 1 }, H = {
6
- key: 1,
7
- class: "zh-base-item--value--file"
8
- }, $ = { key: 2 }, j = /* @__PURE__ */ z({
9
- name: "ZhBaseItem",
10
- __name: "BaseItem",
11
- props: {
12
- label: {},
13
- labelRender: {},
14
- colon: { type: Boolean, default: !1 },
15
- value: {},
16
- fileId: {},
17
- rewriteFileName: {},
18
- valueRender: {},
19
- onClick: {},
20
- labelWidth: {},
21
- infoDirection: { default: "horizontal" },
22
- defaultValue: { default: b },
23
- className: {},
24
- labelClassName: {},
25
- valueClassName: {},
26
- span: { default: 1 },
27
- showFileName: { type: Boolean, default: !0 },
28
- fetchFileById: {}
29
- },
30
- setup(C) {
31
- const I = R(), l = C, w = T(
32
- "infoLabelWidth",
33
- void 0
34
- ), F = n(() => !!(l.onClick && l.value)), y = n(() => !!(!l.value && l.fileId)), c = M(), E = n(() => {
35
- var a;
36
- const e = (a = c.value) == null ? void 0 : a.name;
37
- if (!e)
38
- return "";
39
- if (l.rewriteFileName) {
40
- const r = e.substring(e.lastIndexOf("."));
41
- return l.rewriteFileName + r;
42
- }
43
- return e;
44
- }), B = n(() => {
45
- const e = {}, a = l.labelWidth || w;
46
- return a && l.infoDirection === "horizontal" && (isNaN(Number(a)) ? e.width = a : e.width = a + "px"), e;
47
- }), L = n(() => ({
48
- ...B.value
49
- })), Y = n(() => l.value === "" ? b : l.value ?? b);
50
- return A(async () => {
51
- !y.value || !l.fileId || !l.fetchFileById || (c.value = await l.fetchFileById(l.fileId));
52
- }), (e, a) => (t(), u(s(G), {
53
- span: e.span,
54
- label: e.label
55
- }, {
56
- default: d((r) => {
57
- var N;
58
- return [
59
- h("div", {
60
- class: m(["zh-base-item", [e.infoDirection, e.className]])
61
- }, [
62
- h("div", {
63
- class: m(["zh-base-item-label", [e.infoDirection, e.labelClassName]]),
64
- style: W({
65
- width: e.infoDirection === "horizontal" && r.maxLabelWidthInCol ? r.maxLabelWidthInCol + "px" : void 0,
66
- ...L.value
67
- })
68
- }, [
69
- e.labelRender ? (t(), u(k(e.labelRender), { key: 0 })) : (t(), i("span", _, o(e.label) + o(e.colon ? ":" : ""), 1))
70
- ], 6),
71
- h("div", {
72
- class: m(["zh-base-item-value", e.valueClassName])
73
- }, [
74
- s(I).value ? S(e.$slots, "value", {
75
- key: 0,
76
- content: e.value
77
- }) : (t(), i(v, { key: 1 }, [
78
- F.value ? (t(), u(s(D), {
79
- key: 0,
80
- type: "primary",
81
- class: "zh-base-item--value--link",
82
- onClick: a[0] || (a[0] = V((K) => e.onClick && e.onClick(e.value), ["stop"]))
83
- }, {
84
- default: d(() => [
85
- f(o(e.value), 1)
86
- ]),
87
- _: 1
88
- })) : y.value ? (t(), i("div", H, [
89
- e.showFileName ? (t(), i(v, { key: 0 }, [
90
- p(s(Z), { class: "iconfont" }, {
91
- default: d(() => [
92
- p(s(g))
93
- ]),
94
- _: 1
95
- }),
96
- f(" " + o(E.value), 1)
97
- ], 64)) : O("", !0),
98
- p(s(D), {
99
- type: "primary",
100
- href: (N = c.value) == null ? void 0 : N.path,
101
- target: "_blank",
102
- class: m({ "ml-8": e.showFileName })
103
- }, {
104
- default: d(() => a[1] || (a[1] = [
105
- f(" 查看/下载 ")
106
- ])),
107
- _: 1
108
- }, 8, ["href", "class"])
109
- ])) : e.valueRender ? (t(), i("div", $, [
110
- (t(), u(k(e.valueRender)))
111
- ])) : (t(), i(v, { key: 3 }, [
112
- f(o(Y.value), 1)
113
- ], 64))
114
- ], 64))
115
- ], 2)
116
- ], 2)
117
- ];
118
- }),
119
- _: 3
120
- }, 8, ["span", "label"]));
121
- }
122
- }), ae = U(j);
123
- export {
124
- le as C,
125
- b as D,
126
- X as L,
127
- ae as Z,
128
- ee as a,
129
- x as b
130
- };
@@ -1,287 +0,0 @@
1
- import { defineComponent as ae, useModel as oe, ref as s, watch as R, nextTick as g, withDirectives as se, openBlock as h, createElementBlock as k, createVNode as A, unref as S, withCtx as B, createBlock as W, toDisplayString as ne, createCommentVNode as re, mergeProps as ce, Fragment as ie, renderList as ue, mergeModels as $ } from "vue";
2
- import { e as H, f as pe, g as de, h as ve, i as fe, C as me } from "./vendor-DkGhDRdQ.js";
3
- import { w as ge } from "./utils-B-n1yx0L.js";
4
- const he = { class: "w-100" }, ye = {
5
- key: 1,
6
- class: "cascader-select-empty"
7
- }, Ce = {
8
- key: 2,
9
- class: "loading"
10
- }, Se = /* @__PURE__ */ ae({
11
- name: "CascaderLoadMore",
12
- __name: "CascaderLoadMore",
13
- props: /* @__PURE__ */ $({
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
- },
84
- teleported: {
85
- type: Boolean,
86
- default: !1
87
- },
88
- noDataText: {
89
- type: String,
90
- default: "暂无数据"
91
- }
92
- }, {
93
- modelValue: {},
94
- modelModifiers: {}
95
- }),
96
- emits: /* @__PURE__ */ $(["change", "removeTag"], ["update:modelValue"]),
97
- setup(p, { expose: I, emit: N }) {
98
- const o = p, c = oe(p, "modelValue"), f = s(c.value || []), m = s(!1), d = s({
99
- page: 1,
100
- size: o.pageSize
101
- }), b = s(void 0), T = s(!1), E = s(!0), v = s(o.initialOptions || []), n = s(o.initialOptions || []), y = s(void 0), O = s(!1), U = {
102
- expandTrigger: "hover",
103
- checkStrictly: !1,
104
- multiple: o.multiple,
105
- emitPath: !0,
106
- ...o.cascaderProps
107
- }, D = s(), q = s(), j = () => {
108
- m.value = !0;
109
- }, Z = () => {
110
- m.value = !1;
111
- }, Q = (e) => {
112
- const l = /* @__PURE__ */ new Map();
113
- return (e || []).forEach((t) => {
114
- const a = `${t.value}`;
115
- l.has(a) || l.set(a, t);
116
- }), Array.from(l.values());
117
- };
118
- function V(e) {
119
- const l = [];
120
- function t(a, i = "") {
121
- const r = i && (o.cascaderProps.emitPath ?? !0) ? `${i}/${a.label}` : a.label;
122
- l.push({
123
- ...a,
124
- value: a.value,
125
- label: r
126
- // 如果需要保留原始路径结构,可加上 fullPath 字段
127
- // fullPath: currentPath
128
- }), a.children && a.children.length > 0 && a.children.forEach((u) => t(u, r));
129
- }
130
- return e.forEach((a) => t(a)), l;
131
- }
132
- const x = async (e) => {
133
- var i;
134
- if (!o.forceSearch && !e) return;
135
- const l = y.value === e || !y.value && !e;
136
- if (l || (d.value.page = 1), l && b.value !== void 0 && d.value.page > b.value && !O.value) return;
137
- O.value = !1, T.value = !0, n.value.length === 0 && (E.value = !0);
138
- const a = await o.requestFunction(d.value.page, d.value.size, e);
139
- if (a && Object.keys(a).length) {
140
- b.value = a.totalPage;
141
- const r = (i = a == null ? void 0 : a.list) == null ? void 0 : i.map(o.handleOptionsFunction);
142
- l && d.value.page !== 1 ? n.value = Q([...n.value, ...r]) : n.value = r || [], f.value = H(c.value), v.value = V(n.value);
143
- }
144
- g(() => {
145
- z();
146
- }), y.value = e, T.value = !1, n.value.length !== 0 && (E.value = !1);
147
- }, G = () => {
148
- d.value.page = d.value.page + 1, x(y.value);
149
- }, J = (e) => {
150
- c.value = e, f.value = e;
151
- const l = M(e), t = o.onChange;
152
- t && t(e, l);
153
- }, M = (e) => {
154
- const l = e || c.value;
155
- return o.multiple ? v.value.filter(
156
- (t) => (l || []).includes(t.value)
157
- ) : v.value.find((t) => t.value === l);
158
- }, K = () => {
159
- c.value = o.initialValue, f.value = o.initialValue, d.value.page = 1, d.value.size = o.pageSize, v.value = o.initialOptions || [], n.value = o.initialOptions || [], b.value = void 0, y.value = void 0;
160
- }, w = N;
161
- R(
162
- () => o.initialOptions,
163
- () => {
164
- v.value = V(o.initialOptions), console.log("options.value", v.value), n.value = o.initialOptions;
165
- },
166
- { immediate: !0 }
167
- );
168
- const X = (e) => {
169
- w("removeTag", e);
170
- }, Y = (e) => {
171
- O.value = e;
172
- }, P = s(null), C = s(null), L = () => {
173
- if (!m.value) return;
174
- const e = q.value.popperRef.contentRef, l = e == null ? void 0 : e.querySelector(".el-cascader-panel .el-scrollbar__wrap");
175
- l && (P.value = l, C.value = () => _(l), l.addEventListener("scroll", C.value));
176
- }, F = () => {
177
- P.value && C.value && (P.value.removeEventListener("scroll", C.value), P.value = null, C.value = null);
178
- }, _ = (e) => {
179
- const { scrollTop: l, scrollHeight: t, clientHeight: a } = e;
180
- let i = t - l;
181
- a + 10 > i && G();
182
- };
183
- g(() => L()), R(m, (e) => {
184
- e ? (console.log("visible", e), g(() => L())) : F();
185
- }), R(n, (e) => {
186
- e != null && e.length && m.value ? g(() => L()) : F();
187
- });
188
- const ee = async (e) => {
189
- (o.cascaderProps.emitPath ?? !0) && Array.isArray(e) ? o.multiple ? c.value = e.map((a) => a.at(-1)) : c.value = e.at(-1) : c.value = H(f.value), await g();
190
- const l = M(c.value);
191
- w("change", e, l);
192
- const t = o.onChange;
193
- t && t(e, l);
194
- }, z = () => {
195
- var i;
196
- const e = q.value.popperRef.contentRef, l = e.querySelectorAll(".el-cascader-node__label"), t = (i = D.value) == null ? void 0 : i.$el, a = e == null ? void 0 : e.querySelector(".cascader-select-empty");
197
- if (t && a) {
198
- const r = t.offsetWidth;
199
- a.style.width = `${r}px`;
200
- }
201
- l.forEach((r) => {
202
- const u = document.createElement("span");
203
- u.style.visibility = "hidden", u.style.position = "absolute", u.style.whiteSpace = "nowrap", u.style.font = window.getComputedStyle(r).font, u.textContent = r.textContent || "", document.body.appendChild(u);
204
- const te = u.offsetWidth;
205
- document.body.removeChild(u), r instanceof HTMLElement && (r.style.whiteSpace = te > 240 ? "break-spaces" : "nowrap");
206
- });
207
- }, le = () => {
208
- g(() => {
209
- z();
210
- });
211
- };
212
- return I({
213
- reset: K,
214
- getSelectedOption: M,
215
- remoteMethod: x,
216
- handleRequestParamsChanged: Y,
217
- options: v,
218
- cascderOptions: n
219
- }), (e, l) => se((h(), k("div", he, [
220
- A(S(pe), {
221
- ref_key: "popoverRef",
222
- ref: q,
223
- teleported: p.teleported,
224
- placement: o.placement,
225
- trigger: o.trigger,
226
- "popper-class": "warp-cascade-panel " + o.popperClass,
227
- visible: m.value
228
- }, {
229
- reference: B(() => [
230
- A(S(ve), ce({
231
- ref_key: "remoteSelectRef",
232
- ref: D,
233
- modelValue: c.value,
234
- "onUpdate:modelValue": l[0] || (l[0] = (t) => c.value = t),
235
- multiple: p.multiple,
236
- placeholder: p.placeholder,
237
- "remote-method": x,
238
- teleported: !0,
239
- clearable: p.clearable,
240
- "collapse-tags": p.collapseTags,
241
- "collapse-tags-tooltip": p.collapseTagsTooltip,
242
- filterable: "",
243
- height: "300",
244
- remote: "",
245
- "remote-show-suffix": "",
246
- "reserve-keyword": "",
247
- "popper-class": "hidden-dropdown",
248
- class: "cascader-select"
249
- }, e.$attrs, {
250
- onClick: j,
251
- onChange: J,
252
- onRemoveTag: X
253
- }), {
254
- default: B(() => [
255
- (h(!0), k(ie, null, ue(v.value, (t) => (h(), W(S(fe), {
256
- key: t.value,
257
- label: t.label,
258
- value: t.value
259
- }, null, 8, ["label", "value"]))), 128))
260
- ]),
261
- _: 1
262
- }, 16, ["modelValue", "multiple", "placeholder", "clearable", "collapse-tags", "collapse-tags-tooltip"])
263
- ]),
264
- default: B(() => [
265
- !E.value && n.value.length > 0 ? (h(), W(S(de), {
266
- key: 0,
267
- modelValue: f.value,
268
- "onUpdate:modelValue": l[1] || (l[1] = (t) => f.value = t),
269
- border: !1,
270
- props: U,
271
- options: n.value,
272
- class: "select-cascader-panel",
273
- onChange: ee,
274
- onExpandChange: le
275
- }, null, 8, ["modelValue", "options"])) : (h(), k("div", ye, ne(p.noDataText), 1)),
276
- T.value ? (h(), k("div", Ce, "加载中...")) : re("", !0)
277
- ]),
278
- _: 1
279
- }, 8, ["teleported", "placement", "trigger", "popper-class", "visible"])
280
- ])), [
281
- [S(me), Z]
282
- ]);
283
- }
284
- }), Te = ge(Se);
285
- export {
286
- Te as Z
287
- };