@piying/view-vue 1.1.11 → 1.1.13
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.
- package/formly/util/use-control-value-accessor.d.ts +1 -1
- package/index.js +60 -60
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var L = Object.defineProperty;
|
|
2
|
-
var U = (
|
|
3
|
-
var F = (
|
|
4
|
-
import { inject as B, shallowRef as O, watchEffect as G, defineComponent as j, computed as v, createBlock as y, renderSlot as T, openBlock as i, resolveDynamicComponent as k, mergeProps as I, unref as d, toHandlers as b, withCtx as
|
|
2
|
+
var U = (o, e, n) => e in o ? L(o, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : o[e] = n;
|
|
3
|
+
var F = (o, e, n) => U(o, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { inject as B, shallowRef as O, watchEffect as G, defineComponent as j, computed as v, createBlock as y, renderSlot as T, openBlock as i, resolveDynamicComponent as k, mergeProps as I, unref as d, toHandlers as b, withCtx as D, createVNode as J, normalizeProps as M, guardReactiveProps as Q, defineAsyncComponent as X, provide as N, ref as S, watch as H, onUnmounted as Y, createElementBlock as E, createCommentVNode as A, Fragment as P, renderList as Z } from "vue";
|
|
5
5
|
import { CoreSchemaHandle as ee, FormBuilder as te, isFieldControl as oe, createViewControlLink as ne, convert as re } from "@piying/view-core";
|
|
6
6
|
import { effect as W, createRootInjector as le, ChangeDetectionSchedulerImpl as ae, ChangeDetectionScheduler as se, createInjector as ue, DestroyRef as ie, untracked as ce } from "static-injector";
|
|
7
7
|
import { deepEqual as de } from "fast-equals";
|
|
@@ -14,29 +14,29 @@ class pe extends ee {
|
|
|
14
14
|
class fe extends te {
|
|
15
15
|
}
|
|
16
16
|
const R = Symbol(), me = Symbol();
|
|
17
|
-
function m(
|
|
18
|
-
const e = B(R),
|
|
17
|
+
function m(o) {
|
|
18
|
+
const e = B(R), n = O(void 0);
|
|
19
19
|
return G((r) => {
|
|
20
|
-
|
|
20
|
+
n.value = o();
|
|
21
21
|
const l = W(
|
|
22
22
|
() => {
|
|
23
|
-
const t =
|
|
24
|
-
Object.is(
|
|
23
|
+
const t = o();
|
|
24
|
+
Object.is(n.value, t) || (n.value = t);
|
|
25
25
|
},
|
|
26
26
|
{ injector: e }
|
|
27
27
|
);
|
|
28
28
|
r(() => {
|
|
29
29
|
l.destroy();
|
|
30
30
|
});
|
|
31
|
-
}),
|
|
31
|
+
}), n;
|
|
32
32
|
}
|
|
33
33
|
const q = /* @__PURE__ */ j({
|
|
34
34
|
__name: "wrapper",
|
|
35
35
|
props: {
|
|
36
36
|
wrappers: {}
|
|
37
37
|
},
|
|
38
|
-
setup(
|
|
39
|
-
const e =
|
|
38
|
+
setup(o) {
|
|
39
|
+
const e = o, n = v(() => e.wrappers.slice(1)), r = v(() => e.wrappers[0]), l = m(() => {
|
|
40
40
|
var a, p;
|
|
41
41
|
return { ...(a = r.value) == null ? void 0 : a.inputs(), ...(p = r.value) == null ? void 0 : p.attributes() };
|
|
42
42
|
}), t = v(() => {
|
|
@@ -44,9 +44,9 @@ const q = /* @__PURE__ */ j({
|
|
|
44
44
|
return ((a = r.value) == null ? void 0 : a.outputs) ?? {};
|
|
45
45
|
});
|
|
46
46
|
return (a, p) => r.value ? (i(), y(k(r.value.type), I({ key: 0 }, d(l), b(t.value)), {
|
|
47
|
-
default:
|
|
48
|
-
J(q, M(Q({ wrappers:
|
|
49
|
-
default:
|
|
47
|
+
default: D(() => [
|
|
48
|
+
J(q, M(Q({ wrappers: n.value })), {
|
|
49
|
+
default: D(() => [
|
|
50
50
|
T(a.$slots, "default")
|
|
51
51
|
]),
|
|
52
52
|
_: 3
|
|
@@ -60,46 +60,46 @@ const q = /* @__PURE__ */ j({
|
|
|
60
60
|
props: {
|
|
61
61
|
field: {}
|
|
62
62
|
},
|
|
63
|
-
setup(
|
|
64
|
-
const e =
|
|
63
|
+
setup(o) {
|
|
64
|
+
const e = o, n = B(R), r = m(() => e.field.inputs()), l = m(() => e.field.outputs()), t = m(() => e.field.renderConfig()), a = m(() => e.field.attributes()), p = v(() => ({ ...r.value, fields: e.field.fieldGroup() })), x = v(() => ({ ...r.value, fields: e.field.fieldArray() })), $ = m(() => e.field.wrappers()), g = m(() => {
|
|
65
65
|
var s, u;
|
|
66
66
|
return (u = (s = e.field).fieldGroup) == null ? void 0 : u.call(s);
|
|
67
|
-
}),
|
|
67
|
+
}), w = m(() => {
|
|
68
68
|
var s, u;
|
|
69
69
|
return (u = (s = e.field).fieldArray) == null ? void 0 : u.call(s);
|
|
70
70
|
}), _ = v(() => ({ ...a.value, ...r.value })), c = v(
|
|
71
71
|
() => {
|
|
72
|
-
var s, u,
|
|
73
|
-
return typeof ((s = e.field.define) == null ? void 0 : s.type) == "function" ? X((u = e.field.define) == null ? void 0 : u.type) : (
|
|
72
|
+
var s, u, V;
|
|
73
|
+
return typeof ((s = e.field.define) == null ? void 0 : s.type) == "function" ? X((u = e.field.define) == null ? void 0 : u.type) : (V = e.field.define) == null ? void 0 : V.type;
|
|
74
74
|
}
|
|
75
75
|
), h = v(() => e.field);
|
|
76
76
|
N(me, h);
|
|
77
|
-
const
|
|
77
|
+
const C = S(null), K = oe(h.value.form.control);
|
|
78
78
|
let f;
|
|
79
79
|
return H(
|
|
80
|
-
[
|
|
80
|
+
[C, h],
|
|
81
81
|
([s, u]) => {
|
|
82
|
-
f == null || f
|
|
82
|
+
f == null || f(), K && s && (f = ne(
|
|
83
83
|
() => u.form.control,
|
|
84
84
|
s.cva,
|
|
85
|
-
|
|
85
|
+
n
|
|
86
86
|
));
|
|
87
87
|
},
|
|
88
88
|
{ immediate: !0 }
|
|
89
89
|
), Y(() => {
|
|
90
|
-
f == null || f
|
|
90
|
+
f == null || f(), f = void 0;
|
|
91
91
|
}), (s, u) => {
|
|
92
|
-
var
|
|
93
|
-
return d(t).hidden ? A("", !0) : (i(),
|
|
94
|
-
(
|
|
92
|
+
var V;
|
|
93
|
+
return d(t).hidden ? A("", !0) : (i(), E(P, { key: 0 }, [
|
|
94
|
+
(V = h.value.define) != null && V.type ? (i(), y(q, {
|
|
95
95
|
key: 0,
|
|
96
|
-
wrappers: d(
|
|
96
|
+
wrappers: d($)
|
|
97
97
|
}, {
|
|
98
|
-
default:
|
|
99
|
-
d(
|
|
98
|
+
default: D(() => [
|
|
99
|
+
d(g) ? (i(), y(k(c.value), I({ key: 0 }, p.value, b(d(l))), null, 16)) : d(w) ? (i(), y(k(c.value), I({ key: 1 }, x.value, b(d(l))), null, 16)) : (i(), E(P, { key: 2 }, [
|
|
100
100
|
h.value.form.control ? (i(), y(k(c.value), I({ key: 0 }, _.value, b(d(l)), {
|
|
101
101
|
ref_key: "childRef",
|
|
102
|
-
ref:
|
|
102
|
+
ref: C
|
|
103
103
|
}), null, 16)) : (i(), y(k(c.value), I({ key: 1 }, _.value, b(d(l))), null, 16))
|
|
104
104
|
], 64))
|
|
105
105
|
]),
|
|
@@ -109,14 +109,14 @@ const q = /* @__PURE__ */ j({
|
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
111
|
});
|
|
112
|
-
function ve(
|
|
112
|
+
function ve(o, e, n, r) {
|
|
113
113
|
let l = !0;
|
|
114
114
|
return W(
|
|
115
115
|
() => {
|
|
116
116
|
const t = e.value$$();
|
|
117
|
-
l ? (de(t,
|
|
117
|
+
l ? (de(t, o) || r(t), l = !1) : r(t);
|
|
118
118
|
},
|
|
119
|
-
{ injector:
|
|
119
|
+
{ injector: n }
|
|
120
120
|
);
|
|
121
121
|
}
|
|
122
122
|
const Ce = /* @__PURE__ */ j({
|
|
@@ -127,8 +127,8 @@ const Ce = /* @__PURE__ */ j({
|
|
|
127
127
|
options: {}
|
|
128
128
|
},
|
|
129
129
|
emits: ["update:modelValue"],
|
|
130
|
-
setup(
|
|
131
|
-
const
|
|
130
|
+
setup(o, { emit: e }) {
|
|
131
|
+
const n = o, r = e, l = le({
|
|
132
132
|
providers: [
|
|
133
133
|
{
|
|
134
134
|
provide: se,
|
|
@@ -139,58 +139,58 @@ const Ce = /* @__PURE__ */ j({
|
|
|
139
139
|
N(R, l);
|
|
140
140
|
const t = O(void 0);
|
|
141
141
|
return H(
|
|
142
|
-
() => [
|
|
143
|
-
([a, p], x,
|
|
144
|
-
const
|
|
142
|
+
() => [n.schema, n.options],
|
|
143
|
+
([a, p], x, $) => {
|
|
144
|
+
const g = ue({ providers: [], parent: l }), w = re(a, {
|
|
145
145
|
handle: pe,
|
|
146
146
|
builder: fe,
|
|
147
|
-
injector:
|
|
147
|
+
injector: g,
|
|
148
148
|
registerOnDestroy: (c) => {
|
|
149
|
-
|
|
149
|
+
g.get(ie).onDestroy(() => {
|
|
150
150
|
c();
|
|
151
151
|
});
|
|
152
152
|
},
|
|
153
153
|
...p
|
|
154
154
|
});
|
|
155
|
-
t.value =
|
|
155
|
+
t.value = w;
|
|
156
156
|
let _;
|
|
157
|
-
if (
|
|
158
|
-
const c =
|
|
157
|
+
if (w.form.control) {
|
|
158
|
+
const c = n.modelValue;
|
|
159
159
|
_ = ve(
|
|
160
160
|
typeof c < "u" ? c : void 0,
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
w.form.control,
|
|
162
|
+
g,
|
|
163
163
|
(h) => {
|
|
164
164
|
ce(() => {
|
|
165
|
-
var
|
|
166
|
-
(
|
|
165
|
+
var C;
|
|
166
|
+
(C = w.form.control) != null && C.valueNoError$$() && r("update:modelValue", h);
|
|
167
167
|
});
|
|
168
168
|
}
|
|
169
169
|
);
|
|
170
170
|
}
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
$(() => {
|
|
172
|
+
g.destroy(), _ == null || _.destroy();
|
|
173
173
|
});
|
|
174
174
|
},
|
|
175
175
|
{ immediate: !0 }
|
|
176
176
|
), G(() => {
|
|
177
177
|
var a;
|
|
178
|
-
(a = t.value.form.control) == null || a.updateValue(
|
|
178
|
+
(a = t.value.form.control) == null || a.updateValue(n.modelValue);
|
|
179
179
|
}), (a, p) => (i(), y(z, {
|
|
180
180
|
field: t.value
|
|
181
181
|
}, null, 8, ["field"]));
|
|
182
182
|
}
|
|
183
183
|
});
|
|
184
184
|
function Ve() {
|
|
185
|
-
const
|
|
186
|
-
let
|
|
185
|
+
const o = S(), e = S(!1);
|
|
186
|
+
let n, r;
|
|
187
187
|
return {
|
|
188
188
|
cva: {
|
|
189
189
|
writeValue(t) {
|
|
190
|
-
|
|
190
|
+
o.value = t;
|
|
191
191
|
},
|
|
192
192
|
registerOnChange(t) {
|
|
193
|
-
|
|
193
|
+
n = t;
|
|
194
194
|
},
|
|
195
195
|
registerOnTouched(t) {
|
|
196
196
|
r = t;
|
|
@@ -199,10 +199,10 @@ function Ve() {
|
|
|
199
199
|
e.value = t;
|
|
200
200
|
}
|
|
201
201
|
},
|
|
202
|
-
value:
|
|
202
|
+
value: o,
|
|
203
203
|
disabled: e,
|
|
204
204
|
valueChange: (t) => {
|
|
205
|
-
|
|
205
|
+
n(t), o.value = t;
|
|
206
206
|
},
|
|
207
207
|
touchedChange: () => {
|
|
208
208
|
r();
|
|
@@ -214,9 +214,9 @@ const ke = /* @__PURE__ */ j({
|
|
|
214
214
|
props: {
|
|
215
215
|
fields: {}
|
|
216
216
|
},
|
|
217
|
-
setup(
|
|
218
|
-
const e =
|
|
219
|
-
return (
|
|
217
|
+
setup(o) {
|
|
218
|
+
const e = o;
|
|
219
|
+
return (n, r) => (i(!0), E(P, null, Z(e.fields, (l, t) => (i(), y(z, {
|
|
220
220
|
key: t,
|
|
221
221
|
field: l
|
|
222
222
|
}, null, 8, ["field"]))), 128));
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@piying/view-vue",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@piying/view-core": "^0.6.
|
|
6
|
+
"@piying/view-core": "^0.6.27",
|
|
7
7
|
"fast-equals": "^5.2.2",
|
|
8
8
|
"rfdc": "^1.4.1",
|
|
9
9
|
"static-injector": "^6.1.2"
|