@razaman2/reactive-view 0.1.0-beta.11 → 0.1.0-beta.13

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
@@ -177,7 +177,7 @@ var import_data_manager = __toESM(require("@razaman2/data-manager"));
177
177
  var import_vue = require("vue");
178
178
 
179
179
  // package.json
180
- var version = "0.1.0-beta.11";
180
+ var version = "0.1.0-beta.13";
181
181
  var package_default = {
182
182
  name: "@razaman2/reactive-view",
183
183
  version,
@@ -376,6 +376,9 @@ var ReactiveView_default = {
376
376
  };
377
377
  const model = props.model ? typeof props.model === "function" ? props.model(config) : props.model : import_data_manager.default.setConfig({ beforeGetData: (data) => (0, import_vue.isRef)(data) ? (0, import_vue.unref)(data) : data }, config);
378
378
  const component = (0, import_vue.ref)({ parent: { self: vue.proxy }, self: { template, diff, emit, dataPath: dataPath2, model: proxy(model), isValid } });
379
+ if (props.debug) {
380
+ console.warn(`[${props.modelName}]:data`, { props, context, component, config, model });
381
+ }
379
382
  if (context.attrs["onUpdate:model"] || context.attrs["update:model"]) {
380
383
  const config2 = {
381
384
  callback: typeof context.attrs["onUpdate:model"] === "function" ? context.attrs["onUpdate:model"] : context.attrs["update:model"],
@@ -397,13 +400,13 @@ var ReactiveView_default = {
397
400
  }, config2.options));
398
401
  }
399
402
  const track = (source, options = {}) => {
400
- var _a3, _b2, _c2, _d, _e;
403
+ var _a3, _b2, _c2, _d;
404
+ if (props.debug) {
405
+ console.log(`log props.data:`, source, options);
406
+ }
401
407
  subscriptions.push((0, import_vue.watch)(source, async (after, before) => {
402
408
  const diff2 = access(component).diff(import_object_manager.default.on(before), import_object_manager.default.on(after));
403
409
  const callback = context.attrs["data:callback"];
404
- if (props.debug) {
405
- console.warn(`[${props.modelName}]:data`, { diff: diff2, callback, before, after, props, context, component });
406
- }
407
410
  if (typeof callback === "function") {
408
411
  callback(diff2, { component });
409
412
  } else {
@@ -411,8 +414,8 @@ var ReactiveView_default = {
411
414
  }
412
415
  }, {
413
416
  immediate: (_b2 = (_a3 = context.attrs["data:immediate"]) != null ? _a3 : options.immediate) != null ? _b2 : true,
414
- deep: (_d = (_c2 = context.attrs["data:deep"]) != null ? _c2 : options.deep) != null ? _d : true,
415
- once: (_e = context.attrs["data:once"]) != null ? _e : options.once
417
+ deep: (_c2 = context.attrs["data:deep"]) != null ? _c2 : options.deep,
418
+ once: (_d = context.attrs["data:once"]) != null ? _d : options.once
416
419
  }));
417
420
  };
418
421
  setTimeout(async () => {
@@ -428,10 +431,7 @@ var ReactiveView_default = {
428
431
  ]) : [props.data];
429
432
  track(typeof data === "function" ? data : (() => data));
430
433
  } else {
431
- if (props.debug) {
432
- console.log(`log output:`, props, (0, import_vue.isRef)(props.data), (0, import_vue.isReactive)(props.data));
433
- }
434
- track((0, import_vue.isRef)(props.data) || (0, import_vue.isReactive)(props.data) ? props.data : () => props.data, { immediate: false, deep: false });
434
+ track((0, import_vue.isRef)(props.data) || (0, import_vue.isReactive)(props.data) ? props.data : () => props.data, { immediate: false });
435
435
  }
436
436
  }
437
437
  });
package/dist/index.mjs CHANGED
@@ -130,7 +130,7 @@ import DataManager from "@razaman2/data-manager";
130
130
  import { ref, reactive, watch, unref, isRef, isReactive, createVNode, getCurrentInstance, onBeforeUnmount } from "vue";
131
131
 
132
132
  // package.json
133
- var version = "0.1.0-beta.11";
133
+ var version = "0.1.0-beta.13";
134
134
  var package_default = {
135
135
  name: "@razaman2/reactive-view",
136
136
  version,
@@ -329,6 +329,9 @@ var ReactiveView_default = {
329
329
  };
330
330
  const model = props.model ? typeof props.model === "function" ? props.model(config) : props.model : DataManager.setConfig({ beforeGetData: (data) => isRef(data) ? unref(data) : data }, config);
331
331
  const component = ref({ parent: { self: vue.proxy }, self: { template, diff, emit, dataPath: dataPath2, model: proxy(model), isValid } });
332
+ if (props.debug) {
333
+ console.warn(`[${props.modelName}]:data`, { props, context, component, config, model });
334
+ }
332
335
  if (context.attrs["onUpdate:model"] || context.attrs["update:model"]) {
333
336
  const config2 = {
334
337
  callback: typeof context.attrs["onUpdate:model"] === "function" ? context.attrs["onUpdate:model"] : context.attrs["update:model"],
@@ -350,13 +353,13 @@ var ReactiveView_default = {
350
353
  }, config2.options));
351
354
  }
352
355
  const track = (source, options = {}) => {
353
- var _a3, _b2, _c2, _d, _e;
356
+ var _a3, _b2, _c2, _d;
357
+ if (props.debug) {
358
+ console.log(`log props.data:`, source, options);
359
+ }
354
360
  subscriptions.push(watch(source, async (after, before) => {
355
361
  const diff2 = access(component).diff(ObjectManager.on(before), ObjectManager.on(after));
356
362
  const callback = context.attrs["data:callback"];
357
- if (props.debug) {
358
- console.warn(`[${props.modelName}]:data`, { diff: diff2, callback, before, after, props, context, component });
359
- }
360
363
  if (typeof callback === "function") {
361
364
  callback(diff2, { component });
362
365
  } else {
@@ -364,8 +367,8 @@ var ReactiveView_default = {
364
367
  }
365
368
  }, {
366
369
  immediate: (_b2 = (_a3 = context.attrs["data:immediate"]) != null ? _a3 : options.immediate) != null ? _b2 : true,
367
- deep: (_d = (_c2 = context.attrs["data:deep"]) != null ? _c2 : options.deep) != null ? _d : true,
368
- once: (_e = context.attrs["data:once"]) != null ? _e : options.once
370
+ deep: (_c2 = context.attrs["data:deep"]) != null ? _c2 : options.deep,
371
+ once: (_d = context.attrs["data:once"]) != null ? _d : options.once
369
372
  }));
370
373
  };
371
374
  setTimeout(async () => {
@@ -381,10 +384,7 @@ var ReactiveView_default = {
381
384
  ]) : [props.data];
382
385
  track(typeof data === "function" ? data : (() => data));
383
386
  } else {
384
- if (props.debug) {
385
- console.log(`log output:`, props, isRef(props.data), isReactive(props.data));
386
- }
387
- track(isRef(props.data) || isReactive(props.data) ? props.data : () => props.data, { immediate: false, deep: false });
387
+ track(isRef(props.data) || isReactive(props.data) ? props.data : () => props.data, { immediate: false });
388
388
  }
389
389
  }
390
390
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@razaman2/reactive-view",
3
- "version": "0.1.0-beta.11",
3
+ "version": "0.1.0-beta.13",
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",