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