@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 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 FieldToken: InjectionKey<ComputedRef<PiResolvedViewFieldConfig>>;
5
+ export declare const PI_VIEW_FIELD_TOKEN: InjectionKey<ComputedRef<PiResolvedViewFieldConfig>>;
package/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import PiyingView from './formly/piying-view.vue';
2
2
  export { PiyingView };
3
- export * from '@piying/view-core';
4
3
  export * from './formly/util';
5
4
  import PiyingFieldTemplate from './formly/field-template.vue';
6
5
  export { PiyingFieldTemplate };
package/index.js CHANGED
@@ -1,25 +1,24 @@
1
- var J = Object.defineProperty;
2
- var K = (n, e, o) => e in n ? J(n, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : n[e] = o;
3
- var P = (n, e, o) => K(n, typeof e != "symbol" ? e + "" : e, o);
4
- import { inject as B, shallowRef as G, watchEffect as O, defineComponent as j, computed as v, createBlock as y, renderSlot as T, openBlock as i, resolveDynamicComponent as V, mergeProps as I, unref as d, toHandlers as b, withCtx as S, createVNode as L, normalizeProps as M, guardReactiveProps as Q, defineAsyncComponent as X, provide as H, ref as x, watch as N, onUnmounted as Y, createElementBlock as D, createCommentVNode as A, Fragment as R, renderList as Z } from "vue";
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
- export * from "@piying/view-core";
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
- P(this, "contents");
11
+ F(this, "contents");
13
12
  }
14
13
  }
15
14
  class fe extends te {
16
15
  }
17
- const E = Symbol(), me = Symbol();
16
+ const R = Symbol(), me = Symbol();
18
17
  function m(n) {
19
- const e = B(E), o = G(void 0);
20
- return O((r) => {
18
+ const e = B(R), o = O(void 0);
19
+ return G((r) => {
21
20
  o.value = n();
22
- const l = q(
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 z = /* @__PURE__ */ j({
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(V(r.value.type), I({ key: 0 }, d(l), b(t.value)), {
48
- default: S(() => [
49
- L(z, M(Q({ wrappers: o.value })), {
50
- default: S(() => [
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
- }), U = /* @__PURE__ */ j({
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(E), 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() })), F = v(() => ({ ...r.value, fields: e.field.fieldArray() })), $ = m(() => e.field.wrappers()), g = m(() => {
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
- }), h = v(() => ({ ...a.value, ...r.value })), c = v(
70
+ }), _ = v(() => ({ ...a.value, ...r.value })), c = v(
72
71
  () => {
73
- var u, s, k;
74
- return typeof ((u = e.field.define) == null ? void 0 : u.type) == "function" ? X((s = e.field.define) == null ? void 0 : s.type) : (k = e.field.define) == null ? void 0 : k.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
- ), _ = v(() => e.field);
77
- H(me, _);
78
- const C = x(null), W = oe(_.value.form.control);
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 N(
79
+ return H(
81
80
  C,
82
81
  (u) => {
83
- f == null || f.forEach((s) => s()), W && u && (f = ne(
84
- () => _.value.form.control,
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 k;
94
- return d(t).hidden ? A("", !0) : (i(), D(R, { key: 0 }, [
95
- (k = _.value.define) != null && k.type ? (i(), y(z, {
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: S(() => [
100
- d(g) ? (i(), y(V(c.value), I({ key: 0 }, p.value, b(d(l))), null, 16)) : d(w) ? (i(), y(V(c.value), I({ key: 1 }, F.value, b(d(l))), null, 16)) : (i(), D(R, { key: 2 }, [
101
- _.value.form.control ? (i(), y(V(c.value), I({ key: 0 }, h.value, b(d(l)), {
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(V(c.value), I({ key: 1 }, h.value, b(d(l))), null, 16))
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 q(
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
- H(E, l);
141
- const t = G(void 0);
142
- return N(
139
+ N(R, l);
140
+ const t = O(void 0);
141
+ return H(
143
142
  () => [o.schema, o.options],
144
- ([a, p], F, $) => {
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 h;
156
+ let _;
158
157
  if (w.form.control) {
159
158
  const c = o.modelValue;
160
- h = ve(
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(), h == null || h.destroy();
171
+ E(() => {
172
+ g.destroy(), _ == null || _.destroy();
174
173
  });
175
174
  },
176
175
  { immediate: !0 }
177
- ), O(() => {
176
+ ), G(() => {
178
177
  var a;
179
178
  (a = t.value.form.control) == null || a.updateValue(o.modelValue);
180
- }), (a, p) => (i(), y(U, {
179
+ }), (a, p) => (i(), y(z, {
181
180
  field: t.value
182
181
  }, null, 8, ["field"]));
183
182
  }
184
183
  });
185
- function ke() {
186
- const n = x(), e = x(!1);
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 Ve = /* @__PURE__ */ j({
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), D(R, null, Z(e.fields, (l, t) => (i(), y(U, {
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
- U as PiyingFieldTemplate,
226
+ z as PiyingFieldTemplate,
228
227
  Ce as PiyingView,
229
- Ve as PiyingViewGroup,
228
+ ke as PiyingViewGroup,
230
229
  ve as initListen,
231
230
  m as signalToRef,
232
- ke as useControlValueAccessor
231
+ Ve as useControlValueAccessor
233
232
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@piying/view-vue",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@piying/view-core": "^0.6.22",