@piying/view-vue 1.1.2 → 1.1.3

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.
@@ -1 +1 @@
1
- export declare function watchChange<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>;
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,22 +1,22 @@
1
1
  var J = Object.defineProperty;
2
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 R = (n, e, o) => K(n, typeof e != "symbol" ? e + "" : e, o);
4
- import { inject as T, shallowRef as G, watchEffect as O, defineComponent as j, computed as v, createBlock as y, renderSlot as A, openBlock as c, 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 B, Fragment as E, renderList as Z } from "vue";
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";
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 q, createRootInjector as le, ChangeDetectionSchedulerImpl as ae, ChangeDetectionScheduler as ue, createInjector as se, DestroyRef as ce, untracked as ie } from "static-injector";
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";
8
8
  import { deepEqual as de } from "fast-equals";
9
9
  class pe extends ee {
10
10
  constructor() {
11
11
  super(...arguments);
12
- R(this, "contents");
12
+ P(this, "contents");
13
13
  }
14
14
  }
15
15
  class fe extends te {
16
16
  }
17
- const F = Symbol(), me = Symbol();
17
+ const E = Symbol(), me = Symbol();
18
18
  function m(n) {
19
- const e = T(F), o = G(void 0);
19
+ const e = B(E), o = G(void 0);
20
20
  return O((r) => {
21
21
  o.value = n();
22
22
  const l = q(
@@ -44,17 +44,17 @@ 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 ? (c(), y(V(r.value.type), I({ key: 0 }, d(l), b(t.value)), {
47
+ return (a, p) => r.value ? (i(), y(V(r.value.type), I({ key: 0 }, d(l), b(t.value)), {
48
48
  default: S(() => [
49
49
  L(z, M(Q({ wrappers: o.value })), {
50
50
  default: S(() => [
51
- A(a.$slots, "default")
51
+ T(a.$slots, "default")
52
52
  ]),
53
53
  _: 3
54
54
  }, 16)
55
55
  ]),
56
56
  _: 3
57
- }, 16)) : A(a.$slots, "default", { key: 1 });
57
+ }, 16)) : T(a.$slots, "default", { key: 1 });
58
58
  }
59
59
  }), U = /* @__PURE__ */ j({
60
60
  __name: "field-template",
@@ -62,13 +62,13 @@ const z = /* @__PURE__ */ j({
62
62
  field: {}
63
63
  },
64
64
  setup(n) {
65
- const e = n, o = T(F), 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() })), P = v(() => ({ ...r.value, fields: e.field.fieldArray() })), $ = m(() => e.field.wrappers()), g = m(() => {
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(() => {
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
- }), h = v(() => ({ ...a.value, ...r.value })), i = v(
71
+ }), h = v(() => ({ ...a.value, ...r.value })), c = v(
72
72
  () => {
73
73
  var u, s, k;
74
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;
@@ -91,21 +91,21 @@ const z = /* @__PURE__ */ j({
91
91
  f == null || f.forEach((u) => u()), f = [];
92
92
  }), (u, s) => {
93
93
  var k;
94
- return d(t).hidden ? B("", !0) : (c(), D(E, { key: 0 }, [
95
- (k = _.value.define) != null && k.type ? (c(), y(z, {
94
+ return d(t).hidden ? A("", !0) : (i(), D(R, { key: 0 }, [
95
+ (k = _.value.define) != null && k.type ? (i(), y(z, {
96
96
  key: 0,
97
97
  wrappers: d($)
98
98
  }, {
99
99
  default: S(() => [
100
- d(g) ? (c(), y(V(i.value), I({ key: 0 }, p.value, b(d(l))), null, 16)) : d(w) ? (c(), y(V(i.value), I({ key: 1 }, P.value, b(d(l))), null, 16)) : (c(), D(E, { key: 2 }, [
101
- _.value.form.control ? (c(), y(V(i.value), I({ key: 0 }, h.value, b(d(l)), {
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)), {
102
102
  ref_key: "childRef",
103
103
  ref: C
104
- }), null, 16)) : (c(), y(V(i.value), I({ key: 1 }, h.value, b(d(l))), null, 16))
104
+ }), null, 16)) : (i(), y(V(c.value), I({ key: 1 }, h.value, b(d(l))), null, 16))
105
105
  ], 64))
106
106
  ]),
107
107
  _: 1
108
- }, 8, ["wrappers"])) : B("", !0)
108
+ }, 8, ["wrappers"])) : A("", !0)
109
109
  ], 64));
110
110
  };
111
111
  }
@@ -137,18 +137,18 @@ const Ce = /* @__PURE__ */ j({
137
137
  }
138
138
  ]
139
139
  });
140
- H(F, l);
140
+ H(E, l);
141
141
  const t = G(void 0);
142
142
  return N(
143
143
  () => [o.schema, o.options],
144
- ([a, p], P, $) => {
144
+ ([a, p], F, $) => {
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: (i) => {
150
- g.get(ce).onDestroy(() => {
151
- i();
149
+ registerOnDestroy: (c) => {
150
+ g.get(ie).onDestroy(() => {
151
+ c();
152
152
  });
153
153
  },
154
154
  ...p
@@ -156,13 +156,13 @@ const Ce = /* @__PURE__ */ j({
156
156
  t.value = w;
157
157
  let h;
158
158
  if (w.form.control) {
159
- const i = o.modelValue;
159
+ const c = o.modelValue;
160
160
  h = ve(
161
- typeof i < "u" ? i : void 0,
161
+ typeof c < "u" ? c : void 0,
162
162
  w.form.control,
163
163
  g,
164
164
  (_) => {
165
- ie(() => {
165
+ ce(() => {
166
166
  var C;
167
167
  (C = w.form.control) != null && C.valueNoError$$() && r("update:modelValue", _);
168
168
  });
@@ -177,7 +177,7 @@ const Ce = /* @__PURE__ */ j({
177
177
  ), O(() => {
178
178
  var a;
179
179
  (a = t.value.form.control) == null || a.updateValue(o.modelValue);
180
- }), (a, p) => (c(), y(U, {
180
+ }), (a, p) => (i(), y(U, {
181
181
  field: t.value
182
182
  }, null, 8, ["field"]));
183
183
  }
@@ -217,7 +217,7 @@ const Ve = /* @__PURE__ */ j({
217
217
  },
218
218
  setup(n) {
219
219
  const e = n;
220
- return (o, r) => (c(!0), D(E, null, Z(e.fields, (l, t) => (c(), y(U, {
220
+ return (o, r) => (i(!0), D(R, null, Z(e.fields, (l, t) => (i(), y(U, {
221
221
  key: t,
222
222
  field: l
223
223
  }, null, 8, ["field"]))), 128));
@@ -228,6 +228,6 @@ export {
228
228
  Ce as PiyingView,
229
229
  Ve as PiyingViewGroup,
230
230
  ve as initListen,
231
- ke as useControlValueAccessor,
232
- m as watchChange
231
+ m as signalToRef,
232
+ ke as useControlValueAccessor
233
233
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@piying/view-vue",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@piying/view-core": "^0.6.22",