@piying/view-vue 1.1.9 → 1.1.11

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.
Files changed (2) hide show
  1. package/index.js +32 -32
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -3,7 +3,7 @@ var U = (n, e, o) => e in n ? L(n, e, { enumerable: !0, configurable: !0, writab
3
3
  var F = (n, e, o) => U(n, typeof e != "symbol" ? e + "" : e, o);
4
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
- 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";
6
+ import { effect as W, createRootInjector as le, ChangeDetectionSchedulerImpl as ae, ChangeDetectionScheduler as se, createInjector as ue, DestroyRef as ie, untracked as ce } from "static-injector";
7
7
  import { deepEqual as de } from "fast-equals";
8
8
  class pe extends ee {
9
9
  constructor() {
@@ -61,45 +61,45 @@ const q = /* @__PURE__ */ j({
61
61
  field: {}
62
62
  },
63
63
  setup(n) {
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(() => {
65
- var u, s;
66
- return (s = (u = e.field).fieldGroup) == null ? void 0 : s.call(u);
67
- }), w = m(() => {
68
- var u, s;
69
- return (s = (u = e.field).fieldArray) == null ? void 0 : s.call(u);
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()), w = m(() => {
65
+ var s, u;
66
+ return (u = (s = e.field).fieldGroup) == null ? void 0 : u.call(s);
67
+ }), C = m(() => {
68
+ var s, u;
69
+ return (u = (s = e.field).fieldArray) == null ? void 0 : u.call(s);
70
70
  }), _ = v(() => ({ ...a.value, ...r.value })), c = v(
71
71
  () => {
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;
72
+ var s, u, g;
73
+ return typeof ((s = e.field.define) == null ? void 0 : s.type) == "function" ? X((u = e.field.define) == null ? void 0 : u.type) : (g = e.field.define) == null ? void 0 : g.type;
74
74
  }
75
75
  ), h = v(() => e.field);
76
76
  N(me, h);
77
- const C = D(null), K = oe(h.value.form.control);
77
+ const V = D(null), K = oe(h.value.form.control);
78
78
  let f;
79
79
  return H(
80
- C,
81
- (u) => {
82
- f == null || f.forEach((s) => s()), K && u && (f = ne(
83
- () => h.value.form.control,
84
- u.cva,
80
+ [V, h],
81
+ ([s, u]) => {
82
+ f == null || f.forEach((g) => g()), K && s && (f = ne(
83
+ () => u.form.control,
84
+ s.cva,
85
85
  o
86
86
  ));
87
87
  },
88
88
  { immediate: !0 }
89
89
  ), Y(() => {
90
- f == null || f.forEach((u) => u()), f = [];
91
- }), (u, s) => {
92
- var V;
90
+ f == null || f.forEach((s) => s()), f = [];
91
+ }), (s, u) => {
92
+ var g;
93
93
  return d(t).hidden ? A("", !0) : (i(), S(P, { key: 0 }, [
94
- (V = h.value.define) != null && V.type ? (i(), y(q, {
94
+ (g = h.value.define) != null && g.type ? (i(), y(q, {
95
95
  key: 0,
96
96
  wrappers: d(E)
97
97
  }, {
98
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 }, [
99
+ d(w) ? (i(), y(k(c.value), I({ key: 0 }, p.value, b(d(l))), null, 16)) : d(C) ? (i(), y(k(c.value), I({ key: 1 }, x.value, b(d(l))), null, 16)) : (i(), S(P, { key: 2 }, [
100
100
  h.value.form.control ? (i(), y(k(c.value), I({ key: 0 }, _.value, b(d(l)), {
101
101
  ref_key: "childRef",
102
- ref: C
102
+ ref: V
103
103
  }), null, 16)) : (i(), y(k(c.value), I({ key: 1 }, _.value, b(d(l))), null, 16))
104
104
  ], 64))
105
105
  ]),
@@ -131,7 +131,7 @@ const Ce = /* @__PURE__ */ j({
131
131
  const o = n, r = e, l = le({
132
132
  providers: [
133
133
  {
134
- provide: ue,
134
+ provide: se,
135
135
  useClass: ae
136
136
  }
137
137
  ]
@@ -141,35 +141,35 @@ const Ce = /* @__PURE__ */ j({
141
141
  return H(
142
142
  () => [o.schema, o.options],
143
143
  ([a, p], x, E) => {
144
- const g = se({ providers: [], parent: l }), w = re(a, {
144
+ const w = ue({ providers: [], parent: l }), C = re(a, {
145
145
  handle: pe,
146
146
  builder: fe,
147
- injector: g,
147
+ injector: w,
148
148
  registerOnDestroy: (c) => {
149
- g.get(ie).onDestroy(() => {
149
+ w.get(ie).onDestroy(() => {
150
150
  c();
151
151
  });
152
152
  },
153
153
  ...p
154
154
  });
155
- t.value = w;
155
+ t.value = C;
156
156
  let _;
157
- if (w.form.control) {
157
+ if (C.form.control) {
158
158
  const c = o.modelValue;
159
159
  _ = ve(
160
160
  typeof c < "u" ? c : void 0,
161
- w.form.control,
162
- g,
161
+ C.form.control,
162
+ w,
163
163
  (h) => {
164
164
  ce(() => {
165
- var C;
166
- (C = w.form.control) != null && C.valueNoError$$() && r("update:modelValue", h);
165
+ var V;
166
+ (V = C.form.control) != null && V.valueNoError$$() && r("update:modelValue", h);
167
167
  });
168
168
  }
169
169
  );
170
170
  }
171
171
  E(() => {
172
- g.destroy(), _ == null || _.destroy();
172
+ w.destroy(), _ == null || _.destroy();
173
173
  });
174
174
  },
175
175
  { immediate: !0 }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@piying/view-vue",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
4
4
  "type": "module",
5
5
  "dependencies": {
6
- "@piying/view-core": "^0.6.24",
6
+ "@piying/view-core": "^0.6.25",
7
7
  "fast-equals": "^5.2.2",
8
8
  "rfdc": "^1.4.1",
9
9
  "static-injector": "^6.1.2"