@piying/view-vue 1.1.3 → 1.1.5
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/token.d.ts +1 -1
- package/index.d.ts +0 -1
- package/index.js +54 -55
- package/package.json +1 -1
package/formly/token.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ import type { Injector } from 'static-injector';
|
|
|
2
2
|
import type { ComputedRef, InjectionKey } from 'vue';
|
|
3
3
|
import type { PiResolvedViewFieldConfig } from './type/group';
|
|
4
4
|
export declare const InjectorToken: InjectionKey<Injector>;
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const PI_VIEW_FIELD_TOKEN: InjectionKey<ComputedRef<PiResolvedViewFieldConfig>>;
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { inject as B, shallowRef as
|
|
1
|
+
var L = Object.defineProperty;
|
|
2
|
+
var U = (n, e, o) => e in n ? L(n, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : n[e] = o;
|
|
3
|
+
var F = (n, e, o) => U(n, typeof e != "symbol" ? e + "" : e, o);
|
|
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 $, createVNode as J, normalizeProps as M, guardReactiveProps as Q, defineAsyncComponent as X, provide as N, ref as D, watch as H, onUnmounted as Y, createElementBlock as S, 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
|
-
|
|
7
|
-
import { effect as q, createRootInjector as le, ChangeDetectionSchedulerImpl as ae, ChangeDetectionScheduler as ue, createInjector as se, DestroyRef as ie, untracked as ce } from "static-injector";
|
|
6
|
+
import { effect as W, createRootInjector as le, ChangeDetectionSchedulerImpl as ae, ChangeDetectionScheduler as ue, createInjector as se, DestroyRef as ie, untracked as ce } from "static-injector";
|
|
8
7
|
import { deepEqual as de } from "fast-equals";
|
|
9
8
|
class pe extends ee {
|
|
10
9
|
constructor() {
|
|
11
10
|
super(...arguments);
|
|
12
|
-
|
|
11
|
+
F(this, "contents");
|
|
13
12
|
}
|
|
14
13
|
}
|
|
15
14
|
class fe extends te {
|
|
16
15
|
}
|
|
17
|
-
const
|
|
16
|
+
const R = Symbol(), me = Symbol();
|
|
18
17
|
function m(n) {
|
|
19
|
-
const e = B(
|
|
20
|
-
return
|
|
18
|
+
const e = B(R), o = O(void 0);
|
|
19
|
+
return G((r) => {
|
|
21
20
|
o.value = n();
|
|
22
|
-
const l =
|
|
21
|
+
const l = W(
|
|
23
22
|
() => {
|
|
24
23
|
const t = n();
|
|
25
24
|
Object.is(o.value, t) || (o.value = t);
|
|
@@ -31,7 +30,7 @@ function m(n) {
|
|
|
31
30
|
});
|
|
32
31
|
}), o;
|
|
33
32
|
}
|
|
34
|
-
const
|
|
33
|
+
const q = /* @__PURE__ */ j({
|
|
35
34
|
__name: "wrapper",
|
|
36
35
|
props: {
|
|
37
36
|
wrappers: {}
|
|
@@ -44,10 +43,10 @@ const z = /* @__PURE__ */ j({
|
|
|
44
43
|
var a;
|
|
45
44
|
return ((a = r.value) == null ? void 0 : a.outputs) ?? {};
|
|
46
45
|
});
|
|
47
|
-
return (a, p) => r.value ? (i(), y(
|
|
48
|
-
default:
|
|
49
|
-
|
|
50
|
-
default:
|
|
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: o.value })), {
|
|
49
|
+
default: $(() => [
|
|
51
50
|
T(a.$slots, "default")
|
|
52
51
|
]),
|
|
53
52
|
_: 3
|
|
@@ -56,32 +55,32 @@ const z = /* @__PURE__ */ j({
|
|
|
56
55
|
_: 3
|
|
57
56
|
}, 16)) : T(a.$slots, "default", { key: 1 });
|
|
58
57
|
}
|
|
59
|
-
}),
|
|
58
|
+
}), z = /* @__PURE__ */ j({
|
|
60
59
|
__name: "field-template",
|
|
61
60
|
props: {
|
|
62
61
|
field: {}
|
|
63
62
|
},
|
|
64
63
|
setup(n) {
|
|
65
|
-
const e = n, o = B(
|
|
64
|
+
const e = n, o = 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() })), E = m(() => e.field.wrappers()), g = m(() => {
|
|
66
65
|
var u, s;
|
|
67
66
|
return (s = (u = e.field).fieldGroup) == null ? void 0 : s.call(u);
|
|
68
67
|
}), w = m(() => {
|
|
69
68
|
var u, s;
|
|
70
69
|
return (s = (u = e.field).fieldArray) == null ? void 0 : s.call(u);
|
|
71
|
-
}),
|
|
70
|
+
}), _ = v(() => ({ ...a.value, ...r.value })), c = v(
|
|
72
71
|
() => {
|
|
73
|
-
var u, s,
|
|
74
|
-
return typeof ((u = e.field.define) == null ? void 0 : u.type) == "function" ? X((s = e.field.define) == null ? void 0 : s.type) : (
|
|
72
|
+
var u, s, V;
|
|
73
|
+
return typeof ((u = e.field.define) == null ? void 0 : u.type) == "function" ? X((s = e.field.define) == null ? void 0 : s.type) : (V = e.field.define) == null ? void 0 : V.type;
|
|
75
74
|
}
|
|
76
|
-
),
|
|
77
|
-
|
|
78
|
-
const C =
|
|
75
|
+
), h = v(() => e.field);
|
|
76
|
+
N(me, h);
|
|
77
|
+
const C = D(null), K = oe(h.value.form.control);
|
|
79
78
|
let f;
|
|
80
|
-
return
|
|
79
|
+
return H(
|
|
81
80
|
C,
|
|
82
81
|
(u) => {
|
|
83
|
-
f == null || f.forEach((s) => s()),
|
|
84
|
-
() =>
|
|
82
|
+
f == null || f.forEach((s) => s()), K && u && (f = ne(
|
|
83
|
+
() => h.value.form.control,
|
|
85
84
|
u.cva,
|
|
86
85
|
o
|
|
87
86
|
));
|
|
@@ -90,18 +89,18 @@ const z = /* @__PURE__ */ j({
|
|
|
90
89
|
), Y(() => {
|
|
91
90
|
f == null || f.forEach((u) => u()), f = [];
|
|
92
91
|
}), (u, s) => {
|
|
93
|
-
var
|
|
94
|
-
return d(t).hidden ? A("", !0) : (i(),
|
|
95
|
-
(
|
|
92
|
+
var V;
|
|
93
|
+
return d(t).hidden ? A("", !0) : (i(), S(P, { key: 0 }, [
|
|
94
|
+
(V = h.value.define) != null && V.type ? (i(), y(q, {
|
|
96
95
|
key: 0,
|
|
97
|
-
wrappers: d(
|
|
96
|
+
wrappers: d(E)
|
|
98
97
|
}, {
|
|
99
|
-
default:
|
|
100
|
-
d(g) ? (i(), y(
|
|
101
|
-
|
|
98
|
+
default: $(() => [
|
|
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(), S(P, { key: 2 }, [
|
|
100
|
+
h.value.form.control ? (i(), y(k(c.value), I({ key: 0 }, _.value, b(d(l)), {
|
|
102
101
|
ref_key: "childRef",
|
|
103
102
|
ref: C
|
|
104
|
-
}), null, 16)) : (i(), y(
|
|
103
|
+
}), null, 16)) : (i(), y(k(c.value), I({ key: 1 }, _.value, b(d(l))), null, 16))
|
|
105
104
|
], 64))
|
|
106
105
|
]),
|
|
107
106
|
_: 1
|
|
@@ -112,7 +111,7 @@ const z = /* @__PURE__ */ j({
|
|
|
112
111
|
});
|
|
113
112
|
function ve(n, e, o, r) {
|
|
114
113
|
let l = !0;
|
|
115
|
-
return
|
|
114
|
+
return W(
|
|
116
115
|
() => {
|
|
117
116
|
const t = e.value$$();
|
|
118
117
|
l ? (de(t, n) || r(t), l = !1) : r(t);
|
|
@@ -137,11 +136,11 @@ const Ce = /* @__PURE__ */ j({
|
|
|
137
136
|
}
|
|
138
137
|
]
|
|
139
138
|
});
|
|
140
|
-
|
|
141
|
-
const t =
|
|
142
|
-
return
|
|
139
|
+
N(R, l);
|
|
140
|
+
const t = O(void 0);
|
|
141
|
+
return H(
|
|
143
142
|
() => [o.schema, o.options],
|
|
144
|
-
([a, p],
|
|
143
|
+
([a, p], x, E) => {
|
|
145
144
|
const g = se({ providers: [], parent: l }), w = re(a, {
|
|
146
145
|
handle: pe,
|
|
147
146
|
builder: fe,
|
|
@@ -154,36 +153,36 @@ const Ce = /* @__PURE__ */ j({
|
|
|
154
153
|
...p
|
|
155
154
|
});
|
|
156
155
|
t.value = w;
|
|
157
|
-
let
|
|
156
|
+
let _;
|
|
158
157
|
if (w.form.control) {
|
|
159
158
|
const c = o.modelValue;
|
|
160
|
-
|
|
159
|
+
_ = ve(
|
|
161
160
|
typeof c < "u" ? c : void 0,
|
|
162
161
|
w.form.control,
|
|
163
162
|
g,
|
|
164
|
-
(
|
|
163
|
+
(h) => {
|
|
165
164
|
ce(() => {
|
|
166
165
|
var C;
|
|
167
|
-
(C = w.form.control) != null && C.valueNoError$$() && r("update:modelValue",
|
|
166
|
+
(C = w.form.control) != null && C.valueNoError$$() && r("update:modelValue", h);
|
|
168
167
|
});
|
|
169
168
|
}
|
|
170
169
|
);
|
|
171
170
|
}
|
|
172
|
-
|
|
173
|
-
g.destroy(),
|
|
171
|
+
E(() => {
|
|
172
|
+
g.destroy(), _ == null || _.destroy();
|
|
174
173
|
});
|
|
175
174
|
},
|
|
176
175
|
{ immediate: !0 }
|
|
177
|
-
),
|
|
176
|
+
), G(() => {
|
|
178
177
|
var a;
|
|
179
178
|
(a = t.value.form.control) == null || a.updateValue(o.modelValue);
|
|
180
|
-
}), (a, p) => (i(), y(
|
|
179
|
+
}), (a, p) => (i(), y(z, {
|
|
181
180
|
field: t.value
|
|
182
181
|
}, null, 8, ["field"]));
|
|
183
182
|
}
|
|
184
183
|
});
|
|
185
|
-
function
|
|
186
|
-
const n =
|
|
184
|
+
function Ve() {
|
|
185
|
+
const n = D(), e = D(!1);
|
|
187
186
|
let o, r;
|
|
188
187
|
return {
|
|
189
188
|
cva: {
|
|
@@ -210,24 +209,24 @@ function ke() {
|
|
|
210
209
|
}
|
|
211
210
|
};
|
|
212
211
|
}
|
|
213
|
-
const
|
|
212
|
+
const ke = /* @__PURE__ */ j({
|
|
214
213
|
__name: "group",
|
|
215
214
|
props: {
|
|
216
215
|
fields: {}
|
|
217
216
|
},
|
|
218
217
|
setup(n) {
|
|
219
218
|
const e = n;
|
|
220
|
-
return (o, r) => (i(!0),
|
|
219
|
+
return (o, r) => (i(!0), S(P, null, Z(e.fields, (l, t) => (i(), y(z, {
|
|
221
220
|
key: t,
|
|
222
221
|
field: l
|
|
223
222
|
}, null, 8, ["field"]))), 128));
|
|
224
223
|
}
|
|
225
224
|
});
|
|
226
225
|
export {
|
|
227
|
-
|
|
226
|
+
z as PiyingFieldTemplate,
|
|
228
227
|
Ce as PiyingView,
|
|
229
|
-
|
|
228
|
+
ke as PiyingViewGroup,
|
|
230
229
|
ve as initListen,
|
|
231
230
|
m as signalToRef,
|
|
232
|
-
|
|
231
|
+
Ve as useControlValueAccessor
|
|
233
232
|
};
|