zhihao-ui 1.3.52 → 1.3.53

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 (46) hide show
  1. package/dist/es/{BaseInfo-Cu3ME-K_.js → BaseInfo-BZ34efZZ.js} +1 -1
  2. package/dist/es/{BaseItem-Co7KlYD6.js → BaseItem-DxfKmzHN.js} +3 -3
  3. package/dist/es/{Button-Dp3Eoz3O.js → Button-ByWikGvS.js} +2 -2
  4. package/dist/es/CascaderLoadMore-CF_J-i8H.js +261 -0
  5. package/dist/es/{DatePicker-BilQVlgi.js → DatePicker-BS2zGuNF.js} +6 -6
  6. package/dist/es/{DetailHeader-DTHE-pQa.js → DetailHeader-Bdjj2rT_.js} +3 -3
  7. package/dist/es/{DetailSubTitle-BG-q2NNN.js → DetailSubTitle-oDZVGEDj.js} +2 -2
  8. package/dist/es/{Dialog-B0N_UsO3.js → Dialog-6oittA9s.js} +3 -3
  9. package/dist/es/DiyDataTable-BzfRDF0J.js +366 -0
  10. package/dist/es/{EditInfoPair-DwrwCanm.js → EditInfoPair-CZXKGl2-.js} +3 -3
  11. package/dist/es/{FileWrapper-BDK8YvRB.js → FileWrapper-B4nZf2F1.js} +4 -4
  12. package/dist/es/{Grid-pVjqXcmJ.js → Grid-anvIeL2d.js} +2 -2
  13. package/dist/es/{InfoPair-lu2zDhpQ.js → InfoPair-C6PjunKe.js} +3 -3
  14. package/dist/es/{Input-Du4ztfNG.js → Input-v0wMSltt.js} +14 -14
  15. package/dist/es/{Loading-Dc9138dn.js → Loading-C86LqgY4.js} +2 -2
  16. package/dist/es/{Map-BTSSoA-T.js → Map-CGiEKZ7_.js} +3 -3
  17. package/dist/es/{MessageBox-CJMqwEqr.js → MessageBox-Mt0l51rJ.js} +2 -2
  18. package/dist/es/{MoneyInput-CJxSKPIk.js → MoneyInput-DU9wly48.js} +5 -5
  19. package/dist/es/{PageHeadPanel-BChW8Tal.js → PageHeadPanel-CJNtdEZb.js} +2 -2
  20. package/dist/es/Table-BgW-kh7S.js +1177 -0
  21. package/dist/es/{ToolTips-Y6yG2q7L.js → ToolTips-DtkJa3Ld.js} +3 -3
  22. package/dist/es/index.js +43 -40
  23. package/dist/es/{utils-Co2iJhr8.js → utils-BXhGHET2.js} +3 -3
  24. package/dist/es/{vendor-Crdostgq.js → vendor-DIFwbdTH.js} +12157 -11172
  25. package/dist/index.css +1 -1
  26. package/dist/types/components/BaseItem/BaseItem.vue.d.ts +1 -1
  27. package/dist/types/components/BaseItem/index.d.ts +10 -10
  28. package/dist/types/components/BaseItem/types.d.ts +1 -1
  29. package/dist/types/components/CascaderLoadMore/CascaderLoadMore.vue.d.ts +2 -0
  30. package/dist/types/components/CascaderLoadMore/index.d.ts +5 -0
  31. package/dist/types/components/DetailHeader/index.d.ts +3 -3
  32. package/dist/types/components/DetailHeader/types.d.ts +1 -1
  33. package/dist/types/components/Dialog/Dialog.vue.d.ts +12 -12
  34. package/dist/types/components/Dialog/index.d.ts +18 -18
  35. package/dist/types/components/DiyDataTable/DiyDataTable.vue.d.ts +386 -1
  36. package/dist/types/components/DiyDataTable/index.d.ts +1131 -0
  37. package/dist/types/components/DiyDataTable/type.d.ts +17 -1
  38. package/dist/types/components/Table/types.d.ts +1 -0
  39. package/dist/types/components/Table/utils.d.ts +4 -0
  40. package/dist/types/components/ToolTips/index.d.ts +12 -12
  41. package/dist/types/components/index.d.ts +1 -0
  42. package/dist/umd/index.css +1 -1
  43. package/dist/umd/index.umd.cjs +70 -50
  44. package/package.json +1 -1
  45. package/dist/es/DiyDataTable-BQaaClFf.js +0 -331
  46. package/dist/es/Table-CzNjEPnP.js +0 -1155
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zhihao-ui",
3
- "version": "1.3.52",
3
+ "version": "1.3.53",
4
4
  "description": "components",
