@dazhicheng/ui 1.5.211 → 1.5.212
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,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as fe, useTemplateRef as K, computed as
|
|
1
|
+
import { defineComponent as fe, useTemplateRef as K, computed as i, reactive as pe, markRaw as ve, toRaw as he, watch as G, nextTick as be, onUnmounted as ye, createBlock as h, createCommentVNode as c, unref as l, openBlock as u, mergeProps as N, withCtx as b, withDirectives as Ce, createVNode as F, createElementVNode as $, createElementBlock as H, normalizeClass as O, normalizeStyle as J, renderSlot as ge, normalizeProps as we, guardReactiveProps as Fe, resolveDynamicComponent as Re, createSlots as Se, renderList as ke, Transition as Ne, vShow as Oe } from "vue";
|
|
2
2
|
import Ee from "../form/FormControl.vue.js";
|
|
3
3
|
import Be from "../form/FormDescription.vue.js";
|
|
4
4
|
import Pe from "../form/FormItem.vue.js";
|
|
@@ -66,7 +66,7 @@ const Ge = { class: "flex-auto overflow-hidden" }, He = {
|
|
|
66
66
|
commonComponentProps: {}
|
|
67
67
|
},
|
|
68
68
|
setup(n) {
|
|
69
|
-
const B = K("wrapperRef"), { componentBindEventMap: X, componentMap: Y, isVertical: C } = We(), M = ze(), k = qe(), Z = je(n.fieldName), f = K("fieldComponentRef"),
|
|
69
|
+
const B = K("wrapperRef"), { componentBindEventMap: X, componentMap: Y, isVertical: C } = We(), M = ze(), k = qe(), Z = je(n.fieldName), f = K("fieldComponentRef"), R = M.form, S = i(() => M.compact), g = i(() => {
|
|
70
70
|
var e;
|
|
71
71
|
return ((e = Z.value) == null ? void 0 : e.length) > 0;
|
|
72
72
|
}), P = pe(
|
|
@@ -86,21 +86,21 @@ const Ge = { class: "flex-auto overflow-hidden" }, He = {
|
|
|
86
86
|
* @returns 是否设置成功
|
|
87
87
|
*/
|
|
88
88
|
set(e, t, o) {
|
|
89
|
-
return Ve(k.value, t, o),
|
|
89
|
+
return Ve(k.value, t, o), R == null || R.validateField(t), !0;
|
|
90
90
|
}
|
|
91
91
|
})
|
|
92
|
-
), _ =
|
|
92
|
+
), _ = i(() => {
|
|
93
93
|
const e = y(n.component) ? Y.value[n.component] : n.component;
|
|
94
94
|
return ve(he(e));
|
|
95
95
|
}), { dynamicComponentProps: ee, dynamicRules: ne, isDisabled: te, isIf: U, isRequired: T, isShow: D } = xe(
|
|
96
96
|
() => n.dependencies
|
|
97
|
-
), oe =
|
|
97
|
+
), oe = i(() => {
|
|
98
98
|
var e;
|
|
99
99
|
return (e = n.labelClass) != null && e.includes("w-") || C.value ? {} : {
|
|
100
100
|
width: `${n.labelWidth}px`
|
|
101
101
|
};
|
|
102
|
-
}), s =
|
|
103
|
-
var o,
|
|
102
|
+
}), s = i(() => ne.value || n.rules), W = i(() => !n.hide && U.value && D.value), V = i(() => {
|
|
103
|
+
var o, a, d;
|
|
104
104
|
if (!W.value)
|
|
105
105
|
return !1;
|
|
106
106
|
if (!s.value)
|
|
@@ -109,14 +109,14 @@ const Ge = { class: "flex-auto overflow-hidden" }, He = {
|
|
|
109
109
|
return !0;
|
|
110
110
|
if (y(s.value))
|
|
111
111
|
return ["required", "selectRequired"].includes(s.value);
|
|
112
|
-
let e = (
|
|
112
|
+
let e = (a = (o = s == null ? void 0 : s.value) == null ? void 0 : o.isOptional) == null ? void 0 : a.call(o);
|
|
113
113
|
const t = s.value.def;
|
|
114
114
|
if ((t == null ? void 0 : t.type) === "default" && "innerType" in t) {
|
|
115
115
|
const v = t.innerType;
|
|
116
116
|
v && (e = (d = v.isOptional) == null ? void 0 : d.call(v));
|
|
117
117
|
}
|
|
118
118
|
return !e;
|
|
119
|
-
}), le =
|
|
119
|
+
}), le = i(() => {
|
|
120
120
|
var o;
|
|
121
121
|
if (!W.value)
|
|
122
122
|
return null;
|
|
@@ -126,19 +126,19 @@ const Ge = { class: "flex-auto overflow-hidden" }, He = {
|
|
|
126
126
|
if (y(e))
|
|
127
127
|
return e;
|
|
128
128
|
if (!!V.value) {
|
|
129
|
-
const
|
|
130
|
-
|
|
129
|
+
const a = (o = e == null ? void 0 : e.unwrap) == null ? void 0 : o.call(e);
|
|
130
|
+
a && (e = a);
|
|
131
131
|
}
|
|
132
132
|
return Ue(e);
|
|
133
|
-
}), r =
|
|
134
|
-
const e = q(n.componentProps) ? n.componentProps(k.value,
|
|
133
|
+
}), r = i(() => {
|
|
134
|
+
const e = q(n.componentProps) ? n.componentProps(k.value, R) : n.componentProps;
|
|
135
135
|
return {
|
|
136
136
|
...n.commonComponentProps,
|
|
137
137
|
...e,
|
|
138
138
|
...ee.value
|
|
139
139
|
};
|
|
140
|
-
}), { selectComponentProps:
|
|
141
|
-
|
|
140
|
+
}), { selectComponentProps: ae } = Ke(
|
|
141
|
+
i(() => ({
|
|
142
142
|
componentProps: r,
|
|
143
143
|
component: n.component,
|
|
144
144
|
selectWrapRef: B,
|
|
@@ -157,10 +157,10 @@ const Ge = { class: "flex-auto overflow-hidden" }, He = {
|
|
|
157
157
|
},
|
|
158
158
|
{ immediate: !0 }
|
|
159
159
|
);
|
|
160
|
-
const I =
|
|
160
|
+
const I = i(() => {
|
|
161
161
|
var e;
|
|
162
162
|
return te.value || n.disabled || ((e = r.value) == null ? void 0 : e.disabled);
|
|
163
|
-
}), z =
|
|
163
|
+
}), z = i(() => q(n.renderComponentContent) ? n.renderComponentContent(k.value, R) : {}), ie = i(() => Object.keys(z.value)), re = i(() => {
|
|
164
164
|
const e = le.value;
|
|
165
165
|
return {
|
|
166
166
|
keepValue: !0,
|
|
@@ -171,22 +171,22 @@ const Ge = { class: "flex-auto overflow-hidden" }, He = {
|
|
|
171
171
|
});
|
|
172
172
|
function ue(e) {
|
|
173
173
|
var v;
|
|
174
|
-
const t = e.componentField.modelValue, o = e.componentField["onUpdate:modelValue"],
|
|
174
|
+
const t = e.componentField.modelValue, o = e.componentField["onUpdate:modelValue"], a = n.modelPropName || (y(n.component) ? (v = X.value) == null ? void 0 : v[n.component] : null);
|
|
175
175
|
let d = t;
|
|
176
|
-
if (t && Te(t) &&
|
|
176
|
+
if (t && Te(t) && a) {
|
|
177
177
|
const m = t.target;
|
|
178
|
-
d = Q(t) ? m == null ? void 0 : m[
|
|
178
|
+
d = Q(t) ? m == null ? void 0 : m[a] : (t == null ? void 0 : t[a]) ?? t;
|
|
179
179
|
}
|
|
180
|
-
return
|
|
181
|
-
[`onUpdate:${
|
|
182
|
-
[
|
|
180
|
+
return a ? {
|
|
181
|
+
[`onUpdate:${a}`]: o,
|
|
182
|
+
[a]: d === void 0 ? n.emptyStateValue : d,
|
|
183
183
|
onChange: n.disabledOnChangeListener ? void 0 : (m) => {
|
|
184
184
|
var A;
|
|
185
|
-
const ce = Q(m),
|
|
185
|
+
const ce = Q(m), w = (A = e == null ? void 0 : e.componentField) == null ? void 0 : A.onChange;
|
|
186
186
|
if (!ce)
|
|
187
|
-
return
|
|
187
|
+
return w == null ? void 0 : w(m);
|
|
188
188
|
const L = m.target;
|
|
189
|
-
return
|
|
189
|
+
return w == null ? void 0 : w((L == null ? void 0 : L[a]) ?? m);
|
|
190
190
|
},
|
|
191
191
|
...n.disabledOnInputListener ? { onInput: void 0 } : {}
|
|
192
192
|
} : {
|
|
@@ -199,7 +199,7 @@ const Ge = { class: "flex-auto overflow-hidden" }, He = {
|
|
|
199
199
|
const t = ue(e), o = {
|
|
200
200
|
...e.componentField,
|
|
201
201
|
...r.value,
|
|
202
|
-
...
|
|
202
|
+
...ae.value,
|
|
203
203
|
...t,
|
|
204
204
|
...Reflect.has(r.value, "onChange") ? { onChange: r.value.onChange } : {},
|
|
205
205
|
...Reflect.has(r.value, "onInput") ? { onInput: r.value.onInput } : {}
|
|
@@ -218,12 +218,12 @@ const Ge = { class: "flex-auto overflow-hidden" }, He = {
|
|
|
218
218
|
p != null && p.has(n.fieldName) && p.delete(n.fieldName);
|
|
219
219
|
}), (e, t) => !e.hide && l(U) ? (u(), h(l(Me), N({ key: 0 }, re.value, { name: e.fieldName }), {
|
|
220
220
|
default: b((o) => [
|
|
221
|
-
Ce(
|
|
221
|
+
Ce(F(l(Pe), N({
|
|
222
222
|
class: [{
|
|
223
|
-
"form-valid-error":
|
|
223
|
+
"form-valid-error": g.value,
|
|
224
224
|
"form-is-required": V.value,
|
|
225
|
-
"pb-(--form-valid-error-nocompact-padding-bottom)": !
|
|
226
|
-
"pb-2":
|
|
225
|
+
"pb-(--form-valid-error-nocompact-padding-bottom)": !S.value,
|
|
226
|
+
"pb-2": S.value
|
|
227
227
|
}, "relative"]
|
|
228
228
|
}, e.$attrs), {
|
|
229
229
|
default: b(() => [
|
|
@@ -266,7 +266,7 @@ const Ge = { class: "flex-auto overflow-hidden" }, He = {
|
|
|
266
266
|
ref: B,
|
|
267
267
|
class: O(l(j)("relative flex w-full items-center", e.wrapperClass))
|
|
268
268
|
}, [
|
|
269
|
-
|
|
269
|
+
F(l(Ee), {
|
|
270
270
|
class: O(l(j)(e.controlClass))
|
|
271
271
|
}, {
|
|
272
272
|
default: b(() => [
|
|
@@ -274,7 +274,7 @@ const Ge = { class: "flex-auto overflow-hidden" }, He = {
|
|
|
274
274
|
...o,
|
|
275
275
|
...x(o),
|
|
276
276
|
disabled: I.value,
|
|
277
|
-
isInValid:
|
|
277
|
+
isInValid: g.value,
|
|
278
278
|
form: P,
|
|
279
279
|
fieldName: e.fieldName
|
|
280
280
|
})), () => [
|
|
@@ -282,20 +282,20 @@ const Ge = { class: "flex-auto overflow-hidden" }, He = {
|
|
|
282
282
|
ref_key: "fieldComponentRef",
|
|
283
283
|
ref: f,
|
|
284
284
|
class: {
|
|
285
|
-
"border-destructive hover:border-destructive/80 focus:border-destructive focus:shadow-[0_0_0_2px_rgba(255,38,5,0.06)]":
|
|
285
|
+
"border-destructive hover:border-destructive/80 focus:border-destructive focus:shadow-[0_0_0_2px_rgba(255,38,5,0.06)]": g.value
|
|
286
286
|
}
|
|
287
287
|
}, {
|
|
288
288
|
...x(o),
|
|
289
289
|
disabled: I.value,
|
|
290
|
-
isInValid:
|
|
290
|
+
isInValid: g.value,
|
|
291
291
|
form: P,
|
|
292
292
|
fieldName: e.fieldName
|
|
293
293
|
}, { disabled: I.value }), Se({ _: 2 }, [
|
|
294
|
-
ke(
|
|
295
|
-
name:
|
|
294
|
+
ke(ie.value, (a) => ({
|
|
295
|
+
name: a,
|
|
296
296
|
fn: b((d) => [
|
|
297
|
-
|
|
298
|
-
content: z.value[
|
|
297
|
+
F(l(E), N({
|
|
298
|
+
content: z.value[a]
|
|
299
299
|
}, { ...d, formContext: o }), null, 16, ["content"])
|
|
300
300
|
])
|
|
301
301
|
}))
|
|
@@ -305,16 +305,16 @@ const Ge = { class: "flex-auto overflow-hidden" }, He = {
|
|
|
305
305
|
_: 2
|
|
306
306
|
}, 1032, ["class"]),
|
|
307
307
|
e.suffix ? (u(), H("div", He, [
|
|
308
|
-
|
|
308
|
+
F(l(E), { content: e.suffix }, null, 8, ["content"])
|
|
309
309
|
])) : c("", !0),
|
|
310
|
-
|
|
310
|
+
S.value && g.value ? (u(), h(l(Le), {
|
|
311
311
|
key: 1,
|
|
312
312
|
"ref-dom": B.value
|
|
313
313
|
}, null, 8, ["ref-dom"])) : c("", !0)
|
|
314
314
|
], 2)
|
|
315
315
|
])
|
|
316
316
|
], 2),
|
|
317
|
-
e.description || !
|
|
317
|
+
e.description || !S.value ? (u(), H("div", {
|
|
318
318
|
key: 0,
|
|
319
319
|
style: J(!l(C) && !e.hideLabel ? { paddingLeft: `${(e.labelWidth || 0) + 8}px` } : {})
|
|
320
320
|
}, [
|
|
@@ -323,19 +323,19 @@ const Ge = { class: "flex-auto overflow-hidden" }, He = {
|
|
|
323
323
|
class: "text-[12px]"
|
|
324
324
|
}, {
|
|
325
325
|
default: b(() => [
|
|
326
|
-
|
|
326
|
+
F(l(E), { content: e.description }, null, 8, ["content"])
|
|
327
327
|
]),
|
|
328
328
|
_: 1
|
|
329
329
|
})) : c("", !0),
|
|
330
|
-
|
|
331
|
-
key: 1,
|
|
332
|
-
name: "slide-up"
|
|
333
|
-
}, {
|
|
330
|
+
F(Ne, { name: "slide-up" }, {
|
|
334
331
|
default: b(() => [
|
|
335
|
-
|
|
332
|
+
!S.value && g.value ? (u(), h(l($e), {
|
|
333
|
+
key: 0,
|
|
334
|
+
class: "absolute"
|
|
335
|
+
})) : c("", !0)
|
|
336
336
|
]),
|
|
337
337
|
_: 1
|
|
338
|
-
})
|
|
338
|
+
})
|
|
339
339
|
], 4)) : c("", !0)
|
|
340
340
|
]),
|
|
341
341
|
_: 2
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dazhicheng/ui",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.212",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -67,8 +67,8 @@
|
|
|
67
67
|
"vue-router": "^5.0.2",
|
|
68
68
|
"vxe-pc-ui": "^4.12.36",
|
|
69
69
|
"vxe-table": "^4.17.48",
|
|
70
|
-
"@dazhicheng/
|
|
71
|
-
"@dazhicheng/
|
|
70
|
+
"@dazhicheng/utils": "1.3.41",
|
|
71
|
+
"@dazhicheng/hooks": "1.4.44"
|
|
72
72
|
},
|
|
73
73
|
"files": [
|
|
74
74
|
"dist"
|