@razaman2/reactive-view 0.0.10 → 0.0.12

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/dist/index.js CHANGED
@@ -162,7 +162,7 @@ var import_vue = require("vue");
162
162
 
163
163
  // package.json
164
164
  var name = "@razaman2/reactive-view";
165
- var version = "0.0.10";
165
+ var version = "0.0.12";
166
166
 
167
167
  // src/ReactiveView.ts
168
168
  var props = {
@@ -218,7 +218,6 @@ var ReactiveView_default = {
218
218
  return (_c2 = (_b2 = (_a2 = context.slots).template) == null ? void 0 : _b2.call(_a2, { $vue: vue, vnode })) != null ? _c2 : vnode;
219
219
  };
220
220
  const isValid = (0, import_vue.ref)(false);
221
- const isRendered = (0, import_vue.ref)(false);
222
221
  const defaultData = props2.getDefaultData(
223
222
  Array.isArray(props2.state) ? (_a = props2.defaultData) != null ? _a : [] : (_b = props2.defaultData) != null ? _b : {}
224
223
  );
@@ -234,6 +233,7 @@ var ReactiveView_default = {
234
233
  };
235
234
  const getState = props2.model ? typeof props2.model === "function" ? props2.model(config) : props2.model : new import_data_manager.default(config);
236
235
  const sync = (0, import_vue.ref)(false);
236
+ const rendered = (0, import_vue.ref)(false);
237
237
  const options = {
238
238
  parent: { self: (0, import_vue.getCurrentInstance)().proxy },
239
239
  self: { template, isValid, getState }
@@ -247,8 +247,10 @@ var ReactiveView_default = {
247
247
  if (props2.defer instanceof Promise) {
248
248
  (0, import_vue.nextTick)(async () => {
249
249
  var _a2;
250
- isRendered.value = (_a2 = await props2.defer) != null ? _a2 : true;
250
+ rendered.value = (_a2 = await props2.defer) != null ? _a2 : true;
251
251
  });
252
+ } else {
253
+ rendered.value = true;
252
254
  }
253
255
  if (context.attrs["onUpdate:modelState"]) {
254
256
  const config2 = typeof context.attrs["onUpdate:modelState"] === "function" ? { callback: context.attrs["onUpdate:modelState"] } : context.attrs["onUpdate:modelState"];
@@ -268,7 +270,7 @@ var ReactiveView_default = {
268
270
  if (context.attrs["onUpdate:propsState"] || props2.sync) {
269
271
  const config2 = (_f = typeof context.attrs["onUpdate:propsState"] === "function" ? { callback: context.attrs["onUpdate:propsState"] } : context.attrs["onUpdate:propsState"]) != null ? _f : {};
270
272
  (0, import_vue.onMounted)(() => {
271
- (0, import_vue.watch)(() => props2.state, (after, before) => {
273
+ (0, import_vue.watch)(() => import_object_manager.default.on(props2.state).clone(), (after, before) => {
272
274
  if (props2.sync && typeof config2.callback !== "function") {
273
275
  getState.replaceData(after);
274
276
  } else if (typeof config2.callback === "function") {
@@ -290,7 +292,7 @@ var ReactiveView_default = {
290
292
  setup2.options = setup2.options.parent;
291
293
  setup2.$vue = setup2.$vue.$parent;
292
294
  }
293
- if (isRendered.value) {
295
+ if (rendered.value) {
294
296
  return access($vue).template($vue, { parent, self });
295
297
  }
296
298
  };
package/dist/index.mjs CHANGED
@@ -125,7 +125,7 @@ import { h, ref, reactive, watch, nextTick, getCurrentInstance, onMounted } from
125
125
 
126
126
  // package.json
127
127
  var name = "@razaman2/reactive-view";
128
- var version = "0.0.10";
128
+ var version = "0.0.12";
129
129
 
130
130
  // src/ReactiveView.ts
131
131
  var props = {
@@ -181,7 +181,6 @@ var ReactiveView_default = {
181
181
  return (_c2 = (_b2 = (_a2 = context.slots).template) == null ? void 0 : _b2.call(_a2, { $vue: vue, vnode })) != null ? _c2 : vnode;
182
182
  };
183
183
  const isValid = ref(false);
184
- const isRendered = ref(false);
185
184
  const defaultData = props2.getDefaultData(
186
185
  Array.isArray(props2.state) ? (_a = props2.defaultData) != null ? _a : [] : (_b = props2.defaultData) != null ? _b : {}
187
186
  );
@@ -197,6 +196,7 @@ var ReactiveView_default = {
197
196
  };
198
197
  const getState = props2.model ? typeof props2.model === "function" ? props2.model(config) : props2.model : new DataManager(config);
199
198
  const sync = ref(false);
199
+ const rendered = ref(false);
200
200
  const options = {
201
201
  parent: { self: getCurrentInstance().proxy },
202
202
  self: { template, isValid, getState }
@@ -210,8 +210,10 @@ var ReactiveView_default = {
210
210
  if (props2.defer instanceof Promise) {
211
211
  nextTick(async () => {
212
212
  var _a2;
213
- isRendered.value = (_a2 = await props2.defer) != null ? _a2 : true;
213
+ rendered.value = (_a2 = await props2.defer) != null ? _a2 : true;
214
214
  });
215
+ } else {
216
+ rendered.value = true;
215
217
  }
216
218
  if (context.attrs["onUpdate:modelState"]) {
217
219
  const config2 = typeof context.attrs["onUpdate:modelState"] === "function" ? { callback: context.attrs["onUpdate:modelState"] } : context.attrs["onUpdate:modelState"];
@@ -231,7 +233,7 @@ var ReactiveView_default = {
231
233
  if (context.attrs["onUpdate:propsState"] || props2.sync) {
232
234
  const config2 = (_f = typeof context.attrs["onUpdate:propsState"] === "function" ? { callback: context.attrs["onUpdate:propsState"] } : context.attrs["onUpdate:propsState"]) != null ? _f : {};
233
235
  onMounted(() => {
234
- watch(() => props2.state, (after, before) => {
236
+ watch(() => ObjectManager.on(props2.state).clone(), (after, before) => {
235
237
  if (props2.sync && typeof config2.callback !== "function") {
236
238
  getState.replaceData(after);
237
239
  } else if (typeof config2.callback === "function") {
@@ -253,7 +255,7 @@ var ReactiveView_default = {
253
255
  setup2.options = setup2.options.parent;
254
256
  setup2.$vue = setup2.$vue.$parent;
255
257
  }
256
- if (isRendered.value) {
258
+ if (rendered.value) {
257
259
  return access($vue).template($vue, { parent, self });
258
260
  }
259
261
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@razaman2/reactive-view",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "description": "This library enables you to build vue apps in an object oriented way. It provides a convenient approach to extend and override ui components. It provides a built in eventing system along with component data management.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",