5
5
  "type": "module",
6
6
  "main": "./dist/umd/index.umd.cjs",
@@ -1,331 +0,0 @@
1
- import { defineComponent as Z, useModel as P, ref as V, openBlock as i, createBlock as v, unref as n, withCtx as p, createVNode as c, mergeProps as z, createElementBlock as u, Fragment as b, renderList as X, normalizeClass as _, toDisplayString as m, renderSlot as E, createTextVNode as x, createCommentVNode as w, createElementVNode as k, mergeModels as j } from "vue";
2
- import { D as $ } from "./BaseItem-Co7KlYD6.js";
3
- import { g as C, i as F, j as K, k as G, l as D, m as M, n as J, o as L, b as S } from "./vendor-Crdostgq.js";
4
- import { _ as Q } from "./Button-Dp3Eoz3O.js";
5
- import { w as Y } from "./utils-Co2iJhr8.js";
6
- var g = /* @__PURE__ */ ((f) => (f.AUTOCOMPLETE = "autocomplete", f.FORMAT = "format", f.TEXT = "text", f))(g || {});
7
- const ee = { key: 0 }, te = {
8
- key: 1,
9
- class: "col-edit-header"
10
- }, ae = ["onClick"], re = { key: 0 }, oe = { class: "header-operation-container" }, le = { class: "operation-container" }, de = ["onClick"], U = "$ZH_DIV$", ie = /* @__PURE__ */ Z({
11
- name: "zh-diy-data-table",
12
- __name: "DiyDataTable",
13
- props: /* @__PURE__ */ j({
14
- isEdit: { type: Boolean, default: !1 },
15
- maxRowLength: { default: 50 },
16
- maxColLength: { default: 10 },
17
- defaultMinWidth: { default: 120 },
18
- beforeAddRow: {},
19
- addRowText: { default: "增行" },
20
- addColumnText: { default: "增列" },
21
- customAddRow: { type: Boolean, default: !0 },
22
- customAddColumn: { type: Boolean, default: !0 }
23
- }, {
24
- rawData: { required: !0 },
25
- rawDataModifiers: {}
26
- }),
27
- emits: ["update:rawData"],
28
- setup(f, { expose: I }) {
29
- const h = f, s = P(f, "rawData"), l = V([]), A = () => {
30
- if (s.value.length === h.maxRowLength) {
31
- C({
32
- message: `最多添加${h.maxRowLength}行`,
33
- type: "warning"
34
- });
35
- return;
36
- }
37
- let t = {};
38
- h.beforeAddRow && (t = h.beforeAddRow(s.value)), s.value.push(t);
39
- }, R = () => {
40
- if (l.value.filter((e) => e.isAdd).length >= h.maxColLength) {
41
- C({
42
- message: `最多添加${h.maxColLength}列`,
43
- type: "warning"
44
- });
45
- return;
46
- }
47
- const a = String(Date.now());
48
- l.value.push({
49
- prop: a,
50
- label: "",
51
- isEditHeader: !0,
52
- isAdd: !0,
53
- maxlength: 15,
54
- minWidth: 150,
55
- headerMaxlength: 15
56
- });
57
- }, O = (t, a) => {
58
- l.value.splice(t, 1), s.value.forEach((e) => {
59
- delete e[a.prop];
60
- });
61
- }, B = (t) => {
62
- t === 0 && l.value.forEach((a) => {
63
- a.isSameData && (s.value[1][a.prop] = s.value[0][a.prop]);
64
- }), s.value.splice(t, 1);
65
- }, q = (t, a, e) => {
66
- a(
67
- e.completeList.filter((o) => o.includes(t)).map((o) => ({ value: o }))
68
- );
69
- }, H = (t) => [
70
- {
71
- validator: (a, e, o) => {
72
- if (!l.value[t].label) {
73
- o(new Error("请输入表头"));
74
- return;
75
- }
76
- o();
77
- },
78
- message: "请输入表头",
79
- trigger: ["blur", "change"]
80
- }
81
- ], N = (t) => {
82
- const a = [];
83
- return t.required && a.push({
84
- required: !0,
85
- message: "请输入" + t.label,
86
- trigger: t.slot ? void 0 : "blur"
87
- }), t.varidate && a.push({
88
- validator: (e, o, r) => {
89
- const d = t.varidate(o);
90
- d !== !0 ? r(new Error(d)) : r();
91
- },
92
- trigger: t.slot ? void 0 : "blur"
93
- }), a;
94
- }, W = (t, a) => {
95
- let e = t;
96
- return a.isSameData && (e = s.value[0] || $), a.formatter ? a.showFormatter ? a.type === g.FORMAT ? a.showFormatter(a.formatter(e)) : a.showFormatter(e[a.prop]) : a.formatter(e[a.prop]) : e[a.prop] || $;
97
- }, T = V();
98
- return I({
99
- /** 初始化数据 */
100
- initData: (t, a) => {
101
- console.log("initData", t, a), t = F(t) || [], t.length === 0 && t.push({}), a = [...a];
102
- for (const e in t[0])
103
- if (!a.some(
104
- (o) => o.prop === e
105
- )) {
106
- const o = Date.now() + e, r = e.split(U);
107
- if (r.length !== 2) {
108
- console.log("keySplit 失败", e);
109
- continue;
110
- }
111
- const d = Number(r[1]);
112
- a[d] = {
113
- prop: e,
114
- isEditHeader: !0,
115
- label: r[0],
116
- key: o,
117
- isAdd: !0,
118
- maxlength: 15,
119
- headerMaxlength: 15
120
- };
121
- }
122
- s.value = t, l.value = a;
123
- },
124
- /** 获取数据 */
125
- getData: async () => {
126
- await T.value.validate();
127
- for (const a in l.value) {
128
- const e = l.value[a];
129
- for (const o of l.value)
130
- if (e.prop !== o.prop && e.label === o.label) {
131
- C({
132
- message: "所有列的表头不可重复",
133
- type: "warning"
134
- });
135
- return;
136
- }
137
- }
138
- const t = F(s.value);
139
- for (const a in t) {
140
- const e = t[a];
141
- for (const o in l.value) {
142
- const r = l.value[o];
143
- if (r.isSameData && a !== "0" && (e[r.prop] = t[0][r.prop]), r.varidate && !r.varidate(e[r.prop]))
144
- return;
145
- if (r.isAdd) {
146
- const d = e[r.prop];
147
- delete e[r.prop];
148
- const y = r.label + U + o;
149
- e[y] = d;
150
- }
151
- r.formatter && r.type === g.FORMAT && (e[r.prop] = r.formatter(e));
152
- }
153
- }
154
- return console.log("DiyDataTable 获取数据", t, l.value), {
155
- data: t,
156
- columns: l.value
157
- };
158
- },
159
- /** 更新列配置数据 */
160
- updateColumn: (t, a) => {
161
- const e = l.value[t].prop;
162
- if (l.value[t] = a, e !== a.prop)
163
- for (const o of s.value)
164
- o[a.prop] = o[e], delete o[e];
165
- },
166
- /** 重置默认列配置数据 */
167
- resetColumns: (t) => {
168
- const e = l.value.filter((r) => !r.isAdd).reduce((r, d) => (t.some((y) => y.prop === d.prop) || r.push(d.prop), r), []);
169
- s.value.forEach((r) => {
170
- e.forEach((d) => {
171
- delete r[d];
172
- });
173
- });
174
- const o = t.filter((r) => r.isAdd);
175
- l.value = [...t, ...o];
176
- },
177
- onAddRow: A,
178
- onAddColumn: R
179
- }), (t, a) => (i(), v(n(K), {
180
- class: "diy-data-table",
181
- model: f.rawData,
182
- ref_key: "formRef",
183
- ref: T
184
- }, {
185
- default: p(() => [
186
- c(n(G), z({ data: s.value }, t.$attrs), {
187
- default: p(() => [
188
- c(n(D), {
189
- type: "index",
190
- label: "序号",
191
- width: "132",
192
- fixed: "left"
193
- }),
194
- (i(!0), u(b, null, X(l.value, (e, o) => (i(), v(n(D), {
195
- key: e.key || o,
196
- prop: e.prop,
197
- label: e.label,
198
- width: e.width,
199
- "min-width": e.minWidth || t.defaultMinWidth,
200
- fixed: e.fixed
201
- }, {
202
- header: p(() => [
203
- t.isEdit ? e.isEditHeader ? (i(), u("div", te, [
204
- c(n(M), {
205
- prop: `columns.${o}`,
206
- rules: H(o)
207
- }, {
208
- default: p(() => [
209
- c(n(L), {
210
- modelValue: e.label,
211
- "onUpdate:modelValue": (r) => e.label = r,
212
- maxlength: e.headerMaxlength || 20,
213
- placeholder: "请输入表头"
214
- }, null, 8, ["modelValue", "onUpdate:modelValue", "maxlength"])
215
- ]),
216
- _: 2
217
- }, 1032, ["prop", "rules"]),
218
- e.isAdd ? (i(), u("i", {
219
- key: 0,
220
- class: "iconfont icon-close",
221
- onClick: (r) => O(o, e)
222
- }, null, 8, ae)) : w("", !0)
223
- ])) : (i(), u("div", {
224
- key: 2,
225
- class: _({ "is-required-label": e.required })
226
- }, m(e.label), 3)) : (i(), u("div", ee, m(e.label), 1))
227
- ]),
228
- default: p((r) => [
229
- h.isEdit && (!e.isSameData || r.$index === 0) && e.type !== n(g).TEXT ? (i(), v(n(M), {
230
- key: 0,
231
- prop: `${r.$index}.${e.prop}`,
232
- rules: N(e),
233
- class: _(["col-edit-container", { "close-padding": e.isAdd }])
234
- }, {
235
- default: p(() => [
236
- e.type === n(g).FORMAT && e.formatter ? (i(), u("div", re, m(e.showFormatter ? e.showFormatter(
237
- e.formatter(r.row)
238
- ) : e.formatter(r.row)), 1)) : e.type === n(g).AUTOCOMPLETE ? (i(), v(n(J), {
239
- key: 1,
240
- modelValue: r.row[e.prop],
241
- "onUpdate:modelValue": (d) => r.row[e.prop] = d,
242
- placeholder: e.placeholder || "请输入",
243
- "fetch-suggestions": (d, y) => q(d, y, e),
244
- maxlength: e.maxlength || 20
245
- }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "fetch-suggestions", "maxlength"])) : e.slot ? E(t.$slots, e.slot, {
246
- key: 2,
247
- row: r.row,
248
- $index: r.$index
249
- }, void 0, !0) : (i(), v(n(L), {
250
- key: 3,
251
- modelValue: r.row[e.prop],
252
- "onUpdate:modelValue": (d) => r.row[e.prop] = d,
253
- placeholder: e.placeholder || "请输入",
254
- formatter: e.formatter,
255
- parser: e.parser,
256
- maxlength: e.maxlength || 20
257
- }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "formatter", "parser", "maxlength"]))
258
- ]),
259
- _: 2
260
- }, 1032, ["prop", "rules", "class"])) : e.slot ? E(t.$slots, e.slot, {
261
- key: 1,
262
- row: r.row,
263
- $index: r.$index
264
- }, void 0, !0) : (i(), u(b, { key: 2 }, [
265
- x(m(W(r.row, e)), 1)
266
- ], 64))
267
- ]),
268
- _: 2
269
- }, 1032, ["prop", "label", "width", "min-width", "fixed"]))), 128)),
270
- h.isEdit ? (i(), v(n(D), {
271
- key: 0,
272
- width: "150",
273
- fixed: "right"
274
- }, {
275
- header: p(() => [
276
- k("div", oe, [
277
- t.customAddRow ? (i(), v(n(S), {
278
- key: 0,
279
- type: "primary",
280
- link: "",
281
- onClick: A
282
- }, {
283
- default: p(() => [
284
- a[0] || (a[0] = k("i", { class: "iconfont icon-Frame1" }, null, -1)),
285
- x(m(t.addRowText), 1)
286
- ]),
287
- _: 1
288
- })) : w("", !0),
289
- t.customAddColumn ? (i(), v(n(S), {
290
- key: 1,
291
- type: "primary",
292
- link: "",
293
- onClick: R
294
- }, {
295
- default: p(() => [
296
- a[1] || (a[1] = k("i", { class: "iconfont icon-Frame-11" }, null, -1)),
297
- x(m(t.addColumnText), 1)
298
- ]),
299
- _: 1
300
- })) : w("", !0)
301
- ])
302
- ]),
303
- default: p(({ $index: e }) => [
304
- k("div", le, [
305
- t.$slots.operation ? E(t.$slots, "operation", {
306
- key: 0,
307
- row: s.value[e],
308
- $index: e
309
- }, void 0, !0) : (i(), u(b, { key: 1 }, [
310
- s.value.length > 1 ? (i(), u("i", {
311
- key: 0,
312
- class: "iconfont icon-close",
313
- onClick: (o) => B(e)
314
- }, null, 8, de)) : w("", !0)
315
- ], 64))
316
- ])
317
- ]),
318
- _: 3
319
- })) : w("", !0)
320
- ]),
321
- _: 3
322
- }, 16, ["data"])
323
- ]),
324
- _: 3
325
- }, 8, ["model"]));
326
- }
327
- }), se = /* @__PURE__ */ Q(ie, [["__scopeId", "data-v-048d82d3"]]), ve = Y(se);
328
- export {
329
- g as D,
330
- ve as Z
331
- };