@piying/view-vue 1.3.3 → 1.4.1
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/{field-template.vue.d.ts → component/field-template.vue.d.ts} +1 -1
- package/index.d.ts +2 -2
- package/index.js +91 -104
- package/package.json +5 -6
- package/util/index.d.ts +0 -1
- package/util/init-listen.d.ts +0 -3
- /package/{piying-view.vue.d.ts → component/piying-view.vue.d.ts} +0 -0
- /package/{wrapper.vue.d.ts → component/wrapper.vue.d.ts} +0 -0
package/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import PiyingView from './piying-view.vue';
|
|
1
|
+
import PiyingView from './component/piying-view.vue';
|
|
2
2
|
export { PiyingView };
|
|
3
3
|
export * from './util';
|
|
4
|
-
import PiyingFieldTemplate from './field-template.vue';
|
|
4
|
+
import PiyingFieldTemplate from './component/field-template.vue';
|
|
5
5
|
export { PiyingFieldTemplate };
|
|
6
6
|
import PiyingViewGroup from './component/group.vue';
|
|
7
7
|
export { PiyingViewGroup };
|
package/index.js
CHANGED
|
@@ -1,99 +1,98 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { inject as
|
|
5
|
-
import { CoreSchemaHandle as Y, FormBuilder as Z,
|
|
6
|
-
import { effect as
|
|
7
|
-
|
|
8
|
-
class ie extends Y {
|
|
1
|
+
var G = Object.defineProperty;
|
|
2
|
+
var K = (o, e, t) => e in o ? G(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
+
var F = (o, e, t) => K(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { inject as R, shallowRef as B, watchEffect as O, defineComponent as I, computed as g, createBlock as _, renderSlot as L, openBlock as d, resolveDynamicComponent as w, mergeProps as k, unref as m, toHandlers as V, withCtx as j, createVNode as M, normalizeProps as U, guardReactiveProps as q, defineAsyncComponent as J, provide as N, ref as D, watch as z, onUnmounted as Q, createElementBlock as S, createCommentVNode as T, Fragment as P, renderList as X } from "vue";
|
|
5
|
+
import { CoreSchemaHandle as Y, FormBuilder as Z, isLazyMark as ee, getLazyImport as te, isFieldControl as ne, createViewControlLink as oe, convert as re, initListen as le } from "@piying/view-core";
|
|
6
|
+
import { effect as ae, createRootInjector as se, ChangeDetectionSchedulerImpl as ce, ChangeDetectionScheduler as ue, createInjector as ie, DestroyRef as de, untracked as pe } from "static-injector";
|
|
7
|
+
class fe extends Y {
|
|
9
8
|
constructor() {
|
|
10
9
|
super(...arguments);
|
|
11
|
-
|
|
10
|
+
F(this, "contents");
|
|
12
11
|
}
|
|
13
12
|
}
|
|
14
|
-
class
|
|
13
|
+
class me extends Z {
|
|
15
14
|
}
|
|
16
|
-
const
|
|
15
|
+
const $ = Symbol(), H = Symbol();
|
|
17
16
|
function v(o) {
|
|
18
|
-
const e =
|
|
19
|
-
return O((
|
|
20
|
-
|
|
21
|
-
const a =
|
|
17
|
+
const e = R($), t = B(void 0);
|
|
18
|
+
return O((l) => {
|
|
19
|
+
t.value = o();
|
|
20
|
+
const a = ae(
|
|
22
21
|
() => {
|
|
23
|
-
const
|
|
24
|
-
Object.is(
|
|
22
|
+
const n = o();
|
|
23
|
+
Object.is(t.value, n) || (t.value = n);
|
|
25
24
|
},
|
|
26
25
|
{ injector: e }
|
|
27
26
|
);
|
|
28
|
-
|
|
27
|
+
l(() => {
|
|
29
28
|
a.destroy();
|
|
30
29
|
});
|
|
31
|
-
}),
|
|
30
|
+
}), t;
|
|
32
31
|
}
|
|
33
|
-
const
|
|
32
|
+
const A = /* @__PURE__ */ I({
|
|
34
33
|
__name: "wrapper",
|
|
35
34
|
props: {
|
|
36
35
|
wrappers: {}
|
|
37
36
|
},
|
|
38
37
|
setup(o) {
|
|
39
|
-
const e = o,
|
|
40
|
-
var
|
|
41
|
-
return { ...(
|
|
42
|
-
}),
|
|
43
|
-
var
|
|
44
|
-
return ((
|
|
38
|
+
const e = o, t = g(() => e.wrappers.slice(1)), l = g(() => e.wrappers[0]), a = v(() => {
|
|
39
|
+
var r, c;
|
|
40
|
+
return { ...(r = l.value) == null ? void 0 : r.inputs(), ...(c = l.value) == null ? void 0 : c.attributes() };
|
|
41
|
+
}), n = g(() => {
|
|
42
|
+
var r;
|
|
43
|
+
return ((r = l.value) == null ? void 0 : r.outputs) ?? {};
|
|
45
44
|
});
|
|
46
|
-
return (
|
|
45
|
+
return (r, c) => l.value ? (d(), _(w(l.value.type), k({ key: 0 }, m(a), V(n.value)), {
|
|
47
46
|
default: j(() => [
|
|
48
|
-
|
|
47
|
+
M(A, U(q({ wrappers: t.value })), {
|
|
49
48
|
default: j(() => [
|
|
50
|
-
|
|
49
|
+
L(r.$slots, "default")
|
|
51
50
|
]),
|
|
52
51
|
_: 3
|
|
53
52
|
}, 16)
|
|
54
53
|
]),
|
|
55
54
|
_: 3
|
|
56
|
-
}, 16)) :
|
|
55
|
+
}, 16)) : L(r.$slots, "default", { key: 1 });
|
|
57
56
|
}
|
|
58
|
-
}),
|
|
57
|
+
}), W = /* @__PURE__ */ I({
|
|
59
58
|
__name: "field-template",
|
|
60
59
|
props: {
|
|
61
60
|
field: {}
|
|
62
61
|
},
|
|
63
62
|
setup(o) {
|
|
64
|
-
const e = o,
|
|
63
|
+
const e = o, t = R($), l = v(() => e.field.inputs()), a = v(() => e.field.outputs()), n = v(() => e.field.renderConfig()), r = v(() => e.field.attributes()), c = g(() => ({ ...r.value, ...l.value })), x = v(() => {
|
|
65
64
|
var s, f;
|
|
66
65
|
return (f = (s = e.field).children) == null ? void 0 : f.call(s);
|
|
67
66
|
}), b = v(() => e.field.wrappers()), p = g(
|
|
68
67
|
() => {
|
|
69
|
-
var s, f, C;
|
|
70
|
-
return typeof ((s = e.field.define) == null ? void 0 : s.type) == "function"
|
|
68
|
+
var s, f, C, E;
|
|
69
|
+
return typeof ((s = e.field.define) == null ? void 0 : s.type) == "function" || ee((f = e.field.define) == null ? void 0 : f.type) ? J(te((C = e.field.define) == null ? void 0 : C.type)) : (E = e.field.define) == null ? void 0 : E.type;
|
|
71
70
|
}
|
|
72
71
|
), u = g(() => e.field);
|
|
73
|
-
|
|
74
|
-
const y =
|
|
72
|
+
N(H, u);
|
|
73
|
+
const y = D(null), h = ne(u.value.form.control);
|
|
75
74
|
let i;
|
|
76
|
-
return
|
|
75
|
+
return z(
|
|
77
76
|
[y, u],
|
|
78
77
|
([s, f]) => {
|
|
79
|
-
i == null || i(), h && s && (i =
|
|
78
|
+
i == null || i(), h && s && (i = oe(() => f.form.control, s.cva, t));
|
|
80
79
|
},
|
|
81
80
|
{ immediate: !0 }
|
|
82
81
|
), Q(() => {
|
|
83
82
|
i == null || i(), i = void 0;
|
|
84
83
|
}), (s, f) => {
|
|
85
84
|
var C;
|
|
86
|
-
return m(
|
|
87
|
-
(C = u.value.define) != null && C.type ? (d(), _(
|
|
85
|
+
return m(n).hidden ? T("", !0) : (d(), S(P, { key: 0 }, [
|
|
86
|
+
(C = u.value.define) != null && C.type ? (d(), _(A, {
|
|
88
87
|
key: 0,
|
|
89
88
|
wrappers: m(b)
|
|
90
89
|
}, {
|
|
91
90
|
default: j(() => [
|
|
92
|
-
m(
|
|
93
|
-
u.value.form.control ? (d(), _(w(p.value),
|
|
91
|
+
m(x) ? (d(), _(w(p.value), k({ key: 0 }, c.value, V(m(a))), null, 16)) : (d(), S(P, { key: 1 }, [
|
|
92
|
+
u.value.form.control ? (d(), _(w(p.value), k({ key: 0 }, c.value, V(m(a)), {
|
|
94
93
|
ref_key: "childRef",
|
|
95
94
|
ref: y
|
|
96
|
-
}), null, 16)) : (d(), _(w(p.value),
|
|
95
|
+
}), null, 16)) : (d(), _(w(p.value), k({ key: 1 }, c.value, V(m(a))), null, 16))
|
|
97
96
|
], 64))
|
|
98
97
|
]),
|
|
99
98
|
_: 1
|
|
@@ -101,18 +100,7 @@ const W = /* @__PURE__ */ I({
|
|
|
101
100
|
], 64));
|
|
102
101
|
};
|
|
103
102
|
}
|
|
104
|
-
})
|
|
105
|
-
function pe(o, e, n, r) {
|
|
106
|
-
let a = !0;
|
|
107
|
-
return H(
|
|
108
|
-
() => {
|
|
109
|
-
const t = e.value$$();
|
|
110
|
-
a ? (ue(t, o) || r(t), a = !1) : r(t);
|
|
111
|
-
},
|
|
112
|
-
{ injector: n }
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
const he = /* @__PURE__ */ I({
|
|
103
|
+
}), ge = /* @__PURE__ */ I({
|
|
116
104
|
__name: "piying-view",
|
|
117
105
|
props: {
|
|
118
106
|
schema: {},
|
|
@@ -121,42 +109,42 @@ const he = /* @__PURE__ */ I({
|
|
|
121
109
|
},
|
|
122
110
|
emits: ["update:modelValue"],
|
|
123
111
|
setup(o, { emit: e }) {
|
|
124
|
-
const
|
|
112
|
+
const t = o, l = e, a = se({
|
|
125
113
|
providers: [
|
|
126
114
|
{
|
|
127
|
-
provide:
|
|
128
|
-
useClass:
|
|
115
|
+
provide: ue,
|
|
116
|
+
useClass: ce
|
|
129
117
|
}
|
|
130
118
|
]
|
|
131
119
|
});
|
|
132
|
-
|
|
133
|
-
const
|
|
134
|
-
return
|
|
135
|
-
() => [
|
|
136
|
-
([
|
|
137
|
-
const p =
|
|
138
|
-
handle:
|
|
139
|
-
builder:
|
|
120
|
+
N($, a);
|
|
121
|
+
const n = B(void 0);
|
|
122
|
+
return z(
|
|
123
|
+
() => [t.schema, t.options],
|
|
124
|
+
([r, c], x, b) => {
|
|
125
|
+
const p = ie({ providers: [], parent: a }), u = re(r, {
|
|
126
|
+
handle: fe,
|
|
127
|
+
builder: me,
|
|
140
128
|
injector: p,
|
|
141
129
|
registerOnDestroy: (h) => {
|
|
142
|
-
p.get(
|
|
130
|
+
p.get(de).onDestroy(() => {
|
|
143
131
|
h();
|
|
144
132
|
});
|
|
145
133
|
},
|
|
146
134
|
...c
|
|
147
135
|
});
|
|
148
|
-
|
|
136
|
+
n.value = u;
|
|
149
137
|
let y;
|
|
150
138
|
if (u.form.control) {
|
|
151
|
-
const h =
|
|
152
|
-
y =
|
|
139
|
+
const h = t.modelValue;
|
|
140
|
+
y = le(
|
|
153
141
|
typeof h < "u" ? h : void 0,
|
|
154
142
|
u.form.control,
|
|
155
143
|
p,
|
|
156
144
|
(i) => {
|
|
157
|
-
|
|
145
|
+
pe(() => {
|
|
158
146
|
var s;
|
|
159
|
-
(s = u.form.control) != null && s.valueNoError$$() &&
|
|
147
|
+
(s = u.form.control) != null && s.valueNoError$$() && l("update:modelValue", i);
|
|
160
148
|
});
|
|
161
149
|
}
|
|
162
150
|
);
|
|
@@ -167,62 +155,61 @@ const he = /* @__PURE__ */ I({
|
|
|
167
155
|
},
|
|
168
156
|
{ immediate: !0 }
|
|
169
157
|
), O(() => {
|
|
170
|
-
var
|
|
171
|
-
(
|
|
172
|
-
}), (
|
|
173
|
-
field:
|
|
158
|
+
var r;
|
|
159
|
+
(r = n.value.form.control) == null || r.updateValue(t.modelValue);
|
|
160
|
+
}), (r, c) => (d(), _(W, {
|
|
161
|
+
field: n.value
|
|
174
162
|
}, null, 8, ["field"]));
|
|
175
163
|
}
|
|
176
164
|
});
|
|
177
|
-
function
|
|
178
|
-
const o =
|
|
179
|
-
let
|
|
165
|
+
function Ce() {
|
|
166
|
+
const o = D(), e = D(!1);
|
|
167
|
+
let t, l;
|
|
180
168
|
return {
|
|
181
169
|
cva: {
|
|
182
|
-
writeValue(
|
|
183
|
-
o.value =
|
|
170
|
+
writeValue(n) {
|
|
171
|
+
o.value = n;
|
|
184
172
|
},
|
|
185
|
-
registerOnChange(
|
|
186
|
-
|
|
173
|
+
registerOnChange(n) {
|
|
174
|
+
t = n;
|
|
187
175
|
},
|
|
188
|
-
registerOnTouched(
|
|
189
|
-
|
|
176
|
+
registerOnTouched(n) {
|
|
177
|
+
l = n;
|
|
190
178
|
},
|
|
191
|
-
setDisabledState(
|
|
192
|
-
e.value =
|
|
179
|
+
setDisabledState(n) {
|
|
180
|
+
e.value = n;
|
|
193
181
|
}
|
|
194
182
|
},
|
|
195
183
|
cvaa: {
|
|
196
184
|
value: o,
|
|
197
185
|
disabled: e,
|
|
198
|
-
valueChange: (
|
|
199
|
-
n
|
|
186
|
+
valueChange: (n) => {
|
|
187
|
+
t(n), o.value = n;
|
|
200
188
|
},
|
|
201
189
|
touchedChange: () => {
|
|
202
|
-
|
|
190
|
+
l();
|
|
203
191
|
}
|
|
204
192
|
}
|
|
205
193
|
};
|
|
206
194
|
}
|
|
207
|
-
const
|
|
195
|
+
const we = /* @__PURE__ */ I({
|
|
208
196
|
__name: "group",
|
|
209
197
|
setup(o) {
|
|
210
|
-
const e =
|
|
211
|
-
return (
|
|
212
|
-
key:
|
|
213
|
-
field:
|
|
198
|
+
const e = R(H), t = v(() => e == null ? void 0 : e.value.children());
|
|
199
|
+
return (l, a) => (d(!0), S(P, null, X(m(t), (n, r) => (d(), _(W, {
|
|
200
|
+
key: r,
|
|
201
|
+
field: n
|
|
214
202
|
}, null, 8, ["field"]))), 128));
|
|
215
203
|
}
|
|
216
204
|
});
|
|
217
205
|
export {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
pe as initListen,
|
|
206
|
+
$ as InjectorToken,
|
|
207
|
+
H as PI_VIEW_FIELD_TOKEN,
|
|
208
|
+
W as PiyingFieldTemplate,
|
|
209
|
+
ge as PiyingView,
|
|
210
|
+
we as PiyingViewGroup,
|
|
211
|
+
me as VueFormBuilder,
|
|
212
|
+
fe as VueSchemaHandle,
|
|
226
213
|
v as signalToRef,
|
|
227
|
-
|
|
214
|
+
Ce as useControlValueAccessor
|
|
228
215
|
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@piying/view-vue",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "Piying view For Vue;Valibot to Component",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"homepage": "https://piying-org.github.io/website/docs/client/intro",
|
|
7
7
|
"repository": {
|
|
8
|
-
"url": "https://github.com/piying-org/piying-view",
|
|
8
|
+
"url": "git+https://github.com/piying-org/piying-view.git",
|
|
9
9
|
"directory": "packages/vue",
|
|
10
10
|
"type": "git"
|
|
11
11
|
},
|
|
@@ -36,14 +36,13 @@
|
|
|
36
36
|
],
|
|
37
37
|
"license": "MIT",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@piying/view-core": "^1.
|
|
40
|
-
"fast-equals": "^5.2.2",
|
|
41
|
-
"rfdc": "^1.4.1",
|
|
39
|
+
"@piying/view-core": "^1.4.1",
|
|
42
40
|
"static-injector": "^6.1.2"
|
|
43
41
|
},
|
|
44
42
|
"sideEffects": false,
|
|
45
43
|
"peerDependencies": {
|
|
46
|
-
"vue": "^3.4.21"
|
|
44
|
+
"vue": "^3.4.21",
|
|
45
|
+
"valibot": "^1.1.0"
|
|
47
46
|
},
|
|
48
47
|
"module": "index.js",
|
|
49
48
|
"typings": "index.d.ts",
|
package/util/index.d.ts
CHANGED
package/util/init-listen.d.ts
DELETED
|
File without changes
|
|
File without changes
|