@piying/view-vue 1.1.13 → 1.1.15

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 +73 -73
  2. package/package.json +25 -25
package/index.js CHANGED
@@ -1,9 +1,9 @@
1
- var L = Object.defineProperty;
2
- var U = (o, e, n) => e in o ? L(o, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : o[e] = n;
1
+ var K = Object.defineProperty;
2
+ var U = (o, e, n) => e in o ? K(o, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : o[e] = n;
3
3
  var F = (o, e, n) => U(o, typeof e != "symbol" ? e + "" : e, n);
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 D, createVNode as J, normalizeProps as M, guardReactiveProps as Q, defineAsyncComponent as X, provide as N, ref as S, watch as H, onUnmounted as Y, createElementBlock as E, createCommentVNode as A, Fragment as P, renderList as Z } from "vue";
4
+ import { inject as O, shallowRef as A, watchEffect as L, defineComponent as $, computed as v, createBlock as y, renderSlot as T, openBlock as c, resolveDynamicComponent as k, mergeProps as I, unref as p, toHandlers as b, withCtx as S, createVNode as J, normalizeProps as M, guardReactiveProps as Q, defineAsyncComponent as X, provide as N, ref as E, watch as G, onUnmounted as Y, createElementBlock as P, createCommentVNode as B, 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
- 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";
6
+ import { effect as H, 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() {
@@ -13,12 +13,12 @@ class pe extends ee {
13
13
  }
14
14
  class fe extends te {
15
15
  }
16
- const R = Symbol(), me = Symbol();
16
+ const x = Symbol(), me = Symbol();
17
17
  function m(o) {
18
- const e = B(R), n = O(void 0);
19
- return G((r) => {
18
+ const e = O(x), n = A(void 0);
19
+ return L((r) => {
20
20
  n.value = o();
21
- const l = W(
21
+ const l = H(
22
22
  () => {
23
23
  const t = o();
24
24
  Object.is(n.value, t) || (n.value = t);
@@ -30,23 +30,23 @@ function m(o) {
30
30
  });
31
31
  }), n;
32
32
  }
33
- const q = /* @__PURE__ */ j({
33
+ const W = /* @__PURE__ */ $({
34
34
  __name: "wrapper",
35
35
  props: {
36
36
  wrappers: {}
37
37
  },
38
38
  setup(o) {
39
39
  const e = o, n = v(() => e.wrappers.slice(1)), r = v(() => e.wrappers[0]), l = m(() => {
40
- var a, p;
41
- return { ...(a = r.value) == null ? void 0 : a.inputs(), ...(p = r.value) == null ? void 0 : p.attributes() };
40
+ var a, u;
41
+ return { ...(a = r.value) == null ? void 0 : a.inputs(), ...(u = r.value) == null ? void 0 : u.attributes() };
42
42
  }), t = v(() => {
43
43
  var a;
44
44
  return ((a = r.value) == null ? void 0 : a.outputs) ?? {};
45
45
  });
46
- return (a, p) => r.value ? (i(), y(k(r.value.type), I({ key: 0 }, d(l), b(t.value)), {
47
- default: D(() => [
48
- J(q, M(Q({ wrappers: n.value })), {
49
- default: D(() => [
46
+ return (a, u) => r.value ? (c(), y(k(r.value.type), I({ key: 0 }, p(l), b(t.value)), {
47
+ default: S(() => [
48
+ J(W, M(Q({ wrappers: n.value })), {
49
+ default: S(() => [
50
50
  T(a.$slots, "default")
51
51
  ]),
52
52
  _: 3
@@ -55,32 +55,32 @@ const q = /* @__PURE__ */ j({
55
55
  _: 3
56
56
  }, 16)) : T(a.$slots, "default", { key: 1 });
57
57
  }
58
- }), z = /* @__PURE__ */ j({
58
+ }), q = /* @__PURE__ */ $({
59
59
  __name: "field-template",
60
60
  props: {
61
61
  field: {}
62
62
  },
63
63
  setup(o) {
64
- const e = o, n = 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() })), $ = m(() => e.field.wrappers()), g = m(() => {
65
- var s, u;
66
- return (u = (s = e.field).fieldGroup) == null ? void 0 : u.call(s);
67
- }), w = m(() => {
68
- var s, u;
69
- return (u = (s = e.field).fieldArray) == null ? void 0 : u.call(s);
70
- }), _ = v(() => ({ ...a.value, ...r.value })), c = v(
64
+ const e = o, n = O(x), r = m(() => e.field.inputs()), l = m(() => e.field.outputs()), t = m(() => e.field.renderConfig()), a = m(() => e.field.attributes()), u = v(() => ({ ...a.value, ...r.value })), D = m(() => {
65
+ var s, i;
66
+ return (i = (s = e.field).fieldGroup) == null ? void 0 : i.call(s);
67
+ }), j = m(() => {
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(
71
71
  () => {
72
- var s, u, V;
73
- return typeof ((s = e.field.define) == null ? void 0 : s.type) == "function" ? X((u = e.field.define) == null ? void 0 : u.type) : (V = e.field.define) == null ? void 0 : V.type;
72
+ var s, i, V;
73
+ return typeof ((s = e.field.define) == null ? void 0 : s.type) == "function" ? X((i = e.field.define) == null ? void 0 : i.type) : (V = e.field.define) == null ? void 0 : V.type;
74
74
  }
75
- ), h = v(() => e.field);
76
- N(me, h);
77
- const C = S(null), K = oe(h.value.form.control);
75
+ ), _ = v(() => e.field);
76
+ N(me, _);
77
+ const C = E(null), z = oe(_.value.form.control);
78
78
  let f;
79
- return H(
80
- [C, h],
81
- ([s, u]) => {
82
- f == null || f(), K && s && (f = ne(
83
- () => u.form.control,
79
+ return G(
80
+ [C, _],
81
+ ([s, i]) => {
82
+ f == null || f(), z && s && (f = ne(
83
+ () => i.form.control,
84
84
  s.cva,
85
85
  n
86
86
  ));
@@ -88,30 +88,30 @@ const q = /* @__PURE__ */ j({
88
88
  { immediate: !0 }
89
89
  ), Y(() => {
90
90
  f == null || f(), f = void 0;
91
- }), (s, u) => {
91
+ }), (s, i) => {
92
92
  var V;
93
- return d(t).hidden ? A("", !0) : (i(), E(P, { key: 0 }, [
94
- (V = h.value.define) != null && V.type ? (i(), y(q, {
93
+ return p(t).hidden ? B("", !0) : (c(), P(R, { key: 0 }, [
94
+ (V = _.value.define) != null && V.type ? (c(), y(W, {
95
95
  key: 0,
96
- wrappers: d($)
96
+ wrappers: p(w)
97
97
  }, {
98
- default: D(() => [
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(), E(P, { key: 2 }, [
100
- h.value.form.control ? (i(), y(k(c.value), I({ key: 0 }, _.value, b(d(l)), {
98
+ default: S(() => [
99
+ p(D) ? (c(), y(k(d.value), I({ key: 0 }, h.value, b(p(l))), null, 16)) : p(j) ? (c(), y(k(d.value), I({ key: 1 }, g.value, b(p(l))), null, 16)) : (c(), P(R, { key: 2 }, [
100
+ _.value.form.control ? (c(), y(k(d.value), I({ key: 0 }, u.value, b(p(l)), {
101
101
  ref_key: "childRef",
102
102
  ref: C
103
- }), null, 16)) : (i(), y(k(c.value), I({ key: 1 }, _.value, b(d(l))), null, 16))
103
+ }), null, 16)) : (c(), y(k(d.value), I({ key: 1 }, u.value, b(p(l))), null, 16))
104
104
  ], 64))
105
105
  ]),
106
106
  _: 1
107
- }, 8, ["wrappers"])) : A("", !0)
107
+ }, 8, ["wrappers"])) : B("", !0)
108
108
  ], 64));
109
109
  };
110
110
  }
111
111
  });
112
112
  function ve(o, e, n, r) {
113
113
  let l = !0;
114
- return W(
114
+ return H(
115
115
  () => {
116
116
  const t = e.value$$();
117
117
  l ? (de(t, o) || r(t), l = !1) : r(t);
@@ -119,7 +119,7 @@ function ve(o, e, n, r) {
119
119
  { injector: n }
120
120
  );
121
121
  }
122
- const Ce = /* @__PURE__ */ j({
122
+ const Ce = /* @__PURE__ */ $({
123
123
  __name: "piying-view",
124
124
  props: {
125
125
  schema: {},
@@ -136,53 +136,53 @@ const Ce = /* @__PURE__ */ j({
136
136
  }
137
137
  ]
138
138
  });
139
- N(R, l);
140
- const t = O(void 0);
141
- return H(
139
+ N(x, l);
140
+ const t = A(void 0);
141
+ return G(
142
142
  () => [n.schema, n.options],
143
- ([a, p], x, $) => {
144
- const g = ue({ providers: [], parent: l }), w = re(a, {
143
+ ([a, u], D, j) => {
144
+ const h = ue({ providers: [], parent: l }), g = re(a, {
145
145
  handle: pe,
146
146
  builder: fe,
147
- injector: g,
148
- registerOnDestroy: (c) => {
149
- g.get(ie).onDestroy(() => {
150
- c();
147
+ injector: h,
148
+ registerOnDestroy: (d) => {
149
+ h.get(ie).onDestroy(() => {
150
+ d();
151
151
  });
152
152
  },
153
- ...p
153
+ ...u
154
154
  });
155
- t.value = w;
156
- let _;
157
- if (w.form.control) {
158
- const c = n.modelValue;
159
- _ = ve(
160
- typeof c < "u" ? c : void 0,
161
- w.form.control,
162
- g,
163
- (h) => {
155
+ t.value = g;
156
+ let w;
157
+ if (g.form.control) {
158
+ const d = n.modelValue;
159
+ w = ve(
160
+ typeof d < "u" ? d : void 0,
161
+ g.form.control,
162
+ h,
163
+ (_) => {
164
164
  ce(() => {
165
165
  var C;
166
- (C = w.form.control) != null && C.valueNoError$$() && r("update:modelValue", h);
166
+ (C = g.form.control) != null && C.valueNoError$$() && r("update:modelValue", _);
167
167
  });
168
168
  }
169
169
  );
170
170
  }
171
- $(() => {
172
- g.destroy(), _ == null || _.destroy();
171
+ j(() => {
172
+ h.destroy(), w == null || w.destroy();
173
173
  });
174
174
  },
175
175
  { immediate: !0 }
176
- ), G(() => {
176
+ ), L(() => {
177
177
  var a;
178
178
  (a = t.value.form.control) == null || a.updateValue(n.modelValue);
179
- }), (a, p) => (i(), y(z, {
179
+ }), (a, u) => (c(), y(q, {
180
180
  field: t.value
181
181
  }, null, 8, ["field"]));
182
182
  }
183
183
  });
184
184
  function Ve() {
185
- const o = S(), e = S(!1);
185
+ const o = E(), e = E(!1);
186
186
  let n, r;
187
187
  return {
188
188
  cva: {
@@ -209,23 +209,23 @@ function Ve() {
209
209
  }
210
210
  };
211
211
  }
212
- const ke = /* @__PURE__ */ j({
212
+ const ke = /* @__PURE__ */ $({
213
213
  __name: "group",
214
214
  props: {
215
215
  fields: {}
216
216
  },
217
217
  setup(o) {
218
218
  const e = o;
219
- return (n, r) => (i(!0), E(P, null, Z(e.fields, (l, t) => (i(), y(z, {
219
+ return (n, r) => (c(!0), P(R, null, Z(e.fields, (l, t) => (c(), y(q, {
220
220
  key: t,
221
221
  field: l
222
222
  }, null, 8, ["field"]))), 128));
223
223
  }
224
224
  });
225
225
  export {
226
- R as InjectorToken,
226
+ x as InjectorToken,
227
227
  me as PI_VIEW_FIELD_TOKEN,
228
- z as PiyingFieldTemplate,
228
+ q as PiyingFieldTemplate,
229
229
  Ce as PiyingView,
230
230
  ke as PiyingViewGroup,
231
231
  fe as VueFormBuilder,
package/package.json CHANGED
@@ -1,26 +1,26 @@
1
- {
2
- "name": "@piying/view-vue",
3
- "version": "1.1.13",
4
- "type": "module",
5
- "dependencies": {
6
- "@piying/view-core": "^0.6.27",
7
- "fast-equals": "^5.2.2",
8
- "rfdc": "^1.4.1",
9
- "static-injector": "^6.1.2"
10
- },
11
- "sideEffects": false,
12
- "peerDependencies": {
13
- "vue": "^3.4.21"
14
- },
15
- "module": "index.js",
16
- "typings": "index.d.ts",
17
- "exports": {
18
- "./package.json": {
19
- "default": "./package.json"
20
- },
21
- ".": {
22
- "types": "./index.d.ts",
23
- "default": "./index.js"
24
- }
25
- }
1
+ {
2
+ "name": "@piying/view-vue",
3
+ "version": "1.1.15",
4
+ "type": "module",
5
+ "dependencies": {
6
+ "@piying/view-core": "^0.6.27",
7
+ "fast-equals": "^5.2.2",
8
+ "rfdc": "^1.4.1",
9
+ "static-injector": "^6.1.2"
10
+ },
11
+ "sideEffects": false,
12
+ "peerDependencies": {
13
+ "vue": "^3.4.21"
14
+ },
15
+ "module": "index.js",
16
+ "typings": "index.d.ts",
17
+ "exports": {
18
+ "./package.json": {
19
+ "default": "./package.json"
20
+ },
21
+ ".": {
22
+ "types": "./index.d.ts",
23
+ "default": "./index.js"
24
+ }
25
+ }
26
26
  }