@dazhicheng/ui 1.5.204 → 1.5.206

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.
@@ -1,137 +1,181 @@
1
- import { inject as K, computed as d, toValue as V, ref as M, watch as O, onBeforeUnmount as R } from "vue";
2
- import { get as U, set as C, cloneDeep as y } from "lodash-es";
3
- import { FormContextKey as q } from "vee-validate";
4
- function J(g) {
5
- const r = K(q), i = d(() => V(g)), s = M([]);
6
- let E = 0, f;
7
- function a() {
8
- if (!r)
9
- return [];
10
- const t = U(r.values, i.value);
11
- return Array.isArray(t) ? t : [];
12
- }
13
- function c(t) {
14
- r && (C(r.values, i.value, t), f = a());
15
- }
16
- function A(t, e) {
17
- return d({
1
+ import { inject as P, computed as F, toValue as A, ref as Y, watch as q, onBeforeUnmount as D } from "vue";
2
+ import { get as K, set as E, cloneDeep as m } from "lodash-es";
3
+ import { FormContextKey as T } from "vee-validate";
4
+ function z(s) {
5
+ return typeof File < "u" && s instanceof File;
6
+ }
7
+ function d(s, e) {
8
+ if (s === e) return !0;
9
+ if (s && e && typeof s == "object" && typeof e == "object") {
10
+ if (s.constructor !== e.constructor) return !1;
11
+ if (Array.isArray(s)) {
12
+ if (s.length !== e.length) return !1;
13
+ for (let u = s.length; u-- !== 0; ) if (!d(s[u], e[u])) return !1;
14
+ return !0;
15
+ }
16
+ if (s instanceof Map && e instanceof Map) {
17
+ if (s.size !== e.size) return !1;
18
+ for (const u of s.keys()) if (!e.has(u)) return !1;
19
+ for (const [u, a] of s) if (!d(a, e.get(u))) return !1;
20
+ return !0;
21
+ }
22
+ if (s instanceof Set && e instanceof Set) {
23
+ if (s.size !== e.size) return !1;
24
+ for (const u of s) if (!e.has(u)) return !1;
25
+ return !0;
26
+ }
27
+ if (ArrayBuffer.isView(s) && ArrayBuffer.isView(e)) {
28
+ const u = s, a = e;
29
+ if (u.length !== a.length) return !1;
30
+ for (let v = u.length; v-- !== 0; ) if (u[v] !== a[v]) return !1;
31
+ return !0;
32
+ }
33
+ if (s instanceof RegExp && e instanceof RegExp)
34
+ return s.source === e.source && s.flags === e.flags;
35
+ if (z(s) && z(e))
36
+ return s.size === e.size && s.name === e.name && s.lastModified === e.lastModified && s.type === e.type;
37
+ if (s.valueOf !== Object.prototype.valueOf) return s.valueOf() === e.valueOf();
38
+ if (s.toString !== Object.prototype.toString) return s.toString() === e.toString();
39
+ const c = Object.keys(s).filter((u) => s[u] !== void 0), i = Object.keys(e).filter((u) => e[u] !== void 0);
40
+ if (c.length !== i.length) return !1;
41
+ for (const u of c)
42
+ if (!Object.prototype.hasOwnProperty.call(e, u) || !d(s[u], e[u])) return !1;
43
+ return !0;
44
+ }
45
+ return s !== s && e !== e;
46
+ }
47
+ function G(s) {
48
+ const e = P(T), c = F(() => A(s)), i = Y([]);
49
+ let u = 0, a;
50
+ const v = Object.freeze([]);
51
+ function l() {
52
+ if (!e)
53
+ return v;
54
+ const t = K(e.values, c.value);
55
+ return Array.isArray(t) ? t : v;
56
+ }
57
+ function p(t) {
58
+ e && (E(e.values, c.value, t), a = l());
59
+ }
60
+ function $(t, n) {
61
+ return F({
18
62
  get() {
19
- const n = a(), u = s.value.findIndex((l) => l.key === t);
20
- return u === -1 ? e : n[u];
63
+ const r = l(), f = i.value.findIndex((o) => o.key === t);
64
+ return f === -1 ? n : r[f];
21
65
  },
22
- set(n) {
23
- const u = s.value.findIndex((l) => l.key === t);
24
- u !== -1 && F(u, n);
66
+ set(r) {
67
+ const f = i.value.findIndex((o) => o.key === t);
68
+ f !== -1 && V(f, r);
25
69
  }
26
70
  });
27
71
  }
28
- function h() {
29
- const t = s.value.length;
30
- for (let e = 0; e < t; e++) {
31
- const n = s.value[e];
32
- n.isFirst = e === 0, n.isLast = e === t - 1;
72
+ function O() {
73
+ const t = i.value.length;
74
+ for (let n = 0; n < t; n++) {
75
+ const r = i.value[n];
76
+ r.isFirst = n === 0, r.isLast = n === t - 1;
33
77
  }
34
78
  }
35
- function o() {
36
- h(), r == null || r.validate({ mode: "silent" });
79
+ function y() {
80
+ O(), e == null || e.validate({ mode: "silent" });
37
81
  }
38
- function v(t, e, n) {
39
- if (n && e != null && n[e])
40
- return n[e];
41
- const u = E++;
82
+ function g(t, n, r) {
83
+ if (r && n != null && r[n])
84
+ return r[n];
85
+ const f = u++;
42
86
  return {
43
- key: u,
44
- value: A(u, t),
87
+ key: f,
88
+ value: $(f, t),
45
89
  isFirst: !1,
46
90
  isLast: !1
47
91
  };
48
92
  }
49
- function p() {
50
- const t = a(), e = s.value;
51
- s.value = t.map((n, u) => v(n, u, e)), f = a(), h();
93
+ function h() {
94
+ const t = l(), n = i.value;
95
+ i.value = t.map((r, f) => g(r, f, n)), a = l(), O();
52
96
  }
53
- p(), O([() => a(), () => a().length], ([t]) => {
54
- const e = t.length !== s.value.length || t !== f;
55
- f = t, e && p();
97
+ h(), q([() => l(), () => l().length], ([t]) => {
98
+ const n = t.length !== i.value.length || t !== a;
99
+ a = t, n && h();
56
100
  });
57
- function I(t) {
58
- if (!r)
101
+ function M(t) {
102
+ if (!e)
59
103
  return;
60
- const e = [...a()];
61
- if (t < 0 || t >= e.length)
104
+ const n = [...l()];
105
+ if (t < 0 || t >= n.length)
62
106
  return;
63
- const n = `${i.value}[${t}]`;
64
- r.destroyPath(n), r.unsetInitialValue(n), e.splice(t, 1), c(e), s.value.splice(t, 1), o();
107
+ const r = `${c.value}[${t}]`;
108
+ e.destroyPath(r), e.unsetInitialValue(r), n.splice(t, 1), p(n), i.value.splice(t, 1), y();
65
109
  }
66
- function j(t) {
67
- if (!r)
110
+ function S(t) {
111
+ if (!e)
68
112
  return;
69
- const e = y(t), n = [...a(), e];
70
- r.stageInitialValue(`${i.value}[${n.length - 1}]`, e), c(n), s.value.push(v(e)), o();
113
+ const n = m(t), r = [...l(), n];
114
+ e.stageInitialValue(`${c.value}[${r.length - 1}]`, n), p(r), i.value.push(g(n)), y();
71
115
  }
72
- function k(t) {
73
- if (!r)
116
+ function w(t) {
117
+ if (!e)
74
118
  return;
75
- const e = y(t), n = [e, ...a()];
76
- r.stageInitialValue(`${i.value}[0]`, e), c(n), s.value.unshift(v(e)), o();
119
+ const n = m(t), r = [n, ...l()];
120
+ e.stageInitialValue(`${c.value}[0]`, n), p(r), i.value.unshift(g(n)), y();
77
121
  }
78
- function w(t, e) {
79
- if (!r)
122
+ function C(t, n) {
123
+ if (!e)
80
124
  return;
81
- const n = y(e), u = [...a()];
82
- t < 0 || t > u.length || (u.splice(t, 0, n), c(u), s.value.splice(t, 0, v(n)), o());
125
+ const r = m(n), f = [...l()];
126
+ t < 0 || t > f.length || (f.splice(t, 0, r), p(f), i.value.splice(t, 0, g(r)), y());
83
127
  }
84
- function L(t) {
85
- r && (r.stageInitialValue(i.value, t), c(y(t)), p(), o());
128
+ function R(t) {
129
+ e && (e.stageInitialValue(c.value, t), p(m(t)), h(), y());
86
130
  }
87
- function F(t, e) {
88
- if (!r)
131
+ function V(t, n) {
132
+ if (!e)
89
133
  return;
90
- const n = a();
91
- t < 0 || t >= n.length || (C(r.values, `${i.value}[${t}]`, e), r.validate({ mode: "validated-only" }));
134
+ const r = l();
135
+ t < 0 || t >= r.length || (d(r[t], n) || E(e.values, `${c.value}[${t}]`, n), e.validate({ mode: "validated-only" }));
92
136
  }
93
- function b(t, e) {
94
- if (!r)
137
+ function I(t, n) {
138
+ if (!e)
95
139
  return;
96
- const n = [...a()];
97
- if (!(t in n) || !(e in n))
140
+ const r = [...l()];
141
+ if (!(t in r) || !(n in r))
98
142
  return;
99
- const u = n[t];
100
- n[t] = n[e], n[e] = u;
101
- const l = [...s.value], m = l[t];
102
- l[t] = l[e], l[e] = m, c(n), s.value = l, h();
143
+ const f = r[t];
144
+ r[t] = r[n], r[n] = f;
145
+ const o = [...i.value], k = o[t];
146
+ o[t] = o[n], o[n] = k, p(r), i.value = o, O();
103
147
  }
104
- function D(t, e) {
105
- if (!r)
148
+ function L(t, n) {
149
+ if (!e)
106
150
  return;
107
- const n = [...a()];
108
- if (!(t in n) || !(e in n))
151
+ const r = [...l()];
152
+ if (!(t in r) || !(n in r))
109
153
  return;
110
- const u = n.splice(t, 1)[0];
111
- n.splice(e, 0, u);
112
- const l = [...s.value], m = l.splice(t, 1)[0];
113
- l.splice(e, 0, m), c(n), s.value = l, o();
114
- }
115
- const $ = {
116
- fields: s,
117
- remove: I,
118
- push: j,
119
- prepend: k,
120
- insert: w,
121
- replace: L,
122
- update: F,
123
- swap: b,
124
- move: D
154
+ const f = r.splice(t, 1)[0];
155
+ r.splice(n, 0, f);
156
+ const o = [...i.value], k = o.splice(t, 1)[0];
157
+ o.splice(n, 0, k), p(r), i.value = o, y();
158
+ }
159
+ const j = {
160
+ fields: i,
161
+ remove: M,
162
+ push: S,
163
+ prepend: w,
164
+ insert: C,
165
+ replace: R,
166
+ update: V,
167
+ swap: I,
168
+ move: L
125
169
  };
126
- if (r) {
127
- const t = Object.assign({ path: g, reset: p }, $);
128
- r.fieldArrays.push(t), R(() => {
129
- const e = r.fieldArrays.findIndex((n) => V(n.path) === V(g));
130
- e >= 0 && r.fieldArrays.splice(e, 1);
170
+ if (e) {
171
+ const t = Object.assign({ path: s, reset: h }, j);
172
+ e.fieldArrays.push(t), D(() => {
173
+ const n = e.fieldArrays.findIndex((r) => A(r.path) === A(s));
174
+ n >= 0 && e.fieldArrays.splice(n, 1);
131
175
  });
132
176
  }
133
- return $;
177
+ return j;
134
178
  }
135
179
  export {
136
- J as useFieldArray
180
+ G as useFieldArray
137
181
  };
@@ -27,6 +27,10 @@ export declare const TtUpload: import('../../../../utils/src').SFCWithInstall<{
27
27
  readonly type: import('vue').PropType<boolean>;
28
28
  readonly default: true;
29
29
  };
30
+ disabled: {
31
+ readonly type: import('vue').PropType<boolean>;
32
+ readonly default: false;
33
+ };
30
34
  modal: {
31
35
  readonly type: import('vue').PropType<boolean>;
32
36
  readonly default: true;
@@ -188,7 +192,6 @@ export declare const TtUpload: import('../../../../utils/src').SFCWithInstall<{
188
192
  new (): any;
189
193
  readonly prototype: any;
190
194
  }) | null)[], unknown, unknown, import('element-plus').UploadRequestHandler, boolean>;
191
- disabled: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
192
195
  limit: NumberConstructor;
193
196
  directory: BooleanConstructor;
194
197
  modelValue: {
@@ -225,7 +228,7 @@ export declare const TtUpload: import('../../../../utils/src').SFCWithInstall<{
225
228
  onProgress: (evt: import('element-plus').UploadProgressEvent, uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void;
226
229
  onChange: (uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void;
227
230
  onError: (error: Error, uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void;
228
- disabled: import('element-plus/es/utils/index.mjs').EpPropMergeType<BooleanConstructor, unknown, unknown>;
231
+ disabled: boolean;
229
232
  name: string;
230
233
  showPreview: boolean;
231
234
  multiple: boolean;
@@ -291,6 +294,10 @@ export declare const TtUpload: import('../../../../utils/src').SFCWithInstall<{
291
294
  readonly type: import('vue').PropType<boolean>;
292
295
  readonly default: true;
293
296
  };
297
+ disabled: {
298
+ readonly type: import('vue').PropType<boolean>;
299
+ readonly default: false;
300
+ };
294
301
  modal: {
295
302
  readonly type: import('vue').PropType<boolean>;
296
303
  readonly default: true;
@@ -452,7 +459,6 @@ export declare const TtUpload: import('../../../../utils/src').SFCWithInstall<{
452
459
  new (): any;
453
460
  readonly prototype: any;
454
461
  }) | null)[], unknown, unknown, import('element-plus').UploadRequestHandler, boolean>;
455
- disabled: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
456
462
  limit: NumberConstructor;
457
463
  directory: BooleanConstructor;
458
464
  modelValue: {
@@ -479,7 +485,7 @@ export declare const TtUpload: import('../../../../utils/src').SFCWithInstall<{
479
485
  onProgress: (evt: import('element-plus').UploadProgressEvent, uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void;
480
486
  onChange: (uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void;
481
487
  onError: (error: Error, uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void;
482
- disabled: import('element-plus/es/utils/index.mjs').EpPropMergeType<BooleanConstructor, unknown, unknown>;
488
+ disabled: boolean;
483
489
  name: string;
484
490
  showPreview: boolean;
485
491
  multiple: boolean;
@@ -542,6 +548,10 @@ export declare const TtUpload: import('../../../../utils/src').SFCWithInstall<{
542
548
  readonly type: import('vue').PropType<boolean>;
543
549
  readonly default: true;
544
550
  };
551
+ disabled: {
552
+ readonly type: import('vue').PropType<boolean>;
553
+ readonly default: false;
554
+ };
545
555
  modal: {
546
556
  readonly type: import('vue').PropType<boolean>;
547
557
  readonly default: true;
@@ -703,7 +713,6 @@ export declare const TtUpload: import('../../../../utils/src').SFCWithInstall<{
703
713
  new (): any;
704
714
  readonly prototype: any;
705
715
  }) | null)[], unknown, unknown, import('element-plus').UploadRequestHandler, boolean>;
706
- disabled: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
707
716
  limit: NumberConstructor;
708
717
  directory: BooleanConstructor;
709
718
  modelValue: {
@@ -740,7 +749,7 @@ export declare const TtUpload: import('../../../../utils/src').SFCWithInstall<{
740
749
  onProgress: (evt: import('element-plus').UploadProgressEvent, uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void;
741
750
  onChange: (uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void;
742
751
  onError: (error: Error, uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void;
743
- disabled: import('element-plus/es/utils/index.mjs').EpPropMergeType<BooleanConstructor, unknown, unknown>;
752
+ disabled: boolean;
744
753
  name: string;
745
754
  showPreview: boolean;
746
755
  multiple: boolean;
@@ -68,6 +68,10 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
68
68
  readonly type: import('vue').PropType<boolean>;
69
69
  readonly default: true;
70
70
  };
71
+ disabled: {
72
+ readonly type: import('vue').PropType<boolean>;
73
+ readonly default: false;
74
+ };
71
75
  modal: {
72
76
  readonly type: import('vue').PropType<boolean>;
73
77
  readonly default: true;
@@ -229,7 +233,6 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
229
233
  new (): any;
230
234
  readonly prototype: any;
231
235
  }) | null)[], unknown, unknown, import('element-plus').UploadRequestHandler, boolean>;
232
- disabled: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
233
236
  limit: NumberConstructor;
234
237
  directory: BooleanConstructor;
235
238
  modelValue: {
@@ -276,6 +279,10 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
276
279
  readonly type: import('vue').PropType<boolean>;
277
280
  readonly default: true;
278
281
  };
282
+ disabled: {
283
+ readonly type: import('vue').PropType<boolean>;
284
+ readonly default: false;
285
+ };
279
286
  modal: {
280
287
  readonly type: import('vue').PropType<boolean>;
281
288
  readonly default: true;
@@ -437,7 +444,6 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
437
444
  new (): any;
438
445
  readonly prototype: any;
439
446
  }) | null)[], unknown, unknown, import('element-plus').UploadRequestHandler, boolean>;
440
- disabled: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
441
447
  limit: NumberConstructor;
442
448
  directory: BooleanConstructor;
443
449
  modelValue: {
@@ -459,7 +465,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
459
465
  onProgress: (evt: import('element-plus').UploadProgressEvent, uploadFile: UploadFile, uploadFiles: UploadFiles) => void;
460
466
  onChange: (uploadFile: UploadFile, uploadFiles: UploadFiles) => void;
461
467
  onError: (error: Error, uploadFile: UploadFile, uploadFiles: UploadFiles) => void;
462
- disabled: import('element-plus/es/utils/index.mjs').EpPropMergeType<BooleanConstructor, unknown, unknown>;
468
+ disabled: boolean;
463
469
  name: string;
464
470
  showPreview: boolean;
465
471
  multiple: boolean;
@@ -234,7 +234,7 @@ const Je = /* @__PURE__ */ de({
234
234
  onClick: () => le(e)
235
235
  }, {
236
236
  default: () => [w("下载")]
237
- }), i.showDelete && a($, {
237
+ }), i.showDelete && !i.disabled && a($, {
238
238
  type: "danger",
239
239
  link: !0,
240
240
  onClick: () => ee(e)
@@ -72,6 +72,10 @@ export declare const ttUploadProps: {
72
72
  readonly type: PropType<boolean>;
73
73
  readonly default: true;
74
74
  };
75
+ readonly disabled: {
76
+ readonly type: PropType<boolean>;
77
+ readonly default: false;
78
+ };
75
79
  /** 是否使用弹框模式 */
76
80
  readonly modal: {
77
81
  readonly type: PropType<boolean>;
@@ -251,7 +255,6 @@ export declare const ttUploadProps: {
251
255
  new (): any;
252
256
  readonly prototype: any;
253
257
  }) | null)[], unknown, unknown, import('element-plus').UploadRequestHandler, boolean>;
254
- readonly disabled: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
255
258
  readonly limit: NumberConstructor;
256
259
  readonly directory: BooleanConstructor;
257
260
  };
@@ -19,6 +19,10 @@ const o = {
19
19
  type: Boolean,
20
20
  default: !0
21
21
  },
22
+ disabled: {
23
+ type: Boolean,
24
+ default: !1
25
+ },
22
26
  /** 是否使用弹框模式 */
23
27
  modal: {
24
28
  type: Boolean,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dazhicheng/ui",
3
- "version": "1.5.204",
3
+ "version": "1.5.206",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -56,8 +56,8 @@
56
56
  "vee-validate": "^4.15.1",
57
57
  "xe-utils": "^4.0.0",
58
58
  "zod": "^4.3.6",
59
- "@dazhicheng/utils": "1.3.38",
60
- "@dazhicheng/hooks": "1.4.41"
59
+ "@dazhicheng/utils": "1.3.39",
60
+ "@dazhicheng/hooks": "1.4.42"
61
61
  },
62
62
  "peerDependencies": {
63
63
  "@element-plus/icons-vue": "^2.3.2",