@piying/view-vue 1.2.2 → 1.3.2
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/component/group.vue.d.ts +1 -14
- package/index.js +109 -115
- package/package.json +2 -2
- package/readme.md +27 -1
package/component/group.vue.d.ts
CHANGED
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
fields: PiResolvedViewFieldConfig[];
|
|
4
|
-
};
|
|
5
|
-
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}, {}>;
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
6
2
|
export default _default;
|
|
7
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
8
|
-
type __VLS_TypePropsToOption<T> = {
|
|
9
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
10
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
11
|
-
} : {
|
|
12
|
-
type: import('vue').PropType<T[K]>;
|
|
13
|
-
required: true;
|
|
14
|
-
};
|
|
15
|
-
};
|
package/index.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { inject as
|
|
5
|
-
import { CoreSchemaHandle as
|
|
6
|
-
import { effect as H, createRootInjector as
|
|
7
|
-
import { deepEqual as
|
|
8
|
-
class
|
|
1
|
+
var z = Object.defineProperty;
|
|
2
|
+
var G = (o, e, n) => e in o ? z(o, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : o[e] = n;
|
|
3
|
+
var x = (o, e, n) => G(o, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { inject as E, shallowRef as B, watchEffect as O, defineComponent as I, computed as g, createBlock as _, renderSlot as F, openBlock as d, resolveDynamicComponent as w, mergeProps as V, unref as m, toHandlers as k, withCtx as j, createVNode as K, normalizeProps as U, guardReactiveProps as J, defineAsyncComponent as M, provide as L, ref as $, watch as N, onUnmounted as Q, createElementBlock as D, createCommentVNode as T, Fragment as S, renderList as X } from "vue";
|
|
5
|
+
import { CoreSchemaHandle as Y, FormBuilder as Z, isFieldControl as ee, createViewControlLink as te, convert as ne } from "@piying/view-core";
|
|
6
|
+
import { effect as H, createRootInjector as oe, ChangeDetectionSchedulerImpl as re, ChangeDetectionScheduler as le, createInjector as ae, DestroyRef as se, untracked as ce } from "static-injector";
|
|
7
|
+
import { deepEqual as ue } from "fast-equals";
|
|
8
|
+
class ie extends Y {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
11
|
-
|
|
11
|
+
x(this, "contents");
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
class
|
|
14
|
+
class de extends Z {
|
|
15
15
|
}
|
|
16
|
-
const
|
|
17
|
-
function
|
|
18
|
-
const e =
|
|
19
|
-
return
|
|
16
|
+
const P = Symbol(), A = Symbol();
|
|
17
|
+
function v(o) {
|
|
18
|
+
const e = E(P), n = B(void 0);
|
|
19
|
+
return O((r) => {
|
|
20
20
|
n.value = o();
|
|
21
|
-
const
|
|
21
|
+
const a = H(
|
|
22
22
|
() => {
|
|
23
23
|
const t = o();
|
|
24
24
|
Object.is(n.value, t) || (n.value = t);
|
|
@@ -26,96 +26,93 @@ function m(o) {
|
|
|
26
26
|
{ injector: e }
|
|
27
27
|
);
|
|
28
28
|
r(() => {
|
|
29
|
-
|
|
29
|
+
a.destroy();
|
|
30
30
|
});
|
|
31
31
|
}), n;
|
|
32
32
|
}
|
|
33
|
-
const W = /* @__PURE__ */
|
|
33
|
+
const W = /* @__PURE__ */ I({
|
|
34
34
|
__name: "wrapper",
|
|
35
35
|
props: {
|
|
36
36
|
wrappers: {}
|
|
37
37
|
},
|
|
38
38
|
setup(o) {
|
|
39
|
-
const e = o, n =
|
|
40
|
-
var
|
|
41
|
-
return { ...(
|
|
42
|
-
}), t =
|
|
43
|
-
var
|
|
44
|
-
return ((
|
|
39
|
+
const e = o, n = g(() => e.wrappers.slice(1)), r = g(() => e.wrappers[0]), a = v(() => {
|
|
40
|
+
var l, c;
|
|
41
|
+
return { ...(l = r.value) == null ? void 0 : l.inputs(), ...(c = r.value) == null ? void 0 : c.attributes() };
|
|
42
|
+
}), t = g(() => {
|
|
43
|
+
var l;
|
|
44
|
+
return ((l = r.value) == null ? void 0 : l.outputs) ?? {};
|
|
45
45
|
});
|
|
46
|
-
return (
|
|
47
|
-
default:
|
|
48
|
-
|
|
49
|
-
default:
|
|
50
|
-
|
|
46
|
+
return (l, c) => r.value ? (d(), _(w(r.value.type), V({ key: 0 }, m(a), k(t.value)), {
|
|
47
|
+
default: j(() => [
|
|
48
|
+
K(W, U(J({ wrappers: n.value })), {
|
|
49
|
+
default: j(() => [
|
|
50
|
+
F(l.$slots, "default")
|
|
51
51
|
]),
|
|
52
52
|
_: 3
|
|
53
53
|
}, 16)
|
|
54
54
|
]),
|
|
55
55
|
_: 3
|
|
56
|
-
}, 16)) :
|
|
56
|
+
}, 16)) : F(l.$slots, "default", { key: 1 });
|
|
57
57
|
}
|
|
58
|
-
}), q = /* @__PURE__ */
|
|
58
|
+
}), q = /* @__PURE__ */ I({
|
|
59
59
|
__name: "field-template",
|
|
60
60
|
props: {
|
|
61
61
|
field: {}
|
|
62
62
|
},
|
|
63
63
|
setup(o) {
|
|
64
|
-
const e = o, n =
|
|
65
|
-
var s,
|
|
66
|
-
return (
|
|
67
|
-
}),
|
|
68
|
-
var s, i;
|
|
69
|
-
return (i = (s = e.field).fieldArray) == null ? void 0 : i.call(s);
|
|
70
|
-
}), h = v(() => ({ ...u.value, fields: D.value })), g = v(() => ({ ...u.value, fields: j.value })), w = m(() => e.field.wrappers()), d = v(
|
|
64
|
+
const e = o, n = E(P), r = v(() => e.field.inputs()), a = v(() => e.field.outputs()), t = v(() => e.field.renderConfig()), l = v(() => e.field.attributes()), c = g(() => ({ ...l.value, ...r.value })), R = v(() => {
|
|
65
|
+
var s, f;
|
|
66
|
+
return (f = (s = e.field).children) == null ? void 0 : f.call(s);
|
|
67
|
+
}), b = v(() => e.field.wrappers()), p = g(
|
|
71
68
|
() => {
|
|
72
|
-
var s,
|
|
73
|
-
return typeof ((s = e.field.define) == null ? void 0 : s.type) == "function" ?
|
|
69
|
+
var s, f, C;
|
|
70
|
+
return typeof ((s = e.field.define) == null ? void 0 : s.type) == "function" ? M((f = e.field.define) == null ? void 0 : f.type) : (C = e.field.define) == null ? void 0 : C.type;
|
|
74
71
|
}
|
|
75
|
-
),
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
let
|
|
79
|
-
return
|
|
80
|
-
[
|
|
81
|
-
([s,
|
|
82
|
-
|
|
72
|
+
), u = g(() => e.field);
|
|
73
|
+
L(A, u);
|
|
74
|
+
const y = $(null), h = ee(u.value.form.control);
|
|
75
|
+
let i;
|
|
76
|
+
return N(
|
|
77
|
+
[y, u],
|
|
78
|
+
([s, f]) => {
|
|
79
|
+
i == null || i(), h && s && (i = te(() => f.form.control, s.cva, n));
|
|
83
80
|
},
|
|
84
81
|
{ immediate: !0 }
|
|
85
|
-
),
|
|
86
|
-
|
|
87
|
-
}), (s,
|
|
88
|
-
var
|
|
89
|
-
return
|
|
90
|
-
(
|
|
82
|
+
), Q(() => {
|
|
83
|
+
i == null || i(), i = void 0;
|
|
84
|
+
}), (s, f) => {
|
|
85
|
+
var C;
|
|
86
|
+
return m(t).hidden ? T("", !0) : (d(), D(S, { key: 0 }, [
|
|
87
|
+
(C = u.value.define) != null && C.type ? (d(), _(W, {
|
|
91
88
|
key: 0,
|
|
92
|
-
wrappers:
|
|
89
|
+
wrappers: m(b)
|
|
93
90
|
}, {
|
|
94
|
-
default:
|
|
95
|
-
|
|
96
|
-
|
|
91
|
+
default: j(() => [
|
|
92
|
+
m(R) ? (d(), _(w(p.value), V({ key: 0 }, c.value, k(m(a))), null, 16)) : (d(), D(S, { key: 1 }, [
|
|
93
|
+
u.value.form.control ? (d(), _(w(p.value), V({ key: 0 }, c.value, k(m(a)), {
|
|
97
94
|
ref_key: "childRef",
|
|
98
|
-
ref:
|
|
99
|
-
}), null, 16)) : (
|
|
95
|
+
ref: y
|
|
96
|
+
}), null, 16)) : (d(), _(w(p.value), V({ key: 1 }, c.value, k(m(a))), null, 16))
|
|
100
97
|
], 64))
|
|
101
98
|
]),
|
|
102
99
|
_: 1
|
|
103
|
-
}, 8, ["wrappers"])) :
|
|
100
|
+
}, 8, ["wrappers"])) : T("", !0)
|
|
104
101
|
], 64));
|
|
105
102
|
};
|
|
106
103
|
}
|
|
107
104
|
});
|
|
108
|
-
function
|
|
109
|
-
let
|
|
105
|
+
function pe(o, e, n, r) {
|
|
106
|
+
let a = !0;
|
|
110
107
|
return H(
|
|
111
108
|
() => {
|
|
112
109
|
const t = e.value$$();
|
|
113
|
-
|
|
110
|
+
a ? (ue(t, o) || r(t), a = !1) : r(t);
|
|
114
111
|
},
|
|
115
112
|
{ injector: n }
|
|
116
113
|
);
|
|
117
114
|
}
|
|
118
|
-
const
|
|
115
|
+
const he = /* @__PURE__ */ I({
|
|
119
116
|
__name: "piying-view",
|
|
120
117
|
props: {
|
|
121
118
|
schema: {},
|
|
@@ -124,61 +121,61 @@ const Ce = /* @__PURE__ */ $({
|
|
|
124
121
|
},
|
|
125
122
|
emits: ["update:modelValue"],
|
|
126
123
|
setup(o, { emit: e }) {
|
|
127
|
-
const n = o, r = e,
|
|
124
|
+
const n = o, r = e, a = oe({
|
|
128
125
|
providers: [
|
|
129
126
|
{
|
|
130
|
-
provide:
|
|
131
|
-
useClass:
|
|
127
|
+
provide: le,
|
|
128
|
+
useClass: re
|
|
132
129
|
}
|
|
133
130
|
]
|
|
134
131
|
});
|
|
135
|
-
|
|
136
|
-
const t =
|
|
137
|
-
return
|
|
132
|
+
L(P, a);
|
|
133
|
+
const t = B(void 0);
|
|
134
|
+
return N(
|
|
138
135
|
() => [n.schema, n.options],
|
|
139
|
-
([
|
|
140
|
-
const
|
|
141
|
-
handle:
|
|
142
|
-
builder:
|
|
143
|
-
injector:
|
|
144
|
-
registerOnDestroy: (
|
|
145
|
-
|
|
146
|
-
|
|
136
|
+
([l, c], R, b) => {
|
|
137
|
+
const p = ae({ providers: [], parent: a }), u = ne(l, {
|
|
138
|
+
handle: ie,
|
|
139
|
+
builder: de,
|
|
140
|
+
injector: p,
|
|
141
|
+
registerOnDestroy: (h) => {
|
|
142
|
+
p.get(se).onDestroy(() => {
|
|
143
|
+
h();
|
|
147
144
|
});
|
|
148
145
|
},
|
|
149
|
-
...
|
|
146
|
+
...c
|
|
150
147
|
});
|
|
151
|
-
t.value =
|
|
152
|
-
let
|
|
153
|
-
if (
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
typeof
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
(
|
|
148
|
+
t.value = u;
|
|
149
|
+
let y;
|
|
150
|
+
if (u.form.control) {
|
|
151
|
+
const h = n.modelValue;
|
|
152
|
+
y = pe(
|
|
153
|
+
typeof h < "u" ? h : void 0,
|
|
154
|
+
u.form.control,
|
|
155
|
+
p,
|
|
156
|
+
(i) => {
|
|
160
157
|
ce(() => {
|
|
161
|
-
var
|
|
162
|
-
(
|
|
158
|
+
var s;
|
|
159
|
+
(s = u.form.control) != null && s.valueNoError$$() && r("update:modelValue", i);
|
|
163
160
|
});
|
|
164
161
|
}
|
|
165
162
|
);
|
|
166
163
|
}
|
|
167
|
-
|
|
168
|
-
|
|
164
|
+
b(() => {
|
|
165
|
+
p.destroy(), y == null || y.destroy();
|
|
169
166
|
});
|
|
170
167
|
},
|
|
171
168
|
{ immediate: !0 }
|
|
172
|
-
),
|
|
173
|
-
var
|
|
174
|
-
(
|
|
175
|
-
}), (
|
|
169
|
+
), O(() => {
|
|
170
|
+
var l;
|
|
171
|
+
(l = t.value.form.control) == null || l.updateValue(n.modelValue);
|
|
172
|
+
}), (l, c) => (d(), _(q, {
|
|
176
173
|
field: t.value
|
|
177
174
|
}, null, 8, ["field"]));
|
|
178
175
|
}
|
|
179
176
|
});
|
|
180
|
-
function
|
|
181
|
-
const o =
|
|
177
|
+
function ge() {
|
|
178
|
+
const o = $(), e = $(!1);
|
|
182
179
|
let n, r;
|
|
183
180
|
return {
|
|
184
181
|
cva: {
|
|
@@ -207,28 +204,25 @@ function Ve() {
|
|
|
207
204
|
}
|
|
208
205
|
};
|
|
209
206
|
}
|
|
210
|
-
const
|
|
207
|
+
const Ce = /* @__PURE__ */ I({
|
|
211
208
|
__name: "group",
|
|
212
|
-
props: {
|
|
213
|
-
fields: {}
|
|
214
|
-
},
|
|
215
209
|
setup(o) {
|
|
216
|
-
const e =
|
|
217
|
-
return (
|
|
218
|
-
key:
|
|
219
|
-
field:
|
|
210
|
+
const e = E(A), n = v(() => e == null ? void 0 : e.value.children());
|
|
211
|
+
return (r, a) => (d(!0), D(S, null, X(m(n), (t, l) => (d(), _(q, {
|
|
212
|
+
key: l,
|
|
213
|
+
field: t
|
|
220
214
|
}, null, 8, ["field"]))), 128));
|
|
221
215
|
}
|
|
222
216
|
});
|
|
223
217
|
export {
|
|
224
|
-
|
|
225
|
-
|
|
218
|
+
P as InjectorToken,
|
|
219
|
+
A as PI_VIEW_FIELD_TOKEN,
|
|
226
220
|
q as PiyingFieldTemplate,
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
221
|
+
he as PiyingView,
|
|
222
|
+
Ce as PiyingViewGroup,
|
|
223
|
+
de as VueFormBuilder,
|
|
224
|
+
ie as VueSchemaHandle,
|
|
225
|
+
pe as initListen,
|
|
226
|
+
v as signalToRef,
|
|
227
|
+
ge as useControlValueAccessor
|
|
234
228
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@piying/view-vue",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.2",
|
|
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",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
],
|
|
37
37
|
"license": "MIT",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@piying/view-core": "^1.
|
|
39
|
+
"@piying/view-core": "^1.3.2",
|
|
40
40
|
"fast-equals": "^5.2.2",
|
|
41
41
|
"rfdc": "^1.4.1",
|
|
42
42
|
"static-injector": "^6.1.2"
|
package/readme.md
CHANGED
|
@@ -1 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
<div><a href="https://www.npmjs.com/package/@piying/view-core"><img src="https://img.shields.io/npm/v/@piying/view-core" alt="NPM Version" /></a> <a href="https://coveralls.io/github/piying-org/piying-view?branch=main"><img src="https://coveralls.io/repos/github/piying-org/piying-view/badge.svg" alt="Coverage Status" ></a> <a href=""><img src="https://img.shields.io/badge/License-MIT-teal.svg" alt="MIT License" /></a></div>
|
|
2
|
+
|
|
3
|
+
## document
|
|
4
|
+
|
|
5
|
+
- https://piying-org.github.io/website/docs/client/intro
|
|
6
|
+
|
|
7
|
+
## start
|
|
8
|
+
|
|
9
|
+
- npm i
|
|
10
|
+
- npm run build:core
|
|
11
|
+
|
|
12
|
+
## test
|
|
13
|
+
|
|
14
|
+
- npx playwright install
|
|
15
|
+
- npm run test:all
|
|
16
|
+
|
|
17
|
+
### test Core/Angular
|
|
18
|
+
|
|
19
|
+
- npm run test
|
|
20
|
+
|
|
21
|
+
### test Vue
|
|
22
|
+
|
|
23
|
+
- npm run test:vue
|
|
24
|
+
|
|
25
|
+
### test React
|
|
26
|
+
|
|
27
|
+
- npm run test:react
|